Invention content
This specification one or more embodiment describes a kind of method and apparatus, is able to verify that data cached and current number
According to the consistency of table data, to ensure that the data obtained from caching are correct, to further increase having for data query
Effect property.
According in a first aspect, provide a kind of method of data query, including:
Receive inquiry request, wherein the inquiry request includes query argument;
It detects and whether there is cache object corresponding with the query argument in buffer zone;
In the case where there is cache object corresponding with the query argument, first version information and the second edition are obtained
This information, the first version information are the corresponding tables of data version informations of the cache object, and the second edition information is
The version information of current data table in database, wherein being at least stored with the first tables of data and the second data in the database
Table, first tables of data and the second tables of data are configured as the conduct current data table, remaining is as Backup Data
Table;
Judge the consistency of first version information and second edition information;
Under the first version information and second edition information unanimous circumstances, tied the cache object as inquiry
Fruit.
Embodiment according to one aspect, the method further include:
There is no cache object corresponding with the query argument or the first version information and the second edition
In the case that information is inconsistent,
According to the query argument to current data table described in the data base querying;
According to the data returned from the database, query result is generated.
In a possible design, after generating query result, further include:
According to the cache object in the query result update buffer zone generated.
Further, in one embodiment, according to the cache object in the query result update buffer zone generated
Including:
It is added to the query result of generation as cache object in the buffer zone;
The version information of the current data table is saved as to the version information of the cache object.
In one embodiment, the method further includes:
The version information of current data table is obtained from database according to first time interval;
The version information of current data table is stored in and is locally configured in table.
In one embodiment, the acquisition first version information and second edition information include:
The second edition information is obtained from described be locally configured in table.
According to a kind of possible design, the version information of current data table is stored in and table is locally configured includes:
The version information of the acquired current data table of detection and the version that the current data table preserved in table is locally configured
Whether information is consistent;And
In the case of inconsistencies, it is locally configured in table according to the update of the version information of acquired current data table current
The version information of tables of data.
In one embodiment, the database includes tables of data repository, and the tables of data repository is used for, when predetermined
When condition meets, switch the current data table and Backup Data table status of the first tables of data and the second tables of data;
The version information for obtaining current data table from database according to first time interval includes:
The version information of current data table is obtained from the tables of data repository.
According to some embodiments, the predetermined condition includes at least one of the following:
Complete the update of Backup Data table;
Meet the second time interval of tables of data switching;
There is predetermined mistake in current data table.
In some possible designs, the version information of current data table include it is following in it is one or more:Version mark
Know, timestamp.
According to second aspect, a kind of device of data query is provided, including:
Receiving unit is configured to receive inquiry request, wherein the inquiry request includes query argument;
Detection unit is configured to whether there is cache object corresponding with the query argument in detection buffer zone;
Acquiring unit is configured to, in the case where there is cache object corresponding with the query argument, obtain first
Version information and second edition information, the first version information are the corresponding tables of data version information of the cache object, institute
The version information that second edition information is current data table in database is stated, wherein being at least stored with the first number in the database
According to table and the second tables of data, first tables of data and the second tables of data are configured as the conduct current data table,
It is remaining to be used as Backup Data table;
Comparison unit is configured to judge the consistency of first version information and second edition information;
Determination unit is configured under the first version information and second edition information unanimous circumstances, will be described slow
Object is deposited as query result.
According to the third aspect, a kind of computer readable storage medium is provided, computer program is stored thereon with, when described
When computer program executes in a computer, enable computer execute first aspect method.
According to fourth aspect, a kind of computing device, including memory and processor are provided, which is characterized in that described to deposit
It is stored with executable code in reservoir, when the processor executes the executable code, the method for realizing first aspect.
The method and apparatus provided by this specification embodiment, after receiving inquiry request, detecting in buffer zone is
It is no to there is cache object corresponding with query argument included in inquiry request, it is corresponding with above-mentioned query argument existing
Cache object in the case of, obtain first version information and second edition information, wherein first version information is cache object
Corresponding tables of data version information, second edition information are the version informations of current data table in database, in database at least
The first tables of data and the second tables of data of storage are configured as one and are used as current data table, remaining is as Backup Data table;So
Afterwards, the consistency for judging first version information and second edition information, it is consistent with second edition information in first version information
In the case of, using cache object as query result.In this way, data cached and current data table data consistency can be verified,
To ensure that the data obtained from caching are correct, to improve the validity of data query.
Specific implementation mode
Below in conjunction with the accompanying drawings, the scheme provided this specification is described.
Fig. 1 is the implement scene schematic diagram of one embodiment that this specification discloses.As shown, can in searching platform
The inquiry request of user is received and handled by client.Further include database in searching platform, is at least protected in database
Two parts of tables of data are deposited, one is used as current data table, another has as Backup Data table, current data table as inquiry
Tables of data is imitated, for providing service for the inquiry of client, Backup Data table can receive new collected data.Tables of data
When data update, it can be identified by different version informations (such as renewal time etc.).In practice, database can be set
In client, the server end that support is provided for client can also be located at, can also be located at storage platform (such as block chain,
Cloud storage etc.), the application is not construed as limiting this.
In practical applications, inquiring client terminal is rung when handling the inquiry request of user in order to improve query rate and shorten
Between seasonable, the various data (such as account balance etc. of financing account) that can inquire user are preserved as cache object
In buffer zone.Wherein, it in inquiry request may include query argument, such as the inquiry nearest 5 days expenditures of Alipay, inquiry ginseng
Number may include corresponding Alipay account information, time parameter " 5 days ", type parameter " expenditure " etc..Client receives
In the case of inquiry request, first have to inquire data from local buffer zone.When inquiring corresponding cache object, it is
Ensure that cache object is consistent with the data in database current data table, client will further carry out cache object
From the version information of tables of data and the consistency of version information of current data table judged.Due to meeting when tables of data updates
Update version information, as long as therefore version information it is consistent, then show the data one in cache object and database current data table
It causes.In practice, client can together preserve the corresponding tables of data version information of cache object when preserving cache object.
It so can be under the data unanimous circumstances in cache object and database current data table, using cache object as inquiry
As a result user is fed back to, without being inquired from the current data table of database again.In this way, can verify data cached and work as
The consistency of preceding data table data ensures using the cache object obtained from buffer zone as query result to be correct.
According to a kind of embodiment, respective cache object or cache object and data are not being inquired in the buffer
In the case that the version information of library current data table is inconsistent, client can also from data base querying current data table, according to
The data of return generate query result.In this way, can in the buffer without cache object or cache object with current data table not
When consistent, from data base querying data, correct data are obtained in time.
In one embodiment, client, which can be spaced to schedule from database, obtains current data table
Version information, and the version information of current data table is stored in and is locally configured in table.In this way, can grasp in database in time
The release status of current data table, and in the inquiry request for receiving user, know current data table by the way that table is locally configured
Version information, without temporarily again to the version information of data base querying current data table.
The specific executive mode of above procedure is described below.
Fig. 2 shows the method flow diagrams according to the data query of one embodiment.The executive agent of this method can be appointed
What has calculating, the system of processing capacity, unit or platform, such as client shown in FIG. 1 etc..As shown in Fig. 2, should
Method includes the following steps:Step 21, inquiry request is received, wherein above-mentioned inquiry request includes query argument;Step 22, it examines
It surveys and whether there is cache object corresponding with above-mentioned query argument in buffer zone;Step 23, exist and above-mentioned inquiry ginseng
In the case of the corresponding cache object of number, first version information and second edition information are obtained, first version information is caching
The corresponding tables of data version information of object, second edition information are the version information of current data table in database, wherein data
The first tables of data and the second tables of data are at least stored in library, the first tables of data and the second tables of data are configured as a conduct and work as
Preceding tables of data, remaining is as Backup Data table;Step 24, judge the consistency of first version information and second edition information;Step
Rapid 25, under first version information and second edition information unanimous circumstances, using above-mentioned cache object as query result.
First, in step 21, inquiry request is received, wherein above-mentioned inquiry request includes query argument.Inquiry request is for example
It can be HTTP request etc..It is appreciated that each inquiry request has corresponding querying method or query function, this is also known as looked into
Ask interface.One inquiry request can call relevant inquiring interface to transmit query argument.Each inquiry request may be called equally
Query interface, but have different parameters.Therefore, may include having query argument in inquiry request.A such as inquiry
Request is the amount paid in certain payment platform in user 5 days, another inquiry request is one week certain payment platform of inherence of user
Amount paid, their query argument relates separately to:Time parameter " 5 days ", platform parameters " certain payment platform ", type parameter
" expenditure ", target component " amount of money " and time parameter " one week ", platform parameters " certain payment platform ", type parameter " expenditure ", mesh
Mark parameter " amount of money ".
By the query argument in the inquiry request, corresponding data in database can be obtained.Such as it is asked by inquiry
The query argument time parameter " this month " for including, type parameter " residue is available ", target component " amount " etc. are asked, it can be from data
Library acquisition this month, can use amount with full amount and this month.
In some implementations, inquiry request can also include the querying condition being defined to query result, for example, user
By the amount paid of certain payment platform net purchase in 5 days, querying condition defines that the amount paid in be inquired 5 days is to be used for
Net purchase is carried out by certain payment platform.
Inquiry request can be by user by being initiated with interacting for client human-computer interaction interface, can also be by it
What the calling of his application program was initiated, the application is not construed as limiting this.For example, the financing analysis of certain payment platform client
Module can be by calling relevant inquiring interface to initiate inquiry request, to inquire in user one month in the various of the payment platform
Expenditure and income information.Certain payment platform client can receive the query statement that user is inputted by the query page of client
Inquiry request is initiated, user can also be received, the click of query argument is selected to send out in the table of client human-computer interaction interface
Play inquiry request.
Then, it in step 22, detects and whether there is cache object corresponding with above-mentioned query argument in buffer zone.It can
To understand, caching is the buffering area of data exchange, is to carry out the memory of high-speed data exchange.It buffer zone can be by history
Data temporary storage is multiple entries, and data are exchanged prior to memory and processor.Cache entries may include that table, event are retouched
It states, the storage form of key-value pair (key-va l ue) etc..One cache entries or a part of of cache entries can be referred to as
Cache object.
By taking key-value pair as an example, each key values can correspond to one or more va l ue values.Historical query is recorded,
Can be using query argument as key values, query result is as va l ue values, when being stored in buffer zone.For example, will inquiry
Parameter:Time parameter " 5 days ", platform parameters " certain payment platform ", type parameter " expenditure " etc. are used as key values, query result
" 5000 yuan " are used as va l ue values.At this point it is possible to which " 5000 yuan " of va l ue values in cache entries are referred to as to look into above-mentioned
Ask the corresponding cache object of parameter.In one embodiment, a version can also be added to the query result as va l ue values
This attribute tags, to show the version information of the tables of data in query result source, for example, it is " 5000 that va l ue values, which preserve content,
First .201805100900 ", wherein 201805100900 be the version information of the derived data table of query result, such as indicating should
Derived data table version is the more new version at 9 o'clock of on May 10th, 2018.In a kind of possible design, key values can also be
To the obtained vocabulary group of query argument extraction keyword, such as " certain payment platform 5 days in amount paid " etc..
After receiving inquiry request, first the query argument in inquiry request can be matched with cache entries.
Still by taking cache entries are the storage forms of key-value pair as an example, it can be matched with each key values by query argument, be matched to and inquire
When the consistent key values of parameter, corresponding va l ue values, i.e., cache object corresponding with query argument are obtained according to key values.
Stored inside key values be crucial phrase at vocabulary group in the case of, the inquiry language that can also will include according to inquiry request
Sentence carries out cutting word, removal function word processing, obtains query argument and is matched with key values.Matching said herein can be completely accurately
Matching can also be the matching replaced by nearly justice, such as the time parameter in query argument is " last month ", can be according to current
2018 time of inquiry was matched to key values " 2018.4 " or " 201804 " etc. May 10.
From caching Region Matching to respective cache entry, determines in buffer zone and exist and query argument phase
Otherwise cache object corresponding with query argument is not present in corresponding cache object in buffer zone.
Then, in step 23, in the case where there is cache object corresponding with above-mentioned query argument, the first edition is obtained
This information and second edition information.
As previously mentioned, in order to ensure the normal work of storage system on line in this process, the number of storage system on line
The method of AB tables is often used to realize according to table, i.e.,:The first tables of data and the second tables of data, the first number are at least stored in database
It is configured as one according to table and the second tables of data and is used as current data table, remaining is as Backup Data table.First tables of data and
Two tables of data can be used alternatingly, and be configured as that tables of data of current data table, and the business such as inquiry are provided for database,
It is remaining to be used as Backup Data table.The business datum anticipated can be synchronized by data synchronization means to Backup Data table.
As previously mentioned, cache object from historical query as a result, and historical query result derive from historical query when number
According to the current data table in library.For the first tables of data and the second tables of data in database, if only indicating tables of data
Which table is name, then can only know from and inquire data, and it is data when that can not know inquired data.Example
Such as, tables of data tb_0 and tb_1, tables of data tb_0 were used May 1, tables of data tb_1 was used May 2, in May 3
It is switched to the tables of data tb_0 after having updated 2 number in May days again to use, if saved by tables of data tb_0 May 1
Cache object, in the tables of data tb_0 that May 3 used, the corresponding data of identical query argument may have occurred that change
Change, cache object may be inaccurate.Therefore, for the more new state of mark data table, after the completion of each tables of data update
A version information can be added.
This version information can include but is not limited to it is following in it is one or more:Table name, version identifier, time
Stamp.Version identifier can be a string of characters of mark update order, such as can be 2.1.3.5 etc., and tables of data often updates one
Secondary, version identifier variation is primary, such as version number becomes 2.1.3.6 after update;Timestamp can be used to indicate that the one of time
String character, such as 201805100900.Timestamp can indicate that tables of data updates the deadline, can also identify the newer number of institute
According to acquisition time, indicate that the newer data of tables of data institute are 10 days 09 Mays in 2018 such as 201805100900:It is adopted before 00
The data of collection.Table name, such as tb_0;Usually, table name need to be combined with sundry item, and common unique mark goes out the currently active
The version information of table.
In this way, when inquiring data from the current data table of database according to query argument, current data can also be obtained
The version information of table.When query result is saved as cache object, the query result derived data table can also be preserved simultaneously
Version information as the corresponding tables of data version information of cache object.Here first version information is that cache object is corresponding
Tables of data version information, and second edition information, when being this inquiry, as the tables of data version of current data table in database
Information.In one embodiment, first version information can be stored in buffer zone as a part for cache object.
In one embodiment, it for second edition information, can determine in the presence of corresponding with the query argument
In the case of cache object, read from database.
In another embodiment, it can also be obtained from database according to scheduled first time interval (such as 10 minutes)
The version information of current data table, which is stored in, to be locally configured in table.In this way, can determine in the presence of opposite with the query argument
In the case of the cache object answered, acquisition second edition information is locally configured in table from described, to avoid in query process to
Database causes stress.Wherein, the process of the version information of current data table is obtained from database can be and data query
Flow mutually execute side by side, in other words, can by scheduled first time interval no matter either with or without data query is carried out
The version information of current data table is obtained from database.Optionally, in the version letter for obtaining current data table from database
After breath, it can also first detect the version information of acquired current data table and the current data table preserved in table is locally configured
Whether version information is consistent;And in the case of inconsistencies, this is updated according to the version information of acquired current data table
The version information of current data table in ground allocation list.Here, table, which is locally configured, can be located at buffer zone, can also be located at other
Storage region, the application are not construed as limiting this.
In some possible designs, database includes tables of data repository, and tables of data repository is used for the first data
Table and the second tables of data are configured to one and are used as current data table, remaining is as Backup Data table.As shown in figure 3, data configuration
Library 31 can be document, can be table, can also be that a subdata base in above-mentioned database, the application do not limit.
Data configuration library 31 can record the data table information of the first tables of data 32 and the second tables of data 33, such as may include tables of data
Name, data table status (current data table or Backup Data table are identified with 0,1 in Fig. 3), timestamp etc..
Tables of data repository can be provided with predetermined condition, when predetermined condition meets, tables of data repository switching first
The current data table and Backup Data table status of tables of data and the second tables of data.In this way, according to scheduled first time interval from
The version information of acquisition current data table includes just in database:The version letter of current data table is obtained from tables of data repository
Breath.Tables of data repository can indicate the configuration status of tables of data by status indicator etc., for example, the tables of data repository of Fig. 3
In 31, the status indicator position of the first tables of data is 0, indicates that the first tables of data is configured as current data table, the second tables of data
Status indicator position is 1, and the second tables of data of mark is configured as Backup Data table.
In one embodiment, predetermined condition may include:Complete the update of Backup Data table.It can be in Backup Data table
Backup Data table is switched to current data table when update is completed, for example, being switched to the feelings of tables of data tb_0 in current data table
Under condition, start to update the data table tb_1, tables of data tb_1 updates are completed, i.e., tables of data tb_1 are switched to current data table, opened
Begin to update the tables of data tb_0 for being switched to Backup Data table.In this way, the real-time higher of current data table can be made.
In another embodiment, predetermined condition may include:Meet the second time interval of tables of data switching.For example,
Preliminary setting data table switching the second time interval, such as 24 hours, then each current data table using 24 hours when be switched
For Backup Data table.In this way, it is noon before that day 19 that inquiry can be made, which to have certain rule, the data such as inquired every time,:00
Preceding data.
In yet another embodiment, predetermined condition may include:There is predetermined mistake in current data table.Since tables of data passes through
Cross the data increment analyzed under line or full dose update, the problem of for being likely to occur during on-line checking can not full forecast,
It is possible that the case where current data table corrupt data.In practice, can in current data table use client it is various
Business is monitored, in the case where traffic fluctuations exceed preset range, it is believed that current data table corrupt data.At this point it is possible to
It configures current data table to Backup Data table, and the Backup Data table that preceding primary switching comes is reconfigured for current data
Table.
In more embodiments, can also have one that more are used to configure in the first tables of data and the second tables of data is
The predetermined condition of current data table.
Then, in step 24, judge the consistency of first version information and second edition information.
Judgement to the consistency of first version information and second edition information, the purpose is to cache object and database
Whether the data in middle current data table are unanimously judged.The content for including according to version information can believe first version
Breath and second edition information are compared, if just the same, it is determined that first version information is consistent with second edition information
, otherwise, the two is inconsistent.
Then, in step 25, under first version information and second edition information unanimous circumstances, by above-mentioned cache object
As query result.
If first version information is consistent with second edition information, illustrate cache object preservation is from database
The query result that the data inquired in current data table generate, even if being inquired once from the current tables of data again, generation is looked into
It askes result and the cache object is also consistent, it therefore, can be directly using the cache object as query result.
In this way, can be by verifying the data cached consistency with current data table data, to ensure to obtain from caching
Data be correct, to further increase the validity of data query.
According to a kind of embodiment, cache object corresponding with above-mentioned query argument is not present in buffer zone, or
In the case that person's first version information and second edition information are inconsistent, the flow of the data query can also include:
Step 26:According to query argument to data base querying current data table.Can to data base querying current data table,
To obtain and the relevant data of query argument, such as business record.For example, it is assumed that query argument include time parameter " most
Nearly 5 days ", platform parameters " certain payment platform ", type parameter " expenditure ", target component " amount of money ", then can be according to current time
On May 10th, 2018, the expenditure record on May 5th, 2018 to May 9 into data base querying current data table.
Step 27, according to the data returned from database, query result is generated.In practice, database may be provided only and be looked into
Function is ask, without having computing capability, therefore the data possibility returned from database can be directly as query result, it is also possible to
It needs to be further processed and could be used as query result.In the case where needing to be further processed the data returned from database,
Data process method can be determined according to query argument, then generate query result according to data process method processing data.
Again referring to the example above, query argument includes time parameter " nearest 5 days ", platform parameters " certain payment platform ", type parameter " branch
Go out ", target component " amount of money ", database return data be on May 5th, 2018 to May 9 expenditure record, it is determined that
Data process method can be the accumulative summation of the amount of money in the expenditure record by May 5th, 2018 to May 9, thus generate most
The total value of nearly 5 days amounts paid in payment platform is as query result.
In this way, finding that there is no cache object corresponding with query argument or existing cachings pair for buffer zone
In the case of being generated not according to the data of database current data table, then data are obtained from database in time, generates inquiry
As a result, maintaining the good experience of user.
In a possible design, after generating query result, further include:
Step 28, according to the cache object in the query result update buffer zone generated.
In one embodiment, cache object corresponding with query argument is not present in buffer zone, can be by this number
It is added in buffer zone as cache object according to the query result of query generation.At this point, can also be by the version of current data table
This information preservation is the version information of the cache object, so that subsequent query uses.
In another embodiment, there is cache object corresponding with query argument in buffer zone, but first version is believed
Breath and second edition information are inconsistent, that is, existing cache object generates not according to the data of database current data table
's.In this case it is opposite with query argument with buffer zone that the generated query result of this inquiry can further be detected
Whether the cache object answered is consistent, its version information is unanimously then updated to the version information of current database, inconsistent, uses
This is inquired generated query result and replaces former cache object, while replacing former caching pair with the version information of current database
The version information of elephant.Alternatively, former cache object can be deleted, the query result that this data query is generated is as cache object
It is added in buffer zone.
In this way, in the case where receiving the inquiry request comprising same queries parameter next time, it can be first from buffer area
The updated cache object is inquired in domain, and compares database this newer version information is inquired with this next time when
Whether the version information of current data table is consistent, and the updated cache object is directly taken under unanimous circumstances as inquiry
As a result, forming good circulation.
Above procedure is looked back, after receiving inquiry request, detects to whether there is in buffer zone and be wrapped with inquiry request
The corresponding cache object of query argument contained is sentenced in the case where there is cache object corresponding with above-mentioned query argument
The consistency of the second edition information of current data table in the first version information and database of disconnected cache object, if unanimously,
Using cache object as query result.In this way, data cached and current data table data consistency can be verified, with ensure from
The data obtained in caching are correct, to improve the validity of data query.
According to the embodiment of another aspect, a kind of device of data query is also provided.Fig. 4 is shown according to one embodiment
The schematic block diagram of device for data query.As shown in figure 4, the device 400 for data query includes:Receiving unit
41, it is configured to receive inquiry request, wherein inquiry request includes query argument;Detection unit 42 is configured to detection buffer zone
It is interior to whether there is cache object corresponding with query argument;Acquiring unit 43 is configured in the presence of corresponding with query argument
Cache object in the case of, obtain first version information and second edition information, wherein first version information is cache object
Corresponding tables of data version information, second edition information is the version information of current data table in database, wherein in database
It is at least stored with the first tables of data and the second tables of data, the first tables of data and the second tables of data are configured as one and are used as current number
According to table, remaining is as Backup Data table;Comparison unit 44 is configured to judge that first version information is consistent with second edition information
Property;Determination unit 45 is configured under first version information and second edition information unanimous circumstances, above-mentioned cache object is made
For query result.
Embodiment according to one aspect, device 400 further include version querying unit (not shown), are configured to:According to
One time interval obtains the version information of current data table from database;Using the version information of current data table as the second edition
This information preservation is in being locally configured table.In this way, acquiring unit 43 directly can get the second edition from being locally configured in table
Information.To avoid causing database pressure to database request data in query process.In one embodiment, current data
The version information of table include it is following in it is one or more:Table name, version identifier, timestamp.
Further, in one embodiment, which is additionally configured to:
The version information of the acquired current data table of detection and the version that the current data table preserved in table is locally configured
Whether information is consistent;And
In the case of inconsistencies, it is locally configured in table according to the update of the version information of acquired current data table current
The version information of tables of data.
Table is locally configured in this way, can only be updated when the version information of database current data table changes.Here,
Table, which is locally configured, can be located at buffer zone, can also be located at other storage regions, and the application is not construed as limiting this.
According to a kind of possible design, database may include tables of data repository, and tables of data repository is used for first
Tables of data and the second tables of data are configured to one and are used as current data table, remaining is as Backup Data table.Tables of data repository can
To indicate the configuration status of the first tables of data and the second tables of data by status indicator position.Tables of data repository can be stored with pre-
Fixed condition switches current data table and Backup Data table-like in the first tables of data and the second tables of data when predetermined condition meets
State.At this point, version querying unit is additionally configured to:The version information of current data table is obtained from tables of data repository.
In one embodiment, above-mentioned predetermined condition includes at least one of the following:Complete the update of Backup Data table;
Meet the second time interval of tables of data switching;There is predetermined mistake in current data table.
In one embodiment, device 400 further include:
Query unit 46 is configured to there is no cache object corresponding with above-mentioned query argument or first versions
In the case that information and second edition information are inconsistent, according to query argument to data base querying current data table, with obtain with
The relevant data of query argument, such as business record.
Generation unit 47 is configured to, according to the data returned from database, generate query result.It is needing to from database
In the case that the data of return are further processed, generation unit 47 can determine data process method according to query argument, then
Query result is generated according to data process method processing data.
In a possible design, device 400 further includes updating unit 48, is configured to:
After generation unit 47 generates query result, according to the caching in the query result update buffer zone generated
Object.Specifically:In the case that cache object corresponding with query argument is not present in buffer zone, updating unit 48 can incite somebody to action
The query result of generation is added to as cache object in buffer zone, and the version information of current data table is saved as this and is delayed
Deposit the version information of object;There is cache object corresponding with query argument, but first version information and second in buffer zone
In the case that version information is inconsistent, updating unit 48 can further detect this and inquire generated query result and caching
Whether cache object corresponding with query argument is consistent in region, its version information is then unanimously updated to current database
Version information, it is inconsistent, replace former cache object with this generated query result of inquiry, while with current database
Version information replaces the version information of former cache object.Alternatively, updating unit 48 can delete former cache object, by this data
The query result of query generation is added to as cache object in buffer zone.
By apparatus above, data cached and current data table data consistency can be verified, to ensure from caching
The data of acquisition are correct, to improve the validity of data query.
According to the embodiment of another aspect, a kind of computer readable storage medium is also provided, is stored thereon with computer journey
Sequence enables computer execute method described in conjunction with Figure 2 when the computer program executes in a computer.
According to the embodiment of another further aspect, a kind of computing device, including memory and processor, the memory are also provided
In be stored with executable code, when the processor executes the executable code, realize the method in conjunction with described in Fig. 2.
Those skilled in the art are it will be appreciated that in said one or multiple examples, work(described in the invention
It can be realized with hardware, software, firmware or their arbitrary combination.It when implemented in software, can be by these functions
Storage in computer-readable medium or as on computer-readable medium one or more instructions or code be transmitted.
Above-described specific implementation mode has carried out further the purpose of the present invention, technical solution and advantageous effect
It is described in detail, it should be understood that the foregoing is merely the specific implementation mode of the present invention, is not intended to limit the present invention
Protection domain, all any modification, equivalent substitution, improvement and etc. on the basis of technical scheme of the present invention, done should all
Including within protection scope of the present invention.