CN109857760A - Quick response search method and device, computer installation and storage medium - Google Patents

Quick response search method and device, computer installation and storage medium Download PDF

Info

Publication number
CN109857760A
CN109857760A CN201811575997.8A CN201811575997A CN109857760A CN 109857760 A CN109857760 A CN 109857760A CN 201811575997 A CN201811575997 A CN 201811575997A CN 109857760 A CN109857760 A CN 109857760A
Authority
CN
China
Prior art keywords
query result
retrieval request
buffer zone
request
retrieval
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.)
Pending
Application number
CN201811575997.8A
Other languages
Chinese (zh)
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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201811575997.8A priority Critical patent/CN109857760A/en
Publication of CN109857760A publication Critical patent/CN109857760A/en
Pending legal-status Critical Current

Links

Abstract

The present invention provides a kind of quick response search method, when the retrieval request received is first request, by inquiring the query result to match with the retrieval request in database, returning to query result and caching the query result to buffer zone;If the retrieval request received is not first request, inquiry and the matched query result of the retrieval request directly in buffer zone, if not inquiring in the buffer matching as a result, going in database to inquire again.The present invention also provides a kind of quick response retrieval device, computer installation and storage mediums.The present invention is conducive to improve efficiency data query, reduces database pressure.

Description

Quick response search method and device, computer installation and storage medium
Technical field
The present invention relates to field of computer technology, and in particular to a kind of quick response search method and device, computer dress It sets and computer readable storage medium.
Background technique
With flourishing for cloud computing and internet, more and more fields will all face the retrieval of data.If Retrieving is realized using the method for simple data base querying, because its data volume is larger, query time can be with system The increase of data volume and increase, thus occupy database connection time it is also longer.Therefore, if within the regular hour, and In the biggish situation of hair amount, database connection will be made to be occupied full, obtain the inquiry of more and more users can not immediately It is connected to database, and in the state waited.In this way, database loads are considerably increased, so that the response speed of system is got over Come slower, or even will appear the case where cannot respond to, will much be unable to satisfy user demand.
Summary of the invention
In view of the foregoing, it is necessary to propose a kind of quick response search method and device, computer installation and computer Readable storage medium storing program for executing, to improve the response speed of data retrieval.
The first aspect of the application provides a kind of quick response search method, is applied in computer installation, the method Include:
When receiving retrieval request, judge whether the retrieval request is first request;
If the retrieval request is first request, the inquiry knot to match with the retrieval request is inquired from database Fruit, and the query result is returned to, while the query result being cached into preset buffer zone;
If the retrieval request received is not first request, inquiry whether there is and institute from the buffer zone State the matched query result of retrieval request;
If inquired in the buffer zone with the matched query result of the retrieval request, return from the caching The query result inquired in region;And
If do not inquired in the buffer zone with the matched query result of retrieval request, from database inquiry with The matched query result of retrieval request, and the query result inquired in the database is returned and cache to In the buffer zone.
Preferably, described " judge user retrieval request whether be first request method " include:
The retrieval request received is compared with a retrieval request historical record, judges that the retrieval request is A no retrieval request with historical record matches;
If the retrieval request matches with the history retrieval request in retrieval request historical record, connect described in confirmation The retrieval request received is not first request;
If the history retrieval request to match with the retrieval request is not found in retrieval request historical record, really Recognizing the retrieval request received is not first request, and the retrieval request received is added to the historical record In.
Preferably, described cache the query result into preset buffer zone includes: using Key-Value system System, using the key word of the inquiry of the query result as Key, using the query result as the corresponding Value of the keyword It stores to the buffer zone.
Preferably, query result of the caching into the buffer zone is stored in a manner of database table, the data The arrangement mode of query result in the table of library includes such as any one under type: time sequencing arrangement, retrieval frequency row Column come before more wherein the frequency that is retrieved is higher.
Preferably, the method also includes:
Judge whether the number that the query result is queried within a preset time is more than preset value;
If being more than the preset value, the query result is cached;
If the query result is queried number less than the preset value, not to the query result within a preset time It is cached.
Preferably, the query result cached in the buffer zone is cleared up in the given time, wherein described in cleaning The method of query result includes: in buffer zone
When caching the query result, while recording the cache-time of the query result;
When judging whether caching duration of the query result in the buffer zone in the buffer zone reaches default It is long;
If caching duration of the query result cached in the buffer zone reaches preset duration, looked into described in deletion Ask result.
Preferably, the query result cached in the buffer zone is cleared up in the given time, wherein described in cleaning The method of query result includes: in buffer zone
Judge whether the remaining memory space in the buffer zone is less than preset value;
If the residual memory space of the buffer zone is less than the preset value, the portion in the buffer zone is removed Divide data cached, wherein select the data removed to pass through any one realization in following methods: removing has cached duration More than the data of preset duration, by the buffer zone it is data cached according to caching duration be ranked up and remove caching when Long ranking near preceding preset number it is data cached, the query result in buffer zone is arranged according to the frequency being retrieved Sequence simultaneously deletes the data cached of preset number of the retrieval frequency ranking after.
The second aspect of the application provides a kind of quick response retrieval device, and described device includes:
Retrieval request obtains module, judges that the retrieval is asked for receiving retrieval request, and when receiving retrieval request No Seeking Truth is first request;
Enquiry module obtains module for the retrieval request and determines that the retrieval request is first request, then by data The query result to match with the retrieval request is inquired in library;
Query result return module is for returning to the query result;
Cache module is for caching the query result into preset buffer zone;
The enquiry module is also used to when the retrieval request received is not first request, in the buffer zone Middle inquiry whether there is and the matched query result of the retrieval request;
It is returned if being inquired in the buffer zone with the matched query result of the retrieval request, the query result It returns module and returns to the query result inquired in the buffer zone;And
It goes to count with the matched query result of retrieval request, the enquiry module if not inquiring in the buffer zone It will be looked into the database according to inquiry in library and the matched query result of the retrieval request, the query result return module The query result ask returns, and device cache module caches the query result inquired in the database to described In buffer zone.
The third aspect of the application provides a kind of computer installation, and the computer installation includes processor, the processing Device is for realizing quick response search method as previously described when executing the computer program stored in memory.
The fourth aspect of the application provides a kind of computer readable storage medium, is stored thereon with computer program, described Quick response search method as previously described is realized when computer program is executed by processor.
The present invention is by caching user query result, when user inputs keyword query directly by looking into caching Data are ask, user query efficiency is improved, reduce database pressure.In addition, the higher query result of enquiry frequency is cached, The query result being of little use is not cached, system resource optimization is further increased, finally, dynamic updates caching so that query result Accurately and timely.
Detailed description of the invention
Fig. 1 is the application environment configuration diagram for the quick response search method that the embodiment of the present invention one provides.
Fig. 2 is quick response search method flow chart provided by Embodiment 2 of the present invention.
Fig. 3 is the structural schematic diagram for the quick response retrieval device that the embodiment of the present invention three provides.
Fig. 4 is the computer installation schematic diagram that the embodiment of the present invention four provides.
Specific embodiment
To better understand the objects, features and advantages of the present invention, with reference to the accompanying drawing and specific real Applying example, the present invention will be described in detail.It should be noted that in the absence of conflict, embodiments herein and embodiment In feature can be combined with each other.
In the following description, numerous specific details are set forth in order to facilitate a full understanding of the present invention, described embodiment is only It is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill Personnel's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Unless otherwise defined, all technical and scientific terms used herein and belong to technical field of the invention The normally understood meaning of technical staff is identical.Term as used herein in the specification of the present invention is intended merely to description tool The purpose of the embodiment of body, it is not intended that in the limitation present invention.
Embodiment one
As shown in fig.1, the application environment framework signal of the quick response search method provided for the embodiment of the present invention one Figure.
It includes computer installation 1 and at least one user terminal 2 that quick response search method of the invention, which is applied at one, Environment in, the computer installation 1 and at least one user terminal 2 establish communication connection by network.In the present embodiment, institute Stating computer installation 1 can be server or PC, wherein the server can be single server, server Cluster or Cloud Server etc..
The user terminal 2 is the various intelligent electronic devices with display screen, including but not limited to smart phone, plate Computer, convenient computer on knee, desktop computer etc..
In one embodiment, the computer installation 1 and at least one described user terminal 2 can pass through wired (example Such as USB (Universal Serial Bus, universal serial bus) wirelessly establishes communication connection.The wireless mode It can be any type of conventional wireless communication, such as radio, Wireless Fidelity (Wireless Fidelity, WIFI), bee Nest, satellite, broadcast etc..Wireless communication technique may include, but be not limited to, global system for mobile communications (Global System For Mobile Communications, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), CDMA (Code Division Multiple Access, CDMA), wideband code division multiple access (W-CDMA), CDMA2000, IMT single carrier (IMT Single Carrier), enhanced data rates for gsm evolution (Enhanced Data Rates for GSM Evolution, EDGE), it is Long Term Evolution (Long-Term Evolution, LTE), advanced long-term Evolution technology, time-division Long Term Evolution (Time-Division LTE, TD-LTE), high performance radio local area network (High Performance Radio Local Area Network, HiperLAN), high performance radio wide area network (High Performance Radio Wide Area Network, HiperWAN), local multiple spot distribute business (Local Multipoint Distribution Service, LMDS), full micro-wave access global inter communication (Worldwide Interoperability for Microwave Access, WiMAX), ZigBee protocol (ZigBee), bluetooth, orthogonal frequency division multiplexing It is empty with technology (Flash Orthogonal Frequency-Division Multiplexing, Flash-OFDM), large capacity Division multiple access (High Capacity Spatial Division Multiple Access, HC-SDMA), General Mobile electricity Letter system (Universal Mobile Telecommunications System, UMTS), Universal Mobile Telecommunications System time-division Duplexing (UMTS Time-Division Duplexing, UMTS-TDD), evolved high-speed packet access (Evolved High Speed Packet Access, HSPA+), TD SDMA (Time Division Synchronous Code Division Multiple Access, TD-SCDMA), evolution data optimization (Evolution-Data Optimized, EV-DO), Digital Enhanced Cordless Communications (Digital Enhanced Cordless Telecommunications, DECT) and Other.
The computer installation 1 for needing to carry out quick response retrieval can integrate directly on computer installation 1 Quick response search function provided by method of the invention, or installation is for realizing the client of method of the invention.Again Such as, method provided by the present invention can also be with the shape of Software Development Kit (Software Development Kit, SDK) Formula operates in the equipment such as server, in the form of SDK provide quick response search function interface, computer installation 1 or its The processing to abnormal application program can be realized by the interface provided in his equipment.
Embodiment two
It please refers to shown in Fig. 2, is the flow chart of quick response search method provided by Embodiment 2 of the present invention.According to difference Demand, the sequence of step can change in the flow chart, and certain steps can be omitted.
Step S11, when receiving retrieval request, judge whether the retrieval request is first request, if asking for the first time It asks, thens follow the steps S12, if not first request, thens follow the steps S13.
The retrieval request can be the retrieval request that user inputs in web platform, include inspection in the retrieval request Rope keyword, the search key can be text or network address etc..
For example, the web platform can be one for automatically generating the platform of test case, and the platform can be with The test case template needed for user entered keyword retrieval.If user, which wants the retrieval test in the platform, logs in function When the test case template of energy, then user inputs keyword " logging in " inquiry and is logged in the query function column of the platform Related content of pages.
In one embodiment, whether the retrieval request for judging user is that the method for first request includes:
1) retrieval request received is compared with a retrieval request historical record, judges the retrieval request Whether match with the retrieval request in historical record;
If 2) retrieval request matches with the history retrieval request in retrieval request historical record, described in confirmation The retrieval request received is not first request;
If 3) the history retrieval request to match with the retrieval request is not found in retrieval request historical record, The retrieval request received described in confirmation is not first request, and the retrieval request received is added to the history and is remembered In record.
In one embodiment, the retrieval request historical record is stored in local storage.It is understood that institute Stating does not include duplicate retrieval request in retrieval request historical record.
It may include the institute received in past preset time period in one embodiment, in the retrieval request historical record There is history retrieval request, for example, all history retrieval requests received within 30 days in the past.
In another embodiment, when the number of the history retrieval request recorded in the retrieval request historical record, storage Between equal can be configured according to the input of user.User can check the history recorded in the retrieval request historical record Retrieval request, the operational order that the history retrieval request in the retrieval request historical record can also respond user are deleted Deng operation.
If step S12, the described retrieval request is first request, inquires from database and match with the retrieval request Query result, and return to the query result, while the query result being cached into preset buffer zone.
In one embodiment, the query result is shown in the form of the html page.
In one embodiment, in the buffer zone, the query result and the retrieval request are corresponded and are stored, So that subsequent query more accurately facilitates.
For example, when user is when the retrieval request that web platform inputs is keyword " login ", include in query result with " login " related test case, then by the keyword " login " and inquiry knot in retrieval request in the buffer zone Fruit corresponds storage.
In one embodiment, described cache the query result into preset buffer zone includes: using Key- Value (key-value) system, using the key word of the inquiry of the query result as Key, using the query result as the key The corresponding Value of word is stored to the buffer zone.
In another embodiment, the query result stored into the buffer zone be can also be in a manner of database table Storage.
In one embodiment, query result in the database table can be to be arranged with time sequencing, for example, More corresponding query result comes cache-time rearward more front, the earliest query result of cache-time come rearmost.
In another embodiment, the query result in the database table can be detected according to retrieval frequency permutation Rope frequency is higher to be come before more.
In one embodiment, before caching the query result, the step S12 can also include the following steps:
1) judge whether the number that the query result is queried within a preset time is more than preset value;
If 2) be more than the preset value, the frequency for illustrating that the query result is queried is higher, then to the query result It is cached;
If 3) query result is queried number less than the preset value within a preset time, illustrate the inquiry knot The frequency that fruit is queried is very low, then does not cache to the query result.
For example, judging number that the query result is queried in 4 hours whether more than 2 times, if being looked into 4 hours It askes more than 2 times, illustrates that this query result is often to be inquired, then carrying out caching to this query result can be improved use The inquiry velocity at family, if to be queried frequency very low for this query result, then can not cache to this query result, such as This, reduces the caching for the query result that is of little use, caches to save more spatial caches and be queried the higher inquiry of frequency As a result, preferably optimization system resource, raising running efficiency of system optimize user experience.
In one embodiment, the buffer zone can be in the computer installation for running the quick response search method Buffer zone.Wherein, the computer installation may be, but not limited to, tablet computer (Tablet Computer), intelligence Mobile phone, personal computer (Personal Computer, PC), personal digital assistant (Personal Digital Assistant, PDA) etc..
The buffer zone can be memory or disk, this depends on the data volume for needing to cache within a certain period of time.Such as Fruit data volume is less than preset value, can cache in memory, because can read and write faster in this way;But if data volume very Greatly, at this moment if be cached in memory again, will largely sell consumption memory, and influence the performance of system, thus need by page cache in In disk, only records in memory and generated page cache, it is easy-to-look-up with the presence or absence of effective caching.
In another embodiment, the buffer zone also can be set in special cache server.
If step S13, the described retrieval request received is not first request, inquired in the buffer zone whether In the presence of with the matched query result of the retrieval request.
The query result cached in the buffer zone can be cleared up in the given time.Wherein, it clears up described slow The method for depositing the query result in region may include following several modes.
Mode one
When caching the query result, while the cache-time of the query result is recorded, the cleaning buffer zone The method of middle query result includes:
1) judge whether caching duration of the query result in the buffer zone in the buffer zone reaches default Duration, such as 3 days;
If 2) caching duration of the query result in the buffer zone reaches preset duration, deletes this and inquire knot Fruit, in this way can be to avoid when data update in the database, and the data in data and database in caching are nonsynchronous Situation;
If 3) caching duration of the query result in the buffer zone is not up to the preset duration, continuation is being cached This query result is saved in region.
Mode two
The method for clearing up query result in the buffer zone may also is that
1) judge whether the remaining memory space in the buffer zone is less than preset value, be, for example, less than 100M;
If 2) residual memory space of the buffer zone is less than the preset value, remove in the buffer zone Part is data cached.
Wherein it is possible to the data removed by following methods selection:
A. it removes caching duration and is more than the data of preset duration, for example, removing data of the caching more than 2 days;
B. the data cached of the longest preset number of cache-time is removed, for example, removing longest 50 numbers of cache-time According to;
C. the query result in buffer zone is ranked up according to the frequency being retrieved, deletes minimum pre- of retrieval frequency If number is data cached, for example, remove retrieval frequency minimum 50 it is data cached.
If step S14, inquired in the buffer zone with the matched query result of the retrieval request, return from The query result inquired in the buffer zone.
In one embodiment, the query result of the return is shown in the form of the html page.
If S15, do not inquired in the buffer zone with the matched query result of retrieval request, looked into from database Inquiry and the matched query result of the retrieval request, and the query result inquired from the database is cached to institute It states in buffer zone.
In one embodiment, if not inquiring yet in the database and the matched query result of the retrieval request When, then return to an inquiry failure prompt information.For example, it is described inquiry failure prompt information content can be " do not inquire with It is that retrieval request matches as a result, correct retrieval request please be input ".
Embodiment three
Referring to Fig. 3, retrieving the structure chart of device preferred embodiment for quick response of the present invention.
In some embodiments, the quick response retrieval device 10 is run in computer installation.The quick response Retrieving device 10 may include multiple functional modules as composed by program code segments.In the quick response retrieval device 10 The program code of each program segment can store in the memory of computer installation, and be held by least one described processor Row, to realize that automatic test function is applied in mixing.
In the present embodiment, function of the quick response retrieval device 10 according to performed by it can be divided into multiple Functional module.As shown in fig.3, the functional module may include: that retrieval request obtains module 101, enquiry module 102, delays Storing module 103, query result return module 104.The so-called module of the present invention refers to that one kind can be by least one processor institute The series of computation machine program segment of fixed function is executed and can complete, storage is in memory.In the present embodiment, it closes It will be described in detail in subsequent embodiment in the function of each module.
The retrieval request obtains the retrieval request that module 101 is used to receive user's input, and is receiving retrieval request When, judge whether the retrieval request is first request.
The retrieval request can be the retrieval request that user inputs in web platform, include inspection in the retrieval request Rope keyword, the search key can be text or network address etc..
For example, the web platform can be one for automatically generating the platform of test case, and the platform can be with The test case template needed for user entered keyword retrieval.If user, which wants the retrieval test in the platform, logs in function When the test case template of energy, then user inputs keyword " logging in " inquiry and is logged in the query function column of the platform Related content of pages.
In one embodiment, the retrieval request obtains module 101 judges whether the retrieval request of user is first request Method may include:
1) retrieval request received is compared with a retrieval request historical record, judges the retrieval request Whether match with the retrieval request in historical record;
If 2) retrieval request matches with the history retrieval request in retrieval request historical record, described in confirmation The retrieval request received is not first request;
If 3) the history retrieval request to match with the retrieval request is not found in retrieval request historical record, The retrieval request received described in confirmation is not first request, and the retrieval request received is added to the history and is remembered In record.
In one embodiment, the retrieval request historical record is stored in local storage.It is understood that institute Stating does not include duplicate retrieval request in retrieval request historical record.
It may include the institute received in past preset time period in one embodiment, in the retrieval request historical record There is history retrieval request, for example, all history retrieval requests received within 30 days in the past.
In another embodiment, when the number of the history retrieval request recorded in the retrieval request historical record, storage Between equal can be configured according to the input of user.User can check the history recorded in the retrieval request historical record Retrieval request, the operational order that the history retrieval request in the retrieval request historical record can also respond user are deleted Deng operation.
The enquiry module 102, which is used to obtain module 101 in the retrieval request, determines that the retrieval request is to ask for the first time When asking, by inquiring the query result to match with the retrieval request in database, the query result return module 104 is returned The query result, while the cache module 103 caches the query result into buffer zone.
In one embodiment, the query result is shown in the form of the html page.
In one embodiment, in the buffer zone, the query result and the retrieval request are corresponded and are stored, So that subsequent query more accurately facilitates.
For example, when user is when the retrieval request that web platform inputs is keyword " login ", include in query result with " login " related test case, then by the keyword " login " and inquiry knot in retrieval request in the buffer zone Fruit corresponds storage.
In one embodiment, when caching the query result, Key-Value (key-value) system can be used, will cache The key word of the inquiry of file is as Key, using cache file as the corresponding Value storage of keyword to local spatial cache In.
In another embodiment, the query result stored into the buffer zone be can also be in a manner of database table Storage.
In one embodiment, query result in the database table can be to be arranged with time sequencing, for example, More corresponding query result comes cache-time rearward more front, the earliest query result of cache-time come rearmost.
In another embodiment, the query result in the database table can be detected according to retrieval frequency permutation Rope frequency is higher to be come before more.
In one embodiment, before caching the query result, following steps are can also be performed in the enquiry module:
1) judge whether the number that the query result is queried within a preset time is more than preset value;
If 2) be more than the preset value, the frequency for illustrating that the query result is queried is higher, then to the query result It is cached;
If 3) query result is queried number less than the preset value within a preset time, illustrate the inquiry knot The frequency that fruit is queried is very low, then does not cache to the query result.
For example, judging number that the query result is queried in 4 hours whether more than 2 times, if being looked into 4 hours It askes more than 2 times, illustrates that this query result is often to be inquired, then carrying out caching to this query result can be improved use The inquiry velocity at family, if to be queried frequency very low for this query result, then can not cache to this query result, such as This, reduces the caching for the query result that is of little use, caches to save more spatial caches and be queried the higher inquiry of frequency As a result, preferably optimization system resource, raising running efficiency of system optimize user experience.
In one embodiment, the buffer zone can be in the computer installation for running the quick response search method Buffer zone.Wherein, the computer installation may be, but not limited to, tablet computer (Tablet Computer), intelligence Mobile phone, personal computer (Personal Computer, PC), personal digital assistant (Personal Digital Assistant, PDA) etc..
The buffer zone can be memory or disk, this depends on the data volume for needing to cache within a certain period of time.Such as Fruit data volume is less than preset value, can cache in memory, because can read and write faster in this way;But if data volume very Greatly, at this moment if be cached in memory again, will largely sell consumption memory, and influence the performance of system, thus need by page cache in In disk, only records in memory and generated page cache, it is easy-to-look-up with the presence or absence of effective caching.
In another embodiment, the buffer zone also can be set in special cache server.
The retrieval request that the enquiry module 102 is also used to receive described in determination is not first request, described slow Depositing inquiry in region whether there is and the matched query result of the retrieval request.
The query result cached in the buffer zone can be cleared up in the given time.Wherein, it clears up described slow The method for depositing the query result in region may include following several modes.
Mode one
When caching the query result, while the cache-time of the query result is recorded, the cleaning buffer zone The method of middle query result includes:
1) judge whether caching duration of the query result in the buffer zone in the buffer zone reaches default Duration, such as 3 days;
If 2) caching duration of the query result in the buffer zone reaches preset duration, deletes this and inquire knot Fruit, in this way can be to avoid when data update in the database, and the data in data and database in caching are nonsynchronous Situation;
If 3) caching duration of the query result in the buffer zone is not up to the preset duration, continuation is being cached This query result is saved in region.
Mode two
The method for clearing up query result in the buffer zone may also is that
1) judge whether the remaining memory space in the buffer zone is less than preset value, be, for example, less than 100M;
If 2) residual memory space of the buffer zone is less than the preset value, remove in the buffer zone Part is data cached.
Wherein it is possible to the data removed by following methods selection:
A. the data that caching is more than preset duration are removed, for example, removing data of the caching more than 2 days;
B. it is data cached to remove the longest preset number item of cache-time, for example, removing longest 50 numbers of cache-time According to;
C. the query result in buffer zone is ranked up according to the frequency being retrieved, deletes minimum pre- of retrieval frequency If number data, for example, removing 50 minimum datas of retrieval frequency.
The query result return module 104 is also used to inquire in the buffer zone in the enquiry module 102 When query result matched with the retrieval request, the query result inquired in the buffer zone is directly returned.
The query result return module 104 is also used to inquire in the buffer zone in the enquiry module 102 When query result matched with the retrieval request, the query result inquired in the buffer zone is directly returned.
The enquiry module 102 is also used to not inquire in the buffer zone to be tied with the matched inquiry of retrieval request Fruit then removes inquiry and the matched query result of the retrieval request in database, and the cache module 103 will be in the database In the query result that inquires cache into the buffer zone.
Above-described quick response search method and device, by being cached to user query result, when user is defeated Directly user query efficiency is improved, database pressure is reduced by being inquired in caching when entering keyword query.In addition, to inquiry frequency The higher query result of rate is cached, and is not cached to the query result being of little use, and is further increased system resource optimization, is improved Recall precision.Furthermore buffer zone is updated by dynamic, so that query result is more accurately and timely.
Embodiment three
Fig. 3 is the schematic diagram of computer installation preferred embodiment of the present invention.
The computer installation 1 includes memory 20, processor 30 and is stored in the memory 20 and can be in institute State the computer program 40 run on processor 30, such as quick response search program.The processor 30 executes the calculating The step in above-mentioned quick response search method embodiment, such as step S11~S15 shown in Fig. 2 are realized when machine program 40.Or Person, the processor 30 realized when executing the computer program 40 each module in above-mentioned quick response retrieval Installation practice/ The function of unit, such as the unit 101-104 in Fig. 3.
Illustratively, the computer program 40 can be divided into one or more module/units, it is one or Multiple module/units are stored in the memory 20, and are executed by the processor 30, to complete the present invention.Described one A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, and described instruction section is used In implementation procedure of the description computer program 40 in the computer installation 1.For example, the computer program 40 can be with The retrieval request being divided into Fig. 3 obtains module 101, enquiry module 102, cache module 103, query result return module 104.Each module concrete function is referring to embodiment three.
The computer installation 1 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set It is standby.It will be understood by those skilled in the art that the schematic diagram is only the example of computer installation 1, do not constitute to computer The restriction of device 1 may include perhaps combining certain components or different components, example than illustrating more or fewer components Such as described computer installation 1 can also include input-output equipment, network access equipment, bus.
Alleged processor 30 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor 30 is also possible to any conventional processing Device etc., the processor 30 are the control centres of the computer installation 1, utilize various interfaces and the entire computer of connection The various pieces of device 1.
The memory 20 can be used for storing the computer program 40 and/or module/unit, and the processor 30 passes through Operation executes the computer program and/or module/unit being stored in the memory 20, and calls and be stored in memory Data in 20 realize the various functions of the computer installation 1.The memory 20 can mainly include storing program area and deposit Store up data field, wherein storing program area can application program needed for storage program area, at least one function (for example sound is broadcast Playing function, image player function etc.) etc.;Storage data area, which can be stored, uses created data (ratio according to computer installation 1 Such as audio data, phone directory) etc..In addition, memory 20 may include high-speed random access memory, it can also include non-easy The property lost memory, such as hard disk, memory, plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card), at least one disk memory, flush memory device or other Volatile solid-state part.
If the integrated module/unit of the computer installation 1 is realized in the form of SFU software functional unit and as independence Product when selling or using, can store in a computer readable storage medium.Based on this understanding, of the invention It realizes all or part of the process in above-described embodiment method, can also instruct relevant hardware come complete by computer program At the computer program can be stored in a computer readable storage medium, and the computer program is held by processor When row, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, the computer program includes computer program code, institute Stating computer program code can be source code form, object identification code form, executable file or certain intermediate forms etc..It is described Computer-readable medium may include: any entity or device, recording medium, U that can carry the computer program code Disk, mobile hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), arbitrary access Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It needs It is bright, the content that the computer-readable medium includes can according in jurisdiction make laws and patent practice requirement into Row increase and decrease appropriate, such as do not include electric load according to legislation and patent practice, computer-readable medium in certain jurisdictions Wave signal and telecommunication signal.
In several embodiments provided by the present invention, it should be understood that arriving, disclosed computer installation and method can To realize by another way.For example, computer installation embodiment described above is only schematical, for example, institute The division of unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation.
It, can also be in addition, each functional unit in each embodiment of the present invention can integrate in same treatment unit It is that each unit physically exists alone, can also be integrated in same unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of hardware adds software function module.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, Er Qie In the case where without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended power Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims Variation is included in the present invention.Any reference signs in the claims should not be construed as limiting the involved claims.This Outside, it is clear that one word of " comprising " does not exclude other units or steps, and odd number is not excluded for plural number.It is stated in computer installation claim Multiple units or computer installation can also be implemented through software or hardware by the same unit or computer installation.The One, the second equal words are used to indicate names, and are not indicated any particular order.
Finally it should be noted that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although reference Preferred embodiment describes the invention in detail, those skilled in the art should understand that, it can be to of the invention Technical solution is modified or equivalent replacement, without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. a kind of quick response search method is applied in computer installation, which is characterized in that the described method includes:
When receiving retrieval request, judge whether the retrieval request is first request;
If the retrieval request is first request, the query result to match with the retrieval request is inquired from database, And the query result is returned to, while the query result being cached into preset buffer zone;
If the retrieval request received is not first request, inquiry whether there is and the inspection in the buffer zone Rope requests matched query result;
If inquired in the buffer zone with the matched query result of the retrieval request, return from the buffer zone In the query result that inquires;And
If do not inquired in the buffer zone with the matched query result of retrieval request, from database inquiry with it is described The matched query result of retrieval request, and the query result inquired in the database is returned and is cached to described In buffer zone.
2. quick response search method as described in claim 1, which is characterized in that whether the retrieval request for judging user Include: for first request
The retrieval request received is compared with a retrieval request historical record, judge the retrieval request whether with A retrieval request in historical record matches;
If the retrieval request matches with the history retrieval request in retrieval request historical record, received described in confirmation Retrieval request be not first request;
If not finding the history retrieval request to match with the retrieval request in retrieval request historical record, institute is confirmed Stating the retrieval request received is not first request, and the retrieval request that this is received is added in the historical record.
3. quick response search method as described in claim 1, which is characterized in that described to cache the query result to pre- If buffer zone in include:
Using Key-Value system, using the key word of the inquiry of the query result as Key, using the query result as institute The corresponding Value of keyword is stated to store to the buffer zone.
4. quick response search method as described in claim 1, which is characterized in that inquiry of the caching into the buffer zone As a result it is stored in a manner of database table, the arrangement mode of the query result in the database table includes as under type Any one: time sequencing arrangement, retrieval frequency permutation, wherein the frequency that is retrieved it is higher come more front.
5. quick response search method as described in claim 1, which is characterized in that the method also includes:
Judge whether the number that the query result is queried within a preset time is more than preset value;
If being more than the preset value, the query result is cached;
If the query result is queried number less than the preset value within a preset time, the query result is not carried out Caching.
6. quick response search method as described in claim 1, which is characterized in that the inquiry to being cached in the buffer zone As a result it is cleared up in the given time, wherein the method for clearing up query result in the buffer zone includes:
When caching the query result, while recording the cache-time of the query result;
Judge whether caching duration of the query result in the buffer zone in the buffer zone reaches preset duration;
If caching duration of the query result cached in the buffer zone reaches preset duration, the inquiry knot is deleted Fruit.
7. quick response search method as described in claim 1, which is characterized in that the inquiry knot cached in the buffer zone Fruit is cleared up in the given time, wherein the method for clearing up query result in the buffer zone includes:
Judge whether the remaining memory space in the buffer zone is less than preset value;
If the residual memory space of the buffer zone is less than the preset value, the part removed in the buffer zone is slow Deposit data, wherein select the data removed to pass through any one realization in following methods: removing has cached duration and has been more than The data of preset duration, by the buffer zone it is data cached according to caching duration be ranked up and remove caching duration row Name near preceding preset number it is data cached, the query result in buffer zone is ranked up simultaneously according to the frequency being retrieved Delete the data cached of preset number of the retrieval frequency ranking after.
8. a kind of quick response retrieves device, which is characterized in that described device includes:
Retrieval request obtains module, judges that the retrieval request is for receiving retrieval request, and when receiving retrieval request No is first request;
Enquiry module, when determining that the retrieval request is first request for retrieval request acquisition module, from database The query result that inquiry matches with the retrieval request;
Query result return module is for returning to the query result;
Cache module is for caching the query result into preset buffer zone;
The enquiry module is also used to look into the buffer zone when the retrieval request received is not first request Asking whether there is and the matched query result of the retrieval request;
Mould is returned with the matched query result of the retrieval request, the query result if inquiring in the buffer zone Block returns to the query result inquired from the buffer zone;And
If do not inquired in the buffer zone with the matched query result of retrieval request, the enquiry module is from database Middle inquiry and the matched query result of the retrieval request, the query result return module will inquire in the database The query result return, device cache module caches the query result inquired in the database to the caching In region.
9. a kind of computer installation, it is characterised in that: the computer installation includes processor, and the processor is deposited for executing Such as quick response search method of any of claims 1-7 is realized when the computer program stored in reservoir.
10. a kind of computer readable storage medium, is stored thereon with computer program, it is characterised in that: the computer program Such as quick response search method of any of claims 1-7 is realized when being executed by processor.
CN201811575997.8A 2018-12-22 2018-12-22 Quick response search method and device, computer installation and storage medium Pending CN109857760A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811575997.8A CN109857760A (en) 2018-12-22 2018-12-22 Quick response search method and device, computer installation and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811575997.8A CN109857760A (en) 2018-12-22 2018-12-22 Quick response search method and device, computer installation and storage medium

Publications (1)

Publication Number Publication Date
CN109857760A true CN109857760A (en) 2019-06-07

Family

ID=66891789

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811575997.8A Pending CN109857760A (en) 2018-12-22 2018-12-22 Quick response search method and device, computer installation and storage medium

Country Status (1)

Country Link
CN (1) CN109857760A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515971A (en) * 2019-08-09 2019-11-29 金蝶软件(中国)有限公司 Program statement processing method, device, computer equipment and computer storage medium
CN111143416A (en) * 2019-12-25 2020-05-12 深圳广联赛讯有限公司 Data cache-based query method, terminal and storage medium
CN112187908A (en) * 2020-09-23 2021-01-05 易小博(武汉)科技有限公司 Data processing method, system and interface service platform
CN112398852A (en) * 2020-11-12 2021-02-23 北京天融信网络安全技术有限公司 Message detection method, device, storage medium and electronic equipment
CN112597337A (en) * 2020-12-10 2021-04-02 北京飞讯数码科技有限公司 Method, device, equipment and medium for viewing video monitoring content
CN113032392A (en) * 2021-02-26 2021-06-25 广东核电合营有限公司 Label data acquisition method and device, computer equipment and storage medium
CN114143279A (en) * 2020-08-13 2022-03-04 北京有限元科技有限公司 Sampling method and device for interactive recording and storage medium
CN115080625A (en) * 2022-07-21 2022-09-20 成都薯片科技有限公司 Caching method, device and equipment based on Spring Cache framework and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140143271A1 (en) * 2012-11-21 2014-05-22 General Electric Company Multi-level medical image viewer memory management
CN105243072A (en) * 2014-07-11 2016-01-13 北京神州泰岳软件股份有限公司 Database query method and system
CN106649770A (en) * 2016-12-27 2017-05-10 北京启明星辰信息安全技术有限公司 Large data query method and system
CN106919691A (en) * 2017-03-06 2017-07-04 广东神马搜索科技有限公司 Method, device and the searching system retrieved based on web page library
CN106951573A (en) * 2017-04-27 2017-07-14 努比亚技术有限公司 A kind of living broadcast interactive data load method, server and computer-readable medium
CN107590248A (en) * 2017-09-14 2018-01-16 广东欧珀移动通信有限公司 Searching method, device, terminal and computer-readable recording medium
CN108090153A (en) * 2017-12-11 2018-05-29 深圳云天励飞技术有限公司 A kind of searching method, device, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140143271A1 (en) * 2012-11-21 2014-05-22 General Electric Company Multi-level medical image viewer memory management
CN105243072A (en) * 2014-07-11 2016-01-13 北京神州泰岳软件股份有限公司 Database query method and system
CN106649770A (en) * 2016-12-27 2017-05-10 北京启明星辰信息安全技术有限公司 Large data query method and system
CN106919691A (en) * 2017-03-06 2017-07-04 广东神马搜索科技有限公司 Method, device and the searching system retrieved based on web page library
CN106951573A (en) * 2017-04-27 2017-07-14 努比亚技术有限公司 A kind of living broadcast interactive data load method, server and computer-readable medium
CN107590248A (en) * 2017-09-14 2018-01-16 广东欧珀移动通信有限公司 Searching method, device, terminal and computer-readable recording medium
CN108090153A (en) * 2017-12-11 2018-05-29 深圳云天励飞技术有限公司 A kind of searching method, device, electronic equipment and storage medium

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515971A (en) * 2019-08-09 2019-11-29 金蝶软件(中国)有限公司 Program statement processing method, device, computer equipment and computer storage medium
CN110515971B (en) * 2019-08-09 2022-03-11 金蝶软件(中国)有限公司 Program statement processing method, device, computer equipment and computer storage medium
CN111143416A (en) * 2019-12-25 2020-05-12 深圳广联赛讯有限公司 Data cache-based query method, terminal and storage medium
CN111143416B (en) * 2019-12-25 2024-01-30 深圳广联赛讯股份有限公司 Query method, terminal and storage medium based on data cache
CN114143279A (en) * 2020-08-13 2022-03-04 北京有限元科技有限公司 Sampling method and device for interactive recording and storage medium
CN114143279B (en) * 2020-08-13 2023-10-24 北京有限元科技有限公司 Interactive recording sampling method and device and storage medium
CN112187908A (en) * 2020-09-23 2021-01-05 易小博(武汉)科技有限公司 Data processing method, system and interface service platform
CN112398852A (en) * 2020-11-12 2021-02-23 北京天融信网络安全技术有限公司 Message detection method, device, storage medium and electronic equipment
CN112398852B (en) * 2020-11-12 2022-11-15 北京天融信网络安全技术有限公司 Message detection method, device, storage medium and electronic equipment
CN112597337A (en) * 2020-12-10 2021-04-02 北京飞讯数码科技有限公司 Method, device, equipment and medium for viewing video monitoring content
CN113032392A (en) * 2021-02-26 2021-06-25 广东核电合营有限公司 Label data acquisition method and device, computer equipment and storage medium
CN115080625A (en) * 2022-07-21 2022-09-20 成都薯片科技有限公司 Caching method, device and equipment based on Spring Cache framework and storage medium

Similar Documents

Publication Publication Date Title
CN109857760A (en) Quick response search method and device, computer installation and storage medium
CN107169083A (en) Public security bayonet socket magnanimity vehicle data storage and retrieval method and device, electronic equipment
CN109783512A (en) Data processing method, device, computer equipment and storage medium
CN105989076A (en) Data statistical method and device
CN105338026A (en) Data resource acquisition method, device and system
CN110704453A (en) Data query method and device, storage medium and electronic equipment
CN105224560B (en) Cache data searching method and device
CN109033360B (en) Data query method, device, server and storage medium
CN108090153A (en) A kind of searching method, device, electronic equipment and storage medium
US10855637B2 (en) Architecture for large data management in communication applications through multiple mailboxes
WO2020019313A1 (en) Graph data updating method, system, computer readable storage medium, and device
CN103631933A (en) Distributed duplication elimination system-oriented data routing method
CN112231690A (en) Authority management method and related device
CN111241177A (en) Data acquisition method, system and network equipment
CN108694188A (en) A kind of newer method of index data and relevant apparatus
CN106851758A (en) Communication network changing method and terminal device
CN101963978B (en) Distributed database management method, device and system
CN112084173A (en) Data migration method and device and storage medium
CN110321364B (en) Transaction data query method, device and terminal of credit card management system
CN109933595B (en) Internet of things equipment information sharing system and device and terminal equipment
CN102325098B (en) Group information acquisition method and system
CN106796588B (en) The update method and equipment of concordance list
CN111753019A (en) Data partitioning method and device applied to data warehouse
CN109726219A (en) The method and terminal device of data query
CN112925792A (en) Data storage control method, device, computing equipment and medium

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