CN105353976B - It is a kind of to obtain data cached method and apparatus - Google Patents
It is a kind of to obtain data cached method and apparatus Download PDFInfo
- Publication number
- CN105353976B CN105353976B CN201510689666.7A CN201510689666A CN105353976B CN 105353976 B CN105353976 B CN 105353976B CN 201510689666 A CN201510689666 A CN 201510689666A CN 105353976 B CN105353976 B CN 105353976B
- Authority
- CN
- China
- Prior art keywords
- data
- cached
- signature
- data cached
- cache 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/061—Improving I/O performance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/062—Securing storage systems
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention provides a kind of for obtaining data cached method and apparatus, according to the request of data of application server, data signature corresponding with the request of data is obtained from data signature cache server, it is obtained if getting the data signature from data signature cache server, in self-corresponding local disk corresponding with the data signature data cached;If the data signature has not been obtained from data signature cache server, judgement obtains data cached failure;It is obtained if data signature cache server delay machine, in self-corresponding data content cache server corresponding with request of data data cached.Compared with prior art, the present invention accesses data signature cache server and obtains data signature, data cached from local disk acquisition based on the data signature, avoids initiating to ask to data content cache server;It when data signature cache server delay machine, is just obtained from data content cache server data cached, alleviates the pressure of data content cache server.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of method and apparatus that acquisition is data cached.
Background technology
Caching system is stored with the data information that user often accesses, and is obtained nearby when user being contributed to initiate data access
Data achieve the effect that access acceleration.However, the prior art usually only content caching, needs to transmit mass data.And
And when caching system collapses, different processing schemes can bring different effects to system.
The common two schemes of processing caching system collapse case institute are respectively at present:
1) after caching system is collapsed without response, request is directly transparent to rear end truthful data source.After the program causes
End data source instant failure, causes system snowslide, can not provide service, and then influences other services of same data source;
2) after caching system collapses, request rear end is not transparent to, directly refusal service.Although the program provides pair
The protection of back-end data source, but service abnormal.
Therefore, how a kind of data cached acquisition methods are provided, alleviates the pressure of content caching in the prior art, into one
Step ground mitigates the impact to rear end truthful data source after caching system collapses, and alleviating system to request of data side's offer data collapses
The service brought of bursting is abnormal, becomes one of the most urgent problems to be solved by those skilled in the art.
Invention content
The object of the present invention is to provide a kind of for obtaining data cached method and apparatus.
According to an aspect of the present invention, provide a kind of for obtaining data cached method, wherein this method include with
Lower step:
According to the request of data of application server, obtained from data signature cache server opposite with the request of data
The data signature answered;
Wherein, this method further includes any one of following:
If a gets the data signature from the data signature cache server, obtained in self-corresponding local disk
It takes corresponding with the data signature data cached;
If the data signature has not been obtained from the data signature cache server by b, judgement obtains data cached mistake
It loses;
If the c data signature cache server delay machines, acquisition and data in self-corresponding data content cache server
It asks corresponding data cached.
According to another aspect of the present invention, it additionally provides a kind of for obtaining data cached device, wherein the device
Including following device:
First acquisition device is obtained for the request of data according to application server from data signature cache server
Data signature corresponding with the request of data;
Wherein, which further includes any one of following:
Second acquisition device, if for getting the data signature from the data signature cache server, from right
It is obtained in the local disk answered corresponding with the data signature data cached;
First decision maker is sentenced for if the data signature to have not been obtained from the data signature cache server
Surely data cached failure is obtained;
Third acquisition device, if being used for the data signature cache server delay machine, self-corresponding data content caching clothes
It is engaged in obtaining in device corresponding with request of data data cached.
Compared with prior art, cache server is divided into the areas Liang Ge by the present invention:Data signature cache server and data
Content caching server only accesses data signature cache server acquisition data signature in access cache server first
Can, in the case where that can obtain data signature from data signature cache server, success is data cached from local disk acquisition,
If data cached the data cached of local disk acquisition that effectively then be used directly, avoids initiating to data content cache server
Request, alleviates the pressure of data content cache server;It is just slow from data content when data signature cache server delay machine
It deposits and obtains data cached in server, alleviate the pressure of data content cache server.
Further, the present invention local disk obtain less than it is data cached in the case of visit again data content caching clothes
Business device avoids directly initiating to ask to data content cache server, alleviates the pressure of data content cache server.
Further, the present invention will not directly judge to obtain cache failure when data content cache server delay machine,
But mirror image data that one comes in handy can be obtained from local disk to demand data side, it avoids the case where encountering delay machine
When judgement obtain data cached failure and truthful data source held to initiate request of data immediately rearward, to cause back-end system to collapse
It bursts.
Description of the drawings
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, of the invention other
Feature, objects and advantages will become more apparent upon:
Fig. 1 is shown according to one aspect of the invention for obtaining data cached method flow schematic diagram.
Fig. 2 shows the overall flow schematic diagrams for obtaining data cached method.
Fig. 3 show according to a further aspect of the present invention for obtaining data cached schematic device.
Same or analogous reference numeral represents same or analogous component in attached drawing.
Specific implementation mode
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail
The processing described as flow chart or method.Although operations are described as the processing of sequence by flow chart, therein to be permitted
Multioperation can be implemented concurrently, concomitantly or simultaneously.In addition, the sequence of operations can be rearranged.When it
The processing can be terminated when operation completion, it is also possible to the additional step being not included in attached drawing.The processing
It can correspond to method, function, regulation, subroutine, subprogram etc..
Alleged " computer equipment " within a context, also referred to as " computer ", referring to can be by running preset program or referring to
Enable and execute the intelligent electronic device of the predetermined process process such as numerical computations and/or logical calculated, may include processor with
Memory, executes the survival that prestores in memory by processor and instructs and execute predetermined process process, or by ASIC,
The hardware such as FPGA, DSP execute predetermined process process, or are realized by said two devices combination.Computer equipment includes but unlimited
In server, PC, laptop, tablet computer, smart mobile phone etc..
The computer equipment includes user equipment and the network equipment.Wherein, the user equipment includes but not limited to electricity
Brain, smart mobile phone, PDA etc.;The network equipment includes but not limited to that single network server, multiple network servers form
Server group or the cloud being made of a large amount of computers or network server for being based on cloud computing (Cloud Computing), wherein
Cloud computing is one kind of Distributed Calculation, a super virtual computer being made of the computer collection of a group loose couplings.Its
In, the computer equipment can isolated operation realize the present invention, also can access network and by with other calculating in network
The present invention is realized in the interactive operation of machine equipment.Wherein, the network residing for the computer equipment include but not limited to internet,
Wide area network, Metropolitan Area Network (MAN), LAN, VPN network etc..
It should be noted that the user equipment, the network equipment and network etc. are only for example, other are existing or from now on may be used
The computer equipment or network that can occur such as are applicable to the present invention, should also be included within the scope of the present invention, and to draw
It is incorporated herein with mode.
Method (some of them are illustrated by flow) discussed hereafter can be by hardware, software, firmware, centre
Part, microcode, hardware description language or its arbitrary combination are implemented.Implement when with software, firmware, middleware or microcode
When, program code or code segment to implement necessary task can be stored in machine or computer-readable medium and (for example deposit
Storage media) in.(one or more) processor can implement necessary task.
Specific structure and function details disclosed herein are only representative, and are for describing the present invention show
The purpose of example property embodiment.But the present invention can be implemented by many alternative forms, and be not interpreted as
It is limited only by the embodiments set forth herein.
Although it should be understood that may have been used term " first ", " second " etc. herein to describe each unit,
But these units should not be limited by these terms.The use of these items is only for by a unit and another unit
It distinguishes.For example, without departing substantially from the range of exemplary embodiment, it is single that first unit can be referred to as second
Member, and similarly second unit can be referred to as first unit.Term "and/or" used herein above include one of them or
The arbitrary and all combination of more listed associated items.
It should be understood that when a unit is referred to as " connecting " or when " coupled " to another unit, can directly connect
Another unit is connect or be coupled to, or may exist temporary location.In contrast, when a unit is referred to as " directly connecting
Connect " or " direct-coupling " arrive another unit when, then be not present temporary location.It should explain in a comparable manner and be used to retouch
State the relationship between unit other words (such as " between being in ... " compared to " between being directly in ... ", " and with ... it is adjacent
Closely " compared to " with ... be directly adjacent to " etc.).
Term used herein above is not intended to limit exemplary embodiment just for the sake of description specific embodiment.Unless
Context clearly refers else, otherwise singulative used herein above "one", " one " also attempt to include plural number.Also answer
When understanding, term " include " and or " include " used herein above provide stated feature, integer, step, operation,
The presence of unit and/or component, and do not preclude the presence or addition of other one or more features, integer, step, operation, unit,
Component and/or a combination thereof.
It should further be mentioned that in some replace implementations, the function action being previously mentioned can be according to different from attached
The sequence indicated in figure occurs.For example, involved function action is depended on, the two width figures shown in succession actually may be used
Substantially simultaneously to execute or can execute in a reverse order sometimes.
Present invention is further described in detail below in conjunction with the accompanying drawings.
Fig. 1 is shown according to one aspect of the invention for obtaining data cached method flow schematic diagram.
Here, caching acquisition device 1 is for example in computer equipment.
In step S101, request of data of the acquisition device 1 according to application server is cached, from data signature buffer service
Data signature corresponding with the request of data is obtained in device.Specifically, when application server initiates request of data, caching
Acquisition device 1 obtains and request for example according to cache key (key) from the data signature cache server of cache server
The corresponding data signature of data.For example, when application server sends out the request of data for obtaining a certain data, obtained to improve
The speed of data, caching acquisition device 1 can first attempt to obtain the request of data in local disk it is corresponding data cached, if
Want that obtaining the data cached of local disk storage needs first to obtain the data cached data signature, to according to the data label
Name, obtains corresponding data cached from the local disk.Therefore cache server can be divided into two parts:Data label
Name cache server and data content caching server.When application server sends out request of data, caching acquisition device 1 first turns
Enter and rapidly obtain data signature corresponding with the data of request in data signature cache server, then certainly according to data signature
It is obtained in local disk corresponding with data signature data cached.
Here, the data signature is for example determined by Hash (hash) algorithm.
Here, caching acquisition device 1 obtains data signature, phase from data signature cache server according to cache key
Similarly, which obtains corresponding data, such as from data also according to cache key from other following devices
Hold obtained in cache server it is data cached, obtain from local disk data cached, details are not described herein, and passes through reference
Mode is incorporated herein.
Further, according to the acquisition data signature corresponding with the request of data from data signature cache server
Specific acquisition situation, be divided into following three steps:
In step s 102, if getting the data signature from the data signature cache server, caching obtains
It is obtained in 1 self-corresponding local disk of device corresponding with the data signature data cached.Specifically, in step S102
In, if getting the data signature corresponding with the request of data from the data signature cache server, that is, data
There is data signature corresponding with the request of data in signature cache server, and can cache and take from the data signature
When obtaining the data signature in business device, caching acquisition device 1 is transferred in local disk, according to the information of the data signature at this
Lookup is compared in local disk, it is data cached to obtain this.
Preferably, step S102 further includes that sub-step S1021 (not shown), S1022 (not shown) and S1023 (do not show
Go out).
In sub-step S1021, if got from the local disk it is described data cached, caching acquisition device 1 test
Demonstrate,prove the data cached validity.Specifically, in sub-step S1021, if caching acquisition device 1 is from the local disk
It gets described data cached, that is, after lookup is compared with the data in local disk in data signature, find this
Exist corresponding with data signature data cached in local disk, and local disk be in normal operating conditions, and caching, which obtains, to be filled
When setting 1 can obtain described corresponding with data signature data cached from local disk, acquisition it is described it is data cached after need
Further to verify the data cached validity got.For example, if previous executed in local disk obtains operation
Afterwards, data variation has occurred in truthful data source in rear end, but local cache does not timely update, then caches acquisition device 1 at this
Ground obtain it is data cached there may be invalid problems, therefore need to verify obtained in local disk it is data cached effective
Property.
Those skilled in the art will be understood that above-mentioned obtains data cached mode in local disk according to data signature
It is only for example, other are existing or what is be likely to occur from now on obtains data cached mode in local disk according to data signature
It is such as applicable to the present invention, should also be included within the scope of the present invention, and is incorporated herein by reference herein.
Here, the mode of the verification data cached validity includes following at least any one:
1) it compares the data cached corresponding data signature and whether the data signature in the local disk is consistent;Tool
Body, i.e., by from the data signature obtained in data signature cache server and the data signature in the local disk into
Row compares, if comparison result is consistent, passes through, does not otherwise pass through;
2) comparing the last modification time of the data cached corresponding local disk file and the difference of current time is
It is no within the term of validity;Specifically, compare the last modification time of the data cached corresponding local disk file with it is current
Before the deadline whether the difference of time, described data cached effective if before the deadline if the difference, if the difference is more than to have
The effect phase is then described data cached invalid.
Those skilled in the art will be understood that the mode of the validity of above-mentioned verify data is only for example, he is existing or modern
The mode of the validity for the verify data being likely to occur afterwards is such as applicable to the present invention, should also be included in the scope of the present invention with
It is interior, and be incorporated herein by reference herein.
Further, according in sub-step S1021 to the data cached validation verification as a result, executing sub-step respectively
Rapid S1022 or S1023.
In sub-step S1022, if described data cached effective, caching acquisition device 1 directly returns described data cached.
Specifically, in sub-step S1022, caching acquisition device 1 will it is described it is data cached according to above-mentioned verification mode verification after, if
It is described it is data cached effectively, by local disk obtain it is described it is data cached be back to the application server, obtained described in completion
Take data cached process.In sub-step S1023, if described data cached invalid, from the data content cache server
Middle acquisition is described data cached.Specifically, in sub-step S1023, if the caching number acquired in the local disk
According to invalid, it is transferred to described data cached to obtain in the data content cache server.
Here, when getting data signature corresponding with request of data from data signature cache server, caching obtains
Device 1 is transferred to local disk and obtains the corresponding with the data signature data cached of local disk storage, if from local disk
Get it is described data cached and verified, it is described it is data cached effectively, then by acquisition it is data cached be back to using clothes
Business device, completes data cached acquisition process.
Preferably, step S102 further includes sub-step S1024 (not shown).In sub-step S1024, if not from described
Get described data cached in local disk, caching acquisition device 1 obtains described slow from the data content cache server
Deposit data.Specifically, in sub-step S1024, if not got from the local disk described data cached, that is, when this
When being not present corresponding with the data signature described data cached in local disk;Or when local disk failure, such as
Local side temporarily crashes, thus cannot normally execute acquisition operation, does not know to whether there is and institute in the local disk at this time
State data signature it is corresponding data cached when, caching acquisition device 1 be transferred in content caching server obtain with request of data pair
That answers is data cached.
Here, the operation of above-mentioned steps is described in detail with an embodiment:
For example, application server sends out the request for accessing a website, being obtained from the data signature cache server should
The data signature of website data;If success gets the data signature from the data signature cache server, it is transferred to local
Disk checks in local disk that whether be stored with the website data corresponding with the data signature is buffered in this earth magnetism to obtain
The data of the website of disk;1) it when getting described data cached from the local disk, needs to verify described data cached
Validity.When it is described it is data cached effectively, such as when the data signature it is consistent with the signature in local disk file and
When the last modification time of local disk and the difference of current time are in the scheduled term of validity, i.e., the website data does not become
Change, directly returns to the website data described data cached, display request accesses, obtain data cached success, ending request;Work as institute
It is data cached invalid to state, i.e., the data signature and the signature in local disk file that ought be got are inconsistent, or local
The last modification time of disk and the difference of current time be not in the scheduled term of validity or the data signature and this earth magnetism
The difference of inconsistent and local disk the last modification time of signature and current time in disk file is not scheduled effective
When in the phase, be transferred in data content caching server obtain it is data cached.2) it is had not been obtained to described slow when from the local disk
When deposit data, it is transferred to data cached to obtain in data content caching server.
Here, data signature is obtained from data signature cache server, it is data cached from local disk acquisition after success,
The content in local disk if content effectively then be used directly is avoided initiating to ask to content caching server, be alleviated interior
Hold the pressure of cache server.
In step s 103, if the data signature has not been obtained from the data signature cache server, caching obtains
The judgement of device 1 is taken to obtain data cached failure.Specifically, in step s 103, if from the data signature cache server
Do not get the data signature, that is, when signature cache server does not work as machine, it can realize the operation of acquisition, but institute
It states there is no when data signature corresponding with the request of data in data signature cache server, caching acquisition device 1 is direct
Judgement obtains data cached failure, terminates and obtains data cached process.
In step S104, if the data signature cache server delay machine, cache in 1 self-corresponding data of acquisition device
It is corresponding with request of data data cached to hold acquisition in cache server.Specifically, in step S104, if the data signature
Cache server delay machine, i.e., when data cache server failure, such as temporarily crash or the temporary deadlock of database,
When thus cannot normally execute acquisition operation, do not know to whether there is and the number in the data signature cache server at this time
According to corresponding data signature is asked, in such cases, caching acquisition device 1 is transferred to obtain in content caching server and be asked with data
Ask corresponding data cached.
Preferably, obtained from the data content cache server it is described it is data cached further include that step S105 (does not show
Go out), step S106 (not shown) and step S107 (not shown).
Wherein, in step S105, if getting described data cached, caching from the data content cache server
Acquisition device 1 is arranged described data cached in the local disk.Specifically, in step S105, if from the data
Hold cache server in get it is described data cached, that is, if in the data content cache server exist and the data
Ask it is corresponding data cached, and can be got from the content caching server it is described data cached, then caching obtain
Take device 1 be transferred in local disk reset or update it is described data cached.
For example, application server sends out the request for accessing a website, caching acquisition device 1 is cached from the data signature and is taken
The data signature of the website data is obtained in business device;If data signature cache server delay machine, or cache and take from data signature
In business device get data signature but not from getting cache contents in local disk or obtained from local disk
Cache contents are still verified invalid, then are transferred to obtain the data cached of the website in data content caching server, if from
Got in the data content cache server it is described data cached, caching acquisition device 1 be arranged in the local disk
Local cache data makes local cache data update to be synchronized with the data in data content cache server.
Here, the above-mentioned local cache data that is arranged in the local disk includes following at least any one:
1) described data cached and its corresponding data signature is written in the local disk file of the local disk;
2) filemodetime of the local disk file is updated to current time stamp.
Specifically, due to data cached possible wrong in local disk, for example, in sub-step S1024, caching obtains
Device 1 is taken not got from the local disk described data cached, and in step S105, acquisition device 1 is cached from institute
It states and gets described data cached in data content cache server, at this moment can be understood as data cached in the local disk
It is wrong, it needs to be configured.Alternatively, in step S104, the data signature cache server delay machine, and in step S105
In, caching acquisition device 1 got from the data content cache server it is described data cached, at this moment can also be to this
The data cached of local disk is configured.For example, caching acquisition device 1 delays acquired from data content cache server
Deposit data and its corresponding data signature are written in the local disk file of the local disk;Further, which obtains dress
Current time stamp can also be updated to by the filemodetime of the local disk file by setting 1.
Those skilled in the art will be understood that the data cached mode of above-mentioned setting is only for example, he is existing or from now on may be used
The data cached mode that is arranged that can occur such as is applicable to the present invention, should also be included within the scope of the present invention, and
This is incorporated herein by reference.
In step s 106, if not obtaining described data cached, caching acquisition from the data content cache server
The judgement of device 1 obtains data cached failure.Specifically, in step s 106, if not from the data content cache server
Obtain described data cached, the caching not corresponding with the request of data in the even described data content cache server
Data, the caching judgement of acquisition device 1 obtain data cached failure, terminate the data cached process of the acquisition, and to application service
Device returns to the notice for the data that the request has not been obtained.
In step s 107, if the data content cache server delay machine, acquisition device 1 is cached from the local disk
Middle acquisition is described data cached.Specifically, in step s 107, if the data content cache server delay machine, that is, when described
Data content cache server breaks down, such as temporarily crash or the temporary deadlock of database, thus cannot normally execute and obtain
When extract operation, do not know to whether there is caching number corresponding with the request of data in the data content cache server at this time
According to, in such cases, caching acquisition device 1 be transferred in local disk obtain it is described data cached.
Preferably, step S107 further includes sub-step S1071 (not shown) and sub-step S1072 (not shown).
In sub-step S1071, if being got from the local disk described data cached, caching acquisition device 1 is straight
It is described data cached to connect return.Specifically, in sub-step S1071, if getting the caching number from the local disk
According to, that is, it is corresponding with data signature data cached when existing in local disk, and can be obtained from local disk it is described and
When data signature is corresponding data cached, caching acquisition device 1 directly described data cached is back to what local disk obtained
Whether the application server completes the data cached process of the acquisition, effective without verifying the data information.
For example, application server sends out the request for accessing a website, being obtained from the data signature cache server should
The data signature of website data;If data signature cache server delay machine, or got from data signature cache server
Data signature but not from got in local disk it is data cached or get from local disk it is data cached still
It is verified invalid, then it is transferred to obtain the data cached of the website in data content caching server, if data content caching clothes
Business device delay machine, then it is data cached in local disk to obtain to be transferred to local disk.It is asked if being got from local disk
Website it is data cached, then be not necessarily to verify it is described it is data cached whether effectively, the data cached of the website is directly back to institute
State application server.
Here, when data content cache server delay machine, will not directly judge to obtain cache failure, but can be from local
A mirror image data to come in handy is obtained in disk to demand data side, judgement acquisition is slow when avoiding the case where encountering delay machine
It deposits failure and holds really data source initiation request of data immediately rearward and back-end system is caused to collapse.
In sub-step S1072, if described data cached, caching acquisition device 1 is not got from the local disk
Judgement obtains data cached failure.Specifically, in sub-step S1072, if not got from the local disk described slow
Deposit data, that is, when being not present corresponding with the data signature described data cached in local disk;Or work as local disk
It breaks down, such as local side temporarily crashes, thus cannot normally execute acquisition operation, do not know in the local disk at this time
With the presence or absence of it is corresponding with the data signature data cached when, the caching judgement of acquisition device 1 obtains data cached failure, terminates
Obtain data cached process.
Preferably, it further includes following either step to obtain data cached method:Step S108 (not shown), step S109
(not shown).
Wherein, in step S108, caching number is arranged in caching acquisition device 1 in the data content cache server
According to;In step S109, data signature is arranged in the data signature cache server in caching acquisition device 1.Specifically, exist
In step S108, need be arranged data content cache server it is data cached when, caching acquisition device 1 in the data
It is arranged in appearance cache server data cached;In step S109, in the data for needing to be arranged in data signature cache server
When signature, data signature is arranged in the data signature cache server in caching acquisition device 1.
Preferably, it further includes following either step to obtain data cached method:Step S110 (not shown), step S111
(not shown).
Wherein, in step s 110, caching acquisition device 1 deletes caching number in the data content cache server
According to;In step S111, caching acquisition device 1 deletes data signature in the data signature cache server.Specifically, exist
In step S110, need deletion of data content cache server it is data cached when, caching acquisition device 1 in the data
It is deleted in appearance cache server described data cached;In step S111, in needing deletion data signature cache server
When data signature, caching acquisition device 1 deletes the data signature in the data signature cache server.
Fig. 2 shows the overall flow schematic diagrams for obtaining data cached method, specific real with some below in conjunction with Fig. 2
The step of applying the example method data cached to above-mentioned acquisition is described in detail.
Application server initiates request of data, and it is corresponding with the request of data to obtain to be transferred to data signature cache server
Data signature.
1) for example, when data signature cache server delay machine is without response, caching acquisition device 1 is transferred to data content caching
Obtained in server it is corresponding data cached, if data content cache server is also at delay machine state just at this time, temporarily
When obtain less than data cached, it is data cached in the local disk to obtain to be transferred to local disk, if having got local
It is data cached in disk, then data cached validity need not be verified, data cached arriving in local disk is directly returned
The application server obtains data cached success, terminates.
Here, in data signature cache server and data content caching server delay machine simultaneously, will not directly judge
Data cached failure is obtained, but temporarily obtains a mirror image data from local disk directly to application server, avoids sentencing
Surely obtain and truthful data source held after data cached failure to initiate request immediately rearward, will not cause back-end data source collapse and
The snowslide of system.
2) for example, when getting data signature from data signature cache server, local disk is transferred to obtain this
It is data cached in local disk, if getting corresponding with the data signature data cached, and experience from local disk
Card, it is described data cached invalid, then it is transferred to data cached to obtain in data content caching server;If from local disk
When having not been obtained corresponding with the data signature data cached, to be also transferred in data content caching server to obtain caching
Data.If data content cache server is just at delay machine state at this time, temporarily obtains less than data cached, continue to turn
It is data cached in local disk to obtain to enter local disk, if having got data cached in local disk, is not required to
Data cached validity is verified, is directly returned data cached to the application server, acquisition caching in local disk
Data success, terminates.
Here, data signature can be obtained, but obtained less than data cached or acquisition less than effective in local disk
It is data cached, and when data content cache server delay machine, will not directly judge to obtain data cached failure, but temporarily
A mirror image data is obtained from local disk to application server, is held immediately rearward after avoiding judgement from obtaining data cached failure
Request is initiated in truthful data source, will not cause the collapse of back-end data source and the snowslide of system.
3) for example, when getting data signature from data signature cache server, local disk is transferred to obtain this
Local disk cache contents, if getting corresponding with the data signature data cached and verified, institute from local disk
State it is data cached effectively, then directly by from local disk get it is data cached be back in application server, obtain caching
Data success, terminates.
Here, in the case where that can obtain data signature from data signature cache server, success is obtained from local disk
Cache contents are taken, local disk obtains data cached if content effectively then be used directly, and avoids caching clothes to data content
Business device initiates request, alleviates the pressure of content caching server.
4) it for example, when data signature cache server delay machine is without response, is transferred in data content caching server and obtains
It is corresponding data cached;Alternatively, when getting data signature from data signature cache server, local disk is transferred to obtain
Take it is data cached in local disk, if got from local disk it is corresponding with the data signature data cached, and
It is verified, it is described data cached invalid, then it is equally transferred to data cached to obtain in data content caching server;If from this
When having not been obtained corresponding with the data signature data cached in local disk, to be also transferred in data content caching server with
It obtains data cached.If can be got from data content cache server data cached, it is back to data cached
Application server, and be arranged data cached in local disk file;If failing to obtain from data content cache server
To data cached, then judge to obtain data cached failure, terminate.
5) for example, when data signature has not been obtained from data signature cache server, directly judgement obtains caching number
According to failure, terminate.
Fig. 3 show according to a further aspect of the present invention for obtaining data cached schematic device.
It includes the first acquisition device 301, the second acquisition device 302, the first decision maker 303, third to cache acquisition device 1
Acquisition device 304.
Here, caching acquisition device 1 is for example in computer equipment.
Wherein, the first acquisition device 301 is obtained according to the request of data of application server from data signature cache server
Take data signature corresponding with the request of data.Specifically, when application server initiates request of data, first obtains dress
301 are set for example according to cache key (key), and the data with request are obtained from the data signature cache server of cache server
Corresponding data signature.For example, when application server sends out the request of data for obtaining a certain data, in order to improve acquisition data
Speed, can first attempt to obtain that the request of data is corresponding data cached, and obtaining local disk deposits if wanting in local disk
The data cached of storage needs first to obtain the data cached data signature, thus according to the data signature, from the local disk
It obtains corresponding data cached.Therefore cache server can be divided into two parts:Data signature cache server sum number
According to content caching server.When application server sends out request of data, the first acquisition device 301 is first transferred to data signature cache
Data signature corresponding with the data of request is rapidly obtained in server, is then obtained from local disk according to data signature
It is corresponding with data signature data cached.
Here, the data signature is for example determined by Hash (hash) algorithm.
Here, caching acquisition device 1 obtains data signature, phase from data signature cache server according to cache key
Similarly, which obtains corresponding data, such as from data also according to cache key from other following devices
Hold obtained in cache server it is data cached, obtain from local disk data cached, details are not described herein, and passes through reference
Mode is incorporated herein.
If getting the data signature from the data signature cache server, the second acquisition device 302 is certainly corresponding
Local disk in obtain it is corresponding with the data signature data cached.Specifically, it is taken if being cached from the data signature
The data signature corresponding with the request of data is got in business device, that is, is existed and institute in data signature cache server
When stating the corresponding data signature of request of data, and the data signature can be obtained from the data signature cache server,
Second acquisition device 302 is transferred in local disk, and lookup is compared in local disk according to the information of the data signature,
It is data cached to obtain this.
Preferably, the second acquisition device 302 further include 3021 (not shown) of authentication unit, the first returning unit 3022 (not
Show) and 3023 (not shown) of the 4th acquiring unit.
If being got from the local disk described data cached, authentication unit 3021, which is verified, described data cached to be had
Effect property.Specifically, if the second acquisition device 302 got from the local disk it is described data cached, that is, by by data
After lookup is compared with the data in local disk in signature, find there is caching corresponding with data signature in local disk
Data, and local disk is in normal operating conditions, and the second acquisition device 302 can obtain described and number from local disk
According to sign it is corresponding data cached when, obtain it is described it is data cached after need further verify get it is described data cached
Validity.If for example, previous, data variation has occurred in rear end truthful data source after local disk executes and obtains operation,
But local cache does not timely update, then the second acquisition device 302 local disk obtain data cached there may be nothings
The problem of effect, therefore the data cached validity obtained in local disk need to be verified.
Those skilled in the art will be understood that above-mentioned obtains data cached mode in local disk according to data signature
It is only for example, other are existing or what is be likely to occur from now on obtains data cached mode in local disk according to data signature
It is such as applicable to the present invention, should also be included within the scope of the present invention, and is incorporated herein by reference herein.
Here, the mode of the verification data cached validity includes following at least any one:
1) it compares the data cached corresponding data signature and whether the data signature in the local disk is consistent;Tool
Body, i.e., by from the data signature obtained in data signature cache server and the data signature in the local disk into
Row compares, if comparison result is consistent, passes through, does not otherwise pass through;
2) comparing the last modification time of the data cached corresponding local disk file and the difference of current time is
It is no within the term of validity;Specifically, compare the last modification time of the data cached corresponding local disk file with it is current
Before the deadline whether the difference of time, described data cached effective if before the deadline if the difference, if the difference is more than to have
The effect phase is then described data cached invalid.
Those skilled in the art will be understood that the mode of the validity of above-mentioned verify data is only for example, he is existing or modern
The mode of the validity for the verify data being likely to occur afterwards is such as applicable to the present invention, should also be included in the scope of the present invention with
It is interior, and be incorporated herein by reference herein.
Further, according to authentication unit 3021 to the data cached validation verification as a result, being returned respectively by first
Receipt member 3022 or the 4th acquiring unit 3023 execute further operating.
If described data cached effective, the first returning unit 3022 directly returns described data cached.Specifically, verification is single
Member 3021 will it is described it is data cached verified according to above-mentioned verification mode after, if described data cached effective, the first returning unit
3022 by local disk obtain it is described it is data cached be back to the application server, complete described to obtain data cached mistake
Journey.If described data cached invalid, the 4th acquiring unit 3023 obtains the caching from the data content cache server
Data.Specifically, if described data cached invalid acquired in the local disk, the 4th acquiring unit 3023 is transferred to described
It is described data cached to obtain in data content cache server.
Here, when getting data signature corresponding with request of data from data signature cache server, it is transferred to local
Disk obtains the corresponding with the data signature data cached of local disk storage, if getting the caching from local disk
Data, and it is verified, it is described data cached effective, then the data cached of acquisition is back to application server, completes caching
The acquisition process of data.
Preferably, the second acquisition device 302 further includes 3024 (not shown) of the 5th acquiring unit.If not from described earth magnetism
Get described data cached in disk, the 5th acquiring unit 3024 obtains the caching from the data content cache server
Data.Specifically, if not got from the local disk described data cached, that is, when in local disk be not present and institute
State data signature it is corresponding described data cached when;Or work as local disk and break down, such as local side temporarily crashes, thus
Acquisition operation cannot be normally executed, does not know to whether there is caching corresponding with the data signature in the local disk at this time
When data, it is corresponding with request of data data cached that the 5th acquiring unit 3024 is transferred to acquisition in content caching server.
Here, above-mentioned apparatus is described in detail with an embodiment:
For example, application server sends out the request for accessing a website, delayed from the data signature by the first acquisition device 301
Deposit the data signature that the website data is obtained in server;If success gets the number from the data signature cache server
According to signature, local disk is transferred to by the second acquisition device 302 and checks in local disk whether be stored with the website data to obtain
The data of the website for being buffered in local disk corresponding with the data signature;1) described when being got from the local disk
When data cached, need to verify the data cached validity by authentication unit.When it is described it is data cached effectively, as ought as described in
Data signature and the sign consistent and last modification time of local disk and the difference of current time in local disk file
When in the scheduled term of validity, i.e., the website data does not change, and is directly returned by the first returning unit 3022 described slow
Deposit data, the website data that display request accesses, obtains data cached success, ending request;When described data cached invalid, i.e.,
When the data signature got and the signature in local disk file are inconsistent or the last modification time of local disk
With current time difference is not in the scheduled term of validity or the data signature differs with the signature in local disk file
It causes and when the last modification time of local disk and the difference of current time be not in the scheduled term of validity, is obtained by the 4th single
Member 3023 be transferred in data content caching server obtain it is data cached.2) it is had not been obtained to the caching when from the local disk
When data, it is transferred in data content caching server by the 5th acquiring unit 3024 data cached to obtain.
Here, data signature is obtained from data signature cache server, it is data cached from local disk acquisition after success,
The content in local disk if content effectively then be used directly is avoided initiating to ask to content caching server, be alleviated interior
Hold the pressure of cache server.
If the data signature has not been obtained from the data signature cache server, the judgement of the first decision maker 303
Obtain data cached failure.Specifically, if not getting the data signature from the data signature cache server,
That is, when signature cache server does not work as machine, the operation of acquisition can be realized, but in the data signature cache server not
When in the presence of data signature corresponding with the request of data, the first decision maker 303 directly judges to obtain data cached failure, eventually
Only obtain data cached process.
If the data signature cache server delay machine, 304 self-corresponding data content buffer service of third acquisition device
It is obtained in device corresponding with request of data data cached.Specifically, if the data signature cache server delay machine, i.e., when described
Data cache server breaks down, such as temporarily crash or the temporary deadlock of database, thus cannot normally execute acquisition behaviour
When making, do not know to whether there is data signature corresponding with the request of data in the data signature cache server at this time,
In such cases, it is corresponding with request of data data cached to be transferred to acquisition in content caching server for third acquisition device 304.
Preferably, obtained from the data content cache server it is described it is data cached further include the first setting device
305 (not shown), 306 (not shown) of the second decision maker and 307 (not shown) of the 6th acquisition device.
Wherein, if getting described data cached, slow first setting device 305 from the data content cache server
It is arranged in the local disk described data cached.Specifically, if getting institute from the data content cache server
State data cached, that is, if in the data content cache server exist it is corresponding with the request of data data cached, and
Can be got from the content caching server it is described data cached, then by first setting device 305 be transferred to local disk
In reset or update described data cached.
For example, application server sends out the request for accessing a website, the first acquisition device 301 is cached from the data signature
The data signature of the website data is obtained in server;If data signature cache server delay machine, or cached from data signature
Get data signature in server but not from getting cache contents in local disk or obtained from local disk
Still verified invalid to cache contents, then third acquisition device 304 obtains the website from data content cache server
It is data cached, if got from the data content cache server it is described data cached, first setting device 305 described
Local cache data is set in local disk, makes local cache data update with same with the data in data content cache server
Step.
Here, it is above-mentioned by first setting device 305 be arranged in the local disk local cache data include with down toward
It is any one of few:
1) described data cached and its corresponding data signature is written in the local disk file of the local disk;
2) filemodetime of the local disk file is updated to current time stamp.
Specifically, due to data cached possible wrong in local disk, for example, when the 5th acquiring unit is not from described
Got in local disk it is described data cached, and first setting device 305 can be obtained from the data content cache server
When getting described data cached, it can be understood as it is data cached wrong in the local disk, it needs to be configured.Alternatively,
When the data signature cache server delay machine, and got from the data content cache server described data cached
When, the data cached of the local disk can also be configured by the first setting device 305.For example, will delay from data content
Data cached and its corresponding data signature acquired in server is deposited to be written in the local disk file of the local disk;Into
One step, the filemodetime of the local disk file can also be updated to current time stamp.
Those skilled in the art will be understood that the data cached mode of above-mentioned setting is only for example, he is existing or from now on may be used
The data cached mode that is arranged that can occur such as is applicable to the present invention, should also be included within the scope of the present invention, and
This is incorporated herein by reference.
If do not obtained from the data content cache server it is described data cached, the second decision maker 306 judgement obtain
Take data cached failure.If do not obtained from the data content cache server specifically it is described data cached, it is even described
It is not corresponding with the request of data described data cached in data content cache server, the judgement of the second decision maker 306
Data cached failure is obtained, terminates the data cached process of the acquisition, and the request has not been obtained to application server return
Data notice.
If the data content cache server delay machine, described in the 6th acquisition device 307 is obtained from the local disk
It is data cached.Specifically, if the data content cache server delay machine, that is, when the data content cache server occurs
Failure, such as temporarily crash or the temporary deadlock of database, thus when cannot normally execute acquisition operation, do not know at this time described
With the presence or absence of corresponding with the request of data data cached in data content cache server, in such cases, obtained by the 6th
Device 307 is taken to be obtained from local disk described data cached.
Preferably, the 6th acquisition device 307 further includes 3071 (not shown) of the second returning unit and third judging unit
3072 (not shown).
If being got from the local disk described data cached, the second returning unit 3071 directly returns to the caching
Data.Specifically, if being got from the local disk described data cached, that is, when in local disk exist and data label
Name is corresponding data cached, and it is corresponding with data signature data cached described in capable of being obtained from local disk when, second
Returning unit directly by local disk obtain it is described it is data cached be back to the application server, complete acquisitions and cache
Whether the process of data is effective without verifying the data information.
For example, application server sends out the request for accessing a website, the first acquisition device 301 is cached from the data signature
The data signature of the website data is obtained in server;If data signature cache server delay machine, or cached from data signature
Get data signature in server but not from getting data cached in local disk or obtain from local disk
To data cached but verified invalid, then the slow of the website is obtained from data content cache server by third acquisition device
Deposit data is obtained from local disk in local disk if data content cache server delay machine by the 6th acquisition device 307
It is data cached.If getting the data cached of asked website from local disk, without verify it is described it is data cached whether
Effectively, the data cached of the website is directly back to the application server.
Here, when data content cache server delay machine, will not directly judge to obtain cache failure, but can be from local
A mirror image data to come in handy is obtained in disk to demand data side, judgement acquisition is slow when avoiding the case where encountering delay machine
It deposits failure and holds really data source initiation request of data immediately rearward and back-end system is caused to collapse.
If described data cached, the judgement acquisition caching number of third decision maker 3072 is not got from the local disk
According to failure.Specifically, if not got from the local disk described data cached, that is, when in local disk there is no with
When the data signature is corresponding described data cached;Or work as local disk and break down, such as local side temporarily crashes, because
And acquisition operation cannot be normally executed, it does not know at this time in the local disk with the presence or absence of corresponding with the data signature slow
When deposit data, the judgement of third judging unit 3072 obtains data cached failure, terminates and obtains data cached process.
Preferably, caching acquisition device further includes following any device:Second 308 (not shown) of setting device, third are set
Set 309 (not shown) of device.
Second setting device 308 is arranged data cached in the data content cache server;Device 309 is arranged in third
Data signature is set in the data signature cache server.Specifically, it is needing that data content cache server is arranged
When data cached, the second setting device 308 is arranged data cached in the data content cache server;It is needing that number is arranged
When according to data signature in signature cache server, third setting device 309 is arranged in the data signature cache server
Data signature.
Preferably, caching acquisition device further includes following any device:First 310 (not shown) of deletion device, second are deleted
Except 311 (not shown) of device.
First deletion device 310 is deleted data cached in the data content cache server;Second deletes device 311
Data signature is deleted in the data signature cache server.Specifically, deletion of data content cache server is being needed
When data cached, the first deletion device 310 is deleted described data cached in the data content cache server;It is needing to delete
When except data signature in data signature cache server, the second acquisition device 311 is in the data signature cache server
Delete the data signature.
It is described in detail below with some specific embodiments device data cached to above-mentioned acquisition.
Application server initiates request of data, and the first acquisition device 301 is obtained and is somebody's turn to do from data signature cache server
The corresponding data signature of request of data.
1) for example, when data signature cache server delay machine is without response, third acquisition device 304 is cached from data content
Obtained in server it is corresponding data cached, if data content cache server is also at delay machine state just at this time, temporarily
When obtain less than data cached, the 6th acquisition device 307 obtained from local disk it is data cached in the local disk, if the
Six acquisition device 307 have successfully got data cached in local disk, then need not verify data cached validity, by
Second returning unit 3071 directly return in local disk it is data cached arrive the application server, obtain it is data cached at
Work(terminates.
Here, in data signature cache server and data content caching server delay machine simultaneously, will not directly judge
Data cached failure is obtained, but temporarily obtains a mirror image data from local disk directly to application server, avoids sentencing
Surely obtain and truthful data source held after data cached failure to initiate request immediately rearward, will not cause back-end data source collapse and
The snowslide of system.
2) for example, when getting data signature from data signature cache server, the second acquisition device 302 is from locally
It is data cached in disk acquisition local disk, if getting caching number corresponding with the data signature from local disk
According to, and verified unit 3021 is verified, and it is described data cached invalid, then data content is transferred to by the 4th acquiring unit 3023 and delayed
Deposit obtained in server it is data cached;If had not been obtained from local disk corresponding with the data signature data cached
When, to be also transferred in data content caching server by the 5th acquiring unit 3024 obtain it is data cached.If at this time in data
Hold cache server just at delay machine state, then temporarily obtains less than data cached, continuation is transferred to by the 6th acquisition device 307
Local disk obtains data cached in local disk, if having got data cached in local disk, need not test
Data cached validity is demonstrate,proved, is directly returned by the second returning unit 3071 data cached to application clothes in local disk
Business device, obtains data cached success, terminates.
Here, data signature can be obtained, but obtained less than data cached or acquisition less than effective in local disk
It is data cached, and when data content cache server delay machine, will not directly judge to obtain data cached failure, but temporarily
A mirror image data is obtained from local disk to application server, is held immediately rearward after avoiding judgement from obtaining data cached failure
Request is initiated in truthful data source, will not cause the collapse of back-end data source and the snowslide of system.
3) for example, when getting data signature from data signature cache server, by the second acquisition device 302 from originally
Local disk obtains local disk cache contents, if the second acquisition device 302 is got and the data signature from local disk
It is corresponding data cached and verified, it is described data cached effective, then it directly will be from this earth magnetism by the first returning unit 3022
It examines and seizes get data cached to be back in application server, obtains data cached success, terminate.
Here, in the case where that can obtain data signature from data signature cache server, success is obtained from local disk
Cache contents are taken, local disk obtains data cached if content effectively then be used directly, and avoids caching clothes to data content
Business device initiates request, alleviates the pressure of content caching server.
4) for example, when data signature cache server delay machine is without response, data content is transferred to by third acquisition device 304
It is obtained in cache server corresponding data cached;Alternatively, when getting data signature from data signature cache server,
Obtained from local disk by the second acquisition device 302 it is data cached in local disk, if got from local disk and institute
It is corresponding data cached to state data signature, and verified unit 3021 is verified, it is described data cached invalid, then it is obtained by the 4th
Unit 3023 is equally transferred to data cached to obtain in data content caching server;If had not been obtained from local disk with
When the data signature is corresponding data cached, by the 5th acquiring unit 3024 to be also transferred in data content caching server with
It obtains data cached.If can be got from data content cache server data cached, it is back to data cached
Application server, and by data cached in the first setting setting local disk file of device 305;If failed out of data
Hold and get data cached in cache server, then data cached failure is obtained by the judgement of the second decision maker 306, terminated.
5) straight by the first decision maker 303 for example, when data signature has not been obtained from data signature cache server
It connects judgement and obtains data cached failure, terminate.
It should be noted that the present invention can be carried out in the assembly of software and/or software and hardware, for example, this hair
Application-specific integrated circuit (ASIC) can be used in bright each device or any other is realized similar to hardware device.In one embodiment
In, software program of the invention can be executed by processor to realize steps described above or function.Similarly, of the invention
Software program (including relevant data structure) can be stored in computer readable recording medium storing program for performing, for example, RAM memory,
Magnetic or optical driver or floppy disc and similar devices.In addition, hardware can be used to realize in some steps or function of the present invention, example
Such as, coordinate to execute the circuit of each step or function as with processor.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, Er Qie
In the case of without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter
From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended power
Profit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent requirements of the claims
Variation includes within the present invention.Any reference signs in the claims should not be construed as limiting the involved claims.This
Outside, it is clear that one word of " comprising " is not excluded for other units or step, and odd number is not excluded for plural number.That is stated in system claims is multiple
Unit or device can also be realized by a unit or device by software or hardware.The first, the second equal words are used for table
Show title, and does not represent any particular order.
Claims (16)
1. a kind of for obtaining data cached method, wherein this method includes:
According to the request of data of application server, obtained from data signature cache server corresponding with the request of data
Data signature;
Wherein, this method further includes:
Obtained if a gets the data signature from the data signature cache server, in self-corresponding local disk with
The data signature is corresponding data cached;
If the data signature has not been obtained from the data signature cache server by b, judgement obtains data cached failure;
If the c data signature cache server delay machines, acquisition and request of data in self-corresponding data content cache server
It is corresponding data cached;
Wherein, it is obtained from the data content cache server and described data cached further includes:
If c1 got from the data content cache server it is described data cached, in the local disk setting described in
It is data cached;
If c2 does not get described data cached, the data cached failure of judgement acquisition from the data content cache server;
If the c3 data content cache server delay machines, obtain described data cached from the local disk.
2. according to the method described in claim 1, wherein, the step a further includes:
If getting described data cached, the verification data cached validity from the local disk;
If described data cached effective, directly return described data cached;
If described data cached invalid, obtained from the data content cache server described data cached.
3. according to the method described in claim 1, wherein, the step a further includes:
If not got from the local disk described data cached, institute is obtained from the data content cache server
It states data cached.
4. according to the method described in claim 2, wherein, the mode of verifying the data cached validity include it is following at least
Any one:
It compares the data cached corresponding data signature and whether the data signature in the local disk is consistent;
Whether the difference of the last modification time and current time that compare the data cached corresponding local disk file is having
Within the effect phase.
5. method according to claim 1 to 4, wherein the step c3 further includes:
If being got from the local disk described data cached, directly return described data cached;
If described data cached, the data cached failure of judgement acquisition is not got from the local disk.
6. method according to claim 1 to 4, wherein local cache number is arranged in the local disk
According to including following at least any one:
Described data cached and its corresponding data signature is written in the local disk file of the local disk;
The filemodetime of the local disk file is updated to current time stamp.
7. according to the method described in claim 1, wherein, this method further includes following at least any one:
It is arranged in the data content cache server data cached;
Data signature is set in the data signature cache server.
8. according to the method described in claim 1, wherein, this method further includes following at least any one:
It is deleted in the data content cache server data cached;
Data signature is deleted in the data signature cache server.
9. a kind of for obtaining data cached caching acquisition device, wherein the caching acquisition device includes:
First acquisition device, for the request of data according to application server, acquisition and institute from data signature cache server
State the corresponding data signature of request of data;
Wherein, which further includes:
Second acquisition device, if for getting the data signature from the data signature cache server, it is self-corresponding
It is obtained in local disk corresponding with the data signature data cached;
First decision maker, if for the data signature to have not been obtained from the data signature cache server, judgement obtains
Take data cached failure;
Third acquisition device, if being used for the data signature cache server delay machine, self-corresponding data content cache server
Middle acquisition is corresponding with request of data data cached;
Wherein, which further includes:
First setting device, if described data cached for being got from the data content cache server, at described
It is arranged in local disk described data cached;
Second decision maker, if not got from the data content cache server for described data cached, judgement obtains
Take data cached failure;
6th acquisition device obtains described slow if being used for the data content cache server delay machine from the local disk
Deposit data.
10. caching acquisition device according to claim 9, wherein second acquisition device further includes:
Authentication unit, if described data cached for being got from the local disk, verification is described data cached effective
Property;
If first returning unit directly returns described data cached for described data cached effective;
If 4th acquiring unit obtains described slow for described data cached invalid from the data content cache server
Deposit data.
11. caching acquisition device according to claim 9, wherein second acquisition device further includes:
5th acquiring unit, if do not got from the local disk for it is described data cached, it is slow from the data content
Deposit obtained in server it is described data cached.
12. caching acquisition device according to claim 10, wherein the mode packet of the verification data cached validity
Include following at least any one:
It compares the data cached corresponding data signature and whether the data signature in the local disk is consistent;
Whether the difference of the last modification time and current time that compare the data cached corresponding local disk file is having
Within the effect phase.
13. the caching acquisition device according to any one of claim 9 to 12, wherein the 6th acquisition device also wraps
It includes:
Second returning unit directly returns to the caching number if described data cached for being got from the local disk
According to;
Third judging unit, if do not got from the local disk for it is described data cached, judgement obtain it is data cached
Failure.
14. the caching acquisition device according to any one of claim 9 to 12, wherein be arranged in the local disk
Local cache data includes following at least any one:
Described data cached and its corresponding data signature is written in the local disk file of the local disk;
The filemodetime of the local disk file is updated to current time stamp.
15. caching acquisition device according to claim 9, wherein the caching acquisition device further includes following at least any
:
Second setting device, it is data cached for being arranged in the data content cache server;
Device is arranged in third, for data signature to be arranged in the data signature cache server.
16. caching acquisition device according to claim 9, wherein the caching acquisition device further includes following at least any
:
First deletes device, data cached for being deleted in the data content cache server;
Second deletes device, for deleting data signature in the data signature cache server.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510689666.7A CN105353976B (en) | 2015-10-21 | 2015-10-21 | It is a kind of to obtain data cached method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510689666.7A CN105353976B (en) | 2015-10-21 | 2015-10-21 | It is a kind of to obtain data cached method and apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105353976A CN105353976A (en) | 2016-02-24 |
CN105353976B true CN105353976B (en) | 2018-09-07 |
Family
ID=55329955
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510689666.7A Active CN105353976B (en) | 2015-10-21 | 2015-10-21 | It is a kind of to obtain data cached method and apparatus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105353976B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107819729B (en) | 2016-09-13 | 2021-06-25 | 腾讯科技(深圳)有限公司 | Data request method and system, access device, storage device and storage medium |
CN106649566B (en) * | 2016-11-14 | 2019-10-15 | 上海艾融软件股份有限公司 | A kind of sequence number generation method and device |
CN109324858B (en) * | 2018-09-20 | 2022-03-22 | 郑州云海信息技术有限公司 | Method and device for acquiring display content in webpage |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102035815A (en) * | 2009-09-29 | 2011-04-27 | 华为技术有限公司 | Data acquisition method, access node and data acquisition system |
CN102196423A (en) * | 2010-03-04 | 2011-09-21 | 腾讯科技(深圳)有限公司 | Safety data transferring method and system |
CN103491171A (en) * | 2013-09-24 | 2014-01-01 | 成都金山数字娱乐科技有限公司 | Network resource asynchronous loading method and device |
CN103546439A (en) * | 2012-07-16 | 2014-01-29 | 中兴通讯股份有限公司 | Processing method and processing device for content requests |
CN103714078A (en) * | 2012-09-29 | 2014-04-09 | 百度在线网络技术(北京)有限公司 | Method, system and device for providing update contents of web pages |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2004032039A1 (en) * | 2002-10-04 | 2004-04-15 | Sony Corporation | Data management system, data management method, virtual memory device, virtual memory control method, reader/writer device, ic module access device, and ic module access control method |
-
2015
- 2015-10-21 CN CN201510689666.7A patent/CN105353976B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102035815A (en) * | 2009-09-29 | 2011-04-27 | 华为技术有限公司 | Data acquisition method, access node and data acquisition system |
CN102196423A (en) * | 2010-03-04 | 2011-09-21 | 腾讯科技(深圳)有限公司 | Safety data transferring method and system |
CN103546439A (en) * | 2012-07-16 | 2014-01-29 | 中兴通讯股份有限公司 | Processing method and processing device for content requests |
CN103714078A (en) * | 2012-09-29 | 2014-04-09 | 百度在线网络技术(北京)有限公司 | Method, system and device for providing update contents of web pages |
CN103491171A (en) * | 2013-09-24 | 2014-01-01 | 成都金山数字娱乐科技有限公司 | Network resource asynchronous loading method and device |
Also Published As
Publication number | Publication date |
---|---|
CN105353976A (en) | 2016-02-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10503720B2 (en) | Providing eventual consistency for multi-shard transactions | |
EP3637346A1 (en) | Relaxed fraud detection for transactions using virtual transaction cards | |
US9372908B2 (en) | Merging an out of synchronization indicator and a change recording indicator in response to a failure in consistency group formation | |
CN104102643B (en) | A kind of method and apparatus for carrying out page snapshot | |
CN108140009A (en) | B-tree key assignments manager of the distributed freedom formula based on RDMA | |
CN105353976B (en) | It is a kind of to obtain data cached method and apparatus | |
CN109101528A (en) | Data processing method, data processing equipment and electronic equipment | |
EP3816912B1 (en) | Blockchain-based transaction processing method and apparatus, and electronic device | |
CN104683329B (en) | A kind of data cache method and system of mobile device client | |
WO2014160656A2 (en) | Recovery processing using torn write detection | |
CN106503001B (en) | Data updating method and device in distributed cluster environment | |
CN105630632A (en) | Virtual machine recovery method and virtual machine management device | |
CN102317913B (en) | A kind of transaction recovery method and transaction recovery device | |
CN105897694B (en) | A kind of client session recognition methods and system | |
CN112256776B (en) | Form repeated submission detection method and device, computer equipment and storage medium | |
CN108874912A (en) | A kind of cancellation method and server | |
CN106557278A (en) | A kind of method of data cached persistence | |
CN109271367A (en) | Distributed file system multinode snapshot rollback method and system | |
CN107798405B (en) | Medical service reservation method, medical service reservation device, storage medium and computer equipment | |
CN108132948B (en) | Method and device for processing crawled webpage | |
US10311033B2 (en) | Alleviation of index hot spots in data sharing environment with remote update and provisional keys | |
CN108271420A (en) | Manage method, file system and the server system of file | |
CN107729178A (en) | A kind of Metadata Service process takes over method and device | |
CN114119129A (en) | High-concurrency second killing system | |
CN104392362B (en) | Information processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |