Resource allocation method and apparatus, electronic device, and computer storage medium

By dynamically adjusting resource allocation priority through real-time updates of dual variables, the problem of unstable resource allocation in non-stationary traffic scenarios in existing technologies is solved. Stable allocation and constraint satisfaction are achieved under different traffic scenarios, improving the applicability and efficiency of the system.

CN123032018APending Publication Date: 2026-11-03ZHEJIANG TMALL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610914334.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-23
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing resource allocation methods, when faced with non-stationary traffic scenarios, suffer from problems such as high cold start costs, optimizer instability, and tight delay budgets, due to static dual variables causing resource allocation results to fail to meet constraints.

Method used

By employing real-time updated dual variables, resource allocation priorities are dynamically adjusted by determining the dual variables of the current request cycle, enabling batch-level updates of dual variables and ensuring stable resource allocation in both stable and unstable traffic scenarios.

Benefits of technology

It achieves stable resource allocation under different traffic scenarios, meets the constraint objectives, improves the applicability and practicality of the resource allocation method, and reduces system operating costs and optimizer instability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123032018A_ABST
    Figure CN123032018A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a resource allocation method and device, electronic equipment and computer storage medium. The resource allocation method comprises: in response to the obtained search request, determining a plurality of search results corresponding to the search request; determining a dual variable of a current request period, the dual variable being used to determine the resource allocation priority of the plurality of search results in the current request period, and the dual variable being updated as the request period changes; determining the resource allocation priority corresponding to each of the plurality of search results in the current request period based on the dual variable; and performing resource allocation on the plurality of search results based on the resource allocation priority to determine at least one target search result. In the embodiments, the dual variable can be updated as the request period changes, i.e. the update granularity of the dual variable is determined as a batch level, and then the resource allocation operation can be performed based on the dual variable, which can ensure the stability and reliability of the resource allocation operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the booming development of the internet economy, large-scale e-commerce platforms have become important hubs for commodity circulation and consumption. In daily operations and various large-scale promotional activities, platforms face the need to handle high concurrency of massive user requests. In order to maximize platform revenue and meet diverse application goals, the system needs to select one or more solutions in real time from multiple candidate solutions (such as different product recommendation lists, ad placement combinations, or marketing strategies) corresponding to each user request. This process is essentially a complex online constrained resource allocation problem.

[0003] In order to meet the target constraints of the online resource allocation problem, the dual theory method is usually used to implement resource allocation operations. The dual theory mentioned above often uses static dual variables for resource allocation operations. The static dual variables can be determined by offline analysis based on historical data. Since the static dual variables are usually fixed values, they are suitable for relatively stable traffic scenarios.

[0004] However, in scenarios with non-stationary traffic, where traffic fluctuates significantly in a short period of time, using static dual variables for resource allocation may result in resource allocation that fails to meet constraints. Summary of the Invention

[0005] This application provides a resource allocation method, apparatus, electronic device, and computer storage medium that can utilize real-time updated dual variables to perform resource allocation operations, which helps ensure that resource allocation operations can meet constraint objectives.

[0006] This invention provides a resource allocation method, including: In response to the obtained search request, determine multiple search results corresponding to the search request; Determine the dual variable for the current request period, the dual variable being used to determine the resource allocation priority of multiple search results in the current request period, and the dual variable being updated as the request period changes; Based on the dual variables, determine the resource allocation priorities corresponding to the multiple search results in the current request period; Based on the resource allocation priority, resources are allocated to the multiple search results to determine at least one target search result.

[0007] This invention provides a resource allocation device, comprising: The first acquisition module is used to determine multiple search results corresponding to the acquired search request in response to the search request. The first determining module is used to determine the dual variable of the current request period. The dual variable is used to determine the resource allocation priority of multiple search results in the current request period. The dual variable is updated as the request period changes. The first determining module is further configured to determine, based on the dual variable, the resource allocation priority corresponding to the multiple search results in the current request period; The first processing module is further configured to allocate resources to the plurality of search results based on the resource allocation priority, and determine at least one target search result.

[0008] This invention provides an electronic device, including: a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the above-described method.

[0009] This invention provides a computer storage medium for storing a computer program that enables a computer to implement the above-described method when executed.

[0010] This invention provides a computer program product, including: a computer-readable storage medium storing computer instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the method described above.

[0011] The resource allocation method, apparatus, electronic device, and computer storage medium provided in this embodiment, in response to an acquired search request, determine the dual variable of the current request period by identifying multiple search results corresponding to the search request, and then determine the resource allocation priority corresponding to each of the multiple search results in the current request period based on the dual variable. Resource allocation is then performed on the multiple search results based on the resource allocation priority, thereby stably determining at least one target search result. Since the dual variable can be updated with changes in the request period (for example, if the request processing interval for each batch is approximately 5 seconds, the dual variable can be updated within 5 seconds), effectively realizing the batch-level determination of the update granularity of the dual variable. This allows for stable resource allocation operations in both stable and unstable traffic scenarios, ensuring that the resource allocation result meets the constraints corresponding to the search request, thus improving the applicability and practicality of the resource allocation method. Attached Figure Description

[0012] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A schematic diagram illustrating a resource allocation method provided for an exemplary embodiment of this application; Figure 2 A flowchart illustrating a resource allocation method provided for an exemplary embodiment of this application; Figure 3 A schematic diagram of a process for determining the resource allocation priority corresponding to multiple search results in the current request period, provided as an exemplary embodiment of this application; Figure 4 A flowchart illustrating another resource allocation method provided for an exemplary embodiment of this application; Figure 5 A flowchart illustrating yet another resource allocation method provided for an exemplary embodiment of this application; Figure 6 A flowchart illustrating the determination of the dual variable of the current request period, provided for an exemplary embodiment of this application; Figure 7 A schematic diagram illustrating the principle of a resource allocation method provided in an exemplary application embodiment of this application; Figure 8 A schematic diagram of the structure of a resource allocation device provided for an exemplary embodiment of this application; Figure 9 A schematic diagram of the structure of an electronic device provided for an exemplary embodiment of this application. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0014] It should be noted that, in the cases involving user information in the embodiments of this application, 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, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to language models or large models) comply with relevant laws and standards.

[0015] Additionally, it should be noted that when user interaction operations or triggering operations are involved in the embodiments of this application, these operations include, but are not limited to, various interaction methods such as touch operations, gesture operations, voice operations, head movement operations, and eye movement operations. Touch operations include, but are not limited to, click operations, double-click operations, long-press operations, swipe operations, pinch operations, or mouse hover operations. Swipe operations include, but are not limited to, straight-line swipes and curved-line swipes.

[0016] To facilitate understanding of the resource allocation method, apparatus, electronic device, and computer storage medium provided in the embodiments of this application, the relevant technologies are briefly described below: With the booming development of the internet economy, large-scale e-commerce platforms need to continuously allocate resources under online constraints during daily operations and promotional activities. This means that each time a search request arrives, the system can perform an information search operation to obtain multiple candidate solutions. Then, it can select one solution from these candidates, minimizing the negative impact on the platform's overall metrics while satisfying global objective constraints (such as the lower limit of the target product's exposure revenue). This is a classic online linear programming problem, characterized by sequential requests, irreversible decisions, and the need to maintain dual prices online to balance immediate costs with long-term constraint progress.

[0017] To satisfy the objective constraints of online constrained resource allocation problems, duality theory is commonly used to implement resource allocation operations. However, existing resource allocation methods often suffer from the following drawbacks: 1) High cost of cold start: The system lacks historical feedback data during the startup or cold start phase. Operators need to manually try and adjust the initial values ​​of the dual variables repeatedly, which is time-consuming and not feasible under high pressure.

[0018] 2) Unstable optimizer: Existing adaptive optimizers are prone to oscillations under non-stationary flow conditions with frequent gradient direction reversals, due to the exponential decay characteristics of second-order momentum estimation causing the learning rate to rebound.

[0019] 3) Extremely tight latency budget: Each current request decision must be completed in milliseconds, and the system cannot afford the overhead of matrix operations or complex optimization solutions on the decision path.

[0020] To address the aforementioned problems, embodiments of this application provide a resource allocation method, apparatus, electronic device, and computer storage medium. For details, please refer to the appendix. Figure 1 As shown, the entity executing this resource allocation method can be a resource allocation device 200, which can be implemented as a local server, a cloud server, etc. When the resource allocation device 200 is implemented as a cloud server, the resource allocation method can be executed in the cloud. Several computing processes (cloud servers) can be deployed in the cloud, each with computing, storage, and other processing resources. In the cloud, multiple computing processes can be organized to provide a certain service; of course, a single computing process can also provide one or more services. The cloud can provide this service by providing a service interface, which users call to use the corresponding service. Service interfaces include Software Development Kits (SDKs), Application Programming Interfaces (APIs), etc.

[0021] The resource allocation device 200 can communicate with the requesting terminal 100, which is used by users to trigger resource allocation operations. The requesting terminal 100 can be any computing device with certain information interaction capabilities; specifically, it can be a mobile phone, a personal computer (PC), a tablet computer, a configuration application, etc. Furthermore, the basic structure of the requesting terminal 100 can include at least one processor. The number of processors depends on the configuration and type of the requesting terminal 100. The requesting terminal 100 may also include memory, which can be volatile, such as Random Access Memory (RAM), or non-volatile, such as Read-Only Memory (ROM), flash memory, etc., or both types. The memory typically stores the operating system (OS), one or more applications, and may also store program data. In addition to the processing unit and memory, the requesting terminal 100 also includes some basic configurations, such as a network interface card (NIC) chip, an I / O bus, a display component, and some peripheral devices. Optionally, some peripheral devices may include, for example, a keyboard, mouse, stylus, printer, etc. Other peripheral devices are well known in the art and will not be described in detail here.

[0022] Resource allocation device 200 refers to a device capable of performing resource allocation operations in a network virtual environment, typically a device that utilizes a network for information planning and resource allocation. This resource allocation device 200 can be a network model used to implement resource allocation operations. In physical implementation, resource allocation device 200 can be any device capable of providing computing services and performing corresponding resource allocation operations, such as processors, servers, etc. The resource allocation device 200 mainly consists of a processor, hard disk, memory, system bus, etc., and its architecture is similar to that of a general-purpose computer.

[0023] In this embodiment described above, a network connection is established between the resource allocation device 200 and the requesting terminal 100. This network connection can be a wireless or wired network connection. If the resource allocation device 200 and the requesting terminal 100 are connected via a communication connection, the network standard of the mobile network can be any one of 2G (Global System for Mobile Communications GSM), 2.5G (General Packet Radio Service GPRS), 3G (Wideband Code Division Multiple Access (WCDMA), Time Division Synchronous Code Division Multiple Access (TD-SCDMA), 4G (Long Term Evolution LTE), 4G+ (Enhanced Long Term Evolution LTE+), Global Microwave Access Interoperability (WiMax), 5G, 6G, etc.

[0024] In this embodiment of the application, the request terminal 100 is used for users to apply and generate a search request to trigger a resource allocation operation. In order to realize the resource allocation operation, the search request can be sent to the resource allocation device 200 so that the resource allocation device 200 can perform the corresponding resource allocation operation based on the obtained search request.

[0025] The resource allocation device 200, upon receiving a search request from the requesting end 100, can determine multiple search results corresponding to the search request. For example, if the search request is a product search request, the determined multiple search results can be multiple search products; if the search request is an information search request, the determined multiple search results can be multiple search results. To accurately determine at least one target search result corresponding to the search request, after determining the multiple search results corresponding to the search request, a dual variable for the current request period can be determined. The dual variable is used to determine the resource allocation priority of the multiple search results in the current request period, and the dual variable can be updated as the request period changes. After determining the dual variables of the current request period, the resource allocation priorities corresponding to multiple search results in the current request period can be determined based on the dual variables. Different search results can correspond to different resource allocation priorities. Then, resources can be allocated to multiple search results based on the resource allocation priorities, thereby stably determining at least one target search result.

[0026] In this embodiment, since the dual variable can be updated as the request cycle changes, for example, the processing interval of each batch of requests is about 5 seconds, the dual variable can be updated within 5 seconds, effectively realizing the determination of the update granularity of the dual variable at the batch level. This enables stable resource allocation operations in both stable and unstable traffic scenarios, and ensures that the resource allocation results meet the constraint objectives corresponding to the search request.

[0027] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0028] Figure 2 A flowchart illustrating a resource allocation method provided for an exemplary embodiment of this application; see attached diagram. Figure 2 As shown, this embodiment provides a resource allocation method. The execution subject of this method is a resource allocation device, which can be implemented as software or a combination of software and hardware. When the resource allocation device is implemented as hardware, it can specifically be various electronic devices capable of performing data processing operations, including but not limited to servers. When the resource allocation device is implemented as software, it can be installed in the electronic devices exemplified above. Specifically, the resource allocation method may include: Step S201: In response to the obtained search request, determine multiple search results corresponding to the search request.

[0029] Step S202: Determine the dual variable for the current request cycle. The dual variable is used to determine the resource allocation priority of multiple search results in the current request cycle. The dual variable is updated as the request cycle changes.

[0030] Step S203: Based on the dual variables, determine the resource allocation priorities corresponding to the multiple search results in the current request cycle.

[0031] Step S204: Allocate resources to multiple search results based on resource allocation priority to determine at least one target search result.

[0032] The specific implementation principles and effects of each of the above steps are explained in detail below: Step S201: In response to the obtained search request, determine multiple search results corresponding to the search request.

[0033] When a user has a resource allocation need, the resource allocation device can obtain a search request. The search request can be different for different application scenarios. For example, in the e-commerce application scenario, the search request can be a product search request; in the information application scenario, the search request can be an information search request; in the advertising application scenario, the search request can be a search request for advertising allocation strategies, and so on.

[0034] After obtaining a search request, multiple search results corresponding to the search request can be determined. For example, if the search request is for a product, the multiple search results can be multiple products that have been searched; if the search request is for an information search, the multiple search results can be multiple pieces of information that have been searched; if the search request is for an advertising allocation strategy, the multiple search results can be multiple advertising allocation strategies.

[0035] Step S202: Determine the dual variable for the current request cycle. The dual variable is used to determine the resource allocation priority of multiple search results in the current request cycle. The dual variable is updated as the request cycle changes.

[0036] To accurately and effectively allocate resources across multiple search results, we can first determine the dual variable for the current request cycle. This can be used to prioritize resource allocation for determining multiple search results within the current request cycle; in e-commerce applications, the dual variable... It can be implemented as a price signal used to weigh immediate gains against long-term constraints; specifically, the dual variable. It can be used to characterize the marginal value of a unit of constrained resources (such as exposure to a target category). For example, when actual consumption is lower than the expected target, the dual variable can be used. Increase the allocation of resources to encourage increased allocation; conversely, decrease the allocation of resources.

[0037] In addition, dual variables It is not a fixed value, but can be dynamically updated as the request cycle changes. For example, if the request cycle is 5 seconds for processing a batch of requests, then the dual variable will change every 5 seconds when processing a batch of requests. It can be updated every 5 seconds. In some instances, the dual variable of the current request period can be stored in a preset area. In this case, determining the dual variable of the current request period can include: determining the time information of the current request period; accessing the preset area based on the time information to obtain the dual variable of the current request period. Specifically, the preset area stores the mapping relationship between the time information of different request periods and the corresponding dual variables; the dual variable of the current request period can be stably determined based on the mapping relationship and the time information, thus effectively ensuring the accuracy and reliability of determining the dual variable of the current request period.

[0038] In other instances, the dual variable of the current request period can be determined by updating the historical dual variable of previous request periods. In this case, determining the dual variable of the current request period can include: determining the historical dual variable of previous request periods, as well as the historical search requests, historical search results, and historical performance metrics corresponding to the previous request periods; updating the historical dual variable using the historical search requests, historical search results, and historical performance metrics corresponding to the historical search results to determine the dual variable of the next request period, which can also stably determine the dual variable of the current request period.

[0039] In some other instances, the dual variable of the current request cycle can also be determined through human-computer interaction. In this case, determining the dual variable of the current request cycle may include: displaying the human-computer interaction interface; obtaining the configuration operation of the dual variable input by the user in the human-computer interaction interface; and determining the dual variable of the current request cycle based on the configuration operation of the dual variable. This also ensures the accuracy and reliability of determining the dual variable of the current request cycle.

[0040] Step S203: Based on the dual variables, determine the resource allocation priorities corresponding to the multiple search results in the current request cycle.

[0041] After obtaining the dual variables, the resource allocation priorities corresponding to multiple search results in the current request cycle can be determined based on the dual variables. Resource allocation priority characterizes the amount of resources allocated to a search result; a higher priority means more resources are allocated to that search result, and a lower priority means fewer resources are allocated. Resource allocation priority can be implemented as a numerical value or a preset level. When implemented as a numerical value, a larger value indicates a higher priority, and a smaller value indicates a lower priority. When implemented as a preset level, for example, if search result 1 has a priority level of 1 (higher than other levels), then search result 1 has a higher priority. Similarly, if search result 2 has a priority level of 2 (lower than 1), then search result 2 has a lower priority than search result 1.

[0042] In some instances, resource allocation priorities can be determined using a pre-trained priority recognition model. In this case, determining the resource allocation priorities corresponding to multiple search results in the current request cycle based on dual variables can include: determining the pre-trained priority recognition model; inputting the dual variables into the priority recognition model to obtain the resource allocation priorities corresponding to multiple search results in the current request cycle output by the priority recognition model.

[0043] In this application, the priority recognition model can be a Large Language Model (LLM) based on artificial intelligence. This application does not limit the number of model parameters supported by the model, aiming to meet actual needs. If the model has relatively more parameters, the model will be larger and perform better, but it will consume more time and resources during inference or training. If the model has relatively fewer parameters, the model will be smaller and, while meeting performance requirements, more lightweight, consuming less time and resources during inference or training. This priority recognition model can be a deep learning model used to process and generate natural language text or multimodal data, implemented based on a neural network architecture, and can be pre-trained on large amounts of data. In an optional implementation, the priority recognition model may include an encoder, a decoder, a self-attention layer, and a feed-forward neural network, etc. The encoder is mainly used to convert input data (usually in sequence form) into vector representation. This process can capture the semantic features of the input data. The decoder is responsible for converting the intermediate representation generated by the encoder into output data (usually in sequence form). The self-attention layer is a mechanism that allows the model to pay attention to other positions in the sequence to better encode the current position information. The feedforward neural network can perform nonlinear transformations on the output of the self-attention layer to enhance the model's expressive power. All parts work together, enabling the model built on them to perform well in various complex processing tasks, such as natural language processing, computer vision, speech recognition, machine translation, text summarization, and intelligent question answering.

[0044] Step S204: Allocate resources to multiple search results based on resource allocation priority to determine at least one target search result.

[0045] Since resource allocation priority reflects the amount of resources allocated to multiple search results, after determining the resource allocation priority for each search result in the current request cycle, resource allocation operations can be performed on the multiple search results based on the resource allocation priority to determine at least one target search result. This target search result can be the final result corresponding to the search request. For example, in the case of a product search request, at least one target search result can be at least one target product corresponding to the product search request, and then at least one target product can be displayed or promoted. In the case of an information search request, at least one target search result can be at least one information search result corresponding to the information search request, and then at least one information search result can be displayed.

[0046] In some instances, at least one target search result may be a search result with a higher resource allocation. In this case, allocating resources to multiple search results based on resource allocation priority to determine at least one target search result may include: comparing the resource allocation priorities of the multiple search results; and determining the search result with the highest resource allocation priority as the target search result. Alternatively, allocating resources to multiple search results based on resource allocation priority to determine at least one target search result may include: determining a quantity parameter to limit the number of target search results; sorting the multiple search results based on resource allocation priority to obtain the ranking information of the search results; and selecting the search result that satisfies the above quantity parameter based on the ranking information of the search results as at least one target search result. This effectively ensures the accuracy and reliability of determining the target search result.

[0047] The resource allocation method provided in this embodiment, in response to the acquired search request, determines the dual variable of the current request period by identifying multiple search results corresponding to the search request, and then determines the resource allocation priority corresponding to each of the multiple search results in the current request period based on the dual variable. Resource allocation is then performed on the multiple search results based on the resource allocation priority, thereby stably determining at least one target search result. Since the dual variable can be updated with changes in the request period (for example, if the request processing interval for each batch is approximately 5 seconds, the dual variable can be updated within 5 seconds), effectively realizing the batch-level determination of the update granularity of the dual variable. This allows for stable resource allocation operations in both stable and unstable traffic scenarios, ensuring that the resource allocation result meets the constraints corresponding to the search request, thus improving the applicability and practicality of the resource allocation method.

[0048] Figure 3This application provides a schematic diagram illustrating a process for determining the resource allocation priority corresponding to multiple search results in the current request cycle, as shown in the attached diagram, based on the above embodiment. Figure 3 As shown, the resource allocation priority corresponding to multiple search results can be determined not only by a pre-trained priority recognition model, but also by the Lagrange scores corresponding to each search result. In this case, determining the resource allocation priority corresponding to multiple search results in the current request cycle based on dual variables can include: Step S301: Process multiple search results based on dual variables and a preset Lagrange algorithm to determine the Lagrange scores corresponding to the multiple search results. The Lagrange scores are positively correlated with resource allocation priority.

[0049] After obtaining the dual variables, multiple search results can be analyzed and processed based on the dual variables and the preset Lagrange algorithm to determine the Lagrange scores corresponding to the multiple search results. The Lagrange scores are positively correlated with resource allocation priority. For example, the higher the Lagrange score, the higher the resource allocation priority; the lower the Lagrange score, the lower the resource allocation priority.

[0050] In some instances, multiple search results may include both expected and non-promoted results. For example, in a product search request, multiple search results may include both expected and non-promoted products; in an information search request, multiple search results may include both expected and non-promoted information. To increase the priority of promoting results, a Lagrange multiplication operation can be performed on each result separately. In this case, processing multiple search results based on dual variables and a pre-defined Lagrange algorithm to determine their respective Lagrange scores can involve: identifying at least one promoted and non-promoted result from the multiple search results; the at least one promoted result can be determined using a pre-defined promotion database, specifically a result located within that database; and then processing the multiple promoted results using the dual variables and the pre-defined Lagrange algorithm to determine their respective Lagrange scores. This effectively ensures the accuracy and reliability of the Lagrange score determination and reduces the data resources required for calculating the Lagrange scores.

[0051] For example, in e-commerce applications, multiple search results can represent multiple search products. To promote products in a pre-defined promotion database, we can first identify the pre-defined promotion products in the database from among the multiple search products. Then, we use dual variables and a pre-defined Lagrange algorithm to process the pre-defined promotion products and determine the Lagrange scores corresponding to each of the multiple pre-defined promotion products. The obtained Lagrange scores are used to individually weight the resource allocation priority of the pre-defined promotion products, thereby reducing the losses to the entire product system.

[0052] In other instances, the Lagrange score can be determined not only by analyzing and processing the promotional results in multiple search results, but also by determining the resource consumption and revenue indicators corresponding to each of the multiple search results. In this case, processing multiple search results based on dual variables and a pre-defined Lagrange algorithm to determine the Lagrange scores for each search result may include: determining the resource consumption and revenue indicators corresponding to each of the multiple search results; and using the Lagrange algorithm to process the dual variables, resource consumption indicators, and revenue indicators to determine the Lagrange scores for each of the multiple search results.

[0053] To determine the Lagrange score that characterizes resource allocation priority, resource consumption and revenue metrics corresponding to multiple search results can be identified first. The resource consumption metrics represent the amount of resources consumed in calculating the search results, while the revenue metrics represent the positive value brought by the search results. For example, the revenue metric can be implemented as the click-through rate (CTR) to reflect click value, the conversion rate to reflect conversion value, or the transaction rate to reflect transaction value, etc. Specifically, the resource consumption and revenue metrics corresponding to multiple search results can be determined by analyzing and processing multiple search results using a pre-defined metric identification model.

[0054] After determining the resource consumption and revenue metrics corresponding to multiple search results, the Lagrange algorithm can be used to process the resource consumption metrics, dual variables, and revenue metrics to determine the Lagrange scores for each search result. In some instances, the Lagrange score can be determined using the following formula: ,in, As dual variables, For search results For search requests Profitability metrics For search results The corresponding depreciation cost or resource consumption, By assigning a Lagrange score, the accuracy and reliability of the Lagrange score determination are effectively guaranteed.

[0055] Step S302: Based on the Lagrange score, determine the resource allocation priority corresponding to the multiple search results in the current request cycle.

[0056] After determining the Lagrange score, the resource allocation priority for each search result in the current request cycle can be determined based on the Lagrange score. In some instances, the Lagrange score is directly used to determine the resource allocation priority for each search result in the current request cycle; alternatively, the resource allocation priority can be determined based on the Lagrange score and a pre-defined mapping relationship.

[0057] In some other instances, resource allocation priority can be determined not only based on the Lagrange score, but also by combining the search result scores corresponding to multiple search results. In this case, determining the resource allocation priority corresponding to multiple search results in the current request cycle based on the Lagrange score can include: processing multiple search results using a prediction model to determine the search result scores corresponding to each search result, where the search result scores are positively correlated with resource allocation priority; and determining the resource allocation priority corresponding to multiple search results in the current request cycle based on both the search result scores and the Lagrange score.

[0058] Specifically, after determining multiple search results, a predictive model can be used to process these search results to stably determine the search result scores corresponding to each search result. These search result scores are positively correlated with resource allocation priorities; for example, the higher the search result score, the higher the resource allocation priority, and vice versa.

[0059] Since both search result scores and Lagrange scores are positively correlated with resource allocation priority, after determining the search result scores and Lagrange scores, they can be analyzed to determine the resource allocation priority corresponding to multiple search results in the current request cycle. In some instances, determining the resource allocation priority corresponding to multiple search results in the current request cycle based on the search result scores and Lagrange scores can include: summarizing the search result scores and Lagrange scores to obtain a summary score; and then determining the resource allocation priority corresponding to each search result based on the summary score. Specifically, the summary score can be directly used to determine the resource allocation priority corresponding to each search result; or, a query can be performed based on a preset mapping relationship and the summary score to determine the resource allocation priority corresponding to each search result. This also ensures the accuracy and reliability of determining the resource allocation priority.

[0060] In this embodiment, multiple search results are processed based on dual variables and a preset Lagrange algorithm to determine the Lagrange scores corresponding to each search result. Then, the resource allocation priorities corresponding to each search result in the current request period are determined based on the Lagrange scores. This effectively ensures the accuracy and reliability of determining the resource allocation priorities, and facilitates the resource allocation operation on multiple search results based on the resource allocation priorities, further ensuring the accuracy and reliability of determining at least one target search result.

[0061] Figure 4 A flowchart illustrating another resource allocation method provided as an exemplary embodiment of this application; based on the above embodiments, refer to the appendix. Figure 4 As shown, after allocating resources to multiple search results based on resource allocation priority and determining at least one target search result, the dual variable can be updated based on changes in the request cycle. In this case, the method in this embodiment may include: Step S401: Determine the actual resource consumption index corresponding to at least one target search result.

[0062] After determining at least one target search result, a promotion operation can be performed on the at least one target search result to accurately determine the actual resource consumption index corresponding to each of the at least one target search result. The actual resource consumption index is used to characterize the real consumption of the target search result. The actual resource consumption index can be determined by analyzing and processing the actual operation information of the target search result based on a preset network model.

[0063] Step S402: Determine the dual gradient based on the difference between the actual resource consumption index and the constraint objective corresponding to the search request.

[0064] After determining the actual resource consumption index corresponding to at least one target search result, the difference between the actual resource consumption index and the constraint target can be determined. Then, the difference can be analyzed and processed to determine the dual gradient corresponding to the target search result. In some instances, the difference is directly determined as the dual gradient corresponding to the target search result, or the product of the difference and a preset coefficient is determined as the dual gradient corresponding to the target search result, or the sum of the difference and a preset bias is determined as the dual gradient corresponding to the target search result. This effectively ensures the accuracy and reliability of determining the dual gradient.

[0065] Furthermore, in order to achieve a reasonable update operation on the dual variable, after determining the actual resource consumption index corresponding to at least one target search result, it is possible to determine whether the current situation satisfies the conditions for updating the dual variable based on the actual resource consumption index. At this time, the method in this embodiment may also include: identifying whether the corresponding target search result satisfies the constraint objective based on the actual resource consumption index; if the target search result does not satisfy the constraint objective, determining the dual gradient based on the difference between the actual resource consumption index and the constraint objective.

[0066] Specifically, after determining the actual resource consumption indicators corresponding to at least one target search result, it is possible to identify whether the corresponding target search result needs to meet the constraint target based on the actual resource consumption indicators. This identification based on the actual resource consumption indicators can include: determining the range of constraint indicators corresponding to the constraint target; analyzing and comparing the actual resource consumption indicators with the range of constraint indicators; determining that the target search result meets the constraint target if the actual resource consumption indicators are within the range of constraint indicators; and determining that the target search result does not meet the constraint target if the actual resource consumption indicators are outside the range of constraint indicators.

[0067] If the identification result indicates that the target search result does not meet the constraint objective, it means that the resource allocation priority determined based on the dual variable of the current request period cannot achieve the resource allocation operation that satisfies the constraint objective. Therefore, it can be determined that the dual variable needs to be updated. Specifically, the dual gradient can be determined based on the difference between the actual resource consumption index and the constraint objective, and the dual variable can be updated based on the dual gradient. Specifically, if the actual resource consumption index is greater than the constraint index range, it means that the actual resource consumption index of the target search result exceeds the constraint objective, and the dual variable can be reduced based on the dual gradient. If the actual resource consumption index is less than the constraint index range, it means that the actual resource consumption index of the target search result does not meet the constraint objective, and the dual variable can be increased based on the dual gradient. Conversely, if the identification result indicates that the target search result meets the constraint objective, it means that the resource allocation priority determined based on the dual variable of the current request period can achieve the resource allocation operation that satisfies the constraint objective. Therefore, it can be determined that no update processing of the dual variable is needed, i.e., there is no need to determine the dual gradient based on the difference between the actual resource consumption index and the constraint objective.

[0068] Step S403: Determine the first-order momentum estimate and the second-order momentum estimate corresponding to the dual gradient. The second-order momentum estimate is monotonically non-decreasing.

[0069] To stably update the dual variables in the Lagrange algorithm using gradient-based dual variable update methods, after determining the dual gradient, it can be analyzed to determine the corresponding first-order and second-order momentum estimates. The first-order momentum estimate characterizes the smoothed gradient direction of the dual gradient, capturing the long-term trend of the bias; the second-order momentum estimate characterizes the variance of the dual gradient, capturing the degree of bias fluctuation. In some instances, the first-order and second-order momentum estimates can be determined using relevant mathematical formulas. Furthermore, for the second-order momentum estimate, to eliminate oscillations during gradient flipping, the determined second-order momentum estimate can be made monotonically non-decreasing.

[0070] In some other instances, before determining the first-order momentum estimate and the second-order momentum estimate corresponding to the dual gradient, a regularization correction term can be used to determine the first-order momentum estimate and the second-order momentum estimate. In this case, the method in this embodiment may further include: generating a regularization correction term based on a preset regularization coefficient and the dual variable of the current request period; superimposing the dual gradient and the regularization correction term to obtain the corrected dual gradient, which is used to determine the first-order momentum estimate and the second-order momentum estimate.

[0071] In order to make the dual variable It has strong convexity, which makes the dual variable It converges more easily and can generate a regularization correction term using preset regularization coefficients and the dual variable of the current request period. In some instances, the regularization correction term can be determined based on the product of the regularization coefficients and the dual variable of the current request period; that is, the regularization correction term can be... , The regularization coefficient is . This is the dual variable for the current request period. After generating the regularization correction term, the dual gradient can be superimposed with the regularization correction term to obtain the corrected dual gradient. For example, the dual gradient is... , The regularization coefficient is . For the dual variable of the current request cycle, the regularization correction term is: In this case, the corrected dual gradient can be This effectively ensures the accuracy and reliability of determining the dual gradient, and then the first-order momentum estimate and the second-order momentum estimate can be determined based on the corrected dual gradient.

[0072] Step S404: Update the dual variables using first-order momentum estimation and second-order momentum estimation to obtain the updated dual variables for the next request cycle. The updated dual variables are used to determine the resource allocation priority of multiple search results in the next request cycle.

[0073] After determining the first-order and second-order momentum estimates, the dual variables can be updated using these estimates to obtain the updated dual variables for the next request cycle. These updated dual variables are used to determine the resource allocation priority of multiple search results in the next request cycle, thereby upgrading the dual variables from daily batch parameters to batch-level real-time asynchronous status updates, further ensuring the stability and reliability of the resource allocation operation.

[0074] Figure 5 A flowchart illustrating another resource allocation method provided as an exemplary embodiment of this application; based on the above embodiments, refer to the appendix... Figure 5 As shown, when the search request is a request obtained during the warm-up phase, the initial dual variable of the preset phase can be updated using the first learning rate. In this case, the method in this embodiment may include: Step S501: When the search request is in the warm-up phase, determine the first learning rate corresponding to the search request.

[0075] During the resource allocation process, the resource allocation device may be in a preheating phase or a non-preheating phase. The preheating phase can refer to the cold start phase when the resource allocation device is first started, or it can be the deployment phase of the preset application in the resource allocation device. The non-preheating phase can be the phase in which the resource allocation device is running stably. Since the resource allocation device has different update methods for dual variables in the preheating and non-preheating phases, in order to accurately update the dual variables, it is necessary to first identify whether the search request is in the preheating phase. Specifically, this can be determined by analyzing and comparing the timestamp corresponding to the search request with the time window corresponding to the preset phase. That is, if the timestamp corresponding to the search request is within the time window corresponding to the preheating phase, the search request is determined to be in the preheating phase; if the timestamp corresponding to the search request is outside the time window corresponding to the preheating phase, the search request is determined to be in the non-preheating phase.

