CN108322495B - Method, device and system for processing resource access request - Google Patents
Method, device and system for processing resource access request Download PDFInfo
- Publication number
- CN108322495B CN108322495B CN201710034845.6A CN201710034845A CN108322495B CN 108322495 B CN108322495 B CN 108322495B CN 201710034845 A CN201710034845 A CN 201710034845A CN 108322495 B CN108322495 B CN 108322495B
- Authority
- CN
- China
- Prior art keywords
- resource
- access
- sequence
- resources
- server
- 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
Links
- 238000012545 processing Methods 0.000 title claims abstract description 102
- 238000000034 method Methods 0.000 title claims abstract description 72
- 238000012163 sequencing technique Methods 0.000 claims description 27
- 238000003909 pattern recognition Methods 0.000 claims description 15
- 230000008569 process Effects 0.000 claims description 12
- 238000010276 construction Methods 0.000 claims description 11
- 238000012216 screening Methods 0.000 claims description 11
- 230000003247 decreasing effect Effects 0.000 claims description 10
- 238000012544 monitoring process Methods 0.000 claims description 5
- 238000009826 distribution Methods 0.000 claims description 3
- 230000007246 mechanism Effects 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 14
- 238000003860 storage Methods 0.000 description 8
- 238000004590 computer program Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000004140 cleaning Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 239000006185 dispersion Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1012—Server selection for load balancing based on compliance of requirements or conditions with available server resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1023—Server selection for load balancing based on a hash applied to IP addresses or costs
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The application provides a method, a device and a system for processing a resource access request. The method further comprises the following steps: analyzing a plurality of historical resource access requests aiming at a current resource server to obtain a plurality of corresponding target resources; constructing a first resource access sequence based on a plurality of historical resource access requests, wherein the first resource access sequence is used for identifying the access sequence of the plurality of historical resource access requests to the plurality of target resources; determining an access mode of the first resource access sequence as a plurality of resources accessing the current resource server; the other resource access requests which are inconsistent with the access mode are distributed to other resource servers for processing, so that an identification mechanism of the access requests is provided, optimal configuration of server load is achieved, the access requests are prevented from being concentrated in one server for processing, excessive load of the server is prevented from being caused, processing of other access requests aiming at the server is prevented from being influenced, and load balance of the server in a distributed system can be better achieved.
Description
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method, an apparatus, and a system for processing a resource access request.
Background
When a distributed system handles network access, a plurality of access requests are generally received in the same time, and resources are distributed to each server, so that the access requests are distributed to each server for processing. There are generally two modes of dispersion:
one way is that by using a specific algorithm (e.g., a hashing algorithm) to spread the access requests evenly across all servers, the sequentially marked contiguous resources may be distributed across different servers and thus not be able to support traversing all resources according to an ordered resource identification.
In another mode, all the resources are arranged according to the ordered resource identifiers, and each server provides the resources corresponding to one continuous interval. In this case, if a server provides resources in the interval [ a, b ], all access requests for resources in the interval [ a, b ] are processed by the server, and the scheme supports traversing all resources with ordered resource identifications.
In practical applications, the number of resources or the amount of requests often increases, and the resource intervals provided by the servers are adjusted to balance the load of each server, for example, when the number of resources in the [ a, c ] interval increases, and one server may not be able to handle all requests for the resources, the interval may be divided into two intervals [ a, b ] and [ b, c ], and the two servers respectively provide services.
However, for a plurality of access requests for traversing server resources, the access requests cannot be distributed to different servers in the manner of distributing resources, so that the current server is overloaded, the processing of other access requests for the server is affected, and the load balance of the server in the distributed system cannot be realized. It is therefore desirable to provide a mechanism for identifying access requests traversing server resources.
Disclosure of Invention
In view of the above problems, embodiments of the present application are proposed to provide a method for processing a resource access request and a corresponding device for processing a resource access request, which overcome or at least partially solve the above problems.
In order to solve the above problem, the present application discloses a method for processing a resource access request, including:
analyzing a plurality of historical resource access requests aiming at a current resource server to obtain a plurality of target resources corresponding to the plurality of historical resource access requests;
constructing a first resource access sequence based on the plurality of historical resource access requests, the first resource access sequence being used to identify an order of access of the plurality of historical resource access requests to the plurality of target resources;
determining an access mode of the first resource access sequence as a plurality of resources accessing the current resource server;
and distributing other resource access requests inconsistent with the access mode to other resource servers for processing.
Optionally, the parsing the plurality of historical resource access requests for the current resource server, and obtaining a plurality of target resources corresponding to the plurality of historical resource access requests includes:
and extracting the resource identifier of the target resource from the uniform resource locator corresponding to the historical resource access request.
Optionally, the method further comprises:
and collecting a plurality of historical resource access requests received by the current resource server.
Optionally, the collecting the plurality of historical resource access requests received by the current resource server includes:
the method comprises the steps of collecting a plurality of historical resource access requests received by a resource server within a set time period from a current time point aiming at each resource server of a distributed service system.
Optionally, before the parsing the plurality of historical resource access requests for the current resource server and obtaining a plurality of target resources corresponding to the plurality of historical resource access requests, the method further includes:
and screening a plurality of historical resource access requests from the same access terminal.
Optionally, the constructing a first resource access sequence based on the plurality of historical resource access requests includes:
determining the actual access sequence of each target resource according to the actual access time corresponding to each target resource;
sequencing the actual access sequence according to the resource sequencing of the target resource;
and taking the set of the sorted actual access orders as the first resource access sequence.
Optionally, the constructing a first resource access sequence based on the plurality of historical resource access requests includes:
sequencing the resource numbers corresponding to the resource identifications of the target resources according to the corresponding actual access time;
and taking the set of the sorted resource identifications as the first resource access sequence.
Optionally, each target resource carries a resource identifier that is sequentially added according to a monotone rule, and the determining that the access mode of the first resource access sequence is to access the multiple resources of the current resource server includes:
determining the first sequence of resource accesses as a monotonically increasing sequence or a monotonically decreasing sequence.
Optionally, the determining that the access mode of the first resource access sequence is to access a plurality of resources of the current resource server includes:
constructing an access mode as a second resource access sequence for accessing a plurality of resources of the current resource server;
and if the first resource access sequence and the second resource access sequence are judged to meet the preset similar condition, determining that the access mode of the first resource access sequence is to access a plurality of resources of the current resource server.
Optionally, the constructing the access pattern as a second resource access sequence for accessing a plurality of resources of the current resource server includes:
generating a corresponding set access sequence according to the resource sequence of the target resource, and taking the set of the set access sequence as the second resource access sequence;
or, the resource identifiers of the multiple target resources are sorted according to the resource sorting, and the set of resource numbers corresponding to the sorted resource identifiers is used as the second resource access sequence.
Optionally, each target resource carries a resource identifier sequentially added according to a monotone rule, and the generating of the corresponding set access order according to the resource ordering of the target resource includes:
sequencing the target resources according to a monotone rule corresponding to the resource identifier;
and generating a corresponding set access order according to the sorted target resources.
Optionally, the determining that the first resource access sequence and the second resource access sequence satisfy a preset similarity condition includes:
determining the similarity of the first resource access sequence and a second resource access sequence;
and if the similarity is greater than a set threshold, judging that the first resource access sequence and the second resource access sequence meet a preset similarity condition.
Optionally, the method further comprises:
receiving a resource query acquisition request and feeding back resource identifiers of all resources of the resource server;
and receiving a resource access request sent according to the resource identifier.
Optionally, the distributing the other resource access requests inconsistent with the access mode to other resource servers for processing includes:
monitoring for a new resource access request to the current resource server;
identifying whether the other resource access requests are consistent with the access pattern;
and if the resource access requests are not consistent, allocating the other resource access requests to other resource servers for processing.
Optionally, the identifying whether the other resource access requests are consistent with the access pattern includes:
and identifying whether the other resource access requests and the plurality of resource access requests originate from the same access terminal.
Optionally, the method further comprises:
and determining the access mode of the first resource access sequence as a plurality of resources accessing other resource servers.
Optionally, the method further comprises:
and sending a notification message to the other resource servers, wherein the notification message carries the identification of the access end of the plurality of historical resource access requests.
Optionally, the method further comprises:
and processing the other resource access requests if the access mode of the first resource access sequence is determined not to access the plurality of resources of the current resource server.
Optionally, after the determining that the access mode of the first resource access sequence is to access a plurality of resources of the current resource server, the method further includes:
processing other resource access requests consistent with the access pattern.
The application also discloses a device for processing the resource access request, which comprises:
the target resource acquisition module is used for analyzing a plurality of historical resource access requests aiming at the current resource server and acquiring a plurality of target resources corresponding to the plurality of historical resource access requests;
a first sequence construction module, configured to construct a first resource access sequence based on the plurality of historical resource access requests, where the first resource access sequence is used to identify an access order of the plurality of historical resource access requests to the plurality of target resources;
a first pattern recognition module, configured to determine that an access pattern of the first resource access sequence is to access a plurality of resources of the current resource server;
and the first access request processing module is used for distributing other resource access requests which are inconsistent with the access mode to other resource servers for processing.
Optionally, the target resource obtaining module is specifically configured to extract a resource identifier of the target resource from a uniform resource locator corresponding to the historical resource access request.
Optionally, the apparatus further comprises:
and the access request collection module is used for collecting a plurality of historical resource access requests received by the current resource server.
Optionally, the access request collection module is specifically configured to collect, for each resource server of the distributed service system, a plurality of historical resource access requests received by the resource server within a set time period from a current time point.
Optionally, the apparatus further comprises:
and the access request screening module is used for screening a plurality of historical resource access requests from the same access terminal before the plurality of historical resource access requests aiming at the current resource server are analyzed and a plurality of target resources corresponding to the plurality of historical resource access requests are obtained.
Optionally, the first sequence building block comprises:
the actual order determining submodule is used for determining the actual access order of each target resource according to the actual access time corresponding to each target resource;
and the actual order sequencing submodule is used for sequencing the actual access order according to the resource sequencing of the target resource and taking the set of the sequenced actual access order as the first resource access sequence.
Optionally, the first sequence building block comprises:
and the time sequencing submodule is used for sequencing the resource numbers corresponding to the resource identifications of the target resources according to the corresponding actual access time, and taking the set of the sequenced resource identifications as the first resource access sequence.
Optionally, each target resource carries a resource identifier that is sequentially added according to a monotonic rule, and the first pattern recognition module is specifically configured to determine whether the first resource access sequence is a monotonically increasing sequence or a monotonically decreasing sequence.
Optionally, the first trend identification module includes:
the second sequence construction submodule is used for constructing a second resource access sequence with an access mode of accessing a plurality of resources of the current resource server;
and the sequence judgment submodule is used for judging that the first resource access sequence and the second resource access sequence meet preset similar conditions, and determining that the access mode of the first resource access sequence is to access a plurality of resources of the current resource server.
Optionally, the second sequence building sub-module comprises:
a set order generating subunit, configured to generate a corresponding set access order according to the resource ordering of the target resource, and use the set of set access orders as the second resource access sequence;
or, the resource identifier sorting subunit is configured to sort the resource identifiers of the multiple target resources according to the resource sorting, and use a set of resource numbers corresponding to the sorted resource identifiers as the second resource access sequence.
Optionally, each target resource carries a resource identifier sequentially added according to a monotone rule, and the set order generating subunit is specifically configured to sort the target resources according to the monotone rule corresponding to the resource identifiers; and generating a corresponding set access order according to the sorted target resources.
Optionally, the sequence determination sub-module includes:
the similarity determining submodule is used for determining the similarity between the first resource access sequence and the second resource access sequence;
and the similarity judging submodule is used for judging that the first resource access sequence and the second resource access sequence meet a preset similarity condition if the similarity is greater than a set threshold.
Optionally, the method further comprises:
the request feedback module is used for receiving a resource query acquisition request and feeding back resource identifiers of all resources of the resource server;
and the resource access request receiving module is used for receiving the resource access request sent according to the resource identifier.
Optionally, the first access request processing module includes:
an access request monitoring submodule, configured to monitor a new resource access request for the current resource server;
the access request identification submodule is used for identifying whether the access requests of other resources are consistent with the access mode or not;
and the access request distribution submodule is used for distributing the other resource access requests to other resource servers for processing if the access requests are not consistent.
Optionally, the access request identifying sub-module is specifically configured to identify whether the other resource access requests and the multiple resource access requests originate from the same access terminal.
Optionally, the method further comprises:
and the second pattern recognition module is used for determining that the access pattern of the first resource access sequence is a plurality of resources accessing other resource servers.
Optionally, the method further comprises:
and the notification module is used for sending a notification message to the other resource servers, wherein the notification message carries the identification of the access end of the plurality of historical resource access requests.
Optionally, the method further comprises:
and the second access request processing module is used for processing the other resource access requests if the access mode of the first resource access sequence is determined not to access the plurality of resources of the current resource server.
Optionally, the method further comprises:
and a third access request processing module, configured to, after determining that the access mode of the first resource access sequence is to access the multiple resources of the current resource server, process other resource access requests that are consistent with the access mode.
The application also discloses a resource access request processing system, which comprises at least one resource server and a resource access request processing device;
the resource access request processing device comprises:
the target resource acquisition module is used for analyzing a plurality of historical resource access requests aiming at the resource server and acquiring a plurality of target resources corresponding to the historical resource access requests;
a sequence construction module, configured to construct a first resource access sequence based on the plurality of historical resource access requests, where the first resource access sequence is used to identify an access order of the plurality of historical resource access requests to the plurality of target resources;
a mode identification module, configured to determine that an access mode of the first resource access sequence is to access a plurality of resources of the current resource server;
and the access request processing module is used for distributing other resource access requests which are inconsistent with the access mode to other resource servers for processing.
The embodiment of the application has the following advantages:
according to the embodiment of the application, a plurality of target resources corresponding to historical resource access requests are analyzed from a plurality of historical resource access requests for a current resource server, a first resource access sequence is constructed, the first resource access sequence identifies the access sequence of the plurality of historical resource access requests to the plurality of target resources, and further determines whether the access mode of the first resource access sequence is to access the plurality of resources of the current resource server, namely whether the access mode of the plurality of resource access requests is to access the plurality of resources of the current resource server, so that an identification mechanism of the access requests is provided, further, the optimal configuration of server load can be realized, specifically, when the access requests of other resources are identified to be inconsistent with the access mode, the access requests can be distributed to other servers for processing, and therefore, the access requests are prevented from being concentrated in one server for processing, the server is prevented from being overloaded and the processing of other access requests aiming at the server is prevented from being influenced, so that the load balance of the server in the distributed system can be better realized.
In addition, the sent full resource access requests are taken as analysis bases, the specific access requests for accessing the multiple resources of the resource server can be identified by determining the resource access sequence for identifying the actual access sequence and the similarity of the resource access sequence for accessing the multiple resources of the resource server according to the set access sequence, so that a quantitative index is provided for identification of the specific access request sequence for accessing the multiple resources of the resource server, and the identification accuracy is improved.
Drawings
FIG. 1 is a flowchart illustrating a first embodiment of a method for processing a resource access request according to the present application;
FIG. 2 is a flowchart illustrating steps of a second embodiment of a method for processing a resource access request according to the present application;
FIG. 3 is a block diagram of a first embodiment of a device for processing a resource access request according to the present application;
fig. 4 is a block diagram illustrating a second example of a device for processing a resource access request according to the present application;
FIG. 5 is a block diagram of an embodiment of a system for processing resource access requests according to the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description.
Referring to fig. 1, a flowchart illustrating a first step of a first embodiment of a method for processing a resource access request according to the present application is shown, which may specifically include the following steps:
The resource server provides access to resources externally, the resources are accessed by sending a resource access request to the resource server, the resource access request indicates the resources which are requested to be accessed, and the target resources which are correspondingly accessed can be obtained by analyzing the resource access request. The resource access request can carry a resource identifier of a target resource correspondingly accessed, and the requested target resource can be obtained by extracting the resource identifier from the resource access request.
Taking http (HyperText Transfer Protocol) communication Protocol as an example, each resource access request has an independent URL (Uniform resource Locator), and analyzing a plurality of resource access requests for a current resource server to obtain a plurality of target resources corresponding to the plurality of historical resource access requests may specifically include: and extracting the resource identifier of the target resource from the uniform resource locator corresponding to the resource access request.
Specifically, the URL is a character string for uniquely identifying a target resource in a certain server, the URL is composed of a request method, a request header, a request body and the like, a Host field of the request header includes a requested target resource, and specifically, the target resource may be a server address and a port to which the target resource belongs. And a step of analyzing the resource access request, namely searching a Host field in the URL and further extracting specific content from the Host field. For example, an access request with URL http:// www.wrox.com/books has a corresponding Host field www.wrox.com, i.e. the resource identifier. The representation modes of the resource access request are different corresponding to different communication protocols, and the target resource can be determined by adopting corresponding means at a corresponding position according to actual requirements, which is not limited in the present application.
According to a plurality of target resources correspondingly accessed by a plurality of resource access requests, a resource access sequence is further constructed, which is denoted as a first resource access sequence. The resource access sequence is used to identify an access order to a plurality of target resources, and may specifically be constructed by an actual access order to sequentially arranged target resources, or may be composed of information of sequentially accessed target resources.
When the resource access sequence is composed of access orders to sequentially arranged target resources, the access orders may be in the form of numbers or other representations that can identify the access orders. When the resource access sequence is composed of information of sequentially accessed target resources, the information of the target resources may be a resource identifier of the target resources, or may be other attributes of the target resources, such as a resource number corresponding to a resource identifier written in a lexicographic order, where the resource identifier is preferably written in the lexicographic order. The resource access sequence may adopt any suitable representation form, and each access sequence may also adopt any suitable identifier or symbol connection, which is not limited in this application.
Specifically, in a preferred embodiment of the present application, constructing a first resource access sequence that identifies access orders of a plurality of target resources may be divided into two steps, and first, according to actual access time corresponding to each target resource, an actual access order of each target resource is determined; and secondly, sequencing the actual access orders according to the resource sequencing of the target resources, and setting the set of the sequenced actual access orders as the first resource access sequence. For example, seven target resources of the resource server are identified as aaa, aab, aac, aad, aae, aaf and aba in a lexicographic order, the access time of each target resource is extracted, the access sequence of the seven target resources is aaa, aab, aac, aba, aad, aae and aaf, and when the resource access sequence is constructed based on the access sequence of the sequentially arranged target resources, the access sequence is represented by using the numbers as an example, and the resource access sequence may be (1,2,3,5,6,7,4) for the seven target resources arranged in sequence.
In another preferred embodiment of the present application, constructing the first resource access sequence that identifies the access order of the plurality of target resources may specifically include: sequencing the resource numbers corresponding to the resource identifications of the target resources according to the corresponding actual access time; and taking the set of the sorted resource identifications as the first resource access sequence. For example, for the above example, seven target resources identified in sequence by a lexicographic order as aaa, aab, aac, aad, aae, aaf, and aba, the corresponding resource numbers are 1,2,3,4,5,6, and 7, and the resource numbers are aaa, aab, aac, aba, aad, aae, and aaf in the order of access order, and when constructing the resource access sequence based on the information of the target resources accessed in sequence, the resource access sequence is (1,2,3, 7,4, 5, 6) taking the information of the target resources as the resource numbers as an example.
The resource access sequence is an access sequence of target resources accessed by a plurality of histories, and identifies an access mode of the target resources accessed by the plurality of histories, namely an access mode of a plurality of history resource access requests to the plurality of target resources. If the access mode of the resource access sequence is determined to be a plurality of resources accessing the current resource server, a plurality of resource access requests of the access mode can be distinguished from the normal access request to serve as a basis for realizing the optimized configuration of the server load subsequently, and the load management of the current server is realized. The plurality of resources of the current resource server herein include not only a plurality of target resources corresponding to the plurality of historical resource access requests, but also resources corresponding to access by one or more resource access requests in accordance with the access pattern, which are received after the historical resource access requests.
In a specific implementation, if resource identifiers are added to each resource according to a monotone law (monotone increasing or monotone decreasing), for example, the resource identifiers are sequentially added according to a lexicographic order or a monotone numerical number, and the resource access requests are sequentially sent according to the resource identifiers arranged in sequence, the access modes corresponding to the resource access requests are a plurality of resources which sequentially access the server, and the first resource access sequence constructed for the resource access requests is a monotone sequence. For example, the resource access requests are sequentially sent for the resources with the resource identifiers aaa, aab, aac, aad, aae, aaf and aba, the access patterns of the resource access requests are other resources with the access sequences, such as aba, abb, abc, and the like, and the correspondingly constructed resource access identifier sequence in step 102 is (1,2,3,4,5,6,7), i.e., a monotonically increasing sequence, so that it is determined whether the access pattern of the first resource access sequence is for accessing multiple resources of the current resource server, i.e., whether the first resource access sequence is a monotonically increasing or monotonically decreasing sequence.
Of course, in practical applications, the multiple resources of the resource server are not necessarily accessed in a monotone sequence, and other setting orders may be adopted.
In another preferred embodiment of the present application, when determining whether the access mode of the resource access sequence is to access multiple resources of the current resource server, the first resource access sequence may be compared with a preset resource access sequence to access multiple resources of the current resource server, and it is determined whether the two resource access sequences have the same access mode, and specifically, the similarity between the two access sequences may be compared, and if the sequence similarity satisfies a set condition, the two sequences have the same access mode, which indicates that the access mode of the actually obtained resource access sequence is to access multiple resources of the current resource server.
Specifically, a second resource access sequence with an access mode of accessing a plurality of resources of the current resource server may be first constructed; and further determining that the access mode of the first resource access sequence is to access a plurality of resources of the current resource server if the first resource access sequence and the second resource access sequence are judged to meet the preset similar condition.
The second resource access sequence with the access mode being the access to the plurality of resources of the current resource server, similar to the first resource access sequence, is constructed in two ways, namely, based on the set access order of the sequentially arranged target resources, or based on the information of the target resources accessed according to the set order.
Specifically, if the first resource access sequence is constructed based on the actual access orders for the sequentially arranged target resources, the corresponding set access order may be generated according to the resource order of the target resources, and the set of the set access order may be the second resource access sequence. Preferably, if each target resource carries a resource identifier sequentially added according to a monotonic rule (for example, a numerical order such as a lexicographic order, a monotonically increasing number, or a decreasing number), the target resources can be sequentially accessed according to the monotonic rule, and when a corresponding set access order is generated according to the resource ordering of the target resources, the target resources are firstly ordered according to the monotonic rule corresponding to the resource identifier; and further generating a corresponding set access order according to the sorted target resources. For example, the seven target resources are sorted in the lexicographical order as aaa, aab, aac, aad, aae, aaf, and aba, and for the seven sorted target resources, the corresponding set access sequence is 1,2,3,4,5,6, and 7, and the correspondingly constructed second resource access sequence is (1,2,3,4,5,6, and 7).
In connection with the above step of constructing the first resource access sequence, the whole process can be implemented by first constructing a sequence aaa, aab, aac, aba, aad, aae, aaf for seven target resources, numbering the resource access requests in the access order to obtain a tuple (1, aaa), (2, aab), (3, aac), (4, aba), (5, aad), (6, aae), (7, aaf), and renumbering the resource access requests in the resource order to obtain a tuple (1,1, aaa), (2,2, aab), (3,3, aac), (4,5, aad), (5,6, aae), (6,7, aaf), (7,4, aab), thereby extracting the first resource access sequence (1,2,3,5,6,7,4) and the second resource access sequence (1,2,3,4,5,6,7) at the first location.
For the first resource access sequence constructed based on the information of the sequentially accessed target resources, the resource identifiers of the plurality of target resources may be ordered according to the resource ordering, and the set of resource numbers corresponding to the ordered resource identifiers is used as the second resource access sequence. Taking the seven target resources identified as aaa, aab, aac, aad, aae, aaf, and aba in the above-mentioned lexicographical order as an example, the corresponding resource numbers are 1,2,3,4,5,6, and 7, if the resources are accessed in the lexicographical order, the information of the corresponding target resources accessed in the set order is 1,2,3,4,5,6, and 7, and the second resource access order constructed in the correspondence is (1,2,3,4,5,6, and 7).
It should be noted that, in this embodiment, the access order may be set according to the actual requirement, and may not necessarily be the order in which the identifiers of the target resources correspond to the dictionary order, but may also be another order set according to the actual requirement.
In the embodiment of the present application, preferably, the similarity may be used as a condition for determining similarity between the first resource sequence and the second resource sequence. When judging, firstly, determining the similarity of the first resource access sequence and the second resource access sequence; and if the similarity is greater than the set threshold, judging that the first resource access sequence and the second resource access sequence meet the preset similarity condition. Therefore, a quantitative index is provided for identifying a specific access request sequence for accessing a plurality of resources of the server, the specific access request and the normal access request can be distinguished according to the quantitative index, and the identification accuracy is improved. Other similar conditions can also be set, for example, the same information, the position of the same information and the number of the same information are counted, and when at least one statistical result meets the preset requirement, the similar condition can be judged to be met.
The similarity may be determined by any suitable method, for example, referring to the following formula for calculating cosine similarity:
wherein c is the similarity, xiFor each value in the first resource access sequence, yiFor each value in the second resource access sequence, i represents the sequential number in the sequence, e.g., (1,2,3,5,6,7,4) for the first resource access sequence and (1,2,3,4,5,6,7) for the second resource access sequence, e.g., x7=4,y7=7。
The value range of the similarity is [0,1], and the larger the value is, the more the request conforms to the access mode of accessing a plurality of resources of the resource server. In practical applications, a resource access request sent by an access terminal that does not conform to the access mode may be doped, or a certain resource is manually called back, so that the resource access request is not sent according to the access rule completely, and therefore, the value of the similarity does not need to reach 1 (100% similarity), for example, the value may be 0.8, and may be set according to actual requirements, which is not limited in the present application.
In another preferred embodiment of the present application, the access mode of the resource access sequence may be identified first, and then it is determined whether the access mode accesses the current resource server, and the identification method of the access mode of the resource access sequence may be implemented by using any applicable data pattern identification scheme, for example, by combining data variance, median, or composition, which is not limited in this application.
And 104, distributing the other resource access requests which are inconsistent with the access mode to other resource servers for processing.
Here, the other resource access request is received after the historical resource access request, and the receiving time may be before the historical resource access request is analyzed in step 101, or after the access mode of the first resource access sequence is determined in step 103, or during the process of executing step 101 and step 103, the other resource access request may or may not be consistent with the access mode of the historical resource access request.
After the access mode of the historical resource access request is identified as a plurality of resources of the access resource server, the optimized configuration of the server load can be realized. And determining whether the access modes of other resource access requests except the historical resource access requests are consistent with the access modes of the historical resource access requests, and if not, distributing the other resource access requests to other servers for processing. By distributing other resource access requests which are inconsistent with the access mode to other resource servers, the access requests can be prevented from being concentrated in one server for processing, excessive load of the server is avoided, other processing of the access requests aiming at the server is prevented from being influenced, and load balance of the server in the distributed system can be better realized.
The other resource access requests may be monitored at the front-end server that processes and forwards the request, or may be monitored at the resource server that receives the request.
Further, whether the other resource access requests are consistent with the identified access pattern or not can be specifically identified in various ways. For example, it is identified whether the other resource access requests have the same access attributes as the previously identified plurality of resource access requests. Taking the comparison of the access side information as an example, if the access side information of other resource access requests is consistent with the access side information of most resource access requests in the plurality of historical resource access requests, it can be determined that the access side information is originated from the same access side, and it can be determined that the access mode is consistent with the identified access mode. The access terminal identification is adopted for identification, so that the identification efficiency can be greatly improved, and the occupation of the identification step on resources is reduced.
Alternatively, a new third resource access sequence may be constructed and compared with the first resource access sequence or the second resource access sequence, and if a certain resource access sequence satisfies a set similarity condition (for example, the similarity is greater than a set threshold), it may be determined that the identified access pattern is consistent with the identified access pattern.
Further, if the access requests are inconsistent, the other resource access requests are distributed to other resource servers, so that the resource servers process the access requests consistent with the identified access mode in a centralized manner, the access requests are prevented from being concentrated in one server for processing, excessive load of the server is avoided, processing of the access requests of other resources is prevented from being influenced, and load balance of the servers in the distributed system can be better realized.
When the resource access request is specifically distributed to other resource servers, the resource access request can be directly forwarded to other resource servers, or the allocated server is notified to forward the resource access request.
Referring to fig. 2, a flowchart illustrating steps of a second embodiment of a method for processing a resource access request according to the present application is shown, which may specifically include the following steps:
The access to multiple resources of the resource server may be triggered under actual needs of multiple scenarios, for example, when the resources of the server need to be cleaned, an access task may be run through one access terminal, or the access tasks may be run simultaneously by combining multiple access terminals, and all the resources are searched to find the task to be cleaned. Before the access terminal is cleaned, a resource query request can be sent to the resource server, and after the resource server receives the request, resource identifiers of all resources of the resource server can be fed back to the access terminal.
The resource identifiers of all resources can be packaged and fed back to the access terminal, and part of the resource identifiers and information reflecting the compiling rules of the resource identifiers can also be fed back to the access terminal. Taking five resources of aaa, aab, aac, aad, aae, and aaf marked by the lexicographic order as an example, all the five resource identifiers can be issued to the access terminal, or the initial aaa, the information marking the lexicographic order, and the total resource number five can be issued to the access terminal, and the access terminal can derive the resource identifiers of the five resources according to the initial aaa, the ranking mode of the lexicographic order, and the total number. The information reflecting the resource identifier compiling rule can be set according to actual requirements.
After receiving the fed back resource identifier, the access terminal may further send a resource access request according to the resource identifier, where the resource access request may be sent according to a writing rule sequence of the resource, and taking five resources, which are marked by a dictionary in sequence, of aaa, aab, aac, aad, aae, and aaf as an example, five URLs sent in sequence carry one resource identifier of aaa, aab, aac, aad, aae, and aaf in sequence; the resource access request can also be sent according to a set access sequence, and only needs to be compared with the set access sequence when whether the subsequent access mode is an access mode for accessing a plurality of resources of the resource server.
In this embodiment, a plurality of historical resource access requests for the current resource server may be collected in advance. The resource access request is sent from the access terminal to the front-end server responsible for receiving and distributing the request, and is further forwarded to the resource server, and a plurality of historical resource access requests aiming at a certain resource access server can be collected from the access terminal, can also be obtained from the front-end server, or can be directly obtained from the resource server receiving the request. The time period and the number of the plurality of historical resource access requests can be set according to actual requirements, and the time period and the number are not limited in the application. Correspondingly, the embodiment of the application can be deployed on a management end, a front-end server, a resource server or other independent servers of a plurality of access ends according to actual requirements.
If the embodiment of the application is applied to the distributed service system, a plurality of historical resource access requests received by the resource server within a set time period away from the current time point can be collected for each resource server of the distributed service system.
In practice, a plurality of access terminals may simultaneously send resource access requests to a resource server, and only individual access terminals need to access the resource server, for example, a certain access terminal or a combination of access terminals performs access to the resource server, and only a plurality of historical resource access requests sent by the access terminals have a mode of accessing a plurality of resources of the resource server, and if the resource access requests sent by all the access terminals are identified, a particular historical resource access request may not be identified. Preferably, before processing the collected multiple resource access requests, the multiple resource access requests may be filtered, referring to fig. 2, and this embodiment of the present application may further include step 204.
The resource access request may carry access end information, and taking a URL corresponding to the resource access request under the http protocol as an example, the request header may be marked with the access end information, such as an identifier of the access end, a network address (e.g., an IP address), a type of the access end, and the like, and the request header of the URL may be searched, and the access end information may be extracted from the request header.
After the access terminal information is acquired, the collected multiple resource access requests can be further screened according to the access terminal information. If the resource access requests are screened according to the identification of the access terminal, a plurality of resource access requests corresponding to the same access terminal can be obtained; if the screening is performed according to the network address of the access terminal, the screening may be performed on a plurality of network resource requests corresponding to the same network address, and a plurality of resource access requests of the same access terminal or a plurality of access terminals using the same network address are correspondingly obtained, or a plurality of resource access requests belonging to the same network address segment (for example, an IP segment) are screened, and a plurality of resource access requests corresponding to one or more access terminals are correspondingly obtained; if the screening is carried out according to the types of the access terminals, a plurality of resource access requests corresponding to one or more access terminals with the same type are correspondingly obtained.
In practical application, according to an actually adopted communication protocol, access terminal information, access time and the like can be obtained in corresponding fields, and new access attributes can be expanded according to actual needs to screen historical resource access requests, which is not limited in the present application.
Step 205, parsing a plurality of historical resource access requests for a current resource server to obtain a plurality of target resources corresponding to the plurality of historical resource access requests.
And step 208, distributing the received other resource access requests inconsistent with the access mode to other resource servers for processing.
For other resource access requests except the historical resource access request, if the access mode of the other resource access requests is identified to be consistent with the access mode of the historical resource access request, normal processing can be directly carried out.
Step 210, determining that the access mode of the first resource access sequence is to access a plurality of resources of other resource servers.
The historical resource access request correspondingly accesses a plurality of resources of the current resource server, and in the access mode, the resource access request sent subsequently may also access a plurality of resources of other resource servers. Therefore, after determining that the access mode of the first resource access sequence is to access a plurality of resources of the current resource server, it may further determine that the access mode is to access a plurality of resources of other resource servers. Here, access to a plurality of resources of other resource servers is predicted from an access pattern, and has not yet actually occurred.
For example, a plurality of resource servers are accessed according to a monotone request sequence which is monotone increasing or monotone decreasing in a lexicographic order, that is, after the current resource server is accessed, other resource servers are continuously accessed.
For the monotone request sequence, when it is identified whether the access mode of the first resource access sequence is to access the plurality of resource servers, it may be identified whether the first resource sequence satisfies a change rule of monotone increasing or monotone decreasing, and if so, it is determined that the access mode of the first resource access sequence is to access the plurality of resource servers. Therefore, if the first resource access sequence is identified as a monotonic sequence in step 207, the access mode of the first resource access sequence can be directly determined to be accessing a plurality of resource servers according to the identification result, and the determination in this step may not be required.
Step 211, sending a notification message to the other resource servers, where the notification message carries the identifier of the access end of the multiple historical resource access requests.
If a plurality of historical resource access requests access a plurality of resource servers, other resource servers can be determined, the resource servers are informed to intercept the resource access requests inconsistent with the access mode, and the server overload is avoided, and the access requests accessing the resource servers influence the processing of other access requests. The notification may carry access end identifiers of multiple historical resource access requests, so that the server receiving the notification determines the access requests for accessing multiple resources of the resource server after recognizing the access end identifiers.
Specifically, the target resource accessed by the access pattern of the first resource access sequence may be estimated, and the target resource accessed next may be estimated through the monotonic trend of the monotonic sequence, for example, taking the case where a plurality of resource access requests access aaaa, aaab, aaac, aaad sequentially, the corresponding first resource access sequence is the monotonic sequence (1,2,3, 4), and the target resource accessed next is aae, aaf, aba …, etc. And further searching at least one target resource server providing the target resource, then extracting access terminal information commonly carried by the resource access requests, sending a notice to the searched target resource server, wherein the notice carries the access terminal information, so that the target resource server detects the resource access request sent by the access terminal carrying the access terminal information after receiving the notice, and the resource access request is used as a basis for realizing the optimized configuration of the server load subsequently.
If the plurality of resource access requests access a plurality of resources of the resource server, the resource cleaning request sent by the access terminal can be received, so as to perform cleaning operation on at least one resource indicated by the resource cleaning request.
Step 212, if it is determined that the access mode of the first resource access sequence is not to access the plurality of resources of the current resource server, the other resource access request is processed.
If the access mode of the first access sequence is not to access the plurality of resources of the current resource server, load pressure is not caused on the current resource server, and the processing can be normally performed.
In order to make those skilled in the art better understand the solution of the present application, the following describes an example of sending resource requests in a monotonic sequence with respect to the access mode for accessing multiple resources of the resource server.
1. Acquiring a plurality of historical resource access requests aiming at a resource server A to be analyzed from a front-end server, wherein the resource access requests are represented by URLs (uniform resource locators), and the value range of legal characters of a carried resource identifier is a-z;
2. extracting resource identifications from the obtained plurality of URLs is as follows:
aaa,aab,aac,aba,aad,aae,aaf
3. these URLs are numbered by time, resulting in the following binary:
(1,aaa),(2,aab),(3,aac),(4,aba),(5,aad),(6,aae),(7,aaf)
4. and sequencing the numbered binary groups according to the lexicographic order of the resource identifiers to obtain the following results:
(1,aaa),(2,aab),(3,aac),(5,aad),(6,aae),(7,aaf),(4,aba)
5. the sequence after the sorting is completed is renumbered, and the obtained triples are as follows:
(1,1, aaa), (2,2, aab), (3,3, aac), (4,5, aad), (5,6, aae), (6,7, aaf), (7,4, aba), and the new numbers in this step are numbered according to the resource ordering, i.e., according to the normal access order of the access pattern.
6. From the triplets two sequences can be extracted, the normal numbering sequence (1,2,3,4,5,6,7) and the temporal numbering sequence (1,2,3,5,6,7, 4).
7. And calculating the similarity c of the two sequences to be greater than a set threshold value 0.8 according to a cosine similarity formula, and determining that the access mode of the historical resource access request is to access a plurality of resources of the current resource server.
8. And aiming at the newly received current access request, if the access mode is met, processing, and if the access mode is not met, distributing the current access request to other resource servers for processing.
9. And predicting target resource identifications of subsequent accesses of abb, abc, abd, abe … and the like, and determining that a certain resource server B stores the resource, generating a notification message carrying an access terminal identification of a historical resource access request and sending the notification message to the target resource server B so that the target resource server B can be used as a basis for realizing the optimal configuration of the server load subsequently.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the embodiments. Further, those skilled in the art will also appreciate that the embodiments described in the specification are presently preferred and that no particular act is required of the embodiments of the application.
Referring to fig. 3, a block diagram of a first embodiment of a device for processing a resource access request according to the present application is shown, which may specifically include the following modules:
a target resource obtaining module 301, configured to parse a plurality of historical resource access requests for a current resource server, and obtain a plurality of target resources corresponding to the plurality of historical resource access requests;
a first sequence construction module 302, configured to construct a first resource access sequence based on the plurality of historical resource access requests, the first resource access sequence being used to identify an access order of the plurality of historical resource access requests to the plurality of target resources;
a first pattern recognition module 303, configured to determine an access pattern of the first resource access sequence as multiple resources accessing the current resource server;
and the first access request processing module 304 is configured to distribute other resource access requests inconsistent with the access mode to other resource servers for processing.
In this embodiment of the present application, preferably, the target resource obtaining module is specifically configured to extract a resource identifier of the target resource from a uniform resource locator corresponding to the historical resource access request.
In this embodiment of the application, preferably, the first sequence building block includes:
the actual order determining submodule is used for determining the actual access order of each target resource according to the actual access time corresponding to each target resource;
and the actual order sequencing submodule is used for sequencing the actual access order according to the resource sequencing of the target resource and taking the set of the sequenced actual access order as the first resource access sequence.
In this embodiment of the application, preferably, the first sequence building block includes:
and the time sequencing submodule is used for sequencing the resource numbers corresponding to the resource identifications of the target resources according to the corresponding actual access time, and taking the set of the sequenced resource identifications as the first resource access sequence.
In this embodiment of the application, preferably, each target resource carries a resource identifier that is sequentially added according to a monotonic rule, and the first trend identifying module is specifically configured to identify whether the first resource access sequence is a monotonically increasing or monotonically decreasing sequence.
In this embodiment of the application, preferably, the first trend identification module includes:
the second sequence construction submodule is used for constructing a second resource access sequence with an access mode of accessing a plurality of resources of the current resource server;
and the sequence judgment submodule is used for judging that the first resource access sequence and the second resource access sequence meet preset similar conditions, and determining that the access mode of the first resource access sequence is to access a plurality of resources of the current resource server.
In the embodiment of the present application, preferably, the second sequence construction submodule includes:
a set order generating subunit, configured to generate a corresponding set access order according to the resource ordering of the target resource, and use the set of set access orders as the second resource access sequence;
or, the resource identifier sorting subunit is configured to sort the resource identifiers of the multiple target resources according to the resource sorting, and use a set of resource numbers corresponding to the sorted resource identifiers as the second resource access sequence.
In the embodiment of the present application, preferably, each target resource carries a resource identifier sequentially added according to a monotonic rule, and the set order generating subunit is specifically configured to sort the target resources according to the monotonic rule corresponding to the resource identifier; and generating a corresponding set access order according to the sorted target resources.
In the embodiment of the present application, preferably, the sequence determination submodule includes:
the similarity determining submodule is used for determining the similarity between the first resource access sequence and the second resource access sequence;
and the similarity judging submodule is used for judging that the first resource access sequence and the second resource access sequence meet a preset similarity condition if the similarity is greater than a set threshold.
According to the embodiment of the application, a plurality of target resources corresponding to historical resource access requests are analyzed from a plurality of historical resource access requests for a current resource server, a first resource access sequence is constructed, the first resource access sequence identifies the access sequence of the plurality of historical resource access requests to the plurality of target resources, and further determines whether the access mode of the first resource access sequence is to access the plurality of resources of the current resource server, namely whether the access mode of the plurality of resource access requests is to access the plurality of resources of the current resource server, so that an identification mechanism of the access requests is provided, further, the optimal configuration of server load can be realized, specifically, when the access requests of other resources are identified to be inconsistent with the access mode, the access requests can be distributed to other servers for processing, and therefore, the access requests are prevented from being concentrated in one server for processing, the server is prevented from being overloaded and the processing of other access requests aiming at the server is prevented from being influenced, so that the load balance of the server in the distributed system can be better realized.
Referring to fig. 4, a block diagram of a second embodiment of a device for processing a resource access request according to the present application is shown, which may specifically include the following modules:
a request feedback module 401, configured to receive a resource query obtaining request, and feed back resource identifiers of all resources of the resource server;
a resource access request receiving module 402, configured to receive a resource access request sent according to the resource identifier.
An access request collecting module 403, configured to collect multiple historical resource access requests received by the current resource server.
And an access request screening module 404, configured to screen multiple historical resource access requests originating from the same access terminal.
A target resource obtaining module 405, configured to parse a plurality of historical resource access requests for a current resource server, and obtain a plurality of target resources corresponding to the plurality of historical resource access requests;
a first sequence construction module 406, configured to construct a first resource access sequence based on the plurality of historical resource access requests, the first resource access sequence being used to identify an access order of the plurality of historical resource access requests to the plurality of target resources;
a first pattern recognition module 407, configured to determine an access pattern of the first resource access sequence as multiple resources accessing the current resource server.
The first access request processing module 408 is configured to, if the access mode of the resource server is inconsistent with the access mode of the resource server, distribute the other resource access request to the other resource server for processing.
A third access request processing module 409, configured to, after determining that the access pattern of the first resource access sequence is to access multiple resources of the current resource server, process other resource access requests that are consistent with the access pattern.
A second pattern recognition module 410, configured to determine that the access pattern of the first resource access sequence is to access a plurality of resources of other resource servers.
A notification module 411, configured to send a notification message to the other resource servers, where the notification message carries an identifier of an access end of the multiple historical resource access requests.
A second access request processing module 412, configured to determine that the access pattern of the first resource access sequence is not to access the multiple resources of the current resource server, and process the other resource access requests.
In this embodiment of the application, preferably, the access request collection module is specifically configured to collect, for each resource server of the distributed service system, a plurality of historical resource access requests received by the resource server within a set time period from a current time point.
In this embodiment of the present application, preferably, the first access request processing includes:
an access request monitoring submodule, configured to monitor other resource access requests for the current resource server;
the access request identification submodule is used for identifying whether the access requests of other resources are consistent with the access mode or not;
and the access request distribution submodule is used for distributing the other resource access requests to other resource servers for processing if the access requests are not consistent.
In this embodiment of the application, preferably, the access request identification submodule is specifically configured to identify whether the other resource access requests and the multiple resource access requests originate from the same access terminal.
According to the embodiment of the application, a plurality of target resources corresponding to historical resource access requests are analyzed from a plurality of historical resource access requests for a current resource server, a first resource access sequence is constructed, the first resource access sequence identifies the access sequence of the plurality of historical resource access requests to the plurality of target resources, and further determines whether the access mode of the first resource access sequence is to access the plurality of resources of the current resource server, namely whether the access mode of the plurality of resource access requests is to access the plurality of resources of the current resource server, so that an identification mechanism of the access requests is provided, further, the optimal configuration of server load can be realized, specifically, when the access requests of other resources are identified to be inconsistent with the access mode, the access requests can be distributed to other servers for processing, and therefore, the access requests are prevented from being concentrated in one server for processing, the server is prevented from being overloaded and the processing of other access requests aiming at the server is prevented from being influenced, so that the load balance of the server in the distributed system can be better realized.
In addition, the sent full resource access requests are taken as analysis bases, the specific access requests for accessing the multiple resources of the resource server can be identified by determining the resource access sequence for identifying the actual access sequence and the similarity of the resource access sequence for accessing the multiple resources of the resource server according to the set access sequence, so that a quantitative index is provided for identification of the specific access request sequence for accessing the multiple resources of the resource server, and the identification accuracy is improved.
Referring to fig. 5, a block diagram of an embodiment of a system for processing a resource access request according to the present application is shown, including at least one resource server 501 and a resource access request processing apparatus 502;
the resource access request processing device 502 includes:
a target resource obtaining module 5021, configured to parse a plurality of historical resource access requests for the resource server, and obtain a plurality of target resources corresponding to the plurality of historical resource access requests;
a sequence construction module 5022, configured to construct a first resource access sequence based on the plurality of historical resource access requests, where the first resource access sequence is used to identify an access order of the plurality of historical resource access requests to the plurality of target resources;
a pattern recognition module 5023, configured to determine an access pattern of the first resource access sequence as a plurality of resources accessing the current resource server;
and the access request processing module 5024 is used for distributing other resource access requests which are inconsistent with the access mode to other resource servers for processing.
According to the embodiment of the application, a plurality of target resources corresponding to historical resource access requests are analyzed from a plurality of historical resource access requests for a current resource server, a first resource access sequence is constructed, the first resource access sequence identifies the access sequence of the plurality of historical resource access requests to the plurality of target resources, and further determines whether the access mode of the first resource access sequence is to access the plurality of resources of the current resource server, namely whether the access mode of the plurality of resource access requests is to access the plurality of resources of the current resource server, so that an identification mechanism of the access requests is provided, further, the optimal configuration of server load can be realized, specifically, when the access requests of other resources are identified to be inconsistent with the access mode, the access requests can be distributed to other servers for processing, and therefore, the access requests are prevented from being concentrated in one server for processing, the server is prevented from being overloaded and the processing of other access requests aiming at the server is prevented from being influenced, so that the load balance of the server in the distributed system can be better realized.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one of skill in the art, embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
In a typical configuration, the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory. The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium. Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (fransitory media), such as modulated data signals and carrier waves.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the true scope of the embodiments of the application.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal 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 terminal. 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 terminal that comprises the element.
The foregoing describes in detail a method and an apparatus for processing a resource access request provided by the present application, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the foregoing embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (38)
1. A method for processing a resource access request, comprising:
analyzing a plurality of historical resource access requests aiming at a current resource server to obtain a plurality of target resources corresponding to the plurality of historical resource access requests;
constructing a first resource access sequence based on the plurality of historical resource access requests, the first resource access sequence being used to identify an order of access of the plurality of historical resource access requests to the plurality of target resources;
determining that the access mode of the first resource access sequence is to access a plurality of resources of the current resource server, including: determining that the first resource access sequence is a monotone sequence or a sequence with a set sequence or a data pattern recognition result is a sequence of a plurality of resources accessing the current resource server, or determining that the similarity between the first resource access sequence and a preset resource access sequence of a plurality of resources accessing the current resource server meets a set condition;
and distributing other resource access requests inconsistent with the access mode to other resource servers for processing.
2. The method of claim 1, wherein parsing the plurality of historical resource access requests for the current resource server to obtain a plurality of target resources corresponding to the plurality of historical resource access requests comprises:
and extracting the resource identifier of the target resource from the uniform resource locator corresponding to the historical resource access request.
3. The method of claim 1, further comprising:
and collecting a plurality of historical resource access requests received by the current resource server.
4. The method of claim 3, wherein collecting the plurality of historical resource access requests received by the current resource server comprises:
the method comprises the steps of collecting a plurality of historical resource access requests received by a resource server within a set time period from a current time point aiming at each resource server of a distributed service system.
5. The method of claim 1, wherein prior to said parsing a plurality of historical resource access requests for a current resource server to obtain a plurality of target resources corresponding to the plurality of historical resource access requests, the method further comprises:
and screening a plurality of historical resource access requests from the same access terminal.
6. The method of claim 1, wherein constructing a first sequence of resource accesses based on the plurality of historical resource access requests comprises:
determining the actual access sequence of each target resource according to the actual access time corresponding to each target resource;
sequencing the actual access sequence according to the resource sequencing of the target resource;
and taking the set of the sorted actual access orders as the first resource access sequence.
7. The method of claim 1, wherein constructing a first sequence of resource accesses based on the plurality of historical resource access requests comprises:
sequencing the resource numbers corresponding to the resource identifications of the target resources according to the corresponding actual access time;
and taking the set of the sorted resource identifications as the first resource access sequence.
8. The method of claim 1, wherein each target resource carries a resource identifier that is sequentially added according to a monotonic rule, and the determining that the access mode of the first resource access sequence is to access the plurality of resources of the current resource server comprises:
determining the first sequence of resource accesses as a monotonically increasing sequence or a monotonically decreasing sequence.
9. The method of claim 1, wherein determining the access pattern of the first sequence of resource accesses as accessing the plurality of resources of the current resource server comprises:
constructing an access mode as a second resource access sequence for accessing a plurality of resources of the current resource server;
and if the first resource access sequence and the second resource access sequence are judged to meet the preset similar condition, determining that the access mode of the first resource access sequence is to access a plurality of resources of the current resource server.
10. The method of claim 9, wherein constructing the access pattern as a second resource access sequence for accessing the plurality of resources of the current resource server comprises:
generating a corresponding set access sequence according to the resource sequence of the target resource, and taking the set of the set access sequence as the second resource access sequence;
or, the resource identifiers of the multiple target resources are sorted according to the resource sorting, and the set of resource numbers corresponding to the sorted resource identifiers is used as the second resource access sequence.
11. The method according to claim 10, wherein each target resource carries a resource identifier that is sequentially added according to a monotonic rule, and the generating of the corresponding set access order according to the resource ordering of the target resource comprises:
sequencing the target resources according to a monotone rule corresponding to the resource identifier;
and generating a corresponding set access order according to the sorted target resources.
12. The method of claim 9, wherein determining that the first resource access sequence and the second resource access sequence satisfy a predetermined similarity condition comprises:
determining the similarity of the first resource access sequence and a second resource access sequence;
and if the similarity is greater than a set threshold, judging that the first resource access sequence and the second resource access sequence meet a preset similarity condition.
13. The method of claim 1, further comprising:
receiving a resource query acquisition request and feeding back resource identifiers of all resources of the resource server;
and receiving a resource access request sent according to the resource identifier.
14. The method of claim 1, wherein the distributing other resource access requests that are inconsistent with the access pattern to other resource servers comprises:
monitoring for a new resource access request to the current resource server;
identifying whether the other resource access requests are consistent with the access pattern;
and if the resource access requests are not consistent, allocating the other resource access requests to other resource servers for processing.
15. The method of claim 14, wherein the identifying whether the other resource access requests are consistent with the access pattern comprises:
and identifying whether the other resource access requests and the plurality of resource access requests originate from the same access terminal.
16. The method of claim 1, further comprising, after the determining that the access pattern of the first resource access sequence is to access a plurality of resources of the current resource server:
determining that the access mode of the first resource access sequence is to access a plurality of resources of other resource servers;
and sending a notification message to the other resource servers, wherein the notification message carries the identification of the access end of the plurality of historical resource access requests.
17. The method of claim 1, further comprising:
and processing the other resource access requests if the access mode of the first resource access sequence is determined not to access the plurality of resources of the current resource server.
18. The method of claim 1, wherein after the determining that the access pattern of the first sequence of resource accesses is to access a plurality of resources of the current resource server, the method further comprises:
processing other resource access requests consistent with the access pattern.
19. An apparatus for processing resource access requests, comprising:
the target resource acquisition module is used for analyzing a plurality of historical resource access requests aiming at the current resource server and acquiring a plurality of target resources corresponding to the plurality of historical resource access requests;
a first sequence construction module, configured to construct a first resource access sequence based on the plurality of historical resource access requests, where the first resource access sequence is used to identify an access order of the plurality of historical resource access requests to the plurality of target resources;
a first pattern recognition module, configured to determine that an access pattern of the first resource access sequence is to access a plurality of resources of the current resource server, including: determining that the first resource access sequence is a monotone sequence or a sequence with a set sequence or a data pattern recognition result is a sequence of a plurality of resources accessing the current resource server, or determining that the similarity between the first resource access sequence and a preset resource access sequence of a plurality of resources accessing the current resource server meets a set condition;
and the first access request processing module is used for distributing other resource access requests which are inconsistent with the access mode to other resource servers for processing.
20. The apparatus according to claim 19, wherein the target resource obtaining module is specifically configured to extract a resource identifier of the target resource from a uniform resource locator corresponding to the historical resource access request.
21. The apparatus of claim 19, further comprising:
and the access request collection module is used for collecting a plurality of historical resource access requests received by the current resource server.
22. The apparatus according to claim 21, wherein the access request collection module is specifically configured to collect, for each resource server of the distributed service system, a plurality of historical resource access requests received by the resource server within a set time period from a current time point.
23. The apparatus of claim 19, further comprising:
and the access request screening module is used for screening a plurality of historical resource access requests from the same access terminal before the plurality of historical resource access requests aiming at the current resource server are analyzed and a plurality of target resources corresponding to the plurality of historical resource access requests are obtained.
24. The apparatus of claim 19, wherein the first sequence building block comprises:
the actual order determining submodule is used for determining the actual access order of each target resource according to the actual access time corresponding to each target resource;
and the actual order sequencing submodule is used for sequencing the actual access order according to the resource sequencing of the target resource and taking the set of the sequenced actual access order as the first resource access sequence.
25. The apparatus of claim 19, wherein the first sequence building block comprises:
and the time sequencing submodule is used for sequencing the resource numbers corresponding to the resource identifications of the target resources according to the corresponding actual access time, and taking the set of the sequenced resource identifications as the first resource access sequence.
26. The apparatus according to claim 19, wherein each target resource carries a resource identifier that is sequentially added according to a monotonic rule, and the first pattern recognition module is specifically configured to determine whether the first resource access sequence is a monotonically increasing sequence or a monotonically decreasing sequence.
27. The apparatus of claim 19, wherein the first pattern recognition module comprises:
the second sequence construction submodule is used for constructing a second resource access sequence with an access mode of accessing a plurality of resources of the current resource server;
and the sequence judgment submodule is used for judging that the first resource access sequence and the second resource access sequence meet preset similar conditions, and determining that the access mode of the first resource access sequence is to access a plurality of resources of the current resource server.
28. The apparatus of claim 27, wherein the second sequence building submodule comprises:
a set order generating subunit, configured to generate a corresponding set access order according to the resource ordering of the target resource, and use the set of set access orders as the second resource access sequence;
or, the resource identifier sorting subunit is configured to sort the resource identifiers of the multiple target resources according to the resource sorting, and use a set of resource numbers corresponding to the sorted resource identifiers as the second resource access sequence.
29. The apparatus according to claim 28, wherein each target resource carries a resource identifier that is sequentially added according to a monotonic rule, and the set order generating subunit is specifically configured to order the target resources according to the monotonic rule corresponding to the resource identifier; and generating a corresponding set access order according to the sorted target resources.
30. The apparatus of claim 27, wherein the sequence determination submodule comprises:
the similarity determining submodule is used for determining the similarity between the first resource access sequence and the second resource access sequence;
and the similarity judging submodule is used for judging that the first resource access sequence and the second resource access sequence meet a preset similarity condition if the similarity is greater than a set threshold.
31. The apparatus of claim 19, further comprising:
the request feedback module is used for receiving a resource query acquisition request and feeding back resource identifiers of all resources of the resource server;
and the resource access request receiving module is used for receiving the resource access request sent according to the resource identifier.
32. The apparatus of claim 19, wherein the first access request processing module comprises:
an access request monitoring submodule, configured to monitor a new resource access request for the current resource server;
the access request identification submodule is used for identifying whether the access requests of other resources are consistent with the access mode or not;
and the access request distribution submodule is used for distributing the other resource access requests to other resource servers for processing if the access requests are not consistent.
33. The apparatus according to claim 32, wherein the access request identification submodule is configured to identify whether the other resource access request and the plurality of resource access requests originate from the same access side.
34. The apparatus of claim 19, further comprising:
a second pattern recognition module, configured to determine that the access pattern of the first resource access sequence is to access a plurality of resources of other resource servers after determining that the access pattern of the first resource access sequence is to access a plurality of resources of the current resource server;
and the notification module is used for sending a notification message to the other resource servers, wherein the notification message carries the identification of the access end of the plurality of historical resource access requests.
35. The apparatus of claim 19, further comprising:
and the second access request processing module is used for processing the other resource access requests if the access mode of the first resource access sequence is determined not to access the plurality of resources of the current resource server.
36. The apparatus of claim 19, further comprising:
and a third access request processing module, configured to, after determining that the access mode of the first resource access sequence is to access the multiple resources of the current resource server, process other resource access requests that are consistent with the access mode.
37. A resource access request processing system is characterized by comprising at least one resource server and a resource access request processing device;
the resource access request processing device comprises:
the target resource acquisition module is used for analyzing a plurality of historical resource access requests aiming at the current resource server and acquiring a plurality of target resources corresponding to the historical resource access requests;
a sequence construction module, configured to construct a first resource access sequence based on the plurality of historical resource access requests, where the first resource access sequence is used to identify an access order of the plurality of historical resource access requests to the plurality of target resources;
a pattern recognition module, configured to determine that an access pattern of the first resource access sequence is to access a plurality of resources of the current resource server, including: determining that the first resource access sequence is a monotone sequence or a sequence with a set sequence or a data pattern recognition result is a sequence of a plurality of resources accessing the current resource server, or determining that the similarity between the first resource access sequence and a preset resource access sequence of a plurality of resources accessing the current resource server meets a set condition;
and the access request processing module is used for distributing other resource access requests which are inconsistent with the access mode to other resource servers for processing.
38. One or more computer-readable media having instructions stored therein, which when executed by one or more processors, cause the processors to perform the method of processing a resource access request of any of claims 1-18.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710034845.6A CN108322495B (en) | 2017-01-18 | 2017-01-18 | Method, device and system for processing resource access request |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710034845.6A CN108322495B (en) | 2017-01-18 | 2017-01-18 | Method, device and system for processing resource access request |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108322495A CN108322495A (en) | 2018-07-24 |
CN108322495B true CN108322495B (en) | 2021-07-06 |
Family
ID=62892207
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710034845.6A Active CN108322495B (en) | 2017-01-18 | 2017-01-18 | Method, device and system for processing resource access request |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108322495B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109246229B (en) * | 2018-09-28 | 2021-08-27 | 网宿科技股份有限公司 | Method and device for distributing resource acquisition request |
CN109871489A (en) * | 2019-03-06 | 2019-06-11 | 网宿科技股份有限公司 | A resource retrieval method in an intelligent identification system and an intelligent identification system |
CN110602156A (en) * | 2019-03-11 | 2019-12-20 | 平安科技(深圳)有限公司 | Load balancing scheduling method and device |
CN112153130B (en) * | 2020-09-14 | 2025-03-28 | 腾讯科技(深圳)有限公司 | A method and device for accessing business resources |
CN113411400B (en) * | 2021-06-18 | 2023-02-28 | 中国工商银行股份有限公司 | Information calling method and device, electronic equipment and readable storage medium |
CN115617608B (en) * | 2022-10-10 | 2024-03-29 | 深圳市泰通新智信息技术有限公司 | ERP cooperative processing method and ERP cooperative processing system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101006423A (en) * | 2004-08-25 | 2007-07-25 | 英特尔公司 | Method and apparatus of resource access synchronization in a basic in put and output system of a computer system |
CN101645928A (en) * | 2009-08-26 | 2010-02-10 | 成都市华为赛门铁克科技有限公司 | Content resource caching method, device and system |
JP2011182031A (en) * | 2010-02-26 | 2011-09-15 | Kddi R & D Laboratories Inc | Cloud service providing system |
CN102349078A (en) * | 2009-03-19 | 2012-02-08 | 日本电气株式会社 | Access control list conversion system, and method and program therefor |
CN105577714A (en) * | 2014-10-13 | 2016-05-11 | 中兴通讯股份有限公司 | Method and system for implementing content distribution network based on software-defined network |
CN105577549A (en) * | 2014-10-13 | 2016-05-11 | 中兴通讯股份有限公司 | Method and system for realizing content delivery network based on software defined network |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7380039B2 (en) * | 2003-12-30 | 2008-05-27 | 3Tera, Inc. | Apparatus, method and system for aggregrating computing resources |
-
2017
- 2017-01-18 CN CN201710034845.6A patent/CN108322495B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101006423A (en) * | 2004-08-25 | 2007-07-25 | 英特尔公司 | Method and apparatus of resource access synchronization in a basic in put and output system of a computer system |
CN102349078A (en) * | 2009-03-19 | 2012-02-08 | 日本电气株式会社 | Access control list conversion system, and method and program therefor |
CN101645928A (en) * | 2009-08-26 | 2010-02-10 | 成都市华为赛门铁克科技有限公司 | Content resource caching method, device and system |
JP2011182031A (en) * | 2010-02-26 | 2011-09-15 | Kddi R & D Laboratories Inc | Cloud service providing system |
CN105577714A (en) * | 2014-10-13 | 2016-05-11 | 中兴通讯股份有限公司 | Method and system for implementing content distribution network based on software-defined network |
CN105577549A (en) * | 2014-10-13 | 2016-05-11 | 中兴通讯股份有限公司 | Method and system for realizing content delivery network based on software defined network |
Non-Patent Citations (1)
Title |
---|
分布式多媒体系统服务质量保证与资源管理;张占军;《中国博士学位论文全文数据库(信息科技辑)》;20070215;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN108322495A (en) | 2018-07-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108322495B (en) | Method, device and system for processing resource access request | |
CN108881448B (en) | API request processing method and device | |
CN106897334B (en) | Question pushing method and equipment | |
CN108063685B (en) | Log analysis method and device | |
CN104391749B (en) | Resource allocation method and device | |
CN111787060B (en) | Traffic scheduling method, system and device | |
CN106649770B (en) | Big data query method and system | |
CN106649831B (en) | Data filtering method and device | |
CN112130996B (en) | Data monitoring control system, method, device, electronic device and storage medium | |
JP2015508543A (en) | Processing store visit data | |
US20180139222A1 (en) | Method and device for detecting website attack | |
CN113315836B (en) | File access request scheduling method and device, electronic equipment and storage medium | |
CN109344046B (en) | Data processing method, device, medium and electronic equipment | |
CN112286757A (en) | Data synchronization monitoring method and device, electronic equipment and storage medium | |
CN112463772B (en) | Log processing method and device, log server and storage medium | |
CN111338888B (en) | Data statistics method and device, electronic equipment and storage medium | |
CN107819825A (en) | A kind of service scheduling method, device and electronic equipment | |
CN108282414B (en) | Data stream guiding method, server and system | |
CN108900547B (en) | Source returning control method and device | |
CN105227386A (en) | For method, the Apparatus and system of point population statistics online user number | |
CN108900566B (en) | Method and device for determining position of IP (Internet protocol) equipment in network | |
CN113055213A (en) | Alarm information management method, alarm information management system and server | |
CN112861031A (en) | URL (Uniform resource locator) refreshing method, device and equipment in CDN (content delivery network) and CDN node | |
CN117459494A (en) | TOP domain name guaranteed forwarding method of DNS cache server | |
CN107888388B (en) | Charging method and system for network acceleration service |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |