CN111680210B - Information searching method, device, searching gateway and storage medium - Google Patents

Information searching method, device, searching gateway and storage medium Download PDF

Info

Publication number
CN111680210B
CN111680210B CN202010456593.8A CN202010456593A CN111680210B CN 111680210 B CN111680210 B CN 111680210B CN 202010456593 A CN202010456593 A CN 202010456593A CN 111680210 B CN111680210 B CN 111680210B
Authority
CN
China
Prior art keywords
search
search request
information
service data
target
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.)
Active
Application number
CN202010456593.8A
Other languages
Chinese (zh)
Other versions
CN111680210A (en
Inventor
金铮
刘玉莲
张河昌
闫方戈
张弓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202010456593.8A priority Critical patent/CN111680210B/en
Publication of CN111680210A publication Critical patent/CN111680210A/en
Priority to PCT/CN2021/090344 priority patent/WO2021238555A1/en
Application granted granted Critical
Publication of CN111680210B publication Critical patent/CN111680210B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure discloses an information searching method, an information searching device, a searching gateway and a storage medium, and belongs to the technical field of internet. The method comprises the following steps: receiving a first search request sent by a terminal, and acquiring first search request information corresponding to the first search request; responding to the first service data which needs to be degraded for the first search request and does not exist in the cache corresponding to the first search request information, modifying the first search request information to obtain second search request information, and enabling the cache to have second service data corresponding to the second search request information; according to the second search request information, second service data corresponding to the second search request information is obtained from the cache; and returning the second service data to the terminal. By the method, when the first search request is subjected to degradation processing, the search gateway can be ensured to acquire the service data from the cached service data and return the service data to the terminal, so that the search request sent by the terminal can be ensured to be responded, and the response rate of the search request is improved.

Description

Information searching method, device, searching gateway and storage medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to an information search method, an information search device, a search gateway, and a storage medium.
Background
With the development of internet technology, information search becomes an application function frequently used by users. In the information searching process, the terminal sends a searching request to the searching gateway, the searching gateway sends the searching request to the searching server, the searching server searches according to the searching request, and then the searching result is fed back to the terminal through the searching gateway. With the increase of the base number of the terminals, the load of the search server is more and more large, so that a large number of terminals may access the search server in the same time period, which causes the processing speed of the search server to be slow and even causes downtime, thereby affecting the user experience.
In the related art, the search gateway generally performs a degradation process on the search request to reduce the load of the search server. The common degradation processing method is that when the search gateway judges that degradation processing is required, the search gateway abandons the search request, that is, when degradation processing is required, the search gateway does not send the search request to the search server any more. Or the search gateway caches part of the core data of the search server locally, and when the degradation processing is required, the search gateway acquires the search result from the local cache and returns the search result to the client.
Disclosure of Invention
The embodiment of the disclosure provides an information search method, an information search device, a search gateway and a storage medium, and improves the response rate of search requests. The technical scheme is as follows:
in one aspect, an information search method is provided, where the method includes:
receiving a first search request sent by a terminal, and acquiring first search request information corresponding to the first search request;
responding to the first search request needing to be subjected to degradation processing and the cache does not have first service data corresponding to the first search request information, modifying the first search request information to obtain second search request information, wherein the cache has second service data corresponding to the second search request information;
according to the second search request information, second service data corresponding to the second search request information is obtained from the cache;
and returning the second service data to the terminal.
In a possible implementation manner, the modifying the first search request information to obtain the second search request information includes:
responding to the first search request information including first position information, and modifying the first position information to obtain second position information;
and generating the second search request information according to the second position information and search indication information which is used for indicating a search target in the first search request information.
In another possible implementation manner, the modifying the first location information to obtain second location information includes:
intercepting the first position information according to preset accuracy to obtain third position information;
and adjusting the position information of the first target field in the third position information, and/or deleting the position information of the second target field in the third position information to obtain the second position information.
In another possible implementation manner, the generating the second search request information according to the second location information and search indication information used for indicating a search target in the first search request information includes:
composing the second search request information by the second position information and the search indication information in the first search request information; or,
performing word segmentation on search indication information included in the first search request information to obtain a plurality of words, determining a first target word segmentation used for representing fourth position information according to the plurality of words, and forming the second search request information by the fourth position information represented by the first target word segmentation, the second position information and other words except the first target word segmentation in the plurality of words.
In another possible implementation manner, the modifying the first search request information to obtain second search request information includes:
responding to the first search request information without first position information, and performing word segmentation processing on search indication information included in the first search request information to obtain a plurality of words;
determining at least two second target participles from the plurality of participles according to the weight of each participle;
and generating the second search request information according to the at least two second target participles.
In another possible implementation manner, the generating the second search request information according to the at least two second target word segmentations includes:
composing the at least two second target participles into the second search request information; or,
determining a third target participle used for representing position information from the at least two second target participles according to the part of speech of each second target participle; and generating the second search request information according to fifth position information represented by the third target participle and target participles except the third target participle in the at least two second target participles.
In another possible implementation manner, the generating the second search request information according to fifth position information represented by the third target participle and target participles, except for the third target participle, in the at least two second target participles includes:
forming second search request information by using fifth position information represented by the third target participle and target participles except for the third target participle in the at least two second target participles; or,
and modifying the fifth position information to obtain sixth position information, and combining the sixth position information and the target participles except the third target participle in the at least two second target participles to form the second search request information.
In another possible implementation manner, the method further includes:
acquiring the current non-result rate of a search server, and acquiring the reference non-result rate of the search server; determining the current no-result rate increment according to the current no-result rate and the reference no-result rate; determining that degradation processing needs to be performed on the first search request in response to the non-result rate increment being larger than a preset threshold; or,
and determining that degradation processing needs to be carried out on the first search request in response to the fact that a search result returned by the search server is not received within a preset time length.
In another possible implementation manner, before determining that demotion processing is required for the first search request, the method further includes:
determining a current degraded search rate;
responsive to the current destage search rate being less than the no result rate increment, performing a step of determining that destage processing is required for the first search request.
In another possible implementation manner, the obtaining, according to the second search request information, second service data corresponding to the second search request information from the cache includes:
sending the second search request information to a cache server, wherein the cache server is used for caching service data, and determining second service data corresponding to the second search request information according to the second search request information;
and receiving the second service data returned by the cache server.
In another possible implementation manner, the obtaining first search request information corresponding to the first search request includes:
decrypting the first search request to obtain first position information and search indication information corresponding to the first search request, and acquiring auxiliary search information corresponding to the first search request according to the first search request;
and combining the first position information, the search indication information and the auxiliary search information into first search request information corresponding to the first search request.
In another aspect, an information search apparatus is provided, the apparatus including:
the receiving module is used for receiving a first search request sent by a terminal and acquiring first search request information corresponding to the first search request;
a modification module, configured to modify the first search request information to obtain a second search request in response to that the first search request needs to be subjected to degradation processing and first service data corresponding to the first search request information does not exist in the cache
The acquisition module is used for acquiring second service data corresponding to the second search request information from the cache according to the second search request information;
and the sending module is used for returning the second service data to the terminal.
In a possible implementation manner, the modifying module is further configured to modify, in response to that the first search request information includes first location information, the first location information to obtain second location information; and generating the second search request information according to the second position information and search indication information which is used for indicating a search target in the first search request information.
In another possible implementation manner, the modification module is further configured to intercept the first position information according to a preset accuracy to obtain the third position information;
the modification module is further configured to adjust location information of a first target field in the third location information, and/or delete location information of a second target field in the third location information, so as to obtain the second location information.
In another possible implementation manner, the modification module is further configured to combine the second location information and the search indication information in the first search request information into the second search request information; or,
the modification module is further configured to perform word segmentation processing on the search instruction information included in the first search request information to obtain a plurality of words, determine a first target word segmentation used for representing fourth position information according to the plurality of words, and compose the second search request information by the fourth position information represented by the first target word segmentation, the second position information, and other words in the plurality of words except the first target word segmentation.
In another possible implementation manner, the modification module is further configured to perform word segmentation processing on search instruction information included in the first search request information in response to that the first search request information does not include the first location information, so as to obtain a plurality of words; determining at least two second target participles from the plurality of participles according to the weight of each participle; and generating the second search request information according to the at least two second target participles.
In another possible implementation manner, the modification module is further configured to combine the at least two second target word segmentations into the second search request information; or,
the modification module is further configured to determine a third target word segmentation used for representing position information from the at least two second target word segmentations according to the part of speech of each second target word segmentation; and generating the second search request information according to fifth position information represented by the third target participle and target participles except the third target participle in the at least two second target participles.
In another possible implementation manner, the modifying module is further configured to combine fifth position information represented by the third target participle and target participles, except for the third target participle, in the at least two second target participles into the second search request information; or,
the modification module is further configured to modify the fifth location information to obtain sixth location information, and compose the second search request information by the sixth location information and target participles, excluding the third target participle, in the at least two second target participles.
In another possible implementation manner, the apparatus further includes:
the first determining module is used for acquiring the current no-result rate of the search server and acquiring the reference no-result rate of the search server; determining the current non-result rate increment according to the current non-result rate and the reference non-result rate; determining that degradation processing needs to be performed on the first search request in response to the no-result rate increment being larger than a preset threshold; or,
the first determining module is further configured to determine that degradation processing needs to be performed on the first search request in response to not receiving a search result returned by the search server within a preset time period.
In another possible implementation manner, the apparatus further includes:
a second determining module, configured to determine a current degraded search rate;
the first determining module is further configured to perform a step of determining that demotion processing is required for the first search request in response to the current demotion search rate being less than the no-result-rate increment.
In another possible implementation manner, the obtaining module is further configured to send the second search request information to a cache server, where the cache server is configured to cache service data, and determine, according to the second search request information, second service data corresponding to the second search request information; and receiving the second service data returned by the cache server.
In another possible implementation manner, the receiving module is further configured to decrypt the first search request to obtain first location information and search instruction information corresponding to the first search request, and obtain auxiliary search information corresponding to the first search request according to the first search request; and the first position information, the search indication information and the auxiliary search information form first search request information corresponding to the first search request.
In another aspect, a search gateway is provided that includes one or more processors and one or more memories having at least one instruction stored therein, the at least one instruction being loaded and executed by the one or more processors to implement the operations performed by the information search method as described in the method embodiments of the present disclosure.
In another aspect, a non-transitory computer-readable storage medium is provided, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a processor to implement the operations performed by the information search method as described in the method embodiments of the present disclosure.
In the embodiment of the disclosure, a first search request sent by a terminal is received, and first search request information corresponding to the first search request is acquired; responding to the first search request needing to be degraded and first service data corresponding to the first search request information does not exist in the cache, modifying the first search request information to obtain second search request information, and second service data corresponding to the second search request information exists in the cache; according to the second search request information, second service data corresponding to the second search request information is obtained from the cache; and returning the second service data to the terminal, so that when the first search request is subjected to degradation processing, the search gateway can be ensured to acquire the service data from the cached service data and return the service data to the terminal, thereby ensuring that the search request sent by the terminal can be responded, and improving the response rate of the search request.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a diagram illustrating a system architecture according to one method of information search, according to an exemplary embodiment of a portion of the present disclosure;
FIG. 2 is a flow diagram illustrating a method of searching for information according to an exemplary embodiment;
FIG. 3 is a flow diagram illustrating a method of searching for information, according to an example embodiment;
FIG. 4 is a flow diagram illustrating a method of searching for information, according to an example embodiment;
FIG. 5 is a flow diagram illustrating a method of searching for information, according to an example embodiment;
FIG. 6 is a flow diagram illustrating a method of searching for information, according to an example embodiment;
FIG. 7 is a block diagram illustrating an information search apparatus according to an example embodiment;
fig. 8 is a schematic diagram illustrating a search gateway configuration, according to an example embodiment.
Detailed Description
To make the objects, technical solutions and advantages of the present disclosure more apparent, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a system architecture diagram illustrating an information search method according to an exemplary embodiment of the present disclosure. The system architecture diagram includes a terminal 101, a search gateway 102, and a search server 103.
The terminal 101 and the search gateway 102 perform data interaction through network connection, and the search gateway 102 and the search server 103 perform data interaction through network connection. The terminal 101 may run therein an application program for performing a search, which may be an application program having an information search function, such as a browser or an internet transaction platform. The user can search for information through the application. Correspondingly, when the terminal 101 receives a search instruction triggered by a user, a first search request is generated according to the search instruction, and the first search request is sent to the search gateway 102. In response to the normal operation of the search server 103, the search gateway 102 forwards the first search request to the search server 103, the search server 103 searches for service data corresponding to the first search request according to a preset search algorithm, returns the searched service data to the search gateway 102, and the search gateway 102 returns the service data to the terminal 101. In response to the abnormal operation of the search server 103, the search gateway 102 obtains the service data corresponding to the first search request from the cache according to the first search request, and returns the service data to the terminal 101.
For example, the application may be an internet transaction platform, a search bar is displayed in a display interface of the application, and a user may input first search request information corresponding to a search target into the search bar, for example, the search target of the user may be a restaurant in a certain place, and the first search request information input by the user may be "restaurant in a place a", and accordingly, the terminal 101 generates a first search request according to the first search request information, sends the first search request to the search gateway 102, and obtains service data corresponding to the first search request by the search gateway 102, and accordingly, the service data corresponding to the first search request may be data such as a name, a place, and related user comments of the restaurant in the place a.
In one possible implementation, the system architecture further includes a cache server, where the cache server caches the service data. In response to the search server 103 working abnormally, the search gateway 102 may directly acquire the service data cached in the cache server from the cache server, and transmit the service data to the terminal 101.
The terminal 101 may be a mobile phone, a computer, a tablet computer, or a wearable device. The search server 103 and the cache server may be independent physical servers, may be a server cluster composed of a plurality of physical servers, or may be cloud servers or the like. The search gateway 102 may be any network gateway or protocol converter that can perform protocol conversion, which is not specifically limited in the embodiment of the present disclosure.
Fig. 2 is a flowchart illustrating an information search method according to an exemplary embodiment, as shown in fig. 2, the information search method including the steps of:
step 201: receiving a first search request sent by a terminal, and acquiring first search request information corresponding to the first search request.
Step 202: and in response to the first search request needing to be subjected to degradation processing and the first service data corresponding to the first search request information does not exist in the cache, modifying the first search request information to obtain second search request information, wherein the second service data corresponding to the second search request information exists in the cache.
Step 203: and acquiring second service data corresponding to the second search request information from the cache according to the second search request information.
Step 204: and returning the second service data to the terminal.
In a possible implementation manner, the modifying the first search request information to obtain the second search request information includes:
responding to the first search request information including first position information, and modifying the first position information to obtain second position information;
and generating the second search request information according to the second position information and search indication information which is used for indicating a search target in the first search request information.
In another possible implementation manner, the modifying the first location information to obtain second location information includes:
intercepting the first position information according to preset accuracy to obtain third position information;
and adjusting the position information of the first target field in the third position information, and/or deleting the position information of the second target field in the third position information to obtain the second position information.
In another possible implementation manner, the generating the second search request information according to the second location information and search indication information used for indicating a search target in the first search request information includes:
composing the second search request information by the second position information and the search instruction information in the first search request information; or,
performing word segmentation processing on search indication information included in the first search request information to obtain a plurality of segmented words, determining a first target segmented word used for representing fourth position information according to the plurality of segmented words, and forming the fourth position information represented by the first target segmented word, the second position information and other segmented words except the first target segmented word in the plurality of segmented words into second search request information.
In another possible implementation manner, the modifying the first search request information to obtain the second search request information includes:
responding to the first search request information without first position information, and performing word segmentation processing on search indication information included in the first search request information to obtain a plurality of words;
determining at least two second target participles from the multiple participles according to the weight of each participle;
and generating the second search request information according to the at least two second target participles.
In another possible implementation manner, the generating the second search request information according to the at least two second target participles includes:
the at least two second target word segments form the second search request information; or,
determining a third target participle used for representing position information from the at least two second target participles according to the part of speech of each second target participle; and generating the second search request information according to the fifth position information represented by the third target participle and the target participles except the third target participle in the at least two second target participles.
In another possible implementation manner, the generating the second search request information according to the fifth location information indicated by the third target participle and the target participles, except for the third target participle, in the at least two second target participles includes:
forming the second search request information by using fifth position information represented by the third target participle and target participles except the third target participle in the at least two second target participles; or,
and modifying the fifth position information to obtain sixth position information, and combining the sixth position information and the target participles except the third target participle in the at least two second target participles to form the second search request information.
In another possible implementation manner, the method further includes:
acquiring the current no-result rate of a search server, and acquiring the reference no-result rate of the search server; determining the current no-result rate increment according to the current no-result rate and the reference no-result rate; determining that degradation processing needs to be performed on the first search request in response to the no-result rate increment being greater than a preset threshold; or,
and determining that the first search request needs to be subjected to degradation processing in response to the fact that a search result returned by the search server is not received within a preset time length.
In another possible implementation manner, before determining that the first search request needs to be demoted, the method further includes:
determining a current degraded search rate;
responsive to the current degraded search rate being less than the no result rate increment, performing a step of determining that degradation processing is required for the first search request.
In another possible implementation manner, the obtaining, according to the second search request information, second service data corresponding to the second search request information from the cache includes:
sending the second search request information to a cache server, wherein the cache server is used for caching service data, and determining second service data corresponding to the second search request information according to the second search request information;
and receiving the second service data returned by the cache server.
In another possible implementation manner, the obtaining first search request information corresponding to the first search request includes:
decrypting the first search request to obtain first position information and search indication information corresponding to the first search request, and acquiring auxiliary search information corresponding to the first search request according to the first search request;
and composing the first position information, the search indication information and the auxiliary search information into first search request information corresponding to the first search request.
In the embodiment of the disclosure, a first search request sent by a terminal is received, and first search request information corresponding to the first search request is acquired; responding to the first service data which needs to be degraded for the first search request and does not exist in the cache corresponding to the first search request information, modifying the first search request information to obtain second search request information, and enabling the cache to have second service data corresponding to the second search request information; according to the second search request information, second service data corresponding to the second search request information is obtained from the cache; and returning the second service data to the terminal, so that when the first search request is subjected to degradation processing, the search gateway can be ensured to acquire the service data from the cached service data and return the service data to the terminal, thereby ensuring that the search request sent by the terminal can be responded, and improving the response rate of the search request.
In the embodiment of the disclosure, the terminal sends the first search request to the search gateway, and the search gateway determines whether the first search request needs to be subjected to degradation processing. Referring to fig. 3, when the search gateway determines that the first search request needs to be subjected to the degradation processing, the search gateway determines a degradation policy corresponding to the first search request according to the first search request information included in the first search request. And responding to the first search request comprising first position information used for indicating latitude and longitude information, and carrying out a degradation strategy with latitude and longitude on the first search request by the search gateway according to the first position information. And in response to the first search request not including the first position information used for indicating the latitude and longitude information, the search gateway performs a degradation strategy without latitude and longitude on the first search request according to the search indication information included in the first search request information.
Fig. 4 is a flowchart of an information searching method according to an exemplary embodiment, where the present embodiment is described by taking an example that a searching gateway performs a downgrading policy with latitude and longitude, as shown in fig. 4, the information searching method includes the following steps:
step 401: the searching gateway receives a first searching request sent by a terminal, and first searching request information corresponding to the first searching request is obtained.
The first search request information includes at least first location information provided by the terminal and search instruction information for instructing a search target. The first search request information may also include other search assistance information for assisting a search.
In one possible implementation, the first search request information includes first location information and search indication information; and, the first search request carries the first location information and the search instruction information. Correspondingly, the process of the search gateway acquiring the first location information and the search indication information may be: the search gateway acquires the first location information and the search indication information from the first search request.
The first search request carries encrypted first location information and encrypted search indication information. Correspondingly, the process of the search gateway acquiring the first location information and the search indication information may be: the search gateway decrypts the first search request to obtain first location information and search indication information.
Correspondingly, when the first search request carries the encrypted first location information and the encrypted search indication information, the terminal encrypts the first location information and the search indication information before sending the first search request to the search gateway, and adds the encrypted first location information and the encrypted search indication information to the first search request. The encryption method of the terminal corresponds to the decryption method of the search gateway. The terminal encrypts the first search request information according to a preset encryption method, and the search gateway decrypts the first search request according to a preset decryption method.
In the implementation manner, the decryption processing is performed through the first search request to obtain the first position information and the search indication information corresponding to the first search request, so that the security of the first search request is increased.
In another possible implementation manner, the first search request information further includes auxiliary search information; correspondingly, the process of the search gateway acquiring the auxiliary search information may be: the searching gateway calls an external server according to the first searching request; and acquiring auxiliary information corresponding to the first search request from an external server. For example, the auxiliary search information may include source information of the first search request, and accordingly, the auxiliary search information may be a cityid of the first search request, and the cityid corresponding to the first search request is obtained by calling the cityid gateway server.
When the first search request information further includes auxiliary search information, the process of the terminal acquiring the first search request information may be: decrypting the first search request to obtain first position information and search indication information corresponding to the first search request, and acquiring auxiliary search information corresponding to the first search request according to the first search request; and combining the first position information, the search indication information and the auxiliary search information into first search request information corresponding to the first search request.
The first location information may be location information of a geographic location where the terminal is located when the terminal sends the first search request, and accordingly, the terminal locates the current geographic location, determines a current location coordinate, and adds the location coordinate to the first search request. For example, the terminal may perform positioning by using a positioning system of the terminal itself, and determine the position coordinates obtained by the positioning as the first position information. The first location information may also be location information selected or input by a user and received by the terminal, and accordingly, the terminal receives the location information input by the user, converts the location information input by the user into location coordinates, and adds the location coordinates to the first search request. For example, if the position information input by the user is "intersection a and B", the terminal converts the position information into position coordinates corresponding to "intersection a and B", and takes the position coordinates as first position information.
The point to be described is that the search gateway may decrypt the first search request first and then obtain the auxiliary search information corresponding to the first search request; the search gateway can also obtain auxiliary search information corresponding to the first search request first and then decrypt the first search request; the search gateway can also simultaneously acquire an auxiliary search request corresponding to the first search request and decrypt the first search request. In the embodiment of the present disclosure, the processing flow of the gateway server for the first search request is not limited to the aggregate.
Step 402: the search gateway determines whether to downgrade the first search request.
Referring to fig. 5, after receiving a first search request, the search gateway determines whether demotion processing is required for the first search request. In this step, the search gateway determines whether to perform the destaging process for the first search request. The search gateway may determine whether to perform demotion processing on the first search request according to a state of the search server. The search gateway may determine whether to perform degradation processing on the first search request in the following three ways, and in a first implementation, when performing degradation processing on the search request, the search gateway may select a search request meeting a condition to perform degradation processing. In a second implementation manner, the search gateway may determine whether to perform degradation processing on the first search request according to a no-result rate of the search server; in a third implementation manner, the search gateway may further determine that degradation processing needs to be performed on the first search request when service data returned by the search server is not received.
Accordingly, in the first implementation manner, when the search gateway performs degradation on the search request, the search gateway may select a search request meeting the condition to perform degradation processing. Wherein the condition may be that the hash value of the first search request satisfies a requirement of no result rate increment. Correspondingly, the search gateway can perform hash calculation on the unique identifier of the first search request to obtain a hash value corresponding to the first search request, perform remainder calculation on the hash value corresponding to the first search request, and divide the remainder value into hundreds, so as to select the first search request with the percentage value smaller than the non-result-rate increment after the remainder calculation for degradation. The method for determining the search request meeting the condition by the search gateway according to the unique identifier of the first search request can be represented by a formula I.
The formula I is as follows: hash (queryid)% 100/100
Wherein, queryid represents the unique identification of the first search request; hash (queryid) represents a hash value of the unique identifier of the first search request obtained by performing hash calculation on the unique identifier of the first search request; hash (queryid)% 100 represents the remainder calculation of the hash value of the unique identifier of the first search request; hash (queryid)% 100/100 represents the percentage value left over from the hash value of the unique identifier of the first search request.
In the implementation manner, the first search request capable of performing degradation processing is selected through the hash value of the first search request, so that all the first search requests are prevented from being degraded, the search server cannot receive the first search request when the search server works normally, the reasonable number of the degraded first search requests is ensured, and the first search request is automatically subjected to degradation processing.
In a second implementation manner, the search gateway determines whether to perform degradation processing on the first search request according to a predetermined working state of the search server. And the search gateway determines whether the first search request needs to be subjected to degradation processing according to the non-result rate. The process may be realized by the following steps (a1) - (a4), including:
(A1) the search gateway obtains the current non-result rate of the search server.
The search gateway counts the number of the search requests sent to the search server within a first specified time length, counts the number of the search requests receiving the null data in the search requests, and determines the ratio of the number of the search requests receiving the null data to the total number of the sent search requests as the current no-result rate of the search server. The null data may be a response returned by the search server that does not include the service data corresponding to the first search request, or may be service data returned by the search server that is not received by the search gateway. The first specified duration may be set as needed, and in the embodiment of the present disclosure, the first specified duration is not specifically limited. For example, the first specified time period may be 10s, 15s, 20s, or the like.
The reason that the search gateway receives the null data is that the number of search requests processed by the search server possibly exceeds a preset threshold value, so that the time for the search server to respond to the search requests sent by the search gateway exceeds a second specified time length; or, the search server is abnormal in downtime, bug (bug) and the like. In the embodiment of the present disclosure, the kind of the problem generated by the search server is not particularly limited. The second specified time length is less than the first specified time length, and the second specified time length may be set as needed, which is not specifically limited in the embodiment of the present disclosure.
(A2) The search gateway obtains the reference non-result rate of the search server.
Wherein the reference no-result rate may be determined according to no-result rates of the search servers within different specified time periods. For example, the specified time period may be 10 minutes, 1 hour, 1 day, or 1 week, respectively, and the reference no-result rate of the search server is determined by the no-result rate determination model. The non-result rate determination model may be a linear model, and in the embodiment of the present disclosure, the non-result rate determination model is not particularly limited.
In a possible implementation manner, the reference no-result rate may be determined by the search gateway itself, and correspondingly, the search gateway determines the reference no-result rate once every third specified time duration, where the process of determining the reference no-result rate by the search gateway may be: the searching gateway determines the reference non-result rate of the searching server through the non-result rate determining model; and storing the reference non-result rate in a local area, and acquiring the reference non-result rate from the local area by the search gateway every third specified time.
In another possible implementation manner, the reference non-result rate may be determined by other electronic devices, and a process of determining the reference non-result rate of the search server by the other electronic devices is similar to a process of determining the reference non-result rate of the search server by the search gateway, and is not described herein again. Correspondingly, when the search gateway needs to acquire the reference non-result rate of the search server, a non-result rate acquisition request can be sent to other electronic equipment, and the non-result rate acquisition request at least carries the gateway identifier of the search gateway and the server identifier of the search server; when the electronic equipment receives the non-result rate obtaining request, the reference non-result rate of the search server is obtained according to the server identification of the search server, the reference non-result rate is sent to the search gateway according to the gateway identification of the search gateway, and the search gateway receives the remembering non-result rate of the search server sent by other electronic equipment.
Another point to be explained is that the search gateway may first obtain the current no-result rate of the search server, and then obtain the reference no-result rate of the search server; the search gateway can also obtain the reference non-result rate of the search server firstly and then obtain the current non-result rate of the search server; the search gateway may further obtain a current non-result rate and a reference non-result rate of the search server at the same time, which is not specifically limited in the embodiment of the present disclosure. That is, the search gateway may perform the step (a1) first and then the step (a2), the search gateway may perform the step (a2) first and then the step (a1), and the search gateway may perform the steps (a1) and (a2) at the same time. In the embodiment of the present disclosure, the order in which the search gateway performs steps (a1) and (a2) is not particularly limited.
(A3) And the searching gateway determines the current no-result rate increment according to the current no-result rate and the reference no-result rate.
The search gateway takes the difference between the current no-result rate and the reference no-result rate as the no-result rate increment of the search server. That is, the non-result rate increment P1 is the current non-result rate — the reference non-result rate.
(A4) And responding to the result-free rate increment larger than a preset threshold value, and determining that the first search request needs to be subjected to degradation processing by the search gateway.
The search gateway may directly determine that the first search request is a search request requiring a demotion process when the no-result rate increment is greater than a preset threshold. The search gateway can also determine whether to downgrade the current search request according to the current downgrade rate, and determine whether the first search request is a search request needing to be downgraded according to the current downgrade rate. Correspondingly, the search gateway determines the current degraded search rate; in response to the current destage search rate being less than the no result rate increment, the search gateway performs step (a 4). Wherein the current destage search rate may be determined according to the number of search requests that have been destaged in the current time period and the total number of search requests in the current time period.
In the implementation mode, whether the first search request is degraded or not is determined by combining the current non-result rate increment and the current degradation rate, so that only part of the search request is degraded under the condition that the search server exceeds the load, and the search gateway can automatically stop degrading the search request and realize automatic recovery of search when the load of the search server is reduced.
In the implementation manner, the search gateway judges whether to perform degradation processing on the first search request according to the current working state of the search server, so that the search gateway can determine the current working state of the search server and determine whether to perform degradation processing on the first search request, thereby automatically performing degradation processing on the first search request according to the working state of the search server, and thus, when the search server works abnormally, service data corresponding to the search request can be acquired by degrading the first search request, and the terminal is prevented from being incapable of acquiring the service data to influence user experience.
In a third implementation manner, with reference to fig. 5, the search gateway may send the first search request to the search server, and determine that degradation processing needs to be performed on the first search request if service data returned by the search server is not received in the first preset time period. The process may be: and in response to that the search result returned by the search server is not received within the first preset time, the search gateway determines that the first search request needs to be subjected to degradation processing.
It should be noted that, when receiving the first search request, the search gateway may first directly send the first search request to the search server, and when not receiving the service data returned by the search server within a first preset time period, determine that degradation processing needs to be performed on the first search request; the search gateway may further perform steps (a1) - (A3) when receiving the first search request, send the first search request to the search server in response to the non-result rate increment not being greater than the preset threshold, and determine that the first search request needs to be downgraded when the service data returned by the search server is not received within the first preset time period.
In the implementation manner, the search gateway determines whether to perform degradation processing on the search request according to whether the service data returned by the search server is received within a first preset time, so that the search gateway can perform degradation processing on the first search request when the search server cannot return the service data in time, and the terminal can acquire the service data corresponding to the first search request, thereby ensuring user experience.
In addition, the search gateway can also determine whether to perform degradation processing on the first search request according to the accuracy requirement of the first search request on the service data. Accordingly, when the search server determines that the first search request needs to be downgraded, the search gateway may then determine the accuracy requirement of the first search request for the service data. And performing degradation processing on the first search request when the accuracy requirement corresponding to the first search request is lower than the target accuracy requirement. And when the accuracy requirement corresponding to the first search request is not lower than the target accuracy requirement, performing degradation processing on the first search request. For example, the first search request may carry indication information for indicating the accuracy requirement type of the first search request. The search server determines the accuracy requirement corresponding to the first search request information according to the indication information, for example, if the indication information of the first search request indicates that the accuracy requirement type of the first search request is a normal type, it is determined that the first search request can be subjected to degradation processing. And if the indication information of the first search request indicates that the accuracy requirement type of the first search request is a high accuracy type, determining that the first search request cannot be subjected to degradation processing.
It should be noted that, the search gateway may determine the accuracy requirement type of the first search request before determining whether to perform the degradation processing on the first search request, and the search gateway may also determine the accuracy requirement type of the first search request after determining that the first search request needs to be degraded, which is not specifically limited in the embodiment of the present disclosure.
In the implementation manner, whether the first search request is subjected to degradation processing is determined according to the accuracy requirement of the first search request on the service data, so that the first search request with the high accuracy requirement can be ensured not to be degraded, and the first search request can be ensured to acquire the high-accuracy service data.
Step 403: and responding to the first search request needing to be subjected to degradation processing, and inquiring first service data corresponding to the first search request from the cache by the search gateway according to the first search request.
With reference to fig. 5, when the first search request needs to be subjected to the degradation processing, the search gateway queries, according to the first search request, the first service data corresponding to the first search request from the cache. The search gateway may match the cached service data according to a search value corresponding to the first search request, so as to query the first service data corresponding to the first search request. Correspondingly, the cache may store a plurality of service data and a corresponding relationship between the service data and the search value, and when the search gateway acquires the service data from the cache, the first service data corresponding to the first search request may be queried from the corresponding relationship between the service data and the search value according to the search value. Continuing to refer to fig. 5, in response to the search gateway querying the service data corresponding to the search value of the first search request from the cache, returning the service data to the terminal as the first service data; in response to the search gateway not querying the cache for service data corresponding to the first search request, the search gateway performs step 404.
The search value may be determined according to first search request information carried in the first search request, where the first search request information may include information such as a keyword, city information, a search category, and a ranking mode selected by a user corresponding to the first search request. Accordingly, the search server converts the first search request information into a search value according to a search value algorithm. In a possible implementation manner, the search server may directly convert the first search request information into a numerical value to obtain a search value corresponding to the first search request; in another possible implementation manner, the search server may determine weights of different information in the first search request information, and perform addition on the information in the first search request information according to the weights to obtain a search value corresponding to the first search request.
In addition, the cached service data may be core data acquired by the search gateway from the search server in advance, and the cached service data may also be service data returned by the search server and received by the search gateway when the search gateway performs a search service. Correspondingly, when the search server returns the service data, the search value corresponding to the service data is returned at the same time, and the search gateway correspondingly stores the service data and the search value.
The cache may be a local cache of the search gateway, or may be a cache in a cache server called by the search gateway. Correspondingly, in a possible implementation manner, the search gateway directly calls the local cache, and queries the first service data corresponding to the first search request from the cache according to the search value corresponding to the first search request. In this implementation manner, the search gateway caches the service data locally, so that the first search request can be degraded when the search server fails, and the first service data corresponding to the first search request is queried from the local cache, and the first service data corresponding to the first search request can be further prevented from being queried from the local cache by the search gateway when the connection between the search gateway and the external network fails, thereby ensuring that the first service data corresponding to the first search request can also be queried by the search gateway when the network is abnormal.
In another possible implementation manner, the search gateway invokes a cache server, and queries the first service data corresponding to the first search request from the cache server. Correspondingly, the process that the search gateway queries the first service data corresponding to the first search request from the cache according to the first search request can be implemented through the following steps (1) - (6), including:
(1) and sending the first search request information to a cache server, wherein the cache server is used for caching service data, and according to the first search request information, the first service data corresponding to the first search request information is determined to be inquired.
The search gateway can realize a server interface of the storage cache server, perform data interaction with the cache server through the server interface of the cache server, and send the first search request to the cache server.
(2) The cache server receives a first search request.
Accordingly, in this step, the cache server receives the first search request through the server interface.
(3) And the cache server inquires first service data corresponding to the first search request from the cached service data according to the first search request.
In this step, the cache server queries, according to a search value corresponding to the first search request, first service data corresponding to the first search request from the cached service data.
It should be noted that the search value of the first search request may be determined by the search gateway, and correspondingly, the search gateway may directly send the search value corresponding to the first search request to the cache server, and correspondingly, in this step, the cache server directly queries, according to the search value corresponding to the first search request, the first service data for drinking of the first search request from the locally cached service data. Correspondingly, in this step, the cache server determines a search value corresponding to the first search request according to the first search request, and queries, according to the search value corresponding to the first search request, the first service data corresponding to the first search request from the cached service data.
The process of determining the search value corresponding to the first search request by the cache server is similar to the process of determining the search value corresponding to the first search request by the search gateway, and is not described herein again.
(4) In response to that the first service data corresponding to the first search request does not exist in the cache server, the search gateway performs step 404.
In response to that the cache server does not query the first service data corresponding to the first search request from the locally cached service data, the cache server may not send a response corresponding to the first search request to the search gateway, and if the search gateway receives a response returned by the cache server within a second preset time period, the search gateway determines that the first service data corresponding to the first search request does not exist in the cache server, and the search gateway performs step 404. Or, in response to that the cache server does not query the first service data corresponding to the first search request from the locally cached service data, the cache server sends a target response to the search gateway, where the target response is used to indicate that the first service data corresponding to the first search request does not exist in the cache server, and the search gateway determines that the first service data corresponding to the first search request does not exist in the cache server, and the search gateway performs step 404.
(5) And responding to the first service data corresponding to the first search request in the cache server, and sending the first service data to the search gateway by the cache server.
And responding to a first service data corresponding to the first search request inquired from the locally cached service data by the cache server, acquiring the cached first service data, and sending the first service data to the search gateway.
(6) And the search gateway receives the first service data returned by the cache server.
In this step, the search gateway receives the first service data returned by the cache server, and sends the first service data to the terminal corresponding to the first search request.
In the implementation mode, the cached service data is cached in the cache server outside the search gateway, so that enough cache space is ensured, a large amount of service data which can be searched can be cached in the cache, and the search service can be smoothly carried out.
The process of caching the service data by the cache server is similar to the process of searching the gateway cache service data, and is not described in detail herein.
It should be noted that, when receiving the first search request, the search gateway may directly query the first service data corresponding to the first search request from the cache according to the first location information included in the first search request. The search network manager can also intercept the first position information in the first search request according to preset precision when receiving the first search request, and query the first service data corresponding to the first search request from the cache according to the intercepted first position information. In the embodiments of the present disclosure, this is not particularly limited.
Step 404: and in response to the first search request needing to be degraded and the first service data corresponding to the first search request information does not exist in the cache, the search gateway modifies the first location information to obtain second location information.
And responding to the first search request carrying the first position information, and performing degradation processing on the first search request by the search gateway through a band dimension degradation strategy. The first location information is first location information carried by the first search request.
The search gateway may modify the first location information in the following three ways to obtain the second location information. In a first implementation mode, intercepting first position information according to preset accuracy; in a second implementation manner, the position information of the first target field is adjusted; in a third implementation, the location information of the second target field is deleted.
Correspondingly, in a first implementation manner, the search gateway intercepts the first location information according to the preset accuracy to obtain the second location information.
In the implementation mode, the search gateway intercepts digits corresponding to the preset precision in the first position information according to the preset precision to obtain the second position information. The preset precision may be a preset precision value, or a precision value determined according to a preset precision determination method. For example, the user may preset the precision value corresponding to the preset precision to be 5 decimal places, and when the search gateway intercepts any first location information, the search gateway intercepts 5 decimal places of the first location information. Correspondingly, the preset precision is a precision value determined according to a preset precision determination method, and the preset precision determination method can be used for determining the precision value corresponding to the preset precision according to the original decimal number of the first position information. For example, the search gateway may choose to truncate 80% of the decimal places of the first location information, and when the first location information has 10 decimal places, the search gateway may truncate the eighth decimal place of the first location information.
In a second implementation manner, the search gateway adjusts the location information of the first target field in the first location information to obtain the second location information.
The first target field is a field in the preset first location information, for example, the first target field may be a last bit or a last-but-second bit of the first location information.
When the first position information is a position coordinate, the first target field may be a field in coordinate information corresponding to any coordinate axis in the position coordinate, or may be a field in coordinate information corresponding to each coordinate axis in the position coordinate. For example, the first target field is the last bit in the position coordinates, and the first position information is 120.45172: 28.19126, the adjusted second position information may be 120.45172: 28.19127, 120.45173: 28.19126, 120.45173: 28.19167, etc. And the search gateway can randomly determine coordinate axis information corresponding to the first target field. The search gateway may also determine coordinate axis information corresponding to the first target field in advance. The search gateway can also determine coordinate axis information corresponding to the first target field according to values of different coordinate axes in the first position information. For example, the search gateway may determine coordinate axis information corresponding to the first target field according to a coordinate value corresponding to each coordinate axis in the first location information. The search gateway may determine the values corresponding to different coordinate axes in the first location information, and determine an adjustment manner for the first location information according to the values corresponding to the different coordinate axes. For example, the search gateway may increase the coordinate value corresponding to the coordinate axis with smaller value in the first location information, or decrease the coordinate value corresponding to the coordinate axis with larger value in the first location information, and so on. In the embodiments of the present disclosure, this is not particularly limited.
In a third implementation manner, the search gateway deletes the location information of the second target field in the first location information to obtain the second location information.
The second target field is a field in the preset first location information, for example, the second target field may be a last bit or a last-but-second bit of the first location information. When the first position information is a position coordinate, the first target field may be a field in coordinate information corresponding to any one of the position coordinates, or may be a field in coordinate information corresponding to each coordinate axis in the position coordinates. For example, the first target field is the last bit in the position coordinates, and the first position information is 120.45172: 28.19126, the adjusted second position information may be 120.45172: 28.1912, 120.4517: 28.19126, 120.4517: 28.1916, etc.
In addition, the first target field and the second target field may be the same field or different fields, which is not specifically limited in this embodiment of the disclosure.
It should be noted that, when the search gateway modifies the first location information, the first location information may be modified through any one of the three implementations described above. The search gateway may further modify the first location information in combination with at least two of the three implementations, which is not specifically limited in the embodiment of the present disclosure. For example, when the search gateway modifies the first location information in the first search request, the search gateway may intercept the first location information through the first implementation manner to obtain third location information, then adjust the first target field in the third location information, and/or delete the second target field in the third location information to obtain the second location information. That is, the search gateway intercepts the first location information according to a preset precision to obtain the third location information; and adjusting the position information of the first target field in the third position information to obtain second position information. Or the search gateway intercepts the first position information according to preset accuracy to obtain the third position information; and deleting the position information of the second target field in the third position information to obtain the second position information. Or the search gateway intercepts the first position information according to preset accuracy to obtain the third position information; and adjusting the position information of the first target field in the third position information, and deleting the position information of the second target field in the third position information to obtain second position information.
It should be noted that, when the first location information is the location information that is not intercepted, the search gateway may select at least one implementation manner from the three implementation manners to perform the new policy of degrading latitude and longitude on the first search request. When the first location information is the location information which is intercepted, the search gateway can select at least one implementation mode from the second implementation mode and the third implementation mode to perform a new longitude and latitude degradation strategy on the first search request.
In this implementation manner, the second location information is obtained by modifying the location information in the first search request, so that the accuracy of the location information corresponding to the first search request is reduced, the search gateway can query the first service data corresponding to the first search request from the location information with lower accuracy, and the search gateway can acquire the service data.
Step 405: and the search gateway generates the second search request information according to the second position information and search indication information which is used for indicating a search target in the first search request information.
In this step, the search gateway reconstructs the search request information according to the modified second location information, and obtains second search request information. The search gateway can directly combine the second position information with the search indication information in the first search request information to obtain the second search request information; the search gateway can also perform word segmentation on the search indication information in the first search request information, and perform recombination according to word segmentation results to obtain second search request information.
Accordingly, in a possible implementation manner, the search gateway composes the second search request information from the second location information and the search indication information in the first search request information.
In this implementation manner, the search gateway replaces the first location information in the first search request with the modified second location information to obtain second search request information. For example, the first search request is to search a nearby museum of chuan dish, where the location information carried by the first search request is the first location information, the first search request information corresponding to the first search request is "a museum of chuan dish near the first location information", and after the first location information is modified, the second search request information corresponding to the first search request is "a museum of chu dish near the second location information".
In this embodiment, the second search request information is obtained by recombining the second location information and the search instruction information in the first search request information, and the search gateway can perform search through the modified second search request information, thereby ensuring that the search gateway can obtain the service data.
In another possible implementation manner, the search gateway performs word segmentation on the search instruction information included in the first search request information to obtain a plurality of words, determines a first target word segmentation used for representing fourth position information according to the plurality of words, and combines the fourth position information represented by the first target word segmentation, the second position information, and other words except the first target word segmentation in the plurality of words into the second search request information.
In this implementation manner, the search gateway performs word segmentation processing on the search instruction information to obtain a plurality of words, obtains a first target word including the position information from the plurality of words, and converts the first target word into fourth position information, so that second search request information is formed by the fourth position information, the second position information, and other words. For example, if the search instruction information is "a clothing store near street a", the search instruction information is segmented to obtain two segmentation rate, that is, "street a" and "clothing store", where "street a" is a segmentation that can represent location information, fourth location information corresponding to "street a" is obtained, and then the fourth location information, the second location information, and "clothing store" are combined into second search request information.
Step 406: and the search gateway acquires second service data corresponding to the second search request information from the cache according to the second search request information.
The process of the search gateway querying the second search request from the cached service data according to the second search request information is similar to the process of the search gateway querying the first service data corresponding to the first search request from the cache according to the first search request in step 403, and is not described herein again.
Continuing with fig. 5, the search gateway queries the second search request information from the cached service data according to the second search request information, and when the search gateway queries the second service data corresponding to the second search request information, the second service data corresponding to the second search request information exists in the cache, and the search gateway obtains the second service data, and step 406 is executed. When the search gateway does not inquire second service data corresponding to the second search request information, step 404 is executed, and second location information in the second search request information is modified to obtain third location information; and generating third search request information according to the third location information until third service data corresponding to the third search request information is obtained from a cache according to the third search request information.
It should be noted that, when the second location information in the second search request information is continuously modified, at least one modification manner of the three manners in step 404 may be selected for modification, and when only one modification manner is selected for modification, different modification manners may be used alternately in different modification processes, or the same modification manner may be used, which is not specifically limited in the embodiment of the present disclosure.
Another point to be noted is that, when the search gateway performs word segmentation on the search instruction information included in the first search request information to obtain a plurality of words, determines a first target word segmentation for representing fourth position information according to the plurality of words, and combines the fourth position information represented by the first target word segmentation, the second position information, and other words except for the first target word segmentation in the plurality of words into the second search request information, the search gateway may further perform degradation processing on other search instruction information in the second search request information according to a degradation policy without latitude and longitude.
Step 407: the search gateway returns the second service data to the terminal.
In this step, the search gateway sends the cached second service data to the terminal, and the terminal receives and displays the second service data.
It should be noted that, when the search gateway does not obtain the service data corresponding to the search request from the cached service data, the search gateway may modify the search request repeatedly until the corresponding service data is queried, obtain the service data, and return the service data to the terminal, thereby ensuring the response rate of the search request sent by the terminal. The search gateway can also modify the search request within preset times, and after the preset times are exceeded, the search request is not modified any more, and an error response is directly returned, so that the validity of the service data returned by the search gateway is ensured.
In the embodiment of the disclosure, a first search request sent by a terminal is received, and first search request information corresponding to the first search request is acquired; responding to the first service data which needs to be degraded for the first search request and does not exist in the cache corresponding to the first search request information, modifying the first search request information to obtain second search request information, and enabling the cache to have second service data corresponding to the second search request information; according to the second search request information, second service data corresponding to the second search request information is obtained from the cache; and returning the second service data to the terminal, so that when the first search request is subjected to degradation processing, the search gateway can be ensured to acquire the service data from the cached service data and return the service data to the terminal, thereby ensuring that the search request sent by the terminal can be responded, and improving the response rate of the search request.
Fig. 6 is a flowchart illustrating an information search method according to an exemplary embodiment, which is described by taking an example that a search gateway executes a demotion policy without latitude and longitude, as shown in fig. 6, and the information search method includes the following steps:
step 601: the searching gateway receives a first searching request sent by a terminal, and first searching request information corresponding to the first searching request is obtained.
In this embodiment, the first search request information at least includes search instruction information provided by the terminal for instructing a search target. The first search request information may also include other search assistance information for assisting a search.
This step is similar to step 401 and will not be described herein again.
Step 602: the search gateway determines whether to downgrade the first search request.
This step is similar to step 402 and will not be described herein.
Step 603: and responding to the first search request needing to be subjected to degradation processing, and inquiring first service data corresponding to the first search request from the cache by the search gateway according to the first search request.
This step is similar to step 403 and will not be described herein again.
Step 604: and responding to the first service data which needs to be degraded for the first search request and does not exist in the cache and corresponding to the first search request information, and performing word segmentation processing on search indication information included in the first search request information by the search gateway to obtain a plurality of words.
This step is similar to the process of performing word segmentation processing on the target search instruction information in step 405, and is not described herein again.
Step 605: the search gateway determines at least two second target participles from the plurality of participles according to the weight of each participle.
In this step, the search gateway may determine the weight of each participle according to the information amount carried by different participles, thereby selecting at least two second target participles carrying a large amount of information. For example, if the search instruction information is "clothing store near street a", the multiple participles obtained by performing the participle processing are "street a", "nearby", and "clothing store", and the participles with a large amount of carried information can be determined as "street a" and "clothing store" according to the part of speech and the meaning of the participle, so that "street a" and "clothing store" are used as the second target participle.
Step 606: and the search gateway generates the second search request information according to the at least two second target word segmentation.
In this step, the search gateway may directly combine the at least two target segments into second search request information, and the search gateway may further convert target segments carrying position information in the second target segments to obtain fifth position information, and then combine the second search request information according to the fifth position information and the second target segments.
Correspondingly, in a possible implementation manner, the search gateway splices the at least two second target participles to obtain the second search request information. In another possible implementation manner, the search gateway determines a third target word used for representing the position information from the at least two second target words according to the part of speech of each second target word; and generating the second search request information according to the fifth position information represented by the third target participle and the target participles except the third target participle in the at least two second target participles. In this step, similar to step 405, the process of generating the second search request information according to the fourth location information, the second location information, and the target participles other than the first target participle is not repeated here.
Step 607: and the search gateway acquires second service data corresponding to the second search request information from the cache according to the second search request information.
This step is similar to step 405 and will not be described herein again.
It should be noted that, when the second service data corresponding to the second search request information does not exist in the cached service data, the search gateway may execute step 604 again to modify the second search request information. When the second search request information carries the fifth location information, the search gateway may further modify the fifth location information through at least one of the three implementation manners provided in step 404. And obtaining third search request information according to the modified second search request information until third service data is obtained according to the third search request information.
Step 608: the search gateway returns the second service data to the terminal.
This step is similar to step 406 and will not be described herein.
In the embodiment of the disclosure, a first search request sent by a terminal is received, and first search request information corresponding to the first search request is acquired; responding to the first search request needing to be degraded and first service data corresponding to the first search request information does not exist in the cache, modifying the first search request information to obtain second search request information, and second service data corresponding to the second search request information exists in the cache; according to the second search request information, second service data corresponding to the second search request information are obtained from the cache; and returning the second service data to the terminal, so that when the first search request is subjected to degradation processing, the search gateway can be ensured to acquire the service data from the cached service data and return the service data to the terminal, thereby ensuring that the search request sent by the terminal can be responded, and improving the response rate of the search request.
Fig. 7 is a block diagram illustrating an information search apparatus according to an exemplary embodiment, which includes, as shown in fig. 7:
a receiving module 701, configured to receive a first search request sent by a terminal, and obtain first search request information corresponding to the first search request;
a modifying module 702, configured to modify the first search request information to obtain a second search request in response to that the first search request needs to be degraded and the first service data corresponding to the first search request information does not exist in the cache
An obtaining module 703, configured to obtain, according to the second search request information, second service data corresponding to the second search request information from the cache;
a sending module 704, configured to return the second service data to the terminal.
In a possible implementation manner, the modifying module 702 is further configured to modify, in response to that the first search request information includes first location information, the first location information to obtain second location information; and generating the second search request information according to the second position information and search indication information which is used for indicating a search target in the first search request information.
In another possible implementation manner, the modifying module 702 is further configured to intercept the first location information according to a preset precision to obtain the third location information;
the modifying module 702 is further configured to adjust the location information of the first target field in the third location information, and/or delete the location information of the second target field in the third location information, so as to obtain the second location information.
In another possible implementation manner, the modifying module 702 is further configured to combine the second location information and the search indication information in the first search request information into the second search request information; or,
the modifying module 702 is further configured to perform word segmentation on the search instruction information included in the first search request information to obtain a plurality of words, determine a first target word used for representing fourth position information according to the plurality of words, and form the second search request information by the fourth position information represented by the first target word, the second position information, and other words except the first target word in the plurality of words.
In another possible implementation manner, the modifying module 702 is further configured to perform word segmentation processing on the search instruction information included in the first search request information in response to that the first search request information does not include the first location information, so as to obtain a plurality of words; determining at least two second target participles from the plurality of participles according to the weight of each participle; and generating the second search request information according to the at least two second target participles.
In another possible implementation manner, the modifying module 702 is further configured to combine the at least two second target word segments into the second search request information; or,
the modifying module 702 is further configured to determine, according to the part of speech of each second target participle, a third target participle used for representing the position information from the at least two second target participles; and generating the second search request information according to fifth position information represented by the third target participle and target participles except the third target participle in the at least two second target participles.
In another possible implementation manner, the modifying module 702 is further configured to combine fifth position information indicated by the third target participle and target participles, other than the third target participle, in the at least two second target participles into the second search request information; or,
the modifying module 702 is further configured to modify the fifth location information to obtain sixth location information, and form the second search request information by using the sixth location information and the target participles, except the third target participle, in the at least two second target participles.
In another possible implementation manner, the apparatus further includes:
the first determining module is used for acquiring the current no-result rate of the search server and acquiring the reference no-result rate of the search server; determining the current non-result rate increment according to the current non-result rate and the reference non-result rate; determining that degradation processing needs to be performed on the first search request in response to the non-result rate increment being greater than a preset threshold; or,
the first determining module is further configured to determine that degradation processing needs to be performed on the first search request in response to not receiving a search result returned by the search server within a preset time period.
In another possible implementation manner, the apparatus further includes:
a second determining module for determining a current degraded search rate;
the first determining module is further configured to perform a step of determining that the first search request needs to be demoted in response to the current demotion search rate being less than the no-result-rate increment.
In another possible implementation manner, the obtaining module 703 is further configured to send the second search request information to a cache server, where the cache server is configured to cache service data, and determine, according to the second search request information, second service data corresponding to the second search request information; and receiving the second service data returned by the cache server.
In another possible implementation manner, the receiving module 701 is further configured to decrypt the first search request, obtain first location information and search instruction information corresponding to the first search request, and obtain auxiliary search information corresponding to the first search request according to the first search request; and combining the first position information, the search indication information and the auxiliary search information into first search request information corresponding to the first search request.
In the embodiment of the disclosure, a first search request sent by a terminal is received, and first search request information corresponding to the first search request is acquired; responding to the first search request needing to be degraded and first service data corresponding to the first search request information does not exist in the cache, modifying the first search request information to obtain second search request information, and second service data corresponding to the second search request information exists in the cache; according to the second search request information, second service data corresponding to the second search request information is obtained from the cache; and returning the second service data to the terminal, so that when the first search request is subjected to degradation processing, the search gateway can be ensured to acquire the service data from the cached service data and return the service data to the terminal, thereby ensuring that the search request sent by the terminal can be responded, and improving the response rate of the search request.
It should be noted that: the information searching apparatus provided in the above embodiment is only illustrated by dividing the functional modules in the information search, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the terminal is divided into different functional modules to complete all or part of the functions described above. In addition, the information search apparatus and the information search method provided in the above embodiments belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiments, and are not described herein again.
Fig. 8 is a schematic structural diagram of a server according to an embodiment of the present disclosure, where the search gateway 800 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 801 and one or more memories 802, where the memory 802 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 801 to implement the information search method provided by each method embodiment. Certainly, the search gateway 800 may further include a wired or wireless network interface, a keyboard, an input/output interface, and other components to facilitate input and output, and the search gateway 800 may further include other components for implementing the functions of the device, which are not described herein again.
In an exemplary embodiment, a computer-readable storage medium is further provided, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a server to implement the information search method in the above-described embodiment. The computer readable storage medium may be a memory. For example, the computer-readable storage medium may be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by hardware related to instructions of a program, and the program may be stored in a computer readable storage medium, where the above mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk.
The above disclosure is intended to cover all alternative embodiments of the disclosure, and not to limit the disclosure, and all such modifications, equivalents, improvements, etc. that fall within the spirit and scope of the disclosure are intended to be included therein.

Claims (14)

1. An information search method, the method comprising:
receiving a first search request sent by a terminal, and acquiring first search request information corresponding to the first search request;
determining that degradation processing needs to be performed on the first search request in response to the accuracy requirement of the first search request on service data being lower than a target accuracy requirement;
responding to the first search request needing to be subjected to degradation processing and first service data corresponding to the first search request information does not exist in a cache, modifying the first search request information to obtain second search request information, wherein second service data corresponding to the second search request information exists in the cache, and the precision of the second service data is lower than that of the first service data;
according to the second search request information, second service data corresponding to the second search request information are obtained from the cache;
and returning the second service data to the terminal.
2. The method of claim 1, wherein modifying the first search request information to obtain second search request information comprises:
responding to the first search request information including first position information, and modifying the first position information to obtain second position information;
and generating the second search request information according to the second position information and search indication information which is used for indicating a search target in the first search request information.
3. The method of claim 2, wherein modifying the first location information to obtain second location information comprises:
intercepting the first position information according to preset accuracy to obtain third position information;
and adjusting the position information of the first target field in the third position information, and/or deleting the position information of the second target field in the third position information to obtain the second position information.
4. The method according to claim 2, wherein the generating the second search request information according to the second location information and search indication information indicating a search target in the first search request information comprises:
composing the second search request information by the second position information and search indication information in the first search request information; or,
performing word segmentation processing on search indication information included in the first search request information to obtain a plurality of words, determining a first target word segmentation used for representing fourth position information according to the plurality of words, and forming the fourth position information represented by the first target word segmentation, the second position information and other words in the plurality of words except the first target word segmentation into second search request information.
5. The method of claim 1, wherein the modifying the first search request information to obtain second search request information comprises:
responding to the first search request information without first position information, and performing word segmentation processing on search indication information included in the first search request information to obtain a plurality of words;
determining at least two second target participles from the multiple participles according to the weight of each participle;
and generating the second search request information according to the at least two second target word segmentation.
6. The method of claim 5, wherein generating the second search request information according to the at least two second target participles comprises:
composing the at least two second target participles into the second search request information; or,
determining a third target participle for representing position information from the at least two second target participles according to the part of speech of each second target participle; and generating the second search request information according to fifth position information represented by the third target participle and target participles except the third target participle in the at least two second target participles.
7. The method according to claim 6, wherein the generating the second search request information according to the fifth position information represented by the third target participle and the target participle of the at least two second target participles except for the third target participle comprises:
forming second search request information by using fifth position information represented by the third target participle and target participles except for the third target participle in the at least two second target participles; or,
and modifying the fifth position information to obtain sixth position information, and combining the sixth position information and the target participles except the third target participle in the at least two second target participles to form the second search request information.
8. The method of claim 1, further comprising:
acquiring the current no-result rate of a search server, and acquiring the reference no-result rate of the search server; determining the current no-result rate increment according to the current no-result rate and the reference no-result rate; determining that degradation processing needs to be performed on the first search request in response to the non-result rate increment being larger than a preset threshold; or,
and determining that degradation processing needs to be carried out on the first search request in response to the fact that a search result returned by the search server is not received within a preset time length.
9. The method of claim 8, wherein prior to determining that demotion processing is required for the first search request, the method further comprises:
determining a current degraded search rate;
responsive to the current destage search rate being less than the no result rate increment, performing a step of determining that destage processing is required for the first search request.
10. The method according to any one of claims 1 to 9, wherein the obtaining, according to the second search request information, second service data corresponding to the second search request information from the cache includes:
sending the second search request information to a cache server, wherein the cache server is used for caching service data, and determining second service data corresponding to the second search request information according to the second search request information;
and receiving the second service data returned by the cache server.
11. The method according to claim 1, wherein the obtaining first search request information corresponding to the first search request includes:
decrypting the first search request to obtain first position information and search indication information corresponding to the first search request, and acquiring auxiliary search information corresponding to the first search request according to the first search request;
and the first position information, the search indication information and the auxiliary search information form first search request information corresponding to the first search request.
12. An information search apparatus, characterized in that the apparatus comprises:
the receiving module is used for receiving a first search request sent by a terminal and acquiring first search request information corresponding to the first search request;
the modification module is used for responding to the fact that the precision requirement of the first search request on service data is lower than a target precision requirement, and determining that the first search request needs to be subjected to degradation processing; responding to the first search request needing to be subjected to degradation processing and first service data corresponding to the first search request information does not exist in a cache, modifying the first search request information to obtain second search request information, wherein second service data corresponding to the second search request information exists in the cache, and the precision of the second service data is lower than that of the first service data;
the obtaining module is used for obtaining second service data corresponding to the second search request information from the cache according to the second search request information;
and the sending module is used for returning the second service data to the terminal.
13. A search gateway, comprising one or more processors and one or more memories having stored therein at least one instruction, the at least one instruction being loaded and executed by the one or more processors to perform operations performed by the information search method of any one of claims 1 to 11.
14. A non-transitory computer-readable storage medium, wherein at least one instruction is stored therein, and the at least one instruction is loaded and executed by a processor to perform operations performed by the information search method of any one of claims 1 to 11.
CN202010456593.8A 2020-05-26 2020-05-26 Information searching method, device, searching gateway and storage medium Active CN111680210B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010456593.8A CN111680210B (en) 2020-05-26 2020-05-26 Information searching method, device, searching gateway and storage medium
PCT/CN2021/090344 WO2021238555A1 (en) 2020-05-26 2021-04-27 Information search

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010456593.8A CN111680210B (en) 2020-05-26 2020-05-26 Information searching method, device, searching gateway and storage medium

Publications (2)

Publication Number Publication Date
CN111680210A CN111680210A (en) 2020-09-18
CN111680210B true CN111680210B (en) 2022-07-15

Family

ID=72434856

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010456593.8A Active CN111680210B (en) 2020-05-26 2020-05-26 Information searching method, device, searching gateway and storage medium

Country Status (2)

Country Link
CN (1) CN111680210B (en)
WO (1) WO2021238555A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111680210B (en) * 2020-05-26 2022-07-15 北京三快在线科技有限公司 Information searching method, device, searching gateway and storage medium
CN112131455B (en) * 2020-09-28 2021-09-17 贝壳找房(北京)科技有限公司 List page retrieval degradation method and device, electronic equipment and storage medium
CN114996557B (en) * 2021-11-30 2023-04-18 百度在线网络技术(北京)有限公司 Service stability determination method, device, equipment and storage medium

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102446186B (en) * 2010-10-13 2016-03-30 上海众恒信息产业股份有限公司 Chinese geocoding and coding/decoding method and device
CN102479207B (en) * 2010-11-29 2013-07-03 阿里巴巴集团控股有限公司 Information search method, system and device
CN103425659B (en) * 2012-05-15 2017-06-09 阿里巴巴集团控股有限公司 Information search method and server based on geographical position
US20150149433A1 (en) * 2013-11-26 2015-05-28 Resultly, LLC. System, device, and method for searching network data
CN104881497A (en) * 2015-06-17 2015-09-02 郑州悉知信息技术有限公司 Searching method and client
US10120951B2 (en) * 2015-08-12 2018-11-06 Samsung Electronics Co., Ltd. Bifurcated search
CN107291864B (en) * 2017-06-12 2020-04-07 北京三快在线科技有限公司 Searching method and device and electronic equipment
US11294911B2 (en) * 2017-09-29 2022-04-05 Apple Inc. Methods and systems for client side search ranking improvements
CN108090153B (en) * 2017-12-11 2020-04-14 深圳云天励飞技术有限公司 Searching method, searching device, electronic equipment and storage medium
CN109145020A (en) * 2018-07-23 2019-01-04 程之琴 Information query method, from server, client and computer readable storage medium
CN111680210B (en) * 2020-05-26 2022-07-15 北京三快在线科技有限公司 Information searching method, device, searching gateway and storage medium

Also Published As

Publication number Publication date
CN111680210A (en) 2020-09-18
WO2021238555A1 (en) 2021-12-02

Similar Documents

Publication Publication Date Title
CN111680210B (en) Information searching method, device, searching gateway and storage medium
US11012892B2 (en) Resource obtaining method, apparatus, and system
WO2017167050A1 (en) Configuration information generation and transmission method, and resource loading method, apparatus and system
US20140298313A1 (en) Method, server, client and system for updating data
US8954524B1 (en) Access to network content
CN110532259B (en) Base table query method, device, computer equipment and storage medium
CN108009205B (en) Search result caching method based on position, search method, client and system
US11050550B2 (en) Methods and systems for reading data based on plurality of blockchain networks
US20210157801A1 (en) Methods and systems for recording data based on plurality of blockchain networks
US20210158353A1 (en) Methods, systems, apparatuses, and devices for processing request in consortium blockchain
WO2019100853A1 (en) Page query method, device, and electronic apparatus
CN111767297B (en) Big data processing method, device, equipment and medium
US11042357B2 (en) Server and method for ranking data sources
CN112199175B (en) Task queue generating method, device and equipment
US20150220648A1 (en) Systems and Methods for Performing Machine-Implemented Tasks
WO2020222840A1 (en) Privacy preserving data collection and analysis
US10147126B2 (en) Machine to generate a self-updating message
WO2017088293A1 (en) Method and device for providing access information of wireless access point
CN107220260A (en) The method and device that a kind of page is shown
US20220075786A1 (en) Dynamic database query processing
CN111651425A (en) Data extraction method and device for data mart, terminal and storage medium
US11086849B2 (en) Methods and systems for reading data based on plurality of blockchain networks
CN114490719A (en) Data query method and device, electronic equipment and storage medium
CN114938668A (en) Secure management of data distribution limits
EP3968174A1 (en) Dynamic database query processing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant