CN116992158B - Recommendation method and device for resource allocation, storage medium and electronic device - Google Patents

Recommendation method and device for resource allocation, storage medium and electronic device Download PDF

Info

Publication number
CN116992158B
CN116992158B CN202311252709.6A CN202311252709A CN116992158B CN 116992158 B CN116992158 B CN 116992158B CN 202311252709 A CN202311252709 A CN 202311252709A CN 116992158 B CN116992158 B CN 116992158B
Authority
CN
China
Prior art keywords
target
resource
matrix
account
round
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.)
Active
Application number
CN202311252709.6A
Other languages
Chinese (zh)
Other versions
CN116992158A (en
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.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent 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 Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202311252709.6A priority Critical patent/CN116992158B/en
Publication of CN116992158A publication Critical patent/CN116992158A/en
Application granted granted Critical
Publication of CN116992158B publication Critical patent/CN116992158B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • 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
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Computing Systems (AREA)
  • Algebra (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a recommendation method and device for resource configuration, a storage medium and an electronic device, wherein the recommendation method for resource configuration comprises the following steps: under the condition that the target resource platform receives resource demand information sent by a target account, M resource configurations which correspond to the resource demand information and are allowed to be provided by the target resource platform are obtained, and account weight information corresponding to the target account and global weight information corresponding to the target resource platform are obtained; constructing a target recommendation model for the target account according to the account weight information and the global weight information; the technical scheme is adopted to solve the problems that in the related technology, the matching degree between the recommended resource configuration and the resource demand information of the target account is lower and the like.

Description

Recommendation method and device for resource allocation, storage medium and electronic device
Technical Field
The embodiment of the application relates to the field of computers, in particular to a recommendation method and device for resource allocation, a storage medium and an electronic device.
Background
In the target resource platform, the recommendation of corresponding resource allocation according to the acquired account demands is an important basic function of the target resource platform.
Existing resource configuration recommendation methods often collect necessary computing resources according to account requirements (which can be understood as resource requirement information), for example, computing power infrastructures such as a CPU (Central Processing Unit, a central processing unit), a GPU (Graphics Processing Unit, a graphics processor), an NPU (Neural Processing Unit, a neural network processor), etc. to generate a plurality of resource configurations (which can be understood as a computing resource instance), score each resource configuration according to a predefined weighted scoring algorithm, and finally select a resource configuration with a higher score for recommendation, where the following problems may exist:
1) The recommended resource allocation only meets the account demands, but does not refer to the preference of the account, so that personalized recommendation is satisfactorily realized;
2) The weighting scoring algorithm is predefined for the weight of each type of resource or attribute in the resource configuration, and the actual weight of each type of resource or attribute is difficult to reflect, so that the recommended resource configuration may have low matching degree with the requirement of the account.
Aiming at the problems of low matching degree between the recommended resource configuration and the resource demand information of the target account in the related technology, an effective solution is not proposed.
Disclosure of Invention
The embodiment of the application provides a recommendation method and device for resource configuration, a storage medium and an electronic device, and aims to at least solve the problems that in the related technology, the matching degree between the recommended resource configuration and resource demand information of a target account is low and the like.
According to an embodiment of the present application, there is provided a recommendation method for resource configuration, including:
under the condition that a target resource platform receives resource demand information sent by a target account, acquiring M resource configurations which are corresponding to the resource demand information and are allowed to be provided by the target resource platform, and acquiring account weight information corresponding to the target account and global weight information corresponding to the target resource platform, wherein the account weight information is used for representing weights of all features of the resource configurations preferred by the target account, the global weight information is used for representing average weights of all features of the resource configurations preferred by an account set on the target resource platform, the resource demand information is used for indicating computing resources required by the target account when running network tasks, and M is a positive integer greater than or equal to 2;
Constructing a target recommendation model for the target account according to the account weight information and the global weight information;
and calling the target recommendation model to determine recommendation parameters between each of the M resource configurations and the resource demand information, and recommending K resource configurations corresponding to the maximum first K recommendation parameters to the target account, wherein the recommendation parameters are used for indicating the matching degree of the corresponding resource configurations and the resource demand information, and the matching degree of the resource configurations with the resource demand information is higher when the recommendation parameters are larger, and K is a positive integer which is greater than or equal to 1 and less than or equal to M.
Optionally, the obtaining the account weight information corresponding to the target account includes:
obtaining a target account number vector corresponding to the target account number from an account number matrix corresponding to the target resource platform, wherein each row of the account number matrix represents an account number vector of a registered account number on the target resource platform, the account number vector is used for representing the characteristics of resource configuration preferred by the corresponding account number, and the registered account number comprises the target account number;
Generating an account weight matrix according to the target account vector;
and determining the account weight matrix as the account weight information.
Optionally, the generating an account weight matrix according to the target account vector includes:
inputting the target account number vector into a multi-layer perceptron mapping network to obtain a parameter matrix output by the multi-layer perceptron mapping network;
and generating the account weight matrix according to the parameter matrix.
Optionally, the generating the account weight matrix according to the parameter matrix includes:
generating a first transfer matrix of the parameter matrix;
and generating the account weight matrix according to the parameter matrix and the first transfer matrix.
Optionally, the generating the account weight matrix according to the parameter matrix and the first transfer matrix includes:
performing linear operation on the parameter matrix and the first transfer matrix to obtain linear parameters;
and determining the value of the linear parameter on a second activation function as the account weight matrix.
Optionally, the invoking the target recommendation model determines recommendation parameters between each of the M resource configurations and the resource requirement information, including:
Invoking the target recommendation model to determine recommendation parameters between the ith resource configuration in the M resource configurations and the resource requirement information, wherein i is a positive integer greater than or equal to 1 and less than or equal to M:
calculating a cost function matrix corresponding to the target account according to the account weight information and the global weight information;
calculating an ith function solution of the ith resource configuration and the resource requirement information on a first loss function;
acquiring M information set matrixes corresponding to the resource configurations, wherein each resource configuration records a resource configuration scheme and service quality information with a corresponding relation, the resource configuration scheme is used for indicating computing resources provided by the corresponding resource configuration, the service quality information is used for indicating the operation effect of the network task when the corresponding resource configuration is applied, the information set matrixes comprise M rows, and the j-th row of the information set matrixes represents the j-th service quality information corresponding to the j-th resource configuration in the M resource configurations, wherein j is a positive integer greater than or equal to 1 and less than or equal to M;
And determining recommended parameters between the ith resource configuration and the resource demand information according to the resource demand information, the cost function matrix, the ith function solution and the information set matrix.
Optionally, the calculating the cost function matrix corresponding to the target account according to the account weight information and the global weight information includes:
determining an account weight matrix corresponding to the target account as the account weight information, and determining a global weight matrix corresponding to the target resource platform as the global weight information, wherein the account weight matrix is used for representing weights of all features of resource configuration preferred by the target account, and the global weight matrix is used for representing average weights of all features of resource configuration preferred by an account set on the target resource platform;
and determining the values of the account weight matrix and the global weight matrix on a first activation function as the cost function matrix.
Optionally, the calculating the ith function solution of the ith resource configuration and the resource requirement information on the first loss function includes:
q-round updating is carried out on the first initial matrix and the second initial matrix according to the cost function matrix corresponding to the target account, so that a first target matrix and a second target matrix are obtained;
And obtaining the ith function solution according to the first target matrix and the second target matrix.
Optionally, the Q-round updating is performed on the first initial matrix and the second initial matrix according to the cost function matrix corresponding to the target account, so as to obtain a first target matrix and a second target matrix, including:
the Q-th round of updating in the Q-round updating is carried out on the first initial matrix and the second initial matrix according to the cost function matrix corresponding to the target account, through the following steps:
calculating an intermediate matrix according to the cost function matrix corresponding to the target account;
acquiring a first initial matrix obtained by updating a Q-1 th round as a first initial matrix used by the Q-th round, wherein Q is a positive integer which is more than or equal to 1 and less than or equal to Q, and determining an identity matrix as the first initial matrix used by the Q-th round under the condition that Q takes a value of 1;
calculating a second initial matrix obtained by the q-th round of updating according to the first initial matrix used by the q-th round and the intermediate matrix, and generating a first initial matrix obtained by the q-th round of updating according to the second initial matrix obtained by the q-th round of updating;
under the condition that a second initial matrix obtained by the q-th round of updating and a first initial matrix obtained by the q-th round of updating meet a preset first convergence condition, determining the first initial matrix obtained by the q-th round of updating as the first target matrix, and determining the second initial matrix obtained by the q-th round of updating as the second target matrix;
And under the condition that the second initial matrix obtained by the q-th round of updating and the first initial matrix obtained by the q-th round of updating do not meet a preset first convergence condition, carrying out (q+1) -th round of updating on the second initial matrix obtained by the q-th round of updating and the first initial matrix obtained by the q-th round of updating.
Optionally, the calculating an intermediate matrix according to the cost function matrix corresponding to the target account includes:
performing division operation on the cost function matrix corresponding to the target account and a preset constant to obtain a reference matrix;
and performing exponential operation on the opposite number of the reference matrix to obtain the intermediate matrix.
Optionally, the calculating the second initial matrix obtained by updating the q-th round according to the first initial matrix used by the q-th round and the intermediate matrix includes:
performing multiplication operation on the second transposed matrix of the intermediate matrix and the first initial matrix used by the q-th round to obtain a first product of the q-th round;
and determining the reciprocal of the first product of the q-th round as a second initial matrix obtained by the q-th round updating.
Optionally, the generating the first initial matrix obtained by the q-th round of updating according to the second initial matrix obtained by the q-th round of updating includes:
Performing multiplication operation on the second transposed matrix of the intermediate matrix and the second initial matrix obtained by the q-th round update to obtain a second product of the q-th round;
and determining the reciprocal of the second product of the q-th round as a first initial matrix obtained by the q-th round updating.
Optionally, the obtaining the ith function solution according to the first target matrix and the second target matrix includes:
calculating an intermediate matrix according to the cost function matrix corresponding to the target account;
generating a first diagonal matrix corresponding to the first target matrix and generating a second diagonal matrix corresponding to the second target matrix;
and determining the product of the first diagonal matrix, the second diagonal matrix and the intermediate matrix as the ith functional solution.
Optionally, the determining, according to the resource requirement information, the cost function matrix, the ith function solution and the information set matrix, a recommended parameter between the ith resource configuration and the resource requirement information includes:
calculating recommended parameters between the resource configuration and the resource requirement information according to the ith item by the following formula:
wherein,representing said resource requirement information,/for >Representing the cost function matrix,/->Representing the ith functional solution, +.>For the third transpose of the information set matrix,/I>Is the Hadamard product of the matrix, +.>For the third activation function->Is a vector comprising M elements;
will beThe value of the i-th element of the list is determined as a recommended parameter between the i-th information of the quality of service and the information of the resource requirement.
Optionally, after recommending the K resource configurations corresponding to the first K maximum recommendation parameters to the target account, the method further includes:
constructing each resource configuration in the K resource configurations and corresponding resource demand information into an initial training sample, and obtaining K initial training samples;
labeling a first state label on an initial training sample of which the resource configuration is subjected to the selected operation by the target account, and labeling a second state label on an initial training sample of which the resource configuration is not subjected to the selected operation by the target account, so as to obtain a K-item label training sample;
and storing the K target training samples into a training sample set, wherein the training sample set uses the stored target training samples to train the target recommendation model used in the previous stage for R rounds under the condition that the training sample set meets the preset training conditions, so as to obtain a target recommendation model to be used in the next round, and R is a positive integer greater than or equal to 1.
Optionally, the performing R-round training on the target recommendation model used in the previous stage by using the stored target training sample to obtain a target recommendation model to be used in the next round includes:
the method comprises the following steps of carrying out an R-th training in R-round training on a target recommendation model, wherein R is a positive integer which is greater than or equal to 1 and less than or equal to R:
determining the target recommendation model obtained by training the (r-1) th round as the target recommendation model to be trained of the r round, wherein when r takes a value of 1, the target recommendation model used in the previous stage is determined as the target recommendation model to be trained of the r round;
inputting the target training sample into the target recommendation model to be trained in the r round to obtain recommendation parameters output by the target recommendation model to be trained in the r round;
calculating the value of a second loss function of the target recommendation model to be trained in the r round of training according to the recommendation parameters and the state label of the target training sample, wherein the state label comprises the first state label and the second state label;
and under the condition that the value of the second loss function meets a preset second convergence condition, determining the target recommendation model to be trained in the r-th round as the target recommendation model to be used in the next stage, and under the condition that the value of the second loss function does not meet the preset second convergence condition, adjusting model parameters of the target recommendation model to be trained in the r-th round, and taking the target recommendation model with the adjusted model parameters as the target recommendation model to be trained in the (r+1) -th round.
Optionally, the obtaining M resource configurations corresponding to the resource requirement information and allowed to be provided by the target resource platform includes:
acquiring a resource configuration scheme allowed to be provided by the target resource platform, and when a scheme quotation corresponding to each resource configuration scheme and the corresponding resource configuration scheme are adopted, calculating average network transmission delay, network delay and nonvolatile storage IO speed of the network task operation;
determining average network transmission delay, calculated network delay and nonvolatile storage IO speed of the network task operation as service quality information corresponding to each resource allocation scheme when the scheme quotation corresponding to each resource allocation scheme and the corresponding resource allocation scheme are adopted;
and constructing one resource allocation scheme and one service quality information with corresponding relations into one resource allocation, so as to obtain M resource allocation.
Optionally, the obtaining a resource configuration scheme allowed to be provided by the target resource platform includes:
acquiring a resource configuration text returned by the target resource platform, wherein the resource configuration text is used for describing computing resources allowed to be provided by the target resource platform;
Extracting configuration data of computing resources belonging to a target type from the resource configuration text, wherein the computing resources belonging to the target type are resources on which the network task normally operates, and the configuration data are used for indicating the sizes of various computing resources belonging to the target type;
and generating the corresponding resource configuration scheme according to the configuration data of the computing resources belonging to the target type.
Optionally, before the obtaining the M resource configurations that the target resource platform allows to provide and correspond to the resource requirement information, the method further includes:
receiving a resource demand text input by the target account;
extracting a first requirement field and a second requirement field from the resource requirement text, wherein the first requirement field records an account number necessary requirement of the target account number, the account number necessary requirement is used for indicating a computing resource on which the network task normally operates, the second requirement field records an account number service quality requirement of the target account number, and the account number service quality requirement is used for indicating a network performance parameter which does not influence the normal operation of the network task but influences the operation quality of the network task;
And converting the first requirement field and the second requirement field into vector forms to obtain the resource requirement information.
Optionally, the converting the first requirement field and the second requirement field into vector forms to obtain the resource requirement information includes:
obtaining an initial vector, wherein the initial vector comprises (n+m) elements;
filling values of corresponding elements of the initial vector according to the first demand field and the second demand field to obtain a target vector, wherein the first n elements of the (n+m) elements of the initial vector are used for representing the account number necessary demand of the target account number, and the last m elements of the (n+m) elements of the initial vector are used for representing the account number service quality demand of the target account number;
and determining the target vector as the resource requirement information.
According to another embodiment of the present application, there is also provided a recommendation device for resource configuration, including:
the system comprises an acquisition module, a target resource platform and a network task management module, wherein the acquisition module is used for acquiring M resource configurations which are corresponding to the resource demand information and are allowed to be provided by the target resource platform under the condition that the target resource platform receives resource demand information sent by the target account, and acquiring account weight information corresponding to the target account and global weight information corresponding to the target resource platform, wherein the account weight information is used for representing weights of all features of the resource configurations preferred by the target account, the global weight information is used for representing average weights of all features of the resource configurations preferred by an account set on the target resource platform, and the resource demand information is used for indicating computing resources required by the target account when running the network task, and M is a positive integer greater than or equal to 2;
The first construction module is used for constructing a target recommendation model for the target account according to the account weight information and the global weight information;
and the recommendation module is used for calling the target recommendation model to determine recommendation parameters between each resource configuration in the M resource configurations and the resource demand information, and recommending K resource configurations corresponding to the maximum first K recommendation parameters to the target account, wherein the recommendation parameters are used for indicating the matching degree of the corresponding resource configurations and the resource demand information, and the matching degree of the resource configurations with the resource demand information is higher when the recommendation parameters are larger, and K is a positive integer which is larger than or equal to 1 and smaller than or equal to M.
According to yet another aspect of the embodiments of the present application, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program is configured to execute the recommended method of resource allocation described above when running.
According to still another aspect of the embodiments of the present application, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the recommended method of resource allocation described above through the computer program.
In the embodiment of the present application, when receiving resource demand information sent by a target account, and obtaining M resource configurations provided by the target resource platform according to the resource demand information, the target resource platform obtains account weight information for characterizing weights of features of resource configurations preferred by the target account and global weight information corresponding to the target resource platform, where the global weight information is used to characterize average weights of features of resource configurations preferred by an account set on the target resource platform, then constructs a target recommendation model for the target account according to the account weight information and the global weight information, invokes the target recommendation model to determine recommendation parameters between each resource configuration and the resource demand information in the M resource configurations, ranks the M resource configurations, and recommends the first K resource configurations to the target account, where the more heavily ranked resource configurations and the resource demand information have a higher matching degree, on one hand, the resource configurations recommended in such a way can satisfy the computing resource demands proposed by the resource demand information of the target account, on the other hand, and uses the target recommendation model constructed for the target account to construct a recommendation model to determine recommendation parameters between each resource configuration and the M resource configurations, and ranks the M resource configurations to the target account numbers having a higher matching degree of the target account numbers. By adopting the technical scheme, the problems of low matching degree of the recommended resource configuration and the resource demand information of the target account in the related technology are solved, and the technical effect of improving the matching degree of the recommended resource configuration and the resource demand information of the target account is realized.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a recommended scenario for resource configuration according to an embodiment of the present application;
FIG. 2 is a flow chart of a recommendation method for resource allocation according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a target resource platform application according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a target recommendation model ordering resource configurations according to an embodiment of the present application;
FIG. 5 is a flow chart for calculating recommended parameters according to an embodiment of the present application;
FIG. 6 is a flow chart of a training target recommendation model according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a target account issuing resource demand information according to an embodiment of the present application;
FIG. 8 is a schematic diagram of acquiring a resource configuration according to an embodiment of the present application;
fig. 9 is a block diagram of a resource allocation recommendation device according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a schematic diagram of a recommended scenario for resource configuration according to an embodiment of the present application. As shown in fig. 1, a user (i.e., a target account number) inputs a user demand vector q, where the user demand vector q may represent resource demand information, after receiving the user demand vector q, a CSP (Computing Service Provider ) on the target resource platform queries a solution set (i.e., M resource configurations) and at the same time, the user corresponds to one user vector, and the target recommendation model inputs the user vector to the MLP multi-layer perceptron mapping network to obtain an account weight matrix (i.e., account weight information) corresponding to the user vector, and then substitutes the account weight matrix and a global weight matrix (i.e., global weight information) into an activation function ReLU to obtain a cost function matrixAnd use the cost function matrix +.>Computing solution setsSimilarity of each resource allocation in He A to user demand vector q>(i.e., recommended parameters). And finally recommending K resource configurations corresponding to the maximum first K recommendation parameters to the user.
In this embodiment, a recommendation method for resource configuration is provided, and fig. 2 is a flowchart of a recommendation method for resource configuration according to an embodiment of the present application, as shown in fig. 2, where the flowchart includes the following steps:
Step S202, under the condition that a target resource platform receives resource demand information sent by a target account, obtaining M resource configurations which correspond to the resource demand information and are allowed to be provided by the target resource platform, and obtaining account weight information corresponding to the target account and global weight information corresponding to the target resource platform, wherein the account weight information is used for representing weights of all features of the resource configurations preferred by the target account, the global weight information is used for representing average weights of all features of the resource configurations preferred by an account set on the target resource platform, and the resource demand information is used for indicating computing resources required by the target account when running network tasks, and M is a positive integer greater than or equal to 2;
step S204, a target recommendation model is built for the target account according to the account weight information and the global weight information;
step S206, invoking the target recommendation model to determine recommendation parameters between each of the M resource configurations and the resource requirement information, and recommending K resource configurations corresponding to the maximum first K recommendation parameters to the target account, where the recommendation parameters are used to indicate a matching degree of the corresponding resource configurations and the resource requirement information, and the matching degree of the resource configurations with the resource requirement information is higher when the recommendation parameters are larger, where K is a positive integer greater than or equal to 1 and less than or equal to M.
Through the steps, when the target resource platform receives resource demand information sent by the target account and obtains M resource configurations provided by the target resource platform according to the resource demand information, account weight information for representing weights of all features of the resource configurations preferred by the target account and global weight information corresponding to the target resource platform are obtained, the global weight information is used for representing average weights of all features of the resource configurations preferred by an account set on the target resource platform, then a target recommendation model is built for the target account according to the account weight information and the global weight information, recommendation parameters between each resource configuration and the resource demand information in the M resource configurations are determined by calling the target recommendation model, and the M resource configurations are sequenced, and the first K resource configurations are recommended to the target account, wherein the matching degree of the resource configurations which are sequenced earlier and the resource demand information is high, on the one hand, the resource configurations recommended in the mode can meet the calculation resource demands which are set by the resource demand information of the target account, on the other hand, the recommended resource configurations are constructed for the target account, the target account is used for constructing the target recommendation model, and the recommended resource configurations are sequenced, namely, the priority of the target account is higher than the target account is better when the priority is matched with the target account numbers which are sequenced by the target account. By adopting the technical scheme, the problems of low matching degree of the recommended resource configuration and the resource demand information of the target account in the related technology are solved, and the technical effect of improving the matching degree of the recommended resource configuration and the resource demand information of the target account is realized.
In the technical solution provided in step S202, most of the existing cloud computing data centers are each struggled with a computing service provider, and the account needs to be frequently engaged with and inquired about each computing service provider when searching for computing resources, which makes account demands and computing power supply of the computing service provider costly and hinders the application of computing power to a certain extent. To solve this problem, a target resource platform has been developed. The target resource platform opens and connects each computing service provider (which can be understood as a provider for providing cloud computing service) through a special network infrastructure, an account number (or a user) only needs to put forward demands to the target resource platform, the target resource platform automatically performs price inquiry and matching with each computing service provider, and then provides a computing solution, namely a configuration scheme of computing resources, to the account number according to the demands of the account number. The core functions of the target resource platform mainly comprise calculation network interconnection, transaction matching, resource allocation, identity authentication, safe operation and maintenance, audit and the like. The target resource platform is connected with an accessed computing service provider through a unified service access interface. The trade matching mainly means that after the account number issues own computing power demands on a target resource platform, the platform extracts core demands of the account number and transmits the core demands to computing service providers of all access platforms, the computing service providers provide corresponding computing resource configuration schemes and quotations to the platform according to matching conditions of own computing resources and account number demands, the platform synthesizes the computing resource configuration schemes returned by the computing service providers and matching degrees of the quotations and the account number demands to perform priority ranking, and finally presents the priority ranking to the account number selection. After the account number determines the scheme, the platform sends a request to a computing service provider, the computing service provider builds a service pipeline which is built in advance by the platform to serve the account number by instantiating the computing resource.
Optionally, the target resource platform in the present application may be, but is not limited to, a platform for trading resources for a user, where the user (or account) issues resource requirement information on the target resource platform, and then the target resource platform generates M pieces of resource configurations according to the received resource requirement information, where the M pieces of resource configurations may be, but are not limited to, provided by N computing service providers on the target resource platform according to the resource requirement information, and N is a positive integer greater than or equal to 1.
Optionally, in this embodiment, fig. 3 is a schematic diagram of an application of a target resource platform according to an embodiment of the present application, as shown in fig. 3, an account number performs identity authentication through an identity authentication login platform, and then submits its own computing requirement to the target resource platform. The target resource platform delivers the account demands to the resource scheduling module, the resource scheduling module queries a resource pool, screens a solution computing resource configuration scheme and quotation meeting the account computing demands, and then generates and screens proper resource configuration and submits the resource configuration to the account for use. Wherein the resource pool is a computing service network comprised of a plurality of computing service providers. The recommendation of the resource configuration is mainly applied to a resource scheduling module.
Optionally, in this embodiment, the network task may be, but not limited to, a task in a computing-oriented domain, for example, a computing task in an artificial intelligence domain, an AIGC (Artificial Intelligence Generated Content, artificial intelligence content generation) domain, or may be a task that is operated by an application, where the operation of the network task needs to be supported by a computing resource that is matched with the computing task, and the requirements of different network tasks on the computing resource are different, for example, the network task that is focused on instruction processing needs more CPU computing resources, the network task that is focused on image processing needs more GPU computing resources, while the network task that is focused on the neural network needs more NPU computing resources, the resource configuration provided by a computing service provider records a resource configuration scheme and service quality information, where the resource configuration scheme is used to indicate the resource quantity of each type of computing resource provided by the corresponding resource configuration, and the service quality information is used to indicate the operation effect of the network task when the corresponding resource configuration is applied, where the operation effect is reflected on the network task such as average network transmission delay, computing network delay, non-volatile memory IO speed, and other network attributes of the network task, and the like, and in addition, the network configuration also includes the preference of the resource configuration in the network configuration, and the best performance of the same account has a different service configuration, and the best performance is also recommended for the resource.
Optionally, in this embodiment, the resource requirement information is used to indicate a computing resource required when the target account runs a network task, where the computing resource includes multiple types, the resource requirement information may indicate computing power of the computing resource of the various types, and the computing resource may be approximately divided into the following resources:
1) The computing power resources can be realized according to different hardware, and can be roughly divided into general computing power (x 86 and ARM (Advanced RISC Machines)) and special computing power (GPU, TPU (Tensor Processing Unit, tensor processor), NPU, FPGA (Field-Programmable Gate Array, field programmable gate array), ASIC (Application Specific Integrated Circuit, special integrated circuit) and the like);
2) Storage resources, mainly divided into volatile storage (DRAM (Dynamic Random Access Memory, dynamic random access memory) storage) and nonvolatile storage (HDD (Hybrid Hard Drive, hybrid hard disk) or SSD (Solid State Drive, solid state disk);
3) Network transmission resources are mainly divided into a low-speed control scheduling network (100 Mbps, 1000 Mbps) and a high-speed computing network (56G, 100G, 200G, or 400G).
The computing resources, storage resources, and network transport resources described above are often distributed in computing clusters of computing service providers that provide account usage by encapsulating computing resources in the computing clusters using resource pooling and containment (K8 s) techniques to reconstruct separate computing solution instances (i.e., resource configurations).
Optionally, in this embodiment, the target recommendation model may be, but is not limited to, constructed for the target account number by: acquiring an account weight matrix corresponding to the target account, and a global weight matrix corresponding to the target resource platform, wherein the account weight matrix is used for representing weights of all features of resource configuration preferred by the target account, and the global weight matrix is used for representing average weights of all features of resource configuration preferred by an account set (which can comprise all accounts or part of accounts) on the target resource platform; and constructing a target recommendation model for the target account according to the account weight matrix and the global weight matrix.
Optionally, in this embodiment, the target recommendation model is a recommendation model constructed for the target account, which may be understood that when recommending resource configurations for each registered account on the target resource platform, each registered account uses a corresponding recommendation model, and model parameters of recommendation models used by different accounts are affected by resource demand information of corresponding accounts in a history record and resource configurations selected by the accounts, and may be understood that a recommendation model for recommending resource configurations for the registered account is a model customized for the registered account, so that recommended resource configurations and preference matching of the registered account can be achieved, personalized resource configurations are achieved, and matching degree of recommended resource configurations and resource demand information of the target account is improved.
Optionally, in this embodiment, the target recommendation model is constructed according to an account weight matrix corresponding to the target account and a global weight matrix corresponding to the target resource platform, so that when the target recommendation model recommends resource configurations for the target account, in a process of sequencing each resource configuration, not only is an average weight of each feature of resource configurations preferred by all registered accounts on the whole target resource platform considered, the average weight can represent a general weight of most registered accounts, unlike in the related art, when recommending resource configurations for the registered accounts, different registered accounts adopt the same scoring standard and index weight, and the scheme further considers weights of each feature of resource configurations preferred by the target account on the basis of the average weight, so that the recommended resource configurations are closer to the preferences of the target account, and the matching degree of the recommended resource configurations and resource demand information of the target account is improved.
In an exemplary embodiment, the account weight information corresponding to the target account may be obtained, but is not limited to, by: obtaining a target account number vector corresponding to the target account number from an account number matrix corresponding to the target resource platform, wherein each row of the account number matrix represents an account number vector of a registered account number on the target resource platform, the account number vector is used for representing the characteristics of resource configuration preferred by the corresponding account number, and the registered account number comprises the target account number; and generating an account weight matrix according to the target account vector, and determining the account weight matrix as the account weight information.
Optionally, in this embodiment, each row of the account matrix represents an account vector of a registered account on the target resource platform, for example, the current registered account on the target resource platform is 100, and then the account matrix of the target resource platform includes 100 rows, each row represents an account vector of a registered account, each target resource platform corresponds to an account matrix, the account matrix is updated along with a transaction behavior of the registered account on the target resource platform on the resource configuration, each row in the account matrix corresponds to a registered account, and each row of updating is independent, for example, a first row represents an account vector a of the registered account a, a second row represents an account vector B of the registered account B, and then updating of a subsequent account vector a of the account matrix is only affected by the transaction behavior of the registered account a on the target resource platform on the resource configuration and is not affected by the registered account B.
Optionally, in this embodiment, different registered accounts have unique account vectors, and the target account vector corresponding to the target account is recorded as follows:wherein->Representing the vector dimension of the target account number vector.
In one exemplary embodiment, the account weight matrix may be generated from the target account vector by, but is not limited to: inputting the target account number vector into a multi-layer perceptron mapping network to obtain a parameter matrix output by the multi-layer perceptron mapping network; and generating the account weight matrix according to the parameter matrix.
Alternatively, in this embodiment, the following pair generates an account weight matrix from the target account vector (as followsIndicated) are described:
step 1) inputting the target account number vector into a multi-layer perceptron mapping network to obtain a parameter matrix output by the multi-layer perceptron mapping network, wherein the formula is as follows:
wherein,representing the target account number vector,/">Representing a multi-layer perceptron mapping network, < >>Representing a parameter matrix.
And 2) generating the account weight matrix according to the parameter matrix.
In one exemplary embodiment, the account weight matrix may be generated from the parameter matrix, but is not limited to, by: generating a first transfer matrix of the parameter matrix; and generating the account weight matrix according to the parameter matrix and the first transfer matrix.
Optionally, in this embodiment, generating the account weight matrix according to the parameter matrix includes the following steps:
step 1) generating the parameter matrixIs>
Step 2) according to the parameter matrixAnd said first transpose matrix->And generating the account weight matrix.
In one exemplary embodiment, the account weight matrix may be generated from the parameter matrix and the first transfer matrix, but is not limited to, by: performing linear operation on the parameter matrix and the first transfer matrix to obtain linear parameters; and determining the value of the linear parameter on a second activation function as the account weight matrix.
Optionally, in this embodiment, the account weight matrix may be generated according to the parameter matrix and the first forwarding matrix by using the following formula, but not limited to:
wherein,representing an account weight matrix,/->Representing a parameter matrix->Representing a first transpose matrix, ">Is a linear operation function>For the second activation function, +.>Representing an account weight matrix +.>The matrix dimension is->
In the technical solution provided in step S204, the input of the target recommendation model may be, but not limited to, the resource demand information and each of the M resource configurations, where the M resource configurations may be input to the target recommendation model at one time to obtain the ranking of each resource configuration, or may be sequentially input in a single manner, and the recommended parameters of each of the M resource configurations are summarized, so that the ranking is performed according to the recommended parameters, and fig. 4 is a schematic diagram of the ranking of the resource configurations by the target recommendation model according to the embodiment of the present application, and as shown in fig. 4, for the resource demand information input by the target account, each computing service provider provides a total of 4 resource configurations for selection, respectively: resource configuration 1, resource configuration 2, resource configuration 3, and resource configuration 4. Inputting the resource demand information and the 4 resource configurations into a target recommendation model, and preliminarily obtaining the matching degree of each resource configuration in the 4 resource configurations and the resource demand information by the target recommendation model, and sequencing from high to low according to the matching degree: resource configuration 4, resource configuration 1, resource configuration 3, and resource configuration 2. Finally, the first 3 resource configurations are output: resource configuration 4, resource configuration 1, and resource configuration 3 are recommended to the target account number.
Alternatively, in this embodiment, K may be a preset value, or may be dynamically valued according to M, for example, k=30%m.
In one exemplary embodiment, the target recommendation model may be invoked, but not limited to, to sort the M resource configurations by: sequentially determining recommendation parameters between each of the M resource configurations and the resource demand information through the target recommendation model, wherein the recommendation parameters are used for indicating the matching degree of the corresponding resource configuration and the resource demand information, and the matching degree is higher as the recommendation parameters are larger; sorting the M resource configurations in a descending order according to the recommended parameters; and executing intercepting operation on the M resource configurations to obtain the first K resource configurations.
Optionally, in this embodiment, the M resource allocation ranks may be ranked from large to small according to recommendation parameters, where the recommendation parameters may reflect a matching degree of the corresponding resource allocation and the resource requirement information, and because the recommendation parameters are generated by the target recommendation model, which is constructed for the target account, in a process of constructing the target recommendation model, not only average weights of all features of the resource allocation preferred by all the registered accounts on the whole target resource platform are considered, the average weights may represent general weights of most registered accounts, but also weights of all features of the resource allocation preferred by the target account are further considered, so that the recommended resource allocation is closer to the preference of the target account, and the matching degree of the recommended resource allocation and the resource requirement information of the target account is improved.
Optionally, in this embodiment, in general, the target resource platform may recommend a large number of resource configurations according to the resource requirement information, that is, the value of M is larger, if the resource configurations are displayed to the target account one by one, on one hand, the resource configurations with lower matching degree are displayed to cause network resource waste on the network resource of the target resource platform, and on the other hand, the efficiency of selecting the resource configurations by the target account may be reduced, so that K resource configurations before sorting are generally intercepted for selecting the target account, and the recommendation efficiency of the resource configurations is improved.
In one exemplary embodiment, recommended parameters between each of the M resource configurations and the resource requirement information may be determined in turn by the target recommendation model, but not limited to, by: invoking the target recommendation model to determine recommendation parameters between the ith resource configuration in the M resource configurations and the resource requirement information, wherein i is a positive integer greater than or equal to 1 and less than or equal to M: calculating a cost function matrix corresponding to the target account according to the account weight information and the global weight information; calculating an ith function solution of the ith resource configuration and the resource requirement information on a first loss function; acquiring M information set matrixes corresponding to the resource configurations, wherein each resource configuration records a resource configuration scheme and service quality information with a corresponding relation, the resource configuration scheme is used for indicating computing resources provided by the corresponding resource configuration, the service quality information is used for indicating the operation effect of the network task when the corresponding resource configuration is applied, the information set matrixes comprise M rows, and the j-th row of the information set matrixes represents the j-th service quality information corresponding to the j-th resource configuration in the M resource configurations, wherein j is a positive integer greater than or equal to 1 and less than or equal to M; and determining recommended parameters between the ith resource configuration and the resource demand information according to the resource demand information, the cost function matrix, the ith function solution and the information set matrix.
Alternatively, in this embodiment, for any 1 resource configuration of the M resource configurations, the recommended parameter between the resource requirement information and the resource requirement information may be calculated through the above steps.
In one exemplary embodiment, the cost function matrix corresponding to the target account may be calculated from the account weight matrix and the global weight matrix by, but not limited to: determining an account weight matrix corresponding to the target account as the account weight information, and determining a global weight matrix corresponding to the target resource platform as the global weight information, wherein the account weight matrix is used for representing weights of all features of resource configuration preferred by the target account, and the global weight matrix is used for representing average weights of all features of resource configuration preferred by an account set on the target resource platform; and determining the values of the account weight matrix and the global weight matrix on a first activation function as the cost function matrix.
Optionally, in this embodiment, values of the account weight matrix and the global weight matrix on the first activation function are determined as the cost function matrix, where a formula is expressed as follows:
;/>
Wherein,as a cost function matrix>For account weight matrix, < ->For the global weight matrix, +.>For the first activation function, +.>Representing a cost function matrix->The matrix dimension is->,/>In order to obey the random coefficients of normal distribution, in +.>And takes a value. Each calculation +.>When (I)>Will be re-from->Random value of (B), ->Can ensure +.>Is non-negative.
In one exemplary embodiment, the ith functional solution of the ith resource configuration and the resource requirement information on the first loss function may be calculated, but is not limited to, by: q-round updating is carried out on the first initial matrix and the second initial matrix according to the cost function matrix corresponding to the target account, so that a first target matrix and a second target matrix are obtained; and obtaining the ith function solution according to the first target matrix and the second target matrix.
Optionally, in this embodiment, the recommended problem of resource allocation is defined as solving the following optimization problem:wherein the source demand information->And resource allocation set->Resource allocation set->Comprises->Resource allocation, solve->Medium and resource requirement information->Loss between->Minimum resource allocation->A solution to this optimization problem was obtained, and is described as: / >
However, the original problem of optimal transmission is a linear programming problem, and the solving speed, the solving scale and the conductivity are insufficient. One common approach is to introduce an entropy regularization term, building a first loss function (entropic regularized) to solve for:
wherein the configuration setComprises->Resource allocation->Is->Resource allocation->I < th >, < th >>For random coefficients subject to normal distribution, +.>For entropy regularization term, ++>Representing the i-th resource allocation->The value of the j-th element of (a), a->Is the ith functional solution. Above->The solution of (2) can be obtained by a first target matrix and a second target matrix.
In an exemplary embodiment, the first initial matrix and the second initial matrix may be updated in Q rounds according to the cost function matrix corresponding to the target account number, so as to obtain a first target matrix and a second target matrix, which are not limited to the following ways: the Q-th round of updating in the Q-round updating is carried out on the first initial matrix and the second initial matrix according to the cost function matrix corresponding to the target account, through the following steps: calculating an intermediate matrix according to the cost function matrix corresponding to the target account; acquiring a first initial matrix obtained by updating a Q-1 th round as a first initial matrix used by the Q-th round, wherein Q is a positive integer which is more than or equal to 1 and less than or equal to Q, and determining an identity matrix as the first initial matrix used by the Q-th round under the condition that Q takes a value of 1; calculating a second initial matrix obtained by the q-th round of updating according to the first initial matrix used by the q-th round and the intermediate matrix, and generating a first initial matrix obtained by the q-th round of updating according to the second initial matrix obtained by the q-th round of updating; under the condition that a second initial matrix obtained by the q-th round of updating and a first initial matrix obtained by the q-th round of updating meet a preset first convergence condition, determining the first initial matrix obtained by the q-th round of updating as the first target matrix, and determining the second initial matrix obtained by the q-th round of updating as the second target matrix; and under the condition that the second initial matrix obtained by the q-th round of updating and the first initial matrix obtained by the q-th round of updating do not meet a preset first convergence condition, carrying out (q+1) -th round of updating on the second initial matrix obtained by the q-th round of updating and the first initial matrix obtained by the q-th round of updating.
Optionally, in this embodiment, a specific step of acquiring the first target matrix and the second target matrix is illustrated, and the corresponding algorithm 1 is as follows:
input (Input): cost functionAccount demand vector->
Initialization (initialization):
While and />is not converged do (in->And->Execute without convergence):
end While (stopped);
output (Output)
The first initial matrixSecond initial matrix->Obtaining a first target matrix through cyclic updating iteration>And a second target matrix->,/>Is->Is a solution to (a).
In one exemplary embodiment, the intermediate matrix may be calculated from the cost function matrix corresponding to the target account number, but is not limited to, by: performing division operation on the cost function matrix corresponding to the target account and a preset constant to obtain a reference matrix; and performing exponential operation on the opposite number of the reference matrix to obtain the intermediate matrix.
Optionally, in this embodiment, division operation is performed on the cost function matrix corresponding to the target account number and a preset constant to obtain a reference matrix, where the reference matrix is expressed as:
the method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Is an intermediate matrix>As a cost function matrix>Is a preset constant- >Is an intermediate matrix>Is an exponential operation function.
In one exemplary embodiment, the second initial matrix obtained by the q-th round update may be calculated from the first initial matrix used by the q-th round and the intermediate matrix by, but not limited to: performing multiplication operation on the second transposed matrix of the intermediate matrix and the first initial matrix used by the q-th round to obtain a first product of the q-th round; and determining the reciprocal of the first product of the q-th round as a second initial matrix obtained by the q-th round updating.
Optionally, in this embodiment, multiplication is performed on the second transpose matrix of the intermediate matrix and the first initial matrix used by the q-th round to obtain a first product of the q-th round; determining the reciprocal of the first product of the q-th round as the second initial matrix obtained by the q-th round update is represented in the algorithm 1 as follows:wherein the first initial matrix +.>Is a unit matrix->,/>For intermediate matrix->Is a second transpose of the first transpose of the second transpose of the first transpose.
In one exemplary embodiment, the first initial matrix obtained by the q-th round of update may be generated according to the second initial matrix obtained by the q-th round of update by, but not limited to: performing multiplication operation on the second transposed matrix of the intermediate matrix and the second initial matrix obtained by the q-th round update to obtain a second product of the q-th round; and determining the reciprocal of the second product of the q-th round as a first initial matrix obtained by the q-th round updating.
Optionally, in this embodiment, multiplication is performed on the second transposed matrix of the intermediate matrix and the second initial matrix obtained by the update of the q-th round to obtain a second product of the q-th round; determining the reciprocal of the second product of the q-th round as a first initial matrix updated by the q-th round, and representing the first initial matrix as the first initial matrix in the algorithm 1:
wherein the second initial matrix obtained by the q-th round of updating is +.>,/>For intermediate matrix->Is>Updating the obtained first initial matrix for the q-th round.
In one exemplary embodiment, the ith functional solution may be obtained from the first target matrix and the second target matrix by, but not limited to, the following: calculating an intermediate matrix according to the cost function matrix corresponding to the target account; generating a first diagonal matrix corresponding to the first target matrix and generating a second diagonal matrix corresponding to the second target matrix; and determining the product of the first diagonal matrix, the second diagonal matrix and the intermediate matrix as the ith functional solution.
Optionally, in this embodiment, a first diagonal matrix corresponding to the first target matrix is generated, which is expressed as the following in algorithm 1:
Optionally, in this embodiment, a second diagonal matrix corresponding to the second target matrix is generated, which is expressed as the following in algorithm 1:
alternatively, in this embodiment, the product of the first diagonal matrix, the second diagonal matrix, and the intermediate matrix is determined as the ith functional solution, which is expressed as the following in algorithm 1:
in one exemplary embodiment, the recommended parameters between the resource configuration and the resource requirement information of the ith item may be determined, but are not limited to, according to the resource requirement information, the cost function matrix, the ith function solution, and the information set matrix by:
calculating recommended parameters between the resource configuration and the resource requirement information according to the ith item by the following formula:
wherein,representing said resource requirement information,/for>Representing the cost function matrix,/->Representing the ith functional solution, +.>For the third transpose of the information set matrix,/I>Is the Hadamard product of the matrix, +.>For the third activation function->Is a vector comprising M elements;
will beThe value of the i-th element of the list is determined as a recommended parameter between the i-th information of the quality of service and the information of the resource requirement.
Alternatively, in this embodiment, the first and second embodiments,the i-th element of (a)The value of (2) can be expressed as +.>,/>Representation->Is a vector comprising r elements, i.e. r +.>
Alternatively, in the present embodiment, the vector distance between the individual resource configuration and the resource demand information may also be calculated using the following formula:/>Wherein->For resource demand information, ++>For a single resource allocation, +.>Representing the cost function matrix,/->Representing the ith functional solution, +.>Is the Hadamard product of the matrix. The vector distanceThe smaller the resource allocation is, the more the resource allocation is matched with the resource demand information, and in the practical application scenario, one account demand is often corresponding to a plurality of resource allocation, so the above can be adopted to improve the computing efficiencyTransforming and normalizing, i.e. calculating +.>Is a formula of (2). Calculation of->The normalized similarity of the resource demand information and the plurality of resource configurations can be obtained through one-time parallel calculation. It should be noted that->Heel->Opposite monotonicity->The larger the value of (c) means that the more the individual resource configuration fits the resource requirement information. Thus, ascending order is performed according to the distance and then the front +.>And obtaining an optimal resource allocation list recommended to the account number according to the results.
Optionally, in this embodiment, fig. 5 is a flowchart for calculating recommended parameters according to an embodiment of the present application, and as shown in fig. 5, the model parameters of the target recommendation model are initialized first, and the resource requirement information is inputResource requirement information->Forwarded to respective CSP (Computing Service Provider ), return information set matrix +.>Calculating a cost function matrix->The ith is obtained using algorithm 1Functional solution->Matrix, will->、/>、/>And->Carry in the above formula to calculate->According to->The first K resource allocation options are arranged and selected in descending order to the target account, and then the new training data can be fed back according to clicking selection operation of the target account on the K resource allocation options.
In an exemplary embodiment, after recommending the K resource configurations corresponding to the first K maximum recommended parameters to the target account, the following manners may be included, but are not limited to: constructing each resource configuration in the K resource configurations and corresponding resource demand information into an initial training sample, and obtaining K initial training samples; labeling a first state label on an initial training sample of which the resource configuration is subjected to the selected operation by the target account, and labeling a second state label on an initial training sample of which the resource configuration is not subjected to the selected operation by the target account, so as to obtain a K-item label training sample; and storing the K target training samples into a training sample set, wherein the training sample set uses the stored target training samples to train the target recommendation model used in the previous stage for R rounds under the condition that the training sample set meets the preset training conditions, so as to obtain a target recommendation model to be used in the next round, and R is a positive integer greater than or equal to 1.
Optionally, in this embodiment, since the target recommendation model algorithm is data-driven, collecting necessary labeling data is critical to improving model performance, so in the reasoning stage, we label the solution selected by the account on the target resource platform as the data of iterative update of the system, so as to improve account experience. The item label training sample is a group of resource allocation and resource requirement information with corresponding relation marked with the first state label or the second state label.
In one exemplary embodiment, the target recommendation model used in the previous stage may be subjected to R-round training by using a stored target training sample, and the target recommendation model to be used in the next round is obtained, by the following ways: the method comprises the following steps of carrying out an R-th training in R-round training on a target recommendation model, wherein R is a positive integer which is greater than or equal to 1 and less than or equal to R: determining the target recommendation model obtained by training the (r-1) th round as the target recommendation model to be trained of the r round, wherein when r takes a value of 1, the target recommendation model used in the previous stage is determined as the target recommendation model to be trained of the r round; inputting the target training sample into the target recommendation model to be trained in the r round to obtain recommendation parameters output by the target recommendation model to be trained in the r round; calculating the value of a second loss function of the target recommendation model to be trained in the r round of training according to the recommendation parameters and the state label of the target training sample, wherein the state label comprises the first state label and the second state label; and under the condition that the value of the second loss function meets a preset second convergence condition, determining the target recommendation model to be trained in the r-th round as the target recommendation model to be used in the next stage, and under the condition that the value of the second loss function does not meet the preset second convergence condition, adjusting model parameters of the target recommendation model to be trained in the r-th round, and taking the target recommendation model with the adjusted model parameters as the target recommendation model to be trained in the (r+1) -th round.
Optionally, in this embodiment, fig. 6 is a flowchart of training a target recommendation model according to an embodiment of the present application, and as shown in fig. 6, model parameters of the target recommendation model are initialized first, and resource requirement information is inputResource requirement information->Forwarded to respective CSP (Computing Service Provider ), return information set matrix +.>Calculating a cost function matrix->The ith function solution is obtained using algorithm 1>Matrix, will->、/>、/>And->Carry in the above formula to calculate->Then calculate the second loss function +.>Judging the second loss function +.>If the value of (2) meets the preset second convergence condition, ending the training if the value of (2) meets the second convergence conditionAnd training, if the second convergence condition is not met, adjusting model parameters, and controlling the target recommendation model after the model parameters are adjusted to enter the next training round.
Optionally, in this embodiment, the second loss functionThe formula of (2) is as follows:
wherein, for a target training sample, when the label of the target training sample is the first state label,taking the value 1, when the label of the target training sample is the second state label, the label is a +.>Value 0->Representing resource requirement information in target training sample >And resource allocation->Recommended parameters between. The second loss function->It can be understood that: the output similarity score of the target training samples labeled with the first state label is maximized while the output similarity score of the target training samples labeled with the second state label is minimized. Second loss function->The optimization can be performed using a random gradient descent algorithm.
Optionally, in this embodiment, the model parameters may include, but are not limited to, recommendation parameters of the target recommendation model, and may also be an account weight matrix and a global weight matrix.
In an exemplary embodiment, the M resource configurations that the target resource platform is allowed to provide corresponding to the resource requirement information may be obtained, but are not limited to, by: acquiring a resource allocation scheme returned by each computing service provider in N computing service providers, and when a scheme quotation corresponding to each resource allocation scheme and a corresponding resource allocation scheme are adopted, carrying out average network transmission delay, computing network delay and nonvolatile storage IO speed on the network task operation; determining service quality information corresponding to each resource allocation scheme according to the scheme quotation corresponding to each resource allocation scheme, the average network transmission delay of the network task operation, the calculated network delay and the nonvolatile storage IO speed when the corresponding resource allocation scheme is adopted; and constructing one resource allocation scheme and one service quality information with corresponding relations into one resource allocation, so as to obtain M resource allocation.
Optionally, in this embodiment, fig. 7 is a schematic diagram of sending resource requirement information by a target account according to an embodiment of the present application, as shown in fig. 7, where the target account issues the resource requirement information on a target resource platform, the target resource platform forwards the resource requirement information to each computing service provider (computing service provider a, computing service provider B and computing service provider C), fig. 8 is a schematic diagram of obtaining resource configuration according to an embodiment of the present application, as shown in fig. 8, after each computing service provider obtains the resource requirement information, providing respective resource configuration schemes (resource configuration scheme a, resource configuration scheme and resource configuration scheme C), and quality of service information corresponding to each of the resource configuration schemes, to obtain 3 resource configurations, and returning the 3 resource configurations to the target account through the target resource platform.
In one exemplary embodiment, the resource configuration scheme returned by each of the N computing service providers may be obtained, but is not limited to, by: acquiring a resource configuration text returned by the target resource platform, wherein the resource configuration text is used for describing computing resources allowed to be provided by the target resource platform; extracting configuration data of computing resources belonging to a target type from the resource configuration text, wherein the computing resources belonging to the target type are resources on which the network task normally operates, and the configuration data are used for indicating the sizes of various computing resources belonging to the target type; and generating the corresponding resource configuration scheme according to the configuration data of the computing resources belonging to the target type.
Optionally, in this embodiment, the resource configuration text further records service quality information corresponding to the resource configuration scheme using the corresponding scheme, where the resource configuration scheme and the service quality information form a resource configuration, and use the resource configurationRepresentation, wherein->Representing resource allocation scheme,/->Representing quality of service information (e.g., pricing and delay attributes) corresponding to the resource allocation scheme, the set of multiple resource allocation schemes may be expressed as +.>
In an exemplary embodiment, before the obtaining the M resource configurations that the target resource platform allows to provide, which correspond to the resource requirement information, the following manners may be included, but are not limited to: receiving a resource demand text input by the target account; extracting a first requirement field and a second requirement field from the resource requirement text, wherein the first requirement field records an account number necessary requirement of the target account number, the account number necessary requirement is used for indicating a computing resource on which the network task normally operates, the second requirement field records an account number service quality requirement of the target account number, and the account number service quality requirement is used for indicating a network performance parameter which does not influence the normal operation of the network task but influences the operation quality of the network task; and converting the first requirement field and the second requirement field into vector forms to obtain the resource requirement information.
Optionally, in this embodiment, the difference between the account necessary requirement and the account service quality requirement is: the account number must be required to be a resource requirement that must be satisfied anyway to ensure that the network task can be properly run, such as a general CPU power requirement, a parallel GPU power requirement, a nonvolatile memory space requirement, etc., while the account number service quality requirement may be understood as a non-necessary requirement, which is a requirement that does not affect the execution of the account number calculation task, but has a great influence on the service experience of the account number, such as an average network transmission delay, a calculation network delay, a nonvolatile storage IO speed, etc.
In one exemplary embodiment, the resource requirement information may be obtained by, but not limited to, converting the first requirement field and the second requirement field into vector form by: obtaining an initial vector, wherein the initial vector comprises (n+m) elements; filling values of corresponding elements of the initial vector according to the first demand field and the second demand field to obtain a target vector, wherein the first n elements of the (n+m) elements of the initial vector are used for representing the account number necessary demand of the target account number, and the last m elements of the (n+m) elements of the initial vector are used for representing the account number service quality demand of the target account number; and determining the target vector as the resource requirement information.
Alternatively, in this embodiment, the resource requirement information may be expressed as:
wherein the vector isRepresenting resource requirement information, vector->Comprising (n+m) elements, wherein the first n elements are used to characterize the account number of the target account number which must be in need of +.>The latter m elements are used to characterize the account quality of service requirement of the target account +.>
It can be appreciated that the recommendation of resource allocation in the related art has the following drawbacks: (1) The scoring function structure and parameters are fixed, so that the historical demand preference of the accounts is difficult to reflect, namely all the accounts share the same scoring function; (2) The selected standard is fixed and single when the search results are ordered, namely, the optimal node is selected mechanically according to the specific parameters such as the residual memory or delay of the node to provide service. Aiming at the defects, the application provides a recommendation method for data-driven resource allocation based on the calculation of an optimal transmission theory. Firstly, the recommendation problem of the resource allocation of the target resource platform is converted into an optimization problem: given the resource demand information, the problem of loss between the resource demand information and the resource allocation (e.g., quotes, transmission delays, computation delays, resource occupancy, etc.) is minimized. Secondly, in order to capture personalized account demands (account weight matrix) and account-to-account common demands (global weight matrix), the application designs a cost function with a fusion account weight matrix and a global weight matrix for describing candidate resource allocation meeting resource demand information, wherein the cost function consists of two parts: an account weight matrix and a global weight matrix. The account weight matrix is a parameter which only takes effect for the current account and is used for describing the personalized requirements of the account. The global weight matrix is a feature shared by all accounts, and the scheduling weight irrelevant to the accounts can be learned through the weight model, so that the cold start problem is avoided. And finally, solving the optimization problem, and pushing a plurality of optimal resource configurations with highest similarity with the account demands to account selection. Compared with the prior art, the scheme only depends on the optimal selection of single-value attributes such as memory occupation, and the like, the scheme can synthesize various recommended attributes to carry out comprehensive calculation, and the solution has optimality in the statistical theory.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the embodiments of the present application.
FIG. 9 is a block diagram of a recommendation device for resource allocation according to an embodiment of the present application; as shown in fig. 9, includes:
the obtaining module 902 is configured to obtain, when the target resource platform receives resource demand information sent by a target account, M pieces of resource configuration corresponding to the resource demand information and allowed to be provided by the target resource platform, and obtain account weight information corresponding to the target account and global weight information corresponding to the target resource platform, where the account weight information is used to characterize weights of features of the resource configuration preferred by the target account, the global weight information is used to characterize average weights of features of the resource configuration preferred by an account set on the target resource platform, and the resource demand information is used to indicate computing resources required when the target account runs a network task, and M is a positive integer greater than or equal to 2;
A first construction module 904, configured to construct a target recommendation model for the target account according to the account weight information and the global weight information;
and a recommendation module 906, configured to invoke the target recommendation model to determine recommendation parameters between each of the M resource configurations and the resource requirement information, and recommend K resource configurations corresponding to the maximum first K recommendation parameters to the target account, where the recommendation parameters are used to indicate a matching degree of the corresponding resource configurations and the resource requirement information, and the matching degree of the resource configurations with the resource requirement information is higher when the recommendation parameters are larger, where K is a positive integer greater than or equal to 1 and less than or equal to M.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
Through the above embodiment, when the target resource platform receives the resource demand information sent by the target account, and obtains the M resource configurations provided by the target resource platform according to the resource demand information, account weight information for representing weights of all features of the resource configurations preferred by the target account and global weight information corresponding to the target resource platform are obtained, the global weight information is used for representing average weights of all features of the resource configurations preferred by the account set on the target resource platform, then a target recommendation model is built according to the account weight information and the global weight information as the target account, recommendation parameters between each resource configuration and the resource demand information in the M resource configurations are determined by calling the target recommendation model, and the M resource configurations are ranked, and the first K resource configurations are recommended to the target account, wherein the more the resource configurations ranked are matched with the resource demand information, on the one hand, the resource configurations recommended in such a way can meet the computing resource demand proposed by the resource demand information of the target account, on the other hand, the resource configurations recommended by the target account are ranked by using the target recommendation model, and the more the target account numbers (the more the better the resource configurations are ranked by the target account numbers) are ranked, and the better the target account numbers are ranked, and the better the target account demands are ranked by the better. By adopting the technical scheme, the problems of low matching degree of the recommended resource configuration and the resource demand information of the target account in the related technology are solved, and the technical effect of improving the matching degree of the recommended resource configuration and the resource demand information of the target account is realized.
In one exemplary embodiment, the acquisition module includes:
a first obtaining unit, configured to obtain a target account number vector corresponding to the target account number from an account number matrix corresponding to the target resource platform, where each row of the account number matrix represents an account number vector of a registered account number on the target resource platform, where the account number vector is used to characterize a resource configuration preferred by the corresponding account number, and the registered account number includes the target account number;
the generation unit is used for generating an account weight matrix according to the target account vector;
and the first determining unit is used for determining the account weight matrix as the account weight information.
In an exemplary embodiment, the generating unit is further configured to:
inputting the target account number vector into a multi-layer perceptron mapping network to obtain a parameter matrix output by the multi-layer perceptron mapping network;
and generating the account weight matrix according to the parameter matrix.
In an exemplary embodiment, the generating unit is further configured to:
generating a first transfer matrix of the parameter matrix;
and generating the account weight matrix according to the parameter matrix and the first transfer matrix.
In an exemplary embodiment, the generating unit is further configured to:
performing linear operation on the parameter matrix and the first transfer matrix to obtain linear parameters;
and determining the value of the linear parameter on a second activation function as the account weight matrix.
In an exemplary embodiment, the recommendation module includes:
the calling unit is used for calling the target recommendation model to determine recommendation parameters between the ith resource configuration in the M resource configurations and the resource demand information, wherein i is a positive integer which is greater than or equal to 1 and less than or equal to M, and the recommendation parameters are determined by the following steps:
calculating a cost function matrix corresponding to the target account according to the account weight information and the global weight information;
calculating an ith function solution of the ith resource configuration and the resource requirement information on a first loss function;
acquiring M information set matrixes corresponding to the resource configurations, wherein each resource configuration records a resource configuration scheme and service quality information with a corresponding relation, the resource configuration scheme is used for indicating computing resources provided by the corresponding resource configuration, the service quality information is used for indicating the operation effect of the network task when the corresponding resource configuration is applied, the information set matrixes comprise M rows, and the j-th row of the information set matrixes represents the j-th service quality information corresponding to the j-th resource configuration in the M resource configurations, wherein j is a positive integer greater than or equal to 1 and less than or equal to M;
And determining recommended parameters between the ith resource configuration and the resource demand information according to the resource demand information, the cost function matrix, the ith function solution and the information set matrix.
In an exemplary embodiment, the calling unit is further configured to:
determining an account weight matrix corresponding to the target account as the account weight information, and determining a global weight matrix corresponding to the target resource platform as the global weight information, wherein the account weight matrix is used for representing weights of all features of resource configuration preferred by the target account, and the global weight matrix is used for representing average weights of all features of resource configuration preferred by an account set on the target resource platform;
and determining the values of the account weight matrix and the global weight matrix on a first activation function as the cost function matrix.
In an exemplary embodiment, the calling unit is further configured to:
q-round updating is carried out on the first initial matrix and the second initial matrix according to the cost function matrix corresponding to the target account, so that a first target matrix and a second target matrix are obtained;
And obtaining the ith function solution according to the first target matrix and the second target matrix.
In an exemplary embodiment, the calling unit is further configured to:
the Q-th round of updating in the Q-round updating is carried out on the first initial matrix and the second initial matrix according to the cost function matrix corresponding to the target account, through the following steps:
calculating an intermediate matrix according to the cost function matrix corresponding to the target account;
acquiring a first initial matrix obtained by updating a Q-1 th round as a first initial matrix used by the Q-th round, wherein Q is a positive integer which is more than or equal to 1 and less than or equal to Q, and determining an identity matrix as the first initial matrix used by the Q-th round under the condition that Q takes a value of 1;
calculating a second initial matrix obtained by the q-th round of updating according to the first initial matrix used by the q-th round and the intermediate matrix, and generating a first initial matrix obtained by the q-th round of updating according to the second initial matrix obtained by the q-th round of updating;
under the condition that a second initial matrix obtained by the q-th round of updating and a first initial matrix obtained by the q-th round of updating meet a preset first convergence condition, determining the first initial matrix obtained by the q-th round of updating as the first target matrix, and determining the second initial matrix obtained by the q-th round of updating as the second target matrix;
And under the condition that the second initial matrix obtained by the q-th round of updating and the first initial matrix obtained by the q-th round of updating do not meet a preset first convergence condition, carrying out (q+1) -th round of updating on the second initial matrix obtained by the q-th round of updating and the first initial matrix obtained by the q-th round of updating.
In an exemplary embodiment, the calling unit is further configured to:
performing division operation on the cost function matrix corresponding to the target account and a preset constant to obtain a reference matrix;
and performing exponential operation on the opposite number of the reference matrix to obtain the intermediate matrix.
In an exemplary embodiment, the calling unit is further configured to:
performing multiplication operation on the second transposed matrix of the intermediate matrix and the first initial matrix used by the q-th round to obtain a first product of the q-th round;
and determining the reciprocal of the first product of the q-th round as a second initial matrix obtained by the q-th round updating.
In an exemplary embodiment, the calling unit is further configured to:
performing multiplication operation on the second transposed matrix of the intermediate matrix and the second initial matrix obtained by the q-th round update to obtain a second product of the q-th round;
And determining the reciprocal of the second product of the q-th round as a first initial matrix obtained by the q-th round updating.
In an exemplary embodiment, the calling unit is further configured to:
calculating an intermediate matrix according to the cost function matrix corresponding to the target account;
generating a first diagonal matrix corresponding to the first target matrix and generating a second diagonal matrix corresponding to the second target matrix;
and determining the product of the first diagonal matrix, the second diagonal matrix and the intermediate matrix as the ith functional solution.
In an exemplary embodiment, the calling unit is further configured to:
calculating recommended parameters between the resource configuration and the resource requirement information according to the ith item by the following formula:
wherein,representing said resource requirement information,/for>Representing the cost function matrix,/->Representing the ith functional solution, +.>For the third transpose of the information set matrix,/I>Is the Hadamard product of the matrix, +.>For the third activation function->Is a vector comprising M elements;
will beThe value of the i-th element of the list is determined as a recommended parameter between the i-th information of the quality of service and the information of the resource requirement.
In an exemplary embodiment, the apparatus further comprises:
The second construction module is used for constructing each resource configuration in the K resource configurations and corresponding resource requirement information into an initial training sample after recommending the K resource configurations corresponding to the maximum first K recommended parameters to the target account, so as to obtain K initial training samples;
the labeling module is used for labeling a first state label on an initial training sample of which the resource configuration is subjected to the selected operation by the target account, and labeling a second state label on an initial training sample of which the resource configuration is not subjected to the selected operation by the target account, so as to obtain a K-item label training sample;
the storage module is used for storing the K target training samples into a training sample set, wherein the training sample set uses the stored target training samples to train the target recommendation model used in the previous stage to obtain a target recommendation model to be used in the next round under the condition that the training sample set meets the preset training condition, and R is a positive integer greater than or equal to 1.
In one exemplary embodiment, the memory module includes:
the training unit is used for carrying out the R-th training in the R-round training on the target recommendation model through the following steps, wherein R is a positive integer which is more than or equal to 1 and less than or equal to R:
Determining the target recommendation model obtained by training the (r-1) th round as the target recommendation model to be trained of the r round, wherein when r takes a value of 1, the target recommendation model used in the previous stage is determined as the target recommendation model to be trained of the r round;
inputting the target training sample into the target recommendation model to be trained in the r round to obtain recommendation parameters output by the target recommendation model to be trained in the r round;
calculating the value of a second loss function of the target recommendation model to be trained in the r round of training according to the recommendation parameters and the state label of the target training sample, wherein the state label comprises the first state label and the second state label;
and under the condition that the value of the second loss function meets a preset second convergence condition, determining the target recommendation model to be trained in the r-th round as the target recommendation model to be used in the next stage, and under the condition that the value of the second loss function does not meet the preset second convergence condition, adjusting model parameters of the target recommendation model to be trained in the r-th round, and taking the target recommendation model with the adjusted model parameters as the target recommendation model to be trained in the (r+1) -th round.
In one exemplary embodiment, the acquisition module includes:
the second obtaining unit is used for obtaining a resource allocation scheme which is allowed to be provided by the target resource platform, and calculating the average network transmission delay, the network delay and the nonvolatile storage IO speed of the network task operation when the scheme quotation corresponding to each resource allocation scheme and the corresponding resource allocation scheme are adopted;
a second determining unit, configured to determine, as quality of service information corresponding to each resource allocation scheme, an average network transmission delay, a calculated network delay, and a nonvolatile storage IO speed of the network task operation when a scheme offer corresponding to each resource allocation scheme and a corresponding resource allocation scheme are adopted;
the construction unit is used for constructing one resource allocation scheme and one service quality information with corresponding relations into one resource allocation to obtain M resource allocation.
In an exemplary embodiment, the second obtaining unit is further configured to:
acquiring a resource configuration text returned by the target resource platform, wherein the resource configuration text is used for describing computing resources allowed to be provided by the target resource platform;
Extracting configuration data of computing resources belonging to a target type from the resource configuration text, wherein the computing resources belonging to the target type are resources on which the network task normally operates, and the configuration data are used for indicating the sizes of various computing resources belonging to the target type;
and generating the corresponding resource configuration scheme according to the configuration data of the computing resources belonging to the target type.
In an exemplary embodiment, the apparatus further comprises:
the receiving module is used for receiving the resource demand text input by the target account before the M resource configurations which are corresponding to the resource demand information and are allowed to be provided by the target resource platform are obtained;
an extraction module, configured to extract a first requirement field and a second requirement field from the resource requirement text, where the first requirement field records an account number necessary requirement of the target account number, the account number necessary requirement is used to indicate a computing resource on which the network task normally operates, and the second requirement field records an account number service quality requirement of the target account number, and the account number service quality requirement is used to indicate a network performance parameter that does not affect the normal operation of the network task but affects the operation quality of the network task;
And the conversion module is used for converting the first requirement field and the second requirement field into vector forms to obtain the resource requirement information.
In one exemplary embodiment, the conversion module includes:
a third acquisition unit configured to acquire an initial vector, wherein the initial vector includes (n+m) elements;
a filling unit, configured to fill values of corresponding elements of the initial vector according to the first requirement field and the second requirement field to obtain a target vector, where a first n elements of (n+m) elements of the initial vector are used to represent the account number necessary requirement of the target account number, and a last m elements of (n+m) elements of the initial vector are used to represent the account number service quality requirement of the target account number;
and a third determining unit, configured to determine the target vector as the resource requirement information.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
In one exemplary embodiment, the computer readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
Embodiments of the present application also provide an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic device may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application should be included in the protection scope of the present application.

Claims (23)

1. A recommendation method for resource allocation, comprising:
under the condition that a target resource platform receives resource demand information sent by a target account, obtaining M resource configurations which are corresponding to the resource demand information and are allowed to be provided by the target resource platform, and obtaining account weight information corresponding to the target account and global weight information corresponding to the target resource platform, wherein the account weight information is used for representing weights of all features of the resource configurations preferred by the target account, the global weight information is used for representing average weights of all features of the resource configurations preferred by an account set on the target resource platform, the resource demand information is used for indicating computing resources required by the target account when the target account operates network tasks, M is a positive integer which is greater than or equal to 2, each resource configuration records a resource configuration scheme with a corresponding relation and service quality information, the resource configuration scheme is used for indicating the computing resources provided by the corresponding resource configuration, the service quality information is used for indicating the operation effect of the network tasks when the corresponding resource configuration is applied, and the computing resources comprise computing resources, storage resources and network transmission resources;
Constructing a target recommendation model for the target account according to the account weight information and the global weight information;
and calling the target recommendation model to determine recommendation parameters between each of the M resource configurations and the resource demand information, and recommending K resource configurations corresponding to the maximum first K recommendation parameters to the target account, wherein the recommendation parameters are used for indicating the matching degree of the corresponding resource configurations and the resource demand information, and the matching degree of the resource configurations with the resource demand information is higher when the recommendation parameters are larger, and K is a positive integer which is greater than or equal to 1 and less than or equal to M.
2. The method according to claim 1, wherein the obtaining the account weight information corresponding to the target account includes:
obtaining a target account number vector corresponding to the target account number from an account number matrix corresponding to the target resource platform, wherein each row of the account number matrix represents an account number vector of a registered account number on the target resource platform, the account number vector is used for representing the characteristics of resource configuration preferred by the corresponding account number, and the registered account number comprises the target account number;
Generating an account weight matrix according to the target account vector;
and determining the account weight matrix as the account weight information.
3. The method of claim 2, wherein the generating an account weight matrix from the target account vector comprises:
inputting the target account number vector into a multi-layer perceptron mapping network to obtain a parameter matrix output by the multi-layer perceptron mapping network;
and generating the account weight matrix according to the parameter matrix.
4. A method according to claim 3, wherein said generating said account weight matrix from said parameter matrix comprises:
generating a first transfer matrix of the parameter matrix;
and generating the account weight matrix according to the parameter matrix and the first transfer matrix.
5. The method of claim 4, wherein the generating the account weight matrix from the parameter matrix and the first transfer matrix comprises:
performing linear operation on the parameter matrix and the first transfer matrix to obtain linear parameters;
and determining the value of the linear parameter on a second activation function as the account weight matrix.
6. The method of claim 1, wherein said invoking the target recommendation model to determine recommendation parameters between each of the M resource configurations and the resource requirement information comprises:
invoking the target recommendation model to determine recommendation parameters between the ith resource configuration in the M resource configurations and the resource requirement information, wherein i is a positive integer greater than or equal to 1 and less than or equal to M:
calculating a cost function matrix corresponding to the target account according to the account weight information and the global weight information;
calculating an ith function solution of the ith resource configuration and the resource requirement information on a first loss function;
acquiring M information set matrixes corresponding to the resource configurations, wherein the information set matrixes comprise M rows, and the j-th row of the information set matrixes represents the j-th service quality information corresponding to the j-th resource configuration in the M resource configurations, wherein j is a positive integer which is greater than or equal to 1 and less than or equal to M;
and determining recommended parameters between the ith resource configuration and the resource demand information according to the resource demand information, the cost function matrix, the ith function solution and the information set matrix.
7. The method according to claim 6, wherein the calculating a cost function matrix corresponding to the target account according to the account weight information and the global weight information includes:
determining an account weight matrix corresponding to the target account as the account weight information, and determining a global weight matrix corresponding to the target resource platform as the global weight information, wherein the account weight matrix is used for representing weights of all features of resource configuration preferred by the target account, and the global weight matrix is used for representing average weights of all features of resource configuration preferred by an account set on the target resource platform;
and determining the values of the account weight matrix and the global weight matrix on a first activation function as the cost function matrix.
8. The method of claim 6, wherein said calculating an ith function solution of the ith resource configuration and the resource requirement information on the first loss function comprises:
q-round updating is carried out on the first initial matrix and the second initial matrix according to the cost function matrix corresponding to the target account, so that a first target matrix and a second target matrix are obtained;
And obtaining the ith function solution according to the first target matrix and the second target matrix.
9. The method of claim 8, wherein the Q-round updating the first initial matrix and the second initial matrix according to the cost function matrix corresponding to the target account number to obtain a first target matrix and a second target matrix includes:
the Q-th round of updating in the Q-round updating is carried out on the first initial matrix and the second initial matrix according to the cost function matrix corresponding to the target account, through the following steps:
calculating an intermediate matrix according to the cost function matrix corresponding to the target account;
acquiring a first initial matrix obtained by updating a Q-1 th round as a first initial matrix used by the Q-1 th round, wherein Q is a positive integer which is more than or equal to 1 and less than or equal to Q, and determining an identity matrix as the first initial matrix used by the Q-1 th round under the condition that Q takes a value of 1;
calculating a second initial matrix obtained by the q-th round of updating according to the first initial matrix used by the q-th round and the intermediate matrix, and generating a first initial matrix obtained by the q-th round of updating according to the second initial matrix obtained by the q-th round of updating;
under the condition that a second initial matrix obtained by the q-th round of updating and a first initial matrix obtained by the q-th round of updating meet a preset first convergence condition, determining the first initial matrix obtained by the q-th round of updating as the first target matrix, and determining the second initial matrix obtained by the q-th round of updating as the second target matrix;
And under the condition that the second initial matrix obtained by the q-th round of updating and the first initial matrix obtained by the q-th round of updating do not meet a preset first convergence condition, carrying out the q+1-th round of updating on the second initial matrix obtained by the q-th round of updating and the first initial matrix obtained by the q-th round of updating.
10. The method according to claim 9, wherein the calculating an intermediate matrix according to the cost function matrix corresponding to the target account number includes:
performing division operation on the cost function matrix corresponding to the target account and a preset constant to obtain a reference matrix;
and performing exponential operation on the opposite number of the reference matrix to obtain the intermediate matrix.
11. The method of claim 9, wherein the calculating the second initial matrix updated for the q-th round based on the first initial matrix used for the q-th round and the intermediate matrix comprises:
performing multiplication operation on the second transposed matrix of the intermediate matrix and the first initial matrix used by the q-th round to obtain a first product of the q-th round;
and determining the reciprocal of the first product of the q-th round as a second initial matrix obtained by the q-th round updating.
12. The method of claim 9, wherein generating the first initial matrix for the q-th round of updates from the second initial matrix for the q-th round of updates comprises:
performing multiplication operation on the second transposed matrix of the intermediate matrix and the second initial matrix obtained by the q-th round update to obtain a second product of the q-th round;
and determining the reciprocal of the second product of the q-th round as a first initial matrix obtained by the q-th round updating.
13. The method of claim 8, wherein the deriving the ith functional solution from the first target matrix and the second target matrix comprises:
calculating an intermediate matrix according to the cost function matrix corresponding to the target account;
generating a first diagonal matrix corresponding to the first target matrix and generating a second diagonal matrix corresponding to the second target matrix;
and determining the product of the first diagonal matrix, the second diagonal matrix and the intermediate matrix as the ith functional solution.
14. The method of claim 6, wherein said determining a recommendation parameter between an ith of said resource configurations and said resource requirement information based on said resource requirement information, said cost function matrix, said ith function solution, and said information aggregation matrix comprises:
Calculating recommended parameters between the resource configuration and the resource requirement information according to the ith item by the following formula:
wherein,representing said resource requirement information,/for>Representing the cost function matrix,/->Representing the solution of the i-th function,to be the instituteA third transpose of said information set matrix, < >>Is the Hadamard product of the matrix, +.>For the third activation function->Is a vector comprising M elements;
will beThe value of the i-th element of the list is determined as a recommended parameter between the i-th information of the quality of service and the information of the resource requirement.
15. The method according to claim 1, wherein after recommending the K resource configurations corresponding to the first K maximum recommended parameters to the target account, the method further comprises:
constructing each resource configuration in the K resource configurations and corresponding resource demand information into an initial training sample, and obtaining K initial training samples;
labeling a first state label on an initial training sample of which the resource configuration is subjected to the selected operation by the target account, and labeling a second state label on an initial training sample of which the resource configuration is not subjected to the selected operation by the target account, so as to obtain a K-item label training sample;
And storing the K target training samples into a training sample set, wherein the training sample set uses the stored target training samples to train the target recommendation model used in the previous stage for R rounds under the condition that the training sample set meets the preset training conditions, so as to obtain a target recommendation model to be used in the next round, and R is a positive integer greater than or equal to 1.
16. The method according to claim 15, wherein the performing R-round training on the target recommendation model used in the previous stage using the stored target training samples to obtain a target recommendation model to be used in the next round includes:
the method comprises the following steps of carrying out an R-th training in R-round training on a target recommendation model, wherein R is a positive integer which is greater than or equal to 1 and less than or equal to R:
determining the target recommendation model obtained by the r-1 round training as the target recommendation model to be trained of the r round, wherein when r takes a value of 1, the target recommendation model used in the previous stage is determined as the target recommendation model to be trained of the r round;
inputting the target training sample into the target recommendation model to be trained in the r round to obtain recommendation parameters output by the target recommendation model to be trained in the r round;
Calculating the value of a second loss function of the target recommendation model to be trained in the r round of training according to the recommendation parameters and the state label of the target training sample, wherein the state label comprises the first state label and the second state label;
and under the condition that the value of the second loss function meets a preset second convergence condition, determining the target recommendation model to be trained in the r round as the target recommendation model to be used in the next stage, and under the condition that the value of the second loss function does not meet the preset second convergence condition, adjusting model parameters of the target recommendation model to be trained in the r round, and taking the target recommendation model with the adjusted model parameters as the target recommendation model to be trained in the r+1 round.
17. The method according to claim 1, wherein the obtaining M resource configurations corresponding to the resource requirement information and allowed to be provided by the target resource platform includes:
acquiring a resource configuration scheme allowed to be provided by the target resource platform, and when a scheme quotation corresponding to each resource configuration scheme and the corresponding resource configuration scheme are adopted, calculating average network transmission delay, network delay and nonvolatile storage IO speed of the network task operation;
Determining average network transmission delay, calculated network delay and nonvolatile storage IO speed of the network task operation as service quality information corresponding to each resource allocation scheme when the scheme quotation corresponding to each resource allocation scheme and the corresponding resource allocation scheme are adopted;
and constructing one resource allocation scheme and one service quality information with corresponding relations into one resource allocation, so as to obtain M resource allocation.
18. The method of claim 17, wherein the obtaining the resource configuration scheme allowed by the target resource platform comprises:
acquiring a resource configuration text returned by the target resource platform, wherein the resource configuration text is used for describing computing resources allowed to be provided by the target resource platform;
extracting configuration data of computing resources belonging to a target type from the resource configuration text, wherein the computing resources belonging to the target type are resources on which the network task normally operates, and the configuration data are used for indicating the sizes of various computing resources belonging to the target type;
and generating the corresponding resource configuration scheme according to the configuration data of the computing resources belonging to the target type.
19. The method of claim 1, wherein prior to said obtaining the M resource configurations that the target resource platform is permitted to provide corresponding to the resource requirement information, the method further comprises:
receiving a resource demand text input by the target account;
extracting a first requirement field and a second requirement field from the resource requirement text, wherein the first requirement field records an account number necessary requirement of the target account number, the account number necessary requirement is used for indicating a computing resource on which the network task normally operates, the second requirement field records an account number service quality requirement of the target account number, and the account number service quality requirement is used for indicating a network performance parameter which does not influence the normal operation of the network task but influences the operation quality of the network task;
and converting the first requirement field and the second requirement field into vector forms to obtain the resource requirement information.
20. The method of claim 19, wherein converting the first requirement field and the second requirement field into vector form to obtain the resource requirement information comprises:
Obtaining an initial vector, wherein the initial vector comprises n+m elements;
filling values of corresponding elements of the initial vector according to the first demand field and the second demand field to obtain a target vector, wherein the first n elements of n+m elements of the initial vector are used for representing the account number necessary demand of the target account number, and the last m elements of n+m elements of the initial vector are used for representing the account number service quality demand of the target account number;
and determining the target vector as the resource requirement information.
21. A recommendation device for resource allocation, comprising:
the system comprises an acquisition module, a target resource platform and a resource allocation module, wherein the acquisition module is used for acquiring M resource configurations which are corresponding to the resource demand information and are allowed to be provided by the target resource platform under the condition that the target resource platform receives resource demand information sent by the target account, acquiring account weight information corresponding to the target account and global weight information corresponding to the target resource platform, wherein the account weight information is used for representing weights of various characteristics of the resource configurations preferred by the target account, the global weight information is used for representing average weights of various characteristics of the resource configurations preferred by an account set on the target resource platform, the resource demand information is used for indicating computing resources required when the target account operates a network task, M is a positive integer which is greater than or equal to 2, each resource configuration records a resource configuration scheme and service quality information with a corresponding relation, the resource configuration scheme is used for indicating the computing resources provided by the corresponding resource configuration, and the service quality information is used for indicating the operation effect of the network task when the corresponding resource configuration is applied, and the computing resources comprise computing resources, storage resources and network transmission resources;
The first construction module is used for constructing a target recommendation model for the target account according to the account weight information and the global weight information;
and the recommendation module is used for calling the target recommendation model to determine recommendation parameters between each resource configuration in the M resource configurations and the resource demand information, and recommending K resource configurations corresponding to the maximum first K recommendation parameters to the target account, wherein the recommendation parameters are used for indicating the matching degree of the corresponding resource configurations and the resource demand information, and the matching degree of the resource configurations with the resource demand information is higher when the recommendation parameters are larger, and K is a positive integer which is larger than or equal to 1 and smaller than or equal to M.
22. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program when run performs the method of any one of claims 1 to 20.
23. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to perform the method of any of claims 1 to 20 by means of the computer program.
CN202311252709.6A 2023-09-26 2023-09-26 Recommendation method and device for resource allocation, storage medium and electronic device Active CN116992158B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311252709.6A CN116992158B (en) 2023-09-26 2023-09-26 Recommendation method and device for resource allocation, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311252709.6A CN116992158B (en) 2023-09-26 2023-09-26 Recommendation method and device for resource allocation, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN116992158A CN116992158A (en) 2023-11-03
CN116992158B true CN116992158B (en) 2024-01-26

Family

ID=88523561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311252709.6A Active CN116992158B (en) 2023-09-26 2023-09-26 Recommendation method and device for resource allocation, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN116992158B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112101674A (en) * 2020-09-22 2020-12-18 广东睿盟计算机科技有限公司 Resource allocation matching method, device, equipment and medium based on group intelligent algorithm
CN113836390A (en) * 2020-06-24 2021-12-24 北京达佳互联信息技术有限公司 Resource recommendation method and device, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10839255B2 (en) * 2017-05-15 2020-11-17 Internationl Business Machines Corporation Load-balancing training of recommender system for heterogeneous systems

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113836390A (en) * 2020-06-24 2021-12-24 北京达佳互联信息技术有限公司 Resource recommendation method and device, computer equipment and storage medium
CN112101674A (en) * 2020-09-22 2020-12-18 广东睿盟计算机科技有限公司 Resource allocation matching method, device, equipment and medium based on group intelligent algorithm

Also Published As

Publication number Publication date
CN116992158A (en) 2023-11-03

Similar Documents

Publication Publication Date Title
WO2021047593A1 (en) Method for training recommendation model, and method and apparatus for predicting selection probability
US20230088171A1 (en) Method and apparatus for training search recommendation model, and method and apparatus for sorting search results
JP7043786B2 (en) Sales activity support system, sales activity support method and sales activity support program
EP3862893A1 (en) Recommendation model training method, recommendation method, device, and computer-readable medium
CN110866628A (en) System and method for multi-bounded time series prediction using dynamic time context learning
EP4242955A1 (en) User profile-based object recommendation method and device
CN111008335B (en) Information processing method, device, equipment and storage medium
CN113742492B (en) Insurance scheme generation method and device, electronic equipment and storage medium
US20220261591A1 (en) Data processing method and apparatus
CN108549909B (en) Object classification method and object classification system based on crowdsourcing
CN112148973A (en) Data processing method and device for information push
US20220414470A1 (en) Multi-Task Attention Based Recurrent Neural Networks for Efficient Representation Learning
CN107273979A (en) The method and system of machine learning prediction are performed based on service class
CN116738081B (en) Front-end component binding method, device and storage medium
CN113706211A (en) Advertisement click rate prediction method and system based on neural network
Ben-Shimon et al. An ensemble method for top-N recommendations from the SVD
CN113159213A (en) Service distribution method, device and equipment
CN108876422B (en) Method and device for information popularization, electronic equipment and computer readable medium
CN110263973A (en) Predict the method and device of user behavior
CN118043802A (en) Recommendation model training method and device
CN117390540A (en) Target operation execution method and device, storage medium and electronic equipment
CN113761352A (en) Information pushing method, device, equipment and storage medium
CN116992158B (en) Recommendation method and device for resource allocation, storage medium and electronic device
CN117057855A (en) Data processing method and related device
CN116308640A (en) Recommendation method and related device

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
GR01 Patent grant
GR01 Patent grant