[0076] If it is determined that the search request is in the preheating stage, a first learning rate corresponding to the search request can be determined. This first learning rate can be a pre-configured preset parameter, which can be stored in a preset area. In this case, the first learning rate corresponding to the search request is determined by accessing the preset area. Alternatively, the first learning rate can be determined through human-computer interaction. In this case, determining the first learning rate corresponding to the search request can include: displaying a human-computer interaction interface; obtaining the execution operation input by the user in the human-computer interaction interface; and determining the first learning rate corresponding to the search request based on the execution operation.

[0077] Step S502: Update the initial dual variable corresponding to the warm-up stage using the first learning rate to obtain the updated dual variable for the next request cycle. The initial dual variable is zero.

[0078] After obtaining the first learning rate, the initial dual variable corresponding to the warm-up phase can be updated using the first learning rate. The first learning rate can be a large learning rate, and the initial dual variable can be configured to zero. This allows for the rapid acquisition of the updated dual variable for the next request cycle. In other words, the initial dual variable initialized to zero can be quickly updated to the updated dual variable applicable to the non-warm-up phase. Then, based on the updated dual variable, stable resource allocation operations can be performed on subsequent search requests.

[0079] Correspondingly, the method in this embodiment may further include: when the search request switches from the preheating stage to the non-preheating stage, the first learning rate is switched to the second learning rate; the dual variable is updated using the second learning rate and the actual resource consumption indicators corresponding to at least one target search result, respectively, to obtain the updated dual variable for the next request cycle, wherein the first learning rate is greater than the second learning rate.

[0080] Specifically, when a search request switches from the preheating phase to the non-preheating phase, it indicates that the resource allocation device has entered a stable request processing phase. In order to ensure the stability and reliability of updating the dual variable, the first learning rate can be switched to the second learning rate. Specifically, the first learning rate can be controlled to switch to the second learning rate according to preset parameters. The second learning rate can be a smaller learning rate than the first learning rate. The second learning rate can be a stable learning rate suitable for the non-preheating phase. After switching the first learning rate to the second learning rate, the dual variable can be updated using the second learning rate and the actual resource consumption indicators corresponding to at least one target search result, thereby stably obtaining the updated dual variable for the next request cycle.

[0081] In this embodiment, when the search request is in the preheating stage, a first learning rate corresponding to the search request is determined, and the initial dual variable corresponding to the preheating stage is updated using the first learning rate to obtain the updated dual variable for the next request cycle. This effectively ensures the accuracy and reliability of determining the updated dual variable for the next request cycle based on the initial dual variable of the preheating stage.

[0082] Figure 6 A flowchart illustrating the determination of the dual variable of the current request period is provided as an exemplary embodiment of this application; based on any of the above embodiments, refer to the appendix. Figure 6 As shown, the dual variable can be determined not only through human-computer interaction, but also through a first variable component responding to long-term trend deviations and a second variable component responding to burst traffic. In this case, the dual variable for determining the current request period in this embodiment may include: Step S601: Obtain the first variable component for responding to long-term trend deviation and the second variable component for responding to burst flow.

[0083] The dual variables may include a first variable component for responding to long-term trend deviations and a second variable component for responding to sudden flow. The first variable component may be a slow component for capturing persistent deviations with a conservative step size, and the second variable component may be a component for responding to sudden constitution switching with a rapid step size and using a decay coefficient. The fast component fades naturally. Specifically, the first and second variable components can be controlled by a preset dual-time controller, taking into account the number of search request batches T and a preset decay coefficient. The slow step size corresponding to the first variable component The fast step size corresponding to the second variable component and the model framework parameters used to implement resource allocation operations. ,in, Then, the model framework parameters D, the number of request batches T, and the preset decay coefficient are adjusted using a pre-trained dual-timescale model. The slow step size corresponding to the first variable component The fast step size corresponding to the second variable component Analytical processing is performed to determine the slow dual trajectory corresponding to the first variable component. and the fast dual trajectory corresponding to the second variable component { Then, based on the slow dual trajectory { Determine the first variable component used to respond to long-term trend deviation At the same time, it can be based on fast dual trajectories { To determine the second variable component used in response to burst traffic. .

[0084] Step S602: Determine the first weight corresponding to the first variable component and the second weight corresponding to the second variable component.

[0085] After determining the first and second variable components, in order to accurately determine the dual variable based on the first and second variable components, we can first determine the first weight corresponding to the first variable component and the second weight corresponding to the second variable component. The first and second weights can be pre-configured parameters. At this time, the first and second weights can be stored in a preset area. Then, by accessing the preset area, the first weight corresponding to the first variable component and the second weight corresponding to the second variable component can be stably determined.

[0086] Step S603: Based on the first weight and the second weight, perform a weighted summation of the first variable component and the second variable component to determine the dual variable.

[0087] The first variable component is The second variable component is The first weight is The second weight is In this case, the dual variable can be determined using the following formula. ,Right now This effectively ensures the accuracy and reliability of determining the dual variables.

[0088] Furthermore, after obtaining the first variable component for responding to long-term trend deviation and the second variable component for responding to burst traffic, different update step sizes can be used to adjust the first and second variable components. In this case, the method in this embodiment may further include: when the current request period is a preset burst traffic phase, determining a first update step size corresponding to the first variable component and a second update step size corresponding to the second variable component, wherein the first update step size is smaller than the second update step size; adjusting the first variable component using the first update step size to obtain a first adjusted component; and adjusting the second variable component using the second update step size to obtain a second adjusted component.

[0089] Specifically, when the current request period is a preset burst traffic phase, since the second variable component is used to respond to the burst traffic, in order to accurately determine the first and second variable components corresponding to the burst traffic phase, we can first determine the first update step size corresponding to the first variable component and the second update step size corresponding to the second variable component. The first and second update step sizes can be pre-configured preset step size parameters; generally, the value of the first update step size is less than the value of the second update step size. Then, we can use the first update step size to adjust the first variable component to obtain the first adjusted component. Simultaneously, we can use the second update step size to adjust the second variable component, thereby stably obtaining the second adjusted component. The second adjusted component is greater than the second variable component, and the first adjusted component is greater than the first variable component. Then, we can determine the dual variable based on the first and second adjusted components. This effectively enables stable resource allocation operations based on the determined dual variable during the burst traffic phase.

[0090] Furthermore, after obtaining the second adjustment component, if the current request period switches from a burst traffic phase to a stable traffic phase, the second adjustment component can be attenuated. In this case, the method in this embodiment may further include: determining the attenuation coefficient corresponding to the second adjustment component when the current request period switches from a burst traffic phase to a stable traffic phase; and attenuating the second adjustment component to the second variable component using the attenuation coefficient.

[0091] Specifically, after obtaining the second adjustment component, when the current request cycle switches from a burst traffic phase to a stable traffic phase, in order to accurately determine the dual variable in the stable traffic phase, the adjusted second adjustment component needs to be quickly restored to the second variable component. At this time, the attenuation coefficient corresponding to the second adjustment component can be determined first. This attenuation coefficient is a pre-configured optimal parameter. Then, the attenuation coefficient can be used to attenuate the second adjustment component to the second variable component. This ensures the accuracy and reliability of determining the dual variable in the stable traffic phase.

[0092] In this embodiment, by obtaining the first variable component used to respond to long-term trend deviation and the second variable component used to respond to sudden flow, the first weight corresponding to the first variable component and the second weight corresponding to the second variable component are determined. Then, the first variable component and the second variable component are weighted and summed based on the first weight and the second weight to determine the dual variable. This effectively ensures the accuracy and reliability of determining the dual variable.

[0093] In practical applications, taking e-commerce scenarios as an example, this application embodiment provides a resource allocation method based on the distributed drift adaptive online primal-dual method. The execution subject of this method is the resource allocation system. (See attached...) Figure 7 As shown, the resource allocation system may include a lightweight decision-making layer, a dual control layer, a pluggable enhancement module layer, and an operation and maintenance layer. This system can minimize overall platform revenue loss while satisfying fulfillment constraints, achieving a better balance between constraint satisfaction and platform revenue. Specifically, the resource allocation system can manage dual variables... The system upgrades from offline batch parameter allocation to real-time online allocation. A drift-robust online allocation is achieved through a real-time closed loop consisting of a lightweight decision layer and a dual control layer. Flexible functional expansion is provided through a pluggable enhancement module layer. The resource allocation system executes a closed loop every few seconds, specifically using the current dual variable. The system scores the search results corresponding to the search request to enable resource allocation. Then, it calculates the dual gradient based on the aggregated results after resource allocation and updates the dual variables. Furthermore, pluggable enhancement module layers can be used for correction operations. Specifically, the resource allocation method may include the following steps: Step 1: Obtain the product search request and determine the multiple search products corresponding to the product search request, as well as the estimated search scores of the multiple search products.

[0094] After obtaining a product search request, a product search operation can be performed based on the product search request, thereby identifying multiple search products corresponding to the product search request. Then, feature extraction operations can be performed on the search products to obtain search product features. Search product features may include at least one of the following: predicted transaction indicators, predicted click-through rate, predicted conversion rate, etc., and the estimated search scores of multiple search products can be determined based on the search product features. Specifically, a pre-trained search scoring model can be used to analyze and process the search product features to determine the estimated search scores of multiple search products.

[0095] Step 2: Determine the dual variables for the current request cycle dual variables Updated as the request cycle changes, and then based on dual variables. The system processes multiple search items using a pre-defined Lagrange algorithm to determine the Lagrange scores for each item.

[0096] Among them, based on dual variables Processing multiple search items using a pre-defined Lagrange algorithm to determine their respective Lagrange scores may include: determining resource consumption and revenue metrics corresponding to the search items; and then utilizing the dual variables of the current request cycle. Resource consumption and revenue metrics are processed to determine the Lagrange scores for multiple searched products. Specifically, the revenue metrics are... Resource consumption indicators (or cost indicators) are Lagrange rating It can be determined using the following formula: × - This effectively ensures the accuracy and reliability of determining the Lagrange scores for multiple searched items. In the process of calculating the Lagrange scores for the searched items, the dual variable... It is an online parameter that can be updated according to the request cycle. Furthermore, the Lagrange score calculation process mentioned above only involves scalar multiplication and addition operations, which can reduce the latency in the Lagrange score calculation process, specifically keeping the latency in the sub-millisecond range.

[0097] Step 3: Determine the resource allocation priority of multiple search products based on their estimated search scores and Lagrange scores. Then, resource allocation operations can be performed on the multiple search products based on their resource allocation priorities to determine at least one target search product.

[0098] Specifically, after obtaining the estimated search scores and Lagrange scores of multiple search products, a weighted summation operation can be performed on the estimated search scores and Lagrange scores of the multiple search products to determine the comprehensive score of the multiple search products. Then, the resource allocation priority of the multiple search products is determined based on the comprehensive score. The value of the comprehensive score is positively correlated with the resource allocation priority. That is, the larger the comprehensive score, the higher the resource allocation priority, the higher the exposure position of the search product, and the more resources are allocated to the search product. Conversely, the smaller the comprehensive score, the lower the resource allocation priority, the lower the exposure position of the search product, and the fewer resources are allocated to the search product.

[0099] After determining the resource allocation priority of multiple search items, resource allocation operations can be performed on these items based on their resource allocation priority. Specifically, at least one target search item can be determined based on the resource allocation priority. For example, the search item with the highest resource allocation priority can be designated as the target search item. This allows the resource allocation problem to be modeled as an optimization problem with global payoff constraints, where product search requests arrive sequentially, and each product search request... From candidate product set Select a target search product j, and associate resource consumption metrics for each target search product j. and profitability indicators The goal is to minimize the depreciation cost under the request constraint while ensuring that the total revenue is not less than the total revenue. This effectively guarantees the accuracy and reliability of determining at least one target search item. In addition, the above operations only require scalar multiplication and addition and maximum value operation, without matrix operations, which can reduce the latency to the sub-millisecond level. In some scenarios, the end-to-end latency can support less than 5ms and support 500,000+ requests / second.

[0100] Step 4: After identifying at least one target search item, the dual variable can be updated based on the actual resource consumption index of the target search item to obtain the updated dual variable for the next request cycle. The updated dual variable is used to determine the resource allocation operation for multiple search requests in the next request cycle.

[0101] Among them, the dual variable that determines the current request cycle Then, the dual control layer can be used to control the dual variables. The update operation involves, specifically, allocating resources for each batch of search requests. This process involves determining the actual resource consumption index corresponding to at least one target search item. Then, based on this actual resource consumption index, a dual gradient is calculated to update the dual variable. Specifically, calculating the dual gradient based on the actual resource consumption index of at least one target search item can include: determining the constraint objective based on the search request; determining the dual gradient based on the difference between the actual resource consumption index and the constraint objective corresponding to the search request; determining the first-order momentum estimate and the second-order momentum estimate corresponding to the dual gradient, where the second-order momentum estimate is monotonically non-decreasing; and then updating the dual variable using the first-order and second-order momentum estimates to obtain the updated dual variable for the next request cycle. For example, the updated dual variable can be determined using the following formula: In the above formula, For the updated dual variable, As dual variables, The learning rate corresponding to the dual variable. For the first-order momentum estimate corresponding to the dual gradient, For the second-order momentum estimation corresponding to the dual gradient, The hyperparameters are preset. Since the updated dual variable is based on a monotonically non-decreasing second-order momentum estimate, this effectively ensures that the learning rate corresponding to the dual variable will not bounce back and helps eliminate oscillations caused by the reversal of the dual gradient signal. After obtaining the updated dual variable for the next request cycle, the updated dual variable can be stored and injected back into the lightweight decision layer for the next round of request processing.

[0102] Furthermore, for the pluggable enhancement module layer, three optional plugins are provided: a regularization plugin, a cold start plugin, and a dual-speed control plugin. The regularization plugin adds a regularization term to the dual gradient to make the dual variable... Anchoring within a reasonable range helps suppress overreaction in scenarios with sudden traffic changes. Specifically, before determining the first-order and second-order momentum estimates corresponding to the dual gradient, a regularization correction term can be generated based on preset regularization coefficients and the dual variables of the current request cycle. This regularization correction term is then superimposed on the dual gradient to obtain the corrected dual gradient. It can be determined using the following formula: ,in, For dual gradient, The preset regularization coefficients are used. For the dual variable in the current request period, the modified dual gradient is used to determine the first-order and second-order momentum estimates, so that the dual variable can be updated based on the first-order and second-order momentum estimates. Since the modified dual gradient incorporates a regularization correction term, the descent of the dual gradient becomes more stable, thus improving the stability of the dual variable. It is easier to converge.

[0103] In addition, the cold start plugin can be used in the front Within a batch, the learning rate will be increased from... linear transition to The system from Starting from 0, it can converge autonomously without manual initialization, meaning that a large learning rate can be used when the resource allocation system starts. Quickly locate the appropriate dual variable Once stable, it will automatically switch to a smaller learning rate. There is no need to manually set the initial value of the dual variable. Specifically, during the startup phase of the resource allocation system, the dual variable... It can be initialized to zero, and then, during the startup phase of the resource allocation system, it can utilize a pre-set large learning rate. (Generally a value greater than 1, such as 5 or 6, etc.) for the initialized dual variable. Adjustments are made to ensure that the dual variable is within a preset time frame (e.g., 30 minutes). It can be quickly adjusted to a suitable value, for example, to make the dual variable... The learning rate for rapidly reaching a high level from 0 can be determined using the following formula: The learning rate during the process is... The learning rate is , For preset batch parameters, For the current batch, in some instances, the recommended configuration for the above parameters can be: σ=0.1. =15, / =10×, batch interval The learning time is 5 seconds. When the resource allocation system is in a stable phase, a pre-set small learning rate can be utilized. (Values ​​less than 1, such as 0.5, etc.) for the adjusted dual variable Adjustments are made to ensure stable processing of search requests and to prevent serious defaults or resource waste caused by miscalculations during the cold start phase.

[0104] In addition, the dual-speed control plugin can control the dual variables. Decompose into slow variables and fast variables The aforementioned slow variables Used to detect the long-term trend of the dual variable, fast variable Used to respond to sudden surges in traffic and automatically adjust dual variables after the surge ends. Perform automatic decay operation, and then you can apply it to fast variables. and slow variables By performing a weighted summation operation, the dual variable can be stably determined. The dual variable It can be determined using the following formula: ,in, To be with slow variables The corresponding weighting coefficients, For fast variables The corresponding weighting coefficients, and then the fast variables can be... It responds rapidly to sudden system changes and naturally fades away through the attenuation coefficient ρ.

[0105] On the other hand, after the detection module in the operations and maintenance layer determines the dual variable, it can record the dual variable. The trajectory of change, through dual variables The trajectory of change can reveal the dual variable. As time changes, when the dual variable is detected In the event of oscillations, drifts, explosions, sudden changes, or large amplitudes, alarm messages can be generated. Alternatively, when a dual variable is detected within a preset time period, an alarm can be generated. In the event of loss, an alarm message can also be generated to remind the user of the dual variable. Perform operational checks. Additionally, the real-time dashboard in the operations layer can display detected dual variables in real time; for example, it can display the change curves of dual variables or their numerical values. Simultaneously, the real-time dashboard can also display key metrics corresponding to search requests, such as at least one of the following: constraint violation rate (e.g., timeout rate, over-provisioning rate), resource utilization, average response latency, P99 latency, decision accuracy, etc. Furthermore, the deployment and rollback module in the operations layer can support trial runs of new algorithm versions (e.g., new scoring functions, update strategies) under low traffic conditions, comparing results before full deployment, and can detect dual variables in the current request cycle. After an exception occurs, it can trigger the dual variable. Rollback to the historical dual variables of the most recent current request period .

[0106] After conducting the experiment in the manner described above, the following results can be obtained: In both scenarios, it can quickly converge and adaptively track the optimal values. After 14 days of online A / B testing, the target product's exposure index increased by 5.65%, IPV by 5.20%, and GMV by 1.50%, while the impact on the overall market was within the noise range (GMV -0.20%). Ablation experiments showed that the cold start module improved the convergence speed by approximately 5.6 times (67 → 12 batches), and the second regularization reduced the oscillation by approximately 2.6 times (std 0.047 → 0.018). The technical solution provided in this application embodiment can achieve the following effects: 1) The lightweight decision layer and the adaptive dual control layer constitute a dual-path real-time closed-loop architecture with no matrix operations throughout the entire link. Specifically, the lightweight decision layer decomposes the global constraint problem into request-level scalar scores through Lagrange decomposition, achieving sub-millisecond latency. The control layer elevates the dual variables from daily batch parameters to batch-level real-time asynchronous state updates. The decoupling of the two layers enables the framework to meet industrial-grade latency and throughput requirements while achieving real-time adaptation to non-stationary traffic. 2) Preconditional Dual Update: The adaptive dual control layer can use the AMSGrad controller to update the dual variables. The AMSGrad controller is a controller based on the adaptive gradient optimization algorithm. It can overcome the non-convergence problem in related technologies by maintaining a monotonically non-decreasing second-order momentum. The dual variables can be updated on the time scale of flow and response condition drift, rather than the coarse-grained daily scheduling update operation. In addition, the monotonically non-decreasing second-order moment estimation ensures that the effective learning rate does not bounce back. It maintains convergence under non-stationary flow with frequent gradient direction reversals and has theoretical guarantees. That is, it can determine the regret and constraint violation based on the current request batch and the number of target search items. The calculated regret and constraint violation can be used to evaluate the resource allocation quality and effect of the resource allocation system, overcoming the risk of non-convergence in gradient reversal scenarios in related technologies. 3) Cooperative stabilization of cold start scheduling and quadratic regularization: The cold start module transitions linearly from an aggressive learning rate to a steady state and converges autonomously without the need for manual initialization; quadratic regularization adds an anchoring term to the gradient to suppress trajectory oscillations. The cooperative operation of cold start scheduling and quadratic regularization can achieve the following results: convergence speed is improved by 5.6 times (67 → 12 batches), and oscillations are reduced by 2.6 times (std0.047 → 0.018). 4) Dual-time-scale dual control extension: The dual variables are decomposed into slow variables and fast variables. The slow variables are used to capture persistent biases, while the fast variables are used to respond to sudden system switching and naturally fade away through the decay coefficient. This achieves faster transient recovery capability without increasing the complexity of the decision path, further improving the applicability and practicality of the resource allocation system.

[0107] Furthermore, in some of the processes described in the above embodiments and accompanying drawings, multiple operations appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 11, 12, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.

[0108] Figure 8 A schematic diagram of a resource allocation device provided for an exemplary embodiment of this application; see attached diagram. Figure 8 As shown, this embodiment provides a resource allocation device for performing the above-described... Figure 2 The resource allocation method shown may include: The first acquisition module 11 is used to determine multiple search results corresponding to the acquired search request in response to the search request. The first determining module 12 is used to determine the dual variable of the current request period. The dual variable is used to determine the resource allocation priority of multiple search results in the current request period. The dual variable is updated as the request period changes. The first determining module 12 is also used to determine the resource allocation priority corresponding to multiple search results in the current request cycle based on dual variables; The first processing module 13 is also used to allocate resources to multiple search results based on resource allocation priority, and determine at least one target search result.

[0109] In some instances, when the first determining module 12 determines the resource allocation priority corresponding to multiple search results in the current request period based on dual variables, the first determining module 12 is used to perform: processing multiple search results based on dual variables and a preset Lagrange algorithm to determine the Lagrange scores corresponding to the multiple search results, wherein the Lagrange scores are positively correlated with the resource allocation priority; and determining the resource allocation priority corresponding to the multiple search results in the current request period based on the Lagrange scores.

[0110] In some instances, when the first determining module 12 determines the resource allocation priority corresponding to multiple search results in the current request period based on the Lagrange score, the first determining module 12 is used to perform: processing the multiple search results using a prediction model to determine the search result scores corresponding to the multiple search results, wherein the search result scores are positively correlated with the resource allocation priority; and determining the resource allocation priority corresponding to the multiple search results in the current request period based on the search result scores and the Lagrange scores.

[0111] In some instances, when the first determining module 12 processes multiple search results based on dual variables and a preset Lagrange algorithm to determine the Lagrange scores corresponding to the multiple search results, the first determining module 12 is used to perform: determining the resource consumption indicators and revenue indicators corresponding to the multiple search results; and using the Lagrange algorithm to process the dual variables, resource consumption indicators, and revenue indicators to determine the Lagrange scores corresponding to the multiple search results.

[0112] In some instances, after allocating resources to multiple search results based on resource allocation priority and determining at least one target search result, the first determining module 12 and the first processing module 13 in this embodiment are used to perform the following steps: The first determining module 12 is used to determine the actual resource consumption index corresponding to at least one target search result; The first processing module 13 is used to determine the dual gradient based on the difference between the actual resource consumption index and the constraint target corresponding to the search request; determine the first-order momentum estimate and the second-order momentum estimate corresponding to the dual gradient, wherein the second-order momentum estimate is monotonically undecreasing; update the dual variable using the first-order momentum estimate and the second-order momentum estimate to obtain the updated dual variable for the next request cycle, wherein the updated dual variable is used to determine the resource allocation priority of multiple search results in the next request cycle.

[0113] In some instances, after determining the actual resource consumption index corresponding to at least one target search result, the first processing module 13 in this embodiment is used to perform the following steps: identifying whether the corresponding target search result satisfies the constraint target based on the actual resource consumption index; if the target search result does not satisfy the constraint target, determining the dual gradient based on the difference between the actual resource consumption index and the constraint target.

[0114] In some instances, before determining the first-order momentum estimate and the second-order momentum estimate corresponding to the dual gradient, the first processing module 13 in this embodiment performs the following steps: generating a regularization correction term based on a preset regularization coefficient and the dual variable of the current request period; superimposing the dual gradient and the regularization correction term to obtain the corrected dual gradient, which is used to determine the first-order momentum estimate and the second-order momentum estimate.

[0115] In some instances, the first processing module 13 in this embodiment is used to perform the following steps: when the search request is in the warm-up phase, determine the first learning rate corresponding to the search request; use the first learning rate to update the initial dual variable corresponding to the warm-up phase to obtain the updated dual variable for the next request cycle, where the initial dual variable is zero.

[0116] In some instances, the first processing module 13 in this embodiment is used to perform the following steps: when the search request switches from the preheating stage to the non-preheating stage, the first learning rate is transitionally switched to the second learning rate; the dual variable is updated using the second learning rate and the actual resource consumption indicators corresponding to at least one target search result, respectively, to obtain the updated dual variable for the next request cycle, wherein the first learning rate is greater than the second learning rate.

[0117] In some instances, when the first determining module 12 determines the dual variable of the current request period, the first determining module 12 is used to perform: obtaining a first variable component for responding to long-term trend deviation and a second variable component for responding to burst traffic; determining a first weight corresponding to the first variable component and a second weight corresponding to the second variable component; and performing a weighted summation of the first variable component and the second variable component based on the first weight and the second weight to determine the dual variable.

[0118] In some instances, after obtaining a first variable component for responding to long-term trend deviations and a second variable component for responding to burst traffic, the first processing module 13 in this embodiment performs the following steps: when the current request period is a preset burst traffic phase, determining a first update step size corresponding to the first variable component and a second update step size corresponding to the second variable component, wherein the first update step size is smaller than the second update step size; adjusting the first variable component using the first update step size to obtain a first adjusted component; and adjusting the second variable component using the second update step size to obtain a second adjusted component.

[0119] In some instances, after obtaining the second adjustment component, the first processing module 13 in this embodiment performs the following steps: when the current request cycle switches from a burst traffic phase to a steady traffic phase, determine the attenuation coefficient corresponding to the second adjustment component; and use the attenuation coefficient to attenuate the second adjustment component to the second variable component.

[0120] The resource allocation device in this embodiment can also execute the aforementioned embodiments. Figures 1-7 The description of the embodiments shown is for reference only, and will not be elaborated upon here.

[0121] like Figure 9 As shown, this embodiment provides an electronic device, which can refer to a complete set of hardware and software infrastructure supporting software operation and resource allocation. It can provide computing resources, storage, communication, and a runtime environment for applications (such as large model inference, scientific simulation, and web services). This electronic device is used to perform the above-described... Figure 2 The resource allocation method shown may, in practice, include a memory 24 and a processor 25 in the electronic device.

[0122] Memory 24 is used to store computer programs and can be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device, data structures, contact data, phone book data, messages, pictures, videos, etc.

[0123] Processor 25, coupled to memory 24, is configured to execute a computer program in memory 24 for: in response to a received search request, determining multiple search results corresponding to the search request; determining a dual variable for the current request period, the dual variable being used to determine the resource allocation priority of the multiple search results in the current request period, the dual variable being updated as the request period changes; determining, based on the dual variable, the resource allocation priority corresponding to each of the multiple search results in the current request period; allocating resources to the multiple search results based on the resource allocation priority, and determining at least one target search result.

[0124] Furthermore, such as Figure 9 As shown, the electronic device also includes other components such as a communication component 26, a display 27, a power supply component 28, and an audio component 29. Figure 9 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 9 The components shown. Additionally... Figure 9The components within the center frame are optional, not mandatory, and their specific requirements depend on the product form of the work node. In this embodiment, the work node can be a terminal device such as a desktop computer, laptop computer, smartphone, or Internet of Things (IoT) device, or a server-side device such as a conventional server, cloud server, or server array. If the work node in this embodiment is implemented as a terminal device such as a desktop computer, laptop computer, or smartphone, it may include... Figure 9 The components within the center frame; if the working node in this embodiment is implemented as a server-side device such as a conventional server, cloud server, or server array, it may not include... Figure 9 The component within the center frame.

[0125] The aforementioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0126] The aforementioned communication component is configured to facilitate wired or wireless communication between the device containing the communication component and other devices. The device containing the communication component can access wireless networks based on communication standards, such as 2G, 3G, 4G / LTE, 5G, or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel.

[0127] The aforementioned display includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen can be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation.

[0128] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.

[0129] The aforementioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals can be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.

[0130] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method embodiments. The computer-readable storage medium includes volatile or non-volatile components, or a combination thereof, and can be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), flash memory or other memory technologies, CD-ROM, Digital Video Disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium.

[0131] Accordingly, this application also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the processor is able to implement the steps in the above method embodiments. It should be understood that each step or combination of steps in the above method flow can be implemented by the computer program or instructions. In addition, these computer programs or instructions can be applied to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device, so that the processor of the general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device can be implemented as a means to implement the corresponding functions in the above method embodiments.

[0132] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0133] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A resource allocation method, characterized in that, include: In response to the obtained search request, determine multiple search results corresponding to the search request; Determine the dual variable for the current request period, the dual variable being used to determine the resource allocation priority of multiple search results in the current request period, and the dual variable being updated as the request period changes; Based on the dual variables, determine the resource allocation priorities corresponding to the multiple search results in the current request period; Based on the resource allocation priority, resources are allocated to the multiple search results to determine at least one target search result.

