CN109977129A - Multi-stage data caching method and equipment - Google Patents

Multi-stage data caching method and equipment Download PDF

Info

Publication number
CN109977129A
CN109977129A CN201910243844.1A CN201910243844A CN109977129A CN 109977129 A CN109977129 A CN 109977129A CN 201910243844 A CN201910243844 A CN 201910243844A CN 109977129 A CN109977129 A CN 109977129A
Authority
CN
China
Prior art keywords
data
caching
target
grade
database
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
Application number
CN201910243844.1A
Other languages
Chinese (zh)
Inventor
裴宏祥
周文卿
张加伟
李学政
韩克华
黄群
张文娇
王科恒
范雯超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN201910243844.1A priority Critical patent/CN109977129A/en
Publication of CN109977129A publication Critical patent/CN109977129A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the present invention provides a kind of multi-stage data caching method and equipment, this method comprises: when the data that database receives data subscriber terminal transmission update write-in, the target data for updating write-in is obtained from the database, query caching rule-statistical library, obtain the corresponding target cache grade of the target data, according to the corresponding relationship for prestoring each data and its caching grade, wherein the corresponding relationship of each data and its caching grade is to be queried what frequency determined according to each data, according to the caching grade for being queried frequency and determining of target data, by updating target data into the corresponding target cache of target cache grade, rather than it is write data into cachings at different levels in the prior art, the execution time of the data of data inquiry request write-in each time can be reduced, and the data for reducing buffer memories at different levels simultaneously are deposited with saving Store up resource.

Description

Multi-stage data caching method and equipment
Technical field
The present embodiments relate to field of communication technology more particularly to a kind of multi-stage data caching method and equipment.
Background technique
With the continuous development of Internet technology, system amount of access is increased rapidly, and database faces huge processing pressure, It can be pressurizeed to a certain extent for database by multi-stage data caching, improve database service handling capacity and inquiry response effect Rate.
Currently, traditional multi-stage data cache way is: after writing data into database, which is sequentially written in by synchronization In cachings at different levels, including application cache, shared buffer memory, distributed caching, and start to look into data query Shi Zecong application cache Look for, application cache there is no then search shared buffer memory, in shared buffer memory there is no distributed caching is then searched, distributed caching is not In the presence of then searching database, if in database there are the data if be successively sequentially written in application cache, shared buffer memory, distribution Caching, convenient for next data query.
But inventor has found that traditional multi-stage data cache way at least has the following technical problems: every time by data It requires to write data into cachings at different levels when database is written, leads to the execution time of the data of data inquiry request write-in each time Elongated and all data require the waste that storage causes buffer memory resource in cachings at different levels.
Summary of the invention
The embodiment of the present invention provides a kind of multi-stage data caching method and equipment, to overcome in the prior art every time by data It requires to write data into cachings at different levels when database is written, leads to the execution time of the data of data inquiry request write-in each time Elongated and all data require the problem of storage causes the waste of buffer memory resource in cachings at different levels.
In a first aspect, the embodiment of the present invention provides a kind of multi-stage data caching method, comprising:
When the data that database receives data subscriber terminal transmission update write-in, obtains update from the database The target data of write-in;
Query caching rule-statistical library obtains the corresponding target cache grade of the target data, wherein the caching is advised The corresponding relationship for prestoring each data in library and its caching grade is then counted, wherein the correspondence of each data and its caching grade Relationship is to be queried what frequency determined according to each data;
Judge in the caching rule-statistical library with the presence or absence of the corresponding caching record of the target data;
If the corresponding caching record of the target data is not present in the caching rule-statistical library, by the number of targets According to being updated in the corresponding target cache of the target cache grade, and the corresponding caching record of the target data is generated, it will The caching record is stored in the caching rule-statistical library;
If in the caching rule-statistical library, there are the corresponding cachings of the target data, by the updating target data Extremely in the corresponding target cache of the target cache grade, and will be in caching corresponding in caching record according to the caching record Target data delete.
In a kind of possible design, before query caching rule-statistical library, further includes:
The data inquiry request sent according to inquiry user terminal is received, obtain each data is queried frequency;According to The caching grade for being queried frequency and determining each data;By the corresponding relationship of each data and its caching grade, it is stored in described It caches in rule-statistical library.
It is described that the target data for updating write-in is obtained from database, comprising: to work as database in a kind of possible design When receiving multiple data of update, data are generated according to the multiple data and change Message queue;Disappear to data change Breath queue is parsed, and the target data is obtained.
It is described to generate data change Message queue according to the multiple data, comprising: to obtain in a kind of possible design The database data updates the modification information of the multiple data when being written, and is become according to the modification information of the multiple data More database journal;It is acquired using modification information of the message-oriented middleware to database journal, obtains the data change and disappear Breath is to column.
In a kind of possible design, if there are the corresponding caching of the target data in the caching rule-statistical library, Then by the updating target data into the corresponding target cache of the target cache grade, and it will be delayed according to the caching record It deposits after the target data in record in corresponding caching deletes, further includes: generate the corresponding new caching of the target data and remember Record, replaces with the new caching record for the corresponding caching record of target data described in the caching rule-statistical library.
Second aspect, the embodiment of the present invention provide a kind of multi-stage data buffer memory device, including memory, processor and deposit The computer program that can be run in the memory and on the processor is stored up, the processor executes the computer journey Following steps are realized when sequence:
When the data that database receives data subscriber terminal transmission update write-in, obtains update from the database The target data of write-in;
Query caching rule-statistical library obtains the corresponding target cache grade of the target data, wherein the caching is advised The corresponding relationship for prestoring each data in library and its caching grade is then counted, wherein the correspondence of each data and its caching grade Relationship is to be queried what frequency determined according to each data;
Judge in the caching rule-statistical library with the presence or absence of the corresponding caching record of the target data;
If the corresponding caching record of the target data is not present in the caching rule-statistical library, by the number of targets According to being updated in the corresponding target cache of the target cache grade, and the corresponding caching record of the target data is generated, it will The caching record is stored in the caching rule-statistical library;
If in the caching rule-statistical library, there are the corresponding cachings of the target data, by the updating target data Extremely in the corresponding target cache of the target cache grade, and will be in caching corresponding in caching record according to the caching record Target data delete.
In a kind of possible design, before query caching rule-statistical library, the processor executes the calculating Following steps are also realized when machine program: according to the data inquiry request for receiving inquiry user terminal transmission, obtaining each data It is queried frequency;According to the caching grade for being queried frequency and determining each data;By each data and its correspondence of caching grade Relationship is stored in the caching rule-statistical library.
In a kind of possible design, the target data for obtaining from database and updating write-in is stated, comprising: when database connects When receiving multiple data of update, data are generated according to the multiple data and change Message queue;Message is changed to the data Queue is parsed, and the target data is obtained.
It is described to generate data change Message queue according to the multiple data, comprising: to obtain in a kind of possible design The database data updates the modification information of the multiple data when being written, and is become according to the modification information of the multiple data More database journal;It is acquired using modification information of the message-oriented middleware to database journal, obtains the data change and disappear Breath is to column.
The third aspect, the embodiment of the present invention provide a kind of computer readable storage medium, the computer-readable storage medium It is stored with computer executed instructions in matter, when processor executes the computer executed instructions, realizes such as first aspect and the On the one hand described in any item multi-stage data caching methods.
Multi-stage data caching method provided in this embodiment and equipment, this method are obtained by query caching rule-statistical library The corresponding target cache grade of the target data is taken, according to the corresponding relationship for prestoring each data and its caching grade, wherein Each data and its corresponding relationship for caching grade are to be queried what frequency determined according to each data, according to target data It is queried the caching grade that frequency determines, by updating target data into the corresponding target cache of target cache grade, rather than It is write data into cachings at different levels in the prior art, the execution time of the data of data inquiry request write-in each time can be reduced, And reduce the data of buffer memories at different levels simultaneously to save storage resource.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair Bright some embodiments for those of ordinary skill in the art without any creative labor, can be with It obtains other drawings based on these drawings.
Fig. 1 is the system architecture schematic diagram of multi-stage data provided in an embodiment of the present invention caching;
Fig. 2 is the flow diagram one of multi-stage data caching method provided in an embodiment of the present invention;
Fig. 3 is the flow diagram two of multi-stage data caching method provided in an embodiment of the present invention;
Fig. 4 is the structural schematic diagram one of multi-stage data buffer memory device provided in an embodiment of the present invention;
Fig. 5 is the structural schematic diagram two of multi-stage data buffer memory device provided in an embodiment of the present invention;
Fig. 6 is the hardware structural diagram of multi-stage data buffer memory device provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
Fig. 1 is the system architecture schematic diagram of multi-stage data provided in an embodiment of the present invention caching.As shown in Figure 1, this implementation The system that example provides includes data subscriber terminal terminal 101, inquiry user terminal 102 and server 103.Wherein, user terminal Terminal 101 and inquiry user terminal 102 all can be mobile phone, plate, PCs etc..The present embodiment is to user terminal terminal 101 are not particularly limited with the implementation for inquiring user terminal 102, as long as user terminal terminal 101 and inquiry user terminal 102 can interact with server 103.
Server 103 is for managing multi-stage data caching, after writing data into database, and by the data according to the present invention Multi-stage data caching method be written in cachings at different levels, wherein caching at different levels include application cache, it is shared buffer memory, distributed slow It deposits.Begun looking in data query Shi Zecong application cache, application cache there is no then search shared buffer memory, in shared buffer memory not In the presence of then searching distributed caching, distributed caching there is no then searching database, if in database there are the data if according to It is secondary to be sequentially written in application cache, shared buffer memory, distributed caching, convenient for next data query.
Fig. 2 is the flow diagram one of multi-stage data caching method provided in an embodiment of the present invention, the execution of the present embodiment Main body can be the server of embodiment illustrated in fig. 1, and the present embodiment is not particularly limited herein.As shown in Fig. 2, this method packet It includes:
S201, when database receive data subscriber terminal transmission data update write-in when, obtain from the database Take the target data for updating and being written.
In the present embodiment, can be user by the data write service of data subscriber terminal invoking server by mesh It marks data and database is written, or be also possible to directly carry out data write operation to database.
Wherein, wherein target data refers to being updated the data in database, and the data of write-in, the data are used for The data of inquiry are provided in write-in caching or in the absence of in caching when data query.
S202, query caching rule-statistical library obtain the corresponding target cache grade of the target data, wherein described slow The corresponding relationship for prestoring each data in rule-statistical library and its caching grade is deposited, wherein each data and its caching grade Corresponding relationship is to be queried what frequency determined according to each data.
In the present embodiment, the corresponding relationship for prestoring each data in rule-statistical library and its caching grade is cached are as follows: number According to the corresponding relationship of the corresponding caching grade of each data stored in library and each data.
Wherein, the corresponding caching grade of each data refers to the caching grade that each data need to be stored.Caching grade is pressed Descending according to the frequency being queried can successively include: application cache, shared buffer memory and distributed caching.When user query It when a data, is begun looking for first from application cache, there is no then search shared buffer memory, be not present in shared buffer memory for application cache Then search distributed caching, distributed caching there is no then searching database, if in database there are the data if successively according to Secondary write-in application cache, shared buffer memory, distributed caching, convenient for next data query.
Wherein, as follows the characteristics of each level cache: the memory space of application cache is smaller, processing speed is fast, general to use Least recently used expiration policy;The memory space of shared buffer memory is larger, fast speed, is normally at main where application program Machine or host with its same network segment;Distributed caching is generally set up by the way of cluster, can store a large amount of data, is visited Ask that speed is relatively slow.
In the present embodiment, the corresponding relationship of each data and its caching grade is to be queried frequency according to each data It determines, is a dynamic process.For example, each data of corresponding relationship of each data and its caching grade are in preset time period (one In week) determined by the frequency of user query.Such as the caching grade of a certain data is shared buffer memory, but it is newest Data is queried frequency increase in one week, so that it may be cached grade by shared buffer memory and be promoted to application cache.
S203, judge in the caching rule-statistical library with the presence or absence of the corresponding caching record of the target data.If it is not, S204 is thened follow the steps, if so, thening follow the steps S205.
In the present embodiment, also there is the caching record of each data in caching rule-statistical library, wherein wraps in the caching record Include the record that each data are updated to the caching of its corresponding level.For example, a certain newest update of data are as follows: be updated to using slow It deposits.
In the present embodiment, when data any in database is updated to the caching of corresponding level, by data and update The other corresponding relationship of cache level save to caching rule-statistical library in, and delete last time update caching record.
S204, by the updating target data into the corresponding target cache of the target cache grade, and generate described in The caching record is stored in the caching rule-statistical library by the corresponding caching record of target data.
Specifically, updating target data is referred into the corresponding target cache of the target cache grade by number of targets It is stored according to the corresponding target cache of target cache grade is sent to, the data query for subsequent target cache.
In the present embodiment, generating the corresponding caching record of the target data is by target data and its target cache etc. Grade saves as caching record.
S205, by the updating target data into the corresponding target cache of the target cache grade, and according to described Caching record deletes the target data in caching corresponding in caching record.
Specifically, the target data in caching corresponding in caching record is deleted according to the caching record, comprising: root According to caching record, the caching grade of the last time update of target data is obtained;The caching of last time update is obtained according to caching grade;From The target data is inquired in the caching that last time updates, and is deleted.
As can be seen from the above description, obtaining the corresponding target cache of the target data by query caching rule-statistical library Grade, according to prestoring each data and its caching the corresponding relationship of grade, wherein the correspondence of each data and its caching grade Relationship is to be queried what frequency determined according to each data, will according to the caching grade for being queried frequency and determining of target data Updating target data writes data into cachings at different levels into the corresponding target cache of target cache grade in the prior art In, the execution time of the data of data inquiry request write-in each time can be reduced, and reduce the data of buffer memories at different levels simultaneously To save storage resource.
Fig. 3 is the flow diagram two of multi-stage data caching method provided in an embodiment of the present invention, and the present embodiment is in Fig. 2 reality On the basis of applying example, the present embodiment is discussed in detail before query caching rule-statistical library, how according to by each data and its slow The corresponding relationship for depositing grade stores the process into caching rule-statistical library.As shown in figure 3, this method comprises:
S301, basis receive the data inquiry request that inquiry user terminal is sent, and obtain each data is queried frequency.
Specifically, the data inquiry request that inquiry user terminal is sent is received every time, extracts the identity of the data, The corresponding number that is queried of the identity of the data added 1, each data is counted and is queried within a preset time (such as 1 week) Number, obtain each data is queried frequency.For example, the 20 of certain data are queried frequency times/week.
It in the present embodiment, can be with the execution journal of record queries process when receiving data inquiry request.Wherein hold Row log may include: the total spatial cache of application cache, use spatial cache, data cached mark Key and type, caching The size of data, data cached mark, timestamp, the execution duration of inquiry of queried access for obtaining successfully failure etc..
S302, the caching grade that frequency determines each data is queried according to.
In the present embodiment, each data can be determined according to the corresponding relationship for being queried frequency and caching grade prestored Cache grade.For example, table 1 is an example of the corresponding relationship for being queried frequency and caching grade prestored.
What table 1. prestored is queried frequency and caches the example of the corresponding relationship of grade
It is queried frequency (times/week) Cache grade
100 Application cache
70 Shared buffer memory
20 Distributed caching
S303, by each data and its cache grade corresponding relationship, be stored in the caching rule-statistical library.
As can be seen from the above description, the data inquiry request sent by receiving inquiry user terminal, obtains each data It is queried frequency, and according to the caching grade for being queried frequency and determining each data, it can be quickly and easily to caching rule The caching grade of each data is updated in statistics library, and the frequency for avoiding caching grade and data from being queried mismatches.
In one embodiment of the invention, it in the embodiment of above-mentioned Fig. 1 in step S201, obtains and updates from database The target data of write-in, comprising: when database receives multiple data of update, generate data according to the multiple data and become More Message queue;Data change message queue is parsed, the target data is obtained.
Specifically, described to generate data change Message queue according to the multiple data, it specifically includes: obtaining the data Library data update the modification information of the multiple data when being written, and change database according to the modification information of the multiple data Log;It is acquired using modification information of the message-oriented middleware to database journal, obtains the data change Message queue.
Wherein, database journal can be the binlog of mysql database, be also possible to oracle database redolog;Message-oriented middleware can be kafka.
Wherein, data change message queue is parsed, obtains the target data, comprising: obtained data and become The mark of the more new data of more message queue obtains the target data according to the mark of more new data.Wherein more new data Mark is used for unique identification data.
In one embodiment of the invention, can also include: after step S205 in the embodiment of above-mentioned Fig. 1
The corresponding new caching record of the target data is generated, by target data pair described in the caching rule-statistical library The caching record answered replaces with the new caching record.
Fig. 4 is the structural schematic diagram one of multi-stage data buffer memory device provided in an embodiment of the present invention.As shown in figure 4, this is more Grade data buffering device 40 includes: to obtain module 401, enquiry module 402, judgment module 403, the first update module 404 and the Two update modules 405.
Wherein, module 401 is obtained, when the data for receiving data subscriber terminal transmission when database update write-in, The target data for updating write-in is obtained from the database;
Enquiry module 402 is used for query caching rule-statistical library, obtains corresponding target cache of the target data etc. Grade, wherein prestoring each data in the caching rule-statistical library and its caching the corresponding relationship of grade, wherein each data And its corresponding relationship of caching grade is to be queried what frequency determined according to each data;
Judgment module 403, it is corresponding slow with the presence or absence of the target data in the caching rule-statistical library for judging Deposit record;
First update module 404, if corresponding slow for the target data to be not present in the caching rule-statistical library Record is deposited, then by the updating target data into the corresponding target cache of the target cache grade, and generates the target The caching record is stored in the caching rule-statistical library by the corresponding caching record of data;
Second update module 405, if in the caching rule-statistical library there are the corresponding caching of the target data, Then by the updating target data into the corresponding target cache of the target cache grade, and it will be delayed according to the caching record The target data in record in corresponding caching is deposited to delete.
Equipment provided in this embodiment can be used for executing the technical solution of above method embodiment, realization principle and skill Art effect is similar, and details are not described herein again for the present embodiment.
Fig. 5 is the structural schematic diagram two of multi-stage data buffer memory device provided in an embodiment of the present invention.As shown in figure 5, this reality Example is applied on the basis of Fig. 4 embodiment, further includes:
It is queried frequency acquisition module 406, the data inquiry request for sending according to inquiry user terminal is received obtains Frequency is queried to each data;
Level determination module 407 is cached, the caching grade of each data is determined for being queried frequency according to;
Memory module 408, for being stored in the caching rule-statistical for the corresponding relationship of each data and its caching grade In library.
In one embodiment of the invention, the acquisition module 401, specifically for receiving the more of update when database When a data, data being generated according to the multiple data and change Message queue, data change message queue is parsed, Obtain the target data.
In one embodiment of the invention, the acquisition module 401 is specifically used for obtaining the database data update The modification information of the multiple data when write-in changes database journal according to the modification information of the multiple data;It uses Message-oriented middleware is acquired the modification information of database journal, obtains the data change Message queue.
In one embodiment of the invention, with reference to Fig. 5, the multi-stage data buffer memory device, further includes:
Replacement module 409, if for there are the corresponding cachings of the target data in the caching rule-statistical library, it will The updating target data remembers caching into the corresponding target cache of the target cache grade, and according to the caching record After target data in record in corresponding caching is deleted, the corresponding new caching record of the target data is generated, it will be described slow It deposits the corresponding caching record of target data described in rule-statistical library and replaces with the new caching record.
Equipment provided in this embodiment can be used for executing the technical solution of above method embodiment, realization principle and skill Art effect is similar, and details are not described herein again for the present embodiment.
Fig. 6 is the hardware structural diagram of multi-stage data buffer memory device provided in an embodiment of the present invention.As shown in fig. 6, this The multi-stage data buffer memory device 60 of embodiment includes: processor 601 and memory 602;Wherein
Memory 602, for storing computer executed instructions;
Processor 601, for executing the computer executed instructions of memory storage, to realize server in above-described embodiment Performed each step.It specifically may refer to the associated description in preceding method embodiment.
Optionally, memory 602 can also be integrated with processor 601 either independent.
When memory 602 is independently arranged, which further includes bus 603, for connecting described deposit Reservoir 602 and processor 601.
The embodiment of the present invention also provides a kind of computer readable storage medium, stores in the computer readable storage medium There are computer executed instructions, when processor executes the computer executed instructions, realizes multi-stage data caching as described above Method.
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, apparatus embodiments described above are merely indicative, for example, the division of the module, only Only a kind of logical function partition, there may be another division manner in actual implementation, for example, multiple modules can combine or It is desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed it is mutual it Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of device or module It connects, can be electrical property, mechanical or other forms.
The module as illustrated by the separation member may or may not be physically separated, aobvious as module The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.Some or all of the modules therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
It, can also be in addition, each functional module in each embodiment of the present invention can integrate in one processing unit It is that modules physically exist alone, can also be integrated in one unit with two or more modules.Above-mentioned module at Unit both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
The above-mentioned integrated module realized in the form of software function module, can store and computer-readable deposit at one In storage media.Above-mentioned software function module is stored in a storage medium, including some instructions are used so that a computer Equipment (can be personal computer, server or the network equipment etc.) or processor (English: processor) execute this Shen Please each embodiment the method part steps.
It should be understood that above-mentioned processor can be central processing unit (Central Processing Unit, abbreviation CPU), It can also be other general processors, digital signal processor (Digital Signal Processor, abbreviation DSP), dedicated Integrated circuit (Application Specific Integrated Circuit, abbreviation ASIC) etc..General processor can be Microprocessor or the processor are also possible to any conventional processor etc..It can be in conjunction with the step of invention disclosed method Be embodied directly in hardware processor and execute completion, or in processor hardware and software module combination execute completion.
Memory may include high speed RAM memory, it is also possible to and it further include non-volatile memories NVM, for example, at least one Magnetic disk storage can also be USB flash disk, mobile hard disk, read-only memory, disk or CD etc..
It is total that bus can be industry standard architecture (Industry Standard Architecture, abbreviation ISA) Line, external equipment interconnection (Peripheral Component, abbreviation PCI) bus or extended industry-standard architecture (Extended Industry Standard Architecture, abbreviation EISA) bus etc..It is total that bus can be divided into address Line, data/address bus, control bus etc..For convenient for indicating, the bus in illustrations does not limit an only bus or one The bus of seed type.
Above-mentioned storage medium can be by any kind of volatibility or non-volatile memory device or their combination It realizes, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable Read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, Disk or CD.Storage medium can be any usable medium that general or specialized computer can access.
A kind of illustrative storage medium is coupled to processor, believes to enable a processor to read from the storage medium Breath, and information can be written to the storage medium.Certainly, storage medium is also possible to the component part of processor.It processor and deposits Storage media can be located at specific integrated circuit (Application Specific Integrated Circuits, abbreviation ASIC) In.Certainly, pocessor and storage media can also be used as discrete assembly and be present in electronic equipment or main control device.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer readable storage medium.The journey When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned include: ROM, RAM, magnetic disk or The various media that can store program code such as person's CD.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution The range of scheme.

Claims (10)

1. a kind of multi-stage data caching method characterized by comprising
When the data that database receives data subscriber terminal transmission update write-in, obtains update write-in from the database Target data;
Query caching rule-statistical library obtains the corresponding target cache grade of the target data, wherein caching rule system Each data are prestored in meter library and its cache the corresponding relationship of grade, wherein the corresponding relationship of each data and its caching grade It is to be queried what frequency determined according to each data;
Judge in the caching rule-statistical library with the presence or absence of the corresponding caching record of the target data;
If the corresponding caching record of the target data is not present in the caching rule-statistical library, more by the target data In the new extremely corresponding target cache of the target cache grade, and the corresponding caching record of the target data is generated, it will be described Caching record is stored in the caching rule-statistical library;
If there are the corresponding cachings of the target data in the caching rule-statistical library, by the updating target data to institute It states in the corresponding target cache of target cache grade, and according to the caching record by the mesh in caching corresponding in caching record Data are marked to delete.
2. the method according to claim 1, wherein before query caching rule-statistical library, further includes:
The data inquiry request sent according to inquiry user terminal is received, obtain each data is queried frequency;
According to the caching grade for being queried frequency and determining each data;
The corresponding relationship of each data and its caching grade is stored in the caching rule-statistical library.
3. the method according to claim 1, wherein obtaining the number of targets for updating write-in from the database According to, comprising:
When database receives multiple data of update, data are generated according to the multiple data and change Message queue;
Data change message queue is parsed, the target data is obtained.
4. according to the method described in claim 3, it is characterized in that, described generate data change message according to the multiple data To column, comprising:
The modification information for obtaining the multiple data that the database data updates when being written, according to the change of the multiple data More information changes database journal;
It is acquired using modification information of the message-oriented middleware to database journal, obtains the data change Message queue.
5. method according to any one of claims 1 to 4, which is characterized in that if existing in the caching rule-statistical library The corresponding caching of the target data, then by the updating target data to the corresponding target cache of the target cache grade In, and will be after the target data deletion in caching corresponding in caching record according to the caching record, further includes:
The corresponding new caching record of the target data is generated, target data described in the caching rule-statistical library is corresponding Caching record replaces with the new caching record.
6. a kind of multi-stage data buffer memory device, which is characterized in that in the memory including memory, processor and storage And the computer program that can be run on the processor, the processor realize following step when executing the computer program It is rapid:
When the data that database receives data subscriber terminal transmission update write-in, obtains update write-in from the database Target data;
Query caching rule-statistical library obtains the corresponding target cache grade of the target data, wherein caching rule system Each data are prestored in meter library and its cache the corresponding relationship of grade, wherein the corresponding relationship of each data and its caching grade It is to be queried what frequency determined according to each data;
Judge in the caching rule-statistical library with the presence or absence of the corresponding caching record of the target data;
If the corresponding caching record of the target data is not present in the caching rule-statistical library, more by the target data In the new extremely corresponding target cache of the target cache grade, and the corresponding caching record of the target data is generated, it will be described Caching record is stored in the caching rule-statistical library;
If there are the corresponding cachings of the target data in the caching rule-statistical library, by the updating target data to institute It states in the corresponding target cache of target cache grade, and according to the caching record by the mesh in caching corresponding in caching record Data are marked to delete.
7. equipment according to claim 6, which is characterized in that before query caching rule-statistical library, the processing Device also realizes following steps when executing the computer program:
The data inquiry request sent according to inquiry user terminal is received, obtain each data is queried frequency;
According to the caching grade for being queried frequency and determining each data;
The corresponding relationship of each data and its caching grade is stored in the caching rule-statistical library.
8. equipment according to claim 6, which is characterized in that obtain the number of targets for updating write-in from the database According to, comprising:
When database receives multiple data of update, data are generated according to the multiple data and change Message queue;
Data change message queue is parsed, the target data is obtained.
9. equipment according to claim 8, which is characterized in that described to generate data change message according to the multiple data To column, comprising:
The modification information for obtaining the multiple data that the database data updates when being written, according to the change of the multiple data More information changes database journal;
It is acquired using modification information of the message-oriented middleware to database journal, obtains the data change Message queue.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium It executes instruction, when processor executes the computer executed instructions, realizes such as multistage described in any one of claim 1 to 5 Data cache method.
CN201910243844.1A 2019-03-28 2019-03-28 Multi-stage data caching method and equipment Pending CN109977129A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910243844.1A CN109977129A (en) 2019-03-28 2019-03-28 Multi-stage data caching method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910243844.1A CN109977129A (en) 2019-03-28 2019-03-28 Multi-stage data caching method and equipment

Publications (1)

Publication Number Publication Date
CN109977129A true CN109977129A (en) 2019-07-05

Family

ID=67081226

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910243844.1A Pending CN109977129A (en) 2019-03-28 2019-03-28 Multi-stage data caching method and equipment

Country Status (1)

Country Link
CN (1) CN109977129A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110442977A (en) * 2019-08-08 2019-11-12 广州华建工智慧科技有限公司 Mobile terminal BIM model intelligent buffer method based on construction process network recommendation
CN110704463A (en) * 2019-09-06 2020-01-17 中国平安财产保险股份有限公司 Local caching method and device for common data, computer equipment and storage medium
CN111209292A (en) * 2019-12-31 2020-05-29 成都库珀区块链科技有限公司 Bin data management method, device and system
CN112136104A (en) * 2019-07-29 2020-12-25 深圳市大疆创新科技有限公司 Data packet writing method and device, control terminal and movable platform
CN112235414A (en) * 2020-10-26 2021-01-15 中国联合网络通信集团有限公司 File caching method, operator server and MEC server
CN112667847A (en) * 2019-10-16 2021-04-16 北京奇艺世纪科技有限公司 Data caching method, data caching device and electronic equipment
CN113111014A (en) * 2021-04-07 2021-07-13 山东英信计算机技术有限公司 Method, device and equipment for cleaning non-hot data in cache and storage medium
CN113360528A (en) * 2020-03-06 2021-09-07 北京沃东天骏信息技术有限公司 Data query method and device based on multi-level cache
CN113626487A (en) * 2021-07-28 2021-11-09 广州市挖米科技有限责任公司 SAAS-based high-speed electrocardiogram data transmission and display method and device
CN113836579A (en) * 2021-09-26 2021-12-24 多点生活(成都)科技有限公司 Data processing method and device, electronic equipment and storage medium
CN114064086A (en) * 2021-11-29 2022-02-18 四川虹美智能科技有限公司 Multi-stage processor system and upgrading method thereof
CN114218503A (en) * 2022-02-22 2022-03-22 飞狐信息技术(天津)有限公司 Attention relationship caching method and device, electronic equipment and computer storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103390061A (en) * 2013-07-31 2013-11-13 浙江大学 Multi-level cache-based sea spatio-temporal data accessing method taking user as center
US20150220570A1 (en) * 2014-02-06 2015-08-06 International Business Machines Corporation Multilevel filters for cache-efficient access
CN104866434A (en) * 2015-06-01 2015-08-26 北京圆通慧达管理软件开发有限公司 Multi-application-oriented data storage system and data storage and calling method
KR101780586B1 (en) * 2016-03-16 2017-09-21 고려대학교 산학협력단 Monolithic 3D integration based cache memory
CN107341212A (en) * 2017-06-26 2017-11-10 努比亚技术有限公司 A kind of buffering updating method and equipment
CN107622115A (en) * 2017-09-19 2018-01-23 武大吉奥信息技术有限公司 A kind of space querying result cache method towards WFS services
CN108920670A (en) * 2018-07-06 2018-11-30 深圳市小牛在线互联网信息咨询有限公司 Cache synchronization method, device, system and storage medium
CN109299087A (en) * 2018-08-14 2019-02-01 中国平安财产保险股份有限公司 Data cache method, device, computer equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103390061A (en) * 2013-07-31 2013-11-13 浙江大学 Multi-level cache-based sea spatio-temporal data accessing method taking user as center
US20150220570A1 (en) * 2014-02-06 2015-08-06 International Business Machines Corporation Multilevel filters for cache-efficient access
CN104866434A (en) * 2015-06-01 2015-08-26 北京圆通慧达管理软件开发有限公司 Multi-application-oriented data storage system and data storage and calling method
KR101780586B1 (en) * 2016-03-16 2017-09-21 고려대학교 산학협력단 Monolithic 3D integration based cache memory
CN107341212A (en) * 2017-06-26 2017-11-10 努比亚技术有限公司 A kind of buffering updating method and equipment
CN107622115A (en) * 2017-09-19 2018-01-23 武大吉奥信息技术有限公司 A kind of space querying result cache method towards WFS services
CN108920670A (en) * 2018-07-06 2018-11-30 深圳市小牛在线互联网信息咨询有限公司 Cache synchronization method, device, system and storage medium
CN109299087A (en) * 2018-08-14 2019-02-01 中国平安财产保险股份有限公司 Data cache method, device, computer equipment and storage medium

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112136104A (en) * 2019-07-29 2020-12-25 深圳市大疆创新科技有限公司 Data packet writing method and device, control terminal and movable platform
CN110442977A (en) * 2019-08-08 2019-11-12 广州华建工智慧科技有限公司 Mobile terminal BIM model intelligent buffer method based on construction process network recommendation
CN110442977B (en) * 2019-08-08 2023-09-29 广州华建工智慧科技有限公司 Mobile terminal BIM model intelligent caching method based on building construction procedure network recommendation
CN110704463A (en) * 2019-09-06 2020-01-17 中国平安财产保险股份有限公司 Local caching method and device for common data, computer equipment and storage medium
CN110704463B (en) * 2019-09-06 2024-05-24 中国平安财产保险股份有限公司 Local caching method and device for common data, computer equipment and storage medium
CN112667847A (en) * 2019-10-16 2021-04-16 北京奇艺世纪科技有限公司 Data caching method, data caching device and electronic equipment
CN111209292A (en) * 2019-12-31 2020-05-29 成都库珀区块链科技有限公司 Bin data management method, device and system
CN111209292B (en) * 2019-12-31 2023-08-11 成都库珀创新科技有限公司 Bin data management method, device and system
CN113360528A (en) * 2020-03-06 2021-09-07 北京沃东天骏信息技术有限公司 Data query method and device based on multi-level cache
CN112235414B (en) * 2020-10-26 2022-05-31 中国联合网络通信集团有限公司 File caching method, operator server and MEC server
CN112235414A (en) * 2020-10-26 2021-01-15 中国联合网络通信集团有限公司 File caching method, operator server and MEC server
CN113111014B (en) * 2021-04-07 2023-01-06 山东英信计算机技术有限公司 Method, device and equipment for cleaning non-hot data in cache and storage medium
CN113111014A (en) * 2021-04-07 2021-07-13 山东英信计算机技术有限公司 Method, device and equipment for cleaning non-hot data in cache and storage medium
CN113626487A (en) * 2021-07-28 2021-11-09 广州市挖米科技有限责任公司 SAAS-based high-speed electrocardiogram data transmission and display method and device
CN113836579A (en) * 2021-09-26 2021-12-24 多点生活(成都)科技有限公司 Data processing method and device, electronic equipment and storage medium
CN113836579B (en) * 2021-09-26 2024-04-09 多点生活(成都)科技有限公司 Data processing method and device, electronic equipment and storage medium
CN114064086A (en) * 2021-11-29 2022-02-18 四川虹美智能科技有限公司 Multi-stage processor system and upgrading method thereof
CN114064086B (en) * 2021-11-29 2023-06-23 四川虹美智能科技有限公司 Multi-stage processor system and upgrading method thereof
CN114218503A (en) * 2022-02-22 2022-03-22 飞狐信息技术(天津)有限公司 Attention relationship caching method and device, electronic equipment and computer storage medium

Similar Documents

Publication Publication Date Title
CN109977129A (en) Multi-stage data caching method and equipment
CN106911780B (en) Service ID generation method, device and system
CN110275841B (en) Access request processing method and device, computer equipment and storage medium
CN108459826B (en) Method and device for processing IO (input/output) request
CN107025289B (en) A kind of method and relevant device of data processing
CN105677580A (en) Method and device for accessing cache
US20210158310A1 (en) Blockchain-based transaction processing methods and apparatuses and electronic devices
CN107092628B (en) Time series data processing method and device
CN106326499B (en) A kind of data processing method and device
CN106777085A (en) A kind of data processing method, device and data query system
CN109471843A (en) A kind of metadata cache method, system and relevant apparatus
CN113934655B (en) Method and apparatus for solving ambiguity problem of cache memory address
CN113364877B (en) Data processing method, device, electronic equipment and medium
CN100394404C (en) System and method for management of metadata
CN112506823A (en) FPGA data reading and writing method, device, equipment and readable storage medium
CN111737564A (en) Information query method, device, equipment and medium
CN114138840A (en) Data query method, device, equipment and storage medium
CN104978283A (en) Memory access control method and device
CN108733584B (en) Method and apparatus for optimizing data caching
CN111061654B (en) Cache refreshing processing method and device and electronic equipment
CN106302374A (en) A kind of for improving list item access bandwidth and the device and method of atomicity operation
CN112685417A (en) Database operation method, system, device, server and storage medium
CN113010535A (en) Cache data updating method, device, equipment and storage medium
US8533398B2 (en) Combination based LRU caching
CN110658999B (en) Information updating method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190705