Specific implementation mode
In order to make those skilled in the art better understand the technical solutions in the application, below in conjunction with the application reality
The attached drawing in example is applied, technical solutions in the embodiments of the present application is clearly and completely described, it is clear that described implementation
Example is merely a part but not all of the embodiments of the present application.Based on the embodiment in the application, this field is common
The every other embodiment that technical staff is obtained without creative efforts should all belong to the application protection
Range.
The embodiment of the present application provides a kind of hot spot access processing method, is applied to application server side, and the application is implemented
In example, by obtaining the access times according to each access index in setting time length on each cache access agent equipment
It determines the access hot spot in the setting time length, and local temporal cache is executed to the access hot spot, in this way, it is only necessary to access
Each cache access agent equipment can obtain data cached, alleviate the pressure of distributed cache server, so as to avoid
There is the system failure when there is access hot spot in distributed caching, influences the normal use of user.
Wherein, the access hot spot in the embodiment of the present application refers to setting in each cache access agency in setting time length
Standby upper access total degree is more than the access index of given threshold.
Fig. 1 is the first method flow chart of hot spot access processing method provided by the embodiments of the present application, side shown in FIG. 1
Method includes at least following steps:
Step S102, during handling access request, statistics each access index in setting time length corresponds to
Access times;And the corresponding access times write-in of each access index is divided according to the interval of above-mentioned setting time length
Cloth cache server;Wherein, access index is carried in above-mentioned access request.
The executive agent of hot spot access processing method provided by the embodiments of the present application is cache access agent equipment, and is cached
Access agent equipment application is arranged in a one-to-one correspondence in application server, cache access agent equipment with application server, i.e., one
There are one cache access agent equipments for setting on application server.
In distributed cache server, the data of storage are generally deposited in the form of index-data (key-value)
Storage, key are generally referred to as indexed, and value is then specific data corresponding with the index.For ease of understanding, it is following will illustrate into
Row explanation.
For example, being stored with the personal information of Zhang San in distributed cache server, the personal information of Zhang San specifically includes:
Gender, age, date of birth, native place, personal story etc., then above-mentioned key then refer to that Zhang San, value then refer to Zhang San's
Personal information.When user wants the personal information of inquiry Zhang San, need to ask the access for carrying " Zhang San " by client
It asks and is sent to distributed cache server.
In the embodiment of the present application, cache access agent equipment needs the visit that the application server where handling it receives
Ask request, and during handling access request, it is corresponding to count each access index according to received access request
Access times.
Specifically, cache access agent equipment handles the access request received especially by following steps:
After receiving access request, search local with the presence or absence of the corresponding temporal cache of the access request;
If in the presence of data cached client is sent to by the access request is corresponding;Otherwise, above-mentioned access request is sent out
Distributed cache server is given, it is corresponding data cached to obtain the access request from distributed cache server, and should
It is data cached to be sent to client.
Specifically, in the embodiment of the present application, client is taken by calling interface to application corresponding with the interface of calling
Business device sends access request, specifically, being the cache access agent equipment transmission access request on the application server.When slow
After depositing the access request that access agent equipment receives client transmission, first searches and whether there is the visit in local temporal cache
Ask that request is corresponding data cached, specifically, being then to search the access request according to the access index carried in the access request
It is corresponding data cached.
If it is corresponding data cached that there are the access requests in the local temporal cache of the cache access agent equipment,
This data cached is then sent to client;If the corresponding caching number of the access request is not present in local temporal cache
According to the access request being then sent to distributed cache server, to search the access request in distributed cache server
It is corresponding data cached, specifically, be then according to the access index carried in the access request in distributed cache server
It is corresponding data cached to search the access request, when find the access request it is corresponding data cached after, distributed caching clothes
Business device by this it is data cached be sent to the cache access agent equipment, this data cached is sent to by cache access agent equipment
Client.
In addition, since distributed cache server belongs to distributed cache server cluster, that is, there is the slow of multiple nodes
Deposit server.The corresponding data cached buffer service for being potentially stored in one or more node of different access index
On device.For ease of understanding, following to illustrate citing.
For example, distributed cache server includes cache server 1, cache server 2.... and cache server K,
Wherein, K is the positive integer more than or equal to 3.Access index 1 (key1) it is corresponding it is data cached be stored on cache server 1,
The corresponding data of access index 2 (key2) are stored in cache server 1, on cache server 2.
Therefore, when cache access agent equipment by access request when being sent to distributed cache server, needing should
The cache server for the corresponding node of access index that access request is sent in the access request.In the embodiment of the present application,
The cache server for being sent to the access request is determined for the ease of cache access agent equipment, in cache access agent equipment
In be stored with the cryptographic Hash of the corresponding cache server of each access index.In this way, cache access agent equipment is according to the access
Corresponding cryptographic Hash is indexed, determines that the access index needs the cache server being sent to.
The above process describes the detailed process of cache access agent equipment processing access request, and cache access agency sets
During standby processing access request, cache access agent equipment can also count each access rope in each setting time length
Draw corresponding access times.
Wherein, above-mentioned setting time length can be 1 minute, 2 minutes, the random times length such as 3 minutes, when above-mentioned setting
Between the specific size of length can be defined according to practical application scene, the embodiment of the present application is not long to above-mentioned setting time
The concrete numerical value of degree is defined.
For example, in a specific embodiment, above-mentioned setting time length is 1 minute, then cache access agency sets
It is standby to count the corresponding access times of 3 points of 13 minutes to 3: 14/each access index, 3: 14 assign to 3: 15/it is each
The corresponding access times of a access index, 3: 15 assign to 3: 16/the corresponding access times of each access index etc..
In the embodiment of the present application, each access in the setting time length of one of cache access agent equipment statistics
A kind of concrete form for indexing corresponding access times is as shown in table 1.
Table 1
Access index |
Access times |
Key1 |
1000 |
Key2 |
900 |
Key3 |
1200 |
Wherein, in table 1, what above-mentioned key1 was indicated is access index 1, and what key2 was indicated is access index 2, and key3 is indicated
Be access index 3.Then in setting length, access times of the key1 on the cache access agent equipment are 1000 times,
Access times of the key2 on the cache access agent equipment are 900 times, access of the key3 on the cache access agent equipment
Number is 1200 times.It is corresponding in setting time length that above-mentioned table 1 only lists tri- access index of key1, key2 and key3
Access times, do not constitute the restriction to the number of access index and corresponding number.Access times in above-mentioned table 1 are
The explanation of illustrative can not represent true access times.
In the embodiment of the present application, when cache access agent equipment has counted each access index pair in setting time length
After the access times answered, it is written into distributed cache server.
For example, cache access agent equipment has counted the corresponding access of 3 points of 13 minutes to 3: 14/each access index
Number writes the corresponding access times of each access index in this section of time span as batch of data then after the completion of statistics
Enter distributed cache server.
When there are multiple cache access agent equipments, the setting time length of each cache access agent equipment setting
Concrete numerical value is identical, also, the initial time of the setting time length of each cache access agent equipment setting and end time
All.For example, each cache access agent equipment is allocated as 3: 13 as the initial time of a setting time length, by 3
Point 14 was allocated as the end time of a setting time length.
In the embodiment of the present application, after having counted the corresponding access times of each access index in setting time length,
Distributed caching then is written into the corresponding access times of each access index according to the interval of setting time length.
Wherein, in the embodiment of the present application, data are written to distributed cache server in each cache access agent equipment
Frequency access times corresponding with each access index is counted frequency it is consistent.For example, cache access agent equipment can be with every
The primary corresponding access times of each access index in this minute of the one minute statistics in interval, and write according at interval of one minute
Distributed cache server is written in the corresponding access times of each access index by the frequency for entering a data.
For ease of understanding, following to be illustrated with specific example.
Continue to use the example above, setting time length is 1 minute, and cache access agent equipment can count at 3 points at 13 minutes to 3 points
The corresponding access times of 14/each access index 3: 14 assign to 3: 15/the corresponding access of each access index
Number, 3: 15 assign to 3: 16/the corresponding access times of each access index etc..Also, cache access agent equipment can
With the corresponding access times write-in of 3 points of 13 minutes to 3: 14/each access index is distributed slow at 3: 1 14:
Server is deposited, assigned to 3: 15 by 3: 14 at 3: 1 15 :/the corresponding access times write-in minute of each access index
Cloth cache server, 3: 16 are assigned to by 3: 15 when at 3: 1 16 :/each access index is corresponding accesses time
Number write-in distributed cache server.
Specifically, in above-mentioned steps S102, above-mentioned each access index is corresponded to according to the interval of setting time length
Access times be written distributed cache server, specifically comprise the following steps (1) and step (2);
Each access index in step (1), the mark for determining cache access agent equipment and each setting time length
The write time of corresponding access times;
Step (2), according to above-mentioned setting time length interval by the corresponding access times of above-mentioned each access index, on
State the mark and write-in of above-mentioned write time distributed cache server of cache access agent equipment.
In the embodiment of the present application, it is understood that there may be multiple cache access agent equipments, each cache access agent equipment
The corresponding access times write-in distributed cache server of each access index counted is needed, therefore, in order to distinguish not
With the data of cache access agent equipment write-in, need together to be written the mark of each cache access agent equipment distributed slow
Deposit server.
In addition, in the embodiment of the present application, since each cache access agent equipment is the interval according to time span
The corresponding access times write-in distributed cache server of each access index counted.For example, cache access agency sets
It is standby primary at interval of write-in in one minute, it can be written at 3: 13 minutes once, write-in in 3: 14 minutes is primary, writes within 3: 15 minutes
Enter primary etc., in order to distinguish the same cache access agent equipment in the data being written every time, therefore, it is necessary to visit the caching
Ask that distributed cache server is written in agent equipment each write time together.
Wherein, in above-mentioned steps (1), the mark of above-mentioned cache access agent equipment can be that cache access agency sets
Standby address Internet protocol address (Internet Protocol Address, IP).
In the embodiment of the present application, cache access agent equipment is by access index, access times, cache access agent equipment
Mark and the write time distributed cache server is written correspondingly.Wherein, cache access agent equipment write-in point
A kind of concrete form of data in cloth cache server is as shown in table 2.
Table 2
Above-mentioned table 2 is a kind of concrete form of the exemplary data for listing write-in distributed cache server, wherein
Data in above table can not represent true data.
In addition, in the embodiment of the present application, since distributed cache server is distributed cache server cluster, including
Therefore the cache server of multiple nodes can determine that the access index corresponds to according to the corresponding cryptographic Hash of each access index
Access times, the mark of cache access agent equipment and write time the cache server of which node is specifically written.
Specifically, may for the corresponding access times of each access index on the same cache access agent equipment
The cache server of different nodes is written.For ease of understanding, following to illustrate citing.
For example, distributed cache server includes cache server 1, cache server 2.... and cache server K,
Wherein, K is the positive integer more than or equal to 3.Access index 1 (key1) it is corresponding it is data cached be stored on cache server 1,
The corresponding data of access index 2 (key2) are stored on cache server 2.Then for uniting on the same cache access agent equipment
The 1 corresponding access times of access index and 2 corresponding access times of access index of meter then need to be respectively written into no slow
Server is deposited, specifically, cache server 1, the corresponding access time of access index 2 is written in 1 corresponding access times of access index
Number write-in cache server 2.
Also, in the embodiment of the present application, the write time of each cache access agent equipment is consistent, and every
The initial time of each setting time length of a cache access agent equipment setting and end time are also consistent.
Step S104 obtains the access hot spot in each access index;Wherein, which is according to distributed caching
Access times of each access index stored in server on each cache access agent equipment are determined;The access hot spot
It is more than the access index of given threshold for access times.
Wherein, above-mentioned access hot spot refers to that the access in setting time length on all cache access agent equipments is total
Number is more than the access index of given threshold.
Wherein, in above-mentioned steps S104, cache access agent equipment obtains the access hot spot in each access index, tool
Body includes the following steps:
It receives and accesses the access hot spot that hot spot identification equipment is sent;Wherein, above-mentioned access hot spot is set by the identification of access hot spot
The standby access times according to each access index stored in distributed cache server on each cache access agent equipment
It determines.
Specifically, in the above case said, then accessing hot spot is determined by access hot spot identification equipment, wherein access heat
Point identification equipment can be an equipment being separately provided, and can also be integrated on some virtual machine of distributed cache system.
In the embodiment of the present application, accessing hot spot identification equipment specifically can (A1) and step (A2) be really as follows
Surely hot spot is accessed:
Step (A1) is read from distributed cache server in the setting time length according to the interval of setting time length
Access times of the interior each access index on each cache access agent equipment.
Wherein, in the embodiment of the present application, cache access agent equipment write-in data and access hot spot identification equipment are read
Data are two independent steps, and be not present sequencing, cache access agent equipment according to setting time length interval
The write-in of data is carried out, hot spot identification equipment is accessed and reads number from distributed cache server according to the interval of setting time length
According to the sequence of time order and function is not present in the two, can be carried out at the same time.However, cache access agent equipment and access hot spot are known
Other equipment carries out the write-in and reading of data according to identical frequency respectively.For example, cache access agent equipment is at interval of one point
A data are written in clockwise distributed cache server, access hot spot identification equipment at interval of one minute from distributed caching service
Device reads a data.
Also, what in the embodiment of the present application, access hot spot identification equipment was read every time is all same setting time length
Access times of the interior each access index on all cache access agent equipments.It is to be understood that each accessing hot spot identification
What equipment was read is all access times of each access index of same write time on each cache access agent equipment.
Wherein, a kind of possible form for accessing the data that hot spot identification equipment is read is as shown in table 3.
Table 3
Access index |
Access times |
The mark of cache access agent equipment |
Write time |
Key1 |
1000 |
IP1 |
3 points 14 minutes |
Key2 |
1200 |
IP1 |
3 points 14 minutes |
Key3 |
3000 |
IP1 |
3 points 14 minutes |
Key1 |
2000 |
IP2 |
3 points 14 minutes |
Key3 |
1500 |
IP2 |
3 points 14 minutes |
Access hot spot identification equipment is listed in above-mentioned table 2 has read access index key1, access index key2 and access
Key3 is indexed in cache access agent equipment IP1 and the access for caching on access agent device IP 2 and being written at 3: 14 minutes
Number.Wherein, in the batch data, access times of the access index key1 on cache access agent equipment IP1 are 1000 times,
Access times of the access index key2 on cache access agent equipment IP1 are 1200 times, and access index key3 is in cache access
Access times on agent equipment IP1 are 3000, and access times of the access index key1 on cache access agent equipment IP2 are
2000 times, access times of the access index key3 on cache access agent equipment IP3 are 1500 times.
Step (A2), the access times according to each access index on each cache access agent equipment, identification setting
Access hot spot in time span.
Wherein, when (A2) determines access hot spot through the above steps, following process is specifically included:
According to access times of each access index on each cache access agent equipment, each cache access rope is determined
Draw the access total degree on all cache access agent equipments;According to the corresponding access total degree of each access index, determine
Access hot spot in setting time length.
In the embodiment of the present application, when reading access of each access index respectively on each cache access agent equipment
After hot spot, access times of each access index on each cache access agent equipment are merged, and will be after merging
Access times are determined as the corresponding access total degree of the access index.
For ease of understanding, following to illustrate citing.
For example, with the data instance in table 3, it is assumed that the number of cache access agent equipment is two, and respectively caching is visited
Ask that agent equipment IP1 and caching access agent device IP 2, access index are three, respectively key1, key2 and key3, key1
Access times on cache access agent equipment IP1 are access times of 1000, the key1 on cache access agent equipment IP2
It is 2000, therefore, the corresponding access total degrees of access index key1 are 3000;Access index key2 is in cache access agent equipment
Access times on IP1 are 1200, and the access times of access index key2 are not present on cache access agent equipment IP2, therefore,
Access times of the access index key2 on cache access agent equipment IP2 are 0, therefore, the corresponding access of access index key2
Total degree is 1200;Access times of the access index key3 on cache access agent equipment IP1 are 3000, access index key3
Access times on cache access agent equipment IP2 are 1500, and therefore, the corresponding access total degrees of access index key3 are
3500。
After determining access total degree of each access index on all cache access agent equipments by the above process,
Then according to the corresponding access total degree of each access index, the access hot spot in the setting time length is determined.
Specifically, in the embodiment of the present application, according to the corresponding access total degree of each access index, determining setting time
Access hot spot in length is realized particular by following steps:
The corresponding access times of each access index are compared with given threshold;Above-mentioned access total degree is more than and is set
The access index for determining threshold value is determined as access hot spot in setting time length.
Wherein, there are relationships for the value of the specific value of above-mentioned given threshold and above-mentioned setting time length, if above-mentioned
The value of setting time length is bigger, then the value of given threshold is also bigger, and the value of setting time length is smaller, given threshold
Value it is also smaller.Specifically, the specific value of above-mentioned given threshold can according to the specific value of setting time length and
Practical application scene is configured, and the embodiment of the present application is not defined the specific value of above-mentioned given threshold.
In the embodiment of the present application, pass through the access time according to each access index on each cache access agent equipment
Number, can automatically identify the access hot spot in each setting time length, realize the automatic identification for accessing hot spot, avoid
Hot spot is accessed using manual type identification, and it is possible to identify the access hot spot in each setting time length in time, just
The access hot spot is handled in time in cache access agent equipment.
In addition, in the embodiment of the present application, since what is identified every time is all access heat in current setting time length
Point can also identify newest access hot spot in time after accessing hot spot and changing, convenient for being carried out in time to accessing hot spot
Processing.
Specifically, the identification process of above-mentioned access hot spot is executed by access hot spot identification equipment, when access hot spot
After identification equipment identifies the access hot spot in current setting time length, which is notified to set to cache access agency
It is standby.If there are multiple cache access agent equipments, then accessing hot spot identification equipment can will be determining by way of broadcast
Hot spot is accessed to notify to each cache access agent equipment.
In the embodiment of the present application, the access hot spot identification equipment except through being separately provided, which determines, accesses outside hot spot, also
It can will be integrated in cache access agent equipment with the module for accessing hot spot identification function, be known by cache access agent equipment
Hot spot is not accessed.Specifically, this each cache access agent equipment identification can carry out accessing heat in setting time length
The identification of point, the step of hot spot broadcast notice is to each cache access agent equipment will be accessed by avoiding.
Step S106 executes local temporal cache to above-mentioned access hot spot.
In the embodiment of the present application, in order to reduce due to there is cache access hot spot and so that distributed cache server goes out
Therefore the existing system failure after S104 determines the access hot spot in each time span through the above steps, is then visited by caching
Ask that agent equipment executes local temporal cache to the access hot spot, in this way, carrying the access hot spot when client has sent
After access request, the corresponding caching number of the access hot spot can be found in the temporal cache of cache access agent equipment local
According to, avoid from distributed cache server obtain it is data cached, alleviate the operating pressure of distributed cache server, to
It avoids cache server and the system failure occurs, to influence the normal use of user.
Hot spot access processing method provided by the embodiments of the present application for ease of understanding, it is following to be carried out by specific embodiment
Explanation.Fig. 2 is the second method flow chart of hot spot access processing method provided by the embodiments of the present application, method shown in Fig. 2
Including at least following steps:
Step S202, client send access request to cache access agent equipment;Wherein, it is carried in the access request
Access index.
Step S204, cache access agent equipment handle the access request, also, in the process for handling the access request
In, count the corresponding access times of each access index in setting time length.
Wherein, the detailed process of cache access agent equipment processing access request includes:
It first looks for local with the presence or absence of the corresponding temporal cache of the access request;If in the presence of then by the access request
It is corresponding data cached to be sent to client;If being not present, then the access request is sent to distributed cache server, with
It is corresponding data cached that the access request is searched in distributed cache server, and the access request is corresponding data cached
It is sent to cache access agent equipment, this data cached is sent to client by cache access agent equipment.
Step S206, cache access agent equipment correspond to above-mentioned each access index according to the interval of setting time length
Access times be written distributed cache server.
Step S208 accesses hot spot identification equipment and is read from distributed cache server according to the interval of setting time length
Access times of each access index on each cache access agent equipment in the setting time length.
Wherein, the reading process of the ablation process of above-mentioned steps S206 and step S208 are two and independently execute step,
It respectively independently executes, is not necessarily present chronological order, can be performed simultaneously.
In the embodiment of the present application, above-mentioned access hot spot identification equipment can be an equipment being separately provided, can also
It is integrated on some virtual machine of distributed cache system.
Step S210 accesses access of the hot spot identification equipment by each access index on each cache access agent equipment
Number merges, and obtains the corresponding access total degree of each access index.
Wherein, the corresponding access total degree of above-mentioned each access index refers to each access index in all cache access
Access total degree on agent equipment.
Step S212 accesses hot spot identification equipment and carries out the corresponding access total degree of each access index and given threshold
It compares, and access index of the total degree more than given threshold will be accessed and be determined as the access hot spot in the setting time length.
Step S214 accesses hot spot identification equipment and gives determining access hot spot broadcast notice to cache access agent equipment.
Step S216 after cache access agent equipment gets access hot spot, executes the access hot spot local interim slow
It deposits.
Hot spot access processing method provided by the embodiments of the present application is accessed by each cache access agent equipment in processing
During request, the corresponding access times of each access index in setting time length are counted, and by the setting time length
Distributed cache server is written in the corresponding access times of interior each access index;Then, according in distributed cache server
Access times of each access index of storage on each cache access agent equipment determine the visit in the setting time length
Ask hot spot;After cache access agent equipment gets the access hot spot, local temporal cache is executed to the access hot spot.This
Sample, it is only necessary to which accessing each cache access agent equipment can obtain data cached, alleviate the pressure of distributed cache server
There is the system failure when there is access hot spot so as to avoid distributed caching, influences the normal use of user in power.
Based on above-mentioned hot spot access processing method, it is based on identical thinking, the embodiment of the present application also provides a kind of cachings
Access agent equipment is applied on application server, for executing hot spot access processing method provided by the embodiments of the present application.Figure
3 show the module composition schematic diagram of cache access agent equipment provided by the embodiments of the present application, in equipment shown in Fig. 3,
Including:
Statistical module 31, during handling access request, statistics each access index pair in setting time length
The access times answered;And according to above-mentioned setting time length interval by the corresponding access times of above-mentioned each access index
Distributed cache server is written;Wherein, access index is carried in above-mentioned access request;
Acquisition module 32 obtains the access hot spot in above-mentioned each access index;Wherein, above-mentioned access hot spot is according to above-mentioned
Access times institute of the above-mentioned each access index stored in distributed cache server on each cache access agent equipment
It determines;Above-mentioned access hot spot is the access index that access times are more than given threshold;
Cache module 33 executes local temporal cache to above-mentioned access hot spot.
Optionally, above-mentioned acquisition module 32, including:
Receiving unit, for receiving the access hot spot for accessing hot spot identification equipment and sending;Wherein, above-mentioned access hot spot is by visiting
Ask hot spot identification equipment according to each access index stored in distributed cache server in each cache access agent equipment
On access times determine.
Optionally, above-mentioned statistical module 31, including:
Determination unit, each visit in mark and each setting time length for determining cache access agent equipment
Ask the write time for indexing corresponding access times;
Writing unit, for the interval according to setting time length by the corresponding access times of above-mentioned each access index,
Distributed cache server is written in the mark of cache access agent equipment and above-mentioned write time.
Optionally, cache access agent equipment provided by the embodiments of the present application further includes:
Searching module, it is local corresponding interim slow with the presence or absence of access request for after receiving access request, searching
It deposits;
First sending module, if asking above-mentioned access there are the corresponding temporal cache of above-mentioned access request for local
It asks corresponding and data cached is sent to client;
Second sending module asks above-mentioned access if the corresponding temporal cache of above-mentioned access request is not present for local
It asks and is sent to distributed cache server, with corresponding data cached from the above-mentioned access request of distributed cache server acquisition,
And data cached it is sent to client by above-mentioned.
Cache access agent equipment provided by the embodiments of the present application is accessed by each cache access agent equipment in processing
During request, the corresponding access times of each access index in setting time length are counted, and by the setting time length
Distributed cache server is written in the corresponding access times of interior each access index;Then, according in distributed cache server
Access times of each access index of storage on each cache access agent equipment determine the visit in the setting time length
Ask hot spot;After cache access agent equipment gets the access hot spot, local temporal cache is executed to the access hot spot.This
Sample, it is only necessary to which accessing each cache access agent equipment can obtain data cached, alleviate the pressure of distributed cache server
There is the system failure when there is access hot spot so as to avoid distributed caching, influences the normal use of user in power.
Based on Fig. 1, method shown in Fig. 2, the embodiment of the present application also provides a kind of distributed cache system, Fig. 4 is this
The first structural schematic diagram for applying for the distributed cache system that embodiment provides, for system shown in Fig. 4, specific implementation
The specific implementation procedure of principle, modules and composition can refer to hot spot access processing method provided by the embodiments of the present application, this
In repeat no more.Distributed cache system shown in Fig. 4, including:
Distributed cache server 41 accesses hot spot identification equipment 42 and at least one cache access agent equipment 43;
Above-mentioned cache access agent equipment 43, for during handling access request, counting in setting time length
The corresponding access times of interior each access index, and it is according to the interval of setting time length that above-mentioned each access index is corresponding
Distributed cache server 41 is written in access times;And the access hot spot that above-mentioned access hot spot identification equipment determines is executed
Local temporal cache;Wherein, access index is carried in above-mentioned access request;
Above-mentioned distributed cache server 41, for storing each access index on each cache access agent equipment
Access times;
Above-mentioned access hot spot identification equipment 42, for the interval according to above-mentioned setting time length from distributed caching service
Device reads access times of each access index on each cache access agent equipment in setting time length;And root
According to access times of each access index on each cache access agent equipment, identify above-mentioned setting time length per interior visit
Ask hot spot.
In the embodiment of the present application, cache access agent equipment is set on application server, on an application server
There are one cache access agent equipments for setting.
Wherein, above-mentioned cache access agent equipment 43 especially by following process at the access request that receives
Reason:
After receiving access request, search local with the presence or absence of the corresponding temporal cache of above-mentioned access request;If in the presence of,
Then data cached client is sent to by above-mentioned access request is corresponding;Otherwise, above-mentioned access request is sent to distributed slow
Server is deposited, it is corresponding data cached to obtain above-mentioned access request from distributed cache server, and by the data cached hair
Give client.
In one or more embodiment of this specification, each cache access agent equipment in the system handles it
The access request received, and during handling access request, statistics is received in each setting time length
The corresponding access times of each access index in access request, and according to the interval of setting time length by each access index pair
The access times write-in distributed cache server 41 answered.Since each cache access agent equipment is to distributed caching service
Access times of each access index on the cache access agent equipment are written in device 41, therefore, in distributed cache server
Access times of each access index on each cache access agent equipment are stored on 41.
Hot spot identification equipment 42 is accessed to read at this from distributed cache server according to the interval of setting time length
Access times of each access index on each cache access agent equipment in setting time length, then, according to each visit
It asks access times of the index on each cache access agent equipment, identifies the access index in setting time length.
In the embodiment of the present application, it is to be visited independently of distributed cache server and caching due to accessing hot spot identification equipment
An equipment ask except agent equipment, being separately provided can also be integrated on distributed cache system except distributed caching takes
On some virtual machine except device and the caching access agent equipment of being engaged in.
Therefore, after access hot spot identification equipment 42 determines the access hot spot in current setting time length, by this
It accesses hot spot and is sent to cache access agent equipment 43.
If so, when the number of cache access agent equipment is multiple, then hot spot identification equipment 42 is accessed by determining access
Hot spot broadcast notice is to each cache access agent equipment 43.
In the embodiment of the present application, each access index in by setting time length of above-mentioned cache access agent equipment 43
When corresponding access times write-in distributed cache server 41, specifically need to execute following process:
Determine that each access index in the mark and each setting time length of cache access agent equipment 43 corresponds to
Access times write time;According to setting time length interval by the corresponding access times of above-mentioned each access index,
Distributed cache server is written in the mark of cache access agent equipment and above-mentioned write time.
Specifically, in the embodiment of the present application, when access hot spot identification equipment 42 according to setting time length interval from
After distributed cache server reads access times of each access index on each cache access agent equipment 43, heat is accessed
Point identification equipment 42 determines access hot spot especially by following process is executed:
According to access times of each access index on each cache access agent equipment, determine that each access index exists
Access total degree in indexed cache access agent equipment;According to the corresponding access total degree of each access index, determine above-mentioned
Access hot spot in setting time length.
Specifically, in the embodiment of the present application, above-mentioned access hot spot identification equipment 42 is specifically held when determining access hot spot
The following process of row:
The corresponding access total degree of each access index is compared with given threshold respectively;By above-mentioned access total degree
Access index more than given threshold is determined as the access hot spot in setting time length.
Wherein, the specific value of above-mentioned given threshold can be configured according to practical application scene, the embodiment of the present application
The specific value of above-mentioned given threshold is not defined.
Specifically, in the embodiment of the present application, above-mentioned access hot spot identification equipment 42 determine access hot spot during,
It is specific to execute following steps:
Access times of each access index on each cache access agent equipment are merged;By the visit after merging
Ask that number is determined as the corresponding access total degree of the access index.
Distributed cache system provided by the embodiments of the present application for ease of understanding, following points that will combine concrete application scene
It is illustrated for cloth caching system.Fig. 5 shows the concrete application of distributed cache system provided by the embodiments of the present application
Schematic diagram of a scenario, in scene shown in Fig. 5, including multiple cache access agent equipments 43, and a cache access agency sets
It is standby to be set on an application server.
For ease of description, following cache access agent equipments by system shown in fig. 5 are denoted as the visit of the first caching respectively
Ask agent equipment, the second cache access agent equipment and N cache access agent equipments, wherein N is more than or equal to 3
Positive integer.
Wherein, above-mentioned first cache access agent equipment is set on application server 1, the second cache access agent equipment
It is set on application server 2, N cache access agent equipments are set on application server N.
In the embodiment of the present application, data access calls side is called to send to access to above-mentioned application server by interface and be asked
It asks, in application scenarios shown in Fig. 5, data access calls side 1 is called by interface to first be set on application server 1
The access request that cache access agent equipment is sent, data access calls side 2 are called by interface to being set to application server 2
On the second cache access agent equipment send access request, data access calls side N is called by interface to being set to application
N cache access agent equipments on server N send access request.
Wherein, above-mentioned data access calls side can be client.
Also, above-mentioned first cache access agent equipment, the second cache access agent equipment and N cache access agency
Equipment is during handling access request, statistics each access rope in received access request in setting time length
Draw corresponding access times;And it is written according to the corresponding access times of access index that the interval of setting time length is counted
Distributed cache server.
Specifically, each access index that the first cache access agent equipment is counted is set in the first cache access agency
Distributed cache server, each access index that the second cache access agent equipment is counted is written in standby upper access times
Distributed cache server is written in access times on the second cache access agent equipment, and N cache access agent equipments will
Distributed cache server is written in its access times of each access index counted on N cache access agent equipments.
Since distributed cache server includes the cache server of multiple nodes, as shown in figure 5, being denoted as caching clothes respectively
Be engaged in device 1, cache server 2 and cache server M, wherein M is the positive integer more than or equal to 3, and M and N can be with value
It is identical, can also value differ.
It is stored with different access on different buffer services and indexes corresponding data, therefore, in the embodiment of the present application,
It, can be corresponding according to each access index when the corresponding access times of each access index are write distributed cache server
Cryptographic Hash determines the corresponding access times write-in cache server of the access index, and delaying access index write-in determination
It deposits on server.
Hot spot identification equipment is accessed to take from each caching of distributed cache server according to the interval of setting time length
Access times of each access index on each cache access agent equipment are read on business device, and determine that each access index exists
Access total degree on all cache access agent equipments, then, by the corresponding access total degree of each access index and setting
Threshold value is compared, and accesses the access heat that total degree is determined as more than the access index of given threshold in the setting time length
Point.
Access hot spot identify it is hot standby by the access hot spot determined be broadcast to the first cache access agent equipment, second caching
Access agent equipment and N cache access agent equipments, then, by the first cache access agent equipment, the second cache access
Agent equipment and N cache access agent equipment execute local temporal cache to the access hot spot.
Distributed cache system provided by the embodiments of the present application is accessed in processing by each cache access agent equipment and is asked
During asking, the corresponding access times of each access index in setting time length are counted, and will be in the setting time length
Distributed cache server is written in the corresponding access times of each access index;Then, it is deposited according in distributed cache server
Access times of each access index of storage on each cache access agent equipment determine the access in the setting time length
Hot spot;After cache access agent equipment gets the access hot spot, local temporal cache is executed to the access hot spot.In this way,
Only needing to access each cache access agent equipment can obtain data cached, alleviate the pressure of distributed cache server,
There is the system failure when there is access hot spot so as to avoid distributed caching, influences the normal use of user.
Further, it is based on above-mentioned Fig. 1, method shown in Fig. 2, at a kind of hot spot access
Equipment is managed, as shown in Figure 6.
Hot spot access process equipment can generate bigger difference because configuration or performance are different, may include one or one
A above processor 601 and memory 602 can be stored with one or more storage application programs in memory 602
Or data.Wherein, memory 602 can be of short duration storage or persistent storage.Being stored in the application program of memory 602 can wrap
One or more modules (diagram is not shown) are included, each module may include to a series of in hot spot access process equipment
Computer executable instructions.Further, processor 601 could be provided as communicating with memory 602, in hot spot access process
The series of computation machine executable instruction in memory 602 is executed in equipment.Hot spot access process equipment can also include one
Or more than one power supply 603, one or more wired or wireless network interfaces 604, one or more input and output
Interface 605, one or more keyboards 606 etc..
In a specific embodiment, hot spot access process equipment include memory and one or more
Program, either more than one program is stored in memory and one or more than one program may include for one of them
One or more modules, and each module may include executable to the series of computation machine in hot spot access process equipment
Instruction, and it is configured to by one that either more than one processor executes this or more than one program includes for carrying out
Following computer executable instructions:
During handling access request, statistics each access index in setting time length is corresponding to be accessed time
Number;And the corresponding access times of each access index are written according to the interval of the setting time length distributed
Cache server;Wherein, access index is carried in the access request;
Obtain the access hot spot in each access index;Wherein, the access hot spot is according to the distributed caching
Access times of each access index stored in server on each cache access agent equipment are determined;The visit
Ask that hot spot is the access index that access times are more than given threshold;
Local temporal cache is executed to the access hot spot.
Optionally, when executed, the access obtained in each access index is hot for computer executable instructions
Point, including:
It receives and accesses the access hot spot that hot spot identification equipment is sent;Wherein, the access hot spot is known by the access hot spot
Other equipment is according to each access index stored in the distributed cache server in each cache access agent equipment
On access times determine.
Optionally, when executed, the interval according to the setting time length is by institute for computer executable instructions
The corresponding access times write-in distributed cache server of each access index is stated, including:
Determine that each access index in the mark and each setting time length of cache access agent equipment is corresponding
The write time of access times;
The corresponding access times of each access index, the caching are visited according to the interval of the setting time length
The distributed cache server is written in the mark and said write time for asking agent equipment.
Optionally, when executed, the method further includes computer executable instructions:
After receiving the access request, search local with the presence or absence of the corresponding temporal cache of the access request;
If in the presence of data cached client is sent to by the access request is corresponding;Otherwise, by the access request
It is sent to the distributed cache server, to obtain the corresponding caching of the access request from the distributed cache server
Data, and data cached it is sent to the client by described.
Hot spot access process equipment provided by the embodiments of the present application is accessed by each cache access agent equipment in processing
During request, the corresponding access times of each access index in setting time length are counted, and by the setting time length
Distributed cache server is written in the corresponding access times of interior each access index;Then, according in distributed cache server
Access times of each access index of storage on each cache access agent equipment determine the visit in the setting time length
Ask hot spot;After cache access agent equipment gets the access hot spot, local temporal cache is executed to the access hot spot.This
Sample, it is only necessary to which accessing each cache access agent equipment can obtain data cached, alleviate the pressure of distributed cache server
There is the system failure when there is access hot spot so as to avoid distributed caching, influences the normal use of user in power.
Further, it is based on above-mentioned Fig. 1, method shown in Fig. 2, the embodiment of the present application also provides a kind of storage medium,
For storing computer executable instructions, in a kind of specific embodiment, which can be USB flash disk, CD, hard disk etc.,
The computer executable instructions of storage medium storage can realize following below scheme when being executed by processor:
During handling access request, statistics each access index in setting time length is corresponding to be accessed time
Number;And the corresponding access times of each access index are written according to the interval of the setting time length distributed
Cache server;Wherein, access index is carried in the access request;
Obtain the access hot spot in each access index;Wherein, the access hot spot is according to the distributed caching
Access times of each access index stored in server on each cache access agent equipment are determined;The visit
Ask that hot spot is the access index that access times are more than given threshold;
Local temporal cache is executed to the access hot spot.
Optionally, the computer executable instructions of storage medium storage are when being executed by processor, described in the acquisition
Access hot spot in each access index, including:
It receives and accesses the access hot spot that hot spot identification equipment is sent;Wherein, the access hot spot is known by the access hot spot
Other equipment is according to each access index stored in the distributed cache server in each cache access agent equipment
On access times determine.
Optionally, the computer executable instructions of storage medium storage are described according to described when being executed by processor
Distributed cache server is written in the corresponding access times of each access index by the interval of setting time length, including:
Determine that each access index in the mark and each setting time length of cache access agent equipment is corresponding
The write time of access times;
The corresponding access times of each access index, the caching are visited according to the interval of the setting time length
The distributed cache server is written in the mark and said write time for asking agent equipment.
Optionally, the computer executable instructions of storage medium storage when being executed by processor, also wrap by the method
It includes:
After receiving the access request, search local with the presence or absence of the corresponding temporal cache of the access request;
If in the presence of data cached client is sent to by the access request is corresponding;Otherwise, by the access request
It is sent to the distributed cache server, to obtain the corresponding caching of the access request from the distributed cache server
Data, and data cached it is sent to the client by described.
The computer executable instructions stored in storage medium provided by the embodiments of the present application lead to when being executed by processor
Each cache access agent equipment is crossed during handling access request, counts each access index pair in setting time length
The access times answered, and distributed caching service is written into the corresponding access times of each access index in the setting time length
Device;Then, the visit according to each access index stored in distributed cache server on each cache access agent equipment
Ask that number determines the access hot spot in the setting time length;It is right after cache access agent equipment gets the access hot spot
The access hot spot executes local temporal cache.In this way, it is only necessary to which caching number can be obtained by accessing each cache access agent equipment
According to, alleviate the pressure of distributed cache server, so as to avoid distributed caching occur access hot spot when there is system
Failure influences the normal use of user.
In the 1990s, the improvement of a technology can be distinguished clearly be on hardware improvement (for example,
Improvement to circuit structures such as diode, transistor, switches) or software on improvement (improvement for method flow).So
And with the development of technology, the improvement of current many method flows can be considered as directly improving for hardware circuit.
Designer nearly all obtains corresponding hardware circuit by the way that improved method flow to be programmed into hardware circuit.Cause
This, it cannot be said that the improvement of a method flow cannot be realized with hardware entities module.For example, programmable logic device
(Programmable Logic Device, PLD) (such as field programmable gate array (Field Programmable Gate
Array, FPGA)) it is exactly such a integrated circuit, logic function determines device programming by user.By designer
Voluntarily programming comes a digital display circuit " integrated " on a piece of PLD, designs and makes without asking chip maker
Dedicated IC chip.Moreover, nowadays, substitution manually makes IC chip, this programming is also used instead mostly " patrols
Volume compiler (logic compiler) " software realizes that software compiler used is similar when it writes with program development,
And the source code before compiling also write by handy specific programming language, this is referred to as hardware description language
(Hardware Description Language, HDL), and HDL is also not only a kind of, but there are many kind, such as ABEL
(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description
Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL
(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby
Hardware Description Language) etc., VHDL (Very-High-Speed are most generally used at present
Integrated Circuit Hardware Description Language) and Verilog.Those skilled in the art also answer
This understands, it is only necessary to method flow slightly programming in logic and is programmed into integrated circuit with above-mentioned several hardware description languages,
The hardware circuit for realizing the logical method flow can be readily available.
Controller can be implemented in any suitable manner, for example, controller can take such as microprocessor or processing
The computer for the computer readable program code (such as software or firmware) that device and storage can be executed by (micro-) processor can
Read medium, logic gate, switch, application-specific integrated circuit (Application Specific Integrated Circuit,
ASIC), the form of programmable logic controller (PLC) and embedded microcontroller, the example of controller includes but not limited to following microcontroller
Device:ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8041F320, are deposited
Memory controller is also implemented as a part for the control logic of memory.It is also known in the art that in addition to
Pure computer readable program code mode is realized other than controller, can be made completely by the way that method and step is carried out programming in logic
Controller is obtained in the form of logic gate, switch, application-specific integrated circuit, programmable logic controller (PLC) and embedded microcontroller etc. to come in fact
Existing identical function.Therefore this controller is considered a kind of hardware component, and to including for realizing various in it
The device of function can also be considered as the structure in hardware component.Or even, it can will be regarded for realizing the device of various functions
For either the software module of implementation method can be the structure in hardware component again.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.It is a kind of typically to realize that equipment is computer.Specifically, computer for example may be used
Think personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
It is any in device, navigation equipment, electronic mail equipment, game console, tablet computer, wearable device or these equipment
The combination of equipment.
For convenience of description, it is divided into various units when description apparatus above with function to describe respectively.Certainly, implementing this
The function of each unit is realized can in the same or multiple software and or hardware when application.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, the application can be used in one or more wherein include computer usable program code computer
The computer program production implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The application is with reference to method, the flow of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It should be understood that can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
Instruct the processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine so that the instruction executed by computer or the processor of other programmable data processing devices is generated for real
The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or
The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology realizes information storage.Information can be computer-readable instruction, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storages, magnetic tape cassette, tape magnetic disk storage or other magnetic storage apparatus
Or any other non-transmission medium, it can be used for storage and can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
Including so that process, method, commodity or equipment including a series of elements include not only those elements, but also wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that wanted including described
There is also other identical elements in the process of element, method, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer program product.
Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application
Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code
The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The application can describe in the general context of computer-executable instructions executed by a computer, such as program
Module.Usually, program module includes routines performing specific tasks or implementing specific abstract data types, program, object, group
Part, data structure etc..The application can also be put into practice in a distributed computing environment, in these distributed computing environments, by
Task is executed by the connected remote processing devices of communication network.In a distributed computing environment, program module can be with
In the local and remote computer storage media including storage device.
Each embodiment in this specification is described in a progressive manner, identical similar portion between each embodiment
Point just to refer each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality
For applying example, since it is substantially similar to the method embodiment, so description is fairly simple, related place is referring to embodiment of the method
Part explanation.
Above is only an example of the present application, it is not intended to limit this application.For those skilled in the art
For, the application can have various modifications and variations.It is all within spirit herein and principle made by any modification, equivalent
Replace, improve etc., it should be included within the scope of claims hereof.