CN102479198A - Data paging method, device and system - Google Patents
Data paging method, device and system Download PDFInfo
- Publication number
- CN102479198A CN102479198A CN2010105609357A CN201010560935A CN102479198A CN 102479198 A CN102479198 A CN 102479198A CN 2010105609357 A CN2010105609357 A CN 2010105609357A CN 201010560935 A CN201010560935 A CN 201010560935A CN 102479198 A CN102479198 A CN 102479198A
- Authority
- CN
- China
- Prior art keywords
- data
- page
- serial number
- temporary table
- show
- 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
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention is applicable to the data processing field and provides a data paging method, a data paging device and a data paging system. The method comprises the following steps: acquiring data in accordance with inquiry conditions from a physical table, assigning a sequence number for the acquired data, and storing the data with the assigned sequence number in a temporary table; calculating left and right margins of the sequence number of the currently showed page according to the number of the showed data of each page, set by the data showed page; and acquiring the showed data of the current page from the temporary table according to the left and right margins of the sequence number in the currently showed page. According to the invention, the temporary table with the sequence number is generated to realize paging show of the data inquiry result directly based on the sequence number in the temporary table when the data inquiry result is showed in a paging manner, and meanwhile, when the data in the physical table is modified, the data in the temporary table is updated synchronously, thus the complexity and execution frequency of the database sentences can be reduced.
Description
Technical field
The invention belongs to data processing field, relate in particular to a kind of data page method, Apparatus and system.
Background technology
In existing data management system, realize data query; At first need be associated with the physical table of data query, the key information of the data that satisfy querying condition checked out preserve, again according to the scope of key; In each page data of Pagination Display, all from physical table, read a page data.Owing to when inquiring about, all need be associated with physical table at every turn; The complexity of database statement and the expense of lock resource have been increased; In case the data in the physical table change simultaneously; Then need obtain related data again, increase complexity and number of times that database statement is carried out, execution performance receives very big influence.
Summary of the invention
The purpose of the embodiment of the invention is to provide a kind of data page method, is intended to solve when data query paging is as a result showed in the prior art and need repeatedly visits physical table, causes the problem of database statement execution performance difference.
The embodiment of the invention is achieved in that a kind of data page method, and said method comprises the steps:
From physical table, obtain the data that meet querying condition, and be the data allocations serial number that obtains, with the data storage of having distributed serial number to temporary table;
Show the bar number of data, the border, the left and right sides of calculating current displayed page serial number according to each page of data display page setup;
According to the border, the left and right sides of said current page serial number, from said temporary table, obtain current page and show data.
Another purpose of the embodiment of the invention is to provide the data page device, and said device comprises:
The serial number generation unit is used to the data allocations serial number that obtains;
The temporary table storage unit is used for the data storage of having distributed said serial number to temporary table;
The serial number computing unit is used for the bar number according to each page displaying data of data display page setup, the border, the left and right sides of calculating current displayed page serial number;
The paged data acquiring unit is used for the border, the left and right sides according to said current displayed page serial number, from said temporary table, obtains current page and shows data.
Another purpose of the embodiment of the invention is to provide a kind of system that comprises above-mentioned data page device.
The embodiment of the invention has the temporary table of serial number through generation; Make when the data query result being carried out the paging displaying; Directly realize data query result's paging displaying, when the physical table data take place to revise, in temporary table, upgrade synchronously simultaneously according to the serial number in the temporary table; Reduce the complexity and execution number of times of database statement, reduced the contention of lock resource.
Description of drawings
Fig. 1 is the realization flow figure of the data page method that provides of first embodiment of the invention;
Fig. 2 is the realization flow figure of the data page method that provides of second embodiment of the invention;
Fig. 3 is the structural drawing of the data page device that provides of third embodiment of the invention.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
In embodiments of the present invention; The temporary table that has serial number through generation; Realize that according to the serial number in the temporary table data query result's paging shows, make when the data query result being carried out paging and showing, need when showing each paging, all not conduct interviews physical table; Reduce the complexity and execution number of times of database statement, reduced the contention of lock resource.
For technical scheme of the present invention is described, describe through specific embodiment below.
Fig. 1 shows the realization flow of the data page method that first embodiment of the invention provides, and details are as follows:
In step S101, from physical table, obtain the data that meet querying condition, and be the data allocations serial number that obtains, with the data storage of having distributed serial number to temporary table.
In the present embodiment, the querying condition according to being provided with obtains all data that satisfy querying condition through reading physical table, and wherein, the inquiry of data source can be for being associated with the data of a plurality of physical table.Simultaneously, utilize the serial number generting machanism of database, all data allocations serial numbers automatically to inquiring, and Query Result is related with the serial number that distributes automatically, the generation temporary table.
As a realization example of present embodiment, the database perform statement of step S101 is following:
SELECT
*, automatic genesis sequence AS serial number
INTO?T1
FROM traffic table 1T
JOIN traffic table 2B1on T.FITEMID=B1.FITEMID
LEFT JOIN traffic table 3B2ON B2.FDEPID=T.FDEPID
...
WHERE?T.FDATE>’2010-03-01’AND?T.FDATE<’2010-03-30’
ORDER?BY?T.FINTERID
In above-mentioned statement; The span that has defined key FDATE is the querying condition of 2010-03-01 to 2010-03-30; At first from traffic table 1, read the data that satisfy this querying condition, this data are related simultaneously traffic table 2,3...... is with the key assignments ordering of the data that inquire according to key FINFERID; And the data allocations serial number for arranging out automatically of the serial number generting machanism through database, simultaneously the result is stored among the temporary table T1.
In step S102, show the bar number of data, the border, the left and right sides of the current displayed page serial number of dynamic calculation according to each page of data display page setup.
In the present embodiment, show the bar number of data, the border, the left and right sides of current displayed page serial number is calculated, the serial number scope of the data of confirming to show at current displayed page through each page of the data display page setup that obtains.
In step S103,, from temporary table, obtain current page and show data according to the border, the left and right sides of current page serial number.
As a realization example of present embodiment, the database perform statement of step S102 and step S103 is following:
Select*from temporary table where serial number BETWEEN left margin and right margin
For example will be from temporary table T1 every page get 50 data and show, the database perform statement of first page data that obtains so will for
Select*from T1where serial number BETWEEN 1and 50
In the present embodiment; When the data query result being carried out the paging displaying; Only need the border, the left and right sides of the current page serial number that basis calculates when showing each page, show, can realize that data query result's paging is showed by the data of obtaining in the temporary table in this serial number left and right sides bounds; And need not reduce the execution number of times and the complexity of database statement all to the physical table request msg when every displaying one page page.
In embodiments of the present invention; After certain the bar data in the physical table are made amendment; In the temporary table that generates in the time of can being updated to data query synchronously through these data of revising, at this moment, the paged data that obtains through temporary table also can be upgraded synchronously; Do not need to carry out data through physical table again once more and obtain, avoid repeating complicated database statement.
Fig. 2 shows the data page method realization flow that second embodiment of the invention provides, and details are as follows:
In step S201, in the time will making amendment, from temporary table, obtain the serial number of waiting to revise data to the data in the physical table.
In the present embodiment, in the time will making amendment, at first in temporary table, find the respective record of these data, obtain its serial number in temporary table certain the bar data in the physical table.
In step S202, after data to be revised in the physical table are made amendment, obtain amended data, and from temporary table these data to be revised of deletion.
In the present embodiment,, in temporary table, find out the corresponding data relative recording of this serial number through the serial number of the data obtained among the step S201, and deletion.
In step S203, behind the serial number of the data of from temporary table, obtaining for this amended data allocations to be revised, insert temporary table.
In step S204, from temporary table, obtain current paging again and show data.
In the present embodiment; Pass through above-mentioned steps; In the time of can being implemented in the physical table data change take place to the synchronous renewal of temporary table; This renewal does not need to read again physical table one time, only need upgrade getting final product the relative recording in the temporary table, has reduced the execution number of times and execution complexity of database statement.After temporary table was upgraded synchronously, repeated execution of steps S102 and step S103 got final product the refresh data displayed page, and data are showed in the current paging that inquires renewal.
Fig. 3 shows the structure of the data page device that third embodiment of the invention provides, and for the ease of explanation, only shows the part relevant with present embodiment.
This data page device can run on data management system, is the software unit in the data management system, hardware cell or software and hardware combining unit.Wherein:
Serial number generation unit 31 utilizes the serial number generting machanism in the database, for the data that meet querying condition are distributed corresponding order number automatically.
Temporary table storage unit 32, with the data storage of having distributed serial number to temporary table.
Serial number computing unit 33 is showed the bar number of data, the border, the left and right sides of calculating current displayed page serial number according to each page of data display page setup.
Paged data display unit 34, the border, the left and right sides of the current displayed page serial number that calculates according to serial number computing unit 33 obtains the displaying data of the current displayed page in this sequence of pages left and right sides bounds from temporary table storage unit 32.
In the present embodiment, the data page device also comprises:
The displaying data strip is counted acquiring unit 36, obtains each page of data display page setup and shows the bar number of data.
In the present embodiment, when the data in the physical table were made amendment, the data page device also comprised:
Serial number acquiring unit 37 obtains the serial number of waiting to revise data from temporary table.
Data delete unit 38, in physical table, treat revise data and make amendment after, obtain amended data, and from temporary table deletion data to be revised.
In embodiments of the present invention, have the temporary table of serial number, the data query result is being carried out in the process of Pagination Display through generation; Only need to use a physical table; All the other steps all can be accomplished through the visit temporary table, in addition, and after the data in the physical table are made amendment; Can synchronously this be revised the result is updated in the temporary table; Do not need again physical table to be conducted interviews, reduced the execution complexity and execution number of times of database statement, promoted the execution performance of database statement.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.
Claims (9)
1. a data page method is characterized in that, said method comprises the steps:
From physical table, obtain the data that meet querying condition, and be the data allocations serial number that obtains, with the data storage of having distributed serial number to temporary table;
Show the bar number of data, the border, the left and right sides of calculating current displayed page serial number according to each page of data display page setup;
According to the border, the left and right sides of said current page serial number, from said temporary table, obtain current page and show data.
2. the method for claim 1 is characterized in that, the said data that meet querying condition are obtained from one or more physical table.
3. the method for claim 1 is characterized in that, calculates at the bar number of the said data that can show according to the data display page before the step on border, the left and right sides of current page serial number, and said method also comprises the steps:
Obtain the bar number of the data that the said data display page can show.
4. the method for claim 1 is characterized in that, said method also comprises the steps:
From said temporary table, obtain the serial number of waiting to revise data;
After data to be revised are made amendment described in the physical table, obtain amended data, and from said temporary table, delete data said to be revised;
For said amended data allocations from said temporary table, obtain said wait to revise the serial number of data after, insert said temporary table;
From said temporary table, obtain current paging again and show data.
5. a data page device is characterized in that, said device comprises:
The serial number generation unit is used to the data allocations serial number that obtains;
The temporary table storage unit is used for the data storage of having distributed said serial number to temporary table;
The serial number computing unit is used for the bar number according to each page displaying data of data display page setup, the border, the left and right sides of calculating current displayed page serial number;
The paged data acquiring unit is used for the border, the left and right sides according to said current displayed page serial number, from said temporary table, obtains current page and shows data.
6. device as claimed in claim 5 is characterized in that, said device also comprises:
The data query unit is used for the data that meet querying condition through reading one or more physical table, obtaining.
7. device as claimed in claim 5 is characterized in that, said device also comprises:
Show that data strip counts acquiring unit, each page that is used to obtain said data display page setup is showed the bar number of data.
8. device as claimed in claim 5 is characterized in that, said device also comprises:
The serial number acquiring unit is used for obtaining the serial number of waiting to revise data from said temporary table;
Data delete unit is used to obtain amended data, and from said temporary table, deletes data said to be revised;
Data updating unit is used to the said serial number of waiting to revise data that said amended data allocations is obtained, and inserts said temporary table from said temporary table.
9. one kind comprises each the system of data page device of claim 5 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010560935.7A CN102479198B (en) | 2010-11-26 | 2010-11-26 | Data paging method, device and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010560935.7A CN102479198B (en) | 2010-11-26 | 2010-11-26 | Data paging method, device and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102479198A true CN102479198A (en) | 2012-05-30 |
CN102479198B CN102479198B (en) | 2014-04-02 |
Family
ID=46091846
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201010560935.7A Active CN102479198B (en) | 2010-11-26 | 2010-11-26 | Data paging method, device and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102479198B (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106649435A (en) * | 2016-09-07 | 2017-05-10 | 努比亚技术有限公司 | Data query device and method of querying data |
CN107463677A (en) * | 2017-08-04 | 2017-12-12 | 网易(杭州)网络有限公司 | Graph making method, system, medium and computing device |
CN107679180A (en) * | 2017-09-29 | 2018-02-09 | 北京金山安全软件有限公司 | Data display method and device |
CN107783978A (en) * | 2016-08-24 | 2018-03-09 | 中安消物联传感(深圳)有限公司 | A kind of big data inquiry return method and device |
CN109241447A (en) * | 2018-10-29 | 2019-01-18 | 金蝶软件(中国)有限公司 | A kind of method, terminal and the server of inquiring document data |
CN110874368A (en) * | 2018-08-14 | 2020-03-10 | 山东华软金盾软件股份有限公司 | Data paging system and method based on Realm database |
CN110955696A (en) * | 2019-11-12 | 2020-04-03 | 中国经济信息社有限公司 | Data reading method, device, equipment and storage medium |
CN113312382A (en) * | 2021-05-31 | 2021-08-27 | 上海万物新生环保科技集团有限公司 | Method, device and system for database paging query |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1632793A (en) * | 2004-12-29 | 2005-06-29 | 复旦大学 | An optimization method for releasing relational data as XML document using buffer memory |
CN101446964A (en) * | 2008-12-31 | 2009-06-03 | 中国建设银行股份有限公司 | Method of data mining and computer device |
CN101639839A (en) * | 2008-07-30 | 2010-02-03 | 中兴通讯股份有限公司 | Method for searching multi-archive file based on temporary table |
CN101860449A (en) * | 2009-04-09 | 2010-10-13 | 华为技术有限公司 | Data query method, device and system |
-
2010
- 2010-11-26 CN CN201010560935.7A patent/CN102479198B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1632793A (en) * | 2004-12-29 | 2005-06-29 | 复旦大学 | An optimization method for releasing relational data as XML document using buffer memory |
CN101639839A (en) * | 2008-07-30 | 2010-02-03 | 中兴通讯股份有限公司 | Method for searching multi-archive file based on temporary table |
CN101446964A (en) * | 2008-12-31 | 2009-06-03 | 中国建设银行股份有限公司 | Method of data mining and computer device |
CN101860449A (en) * | 2009-04-09 | 2010-10-13 | 华为技术有限公司 | Data query method, device and system |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107783978A (en) * | 2016-08-24 | 2018-03-09 | 中安消物联传感(深圳)有限公司 | A kind of big data inquiry return method and device |
CN106649435A (en) * | 2016-09-07 | 2017-05-10 | 努比亚技术有限公司 | Data query device and method of querying data |
CN107463677A (en) * | 2017-08-04 | 2017-12-12 | 网易(杭州)网络有限公司 | Graph making method, system, medium and computing device |
CN107679180A (en) * | 2017-09-29 | 2018-02-09 | 北京金山安全软件有限公司 | Data display method and device |
CN110874368A (en) * | 2018-08-14 | 2020-03-10 | 山东华软金盾软件股份有限公司 | Data paging system and method based on Realm database |
CN109241447A (en) * | 2018-10-29 | 2019-01-18 | 金蝶软件(中国)有限公司 | A kind of method, terminal and the server of inquiring document data |
CN110955696A (en) * | 2019-11-12 | 2020-04-03 | 中国经济信息社有限公司 | Data reading method, device, equipment and storage medium |
CN113312382A (en) * | 2021-05-31 | 2021-08-27 | 上海万物新生环保科技集团有限公司 | Method, device and system for database paging query |
Also Published As
Publication number | Publication date |
---|---|
CN102479198B (en) | 2014-04-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102479198A (en) | Data paging method, device and system | |
CN110168529B (en) | Data storage method, device and storage medium | |
WO2017107826A1 (en) | Service information pushing method and device | |
CN103377336A (en) | Method and system for controlling computer system user rights | |
CN104915450A (en) | HBase-based big data storage and retrieval method and system | |
CN102779040A (en) | Method and device for generating user-defined form | |
CN104123340A (en) | Table-by-table and page-by-page query method and system for database | |
CN102521230A (en) | Result types for conditional data display | |
CN102201009A (en) | Form generating method and device | |
CN102917009B (en) | A kind of stock certificate data collection based on cloud computing technology and storage means and system | |
CN102262674A (en) | Data synchronization method and system for distributed memory database | |
WO2013078583A1 (en) | Method and apparatus for optimizing data access, method and apparatus for optimizing data storage | |
CN111818175B (en) | Enterprise service bus configuration file generation method, device, equipment and storage medium | |
US20190311051A1 (en) | Virtual columns to expose row specific details for query execution in column store databases | |
CN106682139A (en) | Method and system for achieving HBase multi-condition query based on Solr | |
CN102467525A (en) | Document associating method and system | |
CN102117340A (en) | Dynamic data storage method | |
US20190197123A1 (en) | Metadata storage method, device and server | |
CN101408882B (en) | Method and system for searching authorization document | |
CN101719131A (en) | Method, device and system for processing report data | |
US20180300424A1 (en) | Systems and methods for providing structured markup content retrievable by a service that provides rich search results | |
CN111090803A (en) | Data processing method and device, electronic equipment and storage medium | |
CN102768672B (en) | A kind of disk space management method and apparatus | |
CN102724301A (en) | Cloud database system and method and equipment for reading and writing cloud data | |
CN113094039A (en) | Automatic code generation system based on database table |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |