CN117032978A - Method and device for dynamically allocating quota, storage medium, product and electronic equipment - Google Patents

Method and device for dynamically allocating quota, storage medium, product and electronic equipment Download PDF

Info

Publication number
CN117032978A
CN117032978A CN202311051010.3A CN202311051010A CN117032978A CN 117032978 A CN117032978 A CN 117032978A CN 202311051010 A CN202311051010 A CN 202311051010A CN 117032978 A CN117032978 A CN 117032978A
Authority
CN
China
Prior art keywords
consumption rate
sample
credit
time point
server node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311051010.3A
Other languages
Chinese (zh)
Inventor
刘琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202311051010.3A priority Critical patent/CN117032978A/en
Publication of CN117032978A publication Critical patent/CN117032978A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a method and a device for dynamically allocating a quota, a storage medium, a product and electronic equipment, wherein the method comprises the following steps: dividing the total credit into a pre-allocated credit and a dynamic allocated credit based on the pre-allocated credit proportion, allocating the pre-allocated credit to a server node, acquiring a historical consumption rate of the pre-allocated credit by the server node based on a current time point if the residual credit of the server node meets a preset allocation residual amount, predicting a future consumption rate of the server node at a next time point based on the historical consumption rate, wherein the next time point is the next time point of the current time point, and allocating the dynamic allocated credit to the server node based on the future consumption rate.

Description

