CN107315753A - Across the paging method and device of multiple database - Google Patents
Across the paging method and device of multiple database Download PDFInfo
- Publication number
- CN107315753A CN107315753A CN201610270531.1A CN201610270531A CN107315753A CN 107315753 A CN107315753 A CN 107315753A CN 201610270531 A CN201610270531 A CN 201610270531A CN 107315753 A CN107315753 A CN 107315753A
- Authority
- CN
- China
- Prior art keywords
- record
- database
- paging
- rows
- bar number
- 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/25—Integrating or interfacing systems involving database management systems
- G06F16/254—Extract, transform and load [ETL] procedures, e.g. ETL data flows in data warehouses
Abstract
This application discloses a kind of paging method and device across multiple database.One embodiment of methods described includes:Paging request of the client to M data-base content is received, paging request includes:Paging N, paging record number K and querying condition, wherein M, N, K is natural number;The bar number scale record of each database is obtained, each bar number is recorded as line number of the paging number by recording the last column taken in corresponding database record in the K rows record of N 1 paging in this number scale;Take the K rows record for meeting querying condition since the next line that bar number scale is recorded in corresponding database according to each number scale record;Merge the K rows record obtained in each database, and M × K rows record after merging is ranked up according to predetermined sort criteria;K rows record sends response message as paging result set, and to client before taking after sequence, and response message includes paging result set.It the method achieve and the progress paging of multiple database content is showed in real time.
Description
Technical field
The application is related to field of computer technology, and in particular to Database Pagination Technology field, especially
It is related to a kind of paging method and device across most storehouses.
Background technology
As the development of Internet technology generates many large Web applications, it is embedded in by these
Large Web application in a browser, user may browse through be stored in it is each in Web server
Plant data.Meanwhile, in these large-scale web applications, the production and consumption of data is often related to
To multitype database.Demand sometimes for response user is, it is necessary to by the data of disparate databases
User is showed after merging, while based on performance and facilitating user to check, it is necessary to these merging
Data page processing afterwards.
The decision scheme to multiple database paging used at present for, using a data combiner,
The data of the multiple databases of timing extraction, are stored in after being merged in specific merging data storehouse,
When there is client to send paging request, then pairing Parallel database carries out paging query.From essence
On say, this be still to single database carry out paging.Meanwhile, this data merge paging mode
Poor real, and need to increase extra storage resource to store aggregated data.
The content of the invention
The purpose of the application is to propose a kind of paging method and device across multiple database, to solve
The technical problem that certainly background section above is mentioned.
In a first aspect, this application provides a kind of multidata paging method, method includes:Connect
Paging request of the client to M data-base content is received, paging request includes:Paging N,
Paging records number K and querying condition, wherein M, and N, K is natural number;Obtain each number
Recorded according to the bar number scale in storehouse, wherein, each bar number is recorded as the K rows for the paging that paging number is N-1
The line number of last column record taken in corresponding database is recorded in record in this number scale;
Taken according to the record of each number scale in corresponding database since the next line that bar number scale is recorded
Meet the K rows record of querying condition;Merge the K rows record obtained in each database, and press
M × K rows record after merging is ranked up according to predetermined sort criteria, K rows record is made before taking
For paging result set;Response message is sent to client, response message includes paging result set.
Second aspect, this application provides a kind of paging device across multiple database, device includes:
Receiving unit, is configured to receive client to the paging request of M data-base content, paging
Request includes:Paging N, paging record number K and querying condition, wherein M, N, K
It is natural number;First acquisition unit, is configured to obtain the bar number scale record of each database, its
In, each bar number is recorded as in the K rows record for the paging that paging number is N-1 in the record of this number scale
The line number of last column record taken in corresponding database;Second acquisition unit, configuration
Opened for recording the next line recorded in corresponding database from bar number scale according to each bar number scale
Begin to obtain the K rows record for meeting querying condition;Generation unit, is configured to merge in each data
The K rows record obtained in storehouse, and M × K rows after merging are recorded according to predetermined sort criteria
It is ranked up, K rows record is as paging result set before taking;Transmitting element, is configured to visitor
Family end sends response message, and response message includes paging result set.
The method and apparatus across multiple database that the application is provided, by receiving client to M
The paging request of data-base content, shown paging request include paging number, paging record number K with
And querying condition, obtain the bar number scale record of each database, it is every that bar number is recorded as taking in prevpage
The line number of last column record of individual database multirow record;Then existed according to the record of each bar number scale
Taken in corresponding database since the next line that bar number scale is recorded and meet querying condition K rows note
Record;Then the K rows record obtained in each database is merged, and according to predetermined sort criteria pair
M × K rows record after merging is ranked up, and K rows record is as paging result set before taking;Most
Response message is sent to client afterwards, response message includes paging result set.Realize and be not required to
In the case of wanting extra storage resource, data aggregate paging exhibition is carried out to multitype database in real time
Show.
Brief description of the drawings
Retouched by reading with reference to the detailed of being made to non-limiting example of being made of the following drawings
State, other features, objects and advantages will become more apparent upon:
Fig. 1 is that the application can apply to exemplary system architecture figure therein;
Fig. 2 is the flow of one embodiment of the paging method across multiple database according to the application
Figure;
Fig. 3 be according to Fig. 2 across multiple database paging method an application scenarios stream
Cheng Tu;
Fig. 4 is the structural representation of the paging device across multiple database according to the application;
Fig. 5 is adapted for the structure of the computer system of the server for realizing the embodiment of the present application
Schematic diagram.
Embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is appreciated that
, specific embodiment described herein is used only for explaining related invention, rather than to the hair
Bright restriction.It also should be noted that, illustrate only for the ease of description, in accompanying drawing with
About the related part of invention.
It should be noted that in the case where not conflicting, embodiment and embodiment in the application
In feature can be mutually combined.Describe this in detail below with reference to the accompanying drawings and in conjunction with the embodiments
Application.
Fig. 1 is shown can be using the application across the paging method of multiple database or across many data
The exemplary system architecture 100 of the embodiment of the paging device in storehouse.
As shown in figure 1, system architecture 100 can include terminal device 101,102,103,
Network 104,106, server 105, database server 107,108,109.Network 104,
106 are used in terminal device 101,102,103, server 105 and database server
The 107th, the medium of communication link is provided between 108,109.Network 104 and 106 can include
Various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can pass through network 104 and server 105 with using terminal equipment 101,102,103
Interaction, is asked with sending data page to server 105, and the return of the reception server 105
Paging result set etc..Various softwares, example can be installed on terminal device 101,102,103
Such as browser, searching class application.
Can be the service for being provided with various databases in database server 107,108,109
Device.The type of various databases for example can be:Oracle, MySQL Server etc..Wherein,
The multirow that is stored with every kind of database is recorded.
Server 105 can be to provide the server of various services, for example, connect by network 104
Receive on terminal device 101,102,103 to database server 107,108,109
The paging request of middle data.Server 105 by network 106 and database server 107,
108th, 109 interaction, with each database into database server 107,108,109
Send according to the paging request construction from terminal device to should the paging of type of database look into
Sentence is ask, and receives the multirow record that the database response is returned in paging query sentence.Clothes
Business device 105 is recorded to the multirow that each database is returned in database server 107,108,109
Analyzed and processed, and choose the multirow record conformed to a predetermined condition and be sent to by network 104
Client 101,102 and 103.
Terminal device 101,102 and 103 can be with display screen and support various softwares
Various electronic equipments, including but not limited to tablet personal computer, pocket computer on knee and intelligent hand
Machine etc..
It should be noted that the paging method one across multiple database that the embodiment of the present application is provided
As performed by server 105, correspondingly, clothes are generally positioned at across the paging device of multiple database
It is engaged in device 105.
It should be understood that terminal device, network and server and database server in Fig. 1
Number be only schematical.According to needs are realized, there can be any number of terminal to set
Standby, network, server and database server.
With continued reference to Fig. 2, one of the paging method across multiple database according to the application is shown
The flow 200 of individual embodiment.Across the paging method of multiple database, comprise the following steps:
Step 201, paging request of the client to M data-base content is received.
In the present embodiment, across the paging method operation electronic equipment (example thereon of multiple database
Server 105 as shown in Figure 1) wired connection mode or radio connection can be passed through
Client pair is received from user terminal (terminal device 101,102,103 as shown in Figure 1)
It is installed on database server (database server 107,108,109 as shown in Figure 1)
In M data-base content paging request.
In the present embodiment, client is run by the various browsers installed on terminal device
Various Web are applied meets many datas of querying condition to be checked to the demand paging of web data storehouse
Record.Wherein, various Web applications can be for example the Web Video Applications based on browser.
Web based on browser, which is applied, passes through network (such as 104 shown in Fig. 1) by the paging of user
Request and querying condition are sent to the paging method operation electronic equipment thereon across multiple database
(such as the server 105 shown in Fig. 1).For example, user can be defeated in Web Video Applications
Enter querying condition.Querying condition herein for example can be some type of video.
In the present embodiment, in the Web of Web application operation of the back-office support based on browser
Application database can include M database, and M is natural number.Wherein many M databases
Type can differ, such as M type respectively can for Oracle, MySQL,
A kind of database in Sybase, DB2 etc..M database may be mounted at a number of units evidence
In the server of storehouse, it can also be arranged in many database servers.In M database at least
Including an identical field, namely variable.The data structure phase of the data of same field row
Together.In some optional implementations of the present embodiment, prestored in M database
Multirow data have identical sortord.Can be by the data storage into M database
Real time data, can also be by real time according to being put into after certain regular horizontal segmentation in M database
Data vertical segmentation is put into M database.For M of the vertical segmentation data that are stored with
Database progress paging query is similar to single database paging query, does not repeat herein.
Paging query is carried out in the application to M database to refer to being stored with by the number of horizontal segmentation
According to M database paging query.
In the present embodiment, paging request includes querying condition, paging number and paging record number.
Wherein, it is respectively N and K that paging number and paging, which record number, and N and K are natural number.N is represented
N pagings;Paging records number K, represents there is K rows record in each paging.Database root
According to the querying condition of user, from M database, the record number for meeting user's condition is searched.
Above-mentioned electronic equipment is received after the paging request of client, and statistics meets the inquiry of user
The type for each database that involved all databases of request and confirmation are related to.With
Continue after an action of the bowels and the data in each database are handled.
Step 202, the bar number scale record of each database is obtained.
In the present embodiment, based on the paging request received in step 201, above-mentioned electronics is set
Standby (such as the server 105 shown in Fig. 1) obtains the bar number scale record of each database.Wherein,
Each article number is recorded as paging number to record institute in this article of number scale in the K rows record of N-1 paging
The line number of last column record taken in corresponding database.
In the present embodiment, above-mentioned bar number scale record can be stored in advance in the deposit of electronic equipment
In device.Then electronic equipment is read after the paging request of client is received from storage register
Bar number scale is recorded.
In the present embodiment, when N is equal to 1, the bar number scale record of each database of correspondence is equal to zero.
In some optional implementations of the present embodiment, above-mentioned bar number scale record is stored in bar number scale
Record in pointer, that is, each database one bar number record pointer of correspondence.Each data
Corresponding article of storehouse number record pointer points to last column record of the database in N-1 pagings
Line number.
In some optional implementations of the present embodiment, electronic equipment sends the to client
During N-1 paging result set, the bar number scale record of each database of correspondence is also sent to client simultaneously
End.Namely by the row of last column record of correspondence each database in N-1 pagings
Number client is sent to paging result set, the bar number scale of each database of correspondence is stored by client
Record.When client sends the N pages of paging request to electronic equipment, each database of correspondence
An article number scale record for N-1 pagings is also sent back in electronic equipment with paging request.
In some optional implementations of the present embodiment, when user carries out formfeed inquiry,
Electronic equipment is being analyzed on backstage, and the every page skipped is counted successively in each data
The record extracted in storehouse, and the bar of each database of each paging of correspondence is cached in the buffer
Number scale is recorded.For example, the paging number that user's last time inquires about is 1, that is, inquiry page 1, this
The paging number of secondary inquiry is 5, that is, inquiry page 5, then electronic equipment is divided on backstage
Analysis is handled, and count page 2 successively respectively takes how many articles of records in each database, and by page 2
The record of corresponding article of number scale preserve count in the buffer and then successively in each database page 3 and
Page 4 respectively takes how many rows to record, and the corresponding bar number scale record of every page is preserved in the buffer.
Step 203, recorded according to each number scale record in corresponding database from bar number scale
Next line start to extract the K rows for meeting querying condition record.
In the present embodiment, electronic equipment is based on each database of correspondence obtained from step 202
Bar number scale is recorded, that is, last column record obtained in the N-1 pages in each database
Line number, K rows record is extracted since the next line that corresponding bar number scale is recorded in each data.
In some optional implementations of the present embodiment, electronic equipment is based on above-mentioned bar number scale
Record, paging record number (K rows record) and querying condition and according to all kinds number prestored
Structuralized query language corresponding with any one database is constructed according to the structured query sentence in storehouse
Sentence.Extracted according to construction structured query sentence corresponding with the database from the database
K rows are recorded.That is, electronic equipment is previously stored with the polytype database knot of correspondence
Structure query statement.The structured query sentence of specific every kind of database is widely used in existing
In the data query of database, do not repeat herein.
In the present embodiment, electronic equipment is previously stored with the corresponding type of each database.Can
With understanding, it can just obtain each when electronic equipment and M Database data link
The type of individual database.
In the present embodiment, each database root is sent to query statement therein according to above-mentioned, to
Electronic equipment returns to K rows record, so just there is M × K rows record in the electronic device.
Step 204, the K rows record extracted in each database is merged, and according to predetermined sequence
Condition is ranked up to M × K rows record after merging.
In the present embodiment, electronic equipment is remembered to the K rows sent in each database of step 203
Record is merged.Merging herein refers to respectively from M × K rows of M database to remember
Record carries out vertical consolidation.The K rows of one database can namely be recorded according to certain order
The K rows for being docked to another database record following.When the variable phase in each database
Together, and when structure is identical, the variable of M × K rows record after merging and original any one number
It is identical according to the variable in storehouse.When the variable in any two database is incomplete same, merge
The variable of M × K rows record afterwards is more than the variable quantity in any one original database.Tool
The variable of M × K rows record after the merging of body can be according to the variable of each original database
Obtain.
Next M × K rows record after merging is ranked up.As step 201 is pointed out,
M database at least includes the identical variable column in an identical variable, and each database
Data structure it is identical.The optional identical variable can be M × K row Sorted lists after merging.
For example, the identical variable can be time variable.According to the Sorted list according to predetermined sequence bar
Part to M × K rows record be ranked up, herein predetermined sort criteria can user specify
Sort criteria, such as to time variable according to the sequencing of time to M × K rows after merging
Record is ranked up etc..
Step 205, K rows record is sent out as paging result set, and to client before taking after sequence
Response message is sent, response message includes paging result set.
In the present embodiment, after electronic equipment according to predetermined condition to sorting in step 204
M × K rows are recorded, and the paging result set of the N pages of K rows record generation is extracted according to sequencing.
Response message is generated according to template set in advance and above-mentioned the N pages of paging result set
It is sent to client., can in response message in some optional implementations of the present embodiment
To include total page number, summary journal bar number and the current number of pages and current page bag for meeting querying condition
The record line number contained.
In some optional implementations of the present embodiment, electronic equipment is from the M after sequence
After the paging result set for extracting the N pages of K rows record generation in × K rows record in order, statistics
It is last in the N pages line number of record and each database for being taken from each database
The line number of a line record, and the content update of above-mentioned article of number scale record is each data in the N pages
The line number of last column record in storehouse.Can also optionally take the N-1 pages it is corresponding each
The line number of last column of database and the line number of record that is taken in the N pages from the database it
Number is recorded with article number scale of the N pages of the correspondence as the database and is preserved.
The multidata paging method that includes of the present embodiment offer is crossed by receiving client to M
The paging request of data-base content, obtains the bar number scale record of each database, bar number is recorded as previous
The line number of last column record of each database multirow record taken in page;Then according to each
The record of bar number scale takes satisfaction to inquire about in corresponding database since the next line that bar number scale is recorded
Condition K rows are recorded;Then the K rows record obtained in each database is merged, and according to predetermined
Sort criteria is ranked up to M × K rows record after merging, and K rows record is as paging before taking
Result set;After most paging result set is sent to client.Realize and do not needing extra storage
In the case of resource, data are carried out to multitype database in real time and merge paging displaying.
Fig. 3 is refer to, it illustrates should across one of paging method of multiple database shown in Fig. 2
Flow chart.In figure 3, user passes through the Web application initiations pair in client browser
Database A and database B data content carry out the paging request of paging query.Database A
Can be identical database with database B, or different databases, such as data
Storehouse A can be MySQL database, and database B can be ORACLE databases.In number
It is identical with the data structure in database B according to storehouse A, at least one identical variable.In number
It is identical with the sortord of the data content in database B according to storehouse A, such as according to time order and function
Data content is ranked up.As shown in figure 3, electronic equipment receives the paging request of user,
Paging request includes paging number, paging record number and querying condition.Receiving user's
The bar number scale of each database of correspondence is obtained after paging request in bar number scale records pointer register
The address pointed by pointer is recorded, namely the N-1 pages is extracted in database A and database B
The line number of last column record.Then recorded and constructed according to database A and database B bar number scale
K row record queries sentences, respectively from the next of the bar number scale record in database A and database B
Row starts to extract K rows record, then the 2K rows record extracted respectively from database A and B is closed
And sort, K rows are recorded as paging result set before being extracted in the 2K rows record after sequence,
The N pages of paging result set is finally sent to client, while according to the N pages of K rows
Last column record of database A and database B in record update bar number scale record pointer register
The content of correspondence database A and database B bar number record pointer is distinguished in device.
Please continue to refer to Fig. 4, as to the paging method shown in above-mentioned Fig. 2 across multiple database
Realize, this application provides a kind of one embodiment of the paging device across multiple database, the dress
Put embodiment corresponding with the embodiment of the method shown in Fig. 2.As shown in figure 4, the present embodiment
Include across the paging device 400 of multiple database:Receiving unit 401, first acquisition unit 402,
Second acquisition unit 403, merging and sequencing unit 404 and generation unit 405.Wherein, connect
Receive unit 401 and be configured to receive client to the paging request of M data-base content, paging
Request includes:Paging N, paging record number K and querying condition, wherein M, N, K
It is natural number.First acquisition unit 402 is configured to obtain the bar number scale record of each database,
Wherein, each article of number is recorded as in the K rows of N-1 pagings record corresponding in this article of number scale record
Database in taken last column record line number.Second acquisition unit 403 is configured to
Obtained according to the record of each number scale in corresponding database since the next line that bar number scale is recorded
Take the K rows record for meeting querying condition to merge to be configured to merge with the unit of sequencing unit 404
Obtained in each database K rows record, and according to predetermined sort criteria to the M after merging ×
K rows record is ranked up, and K rows record is as paging result set before taking.Generation unit 405 is matched somebody with somebody
Put for sending response message to client, response message includes paging result set.
In the present embodiment, can be with across the receiving unit 401 of the paging device 400 of multiple database
Software or application behaviour are carried out using it from user by wired connection mode or radio connection
The terminal of work receives the paging request of the content to multiple databases of user's input.User inputs
Paging request include paging number, paging record number and querying condition.In the present embodiment,
The quantity of multiple databases can be set as M, and paging number can be set as N, paging record number
K, wherein M are can be set as, N, K is respectively natural number.
In some optional implementations of the present embodiment, the type of M database can not
Identical, the type of such as M can be respectively Oracle, MySQL, Sybase, DB2
Etc. in a kind of database.M database may be mounted in a database server,
It can also be arranged in many database servers.The M database that type is differed at least is wrapped
Include an identical variable.The data structure of the data of identical variable column is identical.Above-mentioned M numbers
Sorted according to the multirow data prestored in storehouse according to identical sort criteria.
In the present embodiment, the paging to M database received based on receiving unit 401
Information, above-mentioned first acquisition unit 402 can be previously stored with first acquisition unit 402
The bar number scale of each database of correspondence is read in the register of the bar number scale record of each database
Record, here each database article number be recorded as that N-1 pagings are taken in the database it is last
The line number of a line record.
In some optional implementations of the present embodiment, above-mentioned bar number scale record is pre-stored in
In bar number record pointer, that is, each database one bar number record pointer of correspondence.It is each
Individual corresponding article of number record pointer of database points to last in N-1 pagings of the database
The line number of row record.The bar number record pointer of each database is stored in bar number scale record pointer register
In device, first acquisition unit 402 obtains each number of correspondence in bar number scale record pointer register
According to the bar number record pointer in storehouse, and obtain the sensing of each number record pointer to should bar number
The line number of last column record of the database of record pointer in N-1 pagings.
In some optional implementations of the present embodiment, first acquisition unit 402 can be from visitor
The bar number scale record of each database of correspondence is obtained in the paging request that family end is sent.Across multiple database
, also simultaneously will each data of correspondence when paging device is to client the N-1 times paging result set of transmission
The bar number scale record in storehouse is sent to client.Namely by each number of correspondence in N-1 pagings
The line number recorded according to the last column in storehouse is sent to client with paging result set, is deposited by client
The bar number scale record of each database of storage correspondence.In client to the paging device transmission across multiple database
During the N pages of paging request, article number scale records of the N-1 pagings of each database of correspondence also with point
Page request is sent back to across in the paging device of multiple database.
In some optional implementations of the present embodiment, when user carries out formfeed inquiry,
Analyzed to come on backstage across the paging device of multiple database, skip each is counted successively
Deposited in the record that is extracted in each database of page, and caching in first acquisition unit 402
The bar number scale record of each database of each paging of storage correspondence.
In some optional implementations of the present embodiment, second acquisition unit 403 can be pre-
The structured query sentence of each type of database of correspondence is first stored, and please according to the paging of user
Ask and bar number scale records the query statement for constructing each database of correspondence, and according to above-mentioned inquiry
Sentence extracts K rows record from any one database.
In some optional implementations of the present embodiment, the above-mentioned paging across multiple database is filled
Putting also includes updating block, and updating block is according in each database in the N pages of paging result set
The line number of last column record update the bar number scale record of each database.
In some optional implementations of the present embodiment, generation unit 405 is sent out to client
The head office of user's querying condition is met in the response message sent, in addition in above-mentioned M database
Number, total page number, the record number that current number of pages and current page are included.
Below with reference to Fig. 5, it illustrates suitable for for realizing the server of the embodiment of the present application
The structural representation of computer system 500.
As shown in figure 5, computer system 500 includes CPU (CPU) 501, its
Can according to the program being stored in read-only storage (ROM) 502 or from storage part 508
The program that is loaded into random access storage device (RAM) 503 and perform various appropriate actions
And processing.In RAM503, the system that is also stored with 500 operates required various program sums
According to.CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input
/ output (I/O) interface 505 is also connected to bus 504.
I/O interfaces 505 are connected to lower component:Importation 506 including keyboard, mouse etc.;
Include the output par, c 507 of cathode-ray tube (CRT), liquid crystal display (LCD) etc.;
Storage part 508 including hard disk etc.;And including LAN card, modem etc.
The communications portion 509 of NIC.Communications portion 509 is held via the network of such as internet
Row communication process.Driver 510 is also according to needing to be connected to I/O interfaces 505.Detachable media
511, such as disk, CD, magneto-optic disk, semiconductor memory etc. are arranged on as needed
On driver 510, deposited in order to which the computer program read from it is mounted into as needed
Store up part 508.
Especially, in accordance with an embodiment of the present disclosure, the process described above with reference to flow chart can be with
It is implemented as computer software programs.For example, embodiment of the disclosure includes a kind of computer journey
Sequence product, it includes being tangibly embodied in the computer program on machine readable media, computer
Program bag, which contains, is used for the program code of the method shown in execution flow chart.In such embodiments,
The computer program can be downloaded and installed by communications portion 509 from network, and/or from
Detachable media 511 is mounted.
Flow chart and block diagram in accompanying drawing, it is illustrated that according to the system of the various embodiments of the application,
Architectural framework in the cards, function and the operation of method and computer program product.This point
On, each square frame in flow chart or block diagram can represent a module, program segment or code
A part, the part of module, program segment or code is used to realize comprising one or more
The executable instruction of defined logic function.It should also be noted that in some realizations as replacement
In, the function of being marked in square frame can also be with different from the order marked in accompanying drawing generation.
For example, two square frames succeedingly represented can essentially be performed substantially in parallel, they are sometimes
It can also perform in the opposite order, this is depending on involved function.It is also noted that
The group of each square frame in block diagram and/or flow chart and the square frame in block diagram and/or flow chart
Close, can be realized with the special hardware based system of defined function or operation is performed,
Or can be realized with the combination of specialized hardware and computer instruction.
Being described in module involved in the embodiment of the present application can be real by way of software
It is existing, it can also be realized by way of hardware.Described module can also be arranged on processing
In device, for example, can be described as:A kind of processor include receiving unit, first acquisition unit,
Second acquisition unit, merging and sequencing unit and generation unit.Wherein, the name of these units
Claim not constituting the restriction to the unit in itself under certain conditions, for example, receiving unit may be used also
To be described as " unit for receiving user's paging request ".
As on the other hand, present invention also provides a kind of nonvolatile computer storage media,
The nonvolatile computer storage media can be in above-described embodiment included in device it is non-easily
The property lost computer-readable storage medium;Can also be individualism, without non-volatile in supplying terminal
Property computer-readable storage medium.Above-mentioned nonvolatile computer storage media is stored with one or many
Individual program, when one or more program is performed by an equipment so that equipment:Receive visitor
Family end includes to the paging request of M data-base content, paging request:Paging N, paging
Number K and querying condition, wherein M are recorded, N, K is natural number;Obtain each database
Bar number scale record, wherein, each bar number be recorded as paging number be N-1 paging K rows record
In the line number of last column record taken in corresponding database is recorded in this number scale;According to
Each bar number scale record takes satisfaction in corresponding database since the next line that bar number scale is recorded
The K rows record of querying condition;Merge the K rows record obtained in each database, and according to pre-
Determine sort criteria to be ranked up M × K rows record after merging;K rows note before taking after sequence
Record sends response message as paging result set, and to client, and response message includes paging knot
Fruit collects.
Above description is only the preferred embodiment of the application and saying to institute's application technology principle
It is bright.It will be appreciated by those skilled in the art that invention scope involved in the application, is not limited
In the technical scheme of the particular combination of above-mentioned technical characteristic, do not departed from while should cover yet
In the case of the inventive concept, it is combined by above-mentioned technical characteristic or its equivalent feature
Formed by other technical schemes.Such as features described above and (but not limited to) disclosed herein
Technical characteristic with similar functions carries out technical scheme formed by replacement mutually.
Claims (10)
1. a kind of paging method across multiple database, it is characterised in that methods described includes:
Paging request of the client to M data-base content is received, the paging request includes:
Paging N, paging record number K and querying condition, wherein M, N, K is natural number;
The bar number scale record of each database is obtained, wherein, each bar number is recorded as paging
Record what is taken in corresponding database in this number scale in K rows record number by N-1 paging
The line number of last column record;
Recorded according to each number scale in corresponding database from the next of bar number scale record
Row starts to take the K rows for meeting the querying condition to record;
Merge the K rows record obtained in each database, and according to predetermined sequence bar
Part is ranked up to M × K rows record after merging;
K rows record sends response as paging result set, and to the client before taking after sequence
Information, the response message includes the paging result set.
2. according to the method described in claim 1, it is characterised in that described to obtain each number
Include obtaining from bar number scale record pointer register according to the bar number scale record in storehouse and correspond to described in each
The bar number scale record of database.
3. according to the method described in claim 1, it is characterised in that the M database
Type differ;And
What each bar number scale record of basis was recorded in corresponding database from the bar number scale
Next line starts to take the K rows for meeting the querying condition to record, including:
Recorded, constructed corresponding with the type of database according to the type of each database and bar number scale
Structuring paging query sentence simultaneously sends to correspondence database to obtain K rows note from the database
Record.
4. method according to claim 3, it is characterised in that the M database
Each row data at least include identical sort criteria.
5. according to the method described in claim 1, it is characterised in that methods described also includes basis
The line number of the last item record in the paging result set in each database updates each data
The bar number scale record in storehouse.
6. a kind of paging device across multiple database, it is characterised in that described device includes:
Receiving unit, is configured to receive paging request of the client to M data-base content,
The paging request includes:Paging N, paging record number K and querying condition, wherein M,
N, K are natural number;
First acquisition unit, is configured to obtain the bar number scale record of each database, wherein,
Each bar number is recorded as in the K rows record for the paging that paging number is N-1 in the record of this number scale
The line number of last column record taken in corresponding database;
Second acquisition unit, is configured to according to the record of each bar number scale in corresponding database
In since the bar number scale record next line obtain meet the querying condition K rows record;
Ordering by merging unit, is configured to merge the K rows obtained in each database
Record, and M × K rows record after merging is ranked up according to predetermined sort criteria;
Generation unit, is configured to K rows before taking after sequence and records as paging result set, and to
The client sends response message, and the response message includes the paging result set.
7. device according to claim 6, it is characterised in that the second acquisition unit
Further it is configured to obtain from bar number scale record pointer register and corresponds to each described data
The bar number scale record in storehouse.
8. device according to claim 6, it is characterised in that the M database
Type differ;And
The second acquisition unit is further configured to type and bar number according to each database
Record, constructs structuring paging query sentence corresponding with the type of database and sends to corresponding
Database is recorded with obtaining K rows from the database.
9. device according to claim 8, it is characterised in that the M database
Each row data at least include identical sort criteria.
10. device according to claim 6, it is characterised in that described device is also included more
New unit, the updating block is configured to according in each database in the paging result set
The line number of the last item record updates the bar number scale record of each database.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610270531.1A CN107315753B (en) | 2016-04-27 | 2016-04-27 | Paging method and device across multiple databases |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610270531.1A CN107315753B (en) | 2016-04-27 | 2016-04-27 | Paging method and device across multiple databases |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107315753A true CN107315753A (en) | 2017-11-03 |
CN107315753B CN107315753B (en) | 2020-11-03 |
Family
ID=60185628
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610270531.1A Active CN107315753B (en) | 2016-04-27 | 2016-04-27 | Paging method and device across multiple databases |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107315753B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108647347A (en) * | 2018-05-14 | 2018-10-12 | 中国平安财产保险股份有限公司 | Pagination Display method, user equipment, storage medium and device |
CN108848244A (en) * | 2018-04-02 | 2018-11-20 | 阿里巴巴集团控股有限公司 | A kind of method and device of Pagination Display |
CN110928902A (en) * | 2019-11-27 | 2020-03-27 | 杭州安恒信息技术股份有限公司 | Query method and system for acquiring cloud platform terminal data aiming at paging |
CN110928900A (en) * | 2018-09-17 | 2020-03-27 | 马上消费金融股份有限公司 | Multi-table data query method, device, terminal and computer storage medium |
CN111460240A (en) * | 2020-04-13 | 2020-07-28 | 吉林亿联银行股份有限公司 | Page turning data query method and device under cross-region multi-activity micro-service architecture |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103390007A (en) * | 2012-05-11 | 2013-11-13 | 阿里巴巴集团控股有限公司 | Method and device for data acquisition |
CN104298788A (en) * | 2014-11-13 | 2015-01-21 | 中国建设银行股份有限公司 | Paging querying method and system |
CN105468644A (en) * | 2014-09-10 | 2016-04-06 | 阿里巴巴集团控股有限公司 | Method and device for performing query in database |
-
2016
- 2016-04-27 CN CN201610270531.1A patent/CN107315753B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103390007A (en) * | 2012-05-11 | 2013-11-13 | 阿里巴巴集团控股有限公司 | Method and device for data acquisition |
CN105468644A (en) * | 2014-09-10 | 2016-04-06 | 阿里巴巴集团控股有限公司 | Method and device for performing query in database |
CN104298788A (en) * | 2014-11-13 | 2015-01-21 | 中国建设银行股份有限公司 | Paging querying method and system |
Non-Patent Citations (1)
Title |
---|
黄锦捷: "基于Solr的企业级检索系统的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108848244A (en) * | 2018-04-02 | 2018-11-20 | 阿里巴巴集团控股有限公司 | A kind of method and device of Pagination Display |
CN108647347A (en) * | 2018-05-14 | 2018-10-12 | 中国平安财产保险股份有限公司 | Pagination Display method, user equipment, storage medium and device |
CN110928900A (en) * | 2018-09-17 | 2020-03-27 | 马上消费金融股份有限公司 | Multi-table data query method, device, terminal and computer storage medium |
CN110928900B (en) * | 2018-09-17 | 2021-02-19 | 马上消费金融股份有限公司 | Multi-table data query method, device, terminal and computer storage medium |
CN110928902A (en) * | 2019-11-27 | 2020-03-27 | 杭州安恒信息技术股份有限公司 | Query method and system for acquiring cloud platform terminal data aiming at paging |
CN111460240A (en) * | 2020-04-13 | 2020-07-28 | 吉林亿联银行股份有限公司 | Page turning data query method and device under cross-region multi-activity micro-service architecture |
CN111460240B (en) * | 2020-04-13 | 2023-08-15 | 吉林亿联银行股份有限公司 | Cross-region multi-activity micro-service architecture page turning data query method and device |
Also Published As
Publication number | Publication date |
---|---|
CN107315753B (en) | 2020-11-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107315753A (en) | Across the paging method and device of multiple database | |
CN111079022A (en) | Personalized recommendation method, device, equipment and medium based on federal learning | |
CN102073725B (en) | Method for searching structured data and search engine system for implementing same | |
CN104462455B (en) | The method for displaying and processing of network data and device | |
CN102073726B (en) | Structured data import method and device for search engine system | |
CN105095394B (en) | webpage generating method and device | |
JP5721818B2 (en) | Use of model information group in search | |
CN106874467A (en) | Method and apparatus for providing Search Results | |
CN102647462B (en) | Application acquisition and sending method and device | |
CN107798026A (en) | Data query method and apparatus | |
CN103778555A (en) | User attribute mining method and system based on user tags | |
CN107730337A (en) | Information-pushing method and device | |
CN105488205A (en) | Page generation method and page generation apparatus | |
CN107329963A (en) | Accelerate the method and apparatus of web page access | |
US20140365868A1 (en) | Method, server, browser, and system for recommending text information | |
CN106603690A (en) | Data analysis device, data analysis processing system and data analysis method | |
CN110134845A (en) | Project public sentiment monitoring method, device, computer equipment and storage medium | |
CN107871221A (en) | For obtaining the method and apparatus that can sell stockpile number | |
CN103136259B (en) | A kind of method and apparatus based on content block identification processing web page contents | |
CN110209909A (en) | Data crawling method, device, computer equipment and storage medium | |
CN105718559A (en) | Method and device for finding transforming relationship of form pages and target pages | |
CN107066509A (en) | Information providing method, processing server and merging server | |
CN105117434A (en) | Webpage classification method and webpage classification system | |
CN107844488A (en) | Data query method and apparatus | |
CN104572719A (en) | Information collecting method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |