CN113157436B - Resource request distribution method, device, server and storage medium - Google Patents

Resource request distribution method, device, server and storage medium Download PDF

Info

Publication number
CN113157436B
CN113157436B CN202110229177.9A CN202110229177A CN113157436B CN 113157436 B CN113157436 B CN 113157436B CN 202110229177 A CN202110229177 A CN 202110229177A CN 113157436 B CN113157436 B CN 113157436B
Authority
CN
China
Prior art keywords
resource
request
server
resource server
type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110229177.9A
Other languages
Chinese (zh)
Other versions
CN113157436A (en
Inventor
刘乐
赵昊鹏
陈锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Duxiaoman Payment Technology Co ltd
Du Xiaoman Technology Beijing Co Ltd
Original Assignee
Du Xiaoman Technology Beijing 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 Du Xiaoman Technology Beijing Co Ltd filed Critical Du Xiaoman Technology Beijing Co Ltd
Priority to CN202110229177.9A priority Critical patent/CN113157436B/en
Publication of CN113157436A publication Critical patent/CN113157436A/en
Application granted granted Critical
Publication of CN113157436B publication Critical patent/CN113157436B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • 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

Abstract

The application provides a resource request distribution method, a device, a server and a storage medium, wherein the method comprises the following steps: acquiring a first resource request sent by a client, wherein the first resource request is used for requesting first-class resources of business service; distributing the first resource request to resource servers in the first resource server group; obtaining a second resource request sent by the client, wherein the second resource request is used for second-class resources, and the second-class resources are the resources on which the first-class resources depend; and distributing the second resource request to a second resource server in a second resource server group, wherein the second resource server group comprises a plurality of second resource servers, and when the resource of the service is updated, the time of the resource update of each second resource server in the second resource server group is earlier than the time of the resource update of each second resource server in the first resource server group. According to the scheme, the abnormal condition of the client resource request can be reduced.

Description

Resource request distribution method, device, server and storage medium
Technical Field
The present disclosure relates to the field of network technologies, and in particular, to a method, an apparatus, a server, and a storage medium for distributing a resource request.
Background
Updates to resources are often involved on business services platforms. For example, web services platforms often involve the update of web resources (e.g., web pages and pictures within web pages).
In the case of resource update, the updated resources need to be deployed to each resource server of the business service platform. Because the workload of deploying resources is large, and in order to reduce the number of users affected by the abnormality of the updated resources, the updated resources are not deployed to all the resource servers at the same time, so that new resources are deployed in part of the resource servers, and old resources are deployed in part of the resource servers.
In practical applications, one service requested by the client to the service platform may involve multiple resources, and the multiple resources have a dependency relationship, so that versions of the multiple resources that are requested by the client from the service platform in batches need to be consistent. For example, taking a client requesting a web page service as an example, the client loading a web page may involve resources including page data of the web page and pictures within the page, in which case, if the page data requested by the client is updated latest version page data, the client may continue to request updated latest version pictures corresponding to the page.
However, after obtaining the resource request sent by the client, the service platform distributes the resource request to the resource server for processing, which may cause that different resource requests sent by the client for one service may be distributed to multiple resource servers. If the update progress of the resources in the plurality of resource servers is different, the situation that the client cannot request the latest version data of other resources on which the resources depend after obtaining the latest version data of some resources of the service is easy to occur, so that abnormal resource request occurs.
Disclosure of Invention
In view of this, the present application provides a resource request distribution method, apparatus, server, and storage medium, so as to reduce the abnormal situation of a client resource request.
In order to achieve the above purpose, the present application provides the following technical solutions:
in one aspect, the present application provides a resource request distribution method, including:
obtaining a first resource request sent by a client, wherein the first resource request is used for requesting first-class resources of business service;
determining a first resource server group configured for the first type of resource, the first resource server group comprising a plurality of first resource servers;
Determining a target first resource server for processing the first resource request from the first resource server group, and distributing the first resource request to the target first resource server, so that the target first resource server returns the first type of resources for the client;
obtaining a second resource request sent by a client, wherein the second resource request is used for requesting a second type of resource of the business service, and the second type of resource is a resource on which the first type of resource depends;
determining a second resource server group configured for the second type of resources, wherein the second resource server group comprises a plurality of second resource servers, and when the resources of the business service are updated, the time of the second resource server configured as the resources in the second resource server group is earlier than the time of the resources in the second resource server in the first resource server group;
and determining a target second resource server for processing the second resource request from the second resource server group, and distributing the second resource request to the target second resource server so that the target second resource server returns the second class of resources for the client.
Preferably, the first type resource request is used for requesting page structure data required by loading a webpage;
the second type resource request is used for requesting a second type resource required by loading the webpage, and the second type resource is style or behavior data related to the webpage, which is analyzed by the client based on the page structure data.
Preferably, in the testing stage of updating the service resource online, at least one first resource server which has completed the resource update corresponding to the service exists in the first resource server group.
Preferably, the first resource server and the second resource server update the first type of resources in a resource coverage update mode, and the first resource server and the second resource server update the second type of resources in an incremental update mode.
Preferably, the determining a target first resource server for processing the first resource request from the first resource server group includes:
determining a first resource server of a current request to be allocated according to a first sequence corresponding to each first resource server in the first resource server group, and determining the determined first resource server as a target first resource server for processing the first resource request;
The determining a target second resource server from the second resource server group for processing the second resource request includes:
and determining a second resource server of the current request to be allocated according to a second sequence corresponding to each second resource server in the second resource server group, and determining the determined second resource server as a target second resource server for processing the second resource request.
In yet another aspect, the present application further provides a resource request distribution apparatus, including:
a first request obtaining unit, configured to obtain a first resource request sent by a client, where the first resource request is used for requesting a first type of resource of a service;
a first group determining unit configured to determine a first resource server group configured for the first type of resource, the first resource server group including a plurality of first resource servers;
a first request distributing unit, configured to determine a target first resource server for processing the first resource request from the first resource server group, and allocate the first resource request to the target first resource server, so that the target first resource server returns the first type of resource to the client;
A second request obtaining unit, configured to obtain a second resource request sent by a client, where the second resource request is used to request a second type of resource of the service, where the second type of resource is a resource on which the first type of resource depends;
a second group determining unit, configured to determine a second resource server group configured for the second type of resources, where the second resource server group includes a plurality of second resource servers, where, in a case where there is an update of a resource of the service, a time when each second resource server in the second resource server group is configured to update a resource is earlier than a time when each second resource server in the first resource server group updates a resource;
and the second request distribution unit is used for determining a target second resource server for processing the second resource request from the second resource server group and distributing the second resource request to the target second resource server so that the target second resource server returns the second class of resources for the client.
In yet another aspect, the present application further provides a resource request distribution system, including:
request distribution server and multiple resource servers;
The plurality of resource servers are divided into a first resource server group and a second resource server group, wherein a plurality of first resource servers in the first resource server group are configured to process a first resource request corresponding to a first type of resource in business service, and a plurality of second resource servers in the second resource server group are configured to process a second type of resource request corresponding to a second type of resource in the business service, and the second type of resource is a resource on which the first type of resource depends;
and the resource update time of each second resource server in the second resource server group configured as the business service related resource is earlier than the resource update time of each first resource server in the first resource server group for updating the business service related resource;
the request distribution server is used for obtaining a first resource request sent by the client, wherein the first resource request is used for requesting the first type of resources; determining a target first resource server for processing the first resource request from the first resource server group, and distributing the first resource request to the target first resource server, so that the target first resource server returns the first type of resources for the client; obtaining a second resource request sent by a client, wherein the second resource request is used for requesting a second class of resources of the business service; and determining a target second resource server for processing the second resource request from the second resource server group, and distributing the second resource request to the target second resource server so that the target second resource server returns the second class of resources for the client.
Preferably, the system further comprises:
the resource updating control device is used for obtaining the resources to be updated of the business service and the server resource online sequence corresponding to the resources, and the resource updating sequence of each second resource server in the second resource server group in the server resource online sequence is earlier than the resource updating sequence of each first resource server in the first resource server group; and updating the resources to be updated of the business service in the resource servers of the second resource server group and the first resource server group in turn according to the online sequence of the server resources.
In yet another aspect, the present application further provides a server including a memory and a processor;
wherein the memory is used for storing programs;
the processor is configured to execute the program, and when the program is executed, the program is specifically configured to implement the resource request distribution method according to any one of claims 1 to 5.
In yet another aspect, the present application further provides a storage medium storing a program, where the program is executed to implement the resource request distribution method according to any one of the above.
From the above, it can be seen that, in the present application, resource requests of a first type of resources of a business service are fixedly distributed to a first resource server group, and second type of resources on which the first type of resources depend are fixedly distributed to a second resource server group. Because the second resource server in the second resource server group is updated with priority under the condition that the service resource is updated, if the first resource server group has the first resource server which completes the resource update on-line, the condition that all the second resource servers in the second resource server group complete the resource update on-line is described. In this case, if the client obtains the new version data of the first type of resource from the first resource server in the first resource server group, the client can necessarily request the new version data of the second type of resource on which the first type of resource depends from the second resource server group, so that the situation that the client cannot request the new version data of the second type of resource on which the first type of resource depends, and thus the resource request is abnormal can be reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of the architecture of a resource request distribution system according to the present application;
fig. 2 is a schematic flow chart of a resource request distribution method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another resource request distribution method according to an embodiment of the present application;
fig. 4 is a schematic diagram showing a composition structure of a resource request distribution device according to an embodiment of the present application;
fig. 5 shows a schematic diagram of a composition structure of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without undue burden, are within the scope of the present application.
For ease of understanding, the resource request distribution system of the present application will be described first.
As shown in fig. 1, a schematic diagram of a component structure of a resource request distribution system of the present application is shown.
As can be seen from fig. 1, the resource distribution system may comprise: a request distribution server 101 and a plurality of resource servers 102.
Wherein the request distribution server 101 and the resource server 102 are connected through a network. In this application, the request distributing server and the plurality of resource servers actually form a service platform of business service, for example, taking a scenario of web service as an example, the request distributing server and the resource servers are actually website systems for providing web service.
The client 103 may send a resource request to the request distribution server.
Accordingly, the request distribution server is configured to distribute resource requests to a plurality of resource servers, where the resource request server stores service resources of service services that are required to be provided by the service platform, for example, a web service is taken as an example, and the resource server may store resource data, such as web architecture data involved in loading a web page, a style script of the web page, and pictures that need to be displayed.
The plurality of resource servers is divided into a first resource server group and a second resource server group in the present application. The first resource server group and the second resource server group respectively comprise a plurality of resource servers, and for convenience of distinction, the resource servers in the first resource server group are called as first resource servers, and the resource servers in the second resource server group are called as second resource servers. It will be appreciated that a resource server belongs to only one resource server group.
It should be noted that, in the present application, the first resource server group and the second resource server group may be logically obtained by dividing each resource server, and not necessarily physically.
In the present application, a plurality of first resource servers in a first resource server group are configured to process a first resource request corresponding to a first type of resource in a business service. And the plurality of second resource server groups in the second resource server group are configured to process second-type resource requests corresponding to second-type resources in the business service.
Wherein the second type of resource is a resource on which the first type of resource depends in the business service.
For example, the second type of resource needs to be invoked during the processing of the first type of resource. In the business service, the client generally needs to request the first type of resource first, and after the client obtains the first type of resource, the client needs to call the second type of resource based on the first type of resource, so that the business service can be obtained.
For example, taking a web page request service as an example, when a client needs to request a web page, a web page request is sent to a server to request web page structure data of the web page. And analyzing the picture links or the style scripts and the like contained in the obtained webpage structure data at the client, requesting the picture or style data from the server by the client, and finally completing loading and displaying of the webpage by combining the picture and style data. Based on the above, the web page structure data of the web page is a first type of resource in the web page request service, and the picture and style data are a second type of resource on which the web page structure data depends.
The inventors of the present application have studied to find that: since the first type of resource needs to rely on the second type of resource, the version of the second type of resource requested by the client is determined by the version of the first type of resource. If the client obtains the latest version data of the first type of resource, the client must request the latest version data of the second type of resource. For example, taking a web page request service as an example, after the client sends a web page request, the server returns web page data for the client as the structure data of the web page, if the structure data of the web page is the latest version, the picture to be invoked contained in the structure data of the web page is also the picture of the latest version after the resource is updated.
In the resource updating online stage of business service, a part of resource servers can complete resource updating, and a part of resource servers do not complete resource updating. The latest version data of the second type of resources can be obtained in the resource server which has completed resource updating, and the historical version data of the second type of resources can also be obtained; and the resource server which does not complete the resource update can only acquire the historical version data of the second type of resources.
For example, in one possible case, for any resource server, the resource server may store the updated resource data of the second type of resource at the same time, and may store the resource data of the second type of resource at the same time.
In a preferred mode, the first resource server and the second resource server both update the first type of resources in a resource coverage update mode, and the first resource server and the second resource server update the second type of resources in an incremental update mode.
The first resource server and the second resource server update the first type of resources in a resource coverage update mode, and the first type of resources and the second type of resources can only store the latest data corresponding to the first type of resources, so that after resource update deployment, updated business services can be accessed, and whether the updated business services are abnormal or not is facilitated to be tested and detected.
The incremental updating mode adopted by the resource server to update the second type of resources can reduce the data quantity consumed by the resource updating, and the resource server can also be enabled to simultaneously provide the second type of resources of the old version and the second type of resources of the new version.
From the above, if the request distribution server distributes the resource request of the first type resource of the client to the resource server that has completed the resource update, the first type resource returned by the resource server for the client is the first type resource of the latest version. In this case, after the client needs to request the second type resource of the latest version and the client sends the resource request of the second type resource, if the request distribution server distributes the resource request of the second type resource to the resource server that does not complete the resource update, the resource server can only return the second type resource of the historical version without the client, so that the client fails to request the second type resource of the latest version, and thus the condition of abnormal resource request occurs.
Illustrating:
business service a involves resource a and resource b, which depend on resource b, and both are deployed on resource servers W, X, Y and Z, and accordingly, requests for resource a and resource b are randomly distributed to four resource servers W, X, Y or Z.
In the case where the service a has a new resource online, it is assumed that the resource a of the service a before online is a1, the resource b is b1, and the resource a of the service a after online is a2, and the resource b is b2. Whereas the online procedure is to gradually deploy a2, b2 on the server W, X, Y, Z.
Assume at some point in the online process that resources a2 and b2 have been deployed on both W and X resource servers (of course, both W and Z resource servers would also have resource b1 at the same time), while resources a2 and b2 have not been deployed on resource servers Y and Z. In this case, when the client requests the business service a, the following 4 cases are involved:
1) The client's request for resource a is distributed to resource server W or X, and the client can obtain resource a2; at this time, the client requests the resource request b2, b2 to W or X (because b2 exists in W and X), so the resource b2 requested by the resource request can be normally returned, and the service is lossless;
2) The request of the client for the resource a is distributed to the resource server W or X, the client can obtain the resource a2, the client requests the resource b2, and if the request of the resource b2 is distributed to the resource server Y or Z (at the moment, b2 is not existed on the Y and Z), so the request cannot be normally returned, and the service is damaged;
3) The client requests the resource a to Y or Z, the client can obtain the resource a1, the client requests the resource b1, and if the request of the resource b1 is distributed to W or X (the W and X exist b1 at the moment), the request can be normally returned, and the service is lossless;
4) The request of the client for the resource a is distributed to the resource server Y or Z, namely a1, the client requests the resource b1, and the request of the resource b1 is distributed to the resource server Y or Z (at the moment, b1 exists in Y and Z), so that the request of the client for the resource b1 can be normally returned, and the service is lossless;
it can be seen that the above four cases are equally probable, so that 25% of the cases may cause service damage, i.e. the second type resource request is abnormal.
And the inventors further studied to find that: if the requests of the second type of resources can be distributed to the resource servers with the completed resource updating, the resource servers with the completed resource updating can obtain the latest version data and the historical version data of the second type of resources at the same time, so that the situation that the requests of the second type of resources are abnormal can be reduced or even avoided if the second type of resources are directed to the resource servers with the completed resource updating.
Meanwhile, if the request distribution server queries the resource update status of each resource server, resource waste may be caused, and a long time may be consumed, so that resource request efficiency may be affected.
Based on the above findings, the inventors of the present application thought that: the request of the second type of resource which is depended on can be fixedly distributed to the resource server which is preferentially subjected to resource updating deployment, and the request of the first type of resource which is depended on is fixedly distributed to the resource server after resource updating deployment.
Based on this, in the present application, the resource update time of each second resource server in the second resource server group configured as a business service related resource is earlier than the resource update time of each first resource server in the first resource server group for updating the business service related resource. Therefore, on the premise that the first resource server which completes the resource updating exists in the first resource server group, each second resource server in the second resource server group completes the resource updating, based on the condition, the latest version data of the second type of resources can be obtained from the second resource servers, the old version data of the second type of resources can be obtained, and therefore the situation that the version data required by the second type of resources cannot be obtained can be reduced.
The specific implementation of the resources needing online updating in the first resource server group and the second resource server group is not limited, so long as the resources which are preferentially updated online in the second resource server group are guaranteed.
In one alternative, the system may further comprise: the resource update control device (not shown in fig. 1) may have one or more resource update control devices, and the plurality of resource update control devices may form a resource online control platform.
The resource updating control device is used for obtaining resources to be updated of business services and a server resource online sequence corresponding to the resources, wherein the resource updating sequence of each second resource server in the second resource server group in the server resource online sequence is earlier than that of each first resource server in the first resource server group; and updating the resources to be updated of the business service to the resource servers of the second resource server group and the first resource server group in turn according to the online sequence of the server resources.
The server resource online sequence can be preconfigured by a user.
It may be understood that the server resource online sequence may further configure an online sequence of the updated resources deployed in each second resource server in the second resource server group, and on this basis, the resource update control device may sequentially deploy the resources to be updated to each second resource server according to the online sequence corresponding to each second resource server in the second resource server group. Similarly, the server resource online sequence may be further configured with an online sequence of the updated resources deployed in each first resource server in the first resource server group.
In practical application, the server resource online sequence can be further configured with a resource deployment suspension rule, and resource deployment can be suspended according to the resource deployment suspension rule when the resource deployment suspension condition is met. For example, the resource deployment suspension rule may be that, every time the resource update deployment on one resource server is executed, the resource deployment is suspended, and when a suspension duration is reached or a continuing deployment instruction is detected, the resource update deployment on the next resource server is continuously executed.
The resource request distribution method of the present application is described below with reference to flowcharts.
Fig. 2 is a schematic flow chart of an embodiment of a resource request distribution method, which is applied to a request distribution server, and the solution of the present application is applicable to a stage where a service platform where the request distribution server is located is on line for updating resources of a service. The method of the embodiment can comprise the following steps:
s201, a first resource request sent by a client is obtained.
The first resource request is for a first type of resource that requests a business service.
The first type of resources are resources which need to depend on other resources in business service. Typically, the first type of resource is a basic resource of a business service, and a client generally needs to request the first type of resource first in order to obtain the business service.
S202, determining a first resource server group configured for the first type of resources.
The first resource server group includes a plurality of first resource servers.
For example, the resource servers included in the first resource server group may be preconfigured in the request distribution server, and the first resource server group is configured to be suitable for the resource request of the first type of resource. On this basis, upon identifying the resource request as a resource request requesting a first type of resource, it may be determined that a fixed targeting to the first resource server group is required.
S203, determining a target first resource server for processing the first resource request from the first resource server group, and distributing the first resource request to the target first resource server, so that the target first resource server returns the first type of resource for the client.
Wherein for ease of distinction, the first resource server for handling the first resource request is referred to as the target first resource server.
For example, the request distribution server may select one first resource server from the first resource server group as the target first resource server for processing the first resource request according to a random selection.
As another example, the request distribution server may determine a target first resource server for processing the first resource request from the first resource server group according to a load balancing principle.
In an alternative manner, according to a first sequence corresponding to each first resource server in the first resource server group, determining a first resource server of a current request to be allocated, and determining the determined first resource server as a target first resource server for processing the first resource request.
The first sequence is a preset sequence of the resource requests allocated to each first resource server in the first resource server group, and on the basis, the request distribution server can sequentially distribute the resource requests to each first resource server in the first resource server group according to the first sequence.
For example, the first order is resource server 1, resource server 2, resource server 3, and resource server 4, and assuming that the resource request obtained last time is allocated to resource server 2, after the resource request is currently received, resource server 3 is determined as the resource server to be allocated with the request.
It may be appreciated that after the target first resource server obtains the first resource request, if the deployment of the resource update in the target first resource server is completed, the latest version of the first type of resource is deployed in the first resource server, in which case the target first resource server will necessarily return the latest version of the first type of resource service to the client. If the resource update deployment is not completed in the target first resource server, the first resource server returns the first type resource of the old version to the client.
S204, obtaining a second resource request sent by the client.
The second resource request is for a second type of resource that requests a business service.
Wherein the second type of resource is a resource on which the first type of resource depends.
In one possible scenario, the second type of resource is a resource that needs to be invoked by the client based on the first type of resource resolution.
In one possible scenario, the business service may be a web page request service, in which case the first type of resource may be web page base data, such as page structure data, requested by the client. The second type resource request is used for requesting a second type resource required by the loading of the webpage, and the second type resource is style or behavior data related to the webpage, which is analyzed by the client based on the page structure data.
For example, a web page consists of three types of data, structure, presentation and behavior, the structure generally referring to HTML, which is used to describe the structure of the page, while the presentation may be a CSS file, which is used to control the style of elements in the page; the behavior may be JavaScript, which is used to respond to user actions. Accordingly, the first type of resource may include structural data of the web page, while the second type of resource is a style required for loading the web page, or behavioral data such as a picture or a control.
In yet another possible scenario, the business service may be an interface invocation service, in which case the first type of resource may be interface state data corresponding to an initially invoked interface of the interface invocation service, and the second type of resource may be an interface resource for a desired invocation determined based on the interface state. For example, in a transaction settlement service, after a transaction settlement interface is called, state data indicating whether the transaction is paid may be returned, if the client can determine whether the payment is completed according to the state data and determine whether the settlement processing interface to be called is required according to whether the payment is completed, the state data is indicated as a first type resource, and the interface resource requested to be called by the client according to the state data is a second type resource.
Of course, according to different service scenarios, the first type of resources and the second type of resources may also have other possibilities, so long as the scenario that needs to request the first type of resources and the second type of resources on which the first type of resources depend are all applicable to the present embodiment in service, and will not be described in detail.
S205, determining a second resource server group configured for the second type of resource.
The second resource server group comprises a plurality of second resource servers.
Wherein, in case of an update of the resource of the service, the time when each second resource server in the second resource server group is configured to update the resource is earlier than the time when each second resource server in the first resource server group updates the resource.
S206, determining a target second resource server for processing the second resource request from the second resource server group, and distributing the second resource request to the target second resource server, so that the target second resource server returns the second class of resources for the client.
For ease of distinction, the second resource server in the second resource server group that is used to process the second resource request is referred to as the target second resource server.
Wherein the determination of the second resource server from the second resource server group for handling the second resource request may equally be determined randomly or based on a load balancing manner, in particular similar to the previous determination of the target first resource server.
In an alternative manner, the second resource server of the current request to be allocated may be determined according to a second sequence corresponding to each second resource server in the second resource server group, and the determined second resource server is determined as the target second resource server for processing the second resource request.
The second sequence is a preset sequence of resource requests allocated to each second resource server in the second resource server group.
It will be appreciated that the second resource request may indicate a second resource request
From the above, it can be seen that, in the present application, resource requests of a first type of resources of a business service are fixedly distributed to a first resource server group, and second type of resources on which the first type of resources depend are fixedly distributed to a second resource server group. Because the second resource server in the second resource server group is updated with priority under the condition that the service resource is updated, if the first resource server group has the first resource server which completes the resource update on-line, the condition that all the second resource servers in the second resource server group complete the resource update on-line is described. In this case, if the client obtains the new version data of the first type of resource from the first resource server in the first resource server group, the client can necessarily request the new version data of the second type of resource on which the first type of resource depends from the second resource server group, so that the situation that the client cannot request the new version data of the second type of resource on which the first type of resource depends, and thus the resource request is abnormal can be reduced.
It can be understood that, in the case that there is an update of a resource of a service, in order to ensure stability of the service in the process of online of the resource, and possibly also possible to use service availability of the updated resource, at least one first resource server that has completed updating of the resource corresponding to the service exists in the first resource server group in a testing stage of online updating of the service resource. The test stage is to ensure that a part of users use updated resources to provide services and a part of users still use old resources to provide services in the online process, so that even if the services are loophole due to new resources, the services of the part of users can be ensured to be available.
In practical application, the duty ratio of the first resource server which completes the resource updating in the first resource server group can be controlled according to the requirement to control the duty ratio of the user which obtains the service by using the new resource.
To facilitate an understanding of the benefits of the present application, the resource servers previously described are still exemplified below as including resource servers W, X, Y and Z, and assume that business service a involves resource a and resource b, with resource a being dependent on resource b. In the case where the new resource exists in the service a, it is assumed that the resource a of the service a before the service a is on line is a1, the resource b is b1, and the resource a of the service a after the service a is on line is a2, and the resource b is b2.
Wherein Y and Z belong to a first resource server group and W and X belong to a second resource server group. Therefore, in the resource online process, W and X preferentially complete the deployment of new resources.
Suppose that W and X have completed resource update online at present, while Y in the first resource server group has completed resource update online, while Z has not deployed updated resources.
After the scheme of the present application is adopted, the first resource request for the resource a is fixedly distributed to the first resource server group, so that the request for the resource a may be distributed to the resource server Y or Z, and the following two cases may be classified as follows:
1) And the request of the resource a sent by the client is distributed to the resource server Y, and the resource server Y returns the updated resource a2 for the client at the moment. In this case, the client will request the updated resource b, i.e. request resource b2. The request for resource b2 will be distributed to resource server W or X (where both W and X have resource b 2), so the request can be returned normally, with no loss of service.
2) And the request of the resource a sent by the client is distributed to the resource server Z, the resource server Z does not update the resource at the moment, and the resource server Z returns the resource a1 for the client. In this case, the client would request resource b1 based on resource a1. The request of the resource b1 is distributed to W or X (the resource b1 exists in W and X), so that the request can be normally returned, and the service is not damaged.
From the above examples, the abnormal condition of the resource request can be greatly reduced through the scheme of the application. Moreover, since 50% of the first resource servers in the first resource server group have new resources a2 and b2 deployed thereon, and 50% of the first resource servers have old resources a1 and b1 deployed thereon. Through hierarchical release, the availability of new service corresponding to new resources can be verified through 50% of new resources, so that even if the new service has loopholes, the service availability of 50% of users can be guaranteed.
Of course, in practical application, by increasing the number of the first resource servers in the first resource server group, the duty ratio of the first resource servers in the first resource server group for completing the resource update is set, so that the duty ratio of the users for obtaining the new service of the new resource can be flexibly controlled, for example, the duty ratio is reduced, so that the stability of more user services is ensured in the process of online resource update, and the availability of the service provided by the new resource is verified only by a small number of users.
In order to facilitate understanding of the solution of the present application, a scenario of requesting a service from a web page is taken as an example. Fig. 3 is a schematic flow interaction diagram of another embodiment of a resource request distribution method, which is applicable to a scenario in which a web page in a web page service platform has resource update online. The method of the embodiment can comprise the following steps:
S301, the client sends a webpage request to the request distribution server.
The web page request is for requesting page structure data of the web page. For example, the web page request is for HTTP data of the requested web page.
S302, the request distribution server determines a target first resource server for processing the webpage request from first resource servers corresponding to the page structure data, and distributes the webpage request to the target first resource server.
The first resource server group includes a plurality of first resource servers.
S303, the target first resource server returns page structure data of the webpage to the client.
It can be understood that in the web page request service scenario, if the web page request is a web page entry request, only one web page entry can be provided for one web page in one resource server, and if the page structure data of the web page in the first resource server is updated, no new version of the web page entry exists on the first resource server.
Correspondingly, if the resource update of the web page is already completed on the target first resource server, the new version data of the web page structure data stored in the target first resource server is returned to the client side.
Similarly, if the resource update of the web page is not completed on the target first resource server, the target first resource server returns old version data corresponding to the web page structure data to the client.
S304, the client analyzes the page structure data, determines the second type of resources and the version information of the second type of resources, which the page structure data depends on, and sends a second resource request to the request distribution server.
Wherein the second type of resource may be a resource of format or behavioral data within the web page. For example, the second type of resource may be a picture resource to be displayed in the web page or data such as a style script according to which the web page is loaded.
It can be understood that if the client obtains the new version data of the page structure data, by analyzing the page structure data, the client determines the latest version of the resources such as the picture or the style required to be called by the loading webpage, that is, the information which is contained in the page structure data and points to the new version of the picture or the style data. Accordingly, the second resource request is for requesting a new version of the second type of resource.
Similarly, if the page structure data obtained by the client is old version data, the version information of the second type resource is the old version, and the second resource request is the second type resource requesting the old version.
S305, the request distribution server determines a target second resource server for processing the second resource request from a second resource server group corresponding to the second class of resources, and distributes the second resource request to the target second resource server.
The second resource server group includes a plurality of second resource servers.
S306, the target second resource server returns the second type resource of the corresponding version to the client according to the second resource request.
In this application, the second resource server group is configured to preferentially complete the update of the corresponding resource of the web page on line relative to the first resource server group.
In this embodiment, for the second type of resources such as pictures and styles in the web page, the resource server in the present application may perform resource update in an incremental update manner, where incremental update refers to updating only the difference part between the new version and the old version of the second type of resources. The second type of resources in the resource server are updated in an incremental updating mode, so that the data volume required by the online updating of the resources can be reduced, and the old version data of the second type of resources and the new version data can be obtained in the resource server.
It can be understood that, because the second resource server group is configured to preferentially complete the update of the resources corresponding to the web page to be online, in the case that the first resource server for completing the update of the resources of the web page to be online exists in the first resource server group, each second resource server in the second resource server group has completed the update of the resources corresponding to the web page to be online, and the second resource server can provide both new version data and old version data of the second type of resources. Based on the above, the target second resource server may return the new version data or the old version data of the second type of resources to the client according to the second resource request, so as to reduce the abnormal situation of the resource requested by the client.
Corresponding to the resource request distribution method, the application also provides a resource request distribution device.
As shown in fig. 4, which is a schematic diagram illustrating the composition and structure of one embodiment of a resource request distribution device of the present application, the device may be applied to a request distribution server. The apparatus may include:
a first request obtaining unit 401, configured to obtain a first resource request sent by a client, where the first resource request is used for requesting a first type of resource of a business service;
A first group determining unit 402, configured to determine a first resource server group configured for the first type of resource, where the first resource server group includes a plurality of first resource servers;
a first request distributing unit 403, configured to determine a target first resource server for processing the first resource request from the first resource server group, and allocate the first resource request to the target first resource server, so that the target first resource server returns the first type of resource to the client;
a second request obtaining unit 404, configured to obtain a second resource request sent by the client, where the second resource request is used to request a second type of resource of the business service, and the second type of resource is a resource on which the first type of resource depends;
a second group determining unit 405, configured to determine a second resource server group configured for the second type of resources, where the second resource server group includes a plurality of second resource servers, and when there is an update of a resource of the service, a time when each second resource server in the second resource server group is configured to update a resource is earlier than a time when each second resource server in the first resource server group updates a resource;
A second request distributing unit 406, configured to determine a target second resource server for processing the second resource request from the second resource server group, and allocate the second resource request to the target second resource server, so that the target second resource server returns the second class of resources to the client.
In one possible implementation manner, the first type of resource request obtained by the first request obtaining unit is used for requesting page structure data required for loading a web page;
the second type resource request obtained by the second request obtaining unit is used for requesting a second type resource required by loading the webpage, and the second type resource is style or behavior data related to the webpage and analyzed by the client based on the page structure data.
In one possible implementation manner, at least one first resource server which has completed the resource update corresponding to the business service exists in the first resource server group in the online testing stage of the update of the business resource.
In yet another possible implementation, the first resource server and the second resource server update the first type of resources in a resource coverage update manner, and the first resource server and the second resource server update the second type of resources in an incremental update manner.
In yet another possible implementation manner, when determining a target first resource server for processing the first resource request from the first resource server group, the first request distribution unit is specifically configured to determine, according to a second order corresponding to each first resource server in the first resource server group, a first resource server of a current request to be allocated, and determine the determined first resource server as the target first resource server for processing the first resource request;
the second request distribution unit is specifically configured to determine, when determining a target second resource server for processing the second resource request from the second resource server group, a second resource server of a current request to be allocated according to a second sequence corresponding to each second resource server in the second resource server group, and determine the determined second resource server as the target second resource server for processing the second resource request.
In yet another aspect, the present application further provides a server, as shown in fig. 5, which shows a schematic view of a composition architecture of the server provided in the present application. In fig. 5, the server 500 may include: a processor 501 and a memory 502.
Optionally, the server may further include: a communication interface 503, an input unit 504 and a display 505 and a communication bus 506.
Wherein the processor 501, the memory 502, the communication interface 503, the input unit 504 and the display 505 all perform communication with each other via the communication bus 506.
In the embodiment of the present application, the processor 501 may be a central processing unit, an application specific integrated circuit, or the like.
The processor may call a program stored in the memory 502, and in particular, the processor may perform the resource request distribution method of any of the above embodiments.
The memory 502 is used to store one or more programs, and the programs may include program codes including computer operation instructions, and in this embodiment, at least a program for implementing the multimedia processing method in any one of the above embodiments is stored in the memory.
In one possible implementation, the memory 502 may include a stored program area and a stored data area, where the stored program area may store an operating system, the above-mentioned programs, and the like; the storage data area may store data created during use of the distribution server upon request.
The communication interface 503 may be an interface of a communication module.
The present application may also include an input unit 504, which may include a touch-sensitive unit, a keyboard, and the like.
The display 505 includes a display panel such as a touch display panel or the like.
Of course, the server structure shown in fig. 5 does not limit the server in the embodiments of the present application, and the server may include more or fewer components than shown in fig. 5 or may combine some components in practical applications.
In another aspect, the present application further provides a storage medium having stored therein computer executable instructions that, when loaded and executed by a processor, implement the resource request distribution method in any of the above embodiments.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described as different from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other. Meanwhile, the features described in the embodiments of the present specification may be replaced with or combined with each other to enable those skilled in the art to make or use the present application. For the apparatus class embodiments, the description is relatively simple as it is substantially similar to the method embodiments, and reference is made to the description of the method embodiments for relevant points.
Finally, it is further noted that relational terms such as first and second, and the like are 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (10)

1. A resource request distribution method, comprising:
obtaining a first resource request sent by a client, wherein the first resource request is used for requesting first-class resources of business service;
determining a first resource server group configured for the first type of resource, the first resource server group comprising a plurality of first resource servers;
determining a target first resource server for processing the first resource request from the first resource server group, and distributing the first resource request to the target first resource server, so that the target first resource server returns the first type of resources for the client;
obtaining a second resource request sent by a client, wherein the second resource request is used for requesting a second type of resource of the business service, and the second type of resource is a resource on which the first type of resource depends;
Determining a second resource server group configured for the second type of resources, wherein the second resource server group comprises a plurality of second resource servers, and when the resources of the business service are updated, the time of the second resource server configured as the resources in the second resource server group is earlier than the time of the resources in the first resource server group;
and determining a target second resource server for processing the second resource request from the second resource server group, and distributing the second resource request to the target second resource server so that the target second resource server returns the second class of resources for the client.
2. The method of claim 1, wherein the first type of resource request is for page structure data required to load a web page;
the second type resource request is used for requesting a second type resource required by loading the webpage, and the second type resource is style or behavior data related to the webpage, which is analyzed by the client based on the page structure data.
3. The method of claim 1, wherein at least one first resource server in the first resource server group that has completed the update of the resource corresponding to the business service exists during a testing phase of the update of the resource of the business service being online.
4. The method according to claim 1 or 2, wherein the first resource server and the second resource server update the first type of resources in a resource overlay update manner, and wherein the first resource server and the second resource server update the second type of resources in an incremental update manner.
5. The method of claim 1, wherein the determining a target first resource server from the first set of resource servers for processing the first resource request comprises:
determining a first resource server of a current request to be allocated according to a first sequence corresponding to each first resource server in the first resource server group, and determining the determined first resource server as a target first resource server for processing the first resource request;
the determining a target second resource server from the second resource server group for processing the second resource request includes:
and determining a second resource server of the current request to be allocated according to a second sequence corresponding to each second resource server in the second resource server group, and determining the determined second resource server as a target second resource server for processing the second resource request.
6. A resource request distribution apparatus, comprising:
a first request obtaining unit, configured to obtain a first resource request sent by a client, where the first resource request is used for requesting a first type of resource of a service;
a first group determining unit configured to determine a first resource server group configured for the first type of resource, the first resource server group including a plurality of first resource servers;
a first request distributing unit, configured to determine a target first resource server for processing the first resource request from the first resource server group, and allocate the first resource request to the target first resource server, so that the target first resource server returns the first type of resource to the client;
a second request obtaining unit, configured to obtain a second resource request sent by a client, where the second resource request is used to request a second type of resource of the service, where the second type of resource is a resource on which the first type of resource depends;
a second group determining unit, configured to determine a second resource server group configured for the second type of resources, where the second resource server group includes a plurality of second resource servers, where, in a case where there is an update of a resource of the service, a time when each second resource server in the second resource server group is configured to update a resource is earlier than a time when each first resource server in the first resource server group updates a resource;
And the second request distribution unit is used for determining a target second resource server for processing the second resource request from the second resource server group and distributing the second resource request to the target second resource server so that the target second resource server returns the second class of resources for the client.
7. A resource request distribution system, comprising:
request distribution server and multiple resource servers;
the plurality of resource servers are divided into a first resource server group and a second resource server group, wherein a plurality of first resource servers in the first resource server group are configured to process a first resource request corresponding to a first type of resource in business service, and a plurality of second resource servers in the second resource server group are configured to process a second type of resource request corresponding to a second type of resource in the business service, and the second type of resource is a resource on which the first type of resource depends;
and the resource update time of each second resource server in the second resource server group configured as the business service related resource is earlier than the resource update time of each first resource server in the first resource server group for updating the business service related resource;
The request distribution server is used for obtaining a first resource request sent by the client, wherein the first resource request is used for requesting the first type of resources; determining a target first resource server for processing the first resource request from the first resource server group, and distributing the first resource request to the target first resource server, so that the target first resource server returns the first type of resources for the client; obtaining a second resource request sent by a client, wherein the second resource request is used for requesting a second class of resources of the business service; and determining a target second resource server for processing the second resource request from the second resource server group, and distributing the second resource request to the target second resource server so that the target second resource server returns the second class of resources for the client.
8. The system of claim 7, further comprising:
the resource updating control device is used for obtaining the resources to be updated of the business service and the server resource online sequence corresponding to the resources, and the resource updating sequence of each second resource server in the second resource server group in the server resource online sequence is earlier than the resource updating sequence of each first resource server in the first resource server group; and updating the resources to be updated of the business service in the resource servers of the second resource server group and the first resource server group in turn according to the online sequence of the server resources.
9. A server comprising a memory and a processor;
wherein the memory is used for storing programs;
the processor is configured to execute the program, and when the program is executed, the program is specifically configured to implement the resource request distribution method according to any one of claims 1 to 5.
10. A storage medium storing a program which, when executed, is adapted to carry out the resource request distribution method according to any one of claims 1 to 5.
CN202110229177.9A 2021-03-02 2021-03-02 Resource request distribution method, device, server and storage medium Active CN113157436B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110229177.9A CN113157436B (en) 2021-03-02 2021-03-02 Resource request distribution method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110229177.9A CN113157436B (en) 2021-03-02 2021-03-02 Resource request distribution method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN113157436A CN113157436A (en) 2021-07-23
CN113157436B true CN113157436B (en) 2023-07-25

Family

ID=76883801

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110229177.9A Active CN113157436B (en) 2021-03-02 2021-03-02 Resource request distribution method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN113157436B (en)

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9836329B2 (en) * 2014-05-30 2017-12-05 Netapp, Inc. Decentralized processing of worker threads
US9940169B2 (en) * 2015-07-23 2018-04-10 Pearson Education, Inc. Real-time partitioned processing streaming
CN105302615B (en) * 2015-11-24 2019-08-06 小米科技有限责任公司 Method for upgrading software and device
CN106919378A (en) * 2016-08-24 2017-07-04 阿里巴巴集团控股有限公司 Application based on increment updates and method of testing and system, server and client
US10540342B2 (en) * 2017-05-08 2020-01-21 American Express Travel Related Services Company, Inc. In-memory transaction processing
CN107632889A (en) * 2017-06-28 2018-01-26 努比亚技术有限公司 A kind of method, equipment and computer-readable recording medium for realizing service degradation
CN109992384B (en) * 2019-03-18 2020-07-14 北京方鸿智能科技有限公司 Service registration discovery coordination system and method thereof
CN110941471A (en) * 2019-11-25 2020-03-31 厦门中软海晟信息技术有限公司 Method and device for internationalizing basic data of software system
CN111522661A (en) * 2020-04-22 2020-08-11 腾讯科技(深圳)有限公司 Micro-service management system, deployment method and related equipment
CN112000456A (en) * 2020-09-10 2020-11-27 腾讯科技(深圳)有限公司 Task scheduling method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN113157436A (en) 2021-07-23

Similar Documents

Publication Publication Date Title
CN112118565B (en) Multi-tenant service gray level publishing method, device, computer equipment and storage medium
CN107666525B (en) Method and device for IP allocation of cluster container
CN112000348A (en) Control method and device for service gray release and computer equipment
US9996453B2 (en) On-demand software test environment generation
CN101571809B (en) Implementation method of plug-in registration and device thereof
US10185626B2 (en) Automatic application error detection and rollback
CN106415494B (en) Enhanced updating of digital content
US20090199175A1 (en) Dynamic Allocation of Virtual Application Server
US9542226B2 (en) Operating programs on a computer cluster
US9612947B2 (en) Code-free testing framework
US10320892B2 (en) Rolling capacity upgrade control
CN113312037A (en) Data processing method, device and equipment applied to microservice and storage medium
US9141363B2 (en) Application construction for execution on diverse computing infrastructures
CN109104368B (en) Connection request method, device, server and computer readable storage medium
CN110069265B (en) Service cluster upgrading method and device and storage medium
CN103677937A (en) Method and device for upgrading and running software
CN111279312B (en) Alternative service paths for service applications
CN113157436B (en) Resource request distribution method, device, server and storage medium
CN111625344B (en) Resource scheduling system, method and device in application system
CN112115056A (en) Project deployment method and device, server and storage medium
CN110730197A (en) Service discovery method and system
CN109597749B (en) Regression testing method, device, electronic equipment and computer readable storage medium
CN112882921B (en) Fault simulation method and device
CN113835842A (en) Service design method and system for simultaneously supporting monomer architecture and micro-service architecture
CN114500268B (en) Method and device for deploying char resources, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20220913

Address after: 100193 Room 606, 6 / F, building 4, West District, courtyard 10, northwest Wangdong Road, Haidian District, Beijing

Applicant after: Du Xiaoman Technology (Beijing) Co.,Ltd.

Address before: B7-7-2, Yuxing Plaza, No.5, Huangyang Road, Yubei District, Chongqing

Applicant before: Chongqing duxiaoman Youyang Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20240108

Address after: Room 301, 3rd Floor, Building 4, West District, No.10 Northwest Wangdong Road, Haidian District, Beijing, 100085

Patentee after: Beijing Duxiaoman Payment Technology Co.,Ltd.

Patentee after: Du Xiaoman Technology (Beijing) Co.,Ltd.

Address before: 100193 Room 606, 6 / F, building 4, West District, courtyard 10, northwest Wangdong Road, Haidian District, Beijing

Patentee before: Du Xiaoman Technology (Beijing) Co.,Ltd.

TR01 Transfer of patent right