Method and device for dynamically allocating quota, storage medium, product and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and apparatus for dynamically allocating a credit, a storage medium, a product, and an electronic device.
Background
The staff or manufacturer can obtain the request of the user through the server, and send the transaction resource requested by the user to the user according to the request of the user, wherein the transaction resource can be an entity or virtual commodity sold on line, can also be network traffic and the like, and it can be understood that the transaction resource has a certain amount, for example, the commodity amount is a certain amount. If staff or manufacturers distribute the quota of all the transaction resources to one server, the one server needs to receive and process the requests of all users for the transaction resources, the operation load of the server is large, and faults such as server avalanche and the like are easily caused. In the prior art, a plurality of server nodes are often deployed, and transaction resources with a certain amount are allocated to the plurality of server nodes, so that the plurality of server nodes jointly process user requests and jointly consume the transaction resource amount.
However, the number of user requests received and processed by different server nodes is often different, and the consumption rate of the quota is also different, so that the situation that the existing server nodes have no remaining quota and the server nodes have a lot of remaining quota is easy to occur, so that some users cannot request transaction resources, which causes trouble to users and manufacturers, and a quota allocation method capable of balancing transaction resource quota held by the server nodes needs to be provided.
Disclosure of Invention
The embodiment of the application provides a method, a device, a storage medium and electronic equipment for dynamically allocating the quota, which can predict future consumption rate according to the historical consumption rate of the pre-allocated quota consumed by a server, allocate reserved dynamic allocation quota according to the future consumption rate, avoid the situation of unbalanced residual quota caused by different consumption rates of different nodes and improve the rationality and accuracy of dynamic allocation of the quota. The technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for dynamically allocating a credit, where the method includes:
dividing the total credit into pre-allocated credit and dynamic allocation credit based on the pre-allocated credit proportion, and distributing the pre-allocated credit to a server node;
If the residual amount of the server node meets the preset allocation residual amount, acquiring the historical consumption rate of the server node on the pre-allocation amount based on the current time point;
predicting a future consumption rate of the server node at a next point in time based on the historical consumption rate, the next point in time being a next point in time from the current point in time;
and allocating the dynamic allocation credit to the server node based on the future consumption rate.
In a second aspect, an embodiment of the present application provides a consumption rate prediction model training method, where the method includes:
creating an initial consumption rate prediction model;
acquiring a sample historical consumption rate set corresponding to a sample time point in the consumption process of the pre-allocation credit by a server node and a sample actual consumption rate of a next time point of a sample, wherein the next time point of the sample is the next time point of the sample time point;
at least one round of model training is carried out on the initial consumption rate prediction model based on the sample historical consumption rate set corresponding to the sample time point, so that the sample future consumption rate corresponding to the next time point of the sample is obtained;
And carrying out parameter adjustment on the initial consumption rate prediction model based on the sample future consumption rate and the sample actual consumption rate until the residual amount of the server node meets the preset transfer residual amount, so as to obtain the consumption rate prediction model.
In a third aspect, an embodiment of the present application provides a device for dynamically allocating a credit, where the device includes:
the credit splitting module is used for splitting the total credit into a pre-allocated credit and a dynamic allocation credit based on the pre-allocated credit proportion, and distributing the pre-allocated credit to the server node;
the historical rate acquisition module is used for acquiring the historical consumption rate of the server node on the pre-allocation credit based on the current time point if the residual credit of the server node meets the preset allocation residual quantity;
a future rate prediction module, configured to predict a future consumption rate of the server node at a next time point based on the historical consumption rate, where the next time point is a next time point of the current time point;
and the dynamic allocation module is used for allocating the dynamic allocation amount to the server node based on the future consumption rate.
In a fourth aspect, an embodiment of the present application provides a consumption rate prediction model training apparatus, including:
the initial model creation module is used for creating an initial consumption rate prediction model;
the sample data acquisition module is used for acquiring a sample historical consumption rate set corresponding to a sample time point in the consumption process of the pre-allocation credit by the server node and a sample actual consumption rate of a next time point of a sample, wherein the next time point of the sample is the next time point of the sample time point;
the model training module is used for carrying out at least one round of model training on the initial consumption rate prediction model based on the sample historical consumption rate set corresponding to the sample time point to obtain a sample future consumption rate corresponding to the next time point of the sample;
and the parameter adjustment module is used for carrying out parameter adjustment on the initial consumption rate prediction model based on the sample future consumption rate and the sample actual consumption rate until the residual amount of the server node meets the preset allocation residual amount, so as to obtain the consumption rate prediction model.
In a fifth aspect, embodiments of the present application provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-described method steps.
In a sixth aspect, the present description provides a computer program product storing at least one instruction adapted to be loaded by a processor and to perform the method steps of one or more embodiments of the present description.
In a seventh aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
In one or more embodiments of the present application, the total credit is split into a pre-allocated credit and a dynamic allocated credit based on a pre-allocated credit ratio, the pre-allocated credit is allocated to a server node, if the remaining credit of the server node meets a preset allocation remaining amount, a historical consumption rate of the server node for the pre-allocated credit is obtained based on a current time point, a future consumption rate of the server node at a next time point is predicted based on the historical consumption rate, the next time point is the next time point of the current time point, and the dynamic allocated credit is allocated to the server node based on the future consumption rate. The future consumption rate is predicted according to the historical consumption rate of the server consumption pre-allocation credit, and the reserved dynamic allocation credit is allocated according to the future consumption rate, so that the situation that the residual credit is unbalanced due to different consumption rates of different nodes is avoided, and the rationality and accuracy of the dynamic allocation of the credit are improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram illustrating an example of credit allocation according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for dynamically allocating credit according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for dynamically allocating credit according to an embodiment of the present application;
FIG. 4 is an exemplary schematic diagram of a historical consumption rate determination provided by an embodiment of the application;
FIG. 5 is a schematic flow chart of a consumption rate prediction model training method according to an embodiment of the present application;
FIG. 6 is an exemplary schematic diagram of a model training provided by an embodiment of the present application;
fig. 7 is a schematic structural diagram of a dynamic allocation device for credit according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a dynamic allocating module according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a device for training a consumption rate prediction model according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The related staff or manufacturer can send the information of the transaction resource to the credit dynamic allocating device and delegate the credit dynamic allocating device to allocate the total credit of the transaction resource. It can be understood that the transaction resources may be entities or virtual commodities sold and transferred on line, or may be resources such as network traffic, and the total amount is the total amount of transaction resources, for example, the total amount of commodities, the total amount of network traffic, and the like. The dynamic quota allocating device can allocate the total quota to the server node, the server node can comprise at least one node, and the server node can be a server for receiving and processing user applications. The user can submit an application to the server node, and the server node can send and transfer transaction resources with a certain amount to the user according to the application of the user, for example, the user can submit an application of purchasing 5 commodities to the server node, if the remaining amount of the server node has 5 commodities, the server node can sell the 5 commodities to the user from the remaining amount, that is, the server node consumes the 5 commodities, that is, the remaining amount of the server node reduces the 5 commodities.
The method for dynamically allocating the quota can be realized by a computer program and can be operated on a quota dynamic allocating device based on a von neumann system. The computer program may be integrated in the application or may run as a stand-alone tool class application. The dynamic allocation device of the line can be a server, a cloud server or a server cluster, and is used for realizing a dynamic allocation method of the line, carrying out allocation management on the total line of the transaction resources and the server nodes, and the dynamic allocation device of the line can be connected with all the nodes in the server nodes, so that the line can be conveniently allocated to the server nodes, and the residual line, the historical consumption rate and the like of each node in the server nodes are obtained. The remaining amount is the amount which is not consumed in the server node, for example, the server node is allocated with the amount of 100 commodities, and 95 commodities are sold to the user according to the request of the user, and the remaining amount of the node is 5 commodities, namely, if the user continues to send the request to the node, the node can sell to 5 commodities at most. The historical consumption rate is the consumption rate of the line of the server node at the historical time point, reflects the consumption rate of the line of the server node at the historical time point, and can be understood that the higher the historical consumption rate is, the faster the consumption rate of the line of the server node is, and the historical time point is the past time point.
Referring to fig. 1, an exemplary schematic diagram of a credit allocation is provided for an embodiment of the present application, and the credit dynamic allocating device may split the total credit into a pre-allocated credit and a dynamic allocated credit, where the sum of the pre-allocated credit and the dynamic allocated credit is the total credit. The credit dynamic allocation device can allocate the pre-allocation credit to the server nodes first, for example, the pre-allocation credit can be equally allocated to each node in the server nodes for consumption by each node. It can be understood that the historical consumption rates of different nodes are different, that is, the consumption rates of different nodes on the credit are different, because some nodes receive more user requests and some nodes receive less user requests, some nodes consume the credit quickly and some nodes consume the credit slowly, so that the residual credits of different nodes are different. For example, both node a and node B may be allocated 100 items of commodity, but the rate of consumption of the node a is greater than the rate of consumption of the node B, the remaining amount of node a may be cleared before the remaining amount of node B, if the user sends a request to node a, it may be found that there is no remaining amount, for example, the "commodity is cleared" is displayed, and if the user sends a request to node B, it may be found that there is still remaining amount, for example, the "commodity is in stock" is displayed, and the situation that the remaining amount of each node is unbalanced may occur, which may cause trouble to the user and manufacturer in selling and transferring transaction resources. Therefore, the credit dynamic allocation device can acquire the historical consumption rate of the server node to the pre-allocated credit at the current time point, the historical consumption rate corresponding to the current time point can be the credit consumption rate of the server node before the current time point, and the credit dynamic allocation device can predict the future consumption rate of the next time point according to the historical consumption rate, wherein the future consumption rate is the credit consumption rate of the server node at the next time point. And before the residual amount of the server node is zeroed, the dynamic allocation amount is distributed to the server node according to the future consumption rate so as to balance the residual amount of each node. It will be appreciated that the greater the future consumption rate of a node, the greater the credit allocated to that node, and vice versa the lesser the future consumption rate of a node.
The method for dynamically allocating the quota according to the present application will be described in detail with reference to specific embodiments.
Referring to fig. 2, a flow chart of a method for dynamically allocating credit is provided in an embodiment of the application. As shown in fig. 2, the method of the embodiment of the present application may include the following steps S102 to S108.
S102, dividing the total credit into a pre-allocated credit and a dynamic allocated credit based on the pre-allocated credit proportion, and distributing the pre-allocated credit to the server node.
Specifically, the dynamic allocation device of the credit can split the degree into the allocated credit and the dynamic allocation credit based on the ratio of the allocated credit, the numerical range of the pre-allocated credit ratio is 0-1, the pre-allocated credit ratio can be the initial setting of the dynamic allocation device of the credit, and related staff or manufacturers can set and store the pre-allocated credit. The sum of the pre-allocation credit and the dynamic allocation credit is the total credit, the pre-allocation credit can be the product of the pre-allocation credit proportion and the total credit, for example, the total credit is 100 commodities, the allocation credit proportion is 0.6, the pre-allocation credit can be 60 commodities, and the dynamic allocation credit is 40 commodities.
The credit dynamic allocation device may then allocate the pre-allocated credit to the server nodes, e.g. may equally allocate the pre-allocated credit to each of the server nodes.
And S104, if the residual amount of the server node meets the preset allocation residual amount, acquiring the historical consumption rate of the server node on the pre-allocation amount based on the current time point.
Specifically, the dynamic allocation device of the quota can detect the remaining quota of the server node in real time, that is, can detect the remaining quota of each node in the server node, if the detected remaining quota of the server node meets the preset allocation remaining amount, that is, indicates that the situation that the remaining quota in the server node is about to be cleared when the remaining quota is insufficient, in order to ensure that the dynamic allocation device of the quota of each node needs to allocate the reserved dynamic allocation quota to each node. The remaining capacity of the server node may satisfy the preset allocation capacity for the remaining capacity of any node, where the preset allocation capacity may be an initial setting of a capacity dynamic allocation device, or may be set by a relevant staff or manufacturer, for example, the preset allocation capacity may be a specific number, for example, may be 10 commodities, that is, when the remaining capacity of any node in the server node is equal to or less than 10 commodities, it indicates that the remaining capacity of the server node satisfies the preset allocation capacity, and the preset allocation capacity may also be a ratio of the remaining capacity to the pre-allocated capacity allocated to each node, for example, may be 5%, and if each node in the server node is allocated with 100 commodities, the remaining capacity of any node is equal to or less than 5 commodities, which indicates that the remaining capacity of the server node satisfies the preset allocation capacity.
If the remaining amount of the server node meets the preset allocation remaining amount, the amount dynamic allocation device may obtain a historical consumption rate of the pre-allocated amount by the server node based on a current time point, where the current time point is a time point when the amount dynamic allocation device detects that the remaining amount of the server node meets the preset allocation remaining amount. The historical consumption rate corresponding to the current time point is the consumption rate of the pre-allocated amount of the server node in a period of time before the current time point, and it can be understood that the historical consumption rate can be the consumption rate of the pre-allocated amount of each node.
S106, predicting the future consumption rate of the server node at the next time point based on the historical consumption rate.
Specifically, the credit dynamic allocation device can predict the future consumption rate of the server node at the next time point based on the historical consumption rate, where the future consumption rate is the credit consumption rate of the server node at the next time point. The next time point is the next time point of the current time point, and it can be understood that the quota dynamic allocating device can determine a plurality of time points in the process of consuming the quota by the server node according to a preset time interval, and the preset time interval can be initial setting of the quota dynamic allocating device, or can be set by related staff or manufacturers, for example, can be 5ms. The smaller the preset time interval is, the smaller the time interval between adjacent time points is, the more accurate the prediction result of the forehead dynamic allocation device is, but the larger the calculation frequency of the forehead dynamic allocation device is, the larger the power consumption and the load are.
For example, the credit dynamic allocating device may use the consumption rate prediction model to predict the future consumption rate, the credit dynamic allocating device may input the historical consumption rate of the server node into the consumption rate prediction model, and the consumption rate prediction model may output the future consumption rate of the server node at the next time point. It will be appreciated that the historical consumption rate includes the historical consumption rate of each node, so the future consumption rate may also include the future consumption rate of each node.
S108, distributing the dynamic allocation amount to the server node based on the future consumption rate.
Specifically, the dynamic credit allocating device may allocate the dynamic credit to the server node based on the future consumption rate, and since the future consumption rate may include the future consumption rate of each node, the dynamic credit allocating device may allocate the dynamic credit to each node according to the future consumption rate of each node, and it may be understood that the more credits are allocated to the node with the greater future consumption rate, the smaller credits are allocated to the node with the smaller future consumption rate.
The dynamic allocation device of the amount does not need to allocate all dynamic allocation amounts to the server node at one time, and the single allocation amount can be determined from dynamic allocation amounts based on a preset single allocation proportion, wherein the preset single allocation proportion can be initial setting of the dynamic allocation device of the amount, and can also be set by related staff or manufacturers, for example, the dynamic allocation amount can be 25%, namely, if the dynamic allocation amount is 100 commodities, the single allocation amount is 25 commodities. When the dynamic allocation device of the quota detects that the residual quota of the primary server node meets the preset allocation residual amount, the historical consumption rate can be determined, the future consumption rate can be predicted, then the single allocation quota is allocated to the server node according to the future consumption rate, if the residual quota of the server node is detected to meet the preset allocation residual amount again, the single allocation quota is determined from the dynamic allocation quota again, and then the single allocation quota is allocated to the server node until the dynamic allocation quota is cleared.
In the embodiment of the application, the total credit is split into the pre-allocated credit and the dynamic allocation credit based on the pre-allocated credit proportion, the pre-allocated credit is allocated to a server node, if the residual credit of the server node meets the preset allocation residual amount, the historical consumption rate of the server node on the pre-allocated credit is obtained based on the current time point, the future consumption rate of the server node at the next time point is predicted based on the historical consumption rate, the next time point is the next time point of the current time point, and the dynamic allocation credit is allocated to the server node based on the future consumption rate. The future consumption rate is predicted according to the historical consumption rate of the server consumption pre-allocation credit, and the reserved dynamic allocation credit is allocated according to the future consumption rate, so that the situation that the residual credit is unbalanced due to different consumption rates of different nodes is avoided, and the rationality and accuracy of the dynamic allocation of the credit are improved.
Referring to fig. 3, a flow chart of a method for dynamically allocating credit is provided in an embodiment of the application. As shown in fig. 3, the method of the embodiment of the present application may include the following steps S202 to S214.
S202, dividing the total credit into a pre-allocated credit and a dynamic allocated credit based on the pre-allocated credit proportion, and distributing the pre-allocated credit to the server node.
Specifically, the dynamic allocation device of the credit can split the degree into the allocated credit and the dynamic allocation credit based on the ratio of the allocated credit, the numerical range of the pre-allocated credit ratio is 0-1, the pre-allocated credit ratio can be the initial setting of the dynamic allocation device of the credit, and related staff or manufacturers can set and store the pre-allocated credit. The sum of the pre-allocation credit and the dynamic allocation credit is the total credit, the pre-allocation credit can be the product of the pre-allocation credit proportion and the total credit, for example, the total credit is 100 commodities, the allocation credit proportion is 0.6, the pre-allocation credit can be 60 commodities, and the dynamic allocation credit is 40 commodities.
The dynamic allocation device of the credit may then allocate the pre-allocated credit to the server node, for example, the pre-allocated credit may be equally allocated to each node in the server node, for example, the pre-allocated credit is 60 items, and there are 5 nodes in total, and then 12 items in the pre-allocated credit may be allocated to each node.
It will be appreciated that the server nodes include at least one node, and that all nodes may consume credits in accordance with received user requests in order to avoid server avalanches and reduce the operational load of individual servers. For example, the credit dynamic allocation device can determine the node for receiving and processing the user request according to the user information of the user, wherein the user information is information capable of reflecting the characteristics of the user, such as the years, the address and the user identification (User Identification, uid) of the user. For example, the dynamic allocation device of the quota may determine the user request of all the users with addresses in the first province, and the user request is received and processed by one node. The node for receiving and processing the user request may also be determined according to the user's Uid, for example, 100 total nodes, where the node numbers are 00, 01, and 99, respectively, and the node whose node number is the same as the last two digits of the Uid is determined to receive and process the user request, for example, the node whose node number is 35 is determined to receive and process the user request of the user if the last two digits of the user Uid are 35.
S204, if the remaining amount of the server node meets the preset allocation remaining amount, determining a preset number of time points corresponding to the current time point in the consumption process of the pre-allocation amount by the server node.
Specifically, the dynamic allocation device of the quota can detect the remaining quota of the server node in real time, that is, can detect the remaining quota of each node in the server node, if the detected remaining quota of the server node meets the preset allocation remaining amount, that is, indicates that the situation that the remaining quota in the server node is about to be cleared when the remaining quota is insufficient, in order to ensure that the dynamic allocation device of the quota of each node needs to allocate the reserved dynamic allocation quota to each node. The remaining capacity of the server node may satisfy the preset allocation capacity for the remaining capacity of any node, where the preset allocation capacity may be an initial setting of a capacity dynamic allocation device, or may be set by a relevant staff or manufacturer, for example, the preset allocation capacity may be a specific number, for example, may be 10 commodities, that is, when the remaining capacity of any node in the server node is equal to or less than 10 commodities, it indicates that the remaining capacity of the server node satisfies the preset allocation capacity, and the preset allocation capacity may also be a ratio of the remaining capacity to the pre-allocated capacity allocated to each node, for example, may be 5%, and if each node in the server node is allocated with 100 commodities, the remaining capacity of any node is equal to or less than 5 commodities, which indicates that the remaining capacity of the server node satisfies the preset allocation capacity.
It may be understood that the quota dynamic allocating device may determine a plurality of time points in the process of consuming the quota by the server node according to a preset time interval, that is, the time interval between adjacent time points is the preset time interval, where the preset time interval may be an initial setting of the quota dynamic allocating device, or may be set by a relevant staff or manufacturer, for example, may be 5ms. The smaller the preset time interval is, the smaller the time interval between adjacent time points is, the more accurate the prediction result of the forehead dynamic allocation device is, but the larger the calculation frequency of the forehead dynamic allocation device is, the larger the power consumption and the load are. If the residual amount of the server node detected by the amount dynamic allocation device meets the preset allocation residual amount, a preset number of time points corresponding to the current time point can be determined in the consumption process of the pre-allocation amount by the server node, wherein the current time point is the time point when the residual amount of the server node detected by the amount dynamic allocation device meets the preset allocation residual amount, the preset number of time points comprises the current time point and the time point before the current time point, which meets the preset number, and the preset number can be the initial setting of the amount dynamic allocation device, can also be set by related staff or manufacturers, and can be 8.
S206, determining historical consumption rates of the server node at each of the preset number of time points.
Specifically, the credit dynamic allocation device may determine the historical consumption rate of the server node at each time point in the preset number of time points, and it may be understood that the historical consumption rate includes the historical consumption rate of each node, so the credit dynamic allocation device may determine the historical consumption rate of each node at each time point in the preset number of time points.
Referring to fig. 4, an exemplary schematic diagram of determining a historical consumption rate is provided for the embodiment of the present application, and the credit dynamic allocation device may determine at least one time point in the process of consuming the credit by the server node according to a preset time interval, where the interval time between two adjacent time points is a preset time interval, for example, if the preset time interval is t, the interval time between two adjacent time points a and b is t. If the dynamic allocation device of the quota detects that the remaining quota of the server node meets the preset allocation remaining amount at the current time point c, a preset number of time points corresponding to the current time point can be determined in the consumption process of the pre-allocation quota by the server node, and if the preset number is 8, as shown in fig. 4, the preset number of time points corresponding to the current time point is 8 time points including the current time point.
The device for dynamically allocating the quota can also determine the historical consumption rate at each time point, the device for dynamically allocating the quota can determine the residual quota of the server node at each time point, and the historical consumption rate of the server node at the current time point can be obtained at preset time intervals by using the difference between the residual quota at the current time point and the residual quota at the last time point. As shown in fig. 4, the device for dynamically allocating the credit may determine the remaining credit of the node a at the time point a and the remaining credit of the node a at the time point b, and then divide the difference between the remaining credit of the node a at the time point b and the remaining credit of the node a at the time point a by a preset time interval to obtain the historical consumption rate of the node a at the time point b.
S208, generating a historical consumption rate set corresponding to the current time point based on the historical consumption rate corresponding to each time point.
Specifically, the credit dynamic allocation device may generate a historical consumption set corresponding to the current time point based on the historical consumption rate corresponding to each time point.
Alternatively, if the historical consumption rate at the current time point c of the server node is v c If the preset number is n, the historical consumption set corresponding to the current time point c may be [ v ] c-n ,v c-n+1 ,…,v c ]I.e. comprising a historical consumption rate b corresponding to a point in time c-n c-n Historical consumption rate b at time point c-n+1 c-n+1 Historical consumption rate v at current time point c c The historical consumption rate at n time points in total, it will be appreciated that time point c-n is the last time point of time point c-n+1.
Alternatively, since the server node may include at least one node, the historical consumption rate of the server node at a point in time may be a historical consumption rate distribution of each node at that point in time, i.e., include the historical consumption rate of each node. For example, the historical consumption rate at the current point in time c of the server node is v c If the server node contains N nodes in total, thenThe historical consumption rates of the N nodes at the current point in time c, respectively.
S210, based on the historical consumption rate set corresponding to the current time point, predicting the future consumption rate of the server node at the next time point by adopting a consumption rate prediction model.
Specifically, the credit dynamic allocation device can predict the future consumption rate of the server node at the next time point based on the historical consumption rate, where the future consumption rate is the credit consumption rate of the server node at the next time point. The credit dynamic allocation device can adopt a consumption rate prediction model to predict the future consumption rate, the credit dynamic allocation device can input the historical consumption rate of the server node into the consumption rate prediction model, and the consumption rate prediction model can output the future consumption rate of the server node at the next time point. It will be appreciated that the historical consumption rate includes the historical consumption rate of each node, so the future consumption rate may also include the future consumption rate of each node.
Alternatively, the consumption rate prediction model may be a transducer model, which may be an Encoder-Decoder (Encoder-Decoder) structure, and which may utilize an attention mechanism to increase the model training speed.
S212, obtaining the distribution weight coefficient of the server node based on the future consumption rate and the residual quota of the server node.
Specifically, the dynamic credit allocating device may allocate the dynamic credit to the server node based on the future consumption rate, and since the future consumption rate may include the future consumption rate of each node, the dynamic credit allocating device may allocate the dynamic credit to each node according to the future consumption rate of each node, and it may be understood that the more credits are allocated to the node with the greater future consumption rate, the smaller credits are allocated to the node with the smaller future consumption rate. The dynamic allocation device of the quota can obtain the allocation weight coefficient of the server node based on the future consumption rate and the residual quota of the server node, wherein the allocation weight coefficient comprises the allocation weight coefficient of each node, the larger the allocation weight coefficient is, the larger the dynamic allocation quota can be allocated to the node, otherwise, the smaller the allocation weight coefficient is, the smaller the dynamic allocation quota can be allocated to the node.
Optionally, the quota dynamic allocating device may determine a future consumption rate of the target node and a remaining quota of the target node, where the target node is any node in the server nodes, and the quota dynamic allocating device may divide the future consumption rate of the target node by the remaining quota of the target node to obtain an allocation weight coefficient of the target node.
Optionally, the calculation formula of the assigned weight coefficient is as follows:
wherein K is i The target node is assigned a weight coefficient,for the future consumption rate of the target node,is the remaining credit of the target node at the current point in time.
And S214, distributing the dynamic allocation amount to the server node based on the distribution weight coefficient.
Specifically, the dynamic allocation device of the credit may allocate the dynamic allocation credit to the server node based on the allocation weight coefficient, that is, allocate the dynamic allocation credit to each node according to the allocation weight coefficient of each node.
Optionally, the dynamic allocation device of the quota may obtain the sum of the allocation weight coefficients of all the nodes in the server node, divide the allocation weight coefficient of each node by the sum of the allocation weight coefficients to obtain the allocation weight of each node, and then may allocate the dynamic allocation quota to each node based on the allocation weight of each node. For example, the credit dynamic allocation device may divide the allocation weight coefficient of the target node by the sum of the allocation weight coefficients to obtain the allocation weight of the target node, and allocate the dynamic allocation credit to the target node based on the allocation weight.
Optionally, the dynamic allocation device of the credit does not need to allocate all dynamic allocation credits to the server node at one time, and the single allocation credit can be determined from the dynamic allocation credits based on a preset single allocation proportion, wherein the preset single allocation proportion can be the initial setting of the dynamic allocation device of the credit, and can also be set by related staff or manufacturers. When the dynamic allocation device of the quota detects that the residual quota of the primary server node meets the preset allocation residual amount, the historical consumption rate can be determined, the future consumption rate can be predicted, then the single allocation quota is allocated to the server node according to the future consumption rate, if the residual quota of the server node is detected to meet the preset allocation residual amount again, the single allocation quota is determined from the dynamic allocation quota again, and then the single allocation quota is allocated to the server node until the dynamic allocation quota is cleared.
The dynamic allocation device of the amount can multiply the single allocation amount by the allocation weight to obtain the target allocation amount, and then the target allocation amount is allocated to the target node, and the calculation formula is as follows:
wherein Q is i Allocating credit for a target allocated to a target node, K i And (3) distributing weight coefficients for the target nodes, wherein N is the total number of nodes contained in the server nodes, and W is dynamic allocation amount or single allocation amount.
In the embodiment of the application, the total credit is split into the pre-allocated credit and the dynamic allocation credit based on the pre-allocated credit proportion, the pre-allocated credit is allocated to the server node, the users can be partitioned, different nodes receive and process the user requests of the users in different regions, and the problems of server avalanche and the like caused by the fact that a single server receives and processes a large number of user requests are avoided. If the remaining amount of the server node meets the preset allocation remaining amount, determining a preset number of time points corresponding to the current time point in the consumption process of the server node on the pre-allocation amount, determining historical consumption rates of the server node at each time point in the preset number of time points, generating a historical consumption rate set corresponding to the current time point based on the historical consumption rates corresponding to each time point, predicting future consumption rates of the server node at the next time point based on the historical consumption rate set corresponding to the current time point, predicting the future consumption rates based on the historical consumption rate set of the server node when the pre-allocation amount is consumed, calculating the amount consumption rates under a unified scene, enabling the future consumption rates to be more fit with the current application scene, further improving the accuracy of the prediction of the future consumption rates, obtaining an allocation weight coefficient of the server node based on the future consumption rates and the remaining amount of the server node, and allocating the dynamic allocation amount to the server node based on the allocation weight coefficient. The future consumption rate is predicted according to the historical consumption rate of the server consumption pre-allocation credit, and the reserved dynamic allocation credit is allocated according to the future consumption rate, so that the situation that the residual credit is unbalanced due to different consumption rates of different nodes is avoided, and the rationality and accuracy of the dynamic allocation of the credit are improved.
In the foregoing embodiment, the device for dynamically allocating the quota adopts the consumption rate prediction model to predict the future consumption rate, so that in order to make the consumption rate prediction model more fit the current application scenario, the device for dynamically allocating the quota may perform model training on the initial consumption rate prediction model based on sample data generated in the process of pre-allocating the quota by the server node, so as to obtain the consumption rate prediction model. Referring to fig. 5, a flowchart of a consumption rate prediction model training method is provided in an embodiment of the present application. As shown in fig. 5, the method of the embodiment of the present application may include the following steps S302 to S308.
S302, an initial consumption rate prediction model is created.
Specifically, the credit dynamic allocating apparatus may create an initial consumption rate prediction model. The initial consumption rate prediction model may predict a future consumption rate at a time point next to the current time point based on a set of historical consumption rates corresponding to the current time point. The initial consumption rate prediction model may be a transducer model, which may be an encodable-Decoder structure, and which may utilize an attention mechanism to increase the model training speed.
S304, acquiring a sample historical consumption rate set corresponding to a sample time point in the consumption process of the pre-allocation quota by the server node and a sample actual consumption rate of a next time point of the sample.
Specifically, the sample time point of the server node in the process of pre-allocation of the credit can be obtained by the credit dynamic allocation device, and it can be understood that a large amount of sample data is needed for model training, so that the time point and the historical consumption rate set corresponding to the time point can be sequentially determined according to time sequence in the process of pre-allocation of the credit by the server node, the sample time point is any time point in the process of pre-allocation of the credit by the server node, the sample historical consumption rate set corresponding to the sample time point can be obtained by the credit dynamic allocation device after the sample time point is determined, and the sample historical consumption rate set is the historical consumption rate set corresponding to the sample time point.
The credit dynamic allocation device can also determine the actual sample consumption rate of the next time point of the sample, wherein the next time point of the sample is the next time point of the sample time point, and the actual sample consumption rate is the actual credit consumption rate of the next time point of the sample. The credit dynamic allocation device can divide the difference between the residual credit of the sample time point and the residual credit of the next sample time point by a preset time interval so as to obtain the actual sample consumption rate of the next sample time point.
Optionally, in the consumption process of the pre-allocation credit by the server node, the credit dynamic allocation device may determine a preset number of sample time points corresponding to the sample time points, where the preset number of sample time points include the sample time points and a preset number of time points before the sample time points, and time points in the preset number of sample time points are all time points in the consumption process of the pre-allocation credit by the server node. The credit dynamic allocation device can determine sample historical consumption rates of the server node at each time point in a preset number of sample time points, wherein the sample historical consumption rates are the historical consumption rates of the server node at each time point in the sample time points, and then a sample consumption rate set corresponding to the sample time points is generated based on the sample historical consumption rates at each time point.
Alternatively, since the server node may include at least one node, the sample historical consumption rate of the server node at a point in time may be a sample historical consumption rate distribution of each node at that point in time, i.e., include the sample historical consumption rate of each node.
S306, performing at least one round of model training on the initial consumption rate prediction model based on the sample historical consumption rate set corresponding to the sample time point to obtain the sample future consumption rate corresponding to the next time point of the sample.
Specifically, the credit dynamic allocation device may perform at least one round of model training on the initial consumption rate prediction model based on the sample historical consumption rate set corresponding to the sample time point, so as to obtain a sample future consumption rate corresponding to the next time point of the sample. The sample historical consumption rate set corresponding to the sample time point can be input into the initial consumption rate prediction model by the quota dynamic allocating device, the initial consumption rate prediction model can output the sample future consumption rate corresponding to the next sample time point, and the sample future consumption rate is the quota consumption rate of the next sample time point predicted by the initial consumption rate prediction model.
And S308, carrying out parameter adjustment on the initial consumption rate prediction model based on the future consumption rate of the sample and the actual consumption rate of the sample until the residual amount of the server node meets the preset allocation residual amount, so as to obtain the consumption rate prediction model.
Specifically, the quota dynamic allocating device may calculate the rate loss based on the future sample consumption rate and the actual sample consumption rate, and then perform parameter modulation on the initial consumption rate prediction model in the back propagation training process based on the rate loss until the quota dynamic allocating device detects that the remaining quota of the server node meets the preset allocation remaining amount, and the quota dynamic allocating device may confirm that the model training is completed, thereby obtaining the consumption rate prediction model, that is, the quota remaining in the server node is insufficient, and in order to avoid the situation that the remaining quota of different nodes is unbalanced, the quota dynamic allocating device needs to use the consumption rate prediction model to predict the future consumption rate of the next time point.
Optionally, since the server node may include at least one node, the future sample consumption rate may be a future sample consumption rate of each node at a next sample time point, the actual sample consumption rate may also be an actual sample consumption rate of each node at a next sample time point, and then the rate loss may be a mean square error (Mean Square Error, MSE), that is, the quota dynamic allocating device may calculate a mean square error based on the future sample consumption rate and the actual sample consumption rate, and parameter adjustment is performed on the initial consumption rate prediction model in the back propagation training process based on the mean square error until the remaining quota of the server node meets a preset allocation residual amount, to obtain the consumption rate prediction model.
Referring to fig. 6, an exemplary schematic diagram of model training is provided for the embodiment of the present application, and the credit dynamic allocation device may determine a sample time point and a sample historical consumption rate set corresponding to the sample time point according to a time sequence, and cycle to perform parameter adjustment on an initial consumption rate prediction model. For example, when the credit dynamic allocation device confirms the time point e as a sample time point and the preset number is 6, the preset number of sample time points corresponding to the time point e, that is, six time points before the time point e including the time point e, may be acquired, and the sample history consumption rate of each sample time point in the preset number of sample time points corresponding to the time point e is acquired, so as to obtain a sample history consumption rate set corresponding to the time point e. When the sample time point is the time point e and the next time point of the sample of the time point e is the time point f, the actual consumption rate of the sample is the actual consumption rate of the server node at the time point f, and the quota dynamic allocating device can input the sample historical consumption rate set corresponding to the time point e into the initial consumption rate prediction model to obtain the sample future consumption rate of the time point f, obtain the mean square error corresponding to the time point e according to the sample future consumption rate and the sample actual consumption rate of the time point f, and perform parameter adjustment on the initial consumption rate prediction model based on the mean square error corresponding to the time point e. After the parameter adjustment of the initial consumption rate prediction model based on the mean square error corresponding to the time point e is completed, the quota dynamic adjustment device confirms the next time point of the time point e, namely the time point f, as a sample time point, determines a preset number of sample time points corresponding to the time point f and a sample historical consumption rate set corresponding to the time point f, wherein the next time point of the sample at the moment is the next time point of the time point f, namely the time point g, continuously predicts the sample future consumption rate of the time point g based on the sample historical consumption rate set corresponding to the time point f, adjusts the parameter of the initial consumption rate prediction model based on the sample future consumption rate of the time point g and the sample actual consumption rate of the time point g, and so on until the residual quota of the server node meets the preset adjustment residual quantity, and the consumption rate prediction model is obtained.
In the embodiment of the application, a consumption rate prediction model training method is provided, the initial consumption rate prediction model is trained by adopting data generated by a server node in the consumption process of pre-allocation of the quota, the fitting degree of future consumption rate prediction and a current application scene is improved, the rationality and accuracy of future consumption rate prediction are further improved, and the rationality and accuracy of the quota dynamic allocation are further improved.
The following describes the device for dynamically allocating the credit provided by the embodiment of the application in detail with reference to fig. 7 to 8. It should be noted that, the dynamic allocation device of the quota in fig. 7-8 is used to execute the method of the embodiment of fig. 2 and 3 of the present application, and for convenience of explanation, only the relevant parts of the embodiment of the present application are shown, and specific technical details are not disclosed, please refer to the embodiment of fig. 2 and 3 of the present application.
Fig. 7 is a schematic structural diagram of a dynamic credit allocating device according to an exemplary embodiment of the application. The credit dynamic allocating device can be realized as whole or part of the device through software, hardware or the combination of the software and the hardware. The device 1 comprises a credit splitting module 11, a historical rate acquisition module 12, a future rate prediction module 13 and a dynamic allocating module 14.
The credit splitting module 11 is configured to split the total credit into a pre-allocated credit and a dynamic allocated credit based on a pre-allocated credit ratio, and allocate the pre-allocated credit to a server node;
a historical rate obtaining module 12, configured to obtain, based on a current time point, a historical consumption rate of the pre-allocated quota by the server node if the remaining quota of the server node meets a preset allocation remaining amount;
optionally, the history rate obtaining module 12 is specifically configured to determine, in a process of consuming the pre-allocation credit by the server node, a preset number of time points corresponding to a current time point, where the preset number of time points includes the current time point and a time point before the current time point;
determining historical consumption rates of the server node at each of the preset number of time points;
and generating a historical consumption rate set corresponding to the current time point based on the historical consumption rate corresponding to each time point.
A future rate prediction module 13, configured to predict a future consumption rate of the server node at a next time point based on the historical consumption rate, where the next time point is a next time point of the current time point;
Optionally, the future rate prediction module 13 is specifically configured to predict, based on the historical consumption rate set corresponding to the current time point, a future consumption rate of the server node at a next time point by using a consumption rate prediction model.
A dynamic allocation module 14 for allocating the dynamic allocation credit to the server node based on the future consumption rate.
Optionally, referring to fig. 8, a schematic structural diagram of a dynamic allocating module is provided in an embodiment of the present application, where the dynamic allocating module 14 includes:
a weight coefficient calculating unit 141, configured to obtain an allocation weight coefficient of the server node based on the future consumption rate and a remaining amount of the server node;
optionally, the weight coefficient calculating unit 141 is specifically configured to determine a future consumption rate of a target node and a remaining quota of the target node, where the target node is any node of the server nodes;
and dividing the future consumption rate of the target node by the residual quota of the target node to obtain the distribution weight coefficient of the target node.
And the credit allocation unit 142 is configured to allocate the dynamic allocation credit to the server node based on the allocation weight coefficient.
Optionally, the quota allocation unit 142 is specifically configured to obtain a sum of allocation weight coefficients of all nodes in the server node;
dividing the distribution weight coefficient of the target node by the sum of the distribution weight coefficients to obtain the distribution weight of the target node;
and distributing the dynamic allocation amount to the target node based on the distribution weight.
Optionally, the credit allocation unit 142 is specifically configured to determine a single allocated credit from the dynamic allocated credits based on a preset single allocated proportion;
and multiplying the single allocation credit by the allocation weight to obtain a target allocation credit, and allocating the target allocation credit to the target node.
In this embodiment, the total credit is split into the pre-allocated credit and the dynamic allocated credit based on the pre-allocated credit ratio, the pre-allocated credit is allocated to the server node, and the users can be partitioned, and different nodes receive and process the user requests of the users in different regions, so that the problems of server avalanche and the like caused by receiving and processing a large number of user requests by a single server are avoided. If the remaining amount of the server node meets the preset allocation remaining amount, determining a preset number of time points corresponding to the current time point in the consumption process of the server node on the pre-allocation amount, determining historical consumption rates of the server node at each time point in the preset number of time points, generating a historical consumption rate set corresponding to the current time point based on the historical consumption rates corresponding to each time point, predicting future consumption rates of the server node at the next time point based on the historical consumption rate set corresponding to the current time point, predicting the future consumption rates based on the historical consumption rate set of the server node when the pre-allocation amount is consumed, calculating the amount consumption rates under a unified scene, enabling the future consumption rates to be more fit with the current application scene, further improving the accuracy of the prediction of the future consumption rates, obtaining an allocation weight coefficient of the server node based on the future consumption rates and the remaining amount of the server node, and allocating the dynamic allocation amount to the server node based on the allocation weight coefficient. The future consumption rate is predicted according to the historical consumption rate of the server consumption pre-allocation credit, and the reserved dynamic allocation credit is allocated according to the future consumption rate, so that the situation that the residual credit is unbalanced due to different consumption rates of different nodes is avoided, and the rationality and accuracy of the dynamic allocation of the credit are improved.
The consumption rate prediction model training device provided by the embodiment of the application will be described in detail with reference to fig. 9. It should be noted that, the consumption rate prediction model training device in fig. 9 is used to execute the method of the embodiment of fig. 5 of the present application, and for convenience of explanation, only the portion relevant to the embodiment of the present application is shown, and specific technical details are not disclosed, please refer to the embodiment of fig. 5 of the present application.
Referring to fig. 9, a schematic diagram of a consumption rate prediction model training apparatus according to an exemplary embodiment of the present application is shown. The consumption rate prediction model training means may be implemented as all or part of the device by software, hardware or a combination of both. The apparatus 2 comprises an initial model creation module 21, a sample data acquisition module 22, a model training module 23 and a parameter adjustment module 24.
An initial model creation module 21 for creating an initial consumption rate prediction model;
a sample data obtaining module 22, configured to obtain a sample historical consumption rate set corresponding to a sample time point in a consumption process of a pre-allocation credit by a server node, and a sample actual consumption rate of a next time point of a sample, where the next time point of the sample is a next time point of the sample time point;
Optionally, the sample data obtaining module 22 is specifically configured to determine, in a process of consuming the pre-allocation credit by the server node, a preset number of sample time points corresponding to the sample time points, where the preset number of sample time points includes the sample time point and a time point before the sample time point;
determining a sample historical consumption rate of the server node at each of the preset number of sample time points;
generating a sample consumption rate set corresponding to the sample time point based on the sample historical consumption rate at each time point;
and acquiring the actual sample consumption rate of the server node at the next time point of the sample.
The model training module 23 is configured to perform at least one round of model training on the initial consumption rate prediction model based on the sample historical consumption rate set corresponding to the sample time point, so as to obtain a sample future consumption rate corresponding to the next sample time point;
and the parameter adjustment module 24 is configured to perform parameter adjustment on the initial consumption rate prediction model based on the sample future consumption rate and the sample actual consumption rate until the residual amount of the server node meets a preset allocation residual amount, so as to obtain a consumption rate prediction model.
Optionally, the parameter adjustment module 24 is specifically configured to calculate a mean square error based on the sample future consumption rate and the sample actual consumption rate;
and carrying out parameter adjustment on the initial consumption rate prediction model based on the mean square error until the residual amount of the server node meets the preset allocation residual amount, so as to obtain the consumption rate prediction model.
The embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are adapted to be loaded by a processor and execute the method for dynamically allocating the credit line and the method for training the consumption rate prediction model according to the embodiment shown in fig. 1 to fig. 6, and the specific execution process may refer to the specific description of the embodiment shown in fig. 1 to fig. 6, which is not repeated herein.
The present application further provides a computer program product, where at least one instruction is stored, where the at least one instruction is loaded by the processor and executed by the processor, where the specific execution process may refer to the specific description of the embodiment shown in fig. 1 to 6, and the description is omitted here.
Referring to fig. 10, a block diagram of an electronic device according to an exemplary embodiment of the present application is shown. The electronic device of the present application may include one or more of the following components: processor 110, memory 120, input device 130, output device 140, and bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected by a bus 150.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the overall electronic device using various interfaces and lines, performs various functions of the terminal 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and invoking data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware in at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 110 may integrate one or a combination of several of a central processor (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user page, an application program and the like; the GPU is used for being responsible for rendering and drawing of display content; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 110 and may be implemented solely by a single communication chip.
The Memory 120 may include a random access Memory (Random Access Memory, RAM) or a Read-Only Memory (ROM). Optionally, the memory 120 includes a Non-transitory computer readable medium (Non-Transitory Computer-Readable Storage Medium). Memory 120 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, which may be an Android (Android) system, including an Android system-based deep development system, an IOS system developed by apple corporation, including an IOS system-based deep development system, or other systems, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like.
Memory 120 may be divided into an operating system space in which the operating system runs and a user space in which native and third party applications run. In order to ensure that different third party application programs can achieve better operation effects, the operating system allocates corresponding system resources for the different third party application programs. However, the requirements of different application scenarios in the same third party application program on system resources are different, for example, under the local resource loading scenario, the third party application program has higher requirement on the disk reading speed; in the animation rendering scene, the third party application program has higher requirements on the GPU performance. The operating system and the third party application program are mutually independent, and the operating system often cannot timely sense the current application scene of the third party application program, so that the operating system cannot perform targeted system resource adaptation according to the specific application scene of the third party application program.
In order to enable the operating system to distinguish specific application scenes of the third-party application program, data communication between the third-party application program and the operating system needs to be communicated, so that the operating system can acquire current scene information of the third-party application program at any time, and targeted system resource adaptation is performed based on the current scene.
The input device 130 is configured to receive input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used to output instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 are touch display screens.
The touch display screen may be designed as a full screen, a curved screen, or a contoured screen. The touch display screen may also be designed as a combination of a full screen and a curved screen, and the combination of a special-shaped screen and a curved screen, which is not limited in the embodiment of the present application.
In addition, those skilled in the art will appreciate that the configuration of the electronic device shown in the above-described figures does not constitute a limitation of the electronic device, and the electronic device may include more or less components than illustrated, or may combine certain components, or may have a different arrangement of components. For example, the electronic device further includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (Wireless Fidelity, wiFi) module, a power supply, and a bluetooth module, which are not described herein.
In the electronic device shown in fig. 10, the processor 110 may be configured to invoke the credit dynamic allocation application program stored in the memory 120 and execute to implement the credit dynamic allocation method and/or the consumption rate prediction model training method according to various method embodiments of the present disclosure.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, or the like.
The foregoing disclosure is illustrative of the present application and is not to be construed as limiting the scope of the application, which is defined by the appended claims.
It should be noted that, information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals according to the embodiments of the present disclosure are all authorized by the user or are fully authorized by the parties, and the collection, use, and processing of relevant data is required to comply with relevant laws and regulations and standards of relevant countries and regions. For example, user information, transaction resource information, a credit, and the like referred to in this specification are acquired with sufficient authorization.

Claims (15)

1. A method for dynamically allocating a credit, the method comprising:
dividing the total credit into pre-allocated credit and dynamic allocation credit based on the pre-allocated credit proportion, and distributing the pre-allocated credit to a server node;
if the residual amount of the server node meets the preset allocation residual amount, acquiring the historical consumption rate of the server node on the pre-allocation amount based on the current time point;
predicting a future consumption rate of the server node at a next point in time based on the historical consumption rate, the next point in time being a next point in time from the current point in time;
and allocating the dynamic allocation credit to the server node based on the future consumption rate.
2. The method of claim 1, the obtaining, based on a current point in time, a historical consumption rate of the pre-allocation credit by the server node, comprising:
determining a preset number of time points corresponding to a current time point in the consumption process of the pre-allocation amount by the server node, wherein the preset number of time points comprise the current time point and a time point before the current time point;
determining historical consumption rates of the server node at each of the preset number of time points;
And generating a historical consumption rate set corresponding to the current time point based on the historical consumption rate corresponding to each time point.
3. The method of claim 2, the predicting a future consumption rate of the server node at a next point in time based on the historical consumption rate, comprising:
and predicting the future consumption rate of the server node at the next time point by adopting a consumption rate prediction model based on the historical consumption rate set corresponding to the current time point.
4. The method of claim 1, the assigning the dynamic allotment amount to the server node based on the future consumption rate, comprising:
obtaining an allocation weight coefficient of the server node based on the future consumption rate and the residual quota of the server node;
and distributing the dynamic allocation credit to the server node based on the distribution weight coefficient.
5. The method of claim 4, the obtaining the assigned weight coefficient of the server node based on the future consumption rate and the remaining credit of the server node, comprising:
determining a future consumption rate of a target node and a residual quota of the target node, wherein the target node is any node in the server nodes;
And dividing the future consumption rate of the target node by the residual quota of the target node to obtain the distribution weight coefficient of the target node.
6. The method of claim 4, the assigning the dynamic allotment credit to the server node based on the allotment weight coefficient, comprising:
acquiring the sum of distribution weight coefficients of all nodes in the server node;
dividing the distribution weight coefficient of the target node by the sum of the distribution weight coefficients to obtain the distribution weight of the target node;
and distributing the dynamic allocation amount to the target node based on the distribution weight.
7. The method of claim 6, the assigning the dynamic allotment credit to the target node based on the assignment weight, comprising:
determining a single allocation credit from the dynamic allocation credits based on a preset single allocation proportion;
and multiplying the single allocation credit by the allocation weight to obtain a target allocation credit, and allocating the target allocation credit to the target node.
8. A consumption rate prediction model training method, the method comprising:
creating an initial consumption rate prediction model;
Acquiring a sample historical consumption rate set corresponding to a sample time point in the consumption process of the pre-allocation credit by a server node and a sample actual consumption rate of a next time point of a sample, wherein the next time point of the sample is the next time point of the sample time point;
at least one round of model training is carried out on the initial consumption rate prediction model based on the sample historical consumption rate set corresponding to the sample time point, so that the sample future consumption rate corresponding to the next time point of the sample is obtained;
and carrying out parameter adjustment on the initial consumption rate prediction model based on the sample future consumption rate and the sample actual consumption rate until the residual amount of the server node meets the preset transfer residual amount, so as to obtain the consumption rate prediction model.
9. The method of claim 8, wherein the obtaining the sample historical consumption rate set corresponding to the sample time point in the consumption process of the pre-allocation credit by the server node, and the sample actual consumption rate of the next time point of the sample comprises:
determining a preset number of sample time points corresponding to sample time points in the consumption process of the pre-allocation amount by the server node, wherein the preset number of sample time points comprise the sample time points and time points before the sample time points;
Determining a sample historical consumption rate of the server node at each of the preset number of sample time points;
generating a sample consumption rate set corresponding to the sample time point based on the sample historical consumption rate at each time point;
and acquiring the actual sample consumption rate of the server node at the next time point of the sample.
10. The method of claim 8, wherein the parameter adjusting the initial consumption rate prediction model based on the sample future consumption rate and the sample actual consumption rate until the amount of consumption of the server node satisfies a dynamic allocation condition, to obtain a consumption rate prediction model, comprises:
calculating a mean square error based on the sample future consumption rate and the sample actual consumption rate;
and carrying out parameter adjustment on the initial consumption rate prediction model based on the mean square error until the residual amount of the server node meets the preset allocation residual amount, so as to obtain the consumption rate prediction model.
11. A credit dynamic allocating device, the device comprising:
the credit splitting module is used for splitting the total credit into a pre-allocated credit and a dynamic allocation credit based on the pre-allocated credit proportion, and distributing the pre-allocated credit to the server node;
The historical rate acquisition module is used for acquiring the historical consumption rate of the server node on the pre-allocation credit based on the current time point if the residual credit of the server node meets the preset allocation residual quantity;
a future rate prediction module, configured to predict a future consumption rate of the server node at a next time point based on the historical consumption rate, where the next time point is a next time point of the current time point;
and the dynamic allocation module is used for allocating the dynamic allocation amount to the server node based on the future consumption rate.
12. A consumption rate prediction model training apparatus, the apparatus comprising:
the initial model creation module is used for creating an initial consumption rate prediction model;
the sample data acquisition module is used for acquiring a sample historical consumption rate set corresponding to a sample time point in the consumption process of the pre-allocation credit by the server node and a sample actual consumption rate of a next time point of a sample, wherein the next time point of the sample is the next time point of the sample time point;
the model training module is used for carrying out at least one round of model training on the initial consumption rate prediction model based on the sample historical consumption rate set corresponding to the sample time point to obtain a sample future consumption rate corresponding to the next time point of the sample;
And the parameter adjustment module is used for carrying out parameter adjustment on the initial consumption rate prediction model based on the sample future consumption rate and the sample actual consumption rate until the residual amount of the server node meets the preset allocation residual amount, so as to obtain the consumption rate prediction model.
13. A computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the method steps of any one of claims 1 to 7 and 8 to 10.
14. A computer program product storing at least one instruction for loading by a processor and performing the method steps of any of claims 1-7 and 8-10.
15. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1-7 and 8-10.
CN202311051010.3A 2023-08-18 2023-08-18 Method and device for dynamically allocating quota, storage medium, product and electronic equipment Pending CN117032978A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311051010.3A CN117032978A (en) 2023-08-18 2023-08-18 Method and device for dynamically allocating quota, storage medium, product and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311051010.3A CN117032978A (en) 2023-08-18 2023-08-18 Method and device for dynamically allocating quota, storage medium, product and electronic equipment

Publications (1)

Publication Number Publication Date
CN117032978A true CN117032978A (en) 2023-11-10

Family

ID=88644687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311051010.3A Pending CN117032978A (en) 2023-08-18 2023-08-18 Method and device for dynamically allocating quota, storage medium, product and electronic equipment

Country Status (1)

Country Link
CN (1) CN117032978A (en)

Similar Documents

Publication Publication Date Title
CN110851529B (en) Calculation power scheduling method and related equipment
CN109727070B (en) Method and device for determining potential active users
CN110505165B (en) Method and device for unloading edge calculation tasks based on bidirectional auction mechanism
CN108306874B (en) Service interface access current limiting method and device
CN106959894A (en) Resource allocation methods and device
CN109815405B (en) Gray level shunting method and system
CN113196238A (en) Service-aware serverless cloud computing system
CN116680060B (en) Task allocation method, device, equipment and medium for heterogeneous computing system
CN104008016A (en) Information processing apparatus, resource control method, and program
CN113672375A (en) Resource allocation prediction method, device, equipment and storage medium
WO2022068183A1 (en) Configuration generation method and apparatus, electronic device and storage medium
CN113778675A (en) Calculation task distribution system and method based on block chain network
CN114020469A (en) Edge node-based multi-task learning method, device, medium and equipment
CN111008767B (en) Internet financial technology architecture evaluation method, device, electronic equipment and medium
CN106817296B (en) Information recommendation test method and device and electronic equipment
CN112182374A (en) Inventory control method, device, electronic equipment and computer readable medium
CN116777518A (en) Transaction management method, device, storage medium and equipment
CN113760521A (en) Virtual resource allocation method and device
CN117032978A (en) Method and device for dynamically allocating quota, storage medium, product and electronic equipment
CN114612037A (en) Warehouse information management method and system
CN114996005A (en) Resource scheduling method, device, equipment and medium
CN111694670B (en) Resource allocation method, apparatus, device and computer readable medium
CN111985967A (en) Article information generation method and device, electronic equipment and computer readable medium
CN110633115A (en) Task distribution method and device, electronic equipment and storage medium
CN111932190B (en) Article information display method, apparatus, device and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination