CN105843892A - Data persistence method, device and system based on Ehcache - Google Patents

Data persistence method, device and system based on Ehcache Download PDF

Info

Publication number
CN105843892A
CN105843892A CN201610166005.0A CN201610166005A CN105843892A CN 105843892 A CN105843892 A CN 105843892A CN 201610166005 A CN201610166005 A CN 201610166005A CN 105843892 A CN105843892 A CN 105843892A
Authority
CN
China
Prior art keywords
data
ehcache
caching server
checked
internal memory
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.)
Granted
Application number
CN201610166005.0A
Other languages
Chinese (zh)
Other versions
CN105843892B (en
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.)
Beijing Jianfei Wuxian Science Technology Co Ltd
Original Assignee
Beijing Jianfei Wuxian Science Technology 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 Beijing Jianfei Wuxian Science Technology Co Ltd filed Critical Beijing Jianfei Wuxian Science Technology Co Ltd
Priority to CN201610166005.0A priority Critical patent/CN105843892B/en
Publication of CN105843892A publication Critical patent/CN105843892A/en
Application granted granted Critical
Publication of CN105843892B publication Critical patent/CN105843892B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a data persistence method, device and system based on Ehcache. The method comprises the following steps: an Ehcache cache server receives a first query request initiated from a client side; judging whether to-be-queried data which corresponds to the first query request is stored in memory or not; if the to-be-queried data which corresponds to the first query request is stored in memory, returning the to-be-queried data corresponding to the first query request to the client side; and if the to-be-queried data which corresponds to the first query request is not stored in memory, sending a second query request to a database, receiving to-be-queried data which corresponds to the second query request and is returned from the database, converting to-be-queried data expressed by relational model data into data expressed by a data model in the memory through a POJO (Plain Old Java Object) object, writing the converted data into the memory and the hard disk of the Ehcache cache server, and returning the to-be-queried data to the client side. The method solves the problem in a traditional scheme that data in the memory is lost during outage, and also solves the problem that a plurality of configurations are required for a third-party frame when Java is used for caching.

Description

A kind of data persistence method based on Ehcache, dress Put and system
Technical field
The present invention relates to field of computer technology, in particular to one based on The data persistence method of Ehcache, Apparatus and system.
Background technology
At present, conventional data query means are that client is directly looked into from data base Asking, this method needs the digital independent in hard disk to internal memory, and inquiry data are slower; Another kind of common means are first to inquire about, without to be checked from Java caches Ask data, then inquire about from data base, but in Java caching can only write data into In depositing, during power-off, data in EMS memory can be lost, and it is right to use Java caching to need Third party's frameworks such as Hibernate and MyBatis carry out a lot of configurations, use The most convenient, wherein Hibernate is the Object Relation Mapping frame of an open source code Frame, MyBatis is the excellent of the common SQL query of support, storing process and senior mapping Elegant Persistence Layer Framework.
Summary of the invention
In view of this, the purpose of the embodiment of the present invention is to provide a kind of based on Ehcache Data persistence method, Apparatus and system is to solve the problems referred to above.
A kind of based on Ehcache data persistence side that the embodiment of the present invention provides Method, including:
Ehcache caching server receives the first inquiry request that client is initiated;
Described Ehcache caching server judges described corresponding the treating of first inquiry request Whether inquiry data are stored in internal memory;
If it is, described Ehcache caching server returns and institute to described client State the data to be checked that the first inquiry request is corresponding;
If it does not, described Ehcache caching server initiates the second inquiry to data base Request, described Ehcache caching server receive described data base return with described The data to be checked that second inquiry request is corresponding, wherein, with described second inquiry request Corresponding data to be checked are represented by relational model data, and described Ehcache caches clothes The data to be checked that described relational model data are represented by business device are by POJO object (Plain Ordinary Java Object, simple Java object) is converted in internal memory The data that represent of data model, the data after converting write described Ehcache and delay Depositing in internal memory and the hard disk of server, described Ehcache caching server is to client Return described data to be checked.
A kind of based on Ehcache lasting data makeup that the embodiment of the present invention provides Put, including:
First receiver module, for receiving the first inquiry request that client is initiated;
Judge module, for judging the data to be checked that described first inquiry request is corresponding Whether it is stored in internal memory;
Enquiry module, when described data to be checked are not stored in described Ehcache caching Time in the internal memory of server, for initiating the second inquiry request to data base;
Second receiver module, for receiving the data to be checked returned from data base, Described data to be checked are relational model data;
Processing module, for leading to the data to be checked that described relational model data represent Cross the data that the data model that POJO object is converted in internal memory represents, after converting Data write in the internal memory of described Ehcache caching server and hard disk;
Result returns module, for returning described data to be checked to client.
A kind of based on Ehcache data persistence system that the embodiment of the present invention provides System, described system includes client, Ehcache caching server and data base,
Described client is used for, and sending the first inquiry to Ehcache caching server please Ask;
Described Ehcache caching server is used for, and receives and sends from described client The first inquiry request, it is judged that data to be checked corresponding to described first inquiry request are No it is stored in internal memory, if it is, return and described first inquiry to described client The data to be checked that request is corresponding, if it does not, initiate the second inquiry request to data base, Receive the to be checked number corresponding with described second inquiry request that described data base returns According to, the data to be checked that described relational model data represent are turned by POJO object Turning to the data that the data model in internal memory represents, the data write after converting is described In the internal memory of Ehcache caching server and hard disk, return described to be checked to client Ask data;
Described data base is used for, receive that described Ehcache caching server is initiated the Two inquiry request also return the to be checked data corresponding with described second inquiry request.
Compared with prior art, the number based on Ehcache that the embodiment of the present invention provides According to persistence method, Apparatus and system, use Ehcache caching, it is achieved that simultaneously Data are recorded so that after power-off, data quickly take from Ehcache in internal memory and hard disk Business device hard disk returns in internal memory, solves and traditional scheme uses Java caching only The problem that when causing power-off, data in EMS memory can be lost can be write data in internal memory. And it is no longer dependent on Hibernate and MyBatis etc. after using Ehcache caching Third party's framework, solves and needs Hibernate and MyBatis with Java caching The problem much configured Deng third party's framework.
For making the above-mentioned purpose of the present invention, feature and advantage to become apparent, Preferred embodiment cited below particularly, and coordinate appended accompanying drawing, it is described in detail below.
Accompanying drawing explanation
In order to be illustrated more clearly that the technical scheme of the embodiment of the present invention, below will be to reality Execute the required accompanying drawing used in example to be briefly described, it will be appreciated that the following drawings Illustrate only certain embodiments of the present invention, be therefore not construed as the limit to scope Fixed, for those of ordinary skill in the art, before not paying creative work Put, it is also possible to obtain other relevant accompanying drawings according to these accompanying drawings.
The server that Fig. 1 provides for present pre-ferred embodiments interacts with client Schematic diagram.
The square frame signal of a kind of service end that Fig. 2 provides for present pre-ferred embodiments Figure.
A kind of based on Ehcache data that Fig. 3 present pre-ferred embodiments provides are held The flow chart of longization method.
Fig. 4 is the function of a kind of lasting data gasifying device based on Ehcache of the present invention Module diagram.
Fig. 5 is a kind of based on Ehcache data that present pre-ferred embodiments provides The schematic diagram of persistent object system.
Main element symbol description:
Service end 100, client 200, network 300, data based on Ehcache Persistence device 110, memorizer 120, storage control 130, processor 140, Peripheral Interface the 150, first receiver module 111, judge module 112, enquiry module 113, Second receiver module 114, processing module 115, result return module 116, Ehcache Caching server 130, data base 120.
Detailed description of the invention
Below in conjunction with accompanying drawing in the embodiment of the present invention, to the skill in the embodiment of the present invention Art scheme is clearly and completely described, it is clear that described embodiment is only The a part of embodiment of the present invention rather than whole embodiments.Generally at accompanying drawing herein Described in and the assembly of the embodiment of the present invention that illustrates can come with various different configurations Arrange and design.Therefore, below to the embodiments of the invention provided in the accompanying drawings Describe the scope of claimed invention of being not intended to limit in detail, but only table Show the selected embodiment of the present invention.Based on embodiments of the invention, people in the art The every other embodiment that member is obtained on the premise of not making creative work, Broadly fall into the scope of protection of the invention.
It should also be noted that similar label and letter represent similar terms in following accompanying drawing, Therefore, the most a certain Xiang Yi accompanying drawing is defined, then in accompanying drawing subsequently not Need it to be defined further and explains.Meanwhile, in describing the invention, Term " first ", " second " etc. be only used for distinguish describe, and it is not intended that instruction or Hint relative importance.
As it is shown in figure 1, be service end 100 and the visitor of present pre-ferred embodiments offer The schematic diagram that family end 200 interacts.Described service end 100 is by network and one Or multiple client 200 is communicatively coupled, to carry out data communication or mutual.This In embodiment, described service end 100 may be, but not limited to, web (website) Server, ftp (file transfer protocol, file transfer protocol (FTP)) server etc.. Described client 200 may be, but not limited to, smart mobile phone, PC (personal computer, PC), panel computer, personal digital assistant (personal Digital assistant, PDA), mobile internet surfing equipment (mobile Internet device, MID) etc..Described network 300 may be, but not limited to, cable network or wireless Network.The operating system of described client 200 may be, but not limited to, Android (Android) system, IOS (iPhone operating system) system, Windows Phone system, Windows system etc..
As in figure 2 it is shown, be the block diagram of described service end 100.Described service End includes that the lasting data gasifying device 110 of Ehcache, memorizer 120, storage control Device 130, processor 140, Peripheral Interface 150.
Described memorizer 120, storage control 130, processor 140, Peripheral Interface 150 each elements are electrically connected with the most directly or indirectly, to realize the biography of data Defeated or mutual.Such as, these elements each other can be total by one or more communication Line or holding wire realize being electrically connected with.Described data query based on Ehcache and with Step device 110 includes that at least one can be with software or the form of firmware (firmware) It is stored in described memorizer 120 or is solidificated in the operating system of service end 100 Software function module in (operating system, OS).Described processor 140 For performing the executable module of storage, the most described Ehcache in memorizer 120 The software function module that includes of lasting data gasifying device 110 or computer program.
Wherein, memorizer 120 may be, but not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM) etc..Its In, memorizer 120 is used for storing program, and described processor 140 is receiving execution After instruction, performing described program, aforementioned embodiment of the present invention any embodiment discloses Flow through the method performed by the server of Cheng Dingyi to can apply in processor, or Realized by processor.
Processor 140 is probably a kind of IC chip, has the process energy of signal Power.Above-mentioned processor 140 can be general processor, including central processing unit (Central Processing Unit is called for short CPU), network processing unit (Network Processor is called for short NP) etc.;Can also is that digital signal processor (DSP), special IC (ASIC), ready-made programmable gate array (FPGA) or Other PLDs, discrete gate or transistor logic, discrete hardware Assembly.Can realize or perform the disclosed each method in the embodiment of the present invention, step Rapid and logic diagram.General processor can be microprocessor or this processor also may be used To be the processor etc. of any routine.
Described Peripheral Interface 150 various input/output devices are coupled to processor and Memorizer.In certain embodiments, Peripheral Interface, processor and storage control Can realize in one single chip.In some other example, they can respectively by Independent chip realizes.
In the embodiment of the present invention, service end 100 is Ehcache caching server, Data query service is provided for client 200.
Fig. 3, is that the data based on Ehcache that present pre-ferred embodiments provides are held The flow chart of longization method.Below in conjunction with Fig. 3 the present embodiment is provided in The data persistence method of Ehcache is described in detail.
Step S310, the first of Ehcache caching server reception client initiation is looked into Ask request.
Preferably, before described step S310, also include a configuration service device Step:
Configuring described Ehcache caching server is the mould simultaneously writing internal memory and hard disk Formula.
Preferably, can arrange in the configuration file of described Ehcache caching server Parameter overflowToDisk be true.Configuration in this way, it is possible to realize Ehcache caching server reads while write internal memory.
Further, it is also possible to the configuration literary composition of described Ehcache caching server is set In part, parameter diskPersistent is true.After configuration in this way, when suddenly Power-off, Ehcache caching server can restore data to rapidly from hard disk In internal memory, it is possible to ensure to recover rapidly during Ehcache caching server fault, Convenient client query next time.
Step S320, described Ehcache caching server judges that described first inquiry please Whether the data to be checked asking corresponding are stored in internal memory, if it is, perform step S330, if it does not, perform step S340.
Traditional inquiry be first from hard disk by the digital independent of data base to internal memory In, inquire about from internal memory the most again.The method that the embodiment of the present invention provides, just At first, the internal memory of Ehcache caching server and hard disk are all not appoint What data, when receiving the inquiry of client, by data base from hard disk Digital independent, in Ehcache caching server internal memory, again returns to client, so After the data to be checked read be recorded Ehcache caching server internal memory and In hard disk, when client initiates the inquiry request of same data to be checked next time, Then directly can inquire about from Ehcache caching server internal memory, the most just can Reduce the time of reading database data from hard disk.
Step S330, described Ehcache caching server to described client return with The data to be checked that described first inquiry request is corresponding.
Step S340, described Ehcache caching server is initiated second to data base and is looked into Ask request.
Step S341, described Ehcache caching server receives described data base and returns The to be checked data corresponding with described second inquiry request, wherein, with described second Data to be checked corresponding to inquiry request are represented by relational model data, described Ehcache The data to be checked that described relational model data represent are passed through POJO by caching server The data that the data model that object is converted in internal memory represents, the data after converting are write Enter in internal memory and the hard disk of described Ehcache caching server.
Wherein, the data being stored in data base are the numbers represented by relational model data According to, it is stored in the data in Ehcache buffer service and returns to the data of client It is required for the data represented with the data model in internal memory, it is therefore desirable to by relational model The data that the data model that the second data that data represent are converted in internal memory represents.
Preferably, can be realized described relational model tables of data by POJO object The data that the data model that the data to be checked shown are converted in internal memory represents.
Further, described POJO object uses enumeration type definition.POJO object Use the simple data structure of enumeration type, achieve data base by simplest mode Data are to the mapping of JAVA type memory data, and accelerate data mapping performs effect Rate, the most also accelerates the speed of inquiry.
On the other hand, owing to the data to be checked after converting can be recorded every time In the hard disk of Ehcache caching server, when unexpected power-off, Ehcache caches clothes Business device can restore data to rapidly from the hard disk of Ehcache caching server In internal memory, it is possible to ensure to recover rapidly during Ehcache caching server fault.
Step S342, described Ehcache caching server is treated to described in client return Inquiry data.
The data persistence method based on Ehcache that the present embodiment provides, uses Ehcache caches, it is achieved that records data simultaneously in internal memory and hard disk, and leads to Cross configuration Ehcache server can also further make after power-off data quickly from Ehcache server hard disc returns in internal memory, solve in traditional scheme and use Java caching can only write data in internal memory data in EMS memory when causing power-off and can lose The problem lost, and use Ehcache caching to be no longer dependent on Hibernate and Third party's frameworks such as MyBatis, solve need Hibernate with Java caching and The problem that third party's frameworks such as MyBatis much configure.On the other hand, use It is to be checked that the POJO object of enumeration type definition realizes representing relational model data The data that the data model that inquiry data are converted in internal memory represents, accelerate what data mapped Execution efficiency, inquiry velocity is accelerated.
Refer to Fig. 4, be present pre-ferred embodiments provide Fig. 2 shown in based on The high-level schematic functional block diagram of the lasting data gasifying device 110 of Ehcache.Described based on The lasting data gasifying device 110 of Ehcache includes the first receiver module 111, judges mould Block 112, enquiry module the 113, second receiver module 114, processing module 115 and Result returns module 116.
Described first receiver module 111, for receiving the first inquiry that client is initiated Request;
Preferably, receive, at described first receiver module, the first inquiry that client is initiated Also including before request configuring module, described configuration module is used for configuring described Ehcache Caching server is the pattern simultaneously writing internal memory and hard disk.
Preferably, described configuration module arranges joining of described Ehcache caching server Put in parameter overflowToDisk in file and parameter diskPersistent at least One parameter is true.Configuration parameter overflowToDisk is true, it is possible to realize Ehcache caching server reads while write internal memory.Configuration parameter diskPersistent is Very, it is possible to ensure to recover rapidly during Ehcache caching server fault, convenient Client query next time.
Described judge module 112, for judging described corresponding the treating of first inquiry request Whether inquiry data are stored in internal memory;
Described enquiry module 113, when described data to be checked are not stored in described Time in the internal memory of Ehcache caching server, for initiating the second inquiry to data base Request;
Described second receiver module 114, for receive from data base return to be checked Asking data, described data to be checked are relational model data;
Described processing module 115, to be checked for what described relational model data were represented Ask the data that data are represented by the data model that POJO object is converted in internal memory, Data after converting write internal memory and the hard disk of described Ehcache caching server In;
Further, described POJO object uses enumeration type definition.POJO object Achieve the database data mapping to Java type data, therefore use enumeration type Simple data structure, simplify the mapping relations of data, therefore accelerate inquiry Speed.
Described result returns module 116, for returning described number to be checked to client According to.
The most each module can be by software code realization, now, and above-mentioned each module Can be stored in the memorizer of Ehcache caching server.The most each module equally may be used To be realized by hardware such as IC chip.
Refer to Fig. 5, be that the one of present pre-ferred embodiments offer is based on Ehcache Data persistence system, including client 200, Ehcache caching server 130 And data base 120,
Described client 200 is used for, and sends to Ehcache caching server 110 One inquiry request;
Described Ehcache caching server 130 is used for, and receives from described client 200 the first inquiry request sent, it is judged that corresponding to be checked of described first inquiry request Ask data whether be stored in internal memory, if it is, to described client 200 return with The data to be checked that described first inquiry request is corresponding, if it does not, to data base 120 Initiate the second inquiry request, receive looking into described second of described data base 120 return Asking the data to be checked that request is corresponding, described relational model data represented is to be checked The data that the data model that data are converted in internal memory by POJO object represents, will Data after conversion write internal memory and the hard disk of described Ehcache caching server 130 In, return described data to be checked to client 200;
Described data base 120 is used for, and receives described Ehcache caching server 130 The second inquiry request the return initiated are corresponding with described second inquiry request to be checked Data.
It should be noted that each embodiment in this specification all uses the side gone forward one by one Formula describes, and what each embodiment stressed is the difference with other embodiments, Between each embodiment, identical similar part sees mutually.
Lasting data gasifying device based on Ehcache that the embodiment of the present invention is provided and System, its technique effect realizing principle and generation is identical with preceding method embodiment, For briefly describing, the not mentioned part of device embodiment part, refer to preceding method real Execute corresponding contents in example.
In several embodiments provided herein, it should be understood that disclosed Apparatus and method, it is also possible to realize by another way.Device described above Embodiment is only that schematically such as, flow chart and block diagram in accompanying drawing show The device of multiple embodiments according to the present invention, method and computer program product can Architectural framework, function and the operation that can realize.In this, in flow chart or block diagram Each square frame can represent a module, program segment or a part for code, described A part for module, program segment or code comprises one or more for realizing regulation The executable instruction of logic function.It should also be noted that at some as the realization replaced In mode, the function that marked in square frame can also be marked in accompanying drawing to be different from Order occurs.Such as, two continuous print square frames can essentially perform substantially in parallel, They can also perform sometimes in the opposite order, and this is depending on involved function. It is also noted that each square frame in block diagram and/or flow chart and block diagram and/ Or the combination of the square frame in flow chart, can be with performing the function of regulation or the special of action Hardware based system realize, or can refer to computer with specialized hardware The combination of order realizes.
It addition, each functional module in each embodiment of the present invention can be integrated in one Rise and form an independent part, it is also possible to be modules individualism, it is also possible to Two or more modules are integrated to form an independent part.
If described function realizes and as independent product using the form of software function module When product are sold or use, can be stored in a computer read/write memory medium. Based on such understanding, technical scheme is the most in other words to prior art The part of the part contributed or this technical scheme can be with the form of software product Embodying, this computer software product is stored in a storage medium, if including Dry instruction with so that computer equipment (can be personal computer, server, Or the network equipment etc.) perform the whole or portion of method described in each embodiment of the present invention Step by step.And aforesaid storage medium includes: USB flash disk, portable hard drive, read-only storage Device (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store program The medium of code.It should be noted that in this article, such as the first and second grades it The relational terms of class is used merely to an entity or operates and another entity or behaviour Make a distinction, and not necessarily require or imply existence between these entities or operation The relation of any this reality or order.And, term " includes ", " comprising " or Its any other variant of person is intended to comprising of nonexcludability, so that include one The process of list of elements, method, article or equipment not only include those key elements, and And also include other key elements being not expressly set out, or also include for this process, The key element that method, article or equipment are intrinsic.In the case of there is no more restriction, The key element limited by statement " including ... ", it is not excluded that including described key element Process, method, article or equipment in there is also other identical element.
The foregoing is only the preferred embodiments of the present invention, be not limited to this Invention, for a person skilled in the art, the present invention can have various change and Change.All within the spirit and principles in the present invention, any amendment of being made, equivalent Replacement, improvement etc., should be included within the scope of the present invention.It should also be noted that Similar label and letter in following accompanying drawing represent similar terms, therefore, once certain One is defined in an accompanying drawing, then need not carry out it in accompanying drawing subsequently Definition and explanation further.
The above, the only detailed description of the invention of the present invention, but the protection of the present invention Scope is not limited thereto, and any those familiar with the art is in the present invention In the technical scope disclosed, change can be readily occurred in or replace, all should contain at this Within bright protection domain.Therefore, protection scope of the present invention should described be wanted with right The protection domain asked is as the criterion.

Claims (10)

1. a data persistence method based on Ehcache, it is characterised in that bag Include:
Ehcache caching server receives the first inquiry request that client is initiated;
Described Ehcache caching server judges described corresponding the treating of first inquiry request Whether inquiry data are stored in internal memory;
If it is, described Ehcache caching server returns and institute to described client State the data to be checked that the first inquiry request is corresponding;
If it does not, described Ehcache caching server initiates the second inquiry to data base Request, described Ehcache caching server receive described data base return with described The data to be checked that second inquiry request is corresponding, wherein, with described second inquiry request Corresponding data to be checked are represented by relational model data, and described Ehcache caches clothes The data to be checked that described relational model data represent are turned by business device by POJO object Turning to the data that the data model in internal memory represents, the data write after converting is described In the internal memory of Ehcache caching server and hard disk, described Ehcache caching server Described data to be checked are returned to client.
Method the most according to claim 1, it is characterised in that described Ehcache Before caching server receives the first inquiry request that client is initiated, including:
Configuring described Ehcache caching server is the mould simultaneously writing internal memory and hard disk Formula.
Method the most according to claim 2, it is characterised in that described configuration institute Stating Ehcache caching server is the pattern simultaneously writing internal memory and hard disk, including:
Parameter in the configuration file of described Ehcache caching server is set OverflowToDisk is true.
Method the most according to claim 2, it is characterised in that described configuration institute Stating Ehcache caching server is the pattern simultaneously writing internal memory and hard disk, including:
Parameter in the configuration file of described Ehcache caching server is set DiskPersistent is true.
Method the most according to claim 1, it is characterised in that described POJO Object uses enumeration type definition.
6. a lasting data gasifying device based on Ehcache, it is characterised in that bag Include:
First receiver module, for receiving the first inquiry request that client is initiated;
Judge module, for judging the data to be checked that described first inquiry request is corresponding Whether it is stored in internal memory;
Enquiry module, when described data to be checked are not stored in described Ehcache caching Time in the internal memory of server, for initiating the second inquiry request to data base;
Second receiver module, for receiving the data to be checked returned from data base, Described data to be checked are relational model data;
Processing module, for leading to the data to be checked that described relational model data represent Cross the data that the data model that POJO object is converted in internal memory represents, after converting Data write in the internal memory of described Ehcache caching server and hard disk;
Result returns module, for returning described data to be checked to client.
Device the most according to claim 6, it is characterised in that described POJO Object uses enumeration type definition.
Device the most according to claim 6, it is characterised in that also include configuration Module, described configuration module is used for configuring described Ehcache caching server for simultaneously Write the pattern of internal memory and hard disk.
Device the most according to claim 8, it is characterised in that described configuration institute Stating Ehcache caching server is the pattern simultaneously writing internal memory and hard disk, including:
Parameter in the configuration file of described Ehcache caching server is set OverflowToDisk is true with at least one parameter in parameter diskPersistent.
10. a data persistence system based on Ehcache, it is characterised in that Described system includes client, Ehcache caching server and data base,
Described client is used for, and sending the first inquiry to Ehcache caching server please Ask;
Described Ehcache caching server is used for, and receives and sends from described client The first inquiry request, it is judged that data to be checked corresponding to described first inquiry request are No it is stored in internal memory, if it is, return and described first inquiry to described client The data to be checked that request is corresponding, if it does not, initiate the second inquiry request to data base, Receive the to be checked number corresponding with described second inquiry request that described data base returns According to, the data to be checked that described relational model data represent are turned by POJO object Turning to the data that the data model in internal memory represents, the data write after converting is described In the internal memory of Ehcache caching server and hard disk, return described to be checked to client Ask data;
Described data base is used for, receive that described Ehcache caching server is initiated the Two inquiry request also return the to be checked data corresponding with described second inquiry request.
CN201610166005.0A 2016-03-22 2016-03-22 Data persistence method, device and system based on Ehcache Expired - Fee Related CN105843892B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610166005.0A CN105843892B (en) 2016-03-22 2016-03-22 Data persistence method, device and system based on Ehcache

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610166005.0A CN105843892B (en) 2016-03-22 2016-03-22 Data persistence method, device and system based on Ehcache

Publications (2)

Publication Number Publication Date
CN105843892A true CN105843892A (en) 2016-08-10
CN105843892B CN105843892B (en) 2020-06-30

Family

ID=56587987

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610166005.0A Expired - Fee Related CN105843892B (en) 2016-03-22 2016-03-22 Data persistence method, device and system based on Ehcache

Country Status (1)

Country Link
CN (1) CN105843892B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108153812A (en) * 2017-11-24 2018-06-12 广州高清视信数码科技股份有限公司 Method, apparatus, computer equipment and the storage medium of data communication
CN108182187A (en) * 2016-12-08 2018-06-19 腾讯科技(深圳)有限公司 Data cache method and device
WO2019028988A1 (en) * 2017-08-10 2019-02-14 上海壹账通金融科技有限公司 Data processing method, electronic device and computer readable storage medium
CN109656957A (en) * 2018-12-14 2019-04-19 中国银行股份有限公司 Data query method and device based on Persistence Layer Framework
CN109933585A (en) * 2019-02-22 2019-06-25 京东数字科技控股有限公司 Data query method and data query system
WO2023060943A1 (en) * 2021-10-14 2023-04-20 华为技术有限公司 Traffic control method and apparatus

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101984421A (en) * 2010-09-03 2011-03-09 中国科学院软件研究所 Real-time database based meteorological element data organization type-in and querying method
CN102156717A (en) * 2011-03-25 2011-08-17 中国有色矿业集团有限公司 Method and device for mapping entity object into database
US20120016904A1 (en) * 2009-09-30 2012-01-19 Amitt Mahajan System and Method for Remote Updates
CN103116627A (en) * 2013-01-31 2013-05-22 汉柏科技有限公司 Database access method with high concurrency service-oriented architecture (SOA) technology and system
CN105302568A (en) * 2015-11-13 2016-02-03 山东中创软件工程股份有限公司 Method for establishing Web development framework and Web development framework

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120016904A1 (en) * 2009-09-30 2012-01-19 Amitt Mahajan System and Method for Remote Updates
CN101984421A (en) * 2010-09-03 2011-03-09 中国科学院软件研究所 Real-time database based meteorological element data organization type-in and querying method
CN102156717A (en) * 2011-03-25 2011-08-17 中国有色矿业集团有限公司 Method and device for mapping entity object into database
CN103116627A (en) * 2013-01-31 2013-05-22 汉柏科技有限公司 Database access method with high concurrency service-oriented architecture (SOA) technology and system
CN105302568A (en) * 2015-11-13 2016-02-03 山东中创软件工程股份有限公司 Method for establishing Web development framework and Web development framework

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
关海生: "数据缓存实现快速数据访问的设计", 《中国优秀硕士学位论文全文数据库·信息科技辑》 *
周莉: "E基于Hibernate的网络学习系统的设计与实现", 《中国优秀硕士学位论文全文数据库·信息科技辑》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108182187A (en) * 2016-12-08 2018-06-19 腾讯科技(深圳)有限公司 Data cache method and device
WO2019028988A1 (en) * 2017-08-10 2019-02-14 上海壹账通金融科技有限公司 Data processing method, electronic device and computer readable storage medium
CN108153812A (en) * 2017-11-24 2018-06-12 广州高清视信数码科技股份有限公司 Method, apparatus, computer equipment and the storage medium of data communication
CN109656957A (en) * 2018-12-14 2019-04-19 中国银行股份有限公司 Data query method and device based on Persistence Layer Framework
CN109933585A (en) * 2019-02-22 2019-06-25 京东数字科技控股有限公司 Data query method and data query system
CN109933585B (en) * 2019-02-22 2021-11-02 京东数字科技控股有限公司 Data query method and data query system
WO2023060943A1 (en) * 2021-10-14 2023-04-20 华为技术有限公司 Traffic control method and apparatus

Also Published As

Publication number Publication date
CN105843892B (en) 2020-06-30

Similar Documents

Publication Publication Date Title
CN105843892A (en) Data persistence method, device and system based on Ehcache
CN105391811B (en) domain name resolution method, access method of application server and terminal thereof
US9686152B2 (en) Techniques for tracking resource usage statistics per transaction across multiple layers of protocols
CN101571876B (en) Script program operation logic expansion method, server and client
CN105843895A (en) EhCache-based data querying and synchronizing method, device and system
CN103092996B (en) Document data acquisition device and bills data acquisition methods
CN108108324B (en) PCIE (peripheral component interface express) expansion method and device
CN106506715A (en) Domain name analytic method and device
CN102082800A (en) User request processing method and server
CN110737682A (en) cache operation method, device, storage medium and electronic equipment
CN102377737B (en) The system and method for the interactive email access protocol server of a kind of many account access
CN104657435A (en) Storage management method for application data and network management system
CN111949832A (en) Method and device for analyzing dependency relationship of batch operation
CN102984260A (en) Internet account number and password information management method and system
CN105681380A (en) Client offline method and system thereof
CN107247695A (en) Coding rule generation method, system and storage device
CN110661851A (en) Data exchange method and device
CN107766230A (en) A kind of method and apparatus tested based on configuration file
Singhal et al. Sustainable manufacturing integrated into cloud-based data analytics for e-commerce SMEs
CN104615426A (en) Method, device and terminal for operating multiple systems
CN105024949A (en) Port automatically binding method and system
CN103595618A (en) Method, server and system for maintaining instant communication session continuity
JP2009520261A (en) Participant-selective event synchronization for portable electronic devices
CN103678312A (en) Method and client terminal for recommending website
US11640279B2 (en) Apparatuses and methods for pseudo-random number generation

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200630

Termination date: 20210322