Resource allocation method, apparatus, device, storage medium, and program

By implementing a pre-defined cache page resource management and polling count allocation mechanism, the system addresses the issues of low resource utilization and fragmentation in high-concurrency scenarios. This ensures that high-priority tasks receive resources first, while low-priority tasks receive resources fairly, thereby improving system stability and resource utilization.

CN122285265APending Publication Date: 2026-06-26ZHONGKE TENGLONG INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHONGKE TENGLONG INFORMATION TECH CO LTD
Filing Date
2026-03-05
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In multitasking and high-concurrency application scenarios, when high-priority real-time response tasks and low-priority background tasks share limited memory resources, existing technologies result in low resource utilization and fragmentation issues.

Method used

By pre-setting cache page resource management, priority waiting queues are allocated according to the remaining status of resources and business type, and resource allocation is performed using polling count values ​​to ensure that high-priority tasks get resources first, and low-priority tasks get resources fairly according to their weights, thus avoiding resource fragmentation.

Benefits of technology

It improved system resource utilization, reduced fragmentation, enhanced system stability and service quality, and achieved efficient memory management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122285265A_ABST
    Figure CN122285265A_ABST
Patent Text Reader

Abstract

This application provides a resource allocation method, apparatus, device, storage medium, and program. The method includes: receiving a current resource request from a user device; determining a target waiting queue corresponding to a target priority from multiple request waiting queues based on the remaining resource status of preset cached page resources, the target service type of the current resource request, and the page request volume, and adding the current resource request to the target waiting queue; after the page resources of the preset cached page resources are released, obtaining at least one remaining polling count value from at least one remaining waiting queue in the multiple request waiting queues and the current polling count value of the target waiting queue; allocating page request volume to the current resource request in the target waiting queue based on the remaining polling count values ​​of each remaining waiting queue and the current polling count value of the target waiting queue, and updating the current polling count value corresponding to the target waiting queue. This method improves resource utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a resource allocation method, apparatus, device, storage medium, and program. Background Technology

[0002] In multitasking and high-concurrency application scenarios, high-priority real-time response tasks and low-priority background tasks need to share limited memory resources.

[0003] In existing technologies, page resource requests can be received, and memory can be allocated and released independently based on page resource requests. This leads to frequent system interface calls, increases the overhead of the central processing unit (CPU), and dynamically allocated memory blocks are prone to fragmentation problems (such as external and internal fragmentation) after long-term use, resulting in low resource utilization. Summary of the Invention

[0004] This application provides a resource allocation method, apparatus, device, storage medium, and program to solve the technical problem of low resource utilization.

[0005] Firstly, this application provides a resource allocation method, including:

[0006] Receive a current resource request from a user device. The current resource request is used to request page resources from a preset cached page resource. The current resource request includes the target service type, target priority, and page request quantity.

[0007] Based on the remaining resource status of the preset cache page resources, the target business type and page request volume of the current resource request, the target waiting queue corresponding to the target priority is determined from multiple request waiting queues, and the current resource request is added to the target waiting queue.

[0008] After the page resources of the preset cached page resources are released, at least one remaining polling count value of at least one remaining waiting queue in the plurality of request waiting queues and the current polling count value of the target waiting queue are obtained;

[0009] Based on the remaining polling count values ​​of each remaining waiting queue and the current polling count value of the target waiting queue, the page request quantity is allocated to the current resource request in the target waiting queue, and the current polling count value corresponding to the target waiting queue is updated.

[0010] In this embodiment, more efficient memory management can be achieved in high-concurrency scenarios, reducing resource fragmentation and improving overall resource utilization.

[0011] Optionally, based on the remaining resource status of the preset cached page resource, and the target business type and page request volume of the current resource request, a target waiting queue corresponding to the target priority is determined from multiple request waiting queues, including:

[0012] Based on the target priority corresponding to the current resource request, determine the number of remaining pages corresponding to the remaining state of the resource;

[0013] Determine whether the remaining number of pages of the preset cached page resource is less than the number of pages requested by the current resource request;

[0014] If so, then based on the target business type of the current resource request and the remaining number of pages of the preset cache page resource, determine the target waiting queue corresponding to the target priority from among the multiple request waiting queues.

[0015] In this embodiment, the priority access rights of high-priority services to resources are guaranteed, while basic available resources are reserved for low-priority services, thereby improving the reliability of resource allocation.

[0016] Optionally, based on the target priority corresponding to the current resource request, the number of remaining pages corresponding to the remaining state of the resource is determined, including:

[0017] Obtain the total visible page capacity corresponding to each preset priority among multiple preset priorities, and the total number of pages occupied by the preset cache page resources;

[0018] Among the total visible page capacity corresponding to each preset priority, determine the target total page capacity corresponding to the target priority;

[0019] The number of remaining pages is determined based on the difference between the target total page capacity and the total number of occupied pages.

[0020] In this embodiment, a hierarchical scheduling effect is achieved, where high-priority services are given priority in acquiring resources and low-priority services are not preempted from the core resource pool, thereby improving the fairness, stability, and overall resource utilization of the system resource allocation.

[0021] Optionally, based on the target service type of the current resource request and the remaining number of pages of the preset cached page resource, a target waiting queue corresponding to the target priority is determined from the plurality of request waiting queues, including:

[0022] Determine the minimum page threshold corresponding to the target business type, wherein the minimum page threshold is used to indicate the minimum total amount of page resources required for the normal operation of the target business type;

[0023] Obtain the number of pages already occupied by the target business type;

[0024] When the number of pages occupied by the service is greater than or equal to the minimum page threshold, the request waiting queue corresponding to the target priority is determined as the target waiting queue from among the multiple request waiting queues.

[0025] In this embodiment, the minimum page threshold and cache level are combined to ensure minimum resource availability for services, preventing services from exiting abnormally due to insufficient resources and improving system stability and resource allocation rationality.

[0026] Optionally, based on the remaining polling count values ​​of each remaining waiting queue and the current polling count value of the target waiting queue, the page request quantity is allocated to the current resource requests in the target waiting queue, including:

[0027] If the current polling count value of the target waiting queue is greater than the preset threshold, and the current polling count value is greater than the remaining polling count value of each remaining waiting queue, then page resource allocation processing is performed on each page resource request in the target waiting queue in turn until the current resource request is determined.

[0028] Based on the remaining resource status of the preset cached page resources, allocate the page request amount to the current resource request.

[0029] In this embodiment, high-priority services are guaranteed to receive more scheduling opportunities according to their weights, avoiding low-priority services from being unable to be processed due to resource shortages, thereby improving system resource utilization, concurrent processing capabilities, and long-term operational stability.

[0030] Optionally, based on the remaining resource status of the preset cached page resources, the page request quantity is allocated to the current resource request, including:

[0031] Determine whether the number of remaining pages in the remaining state of the resource is greater than or equal to the number of page requests;

[0032] If so, then if the total number of pages occupied in the remaining state of the resource is less than the preset maximum level, or if the total number of pages occupied in the remaining state of the resource is greater than or equal to the preset maximum level and the number of pages occupied by the service corresponding to the target service type is less than the minimum page threshold, then page request quantity is allocated to the current resource request.

[0033] In this embodiment, resource allocation satisfies business priority requirements, ensures overall system resource security, avoids business processes being left unprocessed due to resource shortages, and improves the accuracy, stability, and long-term operational efficiency of system resource allocation.

[0034] Optional, also includes:

[0035] When the remaining polling count value of each remaining waiting queue and the current polling count value of the target waiting queue are both preset thresholds, the remaining polling count value of each remaining waiting queue and the current polling count value of the target waiting queue are initialized.

[0036] Based on the remaining polling count values ​​of each remaining waiting queue after initialization and the current polling count value of the target waiting queue, the page request quantity is allocated to the current resource request in the target waiting queue.

[0037] In this embodiment, resources are fairly obtained for services of different priorities according to their weights, avoiding long-term unprocessed low-priority services and improving the fairness, efficiency and overall operational stability of system resource scheduling.

[0038] Optionally, allocating the page request quantity to the current resource requests in the target waiting queue includes:

[0039] Based on the remaining status of the resources, multiple consecutive page resource blocks are determined;

[0040] If among the plurality of consecutive page resource blocks, there is a target page resource block whose resource size is greater than the page request size, then the target page resource block is allocated resources corresponding to the page request size;

[0041] If none of the multiple consecutive page resource blocks contain a page resource block whose resource size is greater than the page request size, then multiple target page resource blocks are determined. The fragmented multiple target page resource blocks are mapped into a continuous logical address space through an address mapping mechanism. Based on the logical address space, the page request size is allocated to the current resource request.

[0042] In this embodiment, a balance is achieved between resource allocation efficiency and fragmentation control. Continuous resources are prioritized to ensure operational efficiency, while fragmented resources can be used to avoid waiting, thereby improving system resource utilization, business operation stability, and long-term scheduling efficiency.

[0043] Secondly, embodiments of this application provide a resource allocation apparatus, including a receiving module, a determining module, an acquiring module, an allocation module, and an updating module:

[0044] The receiving module is used to receive a current resource request from a user device. The current resource request is used to request page resources from a preset cached page resource. The current resource request includes the target service type, target priority, and page request quantity.

[0045] The determining module is used to determine the target waiting queue corresponding to the target priority from multiple request waiting queues based on the remaining resource status of the preset cache page resource, the target business type and page request volume of the current resource request, and add the current resource request to the target waiting queue.

[0046] The acquisition module is used to acquire, after the page resources of the preset cached page resources are released, at least one remaining polling count value of at least one remaining waiting queue in the plurality of request waiting queues and the current polling count value of the target waiting queue.

[0047] The allocation module is used to allocate the page request quantity to the current resource request in the target waiting queue based on the remaining polling count value of each remaining waiting queue and the current polling count value of the target waiting queue.

[0048] The update module is used to update the current polling count value corresponding to the target waiting queue.

[0049] Thirdly, embodiments of this application provide an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0050] The memory stores computer-executed instructions;

[0051] The processor executes computer execution instructions stored in the memory to implement the method as described in any of the second aspects.

[0052] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described in the second aspect.

[0053] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the second aspects.

[0054] The resource allocation method, apparatus, device, storage medium, and program provided in this application can avoid external fragmentation (such as unusable small blocks of free memory) and internal fragmentation (such as allocated memory blocks not being fully utilized) caused by dynamic allocation by pre-caching page resources. By using the target priority of the current resource request, it ensures that high-priority services obtain memory resources first when resources are scarce, while by polling the count value, it ensures that low-priority services can fairly obtain resource preemption opportunities according to their weights, preventing them from being completely unable to run due to insufficient resources. In high-concurrency scenarios, it can achieve more efficient memory management, reduce resource fragmentation, improve overall resource utilization, and balance the resource allocation needs of different priority services, preventing low-priority services from being unable to process due to resource preemption, thereby improving system stability and service quality. Attached Figure Description

[0055] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0056] Figure 1 A schematic diagram illustrating the application scenarios provided in the embodiments of this application;

[0057] Figure 2 A flowchart illustrating a resource allocation method provided in an embodiment of this application;

[0058] Figure 3 A schematic diagram of a preset cache page resource provided in an embodiment of this application;

[0059] Figure 4 A flowchart illustrating another resource allocation method provided in an embodiment of this application;

[0060] Figure 5 A schematic diagram of the architecture of a request processing method provided in an embodiment of this application;

[0061] Figure 6 A schematic diagram of the architecture of an alternative request processing method provided in an embodiment of this application;

[0062] Figure 7 This is a schematic diagram of the structure of a resource allocation device provided in an embodiment of this application;

[0063] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0064] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation

[0065] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0066] Figure 1 This is a schematic diagram illustrating an application scenario provided in an embodiment of this application. Please refer to [link / reference]. Figure 1 This technology is applicable to high-concurrency scenarios involving multi-task processing, which may include user device 101 and server 102. Server 102 can be a web service, a distributed computing framework, a real-time data processing system, etc. In these scenarios, server 102 needs to handle a large number of concurrent resource requests from user devices 101 (such as HTTP requests, database queries, video stream encoding, etc.) within a single process, and these requests typically rely on the dynamic allocation of memory resources.

[0067] For example, when server 102 is a web server, high-priority real-time response tasks (such as user login verification) and low-priority background tasks (such as log recording) need to share limited memory resources. Traditional management methods can easily lead to resource waste or uneven allocation.

[0068] In related technologies, page resource requests can be received, and memory can be independently allocated and released based on page resource requests. This leads to frequent system interface calls, increases the overhead of the central processing unit (CPU), and dynamically allocated memory blocks are prone to fragmentation problems (such as external and internal fragmentation) after long-term use, resulting in low resource utilization.

[0069] The resource allocation method provided in this application can receive a current resource request from a user device. The current resource request is used to request page resources from a preset cached page resource. The current resource request includes a target service type, a target priority, and a page request quantity. Based on the remaining resource status of the preset cached page resource, and the target service type and page request quantity of the current resource request, a target waiting queue corresponding to the target priority is determined from multiple request waiting queues, and the current resource request is added to the target waiting queue. After the page resources of the preset cached page resource are released, at least one remaining polling count value of at least one remaining waiting queue and the current polling count value of the target waiting queue are obtained from multiple request waiting queues. Based on the remaining polling count values ​​of each remaining waiting queue and the current polling count value of the target waiting queue, and provided that the remaining resource status of the preset cached page resource can cover the page request quantity of the current resource request, a page request quantity is allocated to the current resource request in the target waiting queue, and the current polling count value corresponding to the target waiting queue is updated.

[0070] During the above execution process, pre-cached page resources avoid external fragmentation (such as unusable small blocks of free memory) and internal fragmentation (such as allocated memory blocks not being fully utilized) caused by dynamic allocation. By using the target priority of current resource requests, high-priority services are ensured to acquire memory resources first when resources are scarce. Simultaneously, by polling the count value, low-priority services are guaranteed a fair and weighted opportunity to acquire resources, preventing them from becoming completely unable to run due to insufficient resources. In high-concurrency scenarios, this achieves more efficient memory management, reduces resource fragmentation, improves overall resource utilization, and balances the resource allocation needs of different priority services, preventing low-priority services from being unable to process due to resource preemption, thereby improving system stability and service quality.

[0071] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.

[0072] Figure 2 This is a flowchart illustrating a resource allocation method provided in an embodiment of this application. Please refer to [link / reference]. Figure 2 The method may include:

[0073] S201, Receive the current resource request from the user equipment.

[0074] The execution entity of this application embodiment can be a server or a resource allocation device set on the server. The resource allocation device can be implemented by software or by a combination of software and hardware.

[0075] The current resource request can be used to request page resources from the preset cached page resources. The current resource request can include the target business type, target priority, and page request quantity.

[0076] The default cache page resources are pre-allocated memory units of uniform size (i.e., cache pages), forming a contiguous memory region for centralized management, which can avoid fragmentation and CPU overhead caused by frequent independent allocation and release of memory.

[0077] For example, a preset cache page resource can consist of multiple standard cache pages of 4096 bytes, achieving efficient allocation and reclamation through a unified specification.

[0078] The target business type can be a real-time task (such as user login verification, order payment), a computing task (such as data statistical analysis, video encoding), or a background task (such as log archiving, data backup).

[0079] Target priority can be used to indicate the business scheduling priority corresponding to the current resource request, and to distinguish the urgency of resource allocation. For example, it includes high priority, medium priority, and low priority.

[0080] The page request count is the number of cached pages required for the target business corresponding to the current resource request, that is, the total number of standard cached pages required to complete this business request.

[0081] S202. Based on the remaining status of the preset cached page resources, the target business type and page request volume of the current resource request, determine the target waiting queue corresponding to the target priority among multiple request waiting queues, and add the current resource request to the target waiting queue.

[0082] The preset cached page resources include the total page capacity, the total number of occupied pages, and the number of remaining pages. The sum of the total number of occupied pages and the number of remaining pages is the total page capacity.

[0083] Multiple request waiting queues are each associated with a specific target priority; that is, one priority level corresponds to one independent request waiting queue. For example, if the target priorities are divided into high priority, medium priority, and low priority, then three request waiting queues are set up: a high-priority request waiting queue, a medium-priority request waiting queue, and a low-priority request waiting queue.

[0084] The target waiting queue is a first-in-first-out (FIFO) queue. This queue only stores resource requests that have not been allocated resources under the corresponding priority. The enqueue order of the queue strictly follows the order of the time the requests are received. The current resource request is added to the tail of the target waiting queue.

[0085] Meanwhile, each request waiting queue is associated with a polling counter, with the initial value of the counter preset according to the scheduling weight of each priority (e.g., high:medium:low = 3:2:1), which is used for fair polling allocation in subsequent scheduling phases.

[0086] In some embodiments, the number of remaining pages corresponding to the remaining state of the resource is determined according to the target priority corresponding to the current resource request; it is determined whether the number of remaining pages of the preset cached page resource is less than the number of pages requested by the current resource request; if so, the target waiting queue corresponding to the target priority is determined from multiple request waiting queues according to the target business type of the current resource request and the number of remaining pages of the preset cached page resource.

[0087] For current resource requests corresponding to different target priorities, there are differentiated limits on the total visible page capacity. Total visible page capacity = actual total page capacity × priority visibility ratio; remaining visible pages = total visible page capacity - number of pages already occupied by the service.

[0088] For example, high-priority current resource requests can access all resources (100% visibility), medium-priority requests have a visibility of 90%, and low-priority current resource requests can only access a preset percentage of the total page capacity (such as 60% of the actual total page capacity).

[0089] It is necessary to determine the total visible page capacity that each current resource request can access by using differentiated rules based on target priority, so as to avoid low-priority requests excessively consuming core resources.

[0090] Figure 3 This is a schematic diagram illustrating a preset cached page resource provided in an embodiment of this application. Please refer to [link / reference]. Figure 3 Service 1 has a higher priority than Service 2, and Service 2 has a higher priority than Service 3. Service 1 has a total visible page capacity equal to the actual total page capacity of the preset cached page resources; Service 2 has a visible total page capacity equal to 90% of the actual total page capacity of the preset cached page resources; and Service 3 has a visible total page capacity equal to 60% of the actual total page capacity of the preset cached page resources. Furthermore, when there are a total number of occupied pages in the preset cached page resources, Service 3 has 0 remaining pages, while Services 1 and 2 still have some remaining pages.

[0091] In this application, the number of remaining visible pages can be determined by the target priority of the current resource request, thereby realizing resource isolation and hierarchical scheduling for services with different priorities. This ensures that high-priority services have priority access to resources while reserving basic available resources for low-priority services, thus improving the reliability of resource allocation.

[0092] S203. After the page resources of the preset cached page resources are released, obtain at least one remaining polling count value of at least one remaining waiting queue in multiple request waiting queues and the current polling count value of the target waiting queue.

[0093] When the total number of occupied pages changes from N to NM (M≥1, where M is the number of pages released), and the number of remaining pages increases by M, it is determined that the preset cached page resources have been released. At the same time, page release operations include scenarios such as business actively returning allocated pages, automatic recycling of pages that have expired and not been used, and forced release of low-priority non-core business pages.

[0094] Multiple request waiting queues can include at least one remaining waiting queue and a target waiting queue. The remaining waiting queue refers to the queues that still have unprocessed resource requests, excluding the target waiting queue. If all non-target waiting queues have no pending requests, the remaining waiting queue is empty. The target waiting queue is the queue that is currently to be scheduled and matches the priority of the pending resource request.

[0095] Multiple request waiting queues are configured with their corresponding initial polling count values, which are the scheduling count quotas preset for different priority queues based on their weights.

[0096] The initial polling count is positively correlated with the queue priority (e.g., high priority queue initial polling count > medium priority > low priority), and the sum of the initial polling counts is a fixed value, ensuring that the number of times each queue is scheduled in each scheduling cycle is allocated according to its weight.

[0097] The polling count is initialized to the configured initial polling count. Each time a resource request for a corresponding queue is successfully scheduled, the polling count for that queue is decremented by 1. When the count reaches 0, the queue will not participate in scheduling for the current scheduling cycle.

[0098] For example, there are 3 request waiting queues: a high-priority request waiting queue, a medium-priority request waiting queue, and a low-priority request waiting queue. The priorities are high, medium, and low, respectively, and the corresponding initial polling count values ​​are 3, 2, and 1 (with a weight ratio of 3:2:1). That is, in each scheduling cycle, the high-priority queue can be scheduled a maximum of 3 times, the medium-priority queue a maximum of 2 times, and the low-priority queue a maximum of 1 time. After all the polling count values ​​of all queues are reduced to 0 in the current scheduling cycle, the polling count values ​​of each queue are re-initialized to start the next round of scheduling.

[0099] S204. Based on the remaining polling count value of each remaining waiting queue and the current polling count value of the target waiting queue, allocate page request quantity to the current resource request in the target waiting queue, and update the current polling count value corresponding to the target waiting queue.

[0100] In some embodiments, if the current polling count value of the target waiting queue is greater than the remaining polling count value of each remaining waiting queue, page resource allocation processing is performed on each page resource request in the target waiting queue in turn until the current resource request is determined; and the page request amount is allocated to the current resource request according to the resource remaining status of the preset cached page resources.

[0101] If there is a selected waiting queue among the remaining polling counts of each remaining waiting queue that is greater than the current polling count of the target waiting queue, or if there is a selected waiting queue among the remaining polling counts of each remaining waiting queue that has the same current polling count as the target waiting queue and a higher priority than the target priority of the target waiting queue, then the selected waiting queue is retrieved, and page resource allocation is performed on each page resource request in the selected waiting queue in a first-in-first-out (FIFO) order.

[0102] In this application, by using differentiated scheduling logic based on polling count values ​​and prioritizing the allocation of continuous page resource blocks, a balance can be achieved between fair scheduling of services with different priorities and efficiency of resource allocation. This ensures that high-priority services receive more scheduling opportunities according to their weights, while preventing low-priority services from being unable to be processed due to resource shortages. This can improve system resource utilization, concurrent processing capabilities, and long-term operational stability.

[0103] The resource allocation method provided in this application avoids external and internal fragmentation caused by dynamic allocation by pre-setting cached page resources. It ensures that high-priority services receive memory resources first when resources are scarce by using the target priority of current resource requests. Simultaneously, it guarantees that low-priority services can fairly obtain resource preemption opportunities according to their weights by polling the count value, preventing them from becoming completely unable to run due to insufficient resources. In high-concurrency scenarios, it achieves more efficient memory management, reduces resource fragmentation, and improves overall resource utilization. At the same time, it balances the resource allocation needs of different priority services, preventing low-priority services from being unable to process due to resource preemption, thereby improving system stability and service quality.

[0104] Figure 4 This is a flowchart illustrating another resource allocation method provided in an embodiment of this application. Please refer to... Figure 4 The method may include:

[0105] S401, Receive the current resource request from the user equipment.

[0106] The execution process of S401 can be found in the execution process of S201, and will not be repeated here.

[0107] S402. Determine the number of remaining pages corresponding to the remaining state of the resource based on the target priority corresponding to the current resource request.

[0108] Specifically, it can obtain the total visible page capacity corresponding to each preset priority among multiple preset priorities, as well as the total number of pages occupied by preset cache page resources; determine the target total page capacity corresponding to the target priority from the total visible page capacity corresponding to each preset priority; and determine the remaining number of pages based on the difference between the target total page capacity and the total number of pages occupied.

[0109] If the difference between the target total page capacity and the total number of occupied pages is negative, then the number of remaining pages is 0.

[0110] For example, multiple preset priorities are high, medium, and low. Assuming the target priority corresponding to the current resource request is medium, the total visible page capacity that can be called is 80% of the actual total page capacity of the preset cache page resources, and the total number of pages occupied by the preset cache page resources is 60% of the actual total page capacity, then the remaining page capacity corresponding to the remaining state of the resource is 20% of the actual total page capacity.

[0111] In this application, by setting differentiated total visible page capacity for services of different priorities, the system resource pool can be hierarchically isolated, thereby achieving a hierarchical scheduling effect where high-priority services obtain resources first and low-priority services do not preempt the core resource pool, thus improving the fairness, stability and overall resource utilization of system resource allocation.

[0112] S403. Determine whether the remaining number of pages of the preset cached page resource is less than the number of pages requested by the current resource request.

[0113] If not, that is, when the number of remaining pages in the preset cached page resources is greater than or equal to the number of pages requested by the current resource request, the number of pages requested can be directly provided to the current resource request.

[0114] If so, that is, when the number of remaining pages of the preset cached page resources is less than the number of pages requested by the current resource request, the number of remaining pages cannot satisfy the number of pages requested by this resource request, and step S404 is executed.

[0115] S404. Based on the target business type of the current resource request and the remaining number of pages of the preset cached page resources, determine the target waiting queue corresponding to the target priority among multiple request waiting queues.

[0116] Each business type also has a minimum page threshold, which can be used to indicate the minimum total amount of page resources required for the target business type to operate normally.

[0117] It can statistically analyze and maintain a ledger of page usage for each business type in real time. When there is insufficient resources or excessive cache level, it can proactively locate and identify the business type that is consuming too many page resources.

[0118] Specifically, determine the minimum page threshold corresponding to the target business type and obtain the number of pages already occupied by the business for the target business type; when the number of pages already occupied by the business is greater than or equal to the minimum page threshold, determine the request waiting queue corresponding to the target priority as the target waiting queue from multiple request waiting queues.

[0119] When the number of pages already occupied by a business is less than the minimum page threshold, the business resource guarantee mechanism is triggered, and page resources are directly allocated to the current resource request.

[0120] In this application, the minimum page threshold and cache level can be combined to ensure minimum resource availability for business operations, prevent abnormal business exits due to insufficient resources, and improve system stability and the rationality of resource allocation.

[0121] S405. Add the current resource request to the target waiting queue.

[0122] Figure 5 This is a schematic diagram illustrating the architecture of a request processing method provided in an embodiment of this application. Please refer to [link / reference]. Figure 5 The system receives the current resource request from the user device and extracts key parameters such as the target business type, preset priority, and page request volume. It determines whether the remaining number of pages is less than the current resource request volume. If not, it determines that current resources are sufficient, enters the resource application success phase, allocates page resources to the business, and updates the system resource usage status (total number of pages occupied by preset cached page resources, and the number of pages already occupied by each business type). The process then ends.

[0123] If so, the system determines that current resources are insufficient and proceeds to the next verification step to check if the number of pages already occupied by the target business type is less than the minimum page threshold. If so, the resource guarantee mechanism is triggered, determining that the current business's resource usage has not yet reached its minimum guarantee amount, and the system proceeds to the resource application success stage, allocating page resources to the business and updating the system resource usage status, ending the process. If not, the system determines that the current business's resource usage has met the minimum guarantee, the current application is rejected, and the system proceeds to the resource application failure stage, adding the application request to the corresponding priority waiting queue according to the business priority, ending the process.

[0124] S406. After the page resources of the preset cached page resources are released, obtain at least one remaining polling count value of at least one remaining waiting queue in multiple request waiting queues and the current polling count value of the target waiting queue.

[0125] The execution process of S406 can be found in the execution process of S203, and will not be repeated here.

[0126] S407. If the current polling count value of the target waiting queue is greater than the preset threshold and the current polling count value is greater than the remaining polling count value of each remaining waiting queue, page resource allocation processing is performed on each page resource request in the target waiting queue in turn until the current resource request is determined.

[0127] For example, if the current polling count of the target waiting queue is 2, and the remaining polling count of each remaining waiting queue is 1, then the target waiting queue is the priority queue. The target waiting queue includes two page resource requests: a historical resource request and a current resource request. Since the historical resource request entered the queue earlier than the current resource request, the historical resource request is allocated resources first, and then the current resource request is allocated resources.

[0128] In addition, when the current polling count of the target waiting queue is greater than a preset threshold and is the same as the remaining polling count of any remaining waiting queue, the corresponding waiting queue with higher target priority is determined as the queue to be processed first.

[0129] For example, the target waiting queue is a medium-priority request waiting queue, and the other two remaining waiting queues are a high-priority request waiting queue and a low-priority request waiting queue. When the polling count value of the medium-priority request waiting queue and the polling count value of the high-priority request waiting queue are both 2 (and both are > 0), the resource allocation of the high-priority request waiting queue is processed first.

[0130] In some embodiments, when the remaining polling count value of each remaining waiting queue and the current polling count value of the target waiting queue are both preset thresholds, the remaining polling count value of each remaining waiting queue and the current polling count value of the target waiting queue are initialized; based on the initialized remaining polling count value of each remaining waiting queue and the current polling count value of the target waiting queue, the page request quantity is allocated to the current resource request in the target waiting queue.

[0131] The preset threshold is 0. When the remaining polling count of each remaining waiting queue and the current polling count of the target waiting queue are both 0, it means that the current scheduling cycle has ended, and all priority queues have exhausted their scheduling quotas in this round and can no longer compete for resources.

[0132] The initialization process updates the polling count value of each request waiting queue to the initial polling count value. The initial polling count value is bound to the queue priority and is fixedly allocated according to the preset scheduling weight. The initial polling count values ​​of queues with different priorities do not interfere with each other or preempt each other.

[0133] The initial polling count of the high-priority queue is greater than that of the medium-priority queue, which is greater than that of the low-priority queue. This weight ratio is strictly restored in each initialization, so that the same priority quota mechanism is repeatedly followed in each scheduling cycle.

[0134] For example, the polling counts for the high, medium, and low priority request waiting queues are 3, 2, and 1, respectively. The initialization process forces the polling count of each queue to be reset to the fixed weight value of that group. After a complete polling cycle, the high priority queue can get a maximum of 3 scheduling opportunities, the medium priority queue a maximum of 2, and the low priority queue a maximum of 1, ensuring that scheduling resources are allocated according to weight. Each initialization reassigns a fixed scheduling quota to the low priority queue, ensuring that it will have an executable number of scheduling opportunities in each round.

[0135] The initialization process periodically resets the polling count value to ensure that the weighting mechanism does not fail due to a single resource shortage. Even if high-priority services occupy a lot of resources in the previous round of scheduling, low-priority services can still obtain the preset quota after the next round of initialization, thus preventing long-term starvation from the mechanism.

[0136] Meanwhile, the fixed-weight initialization method avoids frequent changes in scheduling logic, making the system resource allocation behavior predictable and reproducible, and reducing jitter and abnormal preemption.

[0137] In this application, by scheduling based on polling count priority and business priority, it is possible to ensure that businesses of different priorities obtain scheduling opportunities fairly and stably according to their weights at the implementation level, while avoiding long-term starvation of low-priority businesses, thereby improving the fairness, efficiency and overall operational stability of system resource scheduling.

[0138] S408. Allocate page request quantity to the current resource request based on the remaining resource status of the preset cached page resources.

[0139] Specifically, determine whether the number of remaining pages in the remaining state of the resource is greater than or equal to the number of page requests; if so, allocate the number of page requests to the current resource request if the total number of occupied pages in the remaining state of the resource is less than the preset maximum water level, or if the total number of occupied pages in the remaining state of the resource is greater than or equal to the preset maximum water level and the number of occupied pages for the target business type is less than the minimum page threshold.

[0140] If the conditions are not met, the current polling count value corresponding to the target waiting queue is decremented by 1, the current allocation is skipped, and the next request is scheduled.

[0141] In some embodiments, to proactively prevent the risk of resource exhaustion, the system starts a background timer after the process starts to periodically monitor the total number of pages occupied by the preset cache page resources. When the total number of pages occupied is detected to reach or exceed the preset maximum level, the system proactively sends a resource reclamation notification to each business module, triggering non-core and low-priority businesses to release the occupied page resources, thereby proactively reducing the cache level and reserving resource space for core businesses.

[0142] In this application, by using the remaining number of pages, cache level, and minimum page threshold, resource allocation can meet business priority requirements, ensure the overall resource security of the system, and prevent core business processes from remaining unprocessed for extended periods due to resource constraints, thereby improving the accuracy, stability, and long-term operational efficiency of system resource allocation.

[0143] In some embodiments, multiple consecutive page resource blocks are determined based on the remaining resource status; if among the multiple consecutive page resource blocks there is a target page resource block whose resource size is greater than the page request size, then the target page resource block is allocated resources corresponding to the page request size.

[0144] When allocating page request volume to the current resource request, the page request volume can be allocated to the current resource request within the continuous page resource blocks according to the distribution of continuous page resource blocks, so as to ensure the continuity of resource allocation and reduce fragmentation.

[0145] If none of the multiple consecutive page resource blocks contain a page resource block whose size is greater than the page request size, then multiple target page resource blocks are identified. Through an address mapping mechanism, the fragmented multiple target page resource blocks are mapped into a contiguous logical address space, and the page request size is allocated to the current resource request based on the logical address space.

[0146] The address mapping mechanism virtually maps scattered, fragmented pages into a continuous logical address space, ensuring that the business layer does not need to be aware of the fragmentation of physical addresses.

[0147] In some embodiments, after consecutive page resource blocks are released from a page, they can be formed by detecting and merging adjacent free pages using a merging algorithm.

[0148] By using a merging algorithm, multiple adjacent small free blocks are merged to form a continuous page resource block that meets the requirements before allocation, thus reducing external fragmentation issues.

[0149] Merging algorithms can employ greedy algorithms or graph traversal algorithms to merge adjacent free pages into contiguous blocks.

[0150] In this application, a balance between resource allocation efficiency and fragmentation control can be achieved through continuous page priority allocation and fragmented emergency allocation. Continuous resources can be prioritized to ensure operational efficiency, while fragmented resources can be used to avoid waiting, thereby improving system resource utilization, business operation stability, and long-term scheduling efficiency.

[0151] S409. Update the current polling count value corresponding to the target waiting queue.

[0152] If the current resource request is successfully allocated, the current polling count value of the target waiting queue is decremented by 1. After the update, it is necessary to check whether the count value is ≥0 (if it is negative after decrementing by 1, it is uniformly corrected to 0). At the same time, the scheduling time, the number of pages allocated, the business type and other information are recorded in the system scheduling ledger to facilitate subsequent resource monitoring and weight adjustment.

[0153] If the current resource request fails to be allocated, the current polling count value of the target waiting queue remains unchanged, and the current resource request remains at the head of the target waiting queue until the allocation conditions are re-verified in the next scheduling cycle.

[0154] If allocation fails three times in a row, a dynamic priority adjustment mechanism can be triggered to fine-tune its priority based on the real-time load status of the service (such as CPU utilization and task queue length) to avoid long-term allocation failure.

[0155] In addition, after updating the polling count, it is necessary to determine whether the current polling count of the target waiting queue is 0. If it is 0, it is marked that the queue has no remaining scheduling times in the current scheduling cycle, and the priority scheduling right of the queue is suspended until the polling count of all queues is 0, after which global initialization is triggered. If it is not 0, the scheduling qualification of the queue is retained, and it will continue to participate in the scheduling sorting after the next page resource is released.

[0156] In this application, by updating the polling count value differently and verifying the status after scheduling, the scheduling opportunities are fairly allocated according to weight, and the abnormal scenarios of allocation failure can be flexibly adapted, thereby improving the robustness of the system scheduling logic and the flexibility of resource allocation.

[0157] The resource allocation method provided in this application embodiment can receive the current resource request from the user device, extract the target service type, preset priority, and page request volume, and first determine the number of remaining pages that can be accessed based on the target priority corresponding to the current resource request. When the number of remaining pages of the preset cached page resources is less than the page request volume of the current resource request, if the number of pages occupied by the service has not reached the minimum threshold, a guarantee mechanism is triggered to directly allocate resources. If the threshold has been reached, the current resource request is added to the target waiting queue corresponding to the target priority. After the page resources of the preset cached page resources are released, the polling count value of each request waiting queue is obtained. The priority scheduling queue is determined by the priority of the polling count value and the service priority, and the resource requests in the queue are checked in the first-in-first-out order. During allocation, priority is given to allocating from continuous page resource blocks to reduce fragmentation. If there are not enough continuous blocks, fragmented virtual mapping is used for allocation. At the same time, the polling count value of the target waiting queue is updated differentially according to the resource allocation result.

[0158] By prioritizing and isolating visible resources, high-priority services are guaranteed access to resources first, while low-priority services are prevented from preempting the resource pool. Combining minimum page thresholds and cache levels ensures the minimum resource requirements for each service type, preventing services from crashing due to insufficient resources. Prioritizing continuous page allocation effectively reduces memory fragmentation, while a weighted round-robin scheduling mechanism prevents low-priority services from experiencing prolonged starvation. This improves system resource utilization and service stability.

[0159] Figure 6 This is a schematic diagram illustrating the architecture of an alternative request processing method provided in an embodiment of this application. Please refer to [link / reference]. Figure 6 After the page resources in the preset cache are released, the scheduling process begins. It checks if each request waiting queue is empty. If yes, all requests have been processed, and the scheduling process ends. If not, it checks if the polling counters for each request waiting queue are all 0. If yes, the current scheduling cycle ends, the polling counters are initialized, and each queue is reassigned according to preset weights. Then, it returns to check if each request waiting queue is empty. If not, it determines the target waiting queue for priority scheduling based on the polling counter priority and the business priority.

[0160] The system checks if the remaining number of pages exceeds the number of page requests. If not, resources are insufficient, and the polling count of the target waiting queue is decremented by 1. It then returns to check if each request waiting queue is empty. If so, it checks if the preset maximum water level is met and if the number of pages already occupied by the service is less than the minimum page threshold. If not, the allocation conditions are not met, and the polling count of the target waiting queue is decremented by 1. It then returns to check if each request waiting queue is empty. If so, the allocation conditions are met, and the system executes dequeue success, service activation, count decrement, and allocates page resources to the request.

[0161] The system checks if the requests in the waiting queue have been processed. If not, it returns to check if each request's waiting queue is empty and continues scheduling the next request. If so, all requests have been processed, and the scheduling process ends.

[0162] Figure 7 This is a schematic diagram of a resource allocation device provided in an embodiment of this application. Please refer to... Figure 7 The resource allocation device 700 may include a receiving module 701, a determining module 702, an acquiring module 703, an allocation module 704, and an updating module 705.

[0163] The receiving module 701 is used to receive the current resource request of the user equipment. The current resource request is used to request page resources from the preset cached page resources. The current resource request includes the target service type, target priority and page request quantity.

[0164] The determination module 702 is used to determine the target waiting queue corresponding to the target priority from multiple request waiting queues based on the remaining status of the preset cached page resources, the target business type and page request volume of the current resource request, and add the current resource request to the target waiting queue.

[0165] The acquisition module 703 is used to acquire, after the page resources of the preset cached page resources are released, at least one remaining polling count value of at least one remaining waiting queue in multiple request waiting queues and the current polling count value of the target waiting queue.

[0166] The allocation module 704 is used to allocate page request quantity to the current resource request in the target waiting queue based on the remaining polling count value of each remaining waiting queue and the current polling count value of the target waiting queue;

[0167] The update module 705 is used to update the current polling count value corresponding to the target waiting queue.

[0168] Optionally, module 702 is specifically used for:

[0169] The number of remaining pages corresponding to the remaining state of the resource is determined based on the target priority of the current resource request.

[0170] Determine whether the number of remaining pages of the preset cached page resources is less than the number of pages requested for the current resource;

[0171] If so, then based on the target business type of the current resource request and the remaining number of pages of the preset cached page resources, determine the target waiting queue corresponding to the target priority from multiple request waiting queues.

[0172] Optionally, module 702 is specifically used for:

[0173] Get the total visible page capacity corresponding to each preset priority among multiple preset priorities, and the total number of pages occupied by preset cache page resources;

[0174] Within the total visible page capacity corresponding to each preset priority, determine the target total page capacity corresponding to the target priority;

[0175] The number of remaining pages is determined based on the difference between the target total page capacity and the total number of pages occupied.

[0176] Optionally, module 702 is specifically used for:

[0177] Determine the minimum page threshold corresponding to the target business type. The minimum page threshold is used to indicate the minimum total amount of page resources required for the target business type to operate normally.

[0178] Get the number of pages already occupied by the target business type;

[0179] When the number of pages occupied by the business is greater than or equal to the minimum page threshold, the request waiting queue corresponding to the target priority is determined as the target waiting queue from among multiple request waiting queues.

[0180] Optionally, the allocation module 704 is specifically used for:

[0181] If the current polling count value of the target waiting queue is greater than the preset threshold, and the current polling count value is greater than the remaining polling count value of each remaining waiting queue, then page resource allocation processing is performed on each page resource request in the target waiting queue in turn until the current resource request is determined.

[0182] Based on the remaining resource status of the preset cached page resources, allocate page request volume to the current resource request.

[0183] Optionally, the allocation module 704 is specifically used for:

[0184] Determine whether the number of remaining pages in the resource remaining status is greater than or equal to the number of page requests;

[0185] If so, then if the total number of pages occupied in the remaining state of resources is less than the preset maximum water level, or if the total number of pages occupied in the remaining state of resources is greater than or equal to the preset maximum water level and the number of pages occupied by the business corresponding to the target business type is less than the minimum page threshold, then the page request quantity will be allocated to the current resource request.

[0186] Optionally, the allocation module 704 is also used for:

[0187] When the remaining polling count value of each remaining waiting queue and the current polling count value of the target waiting queue are both preset thresholds, the remaining polling count value of each remaining waiting queue and the current polling count value of the target waiting queue are initialized.

[0188] Based on the remaining polling counts of each remaining waiting queue after initialization and the current polling count of the target waiting queue, allocate page request volume to the current resource request in the target waiting queue.

[0189] Optionally, the allocation module 704 is also used for:

[0190] Based on the remaining resource status, determine multiple consecutive page resource blocks;

[0191] If among multiple consecutive page resource blocks, there is a target page resource block whose resource size is greater than the page request size, then the target page resource block is allocated resources corresponding to the page request size;

[0192] If none of the multiple consecutive page resource blocks contain a page resource block whose size is greater than the page request size, then multiple target page resource blocks are determined. The fragmented multiple target page resource blocks are mapped into a contiguous logical address space through an address mapping mechanism, and the page request size is allocated to the current resource request based on the logical address space.

[0193] The resource allocation device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0194] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Please refer to... Figure 8 The electronic device 800 may include a processor 801 and a memory 802 communicatively connected to the processor 801. Exemplarily, the processor 801 and the memory 802 are interconnected via a bus 803.

[0195] The 802 memory stores instructions executed by the computer;

[0196] The processor 801 executes computer execution instructions stored in the memory 802, causing the processor 801 to perform the resource allocation method as shown in the above method embodiment.

[0197] Accordingly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the resource allocation method of the above-described method embodiments.

[0198] Accordingly, embodiments of this application may also provide a computer program product, including a computer program, which, when executed by a processor, can implement the resource allocation method shown in the above method embodiments.

[0199] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0200] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0201] It should be further noted that although the steps in the flowchart 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 flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0202] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.

[0203] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.

[0204] When integrated units / modules are implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Unless otherwise specified, the storage unit can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc.

[0205] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0206] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.

[0207] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0208] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A resource allocation method, characterized in that, include: Receive a current resource request from a user device. The current resource request is used to request page resources from a preset cached page resource. The current resource request includes the target service type, target priority, and page request quantity. Based on the remaining resource status of the preset cache page resources, the target business type and page request volume of the current resource request, the target waiting queue corresponding to the target priority is determined from multiple request waiting queues, and the current resource request is added to the target waiting queue. After the page resources of the preset cached page resources are released, at least one remaining polling count value of at least one remaining waiting queue in the plurality of request waiting queues and the current polling count value of the target waiting queue are obtained; Based on the remaining polling count values ​​of each remaining waiting queue and the current polling count value of the target waiting queue, the page request quantity is allocated to the current resource request in the target waiting queue, and the current polling count value corresponding to the target waiting queue is updated.

2. The method according to claim 1, characterized in that, Based on the remaining resource status of the preset cached page resources, and the target business type and page request volume of the current resource request, the target waiting queue corresponding to the target priority is determined from multiple request waiting queues, including: Based on the target priority corresponding to the current resource request, determine the number of remaining pages corresponding to the remaining state of the resource; Determine whether the remaining number of pages of the preset cached page resource is less than the number of pages requested by the current resource request; If so, then based on the target business type of the current resource request and the remaining number of pages of the preset cache page resource, determine the target waiting queue corresponding to the target priority from among the multiple request waiting queues.

3. The method according to claim 2, characterized in that, Based on the target priority corresponding to the current resource request, determine the number of remaining pages corresponding to the remaining state of the resource, including: Obtain the total visible page capacity corresponding to each preset priority among multiple preset priorities, and the total number of pages occupied by the preset cache page resources; Among the total visible page capacity corresponding to each preset priority, determine the target total page capacity corresponding to the target priority; The number of remaining pages is determined based on the difference between the target total page capacity and the total number of occupied pages.

4. The method according to claim 2, characterized in that, Based on the target service type of the current resource request and the remaining number of pages of the preset cached page resource, the target waiting queue corresponding to the target priority is determined from the plurality of request waiting queues, including: Determine the minimum page threshold corresponding to the target business type, wherein the minimum page threshold is used to indicate the minimum total amount of page resources required for the normal operation of the target business type; Obtain the number of pages already occupied by the target business type; When the number of pages occupied by the service is greater than or equal to the minimum page threshold, the request waiting queue corresponding to the target priority is determined as the target waiting queue from among the multiple request waiting queues.

5. The method according to claim 1, characterized in that, Based on the remaining polling count values ​​of each remaining waiting queue and the current polling count value of the target waiting queue, the page request quantity is allocated to the current resource requests in the target waiting queue, including: If the current polling count value of the target waiting queue is greater than the preset threshold, and the current polling count value is greater than the remaining polling count value of each remaining waiting queue, then page resource allocation processing is performed on each page resource request in the target waiting queue in turn until the current resource request is determined. Based on the remaining resource status of the preset cached page resources, allocate the page request amount to the current resource request.

6. The method according to claim 5, characterized in that, Based on the remaining resource status of the preset cached page resources, allocate the page request amount to the current resource request, including: Determine whether the number of remaining pages in the remaining state of the resource is greater than or equal to the number of page requests; If so, then if the total number of pages occupied in the remaining state of the resource is less than the preset maximum level, or if the total number of pages occupied in the remaining state of the resource is greater than or equal to the preset maximum level and the number of pages occupied by the service corresponding to the target service type is less than the minimum page threshold, then the page request amount is allocated to the current resource request.

7. The method according to claim 5, characterized in that, Also includes: When the remaining polling count value of each remaining waiting queue and the current polling count value of the target waiting queue are both preset thresholds, the remaining polling count value of each remaining waiting queue and the current polling count value of the target waiting queue are initialized. Based on the remaining polling count values ​​of each remaining waiting queue after initialization and the current polling count value of the target waiting queue, the page request quantity is allocated to the current resource request in the target waiting queue.

8. The method according to claim 1 or 6, characterized in that, Allocating the page request quantity to the current resource requests in the target waiting queue includes: Based on the remaining status of the resources, multiple consecutive page resource blocks are determined; If among the plurality of consecutive page resource blocks, there is a target page resource block whose resource size is greater than the page request size, then the target page resource block is allocated resources corresponding to the page request size; If none of the multiple consecutive page resource blocks contain a page resource block whose resource size is greater than the page request size, then multiple target page resource blocks are determined. The fragmented multiple target page resource blocks are mapped into a continuous logical address space through an address mapping mechanism. Based on the logical address space, the page request size is allocated to the current resource request.

9. A resource allocation device, characterized in that, It includes a receiving module, a determining module, an acquiring module, an allocating module, and an updating module: The receiving module is used to receive a current resource request from a user device. The current resource request is used to request page resources from a preset cached page resource. The current resource request includes the target service type, target priority, and page request quantity. The determining module is used to determine the target waiting queue corresponding to the target priority from multiple request waiting queues based on the remaining resource status of the preset cache page resource, the target business type and page request volume of the current resource request, and add the current resource request to the target waiting queue. The acquisition module is used to acquire, after the page resources of the preset cached page resources are released, at least one remaining polling count value of at least one remaining waiting queue in the plurality of request waiting queues and the current polling count value of the target waiting queue. The allocation module is used to allocate the page request quantity to the current resource request in the target waiting queue based on the remaining polling count value of each remaining waiting queue and the current polling count value of the target waiting queue. The update module is used to update the current polling count value corresponding to the target waiting queue.

10. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed by a processor, are used to implement the method described in any one of claims 1-8.

12. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-8.