CN109783518A - Information query method, query device, storage medium and terminal equipment - Google Patents
Information query method, query device, storage medium and terminal equipment Download PDFInfo
- Publication number
- CN109783518A CN109783518A CN201811512101.1A CN201811512101A CN109783518A CN 109783518 A CN109783518 A CN 109783518A CN 201811512101 A CN201811512101 A CN 201811512101A CN 109783518 A CN109783518 A CN 109783518A
- Authority
- CN
- China
- Prior art keywords
- response message
- information
- client
- parsing
- sent
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 230000004044 response Effects 0.000 claims abstract description 278
- 238000004590 computer program Methods 0.000 claims description 19
- 230000005540 biological transmission Effects 0.000 claims description 9
- 230000006870 function Effects 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 5
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 238000013480 data collection Methods 0.000 description 2
- 238000004321 preservation Methods 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000010485 coping Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000004744 fabric Substances 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Landscapes
- Computer And Data Communications (AREA)
Abstract
The invention discloses an information query method, which comprises the following steps: receiving an information query request sent by a client; judging whether corresponding first response information exists in the search cluster according to the information query request; if the corresponding first response information exists in the search cluster, acquiring the first response information, and sending the first response information to the client; if the corresponding first response information does not exist in the search cluster, judging whether corresponding second response information exists in a preset cache server or not; if the corresponding second response information exists in the preset cache server, acquiring the second response information, and sending the second response information to the client; if the corresponding second response information does not exist in the preset cache server, a third-party query interface corresponding to the information query request is determined, so that third response information corresponding to the information query request is obtained through the third-party query interface, and the third response information is sent to the client side, so that the speed and the efficiency of information query are improved.
Description
Technical field
The present invention relates to technical field of information processing more particularly to a kind of information query method, inquiry unit, computer can
Read storage medium and terminal device.
Background technique
With the development of society, people are also more and more for the query demand of information, expect that the time of response is also more next
It is faster, and in traditional inquiry mode, often after receiving the inquiry request of user, then by calling third party's inquiry
Interface carries out the inquiry of information needed, has the shortcomings that inquiry velocity is slow, search efficiency is lower, is unable to satisfy user query
The demand of real-time.
To sum up, the inquiry velocity and search efficiency of information how are improved, becomes ability to meet the real-time of user query
Field technique personnel's urgent problem to be solved.
Summary of the invention
The embodiment of the invention provides a kind of information query method, inquiry unit, computer readable storage medium and terminals
Equipment can be improved the inquiry velocity and search efficiency of information, can meet the real-time of user query, and promote user uses body
It tests.
The embodiment of the present invention in a first aspect, providing a kind of information query method, comprising:
Receive the information inquiring request that client is sent;
Judged to whether there is corresponding first response message in search cluster according to the information inquiring request;
If obtaining first response message there are corresponding first response message in described search cluster, and by institute
It states the first response message and is sent to the client;
If corresponding first response message is not present in described search cluster, judge whether deposit in preset cache server
In corresponding second response message;
If there are corresponding second response messages in the preset cache server, second response message is obtained,
And second response message is sent to the client;
If corresponding second response message is not present in the preset cache server, it is determined that asked with information inquiry
Corresponding third party's query interface is sought, to obtain corresponding to the information inquiring request by third party's query interface
Three response messages, and the third response message is sent to the client.
It is further, described that second response message is sent to the client, comprising:
Second response message is parsed;
Whether the second response message after judging parsing meets the first preset condition;
If the second response message after parsing meets first preset condition, the second response message after parsing is sent out
It send to the client, and the second response message after parsing is indexed in described search cluster.
Preferably, the response letter of third corresponding to the information inquiring request is being obtained by third party's query interface
After breath, comprising:
The third response message is stored into the preset cache server.
It is optionally, described that the third response message is sent to the client, comprising:
The third response message is parsed;
Whether the third response message after judging parsing meets the second preset condition;
If the third response message after parsing meets second preset condition, the third response message after parsing is sent out
It send to the client, and the third response message after parsing is indexed in described search cluster.
Further, the preset cache server is distributed cache server.
Preferably, judged to whether there is corresponding first response message in search cluster according to the information inquiring request
Before, comprising:
The first presupposed information inquiry request is acquired, and the first presupposed information inquiry request is saved to presetting database
In;
The the first presupposed information inquiry request for extracting preset quantity in real time from the presetting database, as second
Presupposed information inquiry request;
Determine third party's query interface corresponding to each second presupposed information inquiry request;
It is obtained corresponding to each second presupposed information inquiry request by identified each third party's query interface
Four response messages, and will be indexed in described search cluster after the 4th response message parsing.
The second aspect of the embodiment of the present invention provides a kind of information query device, comprising:
Information inquiring request receiving module, for receiving the information inquiring request of client transmission;
First response message judgment module, for according to the information inquiring request judge search cluster in the presence or absence of pair
The first response message answered;
First response message sending module, if for, there are corresponding first response message, being obtained in described search cluster
First response message is taken, and first response message is sent to the client;
Second response message judgment module, if for corresponding first response message to be not present in described search cluster,
Judge in preset cache server with the presence or absence of corresponding second response message;
Second response message sending module, if for there are corresponding second response letters in the preset cache server
Breath, then obtain second response message, and second response message is sent to the client;
Third response message enquiry module, if for there is no corresponding second response letters in the preset cache server
Breath, it is determined that third party's query interface corresponding with the information inquiring request, to be obtained by third party's query interface
Third response message corresponding to the information inquiring request, and the third response message is sent to the client.
The third aspect of the embodiment of the present invention, provides a kind of terminal device, including memory, processor and is stored in
In the memory and the computer program that can run on the processor, when the processor executes the computer program
It realizes as described in aforementioned first aspect the step of information query method.
The fourth aspect of the embodiment of the present invention, provides a kind of computer readable storage medium, described computer-readable to deposit
Storage media is stored with computer program, and the information as described in aforementioned first aspect is realized when the computer program is executed by processor
The step of querying method.
As can be seen from the above technical solutions, the embodiment of the present invention has the advantage that
In the embodiment of the present invention, the index of information can be carried out by setting search cluster, and can be default slow by being arranged
Server is deposited to carry out the caching of information, can be obtained before caching query or in query process in preset cache server
The response message got, and the response message that can be will acquire is indexed in local search cluster, thus, when receiving client
When the information inquiring request of transmission, can inquire in search cluster first whether there is corresponding first response message, if search
There are corresponding first response message in cluster, then first response message is obtained, and send it to client, to improve letter
Inquiry velocity and efficiency are ceased, information query performance is improved, to meet the real-time of user query;If being not present in search cluster
Corresponding first response message, then it is further to judge with the presence or absence of corresponding second response message in preset cache server, if
There are corresponding second response message in preset cache server, then second response message is obtained, and sent it to described
Client, further to improve information inquiry velocity and search efficiency by the inquiry to cache information;And if default slow
It deposits and corresponding second response message is not present in server, it is determined that third party's query interface corresponding with information inquiring request,
To obtain third response message corresponding to information inquiring request by third party's query interface, to pass through unified entry mode
The inquiry of each information is carried out, so as to meet by way of dynamic expansion third party's query interface the different inquiries of user
Demand improves the convenience of information inquiry, promotes the usage experience of user.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art
Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some
Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these
Attached drawing obtains other attached drawings.
Fig. 1 is a kind of structural schematic diagram of information query system in the embodiment of the present invention
Fig. 2 is a kind of one embodiment flow chart of information query method in the embodiment of the present invention;
Fig. 3 indexes response message to search for information query method a kind of in the embodiment of the present invention under an application scenarios
The flow diagram of cluster;
Fig. 4 sends the second response message for information query method a kind of in the embodiment of the present invention under an application scenarios
Flow diagram;
Fig. 5 is a kind of one embodiment structure chart of information query device in the embodiment of the present invention;
Fig. 6 is a kind of schematic diagram for terminal device that one embodiment of the invention provides.
Specific embodiment
The embodiment of the invention provides a kind of information query method, inquiry unit, computer readable storage medium and terminals
Equipment can be improved the inquiry velocity and search efficiency of information, can meet the real-time of user query, and promote user uses body
It tests.
In order to make the invention's purpose, features and advantages of the invention more obvious and easy to understand, below in conjunction with the present invention
Attached drawing in embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that disclosed below
Embodiment be only a part of the embodiment of the present invention, and not all embodiment.Based on the embodiments of the present invention, this field
Those of ordinary skill's all other embodiment obtained without making creative work, belongs to protection of the present invention
Range.
In the description of the present invention, term " first ", " second ", " third " etc. are only used for distinguishing description, and cannot understand
For indication or suggestion relative importance.
The embodiment of the present invention can be applied to information query system as shown in Figure 1, information provided by the embodiment of the present invention
The executing subject of querying method can be the service node for being registered in Zookeeper administrative center, such as can be Server server,
And service node can be individually deployed in data collection layer shown in FIG. 1, and Fig. 1 institute can also be deployed in by way of cluster
In the data collection layer shown, wherein service node can also carry out dynamic expansion as needed, to improve the effect concurrently executed
Rate.It should be noted that when receiving the information inquiring request of client transmission, it can be according to load balancing from being registered in
It is described to respond that one or more service node specifically executed is chosen in multiple service nodes of Zookeeper administrative center
The information inquiring request of client.
Come in conjunction with specific embodiments below based on above- mentioned information inquiry system to the information issuer in the embodiment of the present invention
Method is described.As shown in Fig. 2, the embodiment of the invention provides a kind of information query method, the information query method includes:
Step S201, the information inquiring request that client is sent is received;
It is understood that when client needs to carry out information inquiry, such as need to carry out address information inquiry or
When carrying out the inquiry of specified regional weather information etc., client can send information inquiry by the interface of application service layer
Request, and the service node specifically executed according to determined by load balancing then can receive the information inquiring request.
Step S202, judge to believe in search cluster with the presence or absence of corresponding first response according to the information inquiring request
Breath;
In the embodiment of the present invention, corresponding service node, can be by searching after receiving the information inquiring request of client
Rope local search cluster, wherein the local search cluster can be ElasticSearch cluster, can pass through search
ElasticSearch cluster judges in the ElasticSearch cluster with the presence or absence of needed for the information inquiring request
Response message, i.e., the first response message described above.
Further, as shown in figure 3, in the embodiment of the present invention, search cluster is being judged according to the information inquiring request
In with the presence or absence of before corresponding first response message, may include:
Step S301, acquire the first presupposed information inquiry request, and by the first presupposed information inquiry request save to
In presetting database;
Step S302, first presupposed information inquiry for extracting preset quantity in real time from the presetting database is asked
It asks, as the second presupposed information inquiry request;
Step S303, third party's query interface corresponding to each second presupposed information inquiry request is determined;
Step S304, each second presupposed information inquiry request institute is obtained by identified each third party's query interface
Corresponding 4th response message, and will be indexed in described search cluster after the 4th response message parsing.
For above-mentioned steps S301 to step S304, it is to be understood that, can be previously according to user in the embodiment of the present invention
Inquiry habit, collect some users and be accustomed to the first default inquiry request putd question to, as meta-data preservation in MySQL database
In, such as when carrying out the inquiry of better address information, collects some users and be accustomed to the brief address information putd question to, as first number
According to being stored in MySQL database, for example, can by brief address informations such as " Song Yuanlu 75 " or " Luohu Human Resources Administrations ",
As meta-data preservation in MySQL database.And service node can extract the member of preset quantity from MySQL database in real time
Data extract the first presupposed information inquiry request of preset quantity in real time, as the second presupposed information inquiry request, and determine
With third party's query interface corresponding to each second presupposed information inquiry request, such as work as first the second presupposed information inquiry
When request is the request of address information inquiry, then it can determine that corresponding third party's query interface is Google Map API;Again
Such as when second the second presupposed information inquiry request is the inquiry of specified regional weather information, then it can determine corresponding third
Square query interface is Weather API, etc..
In the embodiment of the present invention, connect being determined that third party corresponding to each second presupposed information inquiry request inquires
After mouthful, it can be obtained corresponding to each second presupposed information inquiry request by calling corresponding third party's query interface
Response message, i.e., the 4th response message described above, that is, the query result that each third party's query interface is returned is obtained,
Such as in the inquiry of progress " Song Yuanlu 75 ", " Guangdong province, China Shenzhen sieve of Google Map API return can be obtained
The lake region road Song Yuan 75, postcode: 518000 " better address information;When carrying out the weather lookup in specified region, can obtain
The specific Weather information, etc. for taking Weather API to return.Getting that third party's query interface returned and described second
After 4th response message corresponding to presupposed information inquiry request, the 4th response message can be parsed first, to sentence
Whether the 4th response message of breaking is effective query result, if the 4th response message is effective query result
4th response message, then be indexed in local ElasticSearch cluster by words, subsequent to receive identical or phase again
As information inquiring request when, then can be directly corresponding to obtain by the local ElasticSearch cluster of inquiry
Response message meets the real-time demand of user query, and improve to improve the inquiry velocity and search efficiency of information inquiry
The performance of information inquiry.
If step S203, there are corresponding first response messages in described search cluster, the first response letter is obtained
Breath, and first response message is sent to the client;
It is understood that if there are needed for the information inquiring request the in local ElasticSearch cluster
When one response message, service node then can obtain first response message from local ElasticSearch cluster, and can
Acquired first response message is directly sent to the client, to obtain by local search, this is rapidly completed
Secondary information inquiry operation improves information inquiry velocity and search efficiency, meets the real-time demand of user query, promotes user
Usage experience.
If corresponding first response message step S204, is not present in described search cluster, preset cache service is judged
It whether there is corresponding second response message in device;
It is understood that if there is no needed for the information inquiring request in local ElasticSearch cluster
When the first response message, sound needed for whether being cached with the information inquiring request in preset cache server can be further judged
Answer information, i.e., the second response message described above.Preferably, in the embodiment of the present invention, the preset cache server is point
Cloth cache server such as can be the Redis server of distributed deployment, to carry out information by distributed cache server
Caching, Lai Tigao information storage efficiency, improve information search efficiency.Wherein, the letter cached in distributed cache server
Breath may be from the query result that third party's query interface is returned, that is, may be from each information that third query interface is returned
Response message corresponding to inquiry request.
If obtaining described second there are corresponding second response message in step S205, the described preset cache server
Response message, and second response message is sent to the client;
In the embodiment of the present invention, when there are the second sound needed for the information inquiring request in the preset cache server
When answering information, service node can then obtain second response message from the preset cache server, and can be directly by institute
Second response message obtained is sent to the client, this information inquiry operation is rapidly completed with this, improves letter
The inquiry velocity and search efficiency for ceasing inquiry, meet the real-time demand of user query, promote the usage experience of user.
Further, described that second response message is sent to the visitor as shown in figure 4, in the embodiment of the present invention
Family end may include:
Step S401, second response message is parsed;
Step S402, whether the second response message after judging parsing meets the first preset condition;
If the second response message after step S403, parsing meets first preset condition, by second after parsing
Response message is sent to the client, and the second response message after parsing is indexed in described search cluster;
If the second response message after step S404, parsing is unsatisfactory for first preset condition, it is determined that described default
Corresponding second response message is not present in cache server.
For above-mentioned steps S401 to step S404, it is to be understood that when there are institutes in the preset cache server
When the second response message needed for stating information inquiring request, service node can obtain institute from the preset cache server first
The second response message is stated, then second response message is parsed, and whether judges the second response message after parsing
Meet the first preset condition, if if the second response message after parsing meets the first preset condition, it is believed that after parsing
Second response message meets demand, is effective query result, can directly be sent to the second response message after parsing at this time
The client, while the second response message after parsing can be also indexed in local ElasticSearch cluster, it is subsequent
When receiving corresponding inquiry request again, then can directly it be inquired by the local ElasticSearch cluster of inquiry
As a result, so as to improve the inquiry velocity and search efficiency of inquiry;If the second response message after parsing is unsatisfactory for the first default item
If part, then the second response message after showing parsing is not effective query result, at this time i.e. it is believed that the preset cache
There is no response messages needed for the information inquiring request in server.
Here, first preset condition can be determined according to the actual situation, as being address when request inquiry
When information, first preset condition can be set to the condition comprising " country, province, city, better address " content, i.e., ought obtain
After getting second response message, second response message can be parsed, include that " country saves, city to parse
The contents such as city, better address ", if the second response message after parsing includes the content in " country, province, city, better address ",
The second response message meet demand after illustrating parsing is effective query result, at this time can respond second after parsing
Information is sent directly to the client, and can simultaneously be indexed to the second response message after parsing local
In ElasticSearch cluster;And if parse after the second response message do not include country, save etc. contents, after illustrating parsing
The second response message do not meet demand, be not effective query result, then can drop second response message at this time, and can
Think that there is no response messages needed for the information inquiring request in the preset cache server.
If in step S206, the described preset cache server be not present corresponding second response message, it is determined that with it is described
The corresponding third party's query interface of information inquiring request, to obtain the information inquiring request by third party's query interface
Corresponding third response message, and the third response message is sent to the client.
In the embodiment of the present invention, if there is no needed for the information inquiring request second in the preset cache server
It if response message, then can first determine that third party's query interface corresponding to the information inquiring request, such as work as the information
When inquiry request is request inquiry better address information, then it can determine that corresponding third party's query interface is Google Map
API;For another example when the information inquiring request is the Weather information that specified region is inquired in request, then it can determine corresponding third
Square query interface is Weather API;And when the information inquiring request is the inquiry that request carries out words explanation, translation etc.
When, then it can determine that corresponding third party's query interface is Dictionary API, etc..The information inquiring request is being determined
After corresponding third query interface, then the information inquiring request can be obtained by calling identified third party's query interface
Required query result, i.e., third response message described above, as by calling Google Map api interface to obtain
State " country, province, the city, better address " information of address needed for information inquiring request and the latitude and longitude information of the address;
The Weather information in specified region is for another example obtained by calling Weather api interface, and the better address inquired is believed
The thirds response message such as breath, Weather information is sent to the client, to complete the inquiry operation of user.
Preferably, in the embodiment of the present invention, the information inquiring request institute is being obtained by third party's query interface
It can also include: to store the third response message to the preset cache server after corresponding third response message
In.
Here, being believed each time by calling third party's query interface to get corresponding response in the embodiment of the present invention
It, can be first by accessed Response information cache into Redis server, so that subsequent have identical information to inquire again after breath
When request, query result directly can be obtained by inquiry Redis server, avoid going again by third party's query interface
It obtains, improves inquiry velocity and search efficiency, meet the real-time demand of user query, promote the usage experience of user.
Optionally, described that the third response message is sent to the client in the embodiment of the present invention, it can wrap
It includes:
Step a, the third response message is parsed;
Step b, whether the third response message after judging parsing meets the second preset condition;
If the third response message after step c, parsing meets second preset condition, the third after parsing is responded
Information is sent to the client, and the third response message after parsing is indexed in described search cluster.
For above-mentioned steps a to step c, it is to be understood that when service node gets third party's query interface
When the query result of return, i.e., when service node gets the third response message that third party's query interface returns, clothes
Business node can first parse the third response message, and then, whether the third response message after judging parsing meets
Second preset condition, if if the third response message after parsing meets the second preset condition, it is believed that the third after parsing
Response message meets demand, is effective query result, the third response message after parsing directly can be sent to institute at this time
State client, while the third response message after parsing can be also indexed in local ElasticSearch cluster, it is subsequent again
When receiving corresponding information inquiring request, then can directly it be inquired by the local ElasticSearch cluster of inquiry
As a result, so as to improve the inquiry velocity and search efficiency of inquiry;And if the third response message after parsing is unsatisfactory for second and presets
If condition, then show that the third response message is not effective query result, then can directly abandon the third at this time and ring
Information is answered, and the response message that can not obtain query result can be returned to the client.Here, second preset condition can
It is identical as first preset condition.
In the embodiment of the present invention, the index of information can be carried out by setting search cluster, and can be default slow by being arranged
Server is deposited to carry out the caching of information, can be obtained before caching query or in query process in preset cache server
The response message got, and the response message that can be will acquire is indexed in local search cluster, thus, when receiving client
When holding the information inquiring request sent, inquiry it can whether there is corresponding first response letter first in local search cluster
Breath, if obtaining first response message, and send it to client there are corresponding first response message in search cluster
Information query performance is improved, to meet the real-time of user query to improve information inquiry velocity and efficiency in end;If search
Corresponding first response message is not present in cluster, then further judges in preset cache server with the presence or absence of corresponding second
Response message, if obtain second response message there are corresponding second response message in preset cache server, and by its
It is sent to the client, further to improve information inquiry velocity and search efficiency by the inquiry to cache information;
And if there is no if corresponding second response message in preset cache server, it is determined that corresponding with information inquiring request the
Tripartite's query interface, to obtain third response message corresponding to information inquiring request by third party's query interface, to pass through
Unified entry mode carries out the inquiry of each information, so as to be met by way of dynamic expansion third party's query interface
The different query demands of user improve the convenience of information inquiry, promote the usage experience of user.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process
Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit
It is fixed.
A kind of information query method is essentially described above, a kind of information query device will be described in detail below.
Fig. 5 shows a kind of one embodiment structure chart of information query device in the embodiment of the present invention.As shown in figure 5,
The information query device, comprising:
Information inquiring request receiving module 501, for receiving the information inquiring request of client transmission;
Whether the first response message judgment module 502 is deposited for judging to search in cluster according to the information inquiring request
In corresponding first response message;
First response message sending module 503, if in described search cluster there are corresponding first response message,
First response message is obtained, and first response message is sent to the client;
Second response message judgment module 504, if for corresponding first response message to be not present in described search cluster,
Then judge in preset cache server with the presence or absence of corresponding second response message;
Second response message sending module 505, if for there are corresponding second responses in the preset cache server
Information then obtains second response message, and second response message is sent to the client;
Third response message enquiry module 506, if for corresponding second sound to be not present in the preset cache server
Answer information, it is determined that third party's query interface corresponding with the information inquiring request, to pass through third party's query interface
Third response message corresponding to the information inquiring request is obtained, and the third response message is sent to the client
End.
Further, the second response message sending module 505, comprising:
Second response message resolution unit, for being parsed to second response message;
First preset condition judging unit, for judging whether the second response message after parsing meets the first default item
Part;
Second response message transmission unit, if meeting first preset condition for the second response message after parsing,
The second response message after parsing is then sent to the client, and the second response message after parsing is indexed to described search
In Suo Jiqun.
Preferably, the information query device, comprising:
Third response message memory module, for storing the third response message to the preset cache server
In.
Optionally, the third response message enquiry module 506, comprising:
Third response message resolution unit, for being parsed to the third response message;
Third response message judging unit, for judging whether the third response message after parsing meets the second default item
Part;
Third response message transmission unit, if meeting second preset condition for the third response message after parsing,
The third response message after parsing is then sent to the client, and the third response message after parsing is indexed to described search
In Suo Jiqun.
Further, the preset cache server is distributed cache server.
Preferably, the information query device, further includes:
Default inquiry request acquisition module presets letter for acquiring the first presupposed information inquiry request, and by described first
Breath inquiry request is saved into presetting database;
Default inquiry request abstraction module, for extracting described the first of preset quantity in real time from the presetting database
Presupposed information inquiry request, as the second presupposed information inquiry request;
Query interface determining module, for determining that third party corresponding to each second presupposed information inquiry request inquires
Interface;
Response message index module, for obtaining each described second default letter by identified each third party's query interface
The 4th response message corresponding to inquiry request is ceased, and described search cluster will be indexed to after the 4th response message parsing
In.
Fig. 6 is the schematic diagram for the terminal device that one embodiment of the invention provides.As shown in fig. 6, the terminal of the embodiment is set
Standby 6 include: processor 60, memory 61 and are stored in the meter that can be run in the memory 61 and on the processor 60
Calculation machine program 62, such as information polling routine.The processor 60 realizes above-mentioned each letter when executing the computer program 62
Cease the step in querying method embodiment, such as step S201 shown in Fig. 2 to step S206.Alternatively, the processor 60 is held
The function of each module/unit in above-mentioned each Installation practice, such as module shown in fig. 5 are realized when the row computer program 62
501 to module 506 function.
Illustratively, the computer program 62 can be divided into one or more module/units, it is one or
Multiple module/units are stored in the memory 61, and are executed by the processor 60, 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, which is used for
Implementation procedure of the computer program 62 in institute's terminal device 6 is described.For example, the computer program 62 can be divided
At information inquiring request receiving module, the first response message judgment module, the first response message sending module, the second response message
Judgment module, the second response message sending module, third response message enquiry module, each module concrete function are as follows:
Information inquiring request receiving module, for receiving the information inquiring request of client transmission;
First response message judgment module, for according to the information inquiring request judge search cluster in the presence or absence of pair
The first response message answered;
First response message sending module, if for, there are corresponding first response message, being obtained in described search cluster
First response message is taken, and first response message is sent to the client;
Second response message judgment module, if for corresponding first response message to be not present in described search cluster,
Judge in preset cache server with the presence or absence of corresponding second response message;
Second response message sending module, if for there are corresponding second response letters in the preset cache server
Breath, then obtain second response message, and second response message is sent to the client;
Third response message enquiry module, if for there is no corresponding second response letters in the preset cache server
Breath, it is determined that third party's query interface corresponding with the information inquiring request, to be obtained by third party's query interface
Third response message corresponding to the information inquiring request, and the third response message is sent to the client.
The terminal device 6 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set
It is standby.The terminal device may include, but be not limited only to, processor 60, memory 61.It will be understood by those skilled in the art that Fig. 6
The only example of terminal device 6 does not constitute the restriction to terminal device 6, may include than illustrating more or fewer portions
Part perhaps combines certain components or different components, such as the terminal device can also include input-output equipment, net
Network access device, bus etc..
The processor 60 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 is also possible to any conventional processor
Deng.
The memory 61 can be the internal storage unit of the terminal device 6, such as the hard disk or interior of terminal device 6
It deposits.The memory 61 is also possible to the External memory equipment of the terminal device 6, such as be equipped on the terminal device 6
Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge
Deposit card (Flash Card) etc..Further, the memory 61 can also both include the storage inside list of the terminal device 6
Member also includes External memory equipment.The memory 61 is for storing needed for the computer program and the terminal device
Other programs and data.The memory 61 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment
The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that each embodiment described in conjunction with the examples disclosed in this document
Module, unit and/or method and step can be realized with the combination of electronic hardware or computer software and electronic hardware.This
A little functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Specially
Industry technical staff can use different methods to achieve the described function each specific application, but this realization is not
It is considered as beyond the scope of this invention.
In several embodiments provided herein, it should be understood that disclosed system, device and method can be with
It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit
It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components
It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or
The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of device or unit
It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one 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 software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-described embodiment side
All or part of the process in method can also instruct relevant hardware to complete, the computer by computer program
Program can be stored in a computer readable storage medium, and the computer program is when being executed by processor, it can be achieved that above-mentioned each
The step of a embodiment of the method.Wherein, the computer program includes computer program code, and the computer program code can
Think source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium can be with
It include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, light that can carry the computer program code
Disk, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random
Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the computer
The content that readable medium includes can carry out increase and decrease appropriate according to the requirement made laws in jurisdiction with patent practice, such as
It does not include electric carrier signal and telecommunication signal according to legislation and patent practice, computer-readable medium in certain jurisdictions.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to before
Stating embodiment, invention is explained in detail, those skilled in the art should understand that: it still can be to preceding
Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these
It modifies or replaces, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.
Claims (10)
1. a kind of information query method characterized by comprising
Receive the information inquiring request that client is sent;
Judged to whether there is corresponding first response message in search cluster according to the information inquiring request;
If obtaining first response message there are corresponding first response message in described search cluster, and by described
One response message is sent to the client;
If in described search cluster be not present corresponding first response message, judge in preset cache server with the presence or absence of pair
The second response message answered;
If obtaining second response message there are corresponding second response message in the preset cache server, and will
Second response message is sent to the client;
If corresponding second response message is not present in the preset cache server, it is determined that with the information inquiring request pair
The third party's query interface answered is rung with obtaining third corresponding to the information inquiring request by third party's query interface
Information is answered, and the third response message is sent to the client.
2. information query method according to claim 1, which is characterized in that described to be sent to second response message
The client, comprising:
Second response message is parsed;
Whether the second response message after judging parsing meets the first preset condition;
If the second response message after parsing meets first preset condition, the second response message after parsing is sent to
The client, and the second response message after parsing is indexed in described search cluster.
3. information query method according to claim 1, which is characterized in that obtained by third party's query interface
After third response message corresponding to the information inquiring request, comprising:
The third response message is stored into the preset cache server.
4. information query method according to claim 1, which is characterized in that described to be sent to the third response message
The client, comprising:
The third response message is parsed;
Whether the third response message after judging parsing meets the second preset condition;
If the third response message after parsing meets second preset condition, the third response message after parsing is sent to
The client, and the third response message after parsing is indexed in described search cluster.
5. information query method according to claim 1, which is characterized in that the preset cache server is distributed slow
Deposit server.
6. information query method according to any one of claim 1 to 5, which is characterized in that looked into according to the information
It askes in request judgement search cluster with the presence or absence of before corresponding first response message, comprising:
The first presupposed information inquiry request is acquired, and the first presupposed information inquiry request is saved into presetting database;
The the first presupposed information inquiry request for extracting preset quantity in real time from the presetting database, it is default as second
Information inquiring request;
Determine third party's query interface corresponding to each second presupposed information inquiry request;
The 4th sound corresponding to each second presupposed information inquiry request is obtained by identified each third party's query interface
Information is answered, and will be indexed in described search cluster after the 4th response message parsing.
7. a kind of information query device characterized by comprising
Information inquiring request receiving module, for receiving the information inquiring request of client transmission;
First response message judgment module, for being judged in search cluster according to the information inquiring request with the presence or absence of corresponding
First response message;
First response message sending module, if for, there are corresponding first response message, obtaining institute in described search cluster
The first response message is stated, and first response message is sent to the client;
Second response message judgment module, if judging for corresponding first response message to be not present in described search cluster
It whether there is corresponding second response message in preset cache server;
Second response message sending module, if in the preset cache server there are corresponding second response message,
Second response message is obtained, and second response message is sent to the client;
Third response message enquiry module, if for corresponding second response message to be not present in the preset cache server,
Third party's query interface corresponding with the information inquiring request is then determined, described in obtaining by third party's query interface
Third response message corresponding to information inquiring request, and the third response message is sent to the client.
8. information query device according to claim 7, which is characterized in that the second response message sending module, packet
It includes:
Second response message resolution unit, for being parsed to second response message;
First preset condition judging unit, for judging whether the second response message after parsing meets the first preset condition;
Second response message transmission unit will if meeting first preset condition for the second response message after parsing
The second response message after parsing is sent to the client, and the second response message after parsing is indexed to described search collection
In group.
9. a kind of terminal device, including memory, processor and storage are in the memory and can be on the processor
The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 6 when executing the computer program
Any one of described in information query method the step of.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists
In the step of realization information query method as described in any one of claims 1 to 6 when the computer program is executed by processor
Suddenly.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811512101.1A CN109783518A (en) | 2018-12-11 | 2018-12-11 | Information query method, query device, storage medium and terminal equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811512101.1A CN109783518A (en) | 2018-12-11 | 2018-12-11 | Information query method, query device, storage medium and terminal equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109783518A true CN109783518A (en) | 2019-05-21 |
Family
ID=66496135
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811512101.1A Pending CN109783518A (en) | 2018-12-11 | 2018-12-11 | Information query method, query device, storage medium and terminal equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109783518A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110262796A (en) * | 2019-06-27 | 2019-09-20 | 广州力挚网络科技有限公司 | Data processing method, device and electronic equipment based on java |
CN110619092A (en) * | 2019-08-20 | 2019-12-27 | 合肥英泽信息科技有限公司 | Location name and address information searching system |
CN112835934A (en) * | 2021-02-01 | 2021-05-25 | 京东数字科技控股股份有限公司 | Query information acquisition method and device, electronic equipment and storage medium |
CN115529250A (en) * | 2022-08-17 | 2022-12-27 | 上海哔哩哔哩科技有限公司 | Flow playback method and device, electronic equipment and storage medium |
CN116132248A (en) * | 2022-10-11 | 2023-05-16 | 马上消费金融股份有限公司 | Information pushing method and computer readable storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101539918A (en) * | 2008-03-19 | 2009-09-23 | 天下互联(北京)科技有限公司 | Method and system for internet search |
CN102135985A (en) * | 2011-01-28 | 2011-07-27 | 百度在线网络技术(北京)有限公司 | Method and system for searching by calling search result of third-party search engine |
US9348918B2 (en) * | 2003-06-13 | 2016-05-24 | Brilliant Digital Entertainment, Inc. | Searching content in distributed computing networks |
CN106411986A (en) * | 2015-12-29 | 2017-02-15 | 深圳市瑞铭无限科技有限公司 | Position query method and apparatus |
CN107704582A (en) * | 2017-10-08 | 2018-02-16 | 安徽康佳电子有限公司 | A kind of closed loop Ecological feed-back catenary system based on server and webpage |
US20180239794A1 (en) * | 2012-06-19 | 2018-08-23 | Amazon Technologies, Inc. | Caching of updated network content portions |
CN108829837A (en) * | 2018-06-19 | 2018-11-16 | 北京五八信息技术有限公司 | A kind of information query method, device, equipment and computer readable storage medium |
-
2018
- 2018-12-11 CN CN201811512101.1A patent/CN109783518A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9348918B2 (en) * | 2003-06-13 | 2016-05-24 | Brilliant Digital Entertainment, Inc. | Searching content in distributed computing networks |
CN101539918A (en) * | 2008-03-19 | 2009-09-23 | 天下互联(北京)科技有限公司 | Method and system for internet search |
CN102135985A (en) * | 2011-01-28 | 2011-07-27 | 百度在线网络技术(北京)有限公司 | Method and system for searching by calling search result of third-party search engine |
US20180239794A1 (en) * | 2012-06-19 | 2018-08-23 | Amazon Technologies, Inc. | Caching of updated network content portions |
CN106411986A (en) * | 2015-12-29 | 2017-02-15 | 深圳市瑞铭无限科技有限公司 | Position query method and apparatus |
CN107704582A (en) * | 2017-10-08 | 2018-02-16 | 安徽康佳电子有限公司 | A kind of closed loop Ecological feed-back catenary system based on server and webpage |
CN108829837A (en) * | 2018-06-19 | 2018-11-16 | 北京五八信息技术有限公司 | A kind of information query method, device, equipment and computer readable storage medium |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110262796A (en) * | 2019-06-27 | 2019-09-20 | 广州力挚网络科技有限公司 | Data processing method, device and electronic equipment based on java |
CN110262796B (en) * | 2019-06-27 | 2023-06-30 | 广州力挚网络科技有限公司 | Data processing method and device based on java and electronic equipment |
CN110619092A (en) * | 2019-08-20 | 2019-12-27 | 合肥英泽信息科技有限公司 | Location name and address information searching system |
CN112835934A (en) * | 2021-02-01 | 2021-05-25 | 京东数字科技控股股份有限公司 | Query information acquisition method and device, electronic equipment and storage medium |
CN112835934B (en) * | 2021-02-01 | 2024-04-05 | 京东科技控股股份有限公司 | Query information acquisition method and device, electronic equipment and storage medium |
CN115529250A (en) * | 2022-08-17 | 2022-12-27 | 上海哔哩哔哩科技有限公司 | Flow playback method and device, electronic equipment and storage medium |
CN116132248A (en) * | 2022-10-11 | 2023-05-16 | 马上消费金融股份有限公司 | Information pushing method and computer readable storage medium |
CN116132248B (en) * | 2022-10-11 | 2024-05-24 | 马上消费金融股份有限公司 | Information pushing method and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109783518A (en) | Information query method, query device, storage medium and terminal equipment | |
CN109428922B (en) | Subscription and publishing method and server | |
CN104125208B (en) | Data transmission method and device | |
CN104052661B (en) | Container name server and container name analytic method | |
CN106603394B (en) | Method and device for realizing subscription notification | |
US20190236728A1 (en) | Method and apparatus for providing information | |
CN109213792A (en) | Method, server-side, client, device and the readable storage medium storing program for executing of data processing | |
CN102194008A (en) | System and method for searching disparate datastores via a remote device | |
CN103051672B (en) | End message acquisition methods in a kind of heterogeneous terminals environment and device | |
CN101616132A (en) | A kind of data capture method and device thereof and system | |
CN110222265A (en) | A kind of method, system, user terminal and the server of information push | |
CN102904801B (en) | Message prompt method and device | |
CN108282508A (en) | Determination method and device, information-pushing method and the device in geographical location | |
CN108536617A (en) | Buffer memory management method, medium, system and electronic equipment | |
CN101420681B (en) | Method and apparatus for processing multi-channel request subscription under service management platform | |
CN110688201B (en) | Log management method and related equipment | |
JPH1091686A (en) | Method for providing service | |
CN115039090A (en) | Data query method, device, server and storage medium | |
CN113688284B (en) | Processing method and device of Internet of vehicles service data, electronic equipment and storage medium | |
US20120303601A1 (en) | Mobile search method and system thereof | |
CN104160675B (en) | The method of filtration application | |
CN114500428A (en) | Navigation sharing method and device, electronic equipment, storage medium and program product | |
CN101621521B (en) | Method for managing a communication between a server device and a customer device | |
CN111813529B (en) | Data processing method, device, electronic equipment and storage medium | |
CN108566411A (en) | Static resource acquisition methods, electronic equipment and storage 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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190521 |
|
RJ01 | Rejection of invention patent application after publication |