CN107153683A - The method and apparatus for realizing data query - Google Patents
The method and apparatus for realizing data query Download PDFInfo
- Publication number
- CN107153683A CN107153683A CN201710270745.3A CN201710270745A CN107153683A CN 107153683 A CN107153683 A CN 107153683A CN 201710270745 A CN201710270745 A CN 201710270745A CN 107153683 A CN107153683 A CN 107153683A
- Authority
- CN
- China
- Prior art keywords
- data
- day
- tables
- target
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention provides a kind of method and apparatus for realizing data query.The present invention's realizes that the method for data query includes:According to the raw data table of primary database, the moon data in primary database are integrated, a moon target data is obtained, the moon data be the data that primary database was increased newly in N day before the day before yesterday;Moon target matrix is obtained, and moon target data is sent stored in tables of data the moon into backup database, so that user is according to moon tables of data inquiry moon target data;According to raw data table, the day data in primary database are integrated, a day target data are obtained, day, data is when the newly-increased data of day before yesterday primary database;Day target data is obtained, and day target data is sent stored in tables of data the day into backup database, so that user is according to tables of data inquiry day, target data day.What the present invention was provided realizes that the method and apparatus of data query improve efficiency data query, enhances the disposal ability of the data of primary database.
Description
Technical field
The present invention relates to data processing technique, more particularly to a kind of method and apparatus for realizing data query.
Background technology
Due to the lifting of portfolio, the funds systems of financial associated companies can all have number with thousand corresponding database every month
Ten thousand data need and the docking of fund platform so that data largely rise violently in the database of funds systems, cause data query
It is less efficient.
In the prior art, asked to solve user by the relatively low technology of the data base querying data efficiency of funds systems
Topic, the data list structure in the database of funds systems is optimized, and necessary inquiry field all with the addition of into index.But
When the method for increase index can not solve data volume and reach a certain amount of, user uses the data base querying data efficiency of funds systems
Relatively low technical problem.
The content of the invention
The present invention provides a kind of method and apparatus for realizing data query, to overcome in the prior art when database data amount
When larger, the relatively low technical problem of efficiency data query.
The present invention provides a kind of method for realizing data query, including:
According to the raw data tables of primary database, the moon data in primary database are integrated, a moon target data is obtained,
The moon data are the data that the primary database was increased newly in N days before the day before yesterday, and N is positive integer;
Obtain the moon target data, and the moon target data is sent to enter in tables of data the moon into backup database
Row storage, so that user inquires about the moon target data according to the moon tables of data;
According to the raw data table, the day data in the primary database are integrated, a day target data, institute is obtained
It is the data increased newly when primary database described in the day before yesterday to state day data;
The day target data is obtained, and the day target data is sent to the day tables of data into the backup database
It is middle to be stored, so that user inquires about the day target data according to the day tables of data.
Method as described above, according to the raw data table, the day data in the primary database are integrated, and are wrapped
Include:
At interval of the first preset duration, according to the raw data table, obtained from primary database corresponding first it is default when
Newly-increased data on the firstth in long, and the data on the firstth are integrated, obtain target data on the firstth;
Correspondingly, the day target data is obtained, and the day target data is sent into the backup database
Stored in day tables of data, including:
The target data on the firstth is obtained, and the target data on the firstth is sent into the backup database
Stored in day tables of data.
Also include parameter list in method as described above, the backup database, the parameter list include the first field and
Second field, the value of first field is used to indicate that the day tables of data allows the minimum interval being updated;Described
The value of two fields is used to be compared with the value of first field, to judge whether to obtain corresponding first from the primary database
Day target data, the value alterable of second field, the value of second field for the value of first field integral multiple;
The target data on the firstth is obtained, and the target data on the firstth is sent into the backup database
Before being stored in day tables of data, methods described also includes:
Judge whether the currency of second field is equal to the value of first field, obtained result is yes.
Method as described above, the day tables of data includes tables of data on the firstth and second day tables of data;
The target data on the firstth is obtained, and the target data on the firstth is sent into the backup database
Stored in day tables of data, including:
Obtain the first state of the tables of data on the firstth and the second state of the second day tables of data;
If the first state is write state, the first state is updated to read states, by the second state by read states
Write state is updated to, the value of second field is updated to desired value;And the target data on the firstth is obtained, by described first
Day target data, which is sent into the second day tables of data, to be stored;
If the first state is read states, the first state is updated to write state, by the second state by write state
Read states are updated to, the value of second field is updated to desired value;And the target data on the firstth is obtained, by described
Target data on the one sends into the tables of data on the firstth and stored;
Wherein, the desired value is the default time interval for updating the day stored day tables of data of target data.
Method as described above, is obtaining the target data on the firstth, and by the target data on the firstth send to
After day in the backup database is stored in tables of data, in addition to:
At interval of the second preset duration, judge whether the second field currency is equal with the value of first field;
Second preset duration allows the minimum interval being updated equal with day tables of data;
If judged result is no, the second field currency is subtracted into a preset value;
If the determination result is YES, then corresponding mesh on the firstth in next first preset duration is obtained from the primary database
Mark data.
Method as described above, is obtaining moon target data, and moon target data is sent to the moon into backup database
Before being stored in tables of data, in addition to:
Delete current data of the moon in the Backup Data in tables of data;
Obtaining the day target data, and day target data is sent into day into the backup database in tables of data
Before being stored, in addition to:
Delete current data of the day in the Backup Data in tables of data.
Method as described above, methods described also includes:
At interval of the 3rd preset duration, for each target raw data table in primary database, the target original number
It is from the very first time to the raw data table into the primary database is increased between the second time newly, by target initial data according to table
Table is renamed, and obtains annual data table;Before acquisition day of second time to obtain the annual data table the M days it is corresponding when
Between, the time interval between the very first time and second time is the 3rd preset duration, and the very first time is described
Before second time;Wherein, the corresponding number of days of the 3rd preset duration is more than or equal to N, and M is more than N, the name of the annual data table
Title includes the first character and the second character, and the first character is the corresponding character of title of corresponding raw data table, the second character
For second time corresponding time character;
Each annual data table is sent into the backup database and stored, so that user is according to the annual data
Table inquires about the annual data;
Delete the annual data table in the master data.
The present invention also provides a kind of method for realizing data query, including:
The inquiry request that user is inputted by user interface is obtained, the inquiry request includes query time attribute and institute
State the corresponding query time scope of query time attribute;
According to the query time attribute and the corresponding query time scope of the query time attribute, it is determined that being looked into described
The target database belonging to the corresponding data to be checked of time range is ask, the target database is backup database or master data
Storehouse;
The data to be checked are obtained from the target database, and the data to be checked are sent to the user
Terminal.
Wherein, the backup database is the backup database obtained by the above-mentioned method for realizing data query, described
Primary database is the primary database obtained by the above-mentioned side for realizing data query.
Day tables of data in method as described above, the backup database includes tables of data on the firstth and second day data
Table;
If the query time attribute is day target data, the corresponding query time scope of the day target data is works as
The day before yesterday, the target database is backup database;
The data to be checked are obtained from target database, and the data to be checked were sent to the end of the user
End, including:
Obtain the first state and second day tables of data corresponding with working as the day before yesterday of tables of data on the firstth corresponding with working as the day before yesterday
The second state, if it is write state that the first state, which is read states, second state, will with when the day before yesterday corresponding first
Data to be checked in day tables of data are sent to the terminal of the user;
If the first state is write state, second state is read states, then will second day corresponding with working as the day before yesterday
Data to be checked in tables of data are sent to the terminal of the user.
The present invention also provides a kind of device for realizing data query, including:
Data Integration module, for the raw data table according to primary database, the moon data in primary database is carried out whole
Close, obtain a moon target data, the moon data are the data that the primary database was increased newly in N days before the day before yesterday, and N is just whole
Number;
Scheduler module, sends into backup database for obtaining the moon target data, and by the moon target data
Stored in tables of data the moon so that user inquires about the moon target data according to the moon tables of data;
The Data Integration module is additionally operable to, and according to the raw data table, the day data in the primary database are entered
Row is integrated, and obtains a day target data, and the day data are the data increased newly when primary database described in the day before yesterday;
The scheduler module is additionally operable to, and obtains the day target data, and the day target data is sent to described standby
Day in part database is stored in tables of data, so that user is according to the day tables of data inquiry day target data.
The present invention provides a kind of method and apparatus for realizing data query.The method bag for realizing data query of the present invention
Include:According to the raw data table of primary database, the moon data in primary database are integrated, a moon target data is obtained, the moon number
According to the data increased newly for primary database in N day before the day before yesterday;Moon target matrix is obtained, and moon target data is sent to standby
The moon in part database is stored in tables of data, so that user is according to moon tables of data inquiry moon target data;According to original number
According to table, the day data in primary database are integrated, a day target data is obtained, day data be when day before yesterday primary database is increased newly
Data;Day target data is obtained, and day target data is sent stored in tables of data the day into backup database, so that
User inquires about day target data according to day tables of data.The present invention's realizes that the method and apparatus of data query improve data query
Efficiency, enhances the disposal ability of the data of primary database.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are this hairs
Some bright embodiments, for those of ordinary skill in the art, without having to pay creative labor, can be with
Other accompanying drawings are obtained according to these accompanying drawings.
A kind of possible system architecture diagram that Fig. 1 provides for the present invention;
The flow chart for the embodiment of the method one for realizing data query that Fig. 2 provides for the present invention;
The flow chart for the embodiment of the method two for realizing data query that Fig. 3 provides for the present invention;
The flow chart for the embodiment of the method three for realizing data query that Fig. 4 provides for the present invention;
The flow chart for the embodiment of the method four for realizing data query that Fig. 5 provides for the present invention;
The user terminal inputting interface schematic diagram one that Fig. 6 provides for the present invention;
The structural representation for the inquiry unit embodiment one for realizing data that Fig. 7 provides for the present invention;
The structural representation for the inquiry unit embodiment two for realizing data that Fig. 8 provides for the present invention;
The structural representation for the inquiry unit embodiment three for realizing data that Fig. 9 provides for the present invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
A part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
A kind of possible system architecture diagram that Fig. 1 provides for the present invention, referring to Fig. 1, the system architecture includes data query
Device 11, master data server 12, Backup Data server 13 and terminal 14, master data server 12 and the phase of primary database 121
Correspondence, Backup Data server is corresponding with backup database 131;Data query arrangement 11 passes through 12 pairs of main numbers of master data server
Operated according to storehouse 121, data query arrangement 11 is operated by Backup Data server 13 to backup database 131.
Specifically, after data query arrangement 11 is integrated the data increased newly in the particular time range of primary database 121
Movement is directly moved in backup database 131, so that user can carry out inquiry data using backup database;In user
When carrying out data query by terminal 14, the query time attribute that data query arrangement 11 is inputted according to user is determined from master data
Data are obtained in storehouse 121 data are still obtained from backup database 131, the data most obtained at last are sent to the terminal of user
14;By the above-mentioned method for realizing data query, the inquiry pressure of primary database is effectively reduced, the inquiry of data is improved
Efficiency.
Illustrate that the method and apparatus for realizing data query that the present invention is provided are carried out in detail with reference to specific embodiment
Explanation.
The flow chart for the embodiment of the method one for realizing data query that Fig. 2 provides for the present invention, as shown in Fig. 2 this implementation
The method of example can include:
Step S101, the raw data table according to primary database, the moon data in primary database are integrated, the moon is obtained
Target data, the moon data be the data that primary database is increased newly in N day before the day before yesterday, N is positive integer;
Step S102, obtain moon target data, and moon target data is sent into the moon into backup database in tables of data
Stored, so that user inquires about moon target data according to moon tables of data;
Step S103, according to raw data table, the day data in primary database are integrated, a day target data is obtained,
Day, data is when the newly-increased data of day before yesterday primary database;
Step S104, obtain day target data, and day target data is sent into day into backup database in tables of data
Stored, so that user inquires about day target data according to day tables of data.
Specifically, the executive agent of the method for realizing data query of the present embodiment is data query arrangement, data query
Device may be provided at master data server internal, may also be arranged on Backup Data server internal, can also be independently present in master
The outside of data server and Backup Data server;In addition, data query arrangement can be arranged on master data clothes with a part
It is engaged in inside device, another part is arranged on Backup Data server internal, two parts cooperate simultaneously completes the inquiry for realizing data.
Illustrated below with data query arrangement in the operation carried out when the day before yesterday, wherein, when the day before yesterday can for today and
Any one day before today.
During data query is realized, for step S101, according to the raw data table of primary database, by master data
Moon data in storehouse are integrated, and obtain a moon target data, the moon data be the moon number that primary database was increased newly in N day before the day before yesterday
According to.
Specifically, primary database is receives the database for the data that external data systems platform is sent, if master data can storehouse
For the corresponding database of certain insurance company, then external data systems platform can be the corresponding data system platform of bank.Therefore, if
Primary database had both been used for and external data systems platform interacts (the alternatively referred to as processing of data), and the inquiry of data is used for again,
When primary database data volume is very big, the search efficiency of data will certainly be caused not high.
In primary database, including the corresponding business datum table of multiple business, wherein, multiple logics of each business correspondence are answered
Business datum table in miscellaneous business datum table, primary database is alternatively referred to as raw data table, and the corresponding each industry of same business
Business tables of data may be from different external data systems platforms, therefore, identical in the corresponding each business datum table of same business
The storage rule of the data of species may be differed, such as storage rule can be:The numerical nomenclature of same species, the table of data
Show mode (actual characters or the form of 10 a powers).
Moon data in primary database are integrated, obtained according to the raw data table of primary database by data query arrangement
Obtained to moon target data, i.e. data query arrangement from each self-corresponding raw data table of each business before the day before yesterday in N days
The newly-increased moon data of primary database, moon data then integrate obtaining a moon target data, the moon target data can be stored in
The moon in primary database is in target matrix.Wherein, the integration in the present embodiment refer to by the data in each business datum table with
Identical storage rule is stored.Wherein, N value is preferably 28~31 in the present embodiment.
For step S102, after moon target data is obtained, data query arrangement obtains moon target data, and by moon target
The moon that data are sent into backup database is stored in tables of data, so that user inquires about moon data according to moon tables of data.
Wherein, moon target data is being obtained, and moon target data is sent to enter in tables of data the moon into backup database
Before row storage, data query arrangement deletes current data of the moon in tables of data in Backup Data.Such as, it was 2017 when the day before yesterday
On April 9, N is 30, data query arrangement obtain corresponding moon target data on April 9th, 2017 (on April 9th, 2017 it
The data increased newly into primary database after being integrated in first 30 days (on April 8, in i.e. 2017 on March 10, to 2017)), and should
Before month target data sends the moon into backup database in tables of data, what the moon in backup database was stored in tables of data works as
Preceding data be on April in 2017 8 before 30 days in (on April 7, in i.e. 2017 on March 9, to 2017) integration after increase newly to
Data (corresponding moon target data on April 8th, 2017) in primary database.Therefore need the current number in moon tables of data first
According to deletion, then corresponding moon target data on April 9th, 2017 is sent stored in tables of data the moon into Backup Data.
In order to save the memory space of primary database, moon target data is being obtained, and moon target data is sent to backup
After the moon in database is stored in tables of data, data query arrangement is deleted in primary database when the day before yesterday corresponding moon target
Data.
It is chosen as working as the execution step S101 time starteds at 0 point of the day before yesterday, step is performed after step S101 is finished
Rapid S102.
For step S103, data query arrangement is integrated the day data in primary database according to raw data table,
A day target data is obtained, day, data is when the newly-increased day data of day before yesterday primary database.Wherein, day target data can be stored in master
Day in database is in tables of data;If when the day before yesterday is April 9, day data be the data that increase newly into primary database on April 9.
The implication of integration herein is identical with the implication integrated in step S101.
For step S104, after day target data is obtained, data query arrangement obtains day target data, and by day target
The day that data are sent into backup database is stored in tables of data, so that user inquires about day data according to day tables of data.
Similarly, obtaining day target data, and day target data is sent into day into backup database in tables of data
Before being stored, data query arrangement deletes current data of the day in tables of data in Backup Data.Such as, it was when the day before yesterday
On April 9th, 2017, obtaining day target data in data query arrangement, (9 days April in 2017 after integration are increased newly to primary database
In data), and before day target data is sent into the moon into backup database in tables of data, the number of days in backup database
The data increased newly according to the current data stored in table for 8 days April in 2017 after integrating into primary database.Therefore first will it need
Current data in day tables of data is deleted, then the data that 9 days April in 2017 after integration are increased newly into primary database send to
Day in Backup Data is stored in tables of data.
In order to save the memory space of primary database, in 24 points when the day before yesterday or next day when the day before yesterday, data query
Device is deleted in primary database when the day before yesterday corresponding day target data.
Due to data newly-increased in N day before the day before yesterday and when the enquiry frequency of the day before yesterday newly-increased data is higher, therefore,
By in primary database the moon data and day Data Integration after send and stored into backup database so that user can use standby
Part database carries out data query, and the inquiry pressure of primary database has been disperseed significantly, efficiency data query is improved.Meanwhile, by
Disperseed in the inquiry pressure of primary database, therefore, primary database is strengthened the disposal ability of data.
The method for realizing data query of the present embodiment includes:According to the raw data table of primary database, by primary database
In moon data integrated, obtain a moon target data, the moon data be the data that primary database was increased newly in N day before the day before yesterday;
Moon target matrix is obtained, and moon target data is sent stored in tables of data the moon into backup database, to use
Moon target data is inquired about in family according to moon tables of data;According to raw data table, the day data in primary database are integrated, obtained
Day target data, day data be the data increased newly when day before yesterday primary database;Day target data is obtained, and day target data is sent
Day into backup database is stored in tables of data, so that user inquires about day target data according to day tables of data.This implementation
Example realize that the method for data query improves efficiency data query, enhance the disposal ability of the data of primary database.
Several specific embodiments are used below, and the technical scheme to embodiment of the method shown in Fig. 1 is described in detail.
The flow chart of the embodiment of the method two for realizing data query that Fig. 3 provides for the present invention, the method for the present embodiment is
For the detailed description of step S103 and step S104 in a upper embodiment.As shown in figure 3, the method for the present embodiment can be wrapped
Include:
Step S201, at interval of the first preset duration, according to raw data table, corresponding first is obtained from primary database pre-
If the data on the firstth increased newly in duration, and data on the firstth are integrated, obtain target data on the firstth;
Specifically, due to working as the day before yesterday, data in primary database may be in real time all in increase, accordingly, it would be desirable to every the
One preset duration is integrated the data on the firstth increased newly in corresponding first preset duration into primary database.Integration herein
It is identical with the meaning of the integration in a upper embodiment, repeated no more in the present embodiment.
Wherein, the first preset duration is chosen as 30min.Such as when the day before yesterday 10:30 ought the day before yesterday 10:00 to 10:30 it
Between increase the database integration on the firstth into primary database newly, obtain 10:00 to 10:Correspondence in the first preset duration between 30
Target data on the firstth, when the day before yesterday 11:00 ought the day before yesterday 10:30 to 11:Increase first into primary database between 00 newly
Day database is integrated, and obtains 10:30 to 11:Corresponding target data on the firstth in the first preset duration between 00;With
This analogizes, until each data on the firstth increased newly when the day before yesterday into primary database are integrated into target data on the firstth.
Step S202, acquisition target data on the firstth, and target data on the firstth is sent into the day into backup database
Stored in tables of data.
Specifically, such as when the day before yesterday 10:30 ought the day before yesterday 10:00 to 10:Increase into primary database between 30 newly
Data Integration on the one is obtained after target data on the firstth, then obtains the target data on the firstth, and by target data on the firstth
Send and stored in tables of data the day into backup database.
More specifically, because the real-time property when the day before yesterday is higher, data query is not influenceed when being inquired about for user
First object data are sent and stored in tables of data the day into backup database by device, the day data in backup database
Table includes tables of data on the firstth and second day tables of data, and tables of data on the firstth and second day tables of data are alternatively used for a day target data
Inquiry and the storage of day target data, that is, (receive number when tables of data on the firstth is used for the storage of day target data
According to inquiry unit from the day target data in corresponding first preset duration that primary database is obtained), second day tables of data is used
Inquiry of the family to day target data, when second day tables of data is used for the storage of day target data, tables of data was used on 1st
Inquiry of the family to day target data.
Tables of data on the firstth includes the 3rd field, and the 3rd field is used for the first state for indicating tables of data on the firstth, the 3rd
Field alterable, such as, if the 3rd field is yes, it is write state to illustrate first state, and tables of data was used for mesh on the firstth on 1st
Mark the storage of data;If the 3rd field is no, it is read states to illustrate first state, and tables of data was used for day target data on 1st
Inquiry.Second day tables of data includes the 4th field, and the 4th field is used for the second state for indicating second day tables of data, the 4th field
Alterable, such as, if the 4th field is yes, it is write state to illustrate the second state, and second day tables of data is used for number of targets on the firstth
According to storage;If the 4th field is no, it is read states to illustrate the second state, and second day tables of data is used for looking into for day target data
Ask.
Also include parameter list in backup database, parameter list includes the first field and the second field, and the value of the first field is used
The minimum interval for allowing to be updated in instruction day tables of data;The value of second field is used to be compared with the value of the first field, with
Judge whether to obtain corresponding target data on the firstth, the value alterable of the second field, the value of the second field from primary database
For the integral multiple of the value of the first field.
Specifically, target data on the firstth is obtained, and target data on the firstth is sent into the number of days into backup database
According to before being stored in table, data query arrangement judges whether the currency of the second field is equal to the value of the first field.If
To result be yes, data query arrangement obtained the target data on the firstth in corresponding preset duration, by target data on the firstth
Send and stored in tables of data the day into backup database.
Wherein, if the currency of the second field is equal to the value of the first field, data query arrangement was by number of targets on the firstth
Stored according to the day sent into backup database in tables of data, specially:Obtain tables of data on the firstth first state and
Second state of second day tables of data;
If first state is write state, first state is updated to read states, the second state is updated to write by read states
State, the value of the second field is updated to desired value;And target data on the firstth is obtained, target data on the firstth is sent to second
Stored in day tables of data;
If first state is read states, first state is updated to write state, the second state is updated to by write state to read
State, desired value is updated to by the value of the second field;And target data on the firstth is obtained, target data on the firstth is sent to the
Stored in tables of data on the one;
Wherein, desired value is the default time interval for updating the day stored day tables of data of target data.
In addition, obtaining target data on the firstth, and target data on the firstth is sent into the number of days into backup database
After being stored in table, whether data query arrangement judges the second field currency with interval of the second preset duration
The value of one field is equal;Second preset duration allows the minimum interval being updated equal with day tables of data;If judged result
It is no, then the second field currency is subtracted into a preset value;If the determination result is YES, then next first is obtained from primary database
Corresponding target data on the firstth in preset duration.
Below, said process is illustrated using specific example.
If desired value is 30min, the value of the first field is 10min, and preset value is 10min, the first of tables of data on the firstth
State is write state, and the first state of second day tables of data is read states.
Wherein, the maximum of desired value also for the second field, i.e. the value day tables of data of the first field allow to be updated
Minimum interval.
Specifically, if the currency of the second field is 10min, the value of the value of the first field and the second field is equal, data
The currency of second field is updated to desired value 30min by inquiry unit, and first state is updated into read states, by the second state
Be updated to write state, obtain the corresponding target data on the firstth of corresponding first preset duration from primary database, and by this first
Day target data, which is sent to second day tables of data, to be stored.
The target data on the firstth is being obtained, and the target data on the firstth is sent into the day data into backup database
After being stored in table, data query arrangement interval 10min, judge the second field currency 30min whether with the first field
Value 10min it is equal, the second field currency 30min is then subtracted preset value 10min to be unequal by judged result, obtains the
The new currency 20min of two fields, interval 10min after, judge again the second field currency 20min whether with the first field
Value 10min is equal, and the currency 20min of the second field is then subtracted preset value 10min to be unequal by judged result, obtains the
The new currency 10min of two fields, interval 10min after, judge again the second field currency 10min whether with the first field
Value 10min is equal, and judged result is equal, then corresponding mesh on the firstth in next first preset duration is obtained from primary database
Data are marked, and first state is updated to write state, the second state is updated to read states, the currency of the second field is updated
For desired value 30min, obtain the corresponding target data on the firstth of next first preset duration from primary database, and by this first
Day target data, which is sent to tables of data on the firstth, to be stored.
It will be appreciated by persons skilled in the art that preset value is it is required that the value of the second field subtracts the value after preset value
Remain as the integral multiple of the value of the first field.
The above-mentioned set-up mode of first field and the second field in parameter list, can change according to actual needs it is default more
The time interval of the new day stored day tables of data of target data, just can reach the hair for the latest data that control user can find
The raw time.Such as when the data renewal frequency of the primary database in the morning day before yesterday is little, 30min updates a next day target data and deposited
The day tables of data of storage, now user can inquire the data increased newly before 30min into primary database;When main number in the afternoon day before yesterday
It is just big, it is necessary to which 10min updates the stored day tables of data of a next day target data, so that user can according to the data renewal frequency in storehouse
To inquire newest data as far as possible, now user can inquire the data increased newly before 10min into primary database.
The method for realizing data query of the present embodiment, by setting two days tables of data, is realized when user inquires about not
The process that influence data query arrangement is stored the day that day target data is sent into backup database in tables of data;Pass through
Arrange parameter table, in that context it may be convenient to control the time of origin for the latest data that user can find.
In order to further reduce the inquiry pressure of primary database, the present embodiment is changed on the basis of above-described embodiment
Enter.The flow chart of data query arrangement embodiment three that Fig. 4 provides for the present invention, as shown in figure 4, the method for the present embodiment can be with
Including:
Step S301, at interval of the 3rd preset duration, for each target raw data table in primary database, target is former
Beginning tables of data is from the very first time to the raw data table into primary database is increased between the second time newly, by target initial data
Table is renamed, and obtains annual data table;The M days corresponding time before acquisition day of second time to obtain annual data table, the
Time interval between one time and the second time is the 3rd preset duration, and the very first time is before the second time;Wherein, the 3rd
The corresponding number of days of preset duration is more than or equal to N, and M is more than N, and the title of annual data table includes the first character and the second character, first
Character is the corresponding character of title of corresponding raw data table, and the second character is the second time corresponding time character.
Specifically, each business datum table in primary database is a raw data table.
If the 3rd preset duration is 40 days, the acquisition day for obtaining annual data table exactly works as the day before yesterday, is 2017 4 when the day before yesterday
The moon 9, M is 35 days, and the very first time is then on January 25th, 2017, and the second time was then on March 5th, 2017;Data query arrangement
The raw data table increased newly into primary database on March 5,25 days to 2017 January in 2017 is obtained, by January 25th, 2017 extremely
The raw data table that on March 5th, 2017 is increased newly into primary database is renamed.Wherein, each raw data table correspondence is obtained
One annual data table.
The naming rule of annual data table is the target time will to be added after the title of raw data table as the name of annual data table
Claim, the target time is the second time in the corresponding time.Such as, if the entitled A of initial data, the second time in the corresponding time is
2017, then the title of the corresponding annual data table of initial data can be A2017.
Step S302, each annual data table is sent stored into backup database, so that user is according to annual data table
Inquire about annual data;
Each annual data table is sent after being stored into backup database, if user needs to inquire about corresponding year in 2017
Data, data query arrangement just can include the corresponding number of searching in 2017 annual data table from the title in backup database
According to the terminal for returning to user, while master data inquiry pressure has further been disperseed, the quick of big data is realized
Inquiry, further enhancing the disposal ability of primary database.
Step S303, the annual data table deleted in primary database.
The annual data table in primary database is deleted, the storage time of primary database is greatlyd save, more further enhances
The disposal ability of primary database.
The present embodiment has further disperseed the inquiry pressure of primary database by storing annual data table in backup database
Power, realizes the quick search of big data, enhances the disposal ability of primary database.
Using the backup database obtained after the processing method of the above embodiments, looking into for most of data is carried out for user
Ask, using the primary database obtained after above-mentioned processing method, fraction data are carried out for the processing of data and for user
Inquiry
Specific embodiment is used below, and the process that user carries out data query is described in detail.Art technology
The backup database that personnel are appreciated that in following examples is the backup database obtained using the method for above-described embodiment,
Primary database in following examples is the primary database obtained using the method for above-described embodiment;The execution master of following examples
Body is alternatively the data query arrangement in Fig. 1.
The flow chart for the embodiment of the method three for realizing data query that Fig. 5 provides for the present invention, as shown in figure 5, this implementation
The method of example can include:
Step S401, obtains the inquiry request that user is inputted by user interface, and inquiry request includes query time category
Property and the corresponding query time scope of query time attribute;
Step S402, according to query time attribute and the corresponding query time scope of query time attribute, it is determined that with inquiry
Target database belonging to the corresponding data to be checked of time range, target database is backup database or primary database;
Step S403, obtains data to be checked, and data to be checked are sent to the terminal of user from target database.
Specifically, the backup database in the present embodiment is using the Backup Data obtained after the method for above-described embodiment
Storehouse, primary database is using the primary database obtained after the method for above-described embodiment.
During corresponding by the user input interface input inquiry time attribute and query time attribute of the terminal inquiry of user
Between scope, terminal can be the terminal shown in Fig. 1.
When data query arrangement obtains query time attribute and the inquiry that user is inputted by the user input interface of terminal
Between the corresponding query time scope of attribute, it is determined that the target database belonging to data to be checked corresponding with query time scope,
Determine it is that data to be checked are obtained from primary database or from backup database.
Data query arrangement is determined after target database, and data to be checked are obtained from target database, and will be to be checked
Data are ask to send to the terminal of user.
The user terminal inputting interface schematic diagram one that Fig. 6 provides for the present invention.
With reference to Fig. 6, step S401~step S403 detailed process is illustrated with specific example.
Such as, it was on April 9th, 2017 when the day before yesterday, data of the moon in tables of data in backup database are before the day before yesterday
The data increased newly into primary database in 30 days after (on April 8, in i.e. 2017 on March 10, to 2017) integration, Backup Data
Data of the day in tables of data in storehouse integrated on April 9th, 2017 after the data increased newly into primary database;Backup database
In containing the annual data table in the embodiment shown in Fig. 4, and the current acquisition for obtaining annual data table day is works as the day before yesterday.
Query time attribute includes moon target data, day target data and annual data.Under the application scenarios illustrated, if
Query time attribute is moon target data, day target data, it is determined that target database is backup database, if query time belongs to
Property be annual data, and the corresponding query time scope of annual data be in before the day before yesterday after the M days in the range of, it is determined that mesh
Mark database is primary database;If query time attribute is year attribute, and the year corresponding query time scope of range of attributes is in
Before M days and before day then in the range of M days before the day before yesterday, it is determined that target database is backup database.M's
Implication is identical with the implication of the M in the embodiment shown in Fig. 4.In the citing, M is taken as 35 days, obtains annual data table interval
3rd preset duration is 40 days.
Specifically, as shown in fig. 6, showing the pull-down choice box of query time attribute on the inputting interface of user,
Pull-down choice box includes the option of moon target data, day target data and annual data.When user have selected a moon target data
Afterwards, can show query time scope input frame on the inputting interface of user, the time range that can be inputted be on March 10th, 2017 extremely
In 8 days April in 2017 one day or several days (if input time range not on April 8,10 days to 2017 March in 2017
In the range of, then it is invalid input), and service attribute pull-down choice box can be shown, such as, the time range of user's input is
On March 26,23 days to 2017 March in 2017, the service attribute of selection deducts the time of insurer's premium for bank, and data are looked into
The query time scope that will be inputted according to user of device and service attribute are ask, is obtained from the moon in backup database in tables of data
Business corresponding data of the time generation of insurer's premium on March 26,23 days to 2017 March in 2017 deduct in bank, and
The terminal that the data of acquisition are back into user is checked and used for user.
After user have selected day target data, query time scope input frame can be shown on the inputting interface of user, can
The time range of input be on April 9th, 2017 this day (if the time range of input is not on April 9th, 2017, to be invalid
Input), and service attribute pull-down choice box can be shown;If the service attribute of the selection of user, which is bank, deducts insurer's premium
Time, query time scope and service attribute that data query arrangement will be selected according to user, from backup database
Bank obtained in day target matrix deduct time of insurer's premium and occur corresponding data of business on April 9th, 2017,
And the terminal that the data of acquisition are back into user is checked and used for user.
After user have selected annual data, query time scope, optional time model can be shown on the inputting interface of user
Any day before enclosing for 9 days April in 2017 or several days are (if the time range of input is after 9 days April in 2017, for nothing
Effect input) and can show service attribute pull-down choice box;If the time range of user's input is 1 day to 2017 March in 2017
On March 3, in (in the range of before the 35th day before currently obtaining day, target database is backup database), selection
Service attribute is the time that insurer's premium deducts in bank, the query time scope that data query arrangement will be inputted according to user
And service attribute, bank is obtained from the annual data table in backup database and deducts the time generation of insurer's premium in 2017
The corresponding data of business in March 31 day to 2017 March, and the terminal that the data of acquisition are back into user checks for user
And use;If the time range of user's input is on March 7,6 days to 2017 March in 2017 (the before currently day is obtained
In the range of after 35 days, target database is primary database), the service attribute of selection for bank deduct insurer's premium when
Between, query time scope and service attribute that data query arrangement will be selected according to user, from the annual data in primary database
The time generation that bank's deduction insurer's premium is obtained in table is corresponding in the business on March 7th, 6 days 1 March in 2017
Data, and the terminal that the data of acquisition are back into user checks and uses for user.
It will be appreciated by persons skilled in the art that when query time attribute is annual data attribute, user's inquiry is obtained
Data are without the initial data before integration, alternatively referred to as historical data;Query time attribute is moon target data or day target
During data, the data that user's inquiry is obtained are the data after initial data is integrated.
If in addition, there is no annual data table in backup database, when queried between attribute when being annual data, target database is just
It is always primary database.Because annual data belongs to historical data, enquiry frequency is very low, the moon target data and day target data inquiry
Frequency is very high, therefore, even if not storing annual data table into backup database, and primary database is used for the inquiry of annual data,
Backup database is used for the inquiry of moon target data and day target data, remains to greatly disperse the inquiry pressure of primary database,
Improve search efficiency.
Further, the day tables of data in backup database includes tables of data on the firstth and second day tables of data;First day
Tables of data include the 3rd field, the 3rd field be used for indicate tables of data on the firstth first state, the 3rd field alterable, than
Such as, if the 3rd field is yes, it is write state to illustrate first state, and the storage that tables of data on the firstth is used for day target data (is received
Data query arrangement obtains the day target data in corresponding first preset duration from primary database);If the 3rd field is no, explanation
First state is read states, and tables of data on the firstth is used for the inquiry of day target data, and (user obtained day mesh from tables of data on the firstth
Mark data).Second day tables of data includes the 4th field, and the 4th field is used for the second state for indicating second day tables of data, the 4th
Field alterable, such as, if the 4th field is yes, it is write state to illustrate the second state, and second day tables of data is used for day number of targets
According to storage;If the 4th field is no, it is read states to illustrate the second state, and second day tables of data is used for looking into for day target data
Ask.
If query time attribute is day target data attribute and the day corresponding query time scope of target data attribute to work as
The day before yesterday, target database is backup database, obtains data to be checked from target database, and by data to be checked send to
The terminal of the user, including:
Obtain the first state and second day tables of data corresponding with working as the day before yesterday of tables of data on the firstth corresponding with working as the day before yesterday
The second state, if it is write state that first state, which is read states, the second state, will with when the day before yesterday corresponding tables of data on the firstth
In data to be checked send to the terminal of user;
If first state is write state, the second state is read states, then will with when in the day before yesterday corresponding second day tables of data
Data to be checked send to the terminal of user.
The method for realizing data query of the present embodiment, including:The inquiry request that user is inputted by user interface is obtained,
Inquiry request includes query time attribute and the corresponding query time scope of query time attribute;According to query time attribute and
The corresponding query time scope of query time attribute, it is determined that the number of targets belonging to data to be checked corresponding with query time scope
According to storehouse, target database is backup database or primary database;Data to be checked are obtained from target database, and will be to be checked
Data are sent to the terminal of user.The method for realizing data query of the present embodiment, improves efficiency data query.
The structural representation for the inquiry unit embodiment one for realizing data that Fig. 7 provides for the present invention, as shown in fig. 7, this
The device of embodiment can include:Data Integration module 71 and scheduler module 72, wherein, Data Integration module 71, for basis
The raw data table of primary database, the moon data in primary database are integrated, and obtain a moon target data, the moon data be current
The newly-increased data of primary database in N days before day, N is positive integer;And be used for, according to raw data table, by primary database
Day data integrated, obtain a day target data, day data be the data increased newly when day before yesterday primary database;
Scheduler module 72, for obtaining moon target data, and moon target data is sent the moon number into backup database
According to being stored in table, so that user inquires about moon target data according to moon tables of data;And be used for, day target data is obtained, and
Day target data is sent and stored in tables of data the day into backup database, so that user inquires about day according to day tables of data
Target data.
Data Integration module 71 is specifically at interval of the first preset duration, according to raw data table, from primary database
The data on the firstth increased newly in corresponding first preset duration are obtained, and data on the firstth are integrated, target on the firstth is obtained
Data;
Correspondingly, scheduler module 72 specifically for obtain target data on the firstth, and by target data on the firstth send to
Day in backup database is stored in tables of data.
The device of the present embodiment, can be used for the technical scheme for performing above method embodiment, its realization principle and technology
Effect is similar, and here is omitted.
The structural representation for the inquiry unit embodiment two for realizing data that Fig. 8 provides for the present invention, as shown in figure 8, this
The device of embodiment is on the basis of Fig. 7 shown device structures, further, can also include:First acquisition module 73, judgement
Module 74 and removing module 75;
First acquisition module 73 is used at interval of the 3rd preset duration, for each target initial data in primary database
Table, target raw data table is from the very first time to the raw data table into primary database is increased between the second time newly, by mesh
Mark raw data table is renamed, and obtains annual data table;The M days correspondences before acquisition day of second time to obtain annual data table
Time, time interval between the very first time and the second time is the 3rd preset duration, and the very first time is before the second time;
Wherein, the corresponding number of days of the 3rd preset duration is more than or equal to N, and M is more than N, and the title of annual data table includes the first character and second
Character, the first character is the corresponding character of title of corresponding raw data table, and the second character is the second time in the corresponding time
Character;Scheduler module 72 is additionally operable to send in each annual data table and stored into backup database, so that user is according to year
Annual data is inquired about according to table;Removing module 75 is used for, and deletes the annual data table in master data.
Also include parameter list in backup database, parameter list includes the first field and the second field, and the value of the second field can
Change, the value of the second field is the integral multiple of the value of the first field, and target data on the firstth is obtained in scheduler module 82, and by the
Before the day that target data on the one is sent into backup database is stored in tables of data, judge module 74 is used to judge second
Whether the currency of field is equal to the value of the first field, and obtained result is yes.
Day tables of data includes tables of data on the firstth and second day tables of data, and the current of the second field is judged in judge module 74
After value is equal to the value of the first field, first state and second day data of the scheduler module 72 specifically for acquisition tables of data on the firstth
Second state of table;If first state is write state, first state is updated to read states, the second state is updated by read states
For write state, the value of the second field is updated to desired value;And obtain target data on the firstth, by target data on the firstth send to
Stored in second day tables of data;If first state be read states, first state is updated to write state, by the second state by
Write state is updated to read states, and the value of the second field is updated into desired value;And target data on the firstth is obtained, by mesh on the firstth
Mark data were sent to first day to be stored in tables of data;Wherein, the default day target data that updates of desired value is backed up
The time interval of day tables of data.
Target data on the firstth is obtained in scheduler module 72, and target data on the firstth is sent into backup database
After being stored in day tables of data, judge module 74 is at interval of the second preset duration, judging that the second field currency is
It is no equal with the value of the first field;Second preset duration allows the minimum interval being updated equal with day tables of data;If sentencing
Disconnected result is no, then the second field currency is subtracted into a preset value;If the determination result is YES, then scheduler module 72 from master data
Corresponding target data on the firstth in next first preset duration is obtained in storehouse.
Moon target data in scheduler module 72 obtains moon target matrix, and moon target data is sent to backup number
Before being stored according to the moon in storehouse in tables of data, removing module 75 is additionally operable to delete the working as in the tables of data moon in Backup Data
Preceding data;Day target data in scheduler module 72 obtains day target matrix, and day target data is sent to backup number
Before being stored according to the day in storehouse in tables of data, removing module 75 is additionally operable to delete the working as in tables of data day in Backup Data
Preceding data.
The device of the present embodiment, can be used for the technical scheme for performing above method embodiment, its realization principle and technology
Effect is similar, and here is omitted.
The structural representation for the device embodiment three for realizing data query that Fig. 9 provides for the present invention, as shown in figure 9, this
The device of embodiment includes:Second acquisition module 91, determining module 92 and sending module 93;
Second acquisition module 91 is used for, and obtains the inquiry request that user is inputted by user interface, and inquiry request includes
Query time attribute and the corresponding query time scope of query time attribute;Determining module 92 be used for according to query time attribute and
The corresponding query time scope of query time attribute, it is determined that the number of targets belonging to data to be checked corresponding with query time scope
According to storehouse, target database is backup database or primary database;Sending module 93 is used to obtain to be checked from target database
Data, and data to be checked are sent to the terminal of user.
Sending module 93 is specifically for obtaining the first state of tables of data on the firstth corresponding with working as the day before yesterday and with working as the day before yesterday
Second state of corresponding second day tables of data, will be with working as the day before yesterday if it is write state that first state, which is read states, the second state,
Data to be checked in corresponding tables of data on the firstth are sent to the terminal of user;If first state is write state, the second state
For read states, then the data to be checked in second day tables of data corresponding with working as the day before yesterday are sent to the terminal of user.
The device of the present embodiment, can be used for the technical scheme for performing embodiment of the method shown in Fig. 5, its realization principle and skill
Art effect is similar, and here is omitted.
It will be appreciated by those skilled in the art that, Fig. 7 and/or realizing shown in the device and Fig. 9 of data query shown in Fig. 8
Realizing the device of data query can integrate, and composition one realizes the device of data query.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to
The related hardware of programmed instruction is crossed to complete.Foregoing program can be stored in a computer read/write memory medium.The journey
Sequence upon execution, performs the step of including above-mentioned each method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or
Person's CD etc. is various can be with the medium of store program codes.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent
The present invention is described in detail with reference to foregoing embodiments for pipe, it will be understood by those within the art that:Its according to
The technical scheme described in foregoing embodiments can so be modified, or which part or all technical characteristic are entered
Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology
The scope of scheme.
Claims (10)
1. a kind of method for realizing data query, it is characterised in that including:
According to the raw data table of primary database, the moon data in primary database are integrated, a moon target data is obtained, it is described
The moon, data were the data that the primary database was increased newly in N days before the day before yesterday, and N is positive integer;
Obtain the moon target data, and the moon target data is sent deposited in tables of data the moon into backup database
Storage, so that user inquires about the moon target data according to the moon tables of data;
According to the raw data table, the day data in the primary database are integrated, a day target data, the day is obtained
Data are the data increased newly when primary database described in the day before yesterday;
Obtain the day target data, and the day target data is sent to enter in tables of data the day into the backup database
Row storage, so that user inquires about the day target data according to the day tables of data.
2. according to the method described in claim 1, it is characterised in that according to the raw data table, by the primary database
Day data integrated, including:
At interval of the first preset duration, according to the raw data table, obtained from primary database in corresponding first preset duration
Newly-increased data on the firstth, and the data on the firstth are integrated, obtain target data on the firstth;
Correspondingly, the day target data is obtained, and the day target data is sent to the number of days into the backup database
According to being stored in table, including:
The target data on the firstth is obtained, and the target data on the firstth is sent into the number of days into the backup database
According to being stored in table.
3. method according to claim 2, it is characterised in that also include parameter list, the ginseng in the backup database
Number table includes the first field and the second field, and the value of first field is used to indicate that the day tables of data allows to be updated most
Small time interval;The value of second field is used to be compared with the value of first field, to judge whether from the master data
Obtain corresponding target data on the firstth in storehouse, the value alterable of second field, the value of second field is described the
The integral multiple of the value of one field;
The target data on the firstth is obtained, and the target data on the firstth is sent into the number of days into the backup database
According to before being stored in table, methods described also includes:
Judge whether the currency of second field is equal to the value of first field, obtained result is yes.
4. method according to claim 3, it is characterised in that the day tables of data includes tables of data on the firstth and second day
Tables of data;
The target data on the firstth is obtained, and the target data on the firstth is sent into the number of days into the backup database
According to being stored in table, including:
Obtain the first state of the tables of data on the firstth and the second state of the second day tables of data;
If the first state is write state, the first state is updated to read states, the second state is updated by read states
For write state, the value of second field is updated to desired value;And the target data on the firstth is obtained, by the mesh on the firstth
Mark data, which are sent into the second day tables of data, to be stored;
If the first state is read states, the first state is updated to write state, the second state is updated by write state
For read states, the value of second field is updated to desired value;And the target data on the firstth is obtained, by described first day
Target data sends into the tables of data on the firstth and stored;
Wherein, the desired value is the default time interval for updating the day stored day tables of data of target data.
5. method according to claim 4, it is characterised in that obtaining the target data on the firstth, and by described the
After the day that target data on the one is sent into the backup database is stored in tables of data, in addition to:
At interval of the second preset duration, judge whether the second field currency is equal with the value of first field;It is described
Second preset duration allows the minimum interval being updated equal with day tables of data;
If judged result is no, the second field currency is subtracted into a preset value;
If the determination result is YES, then corresponding number of targets on the firstth in next first preset duration is obtained from the primary database
According to.
6. according to the method described in claim 1, it is characterised in that obtaining moon target data, and moon target data is sent
Before the moon into backup database is stored in tables of data, in addition to:
Delete current data of the moon in the Backup Data in tables of data;
Obtaining the day target data, and day target data is sent carried out in tables of data the day into the backup database
Before storage, in addition to:
Delete current data of the day in the Backup Data in tables of data.
7. according to the method described in claim 1, it is characterised in that methods described also includes:
At interval of the 3rd preset duration, for each target raw data table in primary database, the target raw data table
For from the very first time to the raw data table into the primary database is increased between the second time newly, by target raw data table weight
New name, obtains annual data table;M days corresponding time, institute before acquisition day of second time to obtain the annual data table
The time interval stated between the very first time and second time is the 3rd preset duration, and the very first time is at described second
Between before;Wherein, the corresponding number of days of the 3rd preset duration is more than or equal to N, and M is more than N, and the title of the annual data table includes
First character and the second character, the first character are the corresponding character of title of corresponding raw data table, and the second character is described
Second time corresponding time character;
Each annual data table is sent into the backup database and stored, so that user looks into according to the annual data table
Ask the annual data;
Delete the annual data table in the master data.
8. a kind of method for realizing data query, it is characterised in that including:
Obtain the inquiry request that is inputted by user interface of user, the inquiry request includes query time attribute and described looked into
Ask the corresponding query time scope of time attribute;
According to the query time attribute and the corresponding query time scope of the query time attribute, it is determined that during with the inquiry
Between target database belonging to the corresponding data to be checked of scope, the target database is backup database or primary database;
The data to be checked are obtained from the target database, and the data to be checked were sent to the end of the user
End.
Wherein, the backup database is the backup database obtained by the method described in any one of claim 1~7, institute
It is the primary database obtained by the method described in any one of claim 1~7 to state primary database.
9. method according to claim 8, it is characterised in that the day tables of data in the backup database includes first
Tables of data and second day tables of data;
If the query time attribute is day target data, the corresponding query time scope of the day target data is current
Day, the target database is backup database;
The data to be checked are obtained from target database, and the data to be checked are sent to the terminal of the user,
Including:
Obtain with the first state when the day before yesterday corresponding tables of data on the firstth and with ought the day before yesterday corresponding second day tables of data the
Two-state, if it is write state that the first state, which is read states, second state, will with when the day before yesterday corresponding first number of days
Sent according to the data to be checked in table to the terminal of the user;
If the first state is write state, second state is read states, then will second day data corresponding with working as the day before yesterday
Data to be checked in table are sent to the terminal of the user.
10. a kind of device for realizing data query, it is characterised in that including:
Data Integration module, for the raw data table according to primary database, the moon data in primary database is integrated, obtained
To moon target data, the moon data are the data that the primary database was increased newly in N days before the day before yesterday, and N is positive integer;
Scheduler module, the moon into backup database is sent for obtaining the moon target data, and by the moon target data
Stored in tables of data, so that user inquires about the moon target data according to the moon tables of data;
The Data Integration module is additionally operable to, and according to the raw data table, the day data in the primary database is carried out whole
Close, obtain a day target data, the day data are the data increased newly when primary database described in the day before yesterday;
The scheduler module is additionally operable to, and obtains the day target data, and the day target data is sent to the backup number
Stored according to the day in storehouse in tables of data, so that user inquires about the day target data according to the day tables of data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710270745.3A CN107153683B (en) | 2017-04-24 | 2017-04-24 | Method and device for realizing data query |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710270745.3A CN107153683B (en) | 2017-04-24 | 2017-04-24 | Method and device for realizing data query |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107153683A true CN107153683A (en) | 2017-09-12 |
CN107153683B CN107153683B (en) | 2020-04-07 |
Family
ID=59794146
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710270745.3A Active CN107153683B (en) | 2017-04-24 | 2017-04-24 | Method and device for realizing data query |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107153683B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107943926A (en) * | 2017-11-21 | 2018-04-20 | 郑州云海信息技术有限公司 | The attribute increase method, apparatus and medium of a kind of tables of data |
CN108647357A (en) * | 2018-05-17 | 2018-10-12 | 阿里巴巴集团控股有限公司 | The method and device of data query |
CN109634963A (en) * | 2018-12-11 | 2019-04-16 | 泰康保险集团股份有限公司 | Processing method, device and the readable storage medium storing program for executing of declaration form data |
CN110457328A (en) * | 2019-08-15 | 2019-11-15 | 中国银行股份有限公司 | Parameter take-effective method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101404013A (en) * | 2008-11-13 | 2009-04-08 | 山东浪潮齐鲁软件产业股份有限公司 | Storage and query method for large data volume table of database |
CN103853727A (en) * | 2012-11-29 | 2014-06-11 | 深圳中兴力维技术有限公司 | Method and system for improving large data volume query performance |
CN105512313A (en) * | 2015-12-15 | 2016-04-20 | 北京京东尚科信息技术有限公司 | Incremental data processing method and device |
-
2017
- 2017-04-24 CN CN201710270745.3A patent/CN107153683B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101404013A (en) * | 2008-11-13 | 2009-04-08 | 山东浪潮齐鲁软件产业股份有限公司 | Storage and query method for large data volume table of database |
CN103853727A (en) * | 2012-11-29 | 2014-06-11 | 深圳中兴力维技术有限公司 | Method and system for improving large data volume query performance |
CN105512313A (en) * | 2015-12-15 | 2016-04-20 | 北京京东尚科信息技术有限公司 | Incremental data processing method and device |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107943926A (en) * | 2017-11-21 | 2018-04-20 | 郑州云海信息技术有限公司 | The attribute increase method, apparatus and medium of a kind of tables of data |
CN108647357A (en) * | 2018-05-17 | 2018-10-12 | 阿里巴巴集团控股有限公司 | The method and device of data query |
CN108647357B (en) * | 2018-05-17 | 2023-01-31 | 创新先进技术有限公司 | Data query method and device |
CN109634963A (en) * | 2018-12-11 | 2019-04-16 | 泰康保险集团股份有限公司 | Processing method, device and the readable storage medium storing program for executing of declaration form data |
CN109634963B (en) * | 2018-12-11 | 2021-01-26 | 泰康保险集团股份有限公司 | Policy data processing method and device and readable storage medium |
CN110457328A (en) * | 2019-08-15 | 2019-11-15 | 中国银行股份有限公司 | Parameter take-effective method and device |
CN110457328B (en) * | 2019-08-15 | 2022-02-25 | 中国银行股份有限公司 | Parameter validation method and device |
Also Published As
Publication number | Publication date |
---|---|
CN107153683B (en) | 2020-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107153683A (en) | The method and apparatus for realizing data query | |
Bes et al. | Concepts of forecast and decision horizons: Applications to dynamic stochastic optimization problems | |
CN104160381B (en) | Managing method and system for tenant-specific data sets in a multi-tenant environment | |
CN104021145B (en) | The method and apparatus that a kind of mixed service concurrently accesses | |
CN102436473B (en) | Menu management device and menu managing method | |
CN107247808A (en) | A kind of distributed NewSQL Database Systems and image data querying method | |
CN102831122B (en) | Data storage method, inquiring method and inquiring device for workflow table | |
CN103336792B (en) | Data partition method and device | |
Xu et al. | Optimal policies in hybrid manufacturing/remanufacturing systems with random price-sensitive product returns | |
CN104750727A (en) | Column type memory storage and query device and column type memory storage and query method | |
CN109741008A (en) | A kind of expense reimbursement management method and device | |
CN109903050A (en) | Transaction De-weight method, transaction building method, equipment and storage medium | |
CN103020753A (en) | Document state display system and document state display method | |
CN108875044B (en) | Contact searching method and device, storage medium and electronic equipment | |
CN110532373A (en) | Generation method, device, computer equipment and the storage medium of finance data | |
CN104574044A (en) | Task originating method in office automation and office automation system | |
CN108628972A (en) | A kind of processing method of tables of data, device and storage medium | |
Mole | Dynamic optimization of vehicle fleet size | |
US20100100535A1 (en) | Enterprise application platform | |
Song | Understanding the lead-time effects in stochastic inventory systems with discounted costs | |
Ekel et al. | Multicriteria analysis based on constructing payoff matrices and applying methods of decision making in fuzzy environment | |
CN110298023A (en) | A kind of joining method and system of report | |
CN102722568B (en) | Data processing method for improving authority set and query efficiency of office management system | |
CN109933725A (en) | A kind of structure match inquiry system and control method | |
US20140236781A1 (en) | Systems and Methods for an In-Memory Budget Finder |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |