CN110113385A - Cache Dynamic Configuration, device, computer equipment and storage medium - Google Patents
Cache Dynamic Configuration, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN110113385A CN110113385A CN201910300407.9A CN201910300407A CN110113385A CN 110113385 A CN110113385 A CN 110113385A CN 201910300407 A CN201910300407 A CN 201910300407A CN 110113385 A CN110113385 A CN 110113385A
- Authority
- CN
- China
- Prior art keywords
- read
- data
- caching
- key
- updated
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003860 storage Methods 0.000 title claims abstract description 22
- 238000000034 method Methods 0.000 claims abstract description 34
- 238000001514 detection method Methods 0.000 claims description 10
- 230000005540 biological transmission Effects 0.000 claims description 7
- 230000000903 blocking effect Effects 0.000 claims description 6
- 238000012546 transfer Methods 0.000 claims description 4
- 238000000151 deposition Methods 0.000 claims description 3
- 238000003780 insertion Methods 0.000 claims description 3
- 230000037431 insertion Effects 0.000 claims description 3
- 230000000694 effects Effects 0.000 abstract description 6
- 238000012545 processing Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 230000002411 adverse Effects 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
- H04L67/5682—Policies or rules for updating, deleting or replacing the stored data
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Memory System Of A Hierarchy Structure (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of caching Dynamic Configuration, device, computer equipment and storage mediums, the described method includes: passing through the data read request for the caching key comprising data to be read that first thread interception request side is sent according to preconfigured hold-up interception method;There are the data to be read corresponding with the caching key, and when the failure out of date of corresponding with the caching key data to be read present in the local cache, the data to be read are read from database, the data to be read read are updated in the local cache, while the data to be read read are back to the requesting party.The present invention confirms whether the data to be updated in local cache need to update by way of intercepting all caching key in first thread and judging its whether expired failure, to achieve the effect that dynamic configuration caches.
Description
Technical field
The present invention relates to data processing fields, and in particular to a kind of caching Dynamic Configuration, device, computer equipment and
Storage medium.
Background technique
Currently, the especially rapid development of mobile Internet, network flow is to server with internet high speed development
It impacts increasing, especially to the impact of database, therefore, stores by data to before database, often make at present
It avoids being impacted with caching technology protection database, still, the Cache Framework in current caching technology is not supported to brush automatically
Newly, and since the code of Cache Framework has been write extremely, dynamic configuration dynamically can not be carried out to caching, in this way, may result in
Cache repeatedly same data or can not update in the buffer in time it is new data cached, and then to data cached accurate sum number
According to validity generate adverse effect;Therefore, a kind of cache management scheme that dynamic configuration caching may be implemented is particularly important.
Summary of the invention
The embodiment of the present invention provides a kind of caching Dynamic Configuration, device, computer equipment and storage medium, the present invention
It can be confirmed in local cache by way of intercepting all caching key in first thread and judging its whether expired failure
Whether data to be updated, which need, updates, to achieve the effect that dynamic configuration caches.
A kind of caching Dynamic Configuration, comprising:
According to preconfigured hold-up interception method, sent by first thread interception request side slow comprising data to be read
Deposit the data read request of key;
It detects and whether there is the data to be read corresponding with the caching key in local cache;
When there are the data to be read corresponding with the caching key, detect present in the local cache and
The corresponding data to be read failure whether out of date of the caching key;
When the failure out of date of corresponding with the caching key data to be read present in the local cache,
The data to be read are read from database, the data to be read read are updated in the local cache, together
When the data to be read read are back to the requesting party.
A kind of caching dynamic configuration device, comprising:
Blocking module, for including by what first thread interception request side was sent according to preconfigured hold-up interception method
The data read request of the caching key of data to be read;
First detection module, for detecting in local cache with the presence or absence of corresponding with the caching key described to be read
Data;
Second detection module, for detecting described when there are the data to be read corresponding with the caching key
The data to be read failure whether out of date corresponding with the caching key present in ground caching;
First read module, for corresponding with the caching key described to be read present in the local cache
When data failure out of date, the data to be read are read from database, the data to be read read are updated to
In the local cache, while the data to be read read are back to the requesting party.
A kind of computer equipment, including memory, processor and storage are in the memory and can be in the processing
The computer-readable instruction run on device, the processor realize that above-mentioned caching dynamic is matched when executing the computer-readable instruction
Set method.
A kind of computer readable storage medium, the computer-readable recording medium storage have computer-readable instruction, institute
It states and realizes above-mentioned caching Dynamic Configuration when computer-readable instruction is executed by processor.
Caching Dynamic Configuration, device, computer equipment and storage medium provided by the invention lead in first thread
The data read request that preconfigured hold-up interception method intercepts the caching key comprising data to be read is crossed, and can be according to local
When in caching there is currently with the caching corresponding data to be read of key, if the expired failure of data to be read, from database
The data to be read are read, the data to be read read are updated in the local cache, while will have been read
The data to be read be back to the requesting party;That is, the present invention in first thread by intercepting all caching key simultaneously
Judge that the mode of its whether expired failure confirms whether the data to be updated in local cache need to update, matches to reach dynamic
Set the effect of caching.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by institute in the description to the embodiment of the present invention
Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention
Example, for those of ordinary skill in the art, without creative efforts, can also obtain according to these attached drawings
Obtain other attached drawings.
Fig. 1 is the application environment schematic diagram that Dynamic Configuration is cached in one embodiment of the invention;
Fig. 2 is the flow chart that Dynamic Configuration is cached in one embodiment of the invention;
Fig. 3 is the flow chart that the step S10 of Dynamic Configuration is cached in one embodiment of the invention;
Fig. 4 is the flow chart that Dynamic Configuration is cached in another embodiment of the present invention;
Fig. 5 is the functional block diagram that dynamic configuration device is cached in one embodiment of the invention;
Fig. 6 is the functional block diagram that the blocking module of dynamic configuration device is cached in one embodiment of the invention;
Fig. 7 is the functional block diagram that dynamic configuration device is cached in another embodiment of the present invention;
Fig. 8 is the schematic diagram of computer equipment in one embodiment of the invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair
Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts
Example, shall fall within the protection scope of the present invention.
Caching Dynamic Configuration provided by the invention, can be applicable in the application environment such as Fig. 1, wherein client (meter
Calculate machine equipment) it is communicated by network with server.Wherein, client (computer equipment) is including but not limited to various
People's computer, laptop, smart phone, tablet computer, camera and portable wearable device.Server can be with solely
The server clusters of the either multiple servers compositions of vertical server is realized.
In one embodiment, it as shown in Fig. 2, providing a kind of caching Dynamic Configuration, applies in Fig. 1 in this way
It is illustrated for server, includes the following steps S10-S40:
S10, according to preconfigured hold-up interception method, what it is by the transmission of first thread interception request side includes data to be read
Caching key data read request.
Wherein, the requesting party refers to that the client of the data to be read is read in request;The caching key refers to described
Data to be read having when storage in local cache (local cache includes distributed caching and local multi-level buffer)
The label of uniqueness can accurately transfer corresponding data to be read according to the caching key in local cache.It is described
Hold-up interception method can be the hold-up interception method preset based on Sping Aop, wherein Sping is an Open Framework, Aop (Aspect
Oriented Programming, towards tangent plane programming) it is a hot spot in software development and one in Spring frame
A important content is a kind of derivative pattern of functional expression programming.In the present embodiment, by being preset based on Sping Aop
Hold-up interception method extract different data read requests common feature, and its have the common feature when it is implemented to intercept,
Common feature is the caching key of data to be read.The hold-up interception method being arranged is a reusable module, this, which can be filled, uses module
It with plug-in can be dissolved into service logic at runtime, so that the duplicated code in reduction system, is effectively reduced intermodule
The degree of coupling.
The first thread refers to the thread processing such as responded, refused for the data read request.It can manage
Xie Di, in the present embodiment, the step S10-S30 can be handled by the first thread.
S20 is detected and be whether there is the data to be read corresponding with the caching key in local cache.
That is, since the data being stored in local cache may be removed, before reading, it is necessary first to
Determine whether its corresponding described data to be read is also still retained in local cache with institute according to the caching key, also
It is deleted.
Understandably, in one embodiment, include: after the step S20
In detecting the local cache and when the data to be read corresponding with the caching key are not present, from
The data to be read are read in database, the data to be read read are back to the requesting party, while will
The data to be read read are updated in the local cache.
That is, in detecting the local cache and the data to be read corresponding with the caching key are not present
When, illustrate currently not being stored with the data to be read that can be read in local cache, only be needed according at this time only
One identifies and reads the newest data to be read, and the institute that will have been read from the database by the first thread
It states data to be read and is back to the requesting party, while the data to be read read being updated in the local cache
, that is, by the new data to be read read and the caching key in the local in the local cache
Associated storage in caching, to ensure the validity of data to be read in the local cache.
S30 is detected and is existed in the local cache when there are the data to be read corresponding with the caching key
The data to be read failure whether out of date corresponding with the caching key.
In the present embodiment, exist in detecting the local cache corresponding with the caching key described to be read
After data, whether to need to detect the data to be read corresponding with the caching key present in the local cache
Through expired failure;In expired failure, illustrate the data to be read stored in local cache there may be error, this
When need to enter step in S40, read data to be read, from database directly to ensure the accuracy of data.
S40, the data failure out of date to be read corresponding with the caching key present in the local cache
When, the data to be read are read from database, and the data to be read read are updated in the local cache,
The data to be read read are back to the requesting party simultaneously.
Preferably, may include the unique identification of data to be read in the data read request, therefore, at described
When the data to be read expired failure corresponding with the caching key present in ground caching, illustrate in local cache
There may be errors for the currently stored data to be read, it is therefore desirable to be updated, be needed according at this time only to it
One identifies and reads the newest data to be read from the database by the first thread, while in the local
After deleting in caching with the associated legacy data of the caching key, by the new data to be read read with it is described
Caching key is associated in the local cache and stores again, to ensure the validity of data to be read in the local cache;
The data to be read read are back to the requesting party simultaneously.
The above embodiment of the present invention is intercepted by preconfigured hold-up interception method comprising access of continuing in first thread
According to caching key data read request, and can according in local cache there is currently with the corresponding access of continuing of caching key
According to when, if the expired failure of data to be read, the data to be read are read from database, will read described in continue
Access evidence is updated in the local cache, while the data to be read read are back to the requesting party;That is,
The present invention is confirmed in local cache by way of intercepting all caching key in first thread and judging its whether expired failure
Data to be updated whether need to update, thus achieve the effect that dynamic configuration cache.
In one embodiment, as shown in figure 3, the step S10, namely according to preconfigured hold-up interception method, pass through
The data read request for the caching key comprising data to be read that one thread interception request side is sent, comprising:
S101 receives the data read request for the unique identification comprising data to be read that requesting party sends, and according to pre-
The hold-up interception method first configured detect in the data read request whether include data to be read caching key.
Understandably, in the present embodiment, server is when receiving the data read request of requesting party's transmission, the data
Necessarily (unique identification refers to transfers described continue to the unique identification comprising data to be read from database in read requests
The label with uniqueness for evidence of fetching), according to the unique identification, corresponding access of continuing can be transferred from database
According to, still, due to transferred from local cache data to be read speed will faster, meeting is it is first determined whether can be with
Local cache called data is walked, that is, needing to first determine whether before this for the data read command locally slow
Corresponding data to be read are stored in depositing, if having storage, can preferably transfer described continue from local cache at this time
Access evidence, it will be appreciated that ground, since only after being stored in local cache in advance, which can just have slow
Deposit key, therefore, can by determine in the data read request whether include data to be read caching key, to determine whether
The data to be read have been stored in local cache in advance.
S102 intercepts the caching comprising data to be read by first thread in the caching key comprising data to be read
The data read request of key.
That is, in data read request include data to be read caching key when, illustrate in advance in local cache
In stored the data to be read, at this time can by first thread intercept comprising data to be read caching key data
After read requests, into the step S20, detection stored whether the data to be read still protect in local cache
It stays in the local cache.
S103, when not including the caching key of the data to be read, according to the unique identification from the database
The data to be read are read, and the data to be read of reading are back to the requesting party.
That is, illustrating never when not including the caching key of data to be read in data read request in advance locally slow
The middle storage data to be read are deposited, at this point it is possible to according to the unique identification and by the first thread from the data
The data to be read are read in library to respond the data read request, and the data to be read of reading are back to institute
State requesting party.
In one embodiment, after the step S30, comprising:
The data to be read corresponding with the caching key and not out of date failure present in the local cache
When, the data to be read are read from the local cache according to the caching key, and access of continuing described in having read
According to being back to the requesting party.
That is, data to be read corresponding with the caching key present in the local cache and not out of date
When failure, illustrate that the data to be read stored in local cache are effective at this time, therefore, in order to guarantee the reading data of system
Speed and efficiency, preferential selection reads and the associated data to be read of caching key in the local cache.
In one embodiment, as shown in figure 4, the method also includes:
S50 updates rule configuration timing according to preset timing and executes task, and the timing updates in rule comprising all
The update initial time and renewal time interval of the caching key of data to be updated and each data to be updated;It is each
It periodically include the caching key and renewal time associated with it point of the data to be updated in execution task described in item.
That is, can be determined described in each according to the update initial time updated in rule and renewal time interval
Timing executes the renewal time point of task, therefore, rule configuration timing can be updated according to the timing and executes task, at one
The timing executes the renewal time point of task, can update it is corresponding with the caching key for including in the timing execution task to
More new data, renewal process are specially following steps S60-80.
The update initial time and more is set according to preset rules preferably, can update in rule in the timing
New time interval, the preset rules are to set according to the update initial time of each data to be updated and between renewal time
Every calculated renewal time point, may finally farthest disperse to be arranged on different time points.In this way, can make
The renewal time point of each data to be updated does not generate conflict, and then avoids reducing each timing execution task treatment effeciency
And processing speed.
Understandably, in one embodiment, it can also be updated in rule in timing and directly set each data to be updated
Renewal time point, or the parameters such as the start time point of each data to be updated, end time point, update times are set, only
Want may finally finally to obtain the renewal time point of the data to be updated according to above-mentioned parameter.
Each timing is executed task and inserted by S60 according to the renewal time point for including in the timing execution task
Enter to execute in task queue.
That is, the execution task queue according to the significance level of pending task, urgency level and execute the time (such as
The renewal time point) etc. arranged;For example, preferentially according to execute the time it is ranked up, but when being executed between belong to
In same time point to be processed or same period to be processed, and when it needs to be handled by same thread, then at this
In same time point to be processed or period, it is ranked up according to the significance level and urgency level of pending task.
S70, in the renewal time point, when being transferred from the execution task queue with the update by the second thread
Between put the associated timing and execute task.
Understandably, it is described execute task queue in all pending tasks, can by one or more of threads into
Row processing.It in the present invention, can if the pending task includes that above-mentioned data read request and the timing execute task
To handle the data read request by the same thread, two different threads can also be given and carried out respectively
Processing is to promote treatment effeciency, for example, in the present embodiment, the data read request is handled by first thread,
And the timing is executed into task and is handled by being different from the second thread of the first thread.
In this step, it when current point in time is the renewal time point, represents and needs for the renewal time point pair
The data to be updated are updated, at this point, first by the second thread transferred from the execution task queue with it is described more
It at the new time point associated caching key, enters back into the step S80 and is read according to the caching key from the database
Take the data to be updated.
S80, according to the caching key for the data to be updated for including in the timing execution task transferred, described in
The data to be updated are read in database, and the data to be updated read are associated with and are updated with the caching key
To in the local cache.
Wherein, the data to be updated that will have been read, which are associated with the caching key and are updated to the local, delays
In depositing, refer to after deleting in the local cache with the associated legacy data of the caching key, by reading newly described in
Data to be updated are associated in the local cache with the caching key and store again.
The above embodiment of the present invention asynchronous in the second thread can update rule configuration timing according to preset timing
Execution task, and achieve the purpose that update the data to be updated in local cache by executing the timing execution task, into one
Step has achieved the effect that dynamic configuration caches.
In one embodiment, as shown in figure 5, providing a kind of caching dynamic configuration device, the caching dynamic configuration device with
Dynamic Configuration is cached in above-described embodiment to correspond.The caching dynamic configuration device includes:
Blocking module 11, for passing through the packet of first thread interception request side transmission according to preconfigured hold-up interception method
The data read request of caching key containing data to be read;
First detection module 12, for detecting in local cache with the presence or absence of continuing described in corresponding with the caching key
Access evidence;
Second detection module 13 is used for when there are the data to be read corresponding with the caching key, described in detection
The data to be read failure whether out of date corresponding with the caching key present in local cache;
First read module 14 described continues for corresponding with the caching key present in the local cache
When access is according to failure out of date, the data to be read are read from database, and the data to be read read are updated
Extremely in the local cache, while the data to be read read are back to the requesting party.
In one embodiment, as shown in fig. 6, the blocking module 11 includes:
Detection unit 111 is asked for receiving the reading data of the unique identification comprising data to be read of requesting party's transmission
Ask, and according to preconfigured hold-up interception method detect in the data read request whether include data to be read caching key;
Interception unit 112, for being intercepted comprising continuing by first thread in the caching key comprising data to be read
The data read request of the caching key for evidence of fetching;
Reading unit 113, for do not include the data to be read caching key when, according to the unique identification from
The data to be read are read in the database, and the data to be read of reading are back to the requesting party.
In one embodiment, as shown in fig. 7, described device further include:
Configuration module 15 executes task for updating rule configuration timing according to preset timing, and the timing updates rule
The update initial time and update of caching key and each data to be updated in then comprising all data to be updated
Time interval;It periodically the caching key in execution task comprising data to be updated and is associated with described in each
Renewal time point;
It is inserted into module 16, it, will be each described fixed for according to the renewal time point for including in the timing execution task
The insertion of Shi Zhihang task executes in task queue;
Module 17 is transferred, for being transferred from the execution task queue by the second thread in the renewal time point
Task is executed with the associated timing of the renewal time point;
Second read module 18, for according to the data to be updated for including in the timing execution task transferred
Key is cached, reads the data to be updated from the database, and by the data to be updated read and the caching
Key is associated with and is updated in the local cache.
In one embodiment, described device further include:
Third read module, in detecting the local cache and be not present institute corresponding with the caching key
When stating data to be read, the data to be read are read from database, and the data to be read read are back to institute
Requesting party is stated, while the data to be read read being updated in the local cache.
In one embodiment, described device further include:
4th read module, for corresponding with the caching key described to be read present in the local cache
When data and not out of date failure, the data to be read are read from the local cache according to the caching key, and will read
The data to be read taken are back to the requesting party.
Specific about caching dynamic configuration device limits the limit that may refer to above for caching Dynamic Configuration
Fixed, details are not described herein.Modules in above-mentioned caching dynamic configuration device can fully or partially through software, hardware and its
Combination is to realize.Above-mentioned each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also be with
It is stored in the memory in computer equipment in a software form, in order to which processor calls the above modules of execution corresponding
Operation.
In one embodiment, a kind of computer equipment is provided, which can be server, internal junction
Composition can be as shown in Figure 8.The computer equipment include by system bus connect processor, memory, network interface and
Database.Wherein, the processor of the computer equipment is for providing calculating and control ability.The memory packet of the computer equipment
Include non-volatile memory medium, built-in storage.The non-volatile memory medium be stored with operating system, computer-readable instruction and
Database.The built-in storage provides ring for the operation of operating system and computer-readable instruction in non-volatile memory medium
Border.To realize a kind of caching Dynamic Configuration when the computer-readable instruction is executed by processor.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage are on a memory
And the computer-readable instruction that can be run on a processor, processor perform the steps of when executing computer-readable instruction
According to preconfigured hold-up interception method, sent by first thread interception request side slow comprising data to be read
Deposit the data read request of key;
It detects and whether there is the data to be read corresponding with the caching key in local cache;
When there are the data to be read corresponding with the caching key, detect present in the local cache and
The corresponding data to be read failure whether out of date of the caching key;
When the failure out of date of corresponding with the caching key data to be read present in the local cache,
The data to be read are read from database, the data to be read read are updated in the local cache, together
When the data to be read read are back to the requesting party.
In one embodiment, a kind of computer readable storage medium is provided, computer-readable instruction is stored thereon with,
It is performed the steps of when computer-readable instruction is executed by processor
According to preconfigured hold-up interception method, sent by first thread interception request side slow comprising data to be read
Deposit the data read request of key;
It detects and whether there is the data to be read corresponding with the caching key in local cache;
When there are the data to be read corresponding with the caching key, detect present in the local cache and
The corresponding data to be read failure whether out of date of the caching key;
When the failure out of date of corresponding with the caching key data to be read present in the local cache,
The data to be read are read from database, the data to be read read are updated in the local cache, together
When the data to be read read are back to the requesting party.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer-readable instruction, it is non-volatile that the computer-readable instruction can be stored in one
Property computer-readable storage medium in, the computer-readable instruction is when being executed, it may include as above-mentioned each method embodiment
Process.Wherein, to memory, storage, database or other media used in each embodiment provided by the present invention
Any reference may each comprise non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory
(ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.It is volatile
Property memory may include random access memory (RAM) or external cache.By way of illustration and not limitation, RAM
It is available in many forms, such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram
(DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization link DRAM (SLDRAM), the direct RAM of memory bus (RDRAM),
Direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function
Can unit or module division progress for example, in practical application, can according to need and by above-mentioned function distribution by difference
Functional unit or module complete, i.e., the internal structure of described device is divided into different functional unit or module, with complete
All or part of function described above.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality
Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each
Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified
Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all
It is included within protection scope of the present invention.
Claims (10)
1. a kind of caching Dynamic Configuration characterized by comprising
According to preconfigured hold-up interception method, the caching comprising data to be read sent by first thread interception request side
The data read request of key;
It detects and whether there is the data to be read corresponding with the caching key in local cache;
Exist the data to be read corresponding with the caching key when, detect present in the local cache with it is described
Cache the corresponding data to be read failure whether out of date of key;
When the failure out of date of corresponding with the caching key data to be read present in the local cache, from number
According to the data to be read are read in library, the data to be read read are updated in the local cache, simultaneously will
The data to be read read are back to the requesting party.
2. caching Dynamic Configuration as described in claim 1, which is characterized in that described according to preconfigured interception side
Method passes through the data read request for the caching key comprising data to be read that first thread interception request side is sent, comprising:
The data read request for the unique identification comprising data to be read that requesting party sends is received, and is blocked according to preconfigured
The method of cutting detect in the data read request whether include data to be read caching key;
In the caching key comprising data to be read, the data of the caching key comprising data to be read are intercepted by first thread
Read requests;
Do not include the data to be read caching key when, read according to the unique identification from the database described in
Data to be read, and the data to be read of reading are back to the requesting party.
3. the method for caching dynamic configuration as described in claim 1, which is characterized in that the method also includes:
Rule configuration timing is updated according to preset timing and executes task, and it includes all numbers to be updated in rule that the timing, which updates,
According to caching key and each data to be updated update initial time and renewal time interval;It is fixed described in each
It include the caching key and renewal time associated with it point of the data to be updated in Shi Zhihang task;
According to the renewal time point for including in the timing execution task, each timing is executed task insertion and executed and is appointed
It is engaged in queue;
In the renewal time point, is transferred by the second thread from the execution task queue and be associated with the renewal time point
The timing execute task;
According to the caching key for the data to be updated for including in the timing execution task transferred, from the database
The data to be updated are read, and the data to be updated read are associated with the caching key and are updated to described
In ground caching.
4. caching Dynamic Configuration as described in claim 1, which is characterized in that described according to preconfigured interception side
Method, after the data read request for caching key comprising data to be read of first thread interception request side transmission, packet
It includes:
In detecting the local cache and when the data to be read corresponding with the caching key are not present, from data
The data to be read are read in library, the data to be read read are back to the requesting party, while will read
The data to be read be updated in the local cache.
5. caching Dynamic Configuration as described in claim 1, which is characterized in that described to exist and key pairs of the caching
When the data to be read answered, the access of continuing corresponding with the caching key present in the local cache is detected
According to after whether failure out of date, comprising:
When the data to be read corresponding with the caching key present in the local cache and not out of date failure, root
The data to be read are read from the local cache according to the caching key, and the data to be read read are returned
It is back to the requesting party.
6. a kind of caching dynamic configuration device characterized by comprising
Blocking module, for according to preconfigured hold-up interception method, what it is by the transmission of first thread interception request side to include to continue
The data read request of the caching key for evidence of fetching;
First detection module, for detecting in local cache with the presence or absence of the data to be read corresponding with the caching key;
Second detection module, for it is slow to detect the local when there are the data to be read corresponding with the caching key
The data to be read failure whether out of date corresponding with the caching key present in depositing;
First read module is used for the data to be read corresponding with the caching key present in the local cache
When failure out of date, the data to be read are read from database, the data to be read read are updated to described
In local cache, while the data to be read read are back to the requesting party.
7. caching dynamic configuration device as claimed in claim 6, which is characterized in that the blocking module includes:
Detection unit, the data read request of the unique identification comprising data to be read for receiving requesting party's transmission, and root
According to preconfigured hold-up interception method detect in the data read request whether include data to be read caching key;
Interception unit, for being intercepted comprising data to be read by first thread in the caching key comprising data to be read
Cache the data read request of key;
Reading unit, for when not including the caching key of the data to be read, according to the unique identification from the data
The data to be read are read in library, and the data to be read of reading are back to the requesting party.
8. caching dynamic configuration device as claimed in claim 7, which is characterized in that described device further include:
Configuration module executes task for updating rule configuration timing according to preset timing, and the timing updates wraps in rule
The update initial time of caching key and each data to be updated containing all data to be updated and between renewal time
Every;The periodically caching key in execution task comprising data to be updated and update associated with it described in each
Time point;
It is inserted into module, for according to the renewal time point for including in the timing execution task, each timing to be executed
Task insertion executes in task queue;
Transfer module, in the renewal time point, transferred by the second thread from the execution task queue with it is described
The associated timing of renewal time point executes task;
Second read module, for the caching according to the data to be updated for including in the timing execution task transferred
Key, reads the data to be updated from the database, and by the data to be updated read and the caching key
It is associated with and is updated in the local cache.
9. a kind of computer equipment, including memory, processor and storage are in the memory and can be in the processor
The computer-readable instruction of upper operation, which is characterized in that the processor is realized when executing the computer-readable instruction as weighed
Benefit requires any one of 1 to the 5 caching Dynamic Configuration.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer-readable instruction, special
Sign is, realizes that caching dynamic is matched as described in any one of claim 1 to 5 when the computer-readable instruction is executed by processor
Set method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910300407.9A CN110113385A (en) | 2019-04-15 | 2019-04-15 | Cache Dynamic Configuration, device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910300407.9A CN110113385A (en) | 2019-04-15 | 2019-04-15 | Cache Dynamic Configuration, device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110113385A true CN110113385A (en) | 2019-08-09 |
Family
ID=67485398
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910300407.9A Pending CN110113385A (en) | 2019-04-15 | 2019-04-15 | Cache Dynamic Configuration, device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110113385A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110837427A (en) * | 2019-11-15 | 2020-02-25 | 四川长虹电器股份有限公司 | Method for preventing cache breakdown based on queue sorting task mechanism |
CN110851856A (en) * | 2019-10-12 | 2020-02-28 | 福建天泉教育科技有限公司 | Cache data acquisition method and computer-readable storage medium |
CN112783909A (en) * | 2021-01-29 | 2021-05-11 | 平安普惠企业管理有限公司 | Data updating method and device, terminal equipment and storage medium |
US11019173B2 (en) | 2016-06-01 | 2021-05-25 | Home Box Office, Inc. | Cached data expiration and refresh |
CN113360533A (en) * | 2021-06-28 | 2021-09-07 | 深圳市高德信通信股份有限公司 | Access system of cache system |
CN113590665A (en) * | 2021-08-12 | 2021-11-02 | 平安普惠企业管理有限公司 | Cache monitoring management method, device, system, equipment and storage medium |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130018842A1 (en) * | 2011-07-12 | 2013-01-17 | Calippe Joel R | System and method for caching mobile services database objects |
US20140089588A1 (en) * | 2012-09-27 | 2014-03-27 | Amadeus S.A.S. | Method and system of storing and retrieving data |
CN105978779A (en) * | 2016-06-23 | 2016-09-28 | 北京东土科技股份有限公司 | Real-time communication method, device and system based on industrial internet |
CN106130858A (en) * | 2016-06-23 | 2016-11-16 | 北京东土科技股份有限公司 | Data transmission method based on the Internet, Apparatus and system |
CN106453667A (en) * | 2016-12-20 | 2017-02-22 | 北京小米移动软件有限公司 | Method and device for updating cached data |
CN106844784A (en) * | 2017-03-14 | 2017-06-13 | 上海网易小额贷款有限公司 | Data cache method, device and computer-readable recording medium |
CN107436910A (en) * | 2017-04-14 | 2017-12-05 | 阿里巴巴集团控股有限公司 | A kind of data query method and apparatus |
CN107506396A (en) * | 2017-07-31 | 2017-12-22 | 努比亚技术有限公司 | A kind of data buffer storage initial method, mobile terminal and computer-readable recording medium |
CN107645516A (en) * | 2016-07-20 | 2018-01-30 | 平安科技(深圳)有限公司 | Application of software data caching method and device |
CN108628891A (en) * | 2017-03-21 | 2018-10-09 | 北京京东尚科信息技术有限公司 | Realize method, apparatus, electronic equipment and the readable storage medium storing program for executing of data buffer storage layer |
-
2019
- 2019-04-15 CN CN201910300407.9A patent/CN110113385A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130018842A1 (en) * | 2011-07-12 | 2013-01-17 | Calippe Joel R | System and method for caching mobile services database objects |
US20140089588A1 (en) * | 2012-09-27 | 2014-03-27 | Amadeus S.A.S. | Method and system of storing and retrieving data |
CN105978779A (en) * | 2016-06-23 | 2016-09-28 | 北京东土科技股份有限公司 | Real-time communication method, device and system based on industrial internet |
CN106130858A (en) * | 2016-06-23 | 2016-11-16 | 北京东土科技股份有限公司 | Data transmission method based on the Internet, Apparatus and system |
CN107645516A (en) * | 2016-07-20 | 2018-01-30 | 平安科技(深圳)有限公司 | Application of software data caching method and device |
CN106453667A (en) * | 2016-12-20 | 2017-02-22 | 北京小米移动软件有限公司 | Method and device for updating cached data |
CN106844784A (en) * | 2017-03-14 | 2017-06-13 | 上海网易小额贷款有限公司 | Data cache method, device and computer-readable recording medium |
CN108628891A (en) * | 2017-03-21 | 2018-10-09 | 北京京东尚科信息技术有限公司 | Realize method, apparatus, electronic equipment and the readable storage medium storing program for executing of data buffer storage layer |
CN107436910A (en) * | 2017-04-14 | 2017-12-05 | 阿里巴巴集团控股有限公司 | A kind of data query method and apparatus |
CN107506396A (en) * | 2017-07-31 | 2017-12-22 | 努比亚技术有限公司 | A kind of data buffer storage initial method, mobile terminal and computer-readable recording medium |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11019173B2 (en) | 2016-06-01 | 2021-05-25 | Home Box Office, Inc. | Cached data expiration and refresh |
CN110851856A (en) * | 2019-10-12 | 2020-02-28 | 福建天泉教育科技有限公司 | Cache data acquisition method and computer-readable storage medium |
CN110851856B (en) * | 2019-10-12 | 2021-10-08 | 福建天泉教育科技有限公司 | Cache data acquisition method and computer-readable storage medium |
CN110837427A (en) * | 2019-11-15 | 2020-02-25 | 四川长虹电器股份有限公司 | Method for preventing cache breakdown based on queue sorting task mechanism |
CN110837427B (en) * | 2019-11-15 | 2022-02-01 | 四川长虹电器股份有限公司 | Method for preventing cache breakdown based on queue sorting task mechanism |
CN112783909A (en) * | 2021-01-29 | 2021-05-11 | 平安普惠企业管理有限公司 | Data updating method and device, terminal equipment and storage medium |
CN112783909B (en) * | 2021-01-29 | 2023-09-26 | 宁夏航天信息有限公司 | Data updating method, device, terminal equipment and storage medium |
CN113360533A (en) * | 2021-06-28 | 2021-09-07 | 深圳市高德信通信股份有限公司 | Access system of cache system |
CN113590665A (en) * | 2021-08-12 | 2021-11-02 | 平安普惠企业管理有限公司 | Cache monitoring management method, device, system, equipment and storage medium |
CN113590665B (en) * | 2021-08-12 | 2023-11-17 | 新疆北斗同创信息科技有限公司 | Cache monitoring management method, device, system, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110113385A (en) | Cache Dynamic Configuration, device, computer equipment and storage medium | |
EP3896633B1 (en) | Task processing method, system and device, and storage medium | |
CN110062924B (en) | Capacity reservation for virtualized graphics processing | |
CN107066570A (en) | Data managing method and device | |
CN109597818A (en) | Data-updating method, device, storage medium and equipment | |
CN113037817B (en) | Method and device for starting intelligent contract, electronic equipment and storage medium | |
CN110046029A (en) | Data processing method and device applied to multi-level buffer in cluster | |
CN106899648A (en) | A kind of data processing method and equipment | |
CN108279921A (en) | A kind of automatic gray scale dissemination method, system and device based on container platform | |
CN110532025B (en) | Data processing method, device and equipment based on micro-service architecture and storage medium | |
CN109358874B (en) | Business rule updating method, business rule updating device, computer equipment and storage medium | |
CN110955448A (en) | Intelligent contract separation method, contract processing method, apparatus, device and medium | |
US20240163242A1 (en) | Distributed domain name resolution and method for use of same | |
CN108491252A (en) | distributed transaction processing method and distributed system | |
CN104639650A (en) | Fine granularity distributive interface access control method and device | |
KR20190021272A (en) | Systems and methods for high availability cloud-enabled point-of-sale systems | |
CN111324425B (en) | Data access method, device, equipment and storage medium | |
CN109885612B (en) | Synchronous validation method and device for intelligent contracts of block chains | |
CN108449187A (en) | A kind of method and device that token refreshes | |
CN109766316A (en) | File acquisition method, device, computer equipment and storage medium | |
CN110826052A (en) | Method and device for protecting server password security | |
CN111290839A (en) | IAAS cloud platform system based on openstack | |
CN107277022B (en) | Process marking method and device | |
CN105302489B (en) | A kind of remote embedded accumulator system of heterogeneous polynuclear and method | |
CN108924185A (en) | Interface creation method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190809 |
|
RJ01 | Rejection of invention patent application after publication |