CN111309490A - Resource allocation method and device, electronic equipment and storage medium - Google Patents

Resource allocation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111309490A
CN111309490A CN202010224983.2A CN202010224983A CN111309490A CN 111309490 A CN111309490 A CN 111309490A CN 202010224983 A CN202010224983 A CN 202010224983A CN 111309490 A CN111309490 A CN 111309490A
Authority
CN
China
Prior art keywords
interface
weight
service
initialization
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010224983.2A
Other languages
Chinese (zh)
Inventor
赵雨露
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202010224983.2A priority Critical patent/CN111309490A/en
Publication of CN111309490A publication Critical patent/CN111309490A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the invention provides a resource allocation method, a resource allocation device, electronic equipment and a storage medium. The scheme is as follows: detecting an incidence relation between a preset service and an initialization interface and a calling relation between the initialization interface and a micro-service interface; acquiring the importance weight of each interface according to the incidence relation and the calling relation; wherein; and outputting the importance weight of each interface to allocate the resource based on the importance weight of each interface. Through the technical scheme provided by the embodiment of the invention, all factors influencing the importance weight of the interface are comprehensively considered, so that the accuracy of the acquired importance weight of the interface is effectively improved, the rationality of resource allocation based on the importance weight of the interface is improved, and the stability of network operation is maintained.

Description

Resource allocation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a resource allocation method and apparatus, an electronic device, and a storage medium.
Background
With the continuous development of internet technology, the concurrency of networks is higher and higher. For example, a large live process has the characteristic of high concurrency. However, in a high-concurrency application scenario, because the concurrency amount of data is large, the number of interfaces capable of providing service is large, and how to reasonably allocate resources for each interface is an important requirement for ensuring the operation stability of the network. For example, in the large live broadcast process, network resources or human resources are reasonably distributed, the stability of network operation is effectively maintained, and the live broadcast quality is ensured.
Disclosure of Invention
An object of the embodiments of the present invention is to provide a resource allocation method, an apparatus, an electronic device, and a storage medium, so as to improve accuracy of an obtained interface importance weight, thereby improving rationality of resource allocation based on the interface importance weight, and maintaining stability of network operation, and the specific technical solution is as follows:
in a first aspect of the embodiments of the present invention, a resource allocation method is first provided, where the method includes:
when the concurrency of the data reaches a preset concurrency threshold, detecting the incidence relation between a plurality of preset services and a plurality of initialization interfaces which are distributed in advance and the calling relation between each initialization interface and a plurality of micro-service interfaces;
acquiring the importance weight of each interface according to the incidence relation and the calling relation; wherein the interfaces include the initialization interface and the micro-service interface;
and outputting the importance weight of each interface to allocate the resource based on the importance weight of each interface.
In a second aspect of the embodiments of the present invention, there is also provided a resource allocation apparatus, including:
the detection module is used for detecting the incidence relation between a plurality of preset services and a plurality of initialization interfaces which are distributed in advance and the call relation between each initialization interface and a plurality of micro-service interfaces when the concurrency of data reaches a preset concurrency threshold;
the first acquisition module is used for acquiring the importance weight of each interface according to the incidence relation and the calling relation; wherein the interfaces include the initialization interface and the micro-service interface;
and the output module is used for outputting the importance weight of each interface so as to allocate the resources based on the importance weight of each interface.
In a third aspect of the embodiments of the present invention, there is further provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing any of the above-described resource allocation method steps when executing a program stored in the memory.
In a fourth aspect of the embodiments of the present invention, there is further provided a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements any of the above-mentioned steps of the resource allocation method.
In a fifth aspect of the embodiments of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above-mentioned resource allocation methods.
According to the resource allocation method, the device, the electronic device and the storage medium provided by the embodiment of the invention, the preset service associated with each initialization interface and the micro service interface called by the initialization interface can influence the importance weights corresponding to the initialization interface and the micro service interface, so that when the importance weights of each interface are obtained, the importance weights of each interface are obtained according to the association relation between each preset service and each initialization interface which is allocated in advance and the calling relation between each initialization interface and a plurality of micro service interfaces, and all factors influencing the importance weights of the interfaces are comprehensively considered, so that the accuracy of the obtained importance weights of the interfaces is effectively improved, the rationality of resource allocation based on the importance weights of the interfaces is improved, and the stability of network operation is maintained.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a first flowchart of a resource allocation method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an interface call network according to an embodiment of the present invention;
fig. 3 is a second flowchart of a resource allocation method according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a front-end service network according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a composite network according to an embodiment of the present invention;
fig. 6 is a third flowchart illustrating a resource allocation method according to an embodiment of the present invention;
fig. 7 is a fourth flowchart illustrating a resource allocation method according to an embodiment of the present invention;
fig. 8 is a schematic flowchart of a fifth method for allocating resources according to an embodiment of the present invention;
fig. 9 is a schematic diagram illustrating a first structure of a resource allocation apparatus according to an embodiment of the present invention;
fig. 10 is a schematic diagram illustrating a second structure of a resource allocation apparatus according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a resource allocation apparatus according to a third embodiment of the present invention;
fig. 12 is a schematic diagram illustrating a fourth structure of a resource allocation apparatus according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of a third obtaining submodule in the resource allocation apparatus according to the embodiment of the present invention;
fig. 14 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
In order to solve the problem of how to reasonably distribute a network and maintain stable network operation in a high concurrency scene, the embodiment of the invention provides a resource distribution method. The method can be applied to any electronic equipment, such as the live broadcast server in the large-scale live broadcast scene. For convenience of description, the following description will be made by taking an electronic device as an execution subject, and does not have any limiting effect.
As shown in fig. 1, fig. 1 is a first flowchart of a resource allocation method according to an embodiment of the present invention.
Step S101, when the concurrency of the data reaches a preset concurrency threshold, detecting the association relationship between a plurality of preset services and a plurality of initialization interfaces which are allocated in advance, and the calling relationship between each initialization interface and a plurality of micro-service interfaces.
Step S102, acquiring importance weight of each interface according to the incidence relation and the calling relation; wherein, each interface comprises an initialization interface and a micro-service interface.
And step S103, outputting the importance weight of each interface to allocate resources based on the importance weight of each interface.
According to the method provided by the embodiment of the invention, the preset service associated with each initialization interface and the micro service interface called by the initialization interface can influence the importance weights corresponding to the initialization interface and the micro service interface, so that when the importance weights of each interface are obtained, the importance weights of each interface are obtained according to the association relationship between each preset service and each initialization interface distributed in advance and the calling relationship between each initialization interface and a plurality of micro service interfaces, and all factors influencing the importance weights of the interfaces are comprehensively considered, so that the accuracy of the obtained importance weights of the interfaces is effectively improved, the rationality of resource distribution based on the importance weights of the interfaces is improved, and the stability of network operation is maintained.
The following examples illustrate the present invention.
With respect to the step S101, when the concurrency of the data reaches the preset concurrency threshold, detecting an association relationship between a plurality of preset services and a plurality of initialization interfaces allocated in advance, and a call relationship between each initialization interface and a plurality of micro service interfaces.
In this step, the electronic device may obtain the concurrency amount of the data at the current time in real time, and compare the concurrency amount with a preset concurrency amount threshold. When the obtained concurrency is greater than the preset concurrency threshold, the electronic device may detect an association relationship between the plurality of preset services and the plurality of initialization interfaces allocated in advance, and a call relationship between each initialization interface and the plurality of micro service interfaces.
In the embodiment of the present invention, the concurrency amount may be expressed as the number of requests processed by the electronic devices in parallel at the current time or the number of data transmitted in parallel. The concurrency amount may be calculated by the electronic device, or may be calculated by a device other than the electronic device, and the electronic device obtains the calculated concurrency amount from the other device. Here, the method of calculating the amount of concurrency will not be specifically described.
For ease of understanding, the above step S101 will be described below by taking the above large live scene as an example.
In a certain large live broadcast process, a user can access a live broadcast server adopted by the large live broadcast through a client so as to watch live broadcast content of the live broadcast. For example, a user can access a live broadcast server through a live broadcast link or live broadcast software on a mobile phone, and establish connection with the live broadcast server, so as to obtain live broadcast video data sent by the live broadcast server and realize watching of live broadcast content. When the client accesses the live broadcast server, the live broadcast server can allocate an initialization interface for the client, so that the client is provided with a preset service through the initialization interface. When the live broadcast server provides a certain preset service for the client through the initialization interface allocated to the client, the preset service is associated with the initialization interface, that is, an association relationship exists between the preset service and the initialization interface. When the concurrency amount of the data reaches the preset concurrency amount threshold, the live broadcast server may detect an association relationship between each preset service and the initialization interface already allocated to each client, so as to obtain an association relationship between the plurality of preset services and the plurality of initialization interfaces allocated in advance.
The preset service may include multiple services, and for example, in a large live broadcast scenario, the preset service may include a live broadcast content viewing service, a user account login service, a gift delivery service, a comment service, and the like. The preset service is different according to different actual application scenes and different user requirements. Here, the preset service is not particularly limited.
In the large live broadcast process, the client accessing the live broadcast server can display the front-end page of the live broadcast server. For example, a user views the live broadcast through a certain live broadcast software in a mobile phone, and a display interface on a screen of the mobile phone is a front-end page of a live broadcast server.
In an optional embodiment, to improve the visualization of the association relationship, when the electronic device detects the association relationship, the electronic device may establish a service network corresponding to the preset service and the initialization interface according to the detected association relationship between the preset services and the plurality of initialization interfaces allocated in advance, and record the service network as a front-end service network. The network nodes in the front-end service network may include a service node and an initialization interface node. The initialization interface associated with each preset service indicates that a connection relationship exists between a service node corresponding to the preset service and an initialization interface node corresponding to the initialization interface in the front-end service network. Reference to the following description with respect to the front-end service network is not specifically made here.
In the embodiment of the present invention, the association relationship between the initialization interface and the preset service may be represented by a binary table shown in table 1, in addition to the form of the front-end service network. Or in the form of a two-dimensional matrix or the like. In addition, the front-end service network in the above embodiments may include other nodes, such as a data transmission node of an initialization interface, besides the service node and the initialization interface node. The association relationship between the initialization interface and the preset service may include transmission data, and at this time, the association relationship may be represented by a ternary table. And will not be described in detail herein.
TABLE 1
Item Service 1 Service 2 Service 3 Service 4
Initialization interface A 1 1 1 1
The preset services in table 1 above include service 1, service 2, service 3, and service 4. The number 1 in table 1 indicates that the preset service and the initialization interface a have an association relationship, that is, the initialization interface a in table 1 has an association relationship with the service 1, the service 2, the service 3, and the service 4, respectively.
After the live broadcast server allocates the initialization ports for the clients accessing the live broadcast server, the live broadcast server can perform data interaction with the clients through the initialization ports. For example, the client a may send comment information posted by the user to the live server, and the live server may push the comment information sent by the client B to the client a. In the data interaction process, the initialization interface distributed by the live broadcast server for each client contains a large amount of data, so that the live broadcast server can set a corresponding micro-service interface for each type of data according to the type of the data, and the data management is facilitated. When a data request sent by a certain client is received, the initialization interface distributed by the live broadcast server for the client can call the corresponding micro-service interface according to the type of the data requested by the client, so that the corresponding service is provided for the client. At this time, there is a call relationship between the initialization interface and the microservice interface it calls. When the concurrency amount of the data reaches the preset concurrency threshold, the live broadcast server needs to detect each micro service interface called by each initialization interface in addition to the association relationship, so as to obtain the calling relationship between each initialization interface and each micro service interface.
The call relationship between the initialization interface and the micro service interface may be specifically expressed as: the initialization interface calls the micro service interface, namely the micro service interface is called by the initialization interface.
In an optional embodiment, to improve the visualization of the call relationship, when the electronic device detects the call relationship, a call network corresponding to the micro service interface and the initialization interface may be established according to the call relationship between each initialization interface and the plurality of micro service interfaces, and is recorded as an interface call network. The network nodes in the interface call network comprise a micro-service interface node and an initialization interface node. The micro service interface called by each initialization interface shows that a connection relation exists between the initialization interface node corresponding to the initialization interface and the micro service interface node corresponding to the micro service interface called by the initialization interface in the interface calling network.
For the sake of understanding, the initialization interface a is taken as an example, and the description is given by taking the interface call network shown in fig. 2 as an example. Fig. 2 is a schematic diagram of an interface call network according to an embodiment of the present invention.
It is assumed that, in the obtained calling relationship between each initialization interface and a plurality of micro service interfaces, the micro service interfaces that the initialization interface a can call include a micro service interface 1, a micro service interface 2, a micro service interface 3, and a micro service interface 4. According to the calling relationship, the electronic device may construct an interface calling network as shown in fig. 2, that is, the initialization interface a has a connection relationship with each of the micro service interface 1, the micro service interface 2, the micro service interface 3, and the micro service interface 4.
In the embodiment of the present invention, there may also be a call relationship between different micro service interfaces. And will not be described in detail herein.
In the embodiment of the present invention, when the concurrency of the data reaches the preset concurrency threshold, the electronic device may detect other information related to the preset service, the initialization interface, or the micro-service interface, in addition to the association relationship and the call relationship.
For example, for the plurality of preset services, there may be an association relationship between different preset services. Taking the live content viewing service, the user account login service, and the gift delivery service as examples, the user can only use the logged-in condition to deliver the gift, but the user can view the live content no matter whether the user logs in or not. Therefore, there is no association between the live content viewing service and the user account login service, or the association is null, while there is an association between the gift-offering service and the live content viewing service, or the association is not null. When the concurrency amount of the data reaches the preset concurrency amount threshold, the electronic device may detect an association relationship between the preset services.
For another example, the electronic device may further detect the data amount transmitted by each initialization interface when performing data interaction with the client through the initialization interface, and further obtain the importance level value of the data transmitted by each initialization interface based on the data amount, for example, the data amount transmitted by each initialization interface is used as the importance level value of the data transmitted by the initialization interface. Referring to the method for acquiring the importance level value of the data transmitted by each initialization interface, the electronic device may further acquire the importance level value of the data corresponding to the micro service interface, which is not specifically described herein.
In the step S102, the importance weight of each interface is obtained according to the association relationship and the call relationship, and a method for obtaining the importance weight of each interface may refer to the embodiment shown in fig. 3, which is not specifically described herein.
In step S103, the importance weight of each interface is output, and resource allocation is performed based on the importance weight of each interface.
In an optional embodiment, after obtaining the importance weights of the interfaces, the electronic device actively outputs the importance weights of the interfaces.
In another alternative embodiment, the electronic device may update and store the importance weights of the interfaces after acquiring the importance weights of the interfaces. When receiving an acquisition request for the importance weights of the respective interfaces, the electronic device may output the importance weights of the respective interfaces.
The resources in the resource allocation based on the importance weight of each interface may include a plurality of resources, and the allocated resources include, but are not limited to, network resources and human resources. Here, the resource to be allocated is not particularly limited.
In the embodiment of the present invention, the importance weight of each interface may be used to indicate the importance of each interface, that is, the interface with the higher importance weight has the higher importance, and the interface with the lower importance weight has the lower importance. Therefore, when resource allocation is performed based on the importance weight of each interface, the interface with the larger importance weight has more resources allocated to it, and the interface with the smaller importance weight has relatively less resources allocated to it. For example, two interfaces with importance weights of 3 and 5, respectively, when allocating resources, since 3<5, the interface with importance weight of 5 is allocated more resources than the interface with importance weight of 3.
In an optional embodiment, when performing resource allocation based on the importance weight of each interface, for each interface, the resource amount corresponding to the importance weight of the interface may be allocated to the interface according to a preset correspondence between the importance weight and the resource amount.
In another optional embodiment, when performing resource allocation based on the importance weights of the interfaces, the importance weight of each interface may be calculated based on the importance weights of the interfaces, and then the resource to be allocated is allocated according to the importance weight corresponding to each interface.
In the embodiment of the invention, different methods can be adopted to allocate network resources or human resources and the like according to the actual application scene and the user requirements. Here, the method of allocating resources based on the importance weights of the interfaces is not particularly limited. In addition, when different resources are allocated, the execution subject of resource allocation may be different, for example, when network resources are allocated, the device performing network resource allocation may be used as the execution subject. For another example, when human resources are allocated, human resources allocating personnel may be the executing entity. Here, the execution subject of resource allocation is not particularly limited.
In the embodiment of the present invention, the resource allocation method is not only applicable to a high concurrency scenario, that is, a scenario in which the data concurrency amount reaches the preset concurrency amount threshold, but also applicable to a scenario in which the data concurrency amount does not reach the preset concurrency amount threshold. Here, an application scenario of the resource allocation method is not particularly limited.
In an optional embodiment, according to the method shown in fig. 1, an embodiment of the present invention further provides a resource allocation method. As shown in fig. 3, fig. 3 is a second flowchart of a resource allocation method according to an embodiment of the present invention. The method comprises the following steps.
Step S301, when the concurrency of the data reaches a preset concurrency threshold, detecting an association relationship between a plurality of preset services and a plurality of initialization interfaces allocated in advance, and a call relationship between each initialization interface and a plurality of micro-service interfaces.
Step S301 is the same as step S101.
Step S302, obtaining a first interface weight of each initialization interface by using the incidence relation and the preset importance degree value of each preset service.
In this step, the electronic device may obtain the weight of each network node based on an association relationship between a plurality of preset services and a plurality of initialization interfaces allocated in advance, and an importance value of each preset service. That is, the initial weight of each service is obtained, and the first interface weight of each initialization interface is obtained.
In an optional embodiment, in step S302, the obtaining of the first interface weight of each initialization interface by using the association relationship and the preset importance value of each preset service may specifically be represented as:
and aiming at each initialization interface, calculating the sum of the importance degree values of each preset service associated with the initialization interface according to the association relation and the preset importance degree value of each preset service, and taking the sum as the first interface weight of the initialization interface.
For ease of understanding, the above-mentioned obtaining of the first interface weights is described in conjunction with the front-end service network shown in fig. 4. Fig. 4 is a schematic diagram of a front-end service network according to an embodiment of the present invention.
If the importance level values corresponding to service 1, service 2, service 3, and service 4 are 1, 2, 3, and 4, respectively. According to the above fig. 4, the electronic device may determine that a connection relationship exists between the initialization interface a and the service 1, the service 2, the service 3, and the service 4, that is, an association relationship exists between the initialization interface a and the service 1, the service 2, the service 3, and the service 4, and at this time, the electronic device may determine that the first interface weight of the initialization interface a is 10 — 1+2+3+ 4.
In the embodiment of the present invention, the importance level value of each preset service is used to represent the importance of each service. The importance degree value of each service may be a preset numerical value, or may be determined according to the priority of each service and the association relationship between services. By taking the account login service and the gift-offering service as examples, when a user watches live broadcast content, the user can only log in the account of the user to carry out gift-offering. At this time, there is an association relationship between the account login service and the gift sending service, and the priority of the account login service is higher than that of the gift sending service, so that the importance degree value corresponding to the account login service is greater than that corresponding to the gift sending service. Here, the importance level value of each preset service is not particularly limited.
In an optional embodiment, in order to improve the accuracy of the obtained first interface weight of the initialization interface, in addition to obtaining the first interface weight according to the association relationship and the preset importance value of each preset service, the electronic device may further comprehensively consider the data amount of data transmitted by each initialization interface, the influence of data, such as the user account level corresponding to the client accessing the electronic device, on the first interface weight of the initialization interface, and a specific method may be described in the following description, which is not specifically described herein.
In the embodiment of the invention, the first interface weight of each initialization interface is obtained by using the importance degree value of each preset service which has an association relation with each initialization interface, so that the accuracy of the first interface weight of each initialization interface is improved, and the accuracy of the importance weight of each interface obtained according to the first interface weight is improved.
Step S303, acquiring the second interface weight of each interface by using the calling relationship.
In this step, the electronic device may obtain the second interface weight of each interface according to the connection relationship between each interface in the interface call network.
In the embodiment of the present invention, the execution sequence of the above step S302 and step S303 is not particularly limited.
In an optional embodiment, in step S303, the second interface weight of each interface is obtained by using the call relationship, which may specifically be represented as: and acquiring the second interface weight of each interface according to the number of the micro service interfaces called by each initialization interface and the number of the initialization interfaces called by each micro service interface. That is, the second interface weight of each initialization interface is obtained according to the number of micro service interfaces called by each initialization interface, for example, the electronic device may directly use the number of micro service interfaces called by each initialization interface as the second interface weight of the initialization interface, and obtain the second interface weight of each micro service interface according to the number of initialization interfaces called by each micro service interface, for example, the electronic device may directly use the number of initialization interfaces called by each micro service interface as the second interface weight of the micro service interface.
For example, if there are 4 micro service interfaces that can be called by an initialization interface in the interface calling network, the electronic device may determine that the second interface weight of the initialization interface is 4. For another example, if a micro service interface in the interface call network can only be called by an initialization interface, the second interface weight of the micro service interface is 1.
In another optional embodiment, in step S303, the second interface weight of each interface is obtained by using the call relationship, which may specifically be represented as: respectively carrying out robustness analysis on each initialization interface and each micro service interface according to the number of the micro service interfaces called by each initialization interface and the number of the initialization interfaces called by each micro service interface to obtain a robust value of each interface; and taking the reciprocal of the robust value of each interface as the second interface weight of the interface.
The electronic equipment can perform robustness analysis on each interface in the interface calling network in a machine learning mode to obtain a robustness value of each interface. For example, the electronic device may simulate, based on the interface call network, a situation where each interface in the interface call network is damaged one by one, such as when each interface is simulated in a closed state or in an abnormal access state one by one, obtain a total access success rate or a total access success number for accessing each interface in the interface call network, and obtain a corresponding robust value in a situation where each interface is damaged. Thus, the robust value is taken as the robust value of the damaged interface, and the reciprocal of the robust value of each interface is taken as the second interface weight of the interface.
For the sake of understanding, the above total access success rate is described by taking the interface 1 and the interface 2 included in the interface call network as an example. Assuming that the total access success rate of each interface in the interface call network is 0.8 under the condition that the interface 1 is damaged, and the total access success rate of each interface in the interface call network is 0.2 under the condition that the interface 2 is damaged. At this time, the electronic device may use 0.8 as the robust value of interface 1 and 0.2 as the robust value of interface 2. Further, the electronic device may determine that the second interface weight of interface 1 is the inverse of 0.8, i.e., 1.25, and the second interface weight of interface 2 is the inverse of 0.2. Since 5>1.25, the importance of interface 2 in the interface call network is higher than the importance of interface 1 in the interface call network.
In the embodiment of the invention, the robustness value is used for indicating the robustness of the whole interface calling network when the interface cannot be normally accessed. The larger the robust value is, the higher the robustness is, the smaller the influence of the interface on the whole interface call network is, and the smaller the weight of the second interface of the interface is. The smaller the robust value is, the lower the robustness is, the greater the influence of the interface on the whole interface call network is, and the greater the weight of the second interface of the interface is.
In an embodiment of the present invention, the second interface weight of each interface may further be related to an importance value of the data of the category corresponding to each micro service. And will not be described in detail herein.
In the embodiment of the invention, the second interface weight of each interface can be obtained through the calling relationship between each initialization interface and a plurality of micro service interfaces, so that the accuracy of the second interface weight of each interface is improved, and the accuracy of the importance weight of each interface obtained according to the second interface weight is improved.
Step S304, based on the first interface weight and the second interface weight, obtaining the importance weight of each interface.
In an optional embodiment, the electronic device may compound the two networks based on the established front-end service network and the interface call network, so as to obtain a compound network. And according to the first interface weight of the initialized interface in the front-end service network and the second interface weight of each interface in the interface calling network, re-acquiring the composite weight of each interface in the composite network, thereby acquiring the importance weight of each interface according to the composite weight of each interface. For the method for obtaining the complex weight and the importance weight, reference may be made to the following description, which is not specifically described herein.
For ease of understanding, the composite network will be described with the front-end service network shown in fig. 4 and the interface invocation network shown in fig. 2 described above. The electronic device may invoke the networks for the front-end service network shown in fig. 4 and the interface shown in fig. 2, merge the same network nodes in the two networks, and reserve different network nodes, thereby obtaining the composite network shown in fig. 5. Fig. 5 is a schematic diagram of a composite network according to an embodiment of the present invention.
In step S305, the importance weights of the interfaces are output to allocate resources based on the importance weights of the interfaces.
Step S305 is the same as step S103.
In an alternative embodiment, according to the method shown in fig. 3, an embodiment of the present invention further provides a resource allocation method. As shown in fig. 6, fig. 6 is a third flowchart illustrating a resource allocation method according to an embodiment of the present invention. The method comprises the following steps.
Step S601, when the concurrency of the data reaches a preset concurrency threshold, detecting an association relationship between a plurality of preset services and a plurality of initialization interfaces allocated in advance, and a call relationship between each initialization interface and a plurality of micro service interfaces.
Step S601 is the same as step S301.
Step S602, obtaining a preset importance value of data transmission of each initialization interface.
In an optional embodiment, the electronic device may obtain a preset importance level value of transmission data of each initialization interface according to the transmission data of each initialization interface. For example, the electronic device may use the amount of data transmitted by each initialization interface as a preset importance level value for the initialization interface to transmit data.
In the embodiment of the present invention, the importance level value of the data transmitted by the initialization interface is used to represent the importance level of the data transmitted by each initialization interface. The importance value of the transmission data may be a preset value, and may be determined according to a preset priority of the transmission data and a data amount of the transmission data. Here, the degree of importance of the data transmission by the initialization interface is not particularly limited.
The transmission data may be data transmitted by the current initialization interface within a preset time period.
In the embodiment of the present invention, the execution sequence of step S601 and step S602 is not particularly limited.
Step S603, for each initialization interface, according to the association relationship and the preset importance value of each preset service, calculating a sum of the importance value of the preset service associated with the initialization interface and the preset importance value of the data transmitted by the initialization interface, as a first interface weight of the initialization interface.
The electronic device may add a data node in the front-end service network according to each initialization interface and data transmitted by each initialization interface. Based on the front-end service network, calculating the sum of the two importance values according to the importance value of each service connected with each initialization interface node in the front-end service network and the importance value of the data node connected with the initialization interface node, and obtaining the first interface weight of the initialization interface. Namely, the sum of the importance value of the preset service associated with each initialization interface and the importance value preset for the initialization interface to transmit data is used as the first interface weight of the initialization interface.
In the embodiment of the invention, the first interface weight of each initialization interface is obtained through the importance degree value of data transmission of each initialization interface in the preset time period, so that the obtained first interface weight of each initialization interface can be changed along with the change of the transmission data, the first interface weight of each initialization interface is dynamically adjusted, the accuracy of the first interface weight of each initialization interface is improved, and the accuracy of the importance weight of each interface is improved.
The method for obtaining the first interface weight according to the user account level corresponding to the client accessing the electronic device may refer to the method for obtaining the first interface weight according to the importance level preset by each initialization interface transmission data, which is not specifically described herein.
Step S604, obtaining the second interface weight of each interface by using the calling relationship.
Step S605, based on the first interface weight and the second interface weight, the importance weight of each interface is obtained.
Step S606, outputting the importance weight of each interface to perform resource allocation based on the importance weight of each interface.
The above-described steps S604 to S606 are the same as the above-described steps S303 to S305.
In an alternative embodiment, according to the method shown in fig. 3, an embodiment of the present invention further provides a resource allocation method. As shown in fig. 7, fig. 7 is a fourth flowchart illustrating a resource allocation method according to an embodiment of the present invention. The method comprises the following steps.
Step S701, when the concurrency of the data reaches a preset concurrency threshold, detecting an association relationship between a plurality of preset services and a plurality of initialization interfaces allocated in advance, and a call relationship between each initialization interface and a plurality of micro service interfaces.
Step S702, obtaining a first interface weight of each initialization interface by using the association relationship and the preset importance value of each preset service.
Step S703, obtaining the second interface weight of each interface by using the call relationship.
The steps S701 to S703 are the same as the steps S301 to S303.
Step S704, using the preset importance level value of each preset service as the initial service weight of each service.
In this step, in the front-end service network, the electronic device obtains the first interface weight of each initialization interface. The electronic device may also obtain an initial traffic weight for each traffic. Namely, the importance value of each service is used as the initial service value of the service. For example, if the importance value of a service is 2, the electronic device may determine that the initial service weight of the service is 2.
Step S705, performing normalization processing on the initial service weight of each preset service and the first interface weight of each initialization interface to obtain a first to-be-combined weight of each initialization interface.
In this step, according to the initial service weight corresponding to each service node in the front-end service network and the first interface weight of each initialization interface node, the electronic device may perform homogenization processing on the weight of each network node in the front-end service network, so that the value range of the weight of each network node is between 0 and 1, thereby obtaining the first weight to be composited of each initialization interface.
In this step, the electronic device may further obtain a weight to be composited of each service node in the front-end service network, that is, a weight to be composited of each service.
In the embodiment of the present invention, a normalization processing method may be used in addition to the above normalization processing method, and the specific calculation procedures of the above normalization processing and normalization processing are not specifically described here.
Step S706, performing normalization processing on the second interface weight of each interface to obtain a second to-be-composited weight of each interface.
In this step, according to the second interface weight of each interface in the interface call network, the electronic device may perform homogenization processing on the weight of each network node in the interface call network, so that the value range of the weight of each network node is between 0 and 1, thereby obtaining the second to-be-composited weight of each interface.
Step S707, based on the first weight to be composited of each initialization interface and the second weight to be composited of each interface, a sum of the weights to be composited corresponding to each interface is calculated, so as to obtain the composite weight of each interface.
The initialization interface a and the micro service interface 1 in fig. 5 are described as an example. If the first interface weight of the initialization interface A is 0.5, the second interface weight of the initialization interface A is 0.8, and the second interface weight of the micro service interface is 0.1. The electronic device may determine that the compound weight of initializing interface a is 1.3-0.5 + 0.8. Since micro service interface 1 is not included in the front-end service network, the electronic device may determine that the complex weight of micro service interface 1 is 0.1 — 0+ 0.1.
The value range of the composite weight of each network node in the composite network is 0-2. Namely, the value range of the complex weight of each interface is 0-2.
Step S708, obtaining the importance weight of each interface according to the composite weight of each interface.
In this step, the electronic device may obtain the importance weight of each interface according to the composite weight of each interface node in the composite network. The interface nodes in the composite network comprise a micro-service interface node and an initialization interface node.
In an optional embodiment, in step S708, the importance weight of each interface is obtained according to the composite weight of each interface, which may be specifically represented as: and taking the composite weight of each interface as the importance weight of the interface.
In another alternative embodiment, in step S708, the importance weight of each interface is obtained according to the composite weight of each interface, which may be specifically represented as:
performing iterative computation on the composite weight of each interface and the composite weight of each preset service for a preset number of times by using a preset machine learning algorithm based on the incidence relation and the calling relation to obtain the importance weight of each interface; the composite weight of each preset service is obtained according to the weight to be composited of each preset service, and the weight to be composited of each preset service is obtained by performing homogenization processing on the initial service weight of each preset service and the first interface weight of each initialization interface.
In an optional embodiment, based on the composite network, the electronic device may perform a preset number of iterative computations on the weight of each network node by using a leader rank (leader rank) algorithm or a web page ranking (pageRank) algorithm according to a composite weight corresponding to each network node in the composite network, and use the weight of each interface node after the iteration as an importance weight of an interface corresponding to the interface node.
Both the leader rank algorithm and the pageRank algorithm belong to ranking algorithms, that is, each network node in the composite network is ranked according to the importance weight of each network node obtained after iteration. For example, the electronic device may obtain a ranking result of each interface according to an order of importance weights of each interface from high to low, where the ranking result includes an importance weight corresponding to each interface.
In an embodiment of the present invention, the preset machine learning algorithm includes, but is not limited to, the leaderRank algorithm and the pageRank algorithm.
Step S709, output the importance weight of each interface, so as to allocate the resource based on the importance weight of each interface.
Step S709 is the same as step S305.
By adopting the method shown in fig. 7, the electronic device can accurately obtain the importance weight of each interface, and the accuracy of the importance weight of each interface is improved, so that limited human resources can be allocated according to the obtained importance weights, and the live broadcast quality is ensured.
For convenience of understanding, the resource allocation method provided by the embodiment of the present invention is described with reference to fig. 8. Fig. 8 is a fifth flowchart illustrating a resource allocation method according to an embodiment of the present invention. The method comprises the following steps.
Step S801, when the concurrency of the data reaches a preset concurrency threshold, the electronic device detects an association relationship between a plurality of preset services and a plurality of initialization interfaces allocated in advance, and a call relationship between each initialization interface and a plurality of micro service interfaces.
Step S802, the electronic device constructs a front-end service network according to the detected incidence relation between the plurality of preset services and the plurality of initialization interfaces which are distributed in advance.
Step S803, the electronic device calculates, according to the connection relationship of each network node in the front-end service network and the preset importance level value of each preset service, a sum of the importance level value of the preset service associated with the initialization interface and the preset importance level value of the data transmitted by the initialization interface, as the first interface weight of the initialization interface.
Step S804, the electronic device constructs an interface call network according to the call relationship between each initialization interface and the plurality of micro service interfaces.
Step S805, the electronic device respectively performs robustness analysis on each initialization interface and each micro service interface according to the number of the micro service interfaces called by each initialization interface and the number of the initialization interfaces called by each micro service interface to obtain a robust value of each interface; and taking the reciprocal of the robust value of each interface as the second interface weight of the interface.
Here, the execution sequence between the steps S802 and S803 and the steps S804 and S805 is not particularly limited.
In step S806, the electronic device performs normalization processing on the weight of each network node in the front-end service network to obtain the weight to be composited of each service node and the first weight to be composited of each initialized interface node.
In step S807, the electronic device performs homogenization processing on the weight of each network node in the interface call network to obtain a second to-be-composited weight of each interface node.
Step S808, the electronic device composites the front-end service network and the interface call network to obtain a composite network, and obtains a composite weight of each network node in the composite network based on the weight to be composited of each service node in the front-end service network, the first weight to be composited of each initialized interface node, and the second weight to be composited of each interface node in the interface call network.
And step S809, the electronic equipment performs iterative computation on the composite weight of each network node in the composite network for a preset number of times by using a preset machine learning algorithm based on the composite network to obtain the importance weight of each interface.
Step S810, the electronic device outputs the importance weight of each interface, so as to perform resource allocation based on the importance weight of each interface.
Based on the same inventive concept, according to the resource allocation method provided by the embodiment of the present invention, the embodiment of the present invention further provides a resource allocation apparatus. As shown in fig. 9, fig. 9 is a schematic view of a first structure of a resource allocation apparatus according to an embodiment of the present invention. The apparatus includes the following modules.
A detecting module 901, configured to detect, when a concurrency amount of data reaches a preset concurrency amount threshold, an association relationship between a plurality of preset services and a plurality of initialization interfaces that are pre-allocated, and a call relationship between each initialization interface and a plurality of micro service interfaces;
a first obtaining module 902, configured to obtain importance weights of the interfaces according to the association relationship and the call relationship; each interface comprises an initialization interface and a micro-service interface;
an output module 903, configured to output the importance weight of each interface, so as to perform resource allocation based on the importance weight of each interface.
Optionally, as shown in fig. 10, the first obtaining module 902 includes:
the first obtaining sub-module 9021 is configured to obtain a first interface weight of each initialization interface by using the association relationship and an importance value preset by each preset service;
the second obtaining sub-module 9022 is configured to obtain, by using the call relationship, a second interface weight of each interface;
and the third obtaining sub-module 9023 is configured to obtain importance weights of the interfaces based on the first interface weight and the second interface weight.
Optionally, the first obtaining sub-module 9021 may be specifically configured to, for each initialization interface, calculate, according to the association relationship and the preset importance value of each preset service, a sum of the importance values of each preset service associated with the initialization interface, as a first interface weight of the initialization interface.
Optionally, as shown in fig. 11, the resource allocation apparatus may further include:
a second obtaining module 904, configured to obtain a preset importance level value of data transmission of each initialization interface before obtaining the first interface weight of each initialization interface by using the association relationship and the preset importance level value of each preset service;
the first obtaining sub-module 9021 may be specifically configured to calculate, for each initialization interface, a sum of an importance value of a preset service associated with the initialization interface and an importance value preset by data transmission of the initialization interface according to the association relationship and the importance value preset by each preset service, and use the sum as a first interface weight of the initialization interface.
Optionally, the second obtaining sub-module 9022 may be specifically configured to perform robustness analysis on each initialization interface and each micro service interface respectively according to the number of micro service interfaces called by each initialization interface and the number of initialization interfaces called by each micro service interface, so as to obtain a robust value of each interface; and taking the reciprocal of the robust value of each interface as the second interface weight of the interface.
Optionally, as shown in fig. 12, the resource allocation apparatus may further include:
a third obtaining module 905, configured to take an importance degree value preset by each preset service as an initial service weight of each service before obtaining an importance weight of each interface based on the first interface weight and the second interface weight;
as shown in fig. 13, the third obtaining sub-module 9023 includes:
a first obtaining unit 1301, configured to perform homogenization processing on an initial service weight of each preset service and a first interface weight of each initialization interface to obtain a first to-be-combined weight of each initialization interface;
a second obtaining unit 1302, configured to perform normalization processing on the second interface weight of each interface to obtain a second to-be-composited weight of each interface;
a third obtaining unit 1303, configured to calculate a sum of weights to be composited corresponding to each interface based on the first weight to be composited of each initialization interface and the second weight to be composited of each interface, so as to obtain a composite weight of each interface;
a fourth obtaining unit 1304, configured to obtain the importance weight of each interface according to the composite weight of each interface.
Optionally, the fourth obtaining unit 1304 may be specifically configured to use the composite weight of each interface as the importance weight of the interface; or based on the incidence relation and the calling relation, performing iterative computation on the composite weight of each interface and the composite weight of each preset service for a preset number of times by using a preset machine learning algorithm to obtain the importance weight of each interface; the composite weight of each preset service is obtained according to the weight to be composited of each preset service, and the weight to be composited of each preset service is obtained by performing homogenization processing on the initial service weight of each preset service and the first interface weight of each initialization interface.
According to the device provided by the embodiment of the invention, the preset service associated with each initialization interface and the micro service interface called by the initialization interface can influence the importance weights corresponding to the initialization interface and the micro service interface, so that when the importance weights of each interface are obtained, the importance weights of each interface are obtained according to the association relationship between each preset service and each initialization interface which is allocated in advance and the calling relationship between each initialization interface and a plurality of micro service interfaces, and all factors influencing the importance weights of the interfaces are comprehensively considered, so that the accuracy of the obtained importance weights of the interfaces is effectively improved, the rationality of resource allocation based on the importance weights of the interfaces is improved, and the stability of network operation is maintained.
Based on the same inventive concept, according to the resource allocation method provided by the above embodiment of the present invention, an embodiment of the present invention further provides an electronic device, as shown in fig. 14, including a processor 1401, a communication interface 1402, a memory 1403, and a communication bus 1404, where the processor 1401, the communication interface 1402, and the memory 1403 complete communication with each other through the communication bus 1404;
a memory 1403 for storing a computer program;
the processor 1401, when executing the program stored in the memory 1403, implements the following steps:
when the concurrency of the data reaches a preset concurrency threshold, detecting the incidence relation between a plurality of preset services and a plurality of initialization interfaces which are distributed in advance and the calling relation between each initialization interface and a plurality of micro-service interfaces;
acquiring the importance weight of each interface according to the incidence relation and the calling relation; each interface comprises an initialization interface and a micro-service interface;
and outputting the importance weight of each interface to allocate the resource based on the importance weight of each interface.
According to the electronic device provided by the embodiment of the invention, the preset service associated with each initialization interface and the micro service interface called by the initialization interface can influence the importance weights corresponding to the initialization interface and the micro service interface, so that when the importance weights of the interfaces are obtained, the importance weights of the interfaces are obtained according to the association relationship between each preset service and each initialization interface which is allocated in advance and the calling relationship between each initialization interface and a plurality of micro service interfaces, and the factors influencing the importance weights of the interfaces are comprehensively considered, so that the accuracy of the obtained importance weights of the interfaces is effectively improved, the rationality of resource allocation based on the importance weights of the interfaces is improved, and the stability of network operation is maintained.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
Based on the same inventive concept, according to the resource allocation method provided in the above embodiment of the present invention, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute the resource allocation method described in any of the above embodiments.
Based on the same inventive concept, according to the resource allocation method provided in the above embodiments of the present invention, an embodiment of the present invention further provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute the resource allocation method described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for embodiments such as the apparatus, the electronic device, the computer-readable storage medium, the computer, and the program product, since they are substantially similar to the method embodiments, the description is simple, and the relevant points can be referred to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for resource allocation, the method comprising:
when the concurrency of the data reaches a preset concurrency threshold, detecting the incidence relation between a plurality of preset services and a plurality of initialization interfaces which are distributed in advance and the calling relation between each initialization interface and a plurality of micro-service interfaces;
acquiring the importance weight of each interface according to the incidence relation and the calling relation; wherein the interfaces include the initialization interface and the micro-service interface;
and outputting the importance weight of each interface to allocate the resource based on the importance weight of each interface.
2. The method according to claim 1, wherein the step of obtaining the importance weight of each interface according to the association relationship and the call relationship comprises:
acquiring a first interface weight of each initialization interface by using the incidence relation and an importance degree value preset by each preset service;
acquiring second interface weights of the interfaces by using the calling relation;
and acquiring the importance weight of each interface based on the first interface weight and the second interface weight.
3. The method according to claim 2, wherein the step of obtaining the first interface weight of each initialization interface by using the association relationship and the preset importance value of each preset service comprises:
and aiming at each initialization interface, calculating the sum of the importance degree values of each preset service associated with the initialization interface according to the association relation and the preset importance degree value of each preset service, and taking the sum as the first interface weight of the initialization interface.
4. The method according to claim 2, before obtaining the first interface weight of each initialization interface by using the association relationship and the preset importance value of each preset service, further comprising:
acquiring an importance degree value preset for data transmission of each initialization interface;
the step of obtaining the first interface weight of each initialization interface by using the association relationship and the preset importance degree value of each preset service includes:
and for each initialization interface, calculating the sum of the importance degree value of the preset service associated with the initialization interface and the importance degree value preset by the initialization interface for transmitting data according to the association relation and the preset importance degree value of each preset service, and taking the sum as the first interface weight of the initialization interface.
5. The method according to claim 2, wherein the step of obtaining the second interface weight of each interface by using the call relation comprises:
respectively carrying out robustness analysis on each initialization interface and each micro service interface according to the number of the micro service interfaces called by each initialization interface and the number of the initialization interfaces called by each micro service interface to obtain a robust value of each interface;
and taking the reciprocal of the robust value of each interface as the second interface weight of the interface.
6. The method of claim 2, further comprising, before obtaining importance weights for respective interfaces based on the first interface weights and the second interface weights:
taking the importance degree value preset by each preset service as the initial service weight of each service;
the step of obtaining the importance weight of each interface based on the first interface weight and the second interface weight includes:
carrying out homogenization treatment on the initial service weight of each preset service and the first interface weight of each initialization interface to obtain a first weight to be compounded of each initialization interface;
the second interface weight of each interface is subjected to homogenization treatment to obtain a second to-be-composited weight of each interface;
calculating the sum of the weights to be compounded corresponding to each interface based on the first weight to be compounded of each initialized interface and the second weight to be compounded of each interface to obtain the composite weight of each interface;
and acquiring the importance weight of each interface according to the composite weight of each interface.
7. The method of claim 6, wherein the step of obtaining the importance weight of each interface according to the composite weight of each interface comprises:
taking the composite weight of each interface as the importance weight of the interface; or
Performing iterative computation on the composite weight of each interface and the composite weight of each preset service for a preset number of times by using a preset machine learning algorithm based on the incidence relation and the calling relation to obtain the importance weight of each interface; the composite weight of each preset service is obtained according to the weight to be composited of each preset service, and the weight to be composited of each preset service is obtained by performing homogenization processing on the initial service weight of each preset service and the first interface weight of each initialization interface.
8. An apparatus for resource allocation, the apparatus comprising:
the detection module is used for detecting the incidence relation between a plurality of preset services and a plurality of initialization interfaces which are distributed in advance and the call relation between each initialization interface and a plurality of micro-service interfaces when the concurrency of data reaches a preset concurrency threshold;
the first acquisition module is used for acquiring the importance weight of each interface according to the incidence relation and the calling relation; wherein the interfaces include the initialization interface and the micro-service interface;
and the output module is used for outputting the importance weight of each interface so as to allocate the resources based on the importance weight of each interface.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 7 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 7.
CN202010224983.2A 2020-03-26 2020-03-26 Resource allocation method and device, electronic equipment and storage medium Pending CN111309490A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010224983.2A CN111309490A (en) 2020-03-26 2020-03-26 Resource allocation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010224983.2A CN111309490A (en) 2020-03-26 2020-03-26 Resource allocation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111309490A true CN111309490A (en) 2020-06-19

Family

ID=71155497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010224983.2A Pending CN111309490A (en) 2020-03-26 2020-03-26 Resource allocation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111309490A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105682146A (en) * 2016-01-08 2016-06-15 努比亚技术有限公司 Data transmission method and device and user equipment
CN107918562A (en) * 2016-10-11 2018-04-17 北京京东尚科信息技术有限公司 A kind of unified interface management method and system
CN108683604A (en) * 2018-04-03 2018-10-19 平安科技(深圳)有限公司 concurrent access control method, terminal device and medium
CN109522115A (en) * 2018-10-11 2019-03-26 平安科技(深圳)有限公司 Resource allocation method, electronic equipment and storage medium
CN109639585A (en) * 2017-10-09 2019-04-16 中兴通讯股份有限公司 Flow control methods, device, the network equipment and computer readable storage medium
US20190215239A1 (en) * 2016-09-19 2019-07-11 Huawei Technologies Co., Ltd. Microservice Configuration Apparatus and Method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105682146A (en) * 2016-01-08 2016-06-15 努比亚技术有限公司 Data transmission method and device and user equipment
US20190215239A1 (en) * 2016-09-19 2019-07-11 Huawei Technologies Co., Ltd. Microservice Configuration Apparatus and Method
CN107918562A (en) * 2016-10-11 2018-04-17 北京京东尚科信息技术有限公司 A kind of unified interface management method and system
CN109639585A (en) * 2017-10-09 2019-04-16 中兴通讯股份有限公司 Flow control methods, device, the network equipment and computer readable storage medium
CN108683604A (en) * 2018-04-03 2018-10-19 平安科技(深圳)有限公司 concurrent access control method, terminal device and medium
CN109522115A (en) * 2018-10-11 2019-03-26 平安科技(深圳)有限公司 Resource allocation method, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US20200125609A1 (en) Inductive matrix completion and graph proximity for content item recommendation
CN109885786B (en) Data caching processing method and device, electronic equipment and readable storage medium
US9043317B2 (en) System and method for event-driven prioritization
US10740427B1 (en) System and method to eliminate uncorrelated data
CN111324471B (en) Service adjustment method, device, equipment and storage medium
CN112965879A (en) Data processing method and device, electronic equipment and readable storage medium
CN115134368A (en) Load balancing method, device, equipment and storage medium
CN110222034A (en) A kind of database maintenance method and device
US8903871B2 (en) Dynamic management of log persistence
CN110443647B (en) Information delivery method and device
CN110245014B (en) Data processing method and device
CN114143000A (en) Secret trace query method and device based on careless transmission protocol and secret sharing
CN111078773B (en) Data processing method and device
CN107734006A (en) A kind of statistical log sending method, device and electronic equipment
CN111309490A (en) Resource allocation method and device, electronic equipment and storage medium
CN110020166B (en) Data analysis method and related equipment
CN110020129B (en) Click rate correction method, prediction method, device, computing equipment and storage medium
CN116599855A (en) Data transmission method, system, electronic equipment and storage medium
CN114285786B (en) Construction method and device of network link library
CN115134274B (en) Network speed measuring method and device, electronic equipment and storage medium
CN113282417A (en) Task allocation method and device, computer equipment and storage medium
US9158807B2 (en) Fast distributed database frequency summarization
CN115130026A (en) Target object determination method, device, medium and electronic equipment
CN113783912A (en) Request distribution method, device and storage medium
CN110677463B (en) Parallel data transmission method, device, medium and electronic equipment

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200619