CN104516920A - Data inquiry method and data inquiry system - Google Patents

Data inquiry method and data inquiry system Download PDF

Info

Publication number
CN104516920A
CN104516920A CN201310463740.4A CN201310463740A CN104516920A CN 104516920 A CN104516920 A CN 104516920A CN 201310463740 A CN201310463740 A CN 201310463740A CN 104516920 A CN104516920 A CN 104516920A
Authority
CN
China
Prior art keywords
data
identification
data identification
database
mark
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201310463740.4A
Other languages
Chinese (zh)
Other versions
CN104516920B (en
Inventor
胡哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University Founder Group Co Ltd
Beijing Founder Electronics Co Ltd
Original Assignee
Peking University Founder Group Co Ltd
Beijing Founder Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Peking University Founder Group Co Ltd, Beijing Founder Electronics Co Ltd filed Critical Peking University Founder Group Co Ltd
Priority to CN201310463740.4A priority Critical patent/CN104516920B/en
Publication of CN104516920A publication Critical patent/CN104516920A/en
Application granted granted Critical
Publication of CN104516920B publication Critical patent/CN104516920B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The invention discloses a data inquiry method and a data inquiry system. The data inquiry method includes that confirming target data identifications according to a received identification request command; acquiring a preset number of data identifications from a database lot by lot according to a preset time sequence, loading to a first storage zone, inquiring the target data identifications in the first storage zone, if the target data identifications are inquired, obtaining the target data identifications, returning, and stopping acquiring a preset number of data identifications from the database lot by lot according to the preset time sequence; selecting in the obtained target data identifications according to the received identification selection command, and inquiring the data corresponding to the selected data identifications. According to the technical scheme, the data inquiry method is capable of loading article identifications to a cache according to user needs so as to avoid the time waste due to loading a lot of data to the cache and avoid the influences to system performance.

Description

Data enquire method and data query system
Technical field
The present invention relates to data query technique field, in particular to a kind of data enquire method and a kind of data query system.
Background technology
Say for general should being used for, article is normally made up of jointly a part of word and plurality of pictures.In a database essential information and the word of article normally together be stored in a table, this binary file of picture is then exist in the file system of database outside, only stores the access mode of these pictures in data.
For above-mentioned storage organization, usually, first can obtain the essential information entity of the article of some at data access layer, the picture table then by linking each entity obtains all pictorial informations of each entity, finally returns all full article entities.But this logical thinking be not suitable for the exploitation of modern internet Mobile solution.Because the entity of this complexity of article, reach 100,000 in data, when 1,000,000, the speed obtaining the entity of specified quantity is that motive objects working application user is insupportable, add the restriction of the networking access bandwidth of mobile device, speed is corresponding will be more slow.
Process the problems referred to above in correlation technique and usually adopt the following two kinds mode:
1., when first time opens application, application program can load the entity of all articles usually in the middle of buffer memory, when next client-requested article, and direct paging in the middle of buffer memory and quick response request.
2. the ID of an all article of loading is in the middle of buffer memory, then obtains a series of article ID according to request paging in buffering of client, finally obtains other details and pictorial information according to ID list.
Above-mentioned two kinds of methods, when data magnanimity, are all one slowly access mechanisms.As shown in Figure 1, owing to needing the entity loading all articles, or load the ID of all articles in buffer memory, when there are 100,000 articles in pictorial information table, may be just so data volume at double in picture table, in data up to a million, find a record or some records are operations consuming time.
Summary of the invention
The present invention, just based on the problems referred to above, proposes a kind of data query technique, article mark can be needed to be loaded in buffer memory according to user in batches, thus avoids loading in the buffer the time that mass data wastes, and the impact on system performance.
In view of this, the present invention proposes a kind of data enquire method, comprising: according to the identification request instruction determination target data mark received; According to Preset Time order by criticizing the Data Identification obtaining predetermined amount from database, and be loaded between the first memory block, the described target data mark of inquiry between described first memory block, if inquire described target data mark, then obtain described target data identify and return, and stop according to described Preset Time order by criticizing the Data Identification obtaining predetermined amount from described database; According to the mark selection instruction received, select in the target data mark got, and the data that inquiry is corresponding with the Data Identification chosen.
In this technical scheme, user is when browsing news, website is multipage title in what dedicate user to, user page turning can determine the headline (namely user sends identification request instruction) that needs to browse as required, the title that first website obtains a certain amount of latest news from database is loaded in buffer memory, then the headline whether existed needed for user is inquired about in the buffer, if do not exist, then continuing to obtain a certain amount of news of (relative to latest news) time period is in a database loaded in buffer memory, and from buffer memory, again inquire about the headline whether existed needed for user, the rest may be inferred, support the headline position inquired needed for user.Due to generally, most user wants that the news seen is all be tending towards several up-to-date news, therefore only the demand that up-to-date part headline just can meet most user need be loaded in the buffer, and, during news before user needs to browse the long period, also can extract corresponding headline to user from database, thus also meet the demand of the user of special requirement.Meanwhile, because each loading section news identifies in the buffer, alleviate the pressure of buffer memory largely, improve reading speed and the loading velocity of news mark.
In technique scheme, preferably, comprise by criticizing the step obtaining the Data Identification of predetermined amount from described database according to described Preset Time order: obtain the write time farthest in the write time of each Data Identification in described database and nearest write time, from the Data Identification corresponding to the described nearest write time to described Data Identification farthest corresponding to the write time, by batch Data Identification of acquisition predetermined amount.
In this technical scheme, a certain amount of news mark of each acquisition, can obtain from up-to-date headline to old headline according to the time, thus improve the hit rate that user inquires about headline.
In technique scheme, preferably, by described according to Preset Time order by when batch obtaining the Data Identification of predetermined amount from described database, inquire about the data corresponding to Data Identification of described predetermined amount in the database, and by between Data import to the second memory block corresponding to the Data Identification of described predetermined amount.
In this technical scheme, when extracting news mark from database, the physical contents corresponding to news mark can also be extracted simultaneously, and be loaded in another buffer memory, thus avoid issuable interference when extracting physical contents and extract title.
In technique scheme, preferably, after getting target data mark, also comprise: according to each Data Identification in the target data mark got, in between described second memory block, inquiry and described each target data identify data corresponding respectively, and by the Data import that inquires to stand-by list, and, the Data Identification not inquiring corresponding data is stored to the presets list; According to each Data Identification in described the presets list, from described database, extract the data corresponding respectively with each Data Identification in described the presets list, and by the Data import that extracts extremely described stand-by list; Then when receiving described mark selection instruction, the data that inquiry is corresponding with the described Data Identification chosen from described stand-by list.
In this technical scheme, for the mark not inquiring corresponding data, can unify to store in a list, after treating to inquire the identification process of corresponding data, again according to the disposable extraction corresponding data from database of the mark in list, and extract corresponding data without the need to often running into a mark of inquiring about in another buffer memory less than corresponding data with regard to return data storehouse, improve the efficiency of data query and extraction.
In above-mentioned arbitrary technical scheme, preferably, according to Preset Time order by when batch obtaining the Data Identification of predetermined amount from database, judge whether there is picture in the data corresponding to Data Identification of described predetermined amount, if exist, then obtain the attribute information of described picture, according to described attribute information by described picture-storage to default file, and in the data of described correspondence, retain described attribute information; And after inquiring the data corresponding with the described Data Identification chosen, judge the no attribute information that there is picture in the data corresponding with the described Data Identification chosen, if exist, then from described default file, obtain picture according to described attribute information, and be added in the data corresponding with the described Data Identification chosen.
In this technical scheme, extracting in the process of headline from database, if include picture in the data corresponding to mark, then can according to the attribute information of picture by picture-storage in the file of specifying, the attribute information of picture is retained in corresponding data simultaneously.When user chooses certain headline, if include the attribute information of picture in the data corresponding to this headline, the path that just can directly form according to this attribute information gets corresponding picture in specified file, reduce the mode picture by link, and resolve the time linking and consume when extracting picture.
The application also proposed a kind of data query system, comprising: mark determining unit, for identifying according to the identification request instruction determination target data received; Loading unit, according to Preset Time order by criticizing the Data Identification obtaining predetermined amount from database, and is loaded between the first memory block; Identified query unit, described target data mark is inquired about between described first memory block, if inquire described target data mark, then obtain described target data identify and return, and stop described loading unit according to described Preset Time order by criticizing the Data Identification obtaining predetermined amount from described database; Data query unit, for according to the mark selection instruction received, selects in the target data mark got, and the data that inquiry is corresponding with the Data Identification chosen.
In this technical scheme, user is when browsing news, website is multipage title in what dedicate user to, user page turning can determine the headline (namely user sends identification request instruction) that needs to browse as required, the title that first website obtains a certain amount of latest news from database is loaded in buffer memory, then the headline whether existed needed for user is inquired about in the buffer, if do not exist, then continuing to obtain a certain amount of news of (relative to latest news) time period is in a database loaded in buffer memory, and from buffer memory, again inquire about the headline whether existed needed for user, the rest may be inferred, support the headline position inquired needed for user.Due to generally, most user wants that the news seen is all be tending towards several up-to-date news, therefore only the demand that up-to-date part headline just can meet most user need be loaded in the buffer, and, during news before user needs to browse the long period, also can extract corresponding headline to user from database, thus also meet the demand of the user of special requirement.Meanwhile, because each loading section news identifies in the buffer, alleviate the pressure of buffer memory largely, improve reading speed and the loading velocity of news mark.
In technique scheme, preferably, described loading unit comprises: time acquisition unit, for obtain each Data Identification in described database write time in write time farthest and the nearest write time; Mark acquiring unit, for from the Data Identification corresponding to the described nearest write time to described Data Identification farthest corresponding to the write time, by batch Data Identification of acquisition predetermined amount.
In this technical scheme, a certain amount of news mark of each acquisition, can obtain from up-to-date headline to old headline according to the time, thus improve the hit rate that user inquires about headline.
In technique scheme, preferably, described loading unit also for, by described according to Preset Time order by when batch obtaining the Data Identification of predetermined amount from described database, inquire about the data corresponding to Data Identification of described predetermined amount in the database, and by between Data import to the second memory block corresponding to the Data Identification of described predetermined amount.
In this technical scheme, when extracting news mark from database, the physical contents corresponding to news mark can also be extracted simultaneously, and be loaded in another buffer memory, thus avoid issuable interference when extracting physical contents and extract title.
In technique scheme, preferably, also comprise: extraction unit, wherein, each Data Identification during the target data that described data query unit also gets for basis identifies, between described second memory block, inquiry and described each target data identify data corresponding respectively; Described loading unit also in the Data import that will inquire to stand-by list, and, the Data Identification not inquiring corresponding data is stored to the presets list; Described extraction unit is used for according to each Data Identification in described the presets list, extracts the data corresponding respectively with each Data Identification in described the presets list from described database, and by the Data import that extracts extremely described stand-by list; And described data query unit is when receiving described mark selection instruction, the data that inquiry is corresponding with the described Data Identification chosen from described stand-by list.
In this technical scheme, for the mark not inquiring corresponding data, can unify to store in a list, after treating to inquire the identification process of corresponding data, again according to the disposable extraction corresponding data from database of the mark in list, and extract corresponding data without the need to often running into a mark of inquiring about in another buffer memory less than corresponding data with regard to return data storehouse, improve the efficiency of data query and extraction.
In technique scheme, preferably, also comprise: image store, described loading unit according to Preset Time order by when batch obtaining the Data Identification of predetermined amount from database, judge whether there is picture in the data corresponding to Data Identification of described predetermined amount, if exist, then obtain the attribute information of described picture, according to described attribute information by described picture-storage to default file, and in the data of described correspondence, retain described attribute information; Judging unit, for at described data query unit after inquiring the data corresponding with the described Data Identification chosen, judge the no attribute information that there is picture in the data corresponding with the described Data Identification chosen, if exist, then from described default file, obtain picture according to described attribute information, and be added in the data corresponding with the described Data Identification chosen.
In this technical scheme, extracting in the process of headline from database, if include picture in the data corresponding to mark, then can according to the attribute information of picture by picture-storage in the file of specifying, the attribute information of picture is retained in corresponding data simultaneously.When user chooses certain headline, if include the attribute information of picture in the data corresponding to this headline, the path that just can directly form according to this attribute information gets corresponding picture in specified file, reduce the mode picture by link, and resolve the time linking and consume when extracting picture.
By above technical scheme, article mark can be needed to be loaded in buffer memory according to user in batches, thus avoid loading in the buffer the time that mass data wastes, and the impact on system performance.
Accompanying drawing explanation
Fig. 1 shows in correlation technique the schematic diagram storing data;
Fig. 2 shows the schematic flow diagram of data enquire method according to an embodiment of the invention;
Fig. 3 shows the schematic block diagram of data query system according to an embodiment of the invention;
Fig. 4 shows the schematic diagram storing data according to an embodiment of the invention;
Fig. 5 shows the schematic diagram of picture according to an embodiment of the invention.
Embodiment
In order to more clearly understand above-mentioned purpose of the present invention, feature and advantage, below in conjunction with the drawings and specific embodiments, the present invention is further described in detail.It should be noted that, when not conflicting, the feature in the embodiment of the application and embodiment can combine mutually.
Set forth a lot of detail in the following description so that fully understand the present invention; but; the present invention can also adopt other to be different from other modes described here and implement, and therefore, protection scope of the present invention is not by the restriction of following public specific embodiment.
Fig. 2 shows the schematic flow diagram of data enquire method according to an embodiment of the invention.
As shown in Figure 2, data enquire method comprises according to an embodiment of the invention: step 102, according to the identification request instruction determination target data mark received; Step 104, according to Preset Time order by criticizing the Data Identification obtaining predetermined amount from database, and be loaded between the first memory block, query aim Data Identification between the first memory block, if inquire target data mark, then obtain target data identify and return, and stop according to Preset Time order by criticizing the Data Identification obtaining predetermined amount from database; Step 106, according to the mark selection instruction received, selects in the target data mark got, and the data that inquiry is corresponding with the Data Identification chosen.
User is when browsing news, website is multipage title in what dedicate user to, user page turning can determine the headline (namely user sends identification request instruction) that needs to browse as required, the title that first website obtains a certain amount of latest news from database is loaded in buffer memory, then the headline whether existed needed for user is inquired about in the buffer, if do not exist, then continuing to obtain a certain amount of news of (relative to latest news) time period is in a database loaded in buffer memory, and from buffer memory, again inquire about the headline whether existed needed for user, the rest may be inferred, support the headline position inquired needed for user.Due to generally, most user wants that the news seen is all be tending towards several up-to-date news, therefore only the demand that up-to-date part headline just can meet most user need be loaded in the buffer, and, during news before user needs to browse the long period, also can extract corresponding headline to user from database, thus also meet the demand of the user of special requirement.Meanwhile, because each loading section news identifies in the buffer, alleviate the pressure of buffer memory largely, improve reading speed and the loading velocity of news mark.
Preferably, step 104 comprises: obtain the write time farthest in the write time of each Data Identification in database and nearest write time, from the Data Identification corresponding to the nearest write time to the Data Identification farthest corresponding to the write time, by batch Data Identification of acquisition predetermined amount.
A certain amount of news mark of each acquisition, can obtain from up-to-date headline to old headline according to the time, thus improve the hit rate that user inquires about headline.
Preferably, according to Preset Time order by when batch obtaining the Data Identification of predetermined amount from database, inquire about the data corresponding to Data Identification of predetermined amount in a database, and by between Data import to the second memory block corresponding to the Data Identification of predetermined amount.
When extracting news mark from database, the physical contents corresponding to news mark can also be extracted simultaneously, and be loaded in another buffer memory, thus avoid issuable interference when extracting physical contents and extract title.
Preferably, after getting target data mark, also comprise: according to each Data Identification in the target data mark got, in between the second memory block, inquiry and each target data identify data corresponding respectively, and by the Data import that inquires to stand-by list, and, the Data Identification not inquiring corresponding data is stored to the presets list; According to each Data Identification in the presets list, from database, extract the data corresponding respectively with each Data Identification in the presets list, and by the Data import that extracts extremely stand-by list; Then when receiving mark selection instruction, the data that inquiry is corresponding with the Data Identification chosen from stand-by list.
For the mark not inquiring corresponding data, can unify to store in a list, after treating to inquire the identification process of corresponding data, again according to the disposable extraction corresponding data from database of the mark in list, and extract corresponding data without the need to often running into a mark of inquiring about in another buffer memory less than corresponding data with regard to return data storehouse, improve the efficiency of data query and extraction.
Preferably, according to Preset Time order by when batch obtaining the Data Identification of predetermined amount from database, judge whether there is picture in the data corresponding to Data Identification of predetermined amount, if exist, then obtain the attribute information of picture, according to attribute information by picture-storage to default file, and in the data of correspondence reserved property information; And after the data that the Data Identification inquired with choose is corresponding, judge the no attribute information that there is picture in the data corresponding with the Data Identification chosen, if exist, then from default file, obtain picture according to attribute information, and be added in the data corresponding with the Data Identification chosen.
Extracting in the process of headline from database, if include picture in the data corresponding to mark, then can according to the attribute information of picture by picture-storage in the file of specifying, the attribute information of picture is retained in corresponding data simultaneously.When user chooses certain headline, if include the attribute information of picture in the data corresponding to this headline, the path that just can directly form according to this attribute information gets corresponding picture in specified file, reduce the mode picture by link, and resolve the time linking and consume when extracting picture.
Fig. 3 shows the schematic block diagram of data query system according to an embodiment of the invention.
As shown in Figure 3, data query system 200 comprises according to an embodiment of the invention: mark determining unit 202, for identifying according to the identification request instruction determination target data received; Loading unit 204, according to Preset Time order by criticizing the Data Identification obtaining predetermined amount from database, and is loaded between the first memory block; Identified query unit 206, for query aim Data Identification middle between the first memory block, if inquire target data mark, then obtain target data and identify and return, and stop loading unit 204 according to Preset Time order by criticizing the Data Identification obtaining predetermined amount from database; Data query unit 208, for according to the mark selection instruction received, selects in the target data mark got, and the data that inquiry is corresponding with the Data Identification chosen.
User is when browsing news, website is multipage title in what dedicate user to, user page turning can determine the headline (namely user sends identification request instruction) that needs to browse as required, the title that first website obtains a certain amount of latest news from database is loaded in buffer memory, then the headline whether existed needed for user is inquired about in the buffer, if do not exist, then continuing to obtain a certain amount of news of (relative to latest news) time period is in a database loaded in buffer memory, and from buffer memory, again inquire about the headline whether existed needed for user, the rest may be inferred, support the headline position inquired needed for user.Due to generally, most user wants that the news seen is all be tending towards several up-to-date news, therefore only the demand that up-to-date part headline just can meet most user need be loaded in the buffer, and, during news before user needs to browse the long period, also can extract corresponding headline to user from database, thus also meet the demand of the user of special requirement.Meanwhile, because each loading section news identifies in the buffer, alleviate the pressure of buffer memory largely, improve reading speed and the loading velocity of news mark.
Preferably, loading unit 204 comprises: time acquisition unit 2042, for obtain each Data Identification in database write time in write time farthest and the nearest write time; Mark acquiring unit 2044, for from the Data Identification corresponding to the nearest write time to the Data Identification farthest corresponding to the write time, by batch Data Identification of acquisition predetermined amount.
A certain amount of news mark of each acquisition, can obtain from up-to-date headline to old headline according to the time, thus improve the hit rate that user inquires about headline.
Preferably, loading unit 204 also for, according to Preset Time order by when batch obtaining the Data Identification of predetermined amount from database, inquire about the data corresponding to Data Identification of predetermined amount in a database, and by between Data import to the second memory block corresponding to the Data Identification of predetermined amount.
When extracting news mark from database, the physical contents corresponding to news mark can also be extracted simultaneously, and be loaded in another buffer memory, thus avoid issuable interference when extracting physical contents and extract title.
Preferably, also comprise: extraction unit 210, wherein, each Data Identification during the target data that data query unit 208 also gets for basis identifies, between the second memory block, inquiry and each target data identify data corresponding respectively; Loading unit 204 also in the Data import that will inquire to stand-by list, and, the Data Identification not inquiring corresponding data is stored to the presets list; Extraction unit 210 for according to each Data Identification in the presets list, extracts the data corresponding respectively with each Data Identification in the presets list from database, and by the Data import that extracts extremely stand-by list; And data query unit 208 is when receiving mark selection instruction, the data that inquiry is corresponding with the Data Identification chosen from stand-by list.
For the mark not inquiring corresponding data, can unify to store in a list, after treating to inquire the identification process of corresponding data, again according to the disposable extraction corresponding data from database of the mark in list, and extract corresponding data without the need to often running into a mark of inquiring about in another buffer memory less than corresponding data with regard to return data storehouse, improve the efficiency of data query and extraction.
Preferably, also comprise: image store 212, loading unit 204 according to Preset Time order by when batch obtaining the Data Identification of predetermined amount from database, judge whether there is picture in the data corresponding to Data Identification of predetermined amount, if exist, then obtain the attribute information of picture, according to attribute information by picture-storage to default file, and in the data of correspondence reserved property information; Judging unit 214, for at data query unit 208 after the data that the Data Identification inquired with choose is corresponding, judge the no attribute information that there is picture in the data corresponding with the Data Identification chosen, if exist, then from default file, obtain picture according to attribute information, and be added in the data corresponding with the Data Identification chosen.
Extracting in the process of headline from database, if include picture in the data corresponding to mark, then can according to the attribute information of picture by picture-storage in the file of specifying, the attribute information of picture is retained in corresponding data simultaneously.When user chooses certain headline, if include the attribute information of picture in the data corresponding to this headline, the path that just can directly form according to this attribute information gets corresponding picture in specified file, reduce the mode picture by link, and resolve the time linking and consume when extracting picture.
It should be noted that, between above-mentioned first memory block and between the second memory block, except comprising buffer memory, can also be other types memory block between, such as ROM, flash memory etc.Further, above-mentioned Data Identification, except comprising headline, can also comprise the Data Identification of various other types, the title of such as article, the title etc. of each chapters and sections in books.
Fig. 4 shows the schematic diagram storing data according to an embodiment of the invention.
As shown in Figure 4, when user opens application first time, when such as opening data query system 200 website had as shown in Figure 2, the screen message of the terminal of user can be analyzed in website, such as this user uses mobile phone, most multipotency is identified for the font size news that is 11 and holds 20, so website can obtain 100 news marks from database, and be loaded between memory block, then between memory block, obtain 20 up-to-date news marks be presented to user, user can page turning backward as required, such as user needs to browse the 3rd page of news mark, i.e. the 41st to the 60th news mark, so website can extract the 41st to the 60th news mark fast and be presented to user between memory block.For the page turn over operation of user at first 5 pages, website can be taken out corresponding news mark and is presented to user by Quick between memory block.
And when user inquires about the news mark after the 5th page, such as inquire about the news mark of the 12nd page, the time that so website can be extracted from database and above-mentioned 100 news identify write into Databasce is adjacent, and the time of write into Databasce is early than other 100 news mark of above-mentioned 100 news mark.Such as up-to-date news identification number is 1, so website only loads the news of sequence number from 1 to 100 at first and is identified between memory block, when user inquires about the news mark of the 12nd page, the news mark of sequence number from 101 to 200 just can be extracted from database, be loaded between memory block, because the 12nd news mark also corresponds to the news mark of sequence number from 221 to 240, corresponding news mark cannot be inquired the news mark of sequence number from 101 to 200, then continue to extract in a database the Data Identification of sequence number from 201 to 300, and be loaded between memory block, then can between memory block in inquire Data Identification needed for user.
Due to generally, most of user is only interested in the news of up-to-date (namely distance current point in time is nearest), all news marks in superimpose data storehouse are all loaded between memory block, news between memory block is identified, user may only can consult a little, thus causes resource between memory block and greatly waste.Therefore only can load several up-to-date news to be identified between memory block, and without the need to all news marks in database are all loaded between memory block, meet the demand of most of user on the one hand, improve user to be identified by terminal inquiry news, resource between the memory block of website can be avoided to be taken by too much on the other hand.
Namely the size between memory block is dynamic change as required.X represents each step-length increased between memory block, and X gets suitable data according to page size in paging, generally should be too not large.What can effectively ensure client-requested between the memory block of this dynamic size is corresponding fast, and it can ensure speed not by the impact that the increase of data total amount brings, and is applicable to the long-run development of application.On the other hand, for the value of size X between the memory block in steps A, need the demand that can meet in most cases client between the memory block of guarantee X bar data, reduce the number of times that requested database increases size between memory block.
When news mark is loaded between memory block, article entity corresponding for each news mark can also to be loaded between another memory block in (namely between the second memory block), thus after inquiring the mark of the news needed for user, article entity corresponding to these can being identified is stand-by from extracting known article list between another memory block, when user chooses certain news to identify, just Quick takes out the mark correspondence chosen between another memory block article entity can be presented to user, because article entity is carried between another memory block, avoid the issuable interference when extracting mark and entity.
When data (entity) corresponding according to Data Identification inquiry, may be able to inquire, also may inquire about less than, for the mark cannot inquiring about corresponding data, can be stored in unknown article ID list (i.e. the presets list), and then after processing all Data Identifications, all Data Identifications that cannot inquire corresponding data are just all stored in unknown article ID list, and then from database, extract corresponding data according to the Data Identification unification in list again, each the unknown article ID avoiding cyclic query extracts article entity from database, but obtain an article list of entities by the disposable Query Database of unknown article ID list, improve the efficiency of data query and extraction, decrease the inquiry times of database.
In order to simplify picture storage mode, glue file catalogue (i.e. default file) picture file can be have employed, using these picture file pathways of some attribute names of article and/or picture.Thus when obtaining picture, just after the essential information obtaining article just, directly can access by I/O the picture needed according in code.Such as, can the naming with following modes of picture:
[article ID] _ [wide] _ [height] _ [column ID] _ [key] .Jpg
[article ID] and [column ID] wherein can be the attribute information of picture place article, also can be the attribute information (i.e. the ID of article belonging to picture and the ID of described article place column) of picture self, [wide] and [height] wherein can refer to the positional information of picture in article, also the attribute information of article self can be referred to, wherein [key] part is the character string of the stochastic generation be stored in article Basic Information Table, it is only stored in the database day after tomorrow and uses to server-side application, user terminal can not be exposed to, be used for protecting the secure access of picture with this, avoid the safety problem brought by this fixing naming rule.On the other hand, the information about picture itself can directly be stored in the metamessage territory of picture.Digital picture, except storing Pixel Information, can also add some additional informations, marking on a map of such as picture, describes, author, creation-time etc.In the application, by relevant API can very aspect customization and access these information, and does not need to use in a database in an independent table and store these information, and the chain of resolving in article fetches acquisition picture.
Carry out picture by the way, decrease the number of times of visit data and comprise at one the time that in the table of mass picture information, index one or plurality of pictures information spend.By the attribute that some is unique, in file system, picture can be divided into some catalogues, as shown in Figure 5, such as the catalogue of a column ID name stores the picture that all articles under this column produce, only store the picture of article ID between 1000 to 10000 with the catalogue of 1000_10000 name, these modes are combined the speed that can greatly reduce search one pictures.
Finally, by the data corresponding to the Data Identification that extracts between the second memory block, be merged in stand-by list with the data inquired from database according to the Data Identification unification in the presets list, and according to initial obtain from database time each data corresponding to order ID the data in stand-by list are sorted, to ensure that article entity correctly shows at user terminal.
More than be described with reference to the accompanying drawings technical scheme of the present invention, consider in correlation technique, when user enters website browsing data, all Data Identifications or all data entities can be loaded in buffer memory by website, and the small part content that just write time is up-to-date in fact needed for user, therefore can cause the waste of cache resources, and system running speed reduces.By the technical scheme of the application, article mark can be needed to be loaded in buffer memory according to user in batches, thus avoid loading in the buffer the time that mass data wastes, and the impact on system performance.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the process flow diagram of the method for the embodiment of the present invention, equipment (system) and computer program and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computing machine or other programmable data processing device produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make on computing machine or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computing machine or other programmable devices is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
In the present invention, term " first ", " second " only for describing object, and can not be interpreted as instruction or hint relative importance.Term " multiple " refers to two or more, unless otherwise clear and definite restriction.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. a data enquire method, is characterized in that, comprising:
According to the identification request instruction determination target data mark received;
According to Preset Time order by criticizing the Data Identification obtaining predetermined amount from database, and be loaded between the first memory block, the described target data mark of inquiry between described first memory block, if inquire described target data mark, then obtain described target data identify and return, and stop according to described Preset Time order by criticizing the Data Identification obtaining predetermined amount from described database;
According to the mark selection instruction received, select in the target data mark got, and the data that inquiry is corresponding with the Data Identification chosen.
2. data enquire method according to claim 1, is characterized in that, comprises by criticizing the step obtaining the Data Identification of predetermined amount from described database according to described Preset Time order:
Obtain the write time farthest in the write time of each Data Identification in described database and nearest write time, from the Data Identification corresponding to the described nearest write time to described Data Identification farthest corresponding to the write time, by batch Data Identification of acquisition predetermined amount.
3. data enquire method according to claim 1, it is characterized in that, by described according to Preset Time order by when batch obtaining the Data Identification of predetermined amount from described database, inquire about the data corresponding to Data Identification of described predetermined amount in the database, and by between Data import to the second memory block corresponding to the Data Identification of described predetermined amount.
4. data enquire method according to claim 3, is characterized in that, after getting target data mark, also comprises:
According to each Data Identification in the target data mark got, in between described second memory block, inquiry and described each target data identify data corresponding respectively, and by the Data import that inquires to stand-by list, and, the Data Identification not inquiring corresponding data is stored to the presets list;
According to each Data Identification in described the presets list, from described database, extract the data corresponding respectively with each Data Identification in described the presets list, and by the Data import that extracts extremely described stand-by list; Then
When receiving described mark selection instruction, the data that inquiry is corresponding with the described Data Identification chosen from described stand-by list.
5. data enquire method according to any one of claim 1 to 4, it is characterized in that, according to Preset Time order by when batch obtaining the Data Identification of predetermined amount from database, judge whether there is picture in the data corresponding to Data Identification of described predetermined amount, if exist, then obtain the attribute information of described picture, according to described attribute information by described picture-storage to default file, and in the data of described correspondence, retain described attribute information; And
After inquiring the data corresponding with the described Data Identification chosen, judge the no attribute information that there is picture in the data corresponding with the described Data Identification chosen, if exist, then from described default file, obtain picture according to described attribute information, and be added in the data corresponding with the described Data Identification chosen.
6. a data query system, is characterized in that, comprising:
Mark determining unit, for identifying according to the identification request instruction determination target data received;
Loading unit, according to Preset Time order by criticizing the Data Identification obtaining predetermined amount from database, and is loaded between the first memory block;
Identified query unit, described target data mark is inquired about between described first memory block, if inquire described target data mark, then obtain described target data identify and return, and stop described loading unit according to described Preset Time order by criticizing the Data Identification obtaining predetermined amount from described database;
Data query unit, for according to the mark selection instruction received, selects in the target data mark got, and the data that inquiry is corresponding with the Data Identification chosen.
7. data query system according to claim 6, is characterized in that, described loading unit comprises:
Time acquisition unit, for obtain each Data Identification in described database write time in write time farthest and the nearest write time;
Mark acquiring unit, for from the Data Identification corresponding to the described nearest write time to described Data Identification farthest corresponding to the write time, by batch Data Identification of acquisition predetermined amount.
8. data query system according to claim 6, it is characterized in that, described loading unit also for, by described according to Preset Time order by when batch obtaining the Data Identification of predetermined amount from described database, inquire about the data corresponding to Data Identification of described predetermined amount in the database, and by between Data import to the second memory block corresponding to the Data Identification of described predetermined amount.
9. data query system according to claim 8, is characterized in that, also comprises:
Extraction unit, wherein, each Data Identification during the target data that described data query unit also gets for basis identifies, between described second memory block, inquiry and described each target data identify data corresponding respectively;
Described loading unit also in the Data import that will inquire to stand-by list, and, the Data Identification not inquiring corresponding data is stored to the presets list;
Described extraction unit is used for according to each Data Identification in described the presets list, extracts the data corresponding respectively with each Data Identification in described the presets list from described database, and by the Data import that extracts extremely described stand-by list; And
Described data query unit, when receiving described mark selection instruction, inquires about the data corresponding with the described Data Identification chosen from described stand-by list.
10. the data query system according to any one of claim 6 to 9, is characterized in that, also comprises:
Image store, described loading unit according to Preset Time order by when batch obtaining the Data Identification of predetermined amount from database, judge whether there is picture in the data corresponding to Data Identification of described predetermined amount, if exist, then obtain the attribute information of described picture, according to described attribute information by described picture-storage to default file, and in the data of described correspondence, retain described attribute information;
Judging unit, for at described data query unit after inquiring the data corresponding with the described Data Identification chosen, judge the no attribute information that there is picture in the data corresponding with the described Data Identification chosen, if exist, then from described default file, obtain picture according to described attribute information, and be added in the data corresponding with the described Data Identification chosen.
CN201310463740.4A 2013-10-08 2013-10-08 Data query method and data query system Expired - Fee Related CN104516920B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310463740.4A CN104516920B (en) 2013-10-08 2013-10-08 Data query method and data query system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310463740.4A CN104516920B (en) 2013-10-08 2013-10-08 Data query method and data query system

Publications (2)

Publication Number Publication Date
CN104516920A true CN104516920A (en) 2015-04-15
CN104516920B CN104516920B (en) 2018-06-05

Family

ID=52792229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310463740.4A Expired - Fee Related CN104516920B (en) 2013-10-08 2013-10-08 Data query method and data query system

Country Status (1)

Country Link
CN (1) CN104516920B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105653652A (en) * 2015-12-28 2016-06-08 上海瀚银信息技术有限公司 Data synchronization method and system
CN106202084A (en) * 2015-04-30 2016-12-07 阿里巴巴集团控股有限公司 Date storage method and data storage device
CN106599235A (en) * 2016-12-20 2017-04-26 四川长虹电器股份有限公司 News acquisition method for Internet-of-Vehicles system
CN106951432A (en) * 2017-01-23 2017-07-14 北京建筑大学 BIM data light weight method and device
CN109241084A (en) * 2018-09-17 2019-01-18 平安科技(深圳)有限公司 Querying method, terminal device and the medium of data
CN110781387A (en) * 2019-10-10 2020-02-11 深圳证券交易所 Pushing method of stock market snapshot, stock trading system and storage medium
CN111159521A (en) * 2019-12-12 2020-05-15 中国平安财产保险股份有限公司 Data query method, system, computer device and storage medium
CN112148984A (en) * 2020-09-30 2020-12-29 微梦创科网络科技(中国)有限公司 Method and system for capturing instant interest of user
CN114443581A (en) * 2022-04-11 2022-05-06 苏州浪潮智能科技有限公司 Download control method, device, equipment and storage medium
CN111159521B (en) * 2019-12-12 2024-04-30 中国平安财产保险股份有限公司 Data query method, system, computer device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040010493A1 (en) * 1997-11-19 2004-01-15 Ns Solutions Corporation Database system and a method of data retrieval from the system
CN101751443A (en) * 2008-12-10 2010-06-23 鸿富锦精密工业(深圳)有限公司 Data searching and processing system as well as method
CN102737133A (en) * 2012-06-27 2012-10-17 北京城市网邻信息技术有限公司 Real-time searching method
CN103336671A (en) * 2013-06-17 2013-10-02 北京奇虎科技有限公司 Method and equipment for acquiring data from network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040010493A1 (en) * 1997-11-19 2004-01-15 Ns Solutions Corporation Database system and a method of data retrieval from the system
CN101751443A (en) * 2008-12-10 2010-06-23 鸿富锦精密工业(深圳)有限公司 Data searching and processing system as well as method
CN102737133A (en) * 2012-06-27 2012-10-17 北京城市网邻信息技术有限公司 Real-time searching method
CN103336671A (en) * 2013-06-17 2013-10-02 北京奇虎科技有限公司 Method and equipment for acquiring data from network

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202084A (en) * 2015-04-30 2016-12-07 阿里巴巴集团控股有限公司 Date storage method and data storage device
CN105653652A (en) * 2015-12-28 2016-06-08 上海瀚银信息技术有限公司 Data synchronization method and system
CN105653652B (en) * 2015-12-28 2019-07-05 上海瀚银信息技术有限公司 A kind of method of data synchronization and system
CN106599235A (en) * 2016-12-20 2017-04-26 四川长虹电器股份有限公司 News acquisition method for Internet-of-Vehicles system
CN106951432A (en) * 2017-01-23 2017-07-14 北京建筑大学 BIM data light weight method and device
CN109241084A (en) * 2018-09-17 2019-01-18 平安科技(深圳)有限公司 Querying method, terminal device and the medium of data
CN110781387A (en) * 2019-10-10 2020-02-11 深圳证券交易所 Pushing method of stock market snapshot, stock trading system and storage medium
CN111159521A (en) * 2019-12-12 2020-05-15 中国平安财产保险股份有限公司 Data query method, system, computer device and storage medium
CN111159521B (en) * 2019-12-12 2024-04-30 中国平安财产保险股份有限公司 Data query method, system, computer device and storage medium
CN112148984A (en) * 2020-09-30 2020-12-29 微梦创科网络科技(中国)有限公司 Method and system for capturing instant interest of user
CN112148984B (en) * 2020-09-30 2023-11-10 微梦创科网络科技(中国)有限公司 Method and system for capturing instant interests of user
CN114443581A (en) * 2022-04-11 2022-05-06 苏州浪潮智能科技有限公司 Download control method, device, equipment and storage medium
CN114443581B (en) * 2022-04-11 2022-06-17 苏州浪潮智能科技有限公司 Download control method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN104516920B (en) 2018-06-05

Similar Documents

Publication Publication Date Title
CN104516920A (en) Data inquiry method and data inquiry system
US20220318336A1 (en) Method and Terminal Device for Extracting Web Page Content
US10250526B2 (en) Method and apparatus for increasing subresource loading speed
US9448999B2 (en) Method and device to detect similar documents
KR100930455B1 (en) Method and system for generating search collection by query
CN102737133B (en) A kind of method of real-time search
KR101672349B1 (en) File cloud service apparatus and method
CN105824830B (en) Method, client and equipment for displaying page
CN104331428A (en) Storage and access method of small files and large files
US7376650B1 (en) Method and system for redirecting a request using redirection patterns
CN104794177A (en) Data storing method and device
CN108920600A (en) A kind of metadata of distributed type file system forecasting method based on data correlation
CN107526828B (en) Page information recommendation method and device
CN107391535B (en) Method and device for searching document in document application
WO2014108038A1 (en) Frequently-used website generation client terminal, server, system and method
CN105760380A (en) Database query method, device and system
CN113010476B (en) Metadata searching method, device, equipment and computer readable storage medium
CN104778271A (en) Video data caching method and device
MXPA04007146A (en) Method and apparatus for late-binding/dynamic pathname resolution.
EP4327215A1 (en) Interactive user interface (iui) and associated systems and methods for display of sustainability information corresponding to an item
CN102955808A (en) Data acquisition method and distributed file system
CN110020297A (en) A kind of loading method of web page contents, apparatus and system
CN109086304B (en) Electronic bookmark updating method, device and storage medium
CN108664191B (en) System access method and device
CN107423267B (en) Method and system for transmitting and combining modified files based on cursor positioning

Legal Events

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

Granted publication date: 20180605

Termination date: 20191008

CF01 Termination of patent right due to non-payment of annual fee