2. The method according to claim 1, characterized in that, Based on the dual variables, the resource allocation priorities corresponding to multiple search results in the current request period are determined, including: The multiple search results are processed based on the dual variables and the preset Lagrange algorithm to determine the Lagrange scores corresponding to the multiple search results. The Lagrange scores are positively correlated with the resource allocation priority. Based on the Lagrange score, the resource allocation priority corresponding to each of the multiple search results in the current request period is determined.

3. The method according to claim 2, characterized in that, Based on the Lagrange score, the resource allocation priority corresponding to multiple search results in the current request period is determined, including: The multiple search results are processed using a prediction model to determine the search result scores corresponding to each of the multiple search results, and the search result scores are positively correlated with the resource allocation priority. Based on the search result score and the Lagrange score, the resource allocation priority corresponding to the multiple search results in the current request period is determined.

4. The method according to claim 2, characterized in that, Based on the dual variables and a preset Lagrange algorithm, multiple search results are processed to determine the Lagrange scores corresponding to each of the multiple search results, including: Determine the resource consumption indicators and revenue indicators corresponding to the multiple search results respectively; The Lagrange algorithm is used to process the dual variables, the resource consumption index, and the revenue index to determine the Lagrange scores corresponding to the multiple search results.

5. The method according to claim 1, characterized in that, After allocating resources to the plurality of search results based on the resource allocation priority and determining at least one target search result, the method further includes: Determine the actual resource consumption indicators corresponding to each of the at least one target search result; The dual gradient is determined based on the difference between the actual resource consumption index and the constraint objective corresponding to the search request. Determine the first-order momentum estimate and the second-order momentum estimate corresponding to the dual gradient, wherein the second-order momentum estimate is monotonically non-decreasing; The dual variable is updated using the first-order momentum estimate and the second-order momentum estimate to obtain the updated dual variable for the next request cycle. The updated dual variable is used to determine the resource allocation priority of multiple search results in the next request cycle.

6. The method according to claim 5, characterized in that, After determining the actual resource consumption indicators corresponding to the at least one target search result, the method further includes: Based on the actual resource consumption index, identify whether the corresponding target search result meets the constraint target; If the target search result does not meet the constraint objective, the dual gradient is determined based on the difference between the actual resource consumption index and the constraint objective.

7. The method according to claim 5, characterized in that, Before determining the first-order momentum estimate and the second-order momentum estimate corresponding to the dual gradient, the method further includes: Based on the preset regularization coefficient and the dual variable of the current request period, a regularization correction term is generated. The dual gradient is superimposed with the regularization correction term to obtain the corrected dual gradient, which is used to determine the first-order momentum estimate and the second-order momentum estimate.

8. The method according to claim 1, characterized in that, The method further includes: When the search request is in the warm-up phase, a first learning rate corresponding to the search request is determined; The initial dual variable corresponding to the warm-up phase is updated using the first learning rate to obtain the updated dual variable for the next request cycle, wherein the initial dual variable is zero.

9. The method according to claim 8, characterized in that, The method further includes: When the search request is switched from the warm-up phase to the non-warm-up phase, the first learning rate is transitioned to the second learning rate. The dual variable is updated using the second learning rate and the actual resource consumption index corresponding to the at least one target search result, respectively, to obtain the updated dual variable for the next request cycle, wherein the first learning rate is greater than the second learning rate.

10. The method according to any one of claims 1-9, characterized in that, Determine the dual variables for the current request cycle, including: Obtain the first variable component used to respond to long-term trend deviations, and the second variable component used to respond to burst traffic. Determine the first weight corresponding to the first variable component and the second weight corresponding to the second variable component; The first variable component and the second variable component are weighted and summed based on the first weight and the second weight to determine the dual variable.

11. The method according to claim 10, characterized in that, After obtaining the first variable component for responding to long-term trend deviation and the second variable component for responding to burst traffic, the method further includes: When the current request period is a preset burst traffic phase, a first update step size corresponding to the first variable component and a second update step size corresponding to the second variable component are determined, wherein the first update step size is smaller than the second update step size. The first variable component is adjusted using the first update step size to obtain the first adjusted component; The second variable component is adjusted using the second update step size to obtain the second adjusted component.

12. The method according to claim 11, characterized in that, After obtaining the second adjustment component, the method further includes: When the current request period switches from the burst traffic phase to the steady traffic phase, a decay coefficient corresponding to the second adjustment component is determined; The second adjustment component is attenuated to the level of the second variable component using the attenuation coefficient.

13. A resource allocation device, characterized in that, include: The first acquisition module is used to determine multiple search results corresponding to the acquired search request in response to the search request. The first determining module is used to determine the dual variable of the current request period. The dual variable is used to determine the resource allocation priority of multiple search results in the current request period. The dual variable is updated as the request period changes. The first determining module is further configured to determine, based on the dual variable, the resource allocation priority corresponding to the multiple search results in the current request period; The first processing module is further configured to allocate resources to the plurality of search results based on the resource allocation priority, and determine at least one target search result.

14. An electronic device, characterized in that, include: A memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any one of claims 1-12.

15. A computer storage medium, characterized in that, Used to store a computer program that, when executed by a computer, implements the method of any one of claims 1-12.

16. A computer program product, characterized in that, include: A computer-readable storage medium storing computer instructions that, when executed by one or more processors, cause the processors to perform the steps of the method of any one of claims 1-12.