CN110691042A - Resource allocation method and device - Google Patents
Resource allocation method and device Download PDFInfo
- Publication number
- CN110691042A CN110691042A CN201911010522.9A CN201911010522A CN110691042A CN 110691042 A CN110691042 A CN 110691042A CN 201911010522 A CN201911010522 A CN 201911010522A CN 110691042 A CN110691042 A CN 110691042A
- Authority
- CN
- China
- Prior art keywords
- server
- client
- request
- service request
- identifier
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/70—Admission control; Resource allocation
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the invention discloses a resource allocation method and a resource allocation device, which aim to solve the problem of unreasonable resource allocation in the existing service scene. The method comprises the following steps: when a service request from a client is received, acquiring a preset routing rule; the routing rule comprises a first corresponding relation between each request path and a first server identification or a second corresponding relation between each client identification and a second server identification; determining a target server corresponding to the service request according to the routing rule; and distributing the service request to the target server. When the technical scheme is used for resource allocation, the situation that the normal operation of the service is influenced when the service requests are more and the resources are not allocated reasonably is avoided based on the request path of the service request or the client, so that the stable operation of the normal service is ensured, and the reasonability of the resource allocation is realized.
Description
Technical Field
The present invention relates to the field of network resource allocation technologies, and in particular, to a resource allocation method and apparatus.
Background
With the continuous development of services, when the application is promoted in order to attract customers with low cost and high efficiency, the resource usage amount of the application is increased rapidly in a short time, thereby affecting the processing of basic services. For example, when the e-commerce platform conducts activities such as high-frequency organization second killing, the resource usage reaches dozens of times or even hundreds of times of the concurrent amount of the ordinary business in a moment, and the basic business is affected, so that the customer experience is poor. Therefore, how to reasonably allocate the resource usage amount becomes one of the problems to be solved urgently at present.
Disclosure of Invention
The embodiment of the invention provides a resource allocation method and a resource allocation device, which are used for solving the problem of unreasonable resource allocation in the existing service scene.
To solve the above technical problem, the embodiment of the present invention is implemented as follows:
in a first aspect, an embodiment of the present invention provides a resource allocation method, including:
when a service request from a client is received, acquiring a preset routing rule; the routing rule comprises a first corresponding relation between each request path and a first server identification or a second corresponding relation between each client identification and a second server identification;
determining a target server corresponding to the service request according to the routing rule;
and distributing the service request to the target server.
In a second aspect, an embodiment of the present invention further provides a resource allocation apparatus, including:
the system comprises an acquisition module, a routing module and a routing module, wherein the acquisition module is used for acquiring a preconfigured routing rule when receiving a service request from a client; the routing rule comprises a first corresponding relation between each request path and a first server identification or a second corresponding relation between each client identification and a second server identification;
the determining module is used for determining a target server corresponding to the service request according to the routing rule;
and the distribution module is used for distributing the service request to the target server.
In a third aspect, an embodiment of the present invention further provides a resource allocation apparatus, including:
a memory storing computer program instructions;
a processor which, when executed by the processor, implements the resource allocation method as claimed in any one of the above.
In a fourth aspect, the present invention also provides a computer-readable storage medium, which includes instructions, when the instructions are run on a computer, the instructions cause the computer to execute the resource allocation method according to any one of the above.
In the embodiment of the invention, when a service request from a client is received, a target server corresponding to the service request can be determined according to a preset routing rule, such as the corresponding relation between each request path and a server identifier or the corresponding relation between each client identifier and the server identifier, so that the condition that the normal operation of the service is influenced when more service requests are not reasonably allocated can be avoided based on the request path of the service request or the client, the stable operation of the normal service is ensured, and the rationality of resource allocation is realized; moreover, the service request is distributed to the target server corresponding to the service request, so that the service request can be processed by the target server reasonably configured for the service request, and the response efficiency of the service request is ensured.
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 introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a resource allocation method in an embodiment of the present invention.
Fig. 2 is a schematic flow chart of a resource allocation method in another embodiment of the present invention.
Fig. 3 is a schematic flow chart of a resource allocation method in another embodiment of the present invention.
Fig. 4 is a schematic architecture diagram of a resource allocation apparatus in an embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a resource allocation apparatus according to an embodiment of the present invention.
Fig. 6 is a schematic structural diagram of a network device applied in one embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flow chart of a resource allocation method in an embodiment of the present invention. The method of fig. 1 may include:
s102, when receiving a service request from a client, obtaining a pre-configured routing rule.
The routing rule comprises a first corresponding relation between each request path and a first server identification or a second corresponding relation between each client identification and a second server identification. The first server identifier may be names, addresses, and the like of one or more servers configured for each request path; the second server identification may be an identification of the name, address, etc. of one or more servers configured for the respective client.
And S104, determining a target server corresponding to the service request according to the routing rule.
And S106, distributing the service request to the target server.
In the embodiment of the invention, when a service request from a client is received, a target server corresponding to the service request can be determined according to a preset routing rule, such as the corresponding relation between each request path and a server identifier or the corresponding relation between each client identifier and the server identifier, so that the allocation of resources can be based on the request paths of the service request or the client, the condition that the normal operation of the service is influenced when more service requests are not reasonably allocated is avoided, the stable operation of the normal service is ensured, and the rationality of the resource allocation is realized; moreover, the service request is distributed to the target server corresponding to the service request, so that the service request can be processed by the target server reasonably configured for the service request, and the response efficiency of the service request is ensured.
In one embodiment, the routing rules include a first correspondence between each request path and a first server identification. Before executing S102, one or more servers may be configured for each request path in advance; and further, establishing a first corresponding relation between each request path and a first server identifier corresponding to one or more servers, and storing the first corresponding relation at the network side.
In this embodiment, by configuring the routing rule, each request path has a corresponding server identifier stored on the network side, which can ensure that the service request is distributed to the server corresponding to the server identifier, so as to maintain stable operation of the service.
In one embodiment, the service request carries a first request path, and therefore, when a target server corresponding to the service request is determined according to the routing rule, the first request path carried in the service request may be first obtained, and a first correspondence between each request path stored on the network side and the first server identifier may be obtained; secondly, according to the first request path and the first corresponding relation, the server corresponding to the first server identification corresponding to the first request path is determined to be the target server.
In this embodiment, the target server can be determined according to the first request path carried in the service request and the first corresponding relationship between each request path and the first server identifier, so that resource allocation to the service request can be based on the request path of the service request, thereby avoiding the situation that the normal operation of the service is affected when the service request is more and the resource is not allocated reasonably, and ensuring positive response to the service request.
In an embodiment, when determining that a server corresponding to a first server identifier corresponding to a first request path is a target server according to the first request path and a first corresponding relationship, if the first request path only corresponds to one first server identifier, determining that the server corresponding to the first server identifier corresponding to the first request path is the target server. If the first request path corresponds to a plurality of first server identifiers, the server corresponding to one of the first server identifiers corresponding to the first request path can be determined as the target server according to the busy degree of the server corresponding to each of the first server identifiers.
The busyness degree of the server corresponding to each first server identification can be determined, the first server identification corresponding to the idle server is determined as the target server identification, and then the server corresponding to the target server identification is determined as the target server.
For example, the first request path corresponds to two first server identities, which correspond to application service node 1 and application service node 2, respectively, assuming that it can be determined that application service node 1 is providing service, application service node 2 is idle. According to the method in the above embodiment, the application service node 2 may be finally determined to be the target server.
In this embodiment, the request path can be corresponding to one or more server identifiers, and when the request path corresponds to multiple server identifiers, a reasonable resource allocation rule is set, so that dynamic allocation of resources is achieved, and normal use of a service scenario is met.
In one embodiment, the routing rule comprises a second correspondence between the client identifications and the second server identification. Before receiving a service request from a client, one or more servers can be configured for the client in advance; and further, establishing a second corresponding relation between the client identification and a second server identification corresponding to the configured one or more servers, and storing the second corresponding relation locally at the client.
In this embodiment, the second server identifier may be stored on the network side, so as to reduce the local storage burden of the client, and the security of the network side is better.
Before the second correspondence between the client identifier and the second server identifier is stored locally at the client, special processing (such as encryption and the like) can be performed on the second correspondence, so that the content in the correspondence cannot be snooped and tampered by others.
In this embodiment, by configuring the routing rule, each client has a corresponding server identifier, and it can be ensured that the service request is all distributed to the server corresponding to the client that sends the service request, thereby implementing rationalization of resource allocation and ensuring stable operation of the service.
Based on the above embodiment, the client locally stores the second corresponding relationship between the client identifier and the second server identifier. The service request sent by the client carries a client identifier, so that when a target server corresponding to the service request is determined according to the routing rule, the client first sends a second corresponding relationship between the locally stored client identifier and a second server identifier to the resource distribution server, and after the resource distribution server receives the second corresponding relationship between the client identifier sent by the client and the second server identifier, the second server identifier corresponding to the client identifier is determined according to the second corresponding relationship and the client identifier carried in the service request; and finally, determining a target server corresponding to the service request according to the second server identifier.
Optionally, after receiving the second corresponding relationship between the client identifier and the second server identifier sent by the client, special processing (such as decryption and the like) may be performed on the second corresponding relationship, and according to the second corresponding relationship and the client identifier after the special processing, the second server identifier corresponding to the client identifier is determined, and then the target server corresponding to the service request is determined according to the second server identifier.
In addition, if a second corresponding relationship between the client identifier sent by the client and the plurality of second server identifiers is received, the busy degree of the server corresponding to each second server identifier can be determined, and the server with few idle or pending requests is determined as the target server.
Optionally, after receiving the second correspondence between the client identifier sent by the client and the plurality of second server identifiers, special processing (such as decryption and the like) may be performed on the second correspondence, and the second correspondence after the special assistance is analyzed to obtain the plurality of second server identifiers corresponding to the client identifier, and then according to the busy degree of the server corresponding to each second server identifier, it is determined that the server corresponding to one of the second server identifiers is the target server corresponding to the service request.
In this embodiment, the target server corresponding to the service request sent by the client can be determined according to the second correspondence between the client identifier and the second server identifier and the client identifier carried in the service request, so that different resources (i.e., target servers) are allocated to different clients, a situation that the normal operation of the service is affected when the service request is more and the resources are not allocated reasonably is avoided, and a positive response to the service request is ensured.
The resource allocation method provided by the present application is described below by several specific embodiments.
Example one
Fig. 2 is a schematic flow chart of a resource allocation method in another embodiment of the present invention. The method of fig. 2 may include:
s201, configuring an application server for each request path.
In another embodiment, multiple application servers may be configured for each request path.
S202, establishing a first corresponding relation between each request path and a first server identifier corresponding to the configured application server.
S203, storing the first corresponding relation in the network side.
The network side may be a cache server, and during storage, the first corresponding relationship is written into the cache server by the backend management application of the application server.
In S201 to S203, the execution subject may be a resource distribution server, a background manager related to resource allocation, a front-end device, or the like. The following execution subject of S204 to S206 is a resource distribution server.
S204, receiving a service request from the client.
The service request carries a first request path.
S205, a first request path carried in the service request is obtained, and a first corresponding relation stored at the network side is obtained.
And S206, determining the application server corresponding to the first server identifier corresponding to the first request path as the target server according to the first request path and the first corresponding relation.
In addition, if each request path corresponds to a plurality of first server identifiers, determining that the server corresponding to the first server identifier corresponding to the first request path is the target server according to the busy degree of the application server corresponding to each first server identifier.
In this embodiment, the target server can be determined according to the first request path carried in the service request and the first corresponding relationship between each request path and the first server identifier, so that resource allocation to the service request can be based on the request path of the service request, thereby avoiding the situation that the normal operation of the service is affected when the service request is more and the resource is not allocated reasonably, and ensuring positive response to the service request.
Example two
Fig. 3 is a schematic flow chart of a resource allocation method in another embodiment of the present invention. In this embodiment, the service request carries a client identifier. Fig. 4 is a schematic architecture diagram of a resource allocation apparatus in an embodiment of the present invention. The method of fig. 3 may include:
s301, configuring an application server for the client.
For example, an application service node 1 may be configured for a client 1, as shown in FIG. 4. In the figure, client 1 and client 2 … … send different service requests to client N.
The resource distribution server requested by the client 1 is random, and the resource distribution servers 1-N can provide services for the client 1; the application service nodes which can be distributed by the resource distribution server can be configured manually, the application service node 1 can be configured for the resource distribution server 1, and the application service node 1 and the application service node 2 can also be configured for the resource distribution server 2.
In addition, a plurality of application servers can be configured for the client side so as to respond to different service requests or select a better resource to respond to the service request of the client side.
S302, a second corresponding relation between the client-side identification and a second server identification corresponding to one application server is established, and the second corresponding relation is encrypted.
Following the above example, a correspondence between the name of the client 1 and the name of the application service node 1 may be established, the correspondence is encrypted, the encrypted correspondence is used as a key (key), and the name of the application service node 1 is used as a value (value).
S303, storing the encrypted second corresponding relation in the local client; and storing the second server identification at the network side.
The network side may be a cache server, and during storage, the second server identifier may be written into the cache server by a backend management application of the application server.
Following the above example, the key may be stored locally at the client 1 and the value may be stored in the cache server.
In S301 to S303, the execution subject may be a resource distribution server, a background manager related to resource allocation, a front-end device, or the like. The main execution units of S304 to S308 are resource distribution servers.
S304, receiving a service request from the client.
The service request carries a client identifier.
S305, receiving a second corresponding relation between the client identifier sent by the client and the second server identifier.
S306, according to the second corresponding relation and the client identification, a second server identification corresponding to the client identification is determined.
Specifically, the second correspondence may be decrypted first, and then, according to the decrypted second correspondence and the client identifier, the second server identifier corresponding to the client identifier is read from the cache server.
Following the above example, the key may be decrypted first, and then the name of the second server (i.e., value) corresponding to the name of the client 1 is read from the cache server according to the decrypted second correspondence and the name of the client 1. S307, determining a target server corresponding to the service request according to the second server identifier.
S308, the service request is distributed to the target server.
Next, the implementation of the above embodiment will be exemplified based on the architecture diagram shown in fig. 4. Take client 1 as an example. Firstly, a background manager writes a binding relationship between a client 1 and an application service node 1 into a cache server through a back-end management application; secondly, when the client 1 initiates a service request 1 for the first time, establishing a corresponding relation between the client 1 and the application service node 1, encrypting the corresponding relation, storing a corresponding relation identifier key obtained by encryption in the local of the client 1, storing an identifier (namely value) of the application service node 1 in a cache server, and simultaneously distributing the service request 1 to the application service node 1; then, when the client 1 initiates the service request 1 with the key, the identifier of the application service node 1 can be determined according to the key and the name of the client 1, the application service node 1 corresponding to the service request 1 can be determined according to the identifier, and then the service request 1 is distributed to the application service node 1 to complete the response to the service request.
In the embodiment of the invention, the target server corresponding to the service request sent by the client can be determined according to the second corresponding relation between the client identifier and the second server identifier and the client identifier carried in the service request, so that different resources (namely the target server) are allocated to different clients, the condition that the normal operation of the service is influenced when more service requests are available and resources are not allocated reasonably is avoided, and the positive response to the service request is ensured.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Fig. 5 is a schematic structural diagram of a resource allocation apparatus according to an embodiment of the present invention. Referring to fig. 5, a resource allocation apparatus 500 may include:
an obtaining module 510, configured to obtain a preconfigured routing rule when receiving a service request from a client; the routing rule comprises a first corresponding relation between each request path and a first server identification or a second corresponding relation between each client identification and a second server identification;
a determining module 520, configured to determine, according to the routing rule, a target server corresponding to the service request;
a distributing module 530, configured to distribute the service request to the target server.
In one embodiment, the routing rule includes a first correspondence between each request path and a first server identification; when receiving a service request from a client, before acquiring a preconfigured routing rule, the resource allocation apparatus 500 further includes:
the first configuration module is used for respectively configuring one or more servers for each request path;
the first establishing module is used for establishing a first corresponding relation between each request path and a first server identifier corresponding to one or more servers;
and the first storage module is used for storing the first corresponding relation at the network side.
In one embodiment, a service request carries a first request path; the determination module 520 includes:
the acquisition unit is used for acquiring a first request path carried in the service request; acquiring a first corresponding relation stored at the network side;
and the first determining unit is used for determining the server corresponding to the first server identifier corresponding to the first request path as the target server according to the first request path and the first corresponding relation.
In one embodiment, the determining module 520 further comprises:
the second determining unit is used for determining that the server corresponding to the first server identifier corresponding to the first request path is the target server if the first request path only corresponds to one first server identifier;
and a third determining unit, configured to determine, if the first request path corresponds to multiple first server identifiers, a server corresponding to one of the first server identifiers corresponding to the first request path as a target server according to a busy level of the server corresponding to each of the first server identifiers.
In one embodiment, the routing rule includes a second correspondence between each client identity and the second server identity; when receiving a service request from a client, before acquiring a preconfigured routing rule, the resource allocation apparatus 500 further includes:
a second configuration module for configuring one or more servers for the client;
the second establishing module is used for establishing a second corresponding relation between the client-side identification and a second server identification corresponding to one or more servers;
and the second storage module is used for storing the second corresponding relation locally at the client.
In one embodiment, the service request carries a client identifier; the determination module 520 includes:
the receiving unit is used for receiving a second corresponding relation between the client identifier sent by the client and the second server identifier;
a fourth determining unit, configured to determine, according to the second correspondence and the client identifier, a second server identifier corresponding to the client identifier;
and the fifth determining unit is used for determining the target server corresponding to the service request according to the second server identifier.
The resource allocation apparatus provided in the embodiment of the present invention is capable of performing each process implemented by the resource allocation method in the foregoing method embodiment, and is not described here again to avoid repetition.
In the embodiment of the invention, when a service request from a client is received, a target server corresponding to the service request can be determined according to a preset routing rule, such as the corresponding relation between each request path and a server identifier or the corresponding relation between each client identifier and the server identifier, so that the allocation of resources can be based on the request paths of the service request or the client, the condition that the normal operation of the service is influenced when more service requests are not reasonably allocated is avoided, the stable operation of the normal service is ensured, and the rationality of the resource allocation is realized; moreover, the service request is distributed to the target server corresponding to the service request, so that the service request can be processed by the target server reasonably configured for the service request, and the response efficiency of the service request is ensured.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a network device applied in the embodiment of the present invention, which can implement details of a resource allocation method executed by the network device in the above embodiment and achieve the same effect. As shown in fig. 6, the network device 600 includes: a processor 601, a transceiver 602, a memory 603, a user interface 604, and a bus interface, wherein:
in this embodiment of the present invention, the network device 600 further includes: a computer program stored in the memory 603 and executable on the processor 601, the computer program when executed by the processor 601 performing the steps of:
when a service request from a client is received, acquiring a preset routing rule; the routing rule comprises a first corresponding relation between each request path and a first server identification or a second corresponding relation between each client identification and a second server identification;
determining a target server corresponding to the service request according to the routing rule;
and distributing the service request to the target server.
In fig. 6, the bus architecture may include any number of interconnected buses and bridges, with one or more processors represented by processor 601 and various circuits of memory represented by memory 603 being linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. The bus interface provides an interface. The transceiver 602 may be a number of elements including a transmitter and a receiver that provide a means for communicating with various other apparatus over a transmission medium. The user interface 604 may also be an interface capable of interfacing with a desired device for different user devices, including but not limited to a keypad, display, speaker, microphone, joystick, etc.
The processor 601 is responsible for managing the bus architecture and general processing, and the memory 603 may store data used by the processor 601 in performing operations.
Optionally, the routing rule includes a first corresponding relationship between each request path and the first server identifier, and when executed by the processor 601, the computer program further implements the following steps:
when a service request from a client is received, one or more servers are respectively configured for each request path before a pre-configured routing rule is acquired;
establishing a first corresponding relation between each request path and a first server identifier corresponding to one or more servers;
the first correspondence is stored on the network side.
Optionally, the service request carries a first request path, and when being executed by the processor 601, the computer program may further implement the following steps:
acquiring a first request path carried in a service request; acquiring a first corresponding relation stored at the network side;
and determining a server corresponding to the first server identifier corresponding to the first request path as a target server according to the first request path and the first corresponding relation.
Optionally, the computer program when executed by the processor 601 may further implement the following steps:
if the first request path only corresponds to one first server identifier, determining that a server corresponding to the first server identifier corresponding to the first request path is a target server;
and if the first request path corresponds to a plurality of first server identifications, determining a server corresponding to one of the first server identifications corresponding to the first request path as a target server according to the busyness degree of the server corresponding to each first server identification.
Optionally, the routing rule includes a second corresponding relationship between each client identifier and the second server identifier, and when executed by the processor 601, the computer program further can implement the following steps:
when a service request from a client is received, one or more servers are configured for the client before a pre-configured routing rule is acquired;
establishing a second corresponding relation between the client-side identification and second server identifications corresponding to one or more servers;
the second correspondence is stored locally at the client.
Optionally, the service request carries a client identifier, and when executed by the processor 601, the computer program may further implement the following steps:
receiving a second corresponding relation between a client identifier and a second server identifier sent by the client;
determining a second server identifier corresponding to the client identifier according to the second corresponding relation and the client identifier;
and determining a target server corresponding to the service request according to the second server identifier.
In the embodiment of the invention, when a service request from a client is received, a target server corresponding to the service request can be determined according to a preset routing rule, such as the corresponding relation between each request path and a server identifier or the corresponding relation between each client identifier and the server identifier, so that the allocation of resources can be based on the request paths of the service request or the client, the condition that the normal operation of the service is influenced when more service requests are not reasonably allocated is avoided, the stable operation of the normal service is ensured, and the rationality of the resource allocation is realized; moreover, the service request is distributed to the target server corresponding to the service request, so that the service request can be processed by the target server reasonably configured for the service request, and the response efficiency of the service request is ensured.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the foregoing resource allocation method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, 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 like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (10)
1. A method for resource allocation, comprising:
when a service request from a client is received, acquiring a preset routing rule; the routing rule comprises a first corresponding relation between each request path and a first server identification or a second corresponding relation between each client identification and a second server identification;
determining a target server corresponding to the service request according to the routing rule;
and distributing the service request to the target server.
2. The method of claim 1, wherein the routing rule comprises a first correspondence between the request paths and a first server identification;
before the obtaining of the preconfigured routing rule when receiving the service request from the client, the method further includes:
respectively configuring one or more servers for each request path;
establishing the first corresponding relation between each request path and a first server identifier corresponding to the one or more servers;
and storing the first corresponding relation at the network side.
3. The method of claim 2, wherein the service request carries a first request path;
the determining the target server corresponding to the service request according to the routing rule includes:
acquiring the first request path carried in the service request; and acquiring the first corresponding relation stored by the network side;
and determining that the server corresponding to the first server identifier corresponding to the first request path is the target server according to the first request path and the first corresponding relation.
4. The method according to claim 3, wherein the determining, according to the first request path and the first corresponding relationship, that the server corresponding to the first server identifier corresponding to the first request path is the target server includes:
if the first request path only corresponds to one first server identifier, determining that a server corresponding to the first server identifier corresponding to the first request path is the target server;
if the first request path corresponds to a plurality of first server identifications, determining a server corresponding to one of the first server identifications corresponding to the first request path as the target server according to the busy degree of the server corresponding to each of the first server identifications.
5. The method of claim 1, wherein the routing rule comprises a second correspondence between the client identities and a second server identity;
before the obtaining of the preconfigured routing rule when receiving the service request from the client, the method further includes:
configuring one or more servers for the client;
establishing the second corresponding relation between the client-side identification and second server identifications corresponding to the one or more servers;
storing the second correspondence locally at the client.
6. The method of claim 5, wherein the service request carries a client identifier;
the determining the target server corresponding to the service request according to the routing rule includes:
receiving a second corresponding relation between the client identifier and the second server identifier sent by the client;
determining the second server identifier corresponding to the client identifier according to the second corresponding relation and the client identifier;
and determining a target server corresponding to the service request according to the second server identifier.
7. A resource allocation apparatus, comprising:
the system comprises an acquisition module, a routing module and a routing module, wherein the acquisition module is used for acquiring a preconfigured routing rule when receiving a service request from a client; the routing rule comprises a first corresponding relation between each request path and a first server identification or a second corresponding relation between each client identification and a second server identification;
the determining module is used for determining a target server corresponding to the service request according to the routing rule;
and the distribution module is used for distributing the service request to the target server.
8. The apparatus of claim 7, wherein the routing rule comprises a first correspondence between the request paths and a first server identification;
the device further comprises:
the first configuration module is used for respectively configuring one or more servers for each request path;
a first establishing module, configured to establish the first correspondence between each request path and a first server identifier corresponding to the one or more servers;
and the first storage module is used for storing the first corresponding relation at the network side.
9. A resource allocation apparatus, comprising:
a memory storing computer program instructions;
a processor which, when executed by the processor, implements the resource allocation method of any one of claims 1 to 6.
10. A computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the resource allocation method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911010522.9A CN110691042A (en) | 2019-10-23 | 2019-10-23 | Resource allocation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911010522.9A CN110691042A (en) | 2019-10-23 | 2019-10-23 | Resource allocation method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110691042A true CN110691042A (en) | 2020-01-14 |
Family
ID=69113908
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911010522.9A Pending CN110691042A (en) | 2019-10-23 | 2019-10-23 | Resource allocation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110691042A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111400051A (en) * | 2020-03-31 | 2020-07-10 | 京东方科技集团股份有限公司 | Resource scheduling method, device and system |
CN114285791A (en) * | 2021-12-17 | 2022-04-05 | 上海绚显科技有限公司 | Data transmission method and device, computer equipment and storage medium |
CN114401318A (en) * | 2021-12-17 | 2022-04-26 | 上海绚显科技有限公司 | Data transmission method and device, computer equipment and storage medium |
CN114615336A (en) * | 2022-04-06 | 2022-06-10 | 北京字节跳动网络技术有限公司 | Request scheduling method and device, computer equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108200165A (en) * | 2017-12-29 | 2018-06-22 | 广东欧珀移动通信有限公司 | Ask Transmission system, method, apparatus and storage medium |
CN109040316A (en) * | 2018-09-19 | 2018-12-18 | 天津字节跳动科技有限公司 | HTTP service treating method and apparatus |
CN109412957A (en) * | 2017-08-17 | 2019-03-01 | 阿里巴巴集团控股有限公司 | Traffic scheduling method, device and system and electronic equipment |
-
2019
- 2019-10-23 CN CN201911010522.9A patent/CN110691042A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109412957A (en) * | 2017-08-17 | 2019-03-01 | 阿里巴巴集团控股有限公司 | Traffic scheduling method, device and system and electronic equipment |
CN108200165A (en) * | 2017-12-29 | 2018-06-22 | 广东欧珀移动通信有限公司 | Ask Transmission system, method, apparatus and storage medium |
CN109040316A (en) * | 2018-09-19 | 2018-12-18 | 天津字节跳动科技有限公司 | HTTP service treating method and apparatus |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111400051A (en) * | 2020-03-31 | 2020-07-10 | 京东方科技集团股份有限公司 | Resource scheduling method, device and system |
CN111400051B (en) * | 2020-03-31 | 2023-10-27 | 京东方科技集团股份有限公司 | Resource scheduling method, device and system |
CN114285791A (en) * | 2021-12-17 | 2022-04-05 | 上海绚显科技有限公司 | Data transmission method and device, computer equipment and storage medium |
CN114401318A (en) * | 2021-12-17 | 2022-04-26 | 上海绚显科技有限公司 | Data transmission method and device, computer equipment and storage medium |
CN114401318B (en) * | 2021-12-17 | 2023-08-11 | 上海绚显科技有限公司 | Data transmission method, device, computer equipment and storage medium |
CN114615336A (en) * | 2022-04-06 | 2022-06-10 | 北京字节跳动网络技术有限公司 | Request scheduling method and device, computer equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106899680B (en) | The fragment treating method and apparatus of multi-tiling chain | |
CN110691042A (en) | Resource allocation method and device | |
CN108737270B (en) | Resource management method and device for server cluster | |
CN105791341B (en) | Application release processing method, device and system | |
CN107920138B (en) | User unified identification generation method, device and system | |
CN104348798B (en) | A kind of method, apparatus, dispatch server and system for distributing network | |
US20110153833A1 (en) | Rate provisioner for web services | |
CN107995013B (en) | Customer service distribution method and device | |
CN110086886B (en) | Dynamic session holding method and device | |
CN112799825A (en) | Task processing method and network equipment | |
CN109150745B (en) | Message processing method and device | |
CN106161643B (en) | Task distribution formula processing method, device and Cloud Server | |
CN107786621A (en) | A kind of user information management method, access processing method and device and system | |
CN109743357B (en) | Method and device for realizing service access continuity | |
CN115428514A (en) | Sharing geographically focused workloads between adjacent MEC hosts of multiple operators | |
CN110677475A (en) | Micro-service processing method, device, equipment and storage medium | |
CN111615128A (en) | Multi-access edge computing method, platform and system | |
CN113206877A (en) | Session keeping method and device | |
CN112087401A (en) | Method and device for realizing service quality in distributed storage | |
CN110245014B (en) | Data processing method and device | |
CN111431818B (en) | Cross-domain request flow distribution method and device, storage medium and computer equipment | |
CN114221959A (en) | Service sharing method, device and system | |
CN109413117B (en) | Distributed data calculation method, device, server and computer storage medium | |
CN111343240B (en) | Service request processing method and device, electronic equipment and storage medium | |
CN105335362B (en) | The processing method and system of real time data, instant disposal system for treating |
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 |
Application publication date: 20200114 |
|
RJ01 | Rejection of invention patent application after publication |