Nothing Special   »   [go: up one dir, main page]

WO2021238555A1 - Information search - Google Patents

Information search Download PDF

Info

Publication number
WO2021238555A1
WO2021238555A1 PCT/CN2021/090344 CN2021090344W WO2021238555A1 WO 2021238555 A1 WO2021238555 A1 WO 2021238555A1 CN 2021090344 W CN2021090344 W CN 2021090344W WO 2021238555 A1 WO2021238555 A1 WO 2021238555A1
Authority
WO
WIPO (PCT)
Prior art keywords
search
search request
information
request information
service data
Prior art date
Application number
PCT/CN2021/090344
Other languages
French (fr)
Chinese (zh)
Inventor
金铮
刘玉莲
张河昌
闫方戈
张弓
Original Assignee
北京三快在线科技有限公司
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 北京三快在线科技有限公司 filed Critical 北京三快在线科技有限公司
Publication of WO2021238555A1 publication Critical patent/WO2021238555A1/en

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

Definitions

  • the embodiments of the present disclosure relate to the field of Internet technology, and in particular to an information search.
  • the terminal sends a search request to the search gateway, sends the search request to the search server through the search gateway, the search server searches according to the search request, and then feeds back the search results to the terminal through the search gateway.
  • the embodiments of the present disclosure provide an information search, which improves the response rate of search requests.
  • the technical scheme is as follows:
  • an information search method includes:
  • the first search request information is modified to obtain the second search request information,
  • the second service data corresponding to the second search request information exists in the cache;
  • an information search device in another aspect, and the device includes:
  • a receiving module configured to receive a first search request sent by a terminal, and obtain first search request information corresponding to the first search request;
  • the modification module is configured to modify the first search request information in response to the need to downgrade the first search request and the first service data corresponding to the first search request information does not exist in the cache to obtain the first search request information.
  • An obtaining module configured to obtain second service data corresponding to the second search request information from the cache according to the second search request information
  • the sending module is configured to return the second service data to the terminal.
  • a search gateway in another aspect, includes one or more processors and one or more memories, and at least one instruction is stored in the one or more memories.
  • the one or more processors are loaded and executed to implement the operations performed by the information search method described in the method embodiment of the embodiment of the present disclosure.
  • a non-transitory computer-readable storage medium stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the method embodiment as the embodiment of the present disclosure The operations performed by the information search method described in.
  • the first search request sent by the terminal is received, and the first search request information corresponding to the first search request is obtained; in response to the need to downgrade the first search request and the first search request information does not exist in the cache
  • modify the first search request information to obtain the second search request information, and the second service data corresponding to the second search request information exists in the cache; according to the second search request information, the first search request information is obtained from the cache.
  • the second service data corresponding to the search request information is returned to the terminal, so that when the first search request is downgraded, the search gateway can ensure that the search gateway obtains the service data from the cached service data and returns it to the terminal, Therefore, it is ensured that the search request sent by the terminal can be responded to, and the response rate of the search request is improved.
  • Fig. 1 is a system architecture diagram involved in an information search method according to an exemplary embodiment
  • Fig. 2 is a flow chart showing an information search method according to an exemplary embodiment
  • Fig. 3 is a flow chart showing an information search method according to an exemplary embodiment
  • Fig. 4 is a flow chart showing an information search method according to an exemplary embodiment
  • Fig. 5 is a flow chart showing an information search method according to an exemplary embodiment
  • Fig. 6 is a flow chart showing an information search method according to an exemplary embodiment
  • Fig. 7 is a block diagram showing an information search device according to an exemplary embodiment
  • Fig. 8 is a schematic structural diagram showing a search gateway according to an exemplary embodiment.
  • the load of the search server is getting heavier, causing a large number of terminals to access the search server during the same period of time, resulting in slower processing speed of the search server or even downtime, causing the terminal to fail to obtain search results in time , Resulting in lower search efficiency.
  • the search gateway often reduces the load on the search server by downgrading the search request.
  • the commonly used downgrade processing method is to abandon the search request when the search gateway determines that the downgrade processing is needed, that is, when the downgrade processing is required, the search request is no longer sent to the search server.
  • the search gateway caches part of the core data of the search server locally, and when downgrading processing is required, the search gateway obtains the search result from the local cache and returns it to the client.
  • Fig. 1 is a system architecture diagram involved in an information search method according to an exemplary embodiment.
  • 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 conduct data interaction through a network connection, and the search gateway 102 and the search server 103 conduct data interaction through a network connection.
  • the terminal 101 may run an application program for searching, and the application program may be an application program with an information search function such as a browser or an Internet transaction platform. Users can search for information through this application.
  • the terminal 101 receives a search instruction triggered by the user, it generates a first search request according to the search instruction, and sends the first search request to the search gateway 102.
  • the search gateway 102 forwards the first search request to the search server 103, and the search server 103 searches for the service data corresponding to the first search request according to a preset search algorithm, and returns the searched service data to The search gateway 102 returns the service data to the terminal 101 by the search gateway 102.
  • the search gateway 102 obtains the service data corresponding to the first search request from the cache according to the first search request, and then returns the service data to the terminal 101.
  • the application program may be an Internet trading platform, and the display interface of the application program displays a search bar, and the user can input the first search request information corresponding to the search target into the search bar.
  • the user's search target may be a restaurant in a certain place
  • the first search request information input by the user may be "a restaurant in area A”.
  • the terminal 101 generates a first search request according to the first search request information, and sends the first search request to the search gateway 102.
  • the search gateway 102 obtains the service data corresponding to the first search request.
  • the service data corresponding to the first search request may be data such as the name, location, and relevant user comments of the restaurant in place A.
  • the system architecture further includes a cache server in which service data is cached.
  • the search gateway 102 may directly obtain the service data cached in the cache server from the cache server, and send the service data to the terminal 101.
  • the terminal 101 may be a mobile phone, a computer, a tablet computer, a wearable device, or the like.
  • Both the search server 103 and the cache server may be independent physical servers, may also be a server cluster composed of multiple physical servers, or may also be cloud servers.
  • the search gateway 102 can be any network connector or protocol converter that can perform protocol conversion, which is not specifically limited in the embodiments of the present disclosure.
  • Fig. 2 is a flow chart showing an information search method according to an exemplary embodiment. As shown in Fig. 2, the information search method includes the following steps:
  • Step 201 Receive a first search request sent by a terminal, and obtain first search request information corresponding to the first search request.
  • Step 202 In response to the need to downgrade the first search request and the first service data corresponding to the first search request information does not exist in the cache, modify the first search request information to obtain second search request information, The second service data corresponding to the second search request information exists in the cache.
  • Step 203 Obtain the second service data corresponding to the second search request information from the cache according to the second search request information.
  • Step 204 Return the second service data to the terminal.
  • the first search request sent by the terminal is received, and the first search request information corresponding to the first search request is obtained; in response to the need to downgrade the first search request and the cache is There is no first service data corresponding to the first search request information, the first search request information is modified to obtain the second search request information, and the second service data corresponding to the second search request information exists in the cache; according to the second search request Information, the second service data corresponding to the second search request information is obtained from the cache; the second service data is returned to the terminal, so that when the first search request is downgraded, the search gateway can ensure that the search gateway obtains the cached service data The service data is returned to the terminal, thereby ensuring that the search request sent by the terminal can be responded to, and improving the response rate of the search request.
  • the terminal sends the first search request to the search gateway, and the search gateway determines whether the first search request needs to be downgraded.
  • the search gateway determines the downgrade strategy corresponding to the first search request according to the first search request information included in the first search request.
  • the search gateway performs a downgrade strategy with the longitude and latitude on the first search request according to the first location information.
  • the search gateway performs a downgrade strategy for the first search request without latitude and longitude according to the search indication information contained in the first search request information.
  • Fig. 4 is a flowchart of an information search method according to an exemplary embodiment. This embodiment takes the search gateway to execute a downgrade strategy with latitude and longitude as an example for description. As shown in Fig. 4, the information search method includes the following steps:
  • Step 401 The search gateway receives the first search request sent by the terminal, and obtains the first search request information corresponding to the first search request.
  • the first search request information includes at least first location information and search indication information.
  • the first location information is location information provided by the terminal;
  • the search instruction information is instruction information used to indicate a search target.
  • the first search request information may also include other auxiliary search information used to assist the search.
  • the first search request information includes first location information and search indication information; and, the first search request carries first location information and search indication information.
  • the process for the search gateway to obtain the first location information and the search indication information may be: the search gateway obtains 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.
  • the process for the search gateway to obtain the first location information and the search indication information may be: the search gateway decrypts the first search request to obtain the first location information and the search indication information.
  • the terminal when the first search request carries the encrypted first location information and the encrypted search indication information, before the terminal sends the first search request to the search gateway, the terminal encrypts the first location information and the search indication information, and encrypts the encrypted first location information and search indication information.
  • the first location information and the encrypted search instruction information are added to the first search request.
  • the encryption method of the terminal corresponds to the decryption method of the search gateway.
  • the terminal and the search gateway agree on an encryption and decryption method in advance, the terminal encrypts the first search request information according to the preset encryption method, and the search gateway decrypts the first search request according to the decryption method agreed in advance.
  • the preset encryption method is a previously agreed encryption method.
  • decryption processing is performed through the first search request to obtain the first location information and search indication information corresponding to the first search request, thereby increasing the security of the first search request.
  • the first search request information also includes auxiliary search information; correspondingly, the process for the search gateway to obtain the auxiliary search information may be: the search gateway calls the external server according to the first search request; The auxiliary information corresponding to the first search request is obtained from the external server.
  • the auxiliary search information may include source information of the first search request.
  • the auxiliary search information may be the cityid of the first search request, and the cityid corresponding to the first search request is obtained by calling the cityid gateway server.
  • the process for the terminal to obtain the first search request information may be: decrypting the first search request to obtain the first location information corresponding to the first search request And search indication information, and, according to the first search request, the auxiliary search information corresponding to the first search request is obtained; the first location information, the search indication information, and the auxiliary search information form the first search request corresponding to the first search request.
  • a search request information may be: decrypting the first search request to obtain the first location information corresponding to the first search request And search indication information, and, according to the first search request, the auxiliary search information corresponding to the first search request is obtained; the first location information, the search indication information, and the auxiliary search information form the first search request corresponding to the first search request.
  • the first location information may be the location information of the geographic location where the terminal is located when the first search request is sent.
  • the terminal locates the current geographic location, determines the current location coordinates, and adds the location coordinates to The first search request.
  • the terminal may perform positioning through the positioning system provided by the terminal, and determine the position coordinates obtained by positioning as the first position information.
  • the first location information may also be location information selected or input by the user received by the terminal.
  • 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. Requesting. For example, if the position information input by the user is "A street B intersection", the terminal converts the position information into position coordinates corresponding to "A street B intersection", and uses the position coordinates as the first position information.
  • the search gateway may first decrypt the first search request and then obtain the auxiliary search information corresponding to the first search request; the search gateway may also first obtain the auxiliary search information corresponding to the first search request before making the first search request Perform decryption processing; the search gateway can also obtain the auxiliary search request corresponding to the first search request and decrypt the first search request at the same time.
  • Step 402 The search gateway determines whether to perform downgrade processing on the first search request.
  • the search gateway determines whether the first search request needs to be downgraded.
  • the search gateway may determine whether to downgrade the first search request according to the state of the search server.
  • the search gateway can determine whether to downgrade the first search request in the following three ways. In the first implementation mode, the search gateway can select eligible search requests for downgrade processing when downgrading the search request. In the second implementation manner, the search gateway can determine whether to downgrade the first search request according to the non-result rate of the search server; in the third implementation manner, the search gateway can also, when it does not receive the service data returned by the search server, It is determined that the first search request needs to be downgraded.
  • the search gateway can select search requests that meet the conditions for downgrade processing when downgrading the search request.
  • the condition may be that the hash value of the first search request satisfies the requirement of an increase in the non-result rate.
  • the search gateway can obtain the hash value corresponding to the first search request by performing a hash calculation on the unique identifier of the first search request, and perform the remainder calculation on the hash value corresponding to the first search request, and take The value after the remainder is differentiated, so that the first search request whose percentage value after the remainder is less than the increase in the rate of no results is selected for downgrading.
  • the method for the search gateway to determine the search request that meets the conditions according to the unique identifier of the first search request can be expressed by Formula 1.
  • queryid represents the unique identifier of the first search request
  • hash(queryid) represents the hash value of the unique identifier of the first search request obtained by hashing 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 of the hash value of the unique identifier of the first search request after the remainder.
  • the first search request that can be downgraded is selected through the hash value of the first search request, thereby preventing all first search requests from being downgraded, and the search server cannot receive the first search request during normal operation.
  • One search request ensures that the number of degraded first search requests is reasonable, so that the first search request is automatically degraded.
  • the search gateway determines whether to downgrade the first search request according to the predetermined working status of the search server.
  • the search gateway determines whether the first search request needs to be downgraded according to the non-result rate. This process can be achieved through the following steps (A1)-(A4), including:
  • the search gateway obtains the current non-result rate of the search server.
  • the search gateway counts the number of search requests sent to the search server within the first specified time period, and counts the number of search requests that receive empty data in these search requests, and compares the number of search requests that receive empty data with the number of search requests sent The ratio of the total number is determined as the current non-result rate of the search server.
  • the empty data may be a response returned by the search server that does not include the service data corresponding to the first search request, or it may be that the search gateway has not received the service data returned by the search server.
  • the first designated duration can be set as required, and in the embodiment of the present disclosure, the first designated duration is not specifically limited. For example, the first designated duration may be 10s, 15s, 20s, etc.
  • the reason why the search gateway receives empty data may be that the number of search requests processed by the search server exceeds the preset threshold, so that the search server responds to the search request sent by the search gateway for longer than the second specified time period; or the search server is down , Program bugs (vulnerabilities) and other exceptions.
  • the types of problems generated by the search server are not specifically limited.
  • the second designated duration is less than the first designated duration, and the second designated duration can be set as required, which is not specifically limited in the embodiments of the present disclosure.
  • the search gateway obtains the benchmark non-result rate of the search server.
  • the reference non-result rate can be determined according to the non-result rate of the search server in different designated time periods.
  • the specified time period may be within a time period of 10 minutes, 1 hour, 1 day, or 1 week, etc.
  • the reference non-result rate of the search server is determined through the non-result rate determination model.
  • the non-result rate determination model may be a linear model. In the embodiment of the present disclosure, the non-result rate determination model is not specifically limited.
  • the reference non-result rate may be determined by the search gateway itself. Accordingly, the search gateway determines the reference non-result rate every third specified time period, and the search gateway determines the reference non-result rate. It can be: the search gateway determines the benchmark non-result rate of the search server through the above-mentioned non-result rate determination model; stores the benchmark non-result rate locally, and the search gateway obtains the benchmark non-result rate from the local storage every third specified period of time .
  • the reference non-result rate may be determined by other electronic devices, the process of determining the reference non-result rate of the search server by other electronic devices, and the process of determining the reference non-result rate of the search server by the search gateway It is similar, so I won't repeat it here.
  • the search gateway when it needs to obtain the reference non-result rate of the search server, it may send a non-result rate obtaining request to other electronic devices, and the non-result rate obtaining request carries at least the gateway identification of the search gateway and the server identification of the search server;
  • the non-result rate obtaining request carries at least the gateway identification of the search gateway and the server identification of the search server;
  • other electronic devices receive the request for obtaining no result rate, they obtain the reference no result rate of the search server according to the server ID of the search server, and send the reference no result rate to the search gateway according to the gateway ID of the search gateway, and search The gateway receives the reference non-result rate of the search server sent by other electronic devices.
  • the search gateway can first obtain the current non-result rate of the search server, and then obtain the reference non-result rate of the search server; the search gateway can also first obtain the reference non-result rate of the search server and then obtain the current non-result rate of the search server.
  • Result rate The search gateway can also obtain the current non-result rate and the 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 can perform step (A1) and then step (A2), the search gateway can also perform step (A2) and then step (A1), and the search gateway can also perform steps (A1) and (A2) at the same time. .
  • the order in which steps (A1) and (A2) are executed by the search gateway is not specifically limited.
  • the search gateway determines the current non-result rate increment based on the current non-result rate and the benchmark non-result rate.
  • the search gateway determines that the first search request needs to be downgraded.
  • the search gateway may directly determine that the first search request is a search request that needs to be degraded when the increase in the non-result rate is greater than the preset threshold.
  • the search gateway may also determine whether to degrade the current search request in combination with the current degradation rate, and determine whether the first search request is a search request that needs to be degraded based on the current degradation rate.
  • the search gateway determines the current degraded search rate; in response to the current degraded search rate being less than the ineffective rate increment, the search gateway executes step (A4).
  • the current degraded search rate may be determined according to the number of degraded search requests in the current time period and the total number of search requests in the current time period.
  • the search gateway can automatically stop downgrading the search request to automatically resume the search.
  • the search gateway determines whether to downgrade the first search request according to the current working status of the search server, so that the search gateway can determine the current working status of the search server and determine whether to make the first search request Perform downgrade processing, so as to automatically downgrade the first search request according to the working status of the search server, so as to prevent the search server from working abnormally, you can downgrade the first search request to obtain the service data corresponding to the search request, and prevent The terminal cannot obtain the service data, which affects the user experience.
  • the search gateway can send the first search request to the search server. If the service data returned by the search server is not received within the first preset time period, it is determined that the first search request is required Perform downgrade processing. The process may be: in response to not receiving the search result returned by the search server within the first preset time period, the search gateway determines that the first search request needs to be downgraded.
  • the search gateway when the search gateway receives the first search request, it can first directly send the first search request to the search server. When the service data returned by the search server is not received within the first preset time period, it is determined The first search request needs to be degraded; the search gateway may also perform steps (A1)-(A3) first when receiving the first search request, and in response to the increase in the rate of no results being not greater than the preset threshold, the search The server sends the first search request, and when the service data returned by the search server is not received within the first preset time period, it is determined that the first search request needs to be downgraded.
  • the search gateway determines whether the search request needs to be downgraded according to whether the service data returned by the search server is received within the first preset time period, so that the search gateway can, when the search server cannot return the service data in time, The first search request is degraded to ensure that the terminal can obtain the service data corresponding to the first search request, thereby ensuring user experience.
  • the search gateway may also determine whether to perform downgrade processing on the first search request according to the accuracy requirements of the first search request for the service data.
  • the search gateway may determine the accuracy requirements of the first search request for the service data.
  • the first search request is degraded.
  • no downgrade processing is performed on the first search request.
  • the first search request may carry indication information used to indicate 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.
  • the indication information of the first search request indicates that the accuracy requirement type of the first search request is a regular type, it is determined that the first search request can be processed. Downgrade processing.
  • the indication information of the first search request indicates that the accuracy requirement type of the first search request is a high-precision type, and it is determined that the first search request cannot be downgraded.
  • the search gateway may determine the accuracy requirement type of the first search request before determining whether to downgrade the first search request, and the search gateway may also determine that the first search request needs to be downgraded.
  • the accuracy requirement type of the first search request is determined, which is not specifically limited in the embodiment of the present disclosure.
  • the accuracy requirement of the first search request on the service data is used to determine whether to downgrade the first search request, thereby ensuring that the first search request with high accuracy requirements may not be downgraded, thereby ensuring that the first search request High-precision service data can be obtained.
  • Step 403 In response to the need to perform downgrade processing on the first search request, the search gateway queries the cache for the first service data corresponding to the first search request according to the first search request.
  • the search gateway queries the cache for the first service data corresponding to the first search request according to the first search request.
  • the search gateway may match the cached service data according to the search value corresponding to the first search request, so as to query the first service data corresponding to the first search request.
  • the cache can store multiple service data and the corresponding relationship between the service data and the search value.
  • the search gateway obtains the service data from the cache, it can query the corresponding relationship between the service data and the search value according to the search value.
  • the first service data corresponding to the first search request when the first search request needs to be downgraded, the search gateway queries the cache for the first service data corresponding to the first search request according to the first search request.
  • the search gateway may match the cached service data according to the search value corresponding to the first search request, so as to query the first service data corresponding to the first search request.
  • the cache can store multiple service data and the corresponding relationship between the service data and the search value.
  • the search gateway in response to the search gateway querying the service data corresponding to the search value of the first search request from the cache, the service data is returned to the terminal as the first service data; Upon searching for service data corresponding to the request, the search gateway executes step 404.
  • the search value may be determined according to the first search request information carried in the first search request, and the first search request information may include information such as keywords corresponding to the first search request, city information, search type, and sorting method selected by the user. .
  • the search server converts the first search request information into a search value according to the search value algorithm.
  • the search server can directly convert the first search request information into a numerical value to obtain the search value corresponding to the first search request; in another possible implementation, the search server can first determine the first The weights of different information in the search request information are added to the information in the first search request information according to the weights to obtain the search value corresponding to the first search request.
  • the cached service data may be core data obtained by the search gateway from the search server in advance, and the cached service data may also be the service data returned by the search server received when the search gateway performs the search service.
  • the search server when the search server returns the service data, it also returns the search value corresponding to the service data, and the search gateway stores the service data and the search value correspondingly.
  • the cache may be a local cache of the search gateway, and the cache may also be a cache in a cache server called by the search gateway.
  • the search gateway directly invokes the local cache, and queries the first service data corresponding to the first search request from the current cache according to the search value corresponding to the first search request.
  • the search gateway caches the service data locally, not only can downgrade the first search request when the search server fails, and query the first service data corresponding to the first search request from the local cache, but also This prevents the search gateway from querying the first service data corresponding to the first search request from the local cache when the connection between the search gateway and the external network fails, thereby ensuring that the search gateway can also query the first search request when the network is abnormal The corresponding first service data.
  • the search gateway calls a cache server to query the first service data corresponding to the first search request from the cache server.
  • the process of the search gateway querying the cache for the first service data corresponding to the first search request according to the first search request can be implemented through the following steps (1)-(6), including:
  • the search gateway can implement the server interface of the storage cache server, exchange data with the cache server through the server interface of the cache server, and send the first search request to the cache server.
  • the cache server receives the first search request.
  • the cache server receives the first search request through the server interface.
  • the cache server queries the cached service data for the first service data corresponding to the first search request according to the first search request.
  • the cache server queries the cached service data for the first service data corresponding to the first search request according to the search value corresponding to the first search request.
  • the search value of the first search request can be determined by the search gateway.
  • the search gateway can directly send the search value corresponding to the first search request to the cache server.
  • the cache The server directly queries the locally cached service data for the first service data of the first search request according to the search value corresponding to the first search request.
  • the search value of the first search request may also be determined by the cache server.
  • the cache server determines the search value corresponding to the first search request according to the first search request, and according to the search value corresponding to the first search request Query the first service data corresponding to the first search request from the cached service data.
  • the process for the cache server to determine the search value corresponding to the first search request is similar to the process for the search gateway to determine the search value corresponding to the first search request, and will not be repeated here.
  • the search gateway executes step 404.
  • the cache server may not send a response corresponding to the first search request to the search gateway, and the search gateway sets the second preset If the response from the cache server is received within the 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 executes step 404. Or, in response to the cache server not querying 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, and the target response is used to indicate that the first service data does not exist in the cache server. If the first service data corresponding to the search request is searched, 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 executes step 404.
  • the cache server In response to the presence of the first service data corresponding to the first search request in the cache server, the cache server sends the first service data to the search gateway.
  • the search gateway receives the first service data returned by the cache server.
  • 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.
  • the cached service data is cached in a cache server outside the search gateway, thereby ensuring sufficient cache space, ensuring that a large amount of service data available for search can be cached in the cache, thereby ensuring that the search service can proceed smoothly .
  • the process of the cache server caching service data is similar to the process of searching the gateway cache service data, and will not be repeated here.
  • the search gateway when it receives the first search request, it can 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 location information in the first search request according to a preset accuracy when receiving the first search request, and query the cache for the first location information corresponding to the first search request according to the intercepted first location information.
  • the first service data In the embodiments of the present disclosure, this is not specifically limited.
  • Step 404 In response to the need to perform downgrade processing on the first search request 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.
  • the search gateway In response to the first location information being carried in the first search request, the search gateway performs downgrade processing on the first search request through a dimensional downgrade strategy.
  • the first location information is the first location information carried in the first search request.
  • the search gateway can modify the first location information in the following three ways to obtain the second location information.
  • the first implementation is to intercept the first location information according to the preset accuracy; the second implementation is to adjust the location information of the first target field; the third implementation is to delete the location of the second target field information.
  • the search gateway intercepts the first location information according to the preset accuracy to obtain the second location information.
  • the search gateway intercepts the number of digits corresponding to the preset accuracy in the first location information according to the preset accuracy to obtain the second location information.
  • the preset precision may be a preset precision value, or may be a precision value determined according to a preset precision determination method.
  • the user can pre-set the precision value corresponding to the preset precision to 5 decimal places, and then when the search gateway intercepts any first position information, it will intercept the 5 decimal places of the first position information.
  • the preset accuracy is an accuracy value determined according to a preset accuracy determination method, and the preset accuracy determination method may be to determine an accuracy value corresponding to the preset accuracy according to the original decimal places of the first position information.
  • the search gateway can choose to intercept 80% of the decimal places of the first location information, and when the first location information has 10 decimal places, the search gateway can intercept the eighth decimal place of the first location information.
  • 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 first location information, and the first target field is a preset field.
  • the first target field may be a field such as the last bit or the penultimate bit of the first position information.
  • the first target field may be a field in the coordinate information corresponding to any coordinate axis in the position coordinate, or may be a field in the coordinate information corresponding to each coordinate axis in the position coordinate.
  • the first target field is the last position in the position coordinates
  • 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.
  • the search gateway may randomly determine the coordinate axis information corresponding to the first target field.
  • the search gateway may also determine in advance the coordinate axis information corresponding to the first target field.
  • the search gateway may also determine the coordinate axis information corresponding to the first target field according to the values of different coordinate axes in the first location information. For example, the search gateway may determine the coordinate axis information corresponding to the first target field according to the coordinate value corresponding to each coordinate axis in the first location information. The search gateway may determine the magnitude of the values corresponding to different coordinate axes in the first location information, and determine the adjustment method for the first location information according to the magnitude of the values corresponding to the different coordinate axes. For example, the search gateway may increase the coordinate value corresponding to a coordinate axis with a smaller value in the first location information, or decrease the coordinate value corresponding to a coordinate axis with a larger data in the first location information, and so on. In the embodiments of the present disclosure, this is not specifically limited.
  • 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.
  • the second target field may be a field such as the last bit or the penultimate bit of the first location information.
  • the first target field may be a field in the coordinate information corresponding to any coordinate axis in the position coordinates, or may be a field in the coordinate information corresponding to each coordinate axis in the position coordinates.
  • the first target field is the last position in the position coordinates, and the first position information is 120.45172:28.19126, and the adjusted second position information may be 120.45172:28.1912, 120.4517:28.19126, 120.4517:28.1916, etc.
  • first target field and the second target field may be the same field or different fields, which is not specifically limited in the embodiment of the present disclosure.
  • the search gateway modifies the first location information
  • the first location information can be modified through any one of the above three implementation manners.
  • the search gateway may also modify the first location information in combination with at least two of the foregoing three implementation manners, which is not specifically limited in the embodiment of the present disclosure.
  • the search gateway modifies the first location information in the first search request, it can intercept the first location information through the first implementation method to obtain the third location information, and then modify the third location information. Adjust the first target field of, and/or delete the second target field in the third position information to obtain the second position information.
  • the search gateway intercepts the first location information according to the preset accuracy to obtain the third location information; adjusts the location information of the first target field in the third location information to obtain the second location information .
  • the search gateway intercepts the first location information according to a preset accuracy to obtain the third location information; deletes the location information of the second target field in the third location information to obtain the second location information.
  • the search gateway intercepts the first location information according to the preset accuracy to obtain the third location information; adjusts the location information of the first target field in the third location information, and deletes the third location information.
  • the location information of the second target field in the location information obtains the second location information.
  • the search gateway can select at least one of the above three implementation methods to perform a new strategy of degrading the first search request with latitude and longitude.
  • the search gateway can select at least one implementation from the second implementation and the third implementation to perform a new strategy of downgrading the first search request with latitude and longitude .
  • 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, so that the search gateway can obtain the location information from the location information with lower accuracy.
  • Querying the first service data corresponding to the first search request ensures that the search gateway can obtain the service data.
  • Step 405 The search gateway generates the second search request information according to the second location information and the search indication information used to indicate the search target in the first search request information.
  • the search gateway reconstructs the search request information according to the modified second location information to obtain the second search request information.
  • the search gateway may directly combine the second location information and the search indication information in the first search request information to obtain the second search request information; the search gateway may also segment the search indication information in the first search request information, Reorganize according to the word segmentation result to obtain the second search request information.
  • the search gateway composes the second search request information with the second location information and the search indication information in the first search request information.
  • the search gateway replaces the first location information in the first search request with the modified second location information to obtain the second search request information.
  • the first search request is to search for nearby Sichuan restaurants, where the location information carried in the first search request is first location information, and the first search request information corresponding to the first search request is "Sichuan cuisine near the first location information Restaurant”, when the first location information is modified, the second search request information corresponding to the first search request is “Sichuan restaurant near the second location information”.
  • the search gateway can search through the modified second search request information, thereby Ensure that the search gateway can obtain service data.
  • the search gateway performs word segmentation processing on the search indication information included in the first search request information to obtain a plurality of word segments, and according to the plurality of word segmentation, determines the first part used to represent the fourth location information.
  • a target word segmentation, the fourth position information represented by the first target word segmentation, the second position information, and other word segmentation in the plurality of word segmentation except the first target word segmentation form the second search request information.
  • the search gateway performs word segmentation processing on the search indication information to obtain a plurality of word segments, obtains a first target word segment containing location information from the plurality of word segments, and converts the first target word segment into fourth location information
  • the second search request information is composed of the fourth location information, the second location information and other word segmentation. For example, if the search instruction information is "clothing store near A street", the word segmentation of the search instruction information will get two word segmentation ratios of "A street” and "clothing store", where "A street” can indicate For word segmentation of location information, the fourth location information corresponding to "A street" is obtained, and then the fourth location information, the second location information, and the "clothing store" are combined into the second search request information.
  • Step 406 The search gateway obtains the second service data corresponding to the second search request information from the cache according to the second search request information.
  • the process in which the search gateway queries the second search request from the cached service data according to the second search request information is the same as the process in which the search gateway queries the first service data corresponding to the first search request from the cache according to the first search request in step 403
  • the process is similar, so I won't repeat it here.
  • the search gateway queries the cached service data for the second search request information according to the second search request information.
  • the search gateway queries the second service data corresponding to the second search request information
  • the cache exists in the cache.
  • the search gateway obtains the second service data, and step 406 is executed.
  • step 404 is executed to modify the second location information in the second search request information to obtain third location information; The information generates the third search request information until the third service data corresponding to the third search request information is obtained from the cache according to the third search request information.
  • step 404 when continuing to modify the second location information in the second search request information, at least one of the three modifications in step 404 can be selected for modification, and when only one modification is selected.
  • different modification methods may be used alternately, or the same modification method may be used, which is not specifically limited in the embodiments of the present disclosure.
  • the search gateway when the search gateway performs word segmentation processing on the search indication information included in the first search request information to obtain multiple word segments, the first target used to represent the fourth location information is determined based on the multiple word segments Word segmentation.
  • the search gateway may also The downgrade strategy without latitude and longitude performs downgrade processing on other search indication information in the second search request information.
  • Step 407 The search gateway returns the second service data to the terminal.
  • the search gateway sends the cached second service data to the terminal, and the terminal receives the second service data and displays the second service data.
  • the search gateway when it does not obtain the service data corresponding to the search request in the cached service data, it can modify the search request repeatedly until the corresponding service data is queried, and the service data is obtained and returned to the terminal , So as to ensure the response rate of the search request sent by the terminal.
  • the search gateway can also modify the search request within a predetermined number of times. After the predetermined number of times is exceeded, the search request is no longer modified, and an error response is directly returned to ensure the validity of the service data returned by the search gateway.
  • the first search request sent by the terminal is received, and the first search request information corresponding to the first search request is obtained; in response to the need to downgrade the first search request and the first search request information does not exist in the cache
  • modify the first search request information to obtain the second search request information, and the second service data corresponding to the second search request information exists in the cache; according to the second search request information, the first search request information is obtained from the cache.
  • the second service data corresponding to the search request information is returned to the terminal, so that when the first search request is downgraded, the search gateway can ensure that the search gateway obtains the service data from the cached service data and returns it to the terminal, Therefore, it is ensured that the search request sent by the terminal can be responded to, and the response rate of the search request is improved.
  • Fig. 6 is a flow chart showing an information search method according to an exemplary embodiment. This embodiment takes the search gateway to execute a downgrade strategy without latitude and longitude as an example for description. As shown in Fig. 6, the information search method includes the following steps :
  • Step 601 The search gateway receives the first search request sent by the terminal, and obtains the first search request information corresponding to the first search request.
  • the first search request information includes at least search indication information provided by the terminal and used to indicate a search target.
  • the first search request information may also include other auxiliary search information used to assist the search.
  • This step is similar to step 401 and will not be repeated here.
  • Step 602 The search gateway determines whether to perform downgrade processing on the first search request.
  • This step is similar to step 402 and will not be repeated here.
  • Step 603 In response to the need to perform downgrade processing on the first search request, the search gateway queries the cache for the first service data corresponding to the first search request according to the first search request.
  • This step is similar to step 403 and will not be repeated here.
  • Step 604 In response to the need to downgrade the first search request and the first service data corresponding to the first search request information does not exist in the cache, the search gateway performs word segmentation on the search indication information included in the first search request information Processing, get multiple word segmentation.
  • This step is similar to the process of performing word segmentation on the target search indication information in step 405, and will not be repeated here.
  • Step 605 The search gateway determines at least two second target word segmentation from the plurality of word segmentation according to the weight of each word segmentation.
  • the search gateway may determine the weight of each word segmentation according to the amount of information carried by different word segmentation, thereby selecting at least two second target word segmentation that carry a large amount of information. For example, if the search instruction information is "clothing store near street A”, the multiple word segmentation obtained by word segmentation are “street A”, “nearby”, and “clothing store”. Meaning, it can be determined that the participles that carry a large amount of information are “street A” and "clothing store”, so that "street A” and "clothing store” are used as the second target participles.
  • Step 606 The search gateway generates the second search request information according to the at least two second target word segmentation.
  • the search gateway can directly compose the at least two target word segmentation into the second search request information, and the search gateway can also convert the target word segmentation carrying location information in the second target word segmentation to obtain the fifth location information, and then The second search request information is formed according to the fifth location information and the second target word segmentation.
  • the search gateway splices the at least two second target word segmentation to obtain the second search request information.
  • the search gateway determines a third target participle representing location information from the at least two second target participles according to the part of speech of each second target participle; according to the third target participle The indicated fifth position information and the target participles other than the third target participle of the at least two second target participles are used to generate the second search request information.
  • This step is similar to the process of generating the second search request information according to the fourth location information, the second location information and the target word segmentation other than the first target word segmentation in step 405, and will not be repeated here.
  • Step 607 The search gateway obtains the 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 repeated here.
  • the search gateway may perform step 604 again to modify the second search request information.
  • the search gateway may also modify the fifth location information through at least one of the three implementation manners provided in step 404.
  • the third search request information is obtained according to the modified second search request information, until the 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 repeated here.
  • the first search request sent by the terminal is received, and the first search request information corresponding to the first search request is obtained; in response to the need to downgrade the first search request and the first search request information does not exist in the cache
  • modify the first search request information to obtain the second search request information, and the second service data corresponding to the second search request information exists in the cache; according to the second search request information, the first search request information is obtained from the cache.
  • the second service data corresponding to the search request information is returned to the terminal, so that when the first search request is downgraded, the search gateway can ensure that the search gateway obtains the service data from the cached service data and returns it to the terminal, Therefore, it is ensured that the search request sent by the terminal can be responded to, and the response rate of the search request is improved.
  • Fig. 7 is a block diagram showing an information search device according to an exemplary embodiment. As shown in Fig. 7, the information search device includes:
  • the receiving module 701 is configured to receive a first search request sent by a terminal, and obtain first search request information corresponding to the first search request;
  • the modification module 702 is configured to modify the first search request information to obtain the second search request in response to the need to downgrade the first search request and the first service data corresponding to the first search request information does not exist in the cache. ask
  • the obtaining module 703 is configured to obtain the second service data corresponding to the second search request information from the cache according to the second search request information;
  • the sending module 704 is configured to return the second service data to the terminal.
  • the modification module 702 is further configured to modify the first location information to obtain second location information in response to the first search request information including the first location information; 2.
  • the location information and the search indication information used to indicate the search target in the first search request information to generate the second search request information.
  • the modification module 702 is further configured to intercept the first position information according to a preset accuracy to obtain the third position information;
  • the modification module 702 is further configured to adjust the position information of the first target field in the third position information, and/or delete the position information of the second target field in the third position information to obtain the second target field. location information.
  • the modification module 702 is further configured to form the second search request information with the second location information and the search indication information in the first search request information; or,
  • the modification module 702 is further configured to perform word segmentation processing on the search indication information included in the first search request information to obtain a plurality of word segmentation, and determine the first target word segmentation used to represent the fourth position information according to the plurality of word segmentation, The fourth location information indicated by the first target word segmentation, the second location information, and other word segmentation in the plurality of word segmentation except the first target word segmentation form the second search request information.
  • the modification module 702 is further configured to, in response to the first search request information not including the first location information, perform word segmentation processing on the search indication information included in the first search request information , Obtain a plurality of word segmentation; determine at least two second target word segmentation from the plurality of word segmentation according to the weight of each word segmentation; generate the second search request information according to the at least two second target word segmentation.
  • the modification module 702 is further configured to form the at least two second target word segmentation into the second search request information; or,
  • the modification module 702 is further configured to determine a third target participle representing location information from the at least two second target participles according to the part of speech of each second target participle; The location information and the target participles other than the third target participle of the at least two second target participles are used to generate the second search request information.
  • the modification module 702 is further used for the fifth position information represented by the third target participle and the target participles other than the third target participle in the at least two second target participles , Compose the second search request information; or,
  • the modification module 702 is further configured to modify the fifth position information to obtain sixth position information, and the sixth position information and the target participle of the at least two second target participles other than the third target participle, Compose the second search request information.
  • the device further includes:
  • the first determining module is used to obtain the current non-result rate of the search server and obtain the reference non-result rate of the search server; determine the current non-result rate increment according to the current non-result rate and the reference non-result rate; In response to the increase in the non-result rate being greater than the preset threshold, it is determined that the first search request needs to be downgraded; or,
  • the first determining module is further configured to determine that the first search request needs to be downgraded in response to not receiving the search result returned by the search server within the preset time period.
  • the device further includes:
  • the second determining module is used to determine the current degraded search rate
  • the first determining module is further configured to perform the step of determining that the first search request needs to be degraded in response to the current degraded search rate being less than the ineffective rate increment.
  • the obtaining module 703 is further configured to send the second search request information to a cache server, where the cache server is used to cache service data, and determine the second search request information according to the second search request information. Search for the second service data corresponding to the request information; receive the second service data returned by the cache server.
  • the receiving module 701 is further configured to perform decryption processing on the first search request to obtain first location information and search indication information corresponding to the first search request, and according to the first search request.
  • a search request obtains auxiliary search information corresponding to the first search request; the first location information, the search indication information, and the auxiliary search information form first search request information corresponding to the first search request.
  • the first search request sent by the terminal is received, and the first search request information corresponding to the first search request is obtained; in response to the need to downgrade the first search request and the first search request information does not exist in the cache
  • modify the first search request information to obtain the second search request information, and the second service data corresponding to the second search request information exists in the cache; according to the second search request information, the first search request information is obtained from the cache.
  • the second service data corresponding to the search request information is returned to the terminal, so that when the first search request is downgraded, the search gateway can ensure that the search gateway obtains the service data from the cached service data and returns it to the terminal, Therefore, it is ensured that the search request sent by the terminal can be responded to, and the response rate of the search request is improved.
  • the information search device provided in the above embodiment searches for information
  • only the division of the above-mentioned functional modules is used as an example.
  • the above-mentioned function allocation can be completed by different functional modules according to needs, i.e.
  • the internal structure of the terminal is divided into different functional modules to complete all or part of the functions described above.
  • the information search device provided in the foregoing embodiment and the information search method embodiment belong to the same concept, and the implementation process is detailed in the method embodiment, which will not be repeated here.
  • FIG. 8 is a schematic structural diagram of a search gateway provided by an embodiment of the present disclosure.
  • the search gateway 800 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 801 And one or more memories 802, where at least one instruction is stored in the memory 802, and the at least one instruction is loaded and executed by the processor 801 to implement the information search method provided by the foregoing method embodiments.
  • the search gateway 800 may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface for input and output.
  • the search gateway 800 may also include other components for implementing device functions, which will not be described here.
  • a computer-readable storage medium stores at least one instruction, and the at least one instruction is loaded and executed by a server, so as to implement the information search method in the foregoing embodiment.
  • the computer-readable storage medium may be a memory.
  • the computer-readable storage medium may be ROM (Read-Only Memory), RAM (Random Access Memory, random access memory), CD-ROM (Compact Disc Read-Only Memory, compact disc read-only memory) Storage), magnetic tapes, floppy disks and optical data storage devices, etc.
  • a computer program product or computer program is also provided.
  • the computer program product or computer program includes computer program code, and the computer program code is stored in a computer-readable storage medium.
  • the processor of the terminal reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the terminal executes the information search method provided in the various optional implementation manners of the foregoing aspects.
  • the computer programs involved in the embodiments of the present application can be deployed and executed on one computer device, or executed on multiple computer devices located in one location, or, in multiple locations and through communication. It is executed on multiple computer devices interconnected by a network, and multiple computer devices distributed in multiple locations and interconnected through a communication network can form a blockchain system.

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

An information search method and apparatus, a search gateway, and a storage medium, which relate to the technical field of the Internet. The method comprises: receiving a first search request sent by a terminal, and acquiring first search request information corresponding to the first search request (201); modifying the first search request information in response to a need to degrade the first search request and that first service data corresponding to the first search request information is not present in a cache, so as to obtain second search request information, second service data corresponding to the second search request information being present in the cache (202); according to the second search request information, acquiring the second service data corresponding to the second search request information from the cache (203); and returning the second service data to the terminal (204).

Description

信息搜索Information search
本公开要求于2020年05月26日提交的申请号为202010456593.8、申请名称为“信息搜索方法、装置、搜索网关及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。This disclosure claims the priority of a Chinese patent application filed on May 26, 2020, with the application number 202010456593.8 and the application title "information search method, device, search gateway and storage medium", the entire content of which is incorporated into this disclosure by reference middle.
技术领域Technical field
本公开实施例涉及互联网技术领域,特别涉及一种信息搜索。The embodiments of the present disclosure relate to the field of Internet technology, and in particular to an information search.
背景技术Background technique
随着互联网技术的发展,信息搜索成为了一种用户常使用的应用程序功能。信息搜索过程中,终端将搜索请求发送给搜索网关,通过搜索网关将搜索请求发送给搜索服务器,搜索服务器根据搜索请求进行搜索,再将搜索结果通过搜索网关反馈给终端。With the development of Internet technology, information search has become an application function frequently used by users. During the information search process, the terminal sends a search request to the search gateway, sends the search request to the search server through the search gateway, the search server searches according to the search request, and then feeds back the search results to the terminal through the search gateway.
发明内容Summary of the invention
本公开实施例提供了一种信息搜索,提高了搜索请求的响应率。该技术方案如下:The embodiments of the present disclosure provide an information search, which improves the response rate of search requests. The technical scheme is as follows:
一方面,提供了一种信息搜索方法,所述方法包括:In one aspect, an information search method is provided, and the method includes:
接收终端发送的第一搜索请求,获取所述第一搜索请求对应的第一搜索请求信息;Receiving a first search request sent by a terminal, and obtaining first search request information corresponding to the first search request;
响应于需要对所述第一搜索请求进行降级处理且缓存中不存在所述第一搜索请求信息对应的第一服务数据,对所述第一搜索请求信息进行修改,得到第二搜索请求信息,所述缓存中存在所述第二搜索请求信息对应的第二服务数据;In response to the need to downgrade the first search request and the first service data corresponding to the first search request information does not exist in the cache, the first search request information is modified to obtain the second search request information, The second service data corresponding to the second search request information exists in the cache;
根据所述第二搜索请求信息,从所述缓存中获取所述第二搜索请求信息对应的第二服务数据;Obtaining second service data corresponding to the second search request information from the cache according to the second search request information;
将所述第二服务数据返回给所述终端。Returning the second service data to the terminal.
另一方面,提供了一种信息搜索装置,所述装置包括:In another aspect, an information search device is provided, and the device includes:
接收模块,用于接收终端发送的第一搜索请求,获取所述第一搜索请求对应的第一搜索请求信息;A receiving module, configured to receive a first search request sent by a terminal, and obtain first search request information corresponding to the first search request;
修改模块,用于响应于需要对所述第一搜索请求进行降级处理且缓存中不存在所述第一搜索请求信息对应的第一服务数据,对所述第一搜索请求信息进行修改,得到第二搜索请求The modification module is configured to modify the first search request information in response to the need to downgrade the first search request and the first service data corresponding to the first search request information does not exist in the cache to obtain the first search request information. Second search request
获取模块,用于根据所述第二搜索请求信息,从所述缓存中获取所述第二搜索请求信息对应的第二服务数据;An obtaining module, configured to obtain second service data corresponding to the second search request information from the cache according to the second search request information;
发送模块,用于将所述第二服务数据返回给所述终端。The sending module is configured to return the second service data to the terminal.
另一方面,提供了一种搜索网关,所述搜索网关包括一个或多个处理器和一个或多个存储器,所述一个或多个存储器中存储有至少一条指令,所述至少一条指令由所述一个或多个处理器加载并执行以实现如本公开实施例的方法实施例中所述的信息搜索方法所执行的操作。In another aspect, a search gateway is provided. The search gateway includes one or more processors and one or more memories, and at least one instruction is stored in the one or more memories. The one or more processors are loaded and executed to implement the operations performed by the information search method described in the method embodiment of the embodiment of the present disclosure.
另一方面,提供了一种非临时性计算机可读存储介质,所述存储介质中存储有至少一条指令,所述至少一条指令由处理器加载并执行以实现如本公开实施例的方法实施例中所述的信息搜索方法所执行的操作。In another aspect, a non-transitory computer-readable storage medium is provided, the storage medium stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the method embodiment as the embodiment of the present disclosure The operations performed by the information search method described in.
在本公开实施例中,接收终端发送的第一搜索请求,获取第一搜索请求对应的第一搜索请求信息;响应于需要对第一搜索请求进行降级处理且缓存中不存在第一搜索请求信息对应 的第一服务数据,对第一搜索请求信息进行修改,得到第二搜索请求信息,缓存中存在第二搜索请求信息对应的第二服务数据;根据第二搜索请求信息,从缓存中获取第二搜索请求信息对应的第二服务数据;将第二服务数据返回给终端,从而在对第一搜索请求进行降级处理时,可以保证搜索网关从缓存的服务数据中获取服务数据,返回给终端,从而保证终端发送的搜索请求可以得到响应,提高了搜索请求的响应率。In the embodiment of the present disclosure, the first search request sent by the terminal is received, and the first search request information corresponding to the first search request is obtained; in response to the need to downgrade the first search request and the first search request information does not exist in the cache Corresponding to the first service data, modify the first search request information to obtain the second search request information, and the second service data corresponding to the second search request information exists in the cache; according to the second search request information, the first search request information is obtained from the cache. 2. The second service data corresponding to the search request information; the second service data is returned to the terminal, so that when the first search request is downgraded, the search gateway can ensure that the search gateway obtains the service data from the cached service data and returns it to the terminal, Therefore, it is ensured that the search request sent by the terminal can be responded to, and the response rate of the search request is improved.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The drawings herein are incorporated into the specification and constitute a part of the specification, show embodiments consistent with the disclosure, and are used together with the specification to explain the principle of the disclosure.
图1是根据一示例性实施例示出的一种信息搜索方法所涉及的系统架构图;Fig. 1 is a system architecture diagram involved in an information search method according to an exemplary embodiment;
图2是根据一示例性实施例示出的一种信息搜索方法流程图;Fig. 2 is a flow chart showing an information search method according to an exemplary embodiment;
图3是根据一示例性实施例示出的一种信息搜索方法流程图;Fig. 3 is a flow chart showing an information search method according to an exemplary embodiment;
图4是根据一示例性实施例示出的一种信息搜索方法流程图;Fig. 4 is a flow chart showing an information search method according to an exemplary embodiment;
图5是根据一示例性实施例示出的一种信息搜索方法流程图;Fig. 5 is a flow chart showing an information search method according to an exemplary embodiment;
图6是根据一示例性实施例示出的一种信息搜索方法流程图;Fig. 6 is a flow chart showing an information search method according to an exemplary embodiment;
图7是根据一示例性实施例示出的一种信息搜索装置的框图;Fig. 7 is a block diagram showing an information search device according to an exemplary embodiment;
图8是根据一示例性实施例示出的一种搜索网关的结构示意图。Fig. 8 is a schematic structural diagram showing a search gateway according to an exemplary embodiment.
具体实施方式Detailed ways
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合附图对本公开实施方式作进一步地详细描述。In order to make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the following further describes the embodiments of the present disclosure in detail with reference to the accompanying drawings.
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
随着终端基数的增加,搜索服务器的负载越来越大,造成同一时间段内,可能有大量的终端访问搜索服务器,导致搜索服务器处理速度较慢甚至出现宕机,造成终端无法及时获取搜索结果,从而导致搜索效率较低。With the increase of terminal base, the load of the search server is getting heavier, causing a large number of terminals to access the search server during the same period of time, resulting in slower processing speed of the search server or even downtime, causing the terminal to fail to obtain search results in time , Resulting in lower search efficiency.
相关技术中,搜索网关常通过对搜索请求进行降级处理,来减轻搜索服务器的负载。其中,常用的降级处理方式为当搜索网关判断需要进行降级处理时,放弃该搜索请求,即需要进行降级处理时,不再向搜索服务器发送搜索请求。或者,搜索网关将搜索服务器的部分核心数据缓存在本地,当需要进行降级处理时,搜索网关从本地缓存中获取搜索结果,返回给客户端。In related technologies, the search gateway often reduces the load on the search server by downgrading the search request. Among them, the commonly used downgrade processing method is to abandon the search request when the search gateway determines that the downgrade processing is needed, that is, when the downgrade processing is required, the search request is no longer sent to the search server. Alternatively, the search gateway caches part of the core data of the search server locally, and when downgrading processing is required, the search gateway obtains the search result from the local cache and returns it to the client.
图1是根据一示例性实施例示出的一种信息搜索方法所涉及的系统架构图。该系统架构图包括终端101、搜索网关102和搜索服务器103。Fig. 1 is a system architecture diagram involved in an information search method according to an exemplary embodiment. The system architecture diagram includes a terminal 101, a search gateway 102, and a search server 103.
终端101与搜索网关102通过网络连接进行数据交互,搜索网关102与搜索服务器103通过网络连接进行数据交互。终端101中可以运行用于进行搜索的应用程序,该应用程序可以为浏览器、互联网交易平台等具有信息搜索功能的应用程序。用户可以通过该应用程序进行信息搜索。相应的,当终端101接收到用户触发的搜索指令时,根据该搜索指令生成第一搜索请求,将该第一搜索请求发送给搜索网关102。响应于搜索服务器103正常工作,搜索网关102将该第一搜索请求转发给搜索服务器103,搜索服务器103根据预设的搜索算法搜索第一搜索请求对应的服务数据,将搜索到的服务数据返回给搜索网关102,由搜索网关102将该服务数据返回给终端101。响应于搜索服务器103工作异常,搜索网关102根据第一搜索请求从缓存中获取该第一搜索请求对应的服务数据,再将该服务数据返回给终端101。The terminal 101 and the search gateway 102 conduct data interaction through a network connection, and the search gateway 102 and the search server 103 conduct data interaction through a network connection. The terminal 101 may run an application program for searching, and the application program may be an application program with an information search function such as a browser or an Internet transaction platform. Users can search for information through this application. Correspondingly, when the terminal 101 receives a search instruction triggered by the user, it generates a first search request according to the search instruction, and sends the first search request 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, and the search server 103 searches for the service data corresponding to the first search request according to a preset search algorithm, and returns the searched service data to The search gateway 102 returns the service data to the terminal 101 by the search gateway 102. 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 then returns the service data to the terminal 101.
例如,该应用程序可以为互联网交易平台,应用程序的显示界面中显示搜索栏,用户可以向搜索栏中输入搜索目标对应的第一搜索请求信息,例如,用户的搜索目标可以为某地的餐厅,则用户输入的第一搜索请求信息可以为“A地的餐厅”,相应的,终端101根据该第一搜索请求信息生成第一搜索请求,将该第一搜索请求发送给搜索网关102,由搜索网关102获取到该第一搜索请求对应的服务数据,相应的,该第一搜索请求对应的服务数据可以为A地的餐厅的名称、地点和相关用户评论等数据。For example, the application program may be an Internet trading platform, and the display interface of the application program displays a search bar, and the user can input the first search request information corresponding to the search target into the search bar. For example, the user's search target may be a restaurant in a certain place , The first search request information input by the user may be "a restaurant in area A". Correspondingly, the terminal 101 generates a first search request according to the first search request information, and sends the first search request to the search gateway 102. The search gateway 102 obtains the service data corresponding to the first search request. Correspondingly, the service data corresponding to the first search request may be data such as the name, location, and relevant user comments of the restaurant in place A.
在一种可能的实现方式中,该系统架构还包括缓存服务器,该缓存服务器中缓存服务数据。响应于搜索服务器103工作异常,搜索网关102可以直接从缓存服务器中获取缓存服务器中缓存的服务数据,将该服务数据发送给终端101。In a possible implementation manner, the system architecture further includes a cache server in which service data is cached. In response to the abnormal operation of the search server 103, the search gateway 102 may directly obtain the service data cached in the cache server from the cache server, and send the service data to the terminal 101.
其中,该终端101可以为手机、电脑、平板电脑或可穿戴设备等。搜索服务器103和缓存服务器都可以为独立的物理服务器,也可以是由多个物理服务器构成的服务器集群,还可以为云服务器等。搜索网关102可以为任一可以进行协议转换的网络网间连接器或协议转换器等,在本公开实施例中,对此均不作具体限定。Wherein, the terminal 101 may be a mobile phone, a computer, a tablet computer, a wearable device, or the like. Both the search server 103 and the cache server may be independent physical servers, may also be a server cluster composed of multiple physical servers, or may also be cloud servers. The search gateway 102 can be any network connector or protocol converter that can perform protocol conversion, which is not specifically limited in the embodiments of the present disclosure.
图2是根据一示例性实施例示出的一种信息搜索方法流程图,如图2所示,该信息搜索方法包括以下步骤:Fig. 2 is a flow chart showing an information search method according to an exemplary embodiment. As shown in Fig. 2, the information search method includes the following steps:
步骤201:接收终端发送的第一搜索请求,获取该第一搜索请求对应的第一搜索请求信息。Step 201: Receive a first search request sent by a terminal, and obtain first search request information corresponding to the first search request.
步骤202:响应于需要对该第一搜索请求进行降级处理且缓存中不存在该第一搜索请求信息对应的第一服务数据,对该第一搜索请求信息进行修改,得到第二搜索请求信息,该缓存中存在该第二搜索请求信息对应的第二服务数据。Step 202: In response to the need to downgrade the first search request and the first service data corresponding to the first search request information does not exist in the cache, modify the first search request information to obtain second search request information, The second service data corresponding to the second search request information exists in the cache.
步骤203:根据该第二搜索请求信息,从该缓存中获取该第二搜索请求信息对应的第二服务数据。Step 203: Obtain the second service data corresponding to the second search request information from the cache according to the second search request information.
步骤204:将该第二服务数据返回给该终端。Step 204: Return the second service data to the terminal.
在本公开实施例中,在本公开实施例中,接收终端发送的第一搜索请求,获取第一搜索请求对应的第一搜索请求信息;响应于需要对第一搜索请求进行降级处理且缓存中不存在第一搜索请求信息对应的第一服务数据,对第一搜索请求信息进行修改,得到第二搜索请求信息,缓存中存在第二搜索请求信息对应的第二服务数据;根据第二搜索请求信息,从缓存中获取第二搜索请求信息对应的第二服务数据;将第二服务数据返回给终端,从而在对第一搜索请求进行降级处理时,可以保证搜索网关从缓存的服务数据中获取服务数据,返回给终端,从而保证终端发送的搜索请求可以得到响应,提高了搜索请求的响应率。In the embodiment of the present disclosure, in the embodiment of the present disclosure, the first search request sent by the terminal is received, and the first search request information corresponding to the first search request is obtained; in response to the need to downgrade the first search request and the cache is There is no first service data corresponding to the first search request information, the first search request information is modified to obtain the second search request information, and the second service data corresponding to the second search request information exists in the cache; according to the second search request Information, the second service data corresponding to the second search request information is obtained from the cache; the second service data is returned to the terminal, so that when the first search request is downgraded, the search gateway can ensure that the search gateway obtains the cached service data The service data is returned to the terminal, thereby ensuring that the search request sent by the terminal can be responded to, and improving the response rate of the search request.
在本公开实施例中,终端将第一搜索请求发送给搜索网关,搜索网关确定是否需要对该第一搜索请求进行降级处理。参见图3,响应于搜索网关确定需要对该第一搜索请求进行降级处理时,搜索网关根据第一搜索请求中包含第一搜索请求信息确定第一搜索请求对应的降级策略。响应于第一搜索请求中包括用于指示经纬度信息的第一位置信息,搜索网关根据该第一位置信息对第一搜索请求进行带经纬度的降级策略。响应于第一搜索请求中不包括用于指示经纬度信息的第一位置信息,搜索网关根据第一搜索请求信息中包含的搜索指示信息对第一搜索请求进行不用带经纬度的降级策略。In the embodiment of the present 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 downgraded. Referring to FIG. 3, in response to the search gateway determining that the first search request needs to be downgraded, the search gateway determines the downgrade strategy corresponding to the first search request according to the first search request information included in the first search request. In response to the first search request including the first location information for indicating the longitude and latitude information, the search gateway performs a downgrade strategy with the longitude and latitude on the first search request according to the first location information. In response to the first search request not including the first location information indicating the latitude and longitude information, the search gateway performs a downgrade strategy for the first search request without latitude and longitude according to the search indication information contained in the first search request information.
图4是根据一示例性实施例示出的一种信息搜索方法流程图,本实施例以搜索网关执行带经纬度的降级策略为例进行说明,如图4所示,该信息搜索方法包括以下步骤:Fig. 4 is a flowchart of an information search method according to an exemplary embodiment. This embodiment takes the search gateway to execute a downgrade strategy with latitude and longitude as an example for description. As shown in Fig. 4, the information search method includes the following steps:
步骤401:搜索网关接收终端发送的第一搜索请求,获取该第一搜索请求对应的第一搜索请求信息。Step 401: The search gateway receives the first search request sent by the terminal, and obtains the first search request information corresponding to the first search request.
该第一搜索请求信息至少包括第一位置信息和搜索指示信息。其中,该第一位置信息为终端提供的位置信息;搜索指示信息为用于指示搜索目标的指示信息。该第一搜索请求信息还可以包括其他用于辅助搜索的辅助搜索信息。The first search request information includes at least first location information and search indication information. Wherein, the first location information is location information provided by the terminal; the search instruction information is instruction information used to indicate a search target. The first search request information may also include other auxiliary search information used to assist the search.
在一种可能的实现方式中,该第一搜索请求信息包括第一位置信息和搜索指示信息;并且,该第一搜索请求携带第一位置信息和搜索指示信息。相应的,搜索网关获取第一位置信息和搜索指示信息的过程可以为:搜索网关从第一搜索请求中获取第一位置信息和搜索指示信息。In a possible implementation manner, the first search request information includes first location information and search indication information; and, the first search request carries first location information and search indication information. Correspondingly, the process for the search gateway to obtain the first location information and the search indication information may be: the search gateway obtains 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 for the search gateway to obtain the first location information and the search indication information may be: the search gateway decrypts the first search request to obtain the first location information and the search indication information.
相应的,第一搜索请求携带加密的第一位置信息和加密的搜索指示信息时,终端向搜索网关发送第一搜索请求之前,终端对第一位置信息和搜索指示信息进行加密,将加密后的第一位置信息和加密后的搜索指示信息添加到第一搜索请求中。其中,该终端的加密方法和搜索网关的解密方法对应。终端和搜索网关事先约定加解密方法,终端根据预设的加密方法对第一搜索请求信息进行加密,搜索网关根据事先约定的解密方法对第一搜索请求进行解密。其中,预设的加密方法为事先约定的加密方法。Correspondingly, when the first search request carries the encrypted first location information and the encrypted search indication information, before the terminal sends the first search request to the search gateway, the terminal encrypts the first location information and the search indication information, and encrypts the encrypted first location information and search indication information. The first location information and the encrypted search instruction information are added to the first search request. Among them, the encryption method of the terminal corresponds to the decryption method of the search gateway. The terminal and the search gateway agree on an encryption and decryption method in advance, the terminal encrypts the first search request information according to the preset encryption method, and the search gateway decrypts the first search request according to the decryption method agreed in advance. Among them, the preset encryption method is a previously agreed encryption method.
在本实现方式中,通过第一搜索请求进行解密处理,得到第一搜索请求对应第一位置信息和搜索指示信息,从而增加了第一搜索请求的安全性。In this implementation manner, decryption processing is performed through the first search request to obtain the first location information and search indication information corresponding to the first search request, thereby increasing the security of the first search request.
在另一种可能的实现方式中,该第一搜索请求信息中还包括辅助搜索信息;相应的,搜索网关获取辅助搜索信息的过程可以为:搜索网关根据第一搜索请求,调用外部服务器;从外部服务器中获取第一搜索请求对应的辅助信息。例如,该辅助搜索信息可以包括该第一搜索请求的来源信息,相应的,该辅助搜索信息可以为第一搜索请求的cityid,通过调用该cityid网关服务器获取该第一搜索请求对应的cityid。In another possible implementation manner, the first search request information also includes auxiliary search information; correspondingly, the process for the search gateway to obtain the auxiliary search information may be: the search gateway calls the external server according to the first search request; The auxiliary information corresponding to the first search request is obtained from the external server. For example, the auxiliary search information may include source information of the first search request. Correspondingly, the auxiliary search information may be the 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 also includes auxiliary search information, the process for the terminal to obtain the first search request information may be: decrypting the first search request to obtain the first location information corresponding to the first search request And search indication information, and, according to the first search request, the auxiliary search information corresponding to the first search request is obtained; the first location information, the search indication information, and the auxiliary search information form the first search request corresponding to the first search request. A search request information.
其中,该第一位置信息可以为终端在发送第一搜索请求时所在的地理位置的位置信息,相应的,终端对当前所在的地理位置进行定位,确定当前的位置坐标,将该位置坐标添加到第一搜索请求中。例如,终端可以通过终端自带的定位系统进行定位,将定位得到位置坐标确定为第一位置信息。该第一位置信息也可以为终端接收的用户选择或输入的位置信息,相应的,终端接收用户输入的位置信息,将用户输入的位置信息转换成位置坐标,将该位置坐标添加到第一搜索请求中。例如,用户输入的位置信息为“A街道B路口”,则终端将该位置信息转换成“A街道B路口”对应的位置坐标,将该位置坐标作为第一位置信息。Wherein, the first location information may be the location information of the geographic location where the terminal is located when the first search request is sent. Correspondingly, the terminal locates the current geographic location, determines the current location coordinates, and adds the location coordinates to The first search request. For example, the terminal may perform positioning through the positioning system provided by the terminal, and determine the position coordinates obtained by positioning as the first position information. The first location information may also be location information selected or input by the user received by the terminal. Correspondingly, 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. Requesting. For example, if the position information input by the user is "A street B intersection", the terminal converts the position information into position coordinates corresponding to "A street B intersection", and uses the position coordinates as the first position information.
需要说明的一点是,搜索网关可以先对第一搜索请求进行解密再获取第一搜索请求对应的辅助搜索信息;搜索网关也可以先获取第一搜索请求对应的辅助搜索信息再对第一搜索请求进行解密处理;搜索网关还可以同时获取该第一搜索请求对应的辅助搜索请求和对该第一搜索请求进行解密。在本公开实施例中,对网关服务器对第一搜索请求的处理流程不作聚集体限定。It should be noted that the search gateway may first decrypt the first search request and then obtain the auxiliary search information corresponding to the first search request; the search gateway may also first obtain the auxiliary search information corresponding to the first search request before making the first search request Perform decryption processing; the search gateway can also obtain the auxiliary search request corresponding to the first search request and decrypt the first search request at the same time. In the embodiment of the present disclosure, there is no aggregate restriction on the processing flow of the gateway server for the first search request.
步骤402:搜索网关确定是否对第一搜索请求进行降级处理。Step 402: The search gateway determines whether to perform downgrade processing on the first search request.
参见图5,搜索网关在接收到第一搜索请求后,确定是否需要对该第一搜索请求进行降级处理。其中,搜索网关可以根据搜索服务器的状态确定是否对第一搜索请求进行降级处理。搜索网关可以通过以下三种方式确定是否对该第一搜索请求进行降级处理,第一种实现方式,搜索网关可以在对搜索请求进行降级时,选择符合条件的搜索请求进行降级处理。第二种实现方式,搜索网关可以根据搜索服务器的无结果率确定是否对该第一搜索请求进行降级处理;第三种实现方式,搜索网关还可以在未接收到搜索服务器返回的服务数据时,确定需要对该第一搜索请求进行降级处理。Referring to FIG. 5, after receiving the first search request, the search gateway determines whether the first search request needs to be downgraded. Wherein, the search gateway may determine whether to downgrade the first search request according to the state of the search server. The search gateway can determine whether to downgrade the first search request in the following three ways. In the first implementation mode, the search gateway can select eligible search requests for downgrade processing when downgrading the search request. In the second implementation manner, the search gateway can determine whether to downgrade the first search request according to the non-result rate of the search server; in the third implementation manner, the search gateway can also, when it does not receive the service data returned by the search server, It is determined that the first search request needs to be downgraded.
相应的,第一种实现方式,搜索网关可以在对搜索请求进行降级时,选择符合条件的搜 索请求进行降级处理。其中,该条件可以为该第一搜索请求的哈希值满足无结果率增量的要求。相应的,搜索网关可以通过对第一搜索请求的唯一标识进行哈希计算,得到该第一搜索请求对应的哈希值,对该第一搜索请求对应的哈希值进行取余计算,将取余数后的值百分化,从而选择取余后百分数数值小于无结果率增量的第一搜索请求进行降级。其中,搜索网关根据第一搜索请求的唯一标识确定符合条件的搜索请求的方法可以通过公式一表示。Correspondingly, in the first implementation mode, the search gateway can select search requests that meet the conditions for downgrade processing when downgrading the search request. Wherein, the condition may be that the hash value of the first search request satisfies the requirement of an increase in the non-result rate. Correspondingly, the search gateway can obtain the hash value corresponding to the first search request by performing a hash calculation on the unique identifier of the first search request, and perform the remainder calculation on the hash value corresponding to the first search request, and take The value after the remainder is differentiated, so that the first search request whose percentage value after the remainder is less than the increase in the rate of no results is selected for downgrading. Wherein, the method for the search gateway to determine the search request that meets the conditions according to the unique identifier of the first search request can be expressed by Formula 1.
公式一:hash(queryid)%100/100Formula 1: hash(queryid)%100/100
其中,queryid表示该第一搜索请求的唯一标识;hash(queryid)表示对该第一搜索请求的唯一标识进行哈希计算得到的第一搜索请求的唯一标识的哈希值;hash(queryid)%100表示对第一搜索请求的唯一标识的哈希值进行取余计算;hash(queryid)%100/100表示第一搜索请求的唯一标识的哈希值取余后百分数数值。Among them, queryid represents the unique identifier of the first search request; hash(queryid) represents the hash value of the unique identifier of the first search request obtained by hashing 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 of the hash value of the unique identifier of the first search request after the remainder.
在本实现方式中,通过第一搜索请求的哈希值选择可以进行降级处理的第一搜素请求,从而防止对所有的第一搜索请求进行降级,导致搜索服务器在正常工作时不能接收到第一搜索请求,保证了降级的第一搜索请求的数量合理,从而实现自动对第一搜索请求进行降级处理。In this implementation manner, the first search request that can be downgraded is selected through the hash value of the first search request, thereby preventing all first search requests from being downgraded, and the search server cannot receive the first search request during normal operation. One search request ensures that the number of degraded first search requests is reasonable, so that the first search request is automatically degraded.
第二种实现方式,搜索网关根据预先确定的搜索服务器的工作状态,确定是否对第一搜索请求进行降级处理。搜索网关根据无结果率确定是否需要对第一搜索请求进行降级处理。该过程可以通过以下步骤(A1)-(A4)实现,包括:In the second implementation manner, the search gateway determines whether to downgrade the first search request according to the predetermined working status of the search server. The search gateway determines whether the first search request needs to be downgraded according to the non-result rate. This process can be achieved through the following steps (A1)-(A4), including:
(A1)搜索网关获取搜索服务器的当前无结果率。(A1) The search gateway obtains the current non-result rate of the search server.
搜索网关统计第一指定时长内向搜索服务器发送的搜索请求的数量,以及,统计这些搜索请求中接收到空数据的搜索请求的数量,将接收到空数据的搜索请求的数量与发送的搜索请求的总数量的比确定为该搜索服务器的当前无结果率。其中,空数据可以为搜索服务器返回的不包括第一搜索请求对应的服务数据的响应,也可以为搜索网关未接收到搜索服务器返回的服务数据。该第一指定时长可以根据需要进行设置,在本公开实施例中,对该第一指定时长不作具体限定。例如,该第一指定时长可以为10s、15s或20s等。The search gateway counts the number of search requests sent to the search server within the first specified time period, and counts the number of search requests that receive empty data in these search requests, and compares the number of search requests that receive empty data with the number of search requests sent The ratio of the total number is determined as the current non-result rate of the search server. The empty data may be a response returned by the search server that does not include the service data corresponding to the first search request, or it may be that the search gateway has not received the service data returned by the search server. The first designated duration can be set as required, and in the embodiment of the present disclosure, the first designated duration is not specifically limited. For example, the first designated duration may be 10s, 15s, 20s, etc.
其中,搜索网关接收到空数据的原因可能在搜索服务器处理的搜索请求的数量超出预设阈值,使得搜索服务器响应搜索网关发送的搜索请求的时间超过第二指定时长;或者,搜索服务器出现宕机、程序bug(漏洞)等异常。在本公开实施例中,对搜索服务器产生的问题的种类不作具体限定。其中,该第二指定时长小于第一指定时长,该第二指定时长可以根据需要进行设置,在本公开实施例中,对此不作具体限定。Among them, the reason why the search gateway receives empty data may be that the number of search requests processed by the search server exceeds the preset threshold, so that the search server responds to the search request sent by the search gateway for longer than the second specified time period; or the search server is down , Program bugs (vulnerabilities) and other exceptions. In the embodiments of the present disclosure, the types of problems generated by the search server are not specifically limited. Wherein, the second designated duration is less than the first designated duration, and the second designated duration can be set as required, which is not specifically limited in the embodiments of the present disclosure.
(A2)搜索网关获取该搜索服务器的基准无结果率。(A2) The search gateway obtains the benchmark non-result rate of the search server.
其中,该基准无结果率可以根据不同指定时间段内搜索服务器的无结果率来确定。例如,该指定时间段可以分别为10分钟、1小时、1天或1周等时间段内,通过无结果率确定模型来确定该搜索服务器的基准无结果率。其中,该无结果率确定模型可以为线性模型,在本公开实施例中,对该无结果率确定模型不作具体限定。Among them, the reference non-result rate can be determined according to the non-result rate of the search server in different designated time periods. For example, the specified time period may be within a time period of 10 minutes, 1 hour, 1 day, or 1 week, etc., and the reference non-result rate of the search server is determined through the non-result rate determination model. The non-result rate determination model may be a linear model. In the embodiment of the present disclosure, the non-result rate determination model is not specifically limited.
在一种可能的实现方式中,该基准无结果率可以为搜索网关自己确定的,相应的,搜索网关每隔第三指定时长确定一次基准无结果率,该搜索网关确定基准无结果率的过程可以为:搜索网关通过上述无结果率确定模型确定该搜索服务器的基准无结果率;将该基准无结果率存储在本地,搜索网关每隔第三指定时长从本地存储中获取该基准无结果率。In a possible implementation manner, the reference non-result rate may be determined by the search gateway itself. Accordingly, the search gateway determines the reference non-result rate every third specified time period, and the search gateway determines the reference non-result rate. It can be: the search gateway determines the benchmark non-result rate of the search server through the above-mentioned non-result rate determination model; stores the benchmark non-result rate locally, and the search gateway obtains the benchmark non-result rate from the local storage every third specified period of time .
在另一种可能的实现方式中,该基准无结果率可以为其他电子设备确定的,其他电子设备确定搜索服务器的基准无结果率的过程,与搜索网关确定搜索服务器的基准无结果率的过程相似,在此不再赘述。相应的,当搜索网关需要获取搜索服务器的基准无结果率时,可以向其他电子设备发送无结果率获取请求,该无结果率获取请求中至少携带搜索网关的网关标识和搜索服务器的服务器标识;其他电子设备接收到该无结果率获取请求时,根据该搜索服务器的服务器标识,获取该搜索服务器的基准无结果率,根据搜索网关的网关标识,将该基 准无结果率发送给搜索网关,搜索网关接收其他电子设备发送的搜索服务器的基准无结果率。In another possible implementation manner, the reference non-result rate may be determined by other electronic devices, the process of determining the reference non-result rate of the search server by other electronic devices, and the process of determining the reference non-result rate of the search server by the search gateway It is similar, so I won't repeat it here. Correspondingly, when the search gateway needs to obtain the reference non-result rate of the search server, it may send a non-result rate obtaining request to other electronic devices, and the non-result rate obtaining request carries at least the gateway identification of the search gateway and the server identification of the search server; When other electronic devices receive the request for obtaining no result rate, they obtain the reference no result rate of the search server according to the server ID of the search server, and send the reference no result rate to the search gateway according to the gateway ID of the search gateway, and search The gateway receives the reference non-result rate of the search server sent by other electronic devices.
需要说明的另一点是,搜索网关可以先获取搜索服务器的当前无结果率,再获取搜索服务器的基准无结果率;搜索网关还可以先获取搜索服务器的基准无结果率再获取搜索服务器的当前无结果率;搜索网关还可以同时获取搜索服务器的当前无结果率和基准无结果率,在本公开实施例中,对此不作具体限定。也即,搜索网关可以先执行步骤(A1)再执行步骤(A2),搜索网关也可以先执行步骤(A2)再执行步骤(A1),搜索网关还可以同时执行步骤(A1)和(A2)。在本公开实施例中,对搜索网关执行步骤(A1)和(A2)的顺序不作具体限定。Another point that needs to be explained is that the search gateway can first obtain the current non-result rate of the search server, and then obtain the reference non-result rate of the search server; the search gateway can also first obtain the reference non-result rate of the search server and then obtain the current non-result rate of the search server. Result rate: The search gateway can also obtain the current non-result rate and the 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 can perform step (A1) and then step (A2), the search gateway can also perform step (A2) and then step (A1), and the search gateway can also perform steps (A1) and (A2) at the same time. . In the embodiment of the present disclosure, the order in which steps (A1) and (A2) are executed by the search gateway is not specifically limited.
(A3)搜索网关根据该当前无结果率和该基准无结果率,确定当前的无结果率增量。(A3) The search gateway determines the current non-result rate increment based on the current non-result rate and the benchmark non-result rate.
搜索网关将当前无结果率和基准无结果率之间的差值作为该搜索服务器的无结果率增量。即,该无结果率增量P1=当前无结果率-基准无结果率。The search gateway uses the difference between the current non-result rate and the reference non-result rate as the increase in the non-result rate of the search server. That is, the increase in the non-result rate P1 = the current non-result rate-the reference non-result rate.
(A4)响应于该无结果率增量大于预设阈值,搜索网关确定需要对该第一搜索请求进行降级处理。(A4) In response to the increase in the non-result rate being greater than the preset threshold, the search gateway determines that the first search request needs to be downgraded.
搜索网关可以在该无结果率增量大于预设阈值时,直接确定该第一搜索请求为需要降级处理的搜索请求。搜索网关还可以结合当前的降级率来确定是否对当前搜索请求进行降级处理,通过当前降级率来确定第一搜索请求是否为需要降级的搜索请求。相应的,搜索网关确定当前降级搜索率;响应于该当前降级搜索率小于该无结果率增量,搜索网关执行步骤(A4)。其中,该当前降级搜索率可以根据当前时间段内已降级的搜索请求的数量和当前时间段内搜索请求的总数量确定。The search gateway may directly determine that the first search request is a search request that needs to be degraded when the increase in the non-result rate is greater than the preset threshold. The search gateway may also determine whether to degrade the current search request in combination with the current degradation rate, and determine whether the first search request is a search request that needs to be degraded based on the current degradation rate. Correspondingly, the search gateway determines the current degraded search rate; in response to the current degraded search rate being less than the ineffective rate increment, the search gateway executes step (A4). Wherein, the current degraded search rate may be determined according to the number of degraded search requests in the current time period and the total number of search requests in the current time period.
在本实现方式中,通过结合当前的无结果率增量和当前降级率,确定是否对第一搜索请求进行降级处理,以便在搜索服务器超过负载的情况下,只对部分搜索请求进行降级,从而在搜索服务器的负载降低时,搜索网关可以自动停止对搜索请求进行降级,实现自动恢复搜索。In this implementation manner, by combining the current unresult rate increment and the current degradation rate, it is determined whether to downgrade the first search request, so that when the search server exceeds the load, only part of the search request is downgraded, thereby When the load of the search server is reduced, the search gateway can automatically stop downgrading the search request to automatically resume the search.
在本实现方式中,通过将搜索网关根据当前搜索服务器的工作状态,判断是否对第一搜索请求进行降级处理,从而使搜索网关可以实现确定搜索服务器当前的工作状态,确定是否对第一搜索请求进行降级处理,从而实现自动根据搜索服务器的工作状态对第一搜索请求进行降级处理,从而防止搜索服务器工作异常时,可以通过对第一搜索请求进行降级来获取该搜索请求对应的服务数据,防止终端无法获取服务数据而影响用户体验。In this implementation, the search gateway determines whether to downgrade the first search request according to the current working status of the search server, so that the search gateway can determine the current working status of the search server and determine whether to make the first search request Perform downgrade processing, so as to automatically downgrade the first search request according to the working status of the search server, so as to prevent the search server from working abnormally, you can downgrade the first search request to obtain the service data corresponding to the search request, and prevent The terminal cannot obtain the service data, which affects the user experience.
第三种实现方式,继续参见图5,搜索网关可以将第一搜索请求发送给搜索服务器,若在第一预设时长中未接收到搜索服务器返回的服务数据,则确定需要对第一搜索请求进行降级处理。该过程可以为:响应于在第一预设时长内未接收到该搜索服务器返回的搜索结果,搜索网关确定需要对该第一搜索请求进行降级处理。The third implementation manner, continue to refer to Figure 5, the search gateway can send the first search request to the search server. If the service data returned by the search server is not received within the first preset time period, it is determined that the first search request is required Perform downgrade processing. The process may be: in response to not receiving the search result returned by the search server within the first preset time period, the search gateway determines that the first search request needs to be downgraded.
需要说明的一点是,搜索网关在接收到第一搜索请求时,可以先直接将该第一搜索请求发送给搜索服务器,当在第一预设时长内未接收到搜索服务器返回的服务数据,确定需要对第一搜索请求进行降级处理;搜索网关还可以在接收到第一搜索请求时,先执行步骤(A1)-(A3),响应于该无结果率增量不大于预设阈值,向搜索服务器发送该第一搜索请求,当在第一预设时长内未接收到搜索服务器返回的服务数据,确定需要对第一搜索请求进行降级处理。It should be noted that when the search gateway receives the first search request, it can first directly send the first search request to the search server. When the service data returned by the search server is not received within the first preset time period, it is determined The first search request needs to be degraded; the search gateway may also perform steps (A1)-(A3) first when receiving the first search request, and in response to the increase in the rate of no results being not greater than the preset threshold, the search The server sends the first search request, and when the service data returned by the search server is not received within the first preset time period, it is determined that the first search request needs to be downgraded.
在本实现方式中,搜索网关根据第一预设时长内是否接收到搜索服务器返回的服务数据,确定是否需要对搜索请求进行降级处理,从而使搜索网关可以在搜索服务器不能及时返回服务数据时,将第一搜索请求进行降级处理,保证终端可以获取第一搜索请求对应的服务数据,从而保证用户体验。In this implementation, the search gateway determines whether the search request needs to be downgraded according to whether the service data returned by the search server is received within the first preset time period, so that the search gateway can, when the search server cannot return the service data in time, The first search request is degraded to ensure that the terminal can obtain the service data corresponding to the first search request, thereby ensuring user experience.
另外,搜索网关还可以根据第一搜索请求对服务数据的精度要求确定是否对第一搜索请求进行降级处理。相应的,当搜索服务器确定需要对第一搜索请求进行降级处理时,搜索网关可以再确定第一搜索请求对服务数据的精度要求。响应于第一搜索请求对应的精度要求低于目标精度要求时,才对该第一搜索请求进行降级处理。响应于第一搜索请求对应的精度要 求不低于目标精度要求,不对该第一搜索请求进行降级处理。例如,第一搜索请求中可以携带用于指示第一搜索请求的精度要求类型的指示信息。搜索服务器根据该指示信息确定该第一搜索请求信息对应的精度要求,例如,该第一搜索请求的指示信息指示第一搜索请求的精度要求类型为常规类型,则确定可以对第一搜索请求进行降级处理。该第一搜索请求的指示信息指示第一搜索请求的精度要求类型为高精度类型,则确定不可以对第一搜索请求进行降级处理。In addition, the search gateway may also determine whether to perform downgrade processing on the first search request according to the accuracy requirements of the first search request for the service data. Correspondingly, when the search server determines that the first search request needs to be downgraded, the search gateway may determine the accuracy requirements of the first search request for the service data. In response to the accuracy requirement corresponding to the first search request being lower than the target accuracy requirement, the first search request is degraded. In response to the accuracy requirement corresponding to the first search request being not lower than the target accuracy requirement, no downgrade processing is performed on the first search request. For example, the first search request may carry indication information used to indicate 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 regular type, it is determined that the first search request can be processed. Downgrade processing. The indication information of the first search request indicates that the accuracy requirement type of the first search request is a high-precision type, and it is determined that the first search request cannot be downgraded.
需要说明的一点是,搜索网关可以在确定是否对第一搜索请求进行降级处理之前,确定该第一搜索请求的精度要求类型,搜索网关也可以在确定需要对第一搜索请求进行降级之后,再确定第一搜索请求的精度要求类型,在本公开实施例中,对此不作具体限定。It should be noted that the search gateway may determine the accuracy requirement type of the first search request before determining whether to downgrade the first search request, and the search gateway may also determine that the first search request needs to be downgraded. The accuracy requirement type of the first search request is determined, which is not specifically limited in the embodiment of the present disclosure.
在本实现方式中,通过第一搜索请求对服务数据的精度要求确定是否对第一搜索请求进行降级处理,从而保证了高精度要求的第一搜索请求可以不被降级,从而保证第一搜索请求可以获取高精度的服务数据。In this implementation, the accuracy requirement of the first search request on the service data is used to determine whether to downgrade the first search request, thereby ensuring that the first search request with high accuracy requirements may not be downgraded, thereby ensuring that the first search request High-precision service data can be obtained.
步骤403:响应于需要对该第一搜索请求进行降级处理,搜索网关根据第一搜索请求从缓存中查询第一搜索请求对应的第一服务数据。Step 403: In response to the need to perform downgrade processing on the first search request, the search gateway queries the cache for the first service data corresponding to the first search request according to the first search request.
继续参见图5,当第一搜索请求需要进行降级处理时,搜索网关根据第一搜索请求,从缓存中查询该第一搜索请求对应的第一服务数据。其中,搜索网关可以根据第一搜索请求对应的搜索值,对缓存的服务数据进行匹配,从而查询第一搜索请求对应的第一服务数据。相应的,缓存中可以存储多个服务数据以及服务数据与搜索值的对应关系,当搜索网关从缓存中获取服务数据时,可以根据该搜索值,从服务数据和搜索值的对应关系中查询该第一搜索请求对应的第一服务数据。继续参见图5,响应于搜索网关从缓存中查询到了第一搜索请求的搜索值对应的服务数据,将该服务数据作为第一服务数据返送给终端;响应于搜索网关没有从缓存中查询到第一搜索请求对应的服务数据,搜索网关执行步骤404。Continuing to refer to FIG. 5, when the first search request needs to be downgraded, the search gateway queries the cache for the first service data corresponding to the first search request according to the first search request. The search gateway may match the cached service data according to the 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 can store multiple service data and the corresponding relationship between the service data and the search value. When the search gateway obtains the service data from the cache, it can query the corresponding relationship between the service data and the search value according to the search value. The first service data corresponding to the first search request. Continuing to refer to Figure 5, in response to the search gateway querying the service data corresponding to the search value of the first search request from the cache, the service data is returned to the terminal as the first service data; Upon searching for service data corresponding to the request, the search gateway executes step 404.
其中,搜索值可以根据第一搜索请求中携带的第一搜索请求信息确定,该第一搜索请求信息可以包括第一搜索请求对应的关键字、城市信息、搜索种类和用户选择的排序方式等信息。相应的,搜索服务器根据搜索值算法,将第一搜索请求信息转换成搜索值。在一种可能的实现方式中,搜索服务器可以直接将第一搜索请求信息转换成数值,得到第一搜索请求对应的搜索值;在另一种可能的实现方式中,搜索服务器可以先确定第一搜索请求信息中不同信息的权重,根据权重对第一搜索请求信息中的信息进行加成,得到第一搜索请求对应的搜索值。The search value may be determined according to the first search request information carried in the first search request, and the first search request information may include information such as keywords corresponding to the first search request, city information, search type, and sorting method selected by the user. . Correspondingly, the search server converts the first search request information into a search value according to the search value algorithm. In a possible implementation, the search server can directly convert the first search request information into a numerical value to obtain the search value corresponding to the first search request; in another possible implementation, the search server can first determine the first The weights of different information in the search request information are added to the information in the first search request information according to the weights to obtain the search value corresponding to the first search request.
另外,缓存的服务数据可以为搜索网关事先从搜索服务器中获取的核心数据,缓存的服务数据还可以为搜索网关在进行搜索服务时,接收到的搜索服务器返回的服务数据,在本公开实施例中,对此不作具体限定。相应的,搜索服务器返回服务数据时,同时返回服务数据对应的搜索值,搜索网关将服务数据和搜索值对应存储。In addition, the cached service data may be core data obtained by the search gateway from the search server in advance, and the cached service data may also be the service data returned by the search server received when the search gateway performs the search service. There is no specific limitation on this. Correspondingly, when the search server returns the service data, it also returns the search value corresponding to the service data, and the search gateway stores the service data and the search value correspondingly.
其中,该缓存可以为搜索网关的本地缓存,该缓存也可以是搜索网关调用的缓存服务器中的缓存。相应的,在一种可能的实现方式中,搜索网关直接调用本地缓存,根据第一搜索请求对应的搜索值,从本次缓存中查询与该第一搜索请求对应的第一服务数据。在本实现方式中,搜索网关将服务数据缓存在本地,不仅可以在搜索服务器发生故障时,对第一搜索请求进行降级处理,从本地缓存中查询第一搜索请求对应的第一服务数据,还防止了当搜索网关与外部的网络连接发生故障时,搜索网关可以从本地缓存中查询第一搜索请求对应的第一服务数据,从而保证了在网络异常时,搜索网关也可以查询第一搜索请求对应的第一服务数据。Wherein, the cache may be a local cache of the search gateway, and the cache may also be a cache in a cache server called by the search gateway. Correspondingly, in a possible implementation manner, the search gateway directly invokes the local cache, and queries the first service data corresponding to the first search request from the current cache according to the search value corresponding to the first search request. In this implementation, the search gateway caches the service data locally, not only can downgrade the first search request when the search server fails, and query the first service data corresponding to the first search request from the local cache, but also This prevents the search gateway from querying the first service data corresponding to the first search request from the local cache when the connection between the search gateway and the external network fails, thereby ensuring that the search gateway can also query the first search request when the network is abnormal The corresponding first service data.
在另一种可能的实现方式中,搜索网关调用缓存服务器,从缓存服务器中查询与该第一搜索请求对应的第一服务数据。相应的,搜索网关根据第一搜索请求从缓存中查询第一搜索请求对应的第一服务数据的过程可以通过以下步骤(1)-(6)实现,包括:In another possible implementation manner, the search gateway calls a cache server to query the first service data corresponding to the first search request from the cache server. Correspondingly, the process of the search gateway querying the cache for the first service data corresponding to the first search request according to the first search request can be implemented through the following steps (1)-(6), including:
(1)向缓存服务器发送该第一搜索请求信息,该缓存服务器用于缓存服务数据,根据该 第一搜索请求信息,确查询该第一搜索请求信息对应的第一服务数据。(1) Send the first search request information to a cache server, 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 actually queried.
搜索网关可以实现存储缓存服务器的服务器接口,通过缓存服务器的服务器接口与缓存服务器进行数据交互,将第一搜索请求发送给缓存服务器。The search gateway can implement the server interface of the storage cache server, exchange data with the cache server through the server interface of the cache server, and send the first search request to the cache server.
(2)缓存服务器接收第一搜索请求。(2) The cache server receives the first search request.
相应的,在本步骤中,缓存服务器通过服务器接口接收该第一搜索请求。Correspondingly, in this step, the cache server receives the first search request through the server interface.
(3)缓存服务器根据第一搜索请求从缓存的服务数据中查询该第一搜索请求对应的第一服务数据。(3) The cache server queries the cached service data for the first service data corresponding to the first search request according to the first search request.
在本步骤中,缓存服务器根据第一搜索请求对应的搜索值,从缓存的服务数据中查询第一搜索请求对应的第一服务数据。In this step, the cache server queries the cached service data for the first service data corresponding to the first search request according to the search value corresponding to the first search request.
需要说明的一点是,该第一搜索请求的搜索值可以由搜索网关确定,相应的,搜索网关可以直接将第一搜索请求对应的搜索值发送给缓存服务器,相应的,在本步骤中,缓存服务器直接根据该第一搜索请求对应的搜索值,从本地缓存的服务数据中查询该第一搜索请求对饮的第一服务数据。第一搜索请求的搜索值还可以是缓存服务器确定的,相应的,在本步骤中,缓存服务器根据第一搜索请求确定第一搜索请求对应的搜索值,根据该第一搜索请求对应的搜索值,从缓存的服务数据中查询该第一搜索请求对应的第一服务数据。It should be noted that the search value of the first search request can be determined by the search gateway. Correspondingly, the search gateway can directly send the search value corresponding to the first search request to the cache server. Correspondingly, in this step, the cache The server directly queries the locally cached service data for the first service data of the first search request according to the search value corresponding to the first search request. The search value of the first search request may also be determined by the cache server. Correspondingly, in this step, the cache server determines the search value corresponding to the first search request according to the first search request, and according to the search value corresponding to the first search request Query the first service data corresponding to the first search request from the cached service data.
其中,缓存服务器确定第一搜索请求对应的搜索值的过程与搜索网关确定第一搜索请求对应的搜索值的过程相似,在此不再赘述。The process for the cache server to determine the search value corresponding to the first search request is similar to the process for the search gateway to determine the search value corresponding to the first search request, and will not be repeated here.
(4)响应于缓存服务器中不存在该第一搜索请求对应的第一服务数据,搜索网关执行步骤404。(4) In response to the absence of the first service data corresponding to the first search request in the cache server, the search gateway executes step 404.
响应于缓存服务器没有从本地缓存的服务数据中查询到第一搜索请求对应的第一服务数据,则缓存服务器可以不向搜索网关发送第一搜索请求对应的响应,则搜索网关在第二预设时长内为接收到缓存服务器返回的响应,则搜索网关确定缓存服务器中不存在该第一搜索请求对应的第一服务数据,搜索网关执行步骤404。或者,响应于缓存服务器没有从本地缓存的服务数据中查询到第一搜索请求对应的第一服务数据,则缓存服务器向搜索网关发送目标响应,该目标响应用于指示缓存服务器中不存在第一搜索请求对应的第一服务数据,则搜索网关确定缓存服务器中不存在该第一搜索请求对应的第一服务数据,搜索网关执行步骤404。In response to the cache server not querying 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 the search gateway sets the second preset If the response from the cache server is received within the 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 executes step 404. Or, in response to the cache server not querying 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, and the target response is used to indicate that the first service data does not exist in the cache server. If the first service data corresponding to the search request is searched, 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 executes step 404.
(5)响应于缓存服务器中存在第一搜索请求对应的第一服务数据,缓存服务器将该第一服务数据发送给搜索网关。(5) In response to the presence of the first service data corresponding to the first search request in the cache server, the cache server sends the first service data to the search gateway.
响应于缓存服务器从本地缓存的服务数据中查询到第一搜索请求对应的第一服务数据,获取缓存的第一服务数据,将该第一服务数据发送给搜索网关。In response to the cache server querying the first service data corresponding to the first search request from the locally cached service data, obtain the cached first service data, and send the first service data to the search gateway.
(6)搜索网关接收该缓存服务器返回的该第一服务数据。(6) 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 this implementation, the cached service data is cached in a cache server outside the search gateway, thereby ensuring sufficient cache space, ensuring that a large amount of service data available for search can be cached in the cache, thereby ensuring that the search service can proceed smoothly .
缓存服务器缓存服务数据的过程与搜索网关缓存服务数据的过程相似,在此不再赘述。The process of the cache server caching service data is similar to the process of searching the gateway cache service data, and will not be repeated here.
需要说明的一点是,搜索网关在接收到第一搜索请求时,可以直接根据第一搜索请求中包括的第一位置信息从缓存中查询第一搜索请求对应的第一服务数据。搜索网管还可以在接收到第一搜索请求时,先根据预设精度对第一搜索请求中的第一位置信息进行截取,根据截取的第一位置信息,从缓存中查询第一搜索请求对应的第一服务数据。在本公开实施例中,对此不作具体限定。It should be noted that when the search gateway receives the first search request, it can 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 location information in the first search request according to a preset accuracy when receiving the first search request, and query the cache for the first location information corresponding to the first search request according to the intercepted first location information. The first service data. In the embodiments of the present disclosure, this is not specifically limited.
步骤404:响应于需要对该第一搜索请求进行降级处理且缓存中不存在该第一搜索请求信息对应的第一服务数据,搜索网关对该第一位置信息进行修改,得到第二位置信息。Step 404: In response to the need to perform downgrade processing on the first search request 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.
响应于该第一搜索请求中携带该第一位置信息,搜索网关通过带维度降级策略对第一搜 索请求进行降级处理。其中,该第一位置信息为第一搜索请求携带的第一位置信息。In response to the first location information being carried in the first search request, the search gateway performs downgrade processing on the first search request through a dimensional downgrade strategy. Wherein, the first location information is the first location information carried in the first search request.
其中,搜索网关可以通过以下三种方式对第一位置信息进行修改,得到第二位置信息。第一种实现方式,根据预设精准度,对第一位置信息进行截取;第二种实现方式,对第一目标字段的位置信息进行调整;第三种实现方式,删除第二目标字段的位置信息。Among them, the search gateway can modify the first location information in the following three ways to obtain the second location information. The first implementation is to intercept the first location information according to the preset accuracy; the second implementation is to adjust the location information of the first target field; the third implementation is to delete the location of the second target field information.
相应的,第一种实现方式,搜索网关根据预设精准度,对该第一位置信息进行截取,得到该第二位置信息。Correspondingly, in the first implementation manner, the search gateway intercepts the first location information according to the preset accuracy to obtain the second location information.
在本实现方式中,搜索网关根据预设精准度,截取第一位置信息中,预设精准度对应的位数,得到第二位置信息。其中,该预设精度可以为预先设置的精度值,也可以为根据预先设置的精度确定方法确定的精度值。例如,用户可以预先设置预设精度对应的精度值为5位小数,则搜索网关对任一第一位置信息进行截取时,都截取该第一位置信息的5位小数。相应与该预设精度为根据预先设置的精度确定方法确定的精度值,该预先设置的精度确定方法可以为根据第一位置信息原本的小数位数确定该预设精度对应的精度值。例如,搜索网关可以选择截取第一位置信息的80%个小数位数,则当第一位置信息有10位小数时,搜索网关可以截取到第一位置信息的第八位小数。In this implementation manner, the search gateway intercepts the number of digits corresponding to the preset accuracy in the first location information according to the preset accuracy to obtain the second location information. Wherein, the preset precision may be a preset precision value, or may be a precision value determined according to a preset precision determination method. For example, the user can pre-set the precision value corresponding to the preset precision to 5 decimal places, and then when the search gateway intercepts any first position information, it will intercept the 5 decimal places of the first position information. Correspondingly, the preset accuracy is an accuracy value determined according to a preset accuracy determination method, and the preset accuracy determination method may be to determine an accuracy value corresponding to the preset accuracy according to the original decimal places of the first position information. For example, the search gateway can choose to intercept 80% of the decimal places of the first location information, and when the first location information has 10 decimal places, the search gateway can intercept the eighth decimal place of the first location information.
第二种实现方式,搜索网关对该第一位置信息中的第一目标字段的位置信息进行调整,得到第二位置信息。In the 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.
其中,该第一目标字段为第一位置信息中的字段,且该第一目标字段为预先设置的字段。例如,第一目标字段可以为第一位置信息的末位或倒数第二位等字段。Wherein, the first target field is a field in the first location information, and the first target field is a preset field. For example, the first target field may be a field such as the last bit or the penultimate bit of the first position information.
该第一位置信息为位置坐标时,该第一目标字段可以为位置坐标中任一坐标轴对应的坐标信息中的字段,也可以为位置坐标中每个坐标轴对应的坐标信息中的字段。例如,该第一目标字段为位置坐标中的末位,第一位置信息为120.45172:28.19126,则调整后的第二位置信息可以为120.45172:28.19127,120.45173:28.19126,120.45173:28.19167等。其中,搜索网关可以随机确定该第一目标字段对应的坐标轴信息。搜索网关还可以事先确定该第一目标字段对应的坐标轴信息。搜索网关还可以根据第一位置信息中,不同的坐标轴的数值确定第一目标字段对应的坐标轴信息。例如,搜索网关可以根据第一位置信息中每个坐标轴对应的坐标值确定第一目标字段对应的坐标轴信息。搜索网关可以确定第一位置信息中,不同坐标轴对应的数值的大小,根据不同坐标轴对应的数值的大小,确定对第一位置信息的调整方式。例如,搜索网关可以增大第一位置信息中数值较小的坐标轴对应的坐标数值,或,减小第一位置信息中数据较大的坐标轴对应的坐标数值等。本公开实施例中,对此不作具体限定。When the first position information is a position coordinate, the first target field may be a field in the coordinate information corresponding to any coordinate axis in the position coordinate, or may be a field in the coordinate information corresponding to each coordinate axis in the position coordinate. For example, the first target field is the last position in the position coordinates, and the first position information is 120.45172:28.19126, and the adjusted second position information may be 120.45172:28.19127, 120.45173:28.19126, 120.45173:28.19167, etc. Wherein, the search gateway may randomly determine the coordinate axis information corresponding to the first target field. The search gateway may also determine in advance the coordinate axis information corresponding to the first target field. The search gateway may also determine the coordinate axis information corresponding to the first target field according to the values of different coordinate axes in the first location information. For example, the search gateway may determine the coordinate axis information corresponding to the first target field according to the coordinate value corresponding to each coordinate axis in the first location information. The search gateway may determine the magnitude of the values corresponding to different coordinate axes in the first location information, and determine the adjustment method for the first location information according to the magnitude of the values corresponding to the different coordinate axes. For example, the search gateway may increase the coordinate value corresponding to a coordinate axis with a smaller value in the first location information, or decrease the coordinate value corresponding to a coordinate axis with a larger data in the first location information, and so on. In the embodiments of the present disclosure, this is not specifically 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.
其中,该第二目标字段为预先设置的第一位置信息中的字段,例如,第二目标字段可以为第一位置信息的末位或倒数第二位等字段。并且,该第一位置信息为位置坐标时,该第一目标字段可以为位置坐标中任一坐标轴对应的坐标信息中的字段,也可以为位置坐标中每个坐标轴对应的坐标信息中的字段。例如,该第一目标字段为位置坐标中的末位,第一位置信息为120.45172:28.19126,则调整后的第二位置信息可以为120.45172:28.1912,120.4517:28.19126,120.4517:28.1916等。Wherein, the second target field is a field in the preset first location information. For example, the second target field may be a field such as the last bit or the penultimate bit of the first location information. Moreover, when the first position information is position coordinates, the first target field may be a field in the coordinate information corresponding to any coordinate axis in the position coordinates, or may be a field in the coordinate information corresponding to each coordinate axis in the position coordinates. Field. For example, the first target field is the last position in the position coordinates, and the first position information is 120.45172:28.19126, and 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 the embodiment of the present disclosure.
需要说明的一点是,搜索网关在对第一位置信息进行修改时,可以通过上述三种实现方式中的任一种实现方式对该第一位置信息进行修改。搜索网关还可以结合上述三种实现方式中的至少两种实现方式对第一位置信息进行修改,在本公开实施例中,对此不作具体限定。例如,搜索网关在对第一搜索请求中第一位置信息进行修改时,可以先通过第一种实现方式,对该第一位置信息进行截取,得到第三位置信息,再对第三位置信息中的第一目标字段进行调整,和/或者,删除第三位置信息中的第二目标字段,得到第二位置信息。也即,搜索网关 根据预设精准度,对该第一位置信息进行截取,得到该第三位置信息;对该第三位置信息中的第一目标字段的位置信息进行调整,得到第二位置信息。或者,搜索网关根据预设精准度,对该第一位置信息进行截取,得到该第三位置信息;删除该第三位置信息中的第二目标字段的位置信息,得到该第二位置信息。或者,搜索网关根据预设精准度,对该第一位置信息进行截取,得到该第三位置信息;对该第三位置信息中的第一目标字段的位置信息进行调整,以及,删除该第三位置信息中的第二目标字段的位置信息,得到第二位置信息。One point that needs to be explained is that when the search gateway modifies the first location information, the first location information can be modified through any one of the above three implementation manners. The search gateway may also modify the first location information in combination with at least two of the foregoing three implementation manners, 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, it can intercept the first location information through the first implementation method to obtain the third location information, and then modify the third location information. Adjust the first target field of, and/or delete the second target field in the third position information to obtain the second position information. That is, the search gateway intercepts the first location information according to the preset accuracy to obtain the third location information; adjusts the location information of the first target field in the third location information to obtain the second location information . Alternatively, the search gateway intercepts the first location information according to a preset accuracy to obtain the third location information; deletes the location information of the second target field in the third location information to obtain the second location information. Alternatively, the search gateway intercepts the first location information according to the preset accuracy to obtain the third location information; adjusts the location information of the first target field in the third location information, and deletes the third location information. The location information of the second target field in the location information obtains the second location information.
需要说明的一点是,当第一位置信息为未被截取过的位置信息时,搜索网关可以从上述三种实现方式中,选择至少一种实现方式对该第一搜索请求进行带经纬度降级新策略。当第一位置信息为实现已被截取过的位置信息时,搜索网关可以从第二种实现方式和第三种实现方式中选择至少一种实现方式对该第一搜索请求进行带经纬度降级新策略。It should be noted that when the first location information is location information that has not been intercepted, the search gateway can select at least one of the above three implementation methods to perform a new strategy of degrading the first search request with latitude and longitude. . When the first location information is the location information that has been intercepted, the search gateway can select at least one implementation from the second implementation and the third implementation to perform a new strategy of downgrading the first search request with latitude and longitude .
在本实现方式中,通过对第一搜索请求中的位置信息进行修改,得到第二位置信息,使得第一搜索请求对应的位置信息的精度降低,以便搜索网关可以从精度较低的位置信息中查询第一搜索请求对应的第一服务数据,保证了搜索网关可以获取到服务数据。In this implementation, 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, so that the search gateway can obtain the location information from the location information with lower accuracy. Querying the first service data corresponding to the first search request ensures that the search gateway can obtain the service data.
步骤405:搜索网关根据该第二位置信息和该第一搜索请求信息中用于指示搜索目标的搜索指示信息,生成该第二搜索请求信息。Step 405: The search gateway generates the second search request information according to the second location information and the search indication information used to indicate the 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 to obtain the second search request information. The search gateway may directly combine the second location information and the search indication information in the first search request information to obtain the second search request information; the search gateway may also segment the search indication information in the first search request information, Reorganize according to the word segmentation result to obtain the second search request information.
相应的,在一种可能的实现方式中,搜索网关将该第二位置信息和该第一搜索请求信息中的搜索指示信息,组成该第二搜索请求信息。Correspondingly, in a possible implementation manner, the search gateway composes the second search request information with 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 the second search request information. For example, the first search request is to search for nearby Sichuan restaurants, where the location information carried in the first search request is first location information, and the first search request information corresponding to the first search request is "Sichuan cuisine near the first location information Restaurant”, when the first location information is modified, the second search request information corresponding to the first search request is “Sichuan restaurant near the second location information”.
在本实施例中,通过将第二位置信息和第一搜索请求信息中的搜索指示信息重新进行组合,得到第二搜索请求信息,搜索网关可以通过修改后的第二搜索请求信息进行搜索,从而保证搜索网关可以获取到服务数据。In this embodiment, by recombining the second location information and the search indication information in the first search request information to obtain the second search request information, the search gateway can search through the modified second search request information, thereby Ensure that the search gateway can obtain service data.
在另一种可能的实现方式中,搜索网关对该第一搜索请求信息中包括的搜索指示信息进行分词处理,得到多个分词,根据该多个分词,确定用于表示第四位置信息的第一目标分词,将该第一目标分词表示的第四位置信息、该第二位置信息和该多个分词中除该第一目标分词以外的其他分词组成该第二搜索请求信息。In another possible implementation manner, the search gateway performs word segmentation processing on the search indication information included in the first search request information to obtain a plurality of word segments, and according to the plurality of word segmentation, determines the first part used to represent the fourth location information. A target word segmentation, the fourth position information represented by the first target word segmentation, the second position information, and other word segmentation in the plurality of word segmentation except the first target word segmentation form the second search request information.
在本实现方式中,搜索网关对搜索指示信息进行分词处理,得到多个分词,从该多个分词中获取包含位置信息的第一目标分词,将该第一目标分词转换成第四位置信息,从而通过第四位置信息、第二位置信息和其他分词组成第二搜索请求信息。例如,该搜索指示信息为“A街道附近的服装店”,则对该搜索指示信息进行分词得到两个分词分比为“A街道”和“服装店”,其中,“A街道”为可以表示位置信息的分词,则获取“A街道”对应的第四位置信息,然后将该第四位置信息、第二位置信息和“服装店”组成第二搜索请求信息。In this implementation manner, the search gateway performs word segmentation processing on the search indication information to obtain a plurality of word segments, obtains a first target word segment containing location information from the plurality of word segments, and converts the first target word segment into fourth location information, Thus, the second search request information is composed of the fourth location information, the second location information and other word segmentation. For example, if the search instruction information is "clothing store near A street", the word segmentation of the search instruction information will get two word segmentation ratios of "A street" and "clothing store", where "A street" can indicate For word segmentation of location information, the fourth location information corresponding to "A street" is obtained, and then the fourth location information, the second location information, and the "clothing store" are combined into the second search request information.
步骤406:搜索网关根据该第二搜索请求信息,从该缓存中获取该第二搜索请求信息对应的第二服务数据。Step 406: The search gateway obtains the second service data corresponding to the second search request information from the cache according to the second search request information.
其中,搜索网关根据第二搜索请求信息从缓存的服务数据中查询第二搜索请求的过程,与步骤403中搜索网关根据第一搜索请求从缓存中查询第一搜索请求对应的第一服务数据的过程相似,在此不再赘述。The process in which the search gateway queries the second search request from the cached service data according to the second search request information is the same as the process in which the search gateway queries the first service data corresponding to the first search request from the cache according to the first search request in step 403 The process is similar, so I won't repeat it here.
继续参见图5,搜索网关根据第二搜索请求信息从缓存的服务数据中查询第二搜索请求 信息,响应于搜索网关查询到第二搜索请求信息对应的第二服务数据时,该缓存中存在该第二搜索请求信息对应的第二服务数据,搜索网关获取该第二服务数据,执行步骤406。响应于搜索网关没有查询到第二搜索请求信息对应的第二服务数据时,执行步骤404,对第二搜索请求信息中的第二位置信息进行修改,得到第三位置信息;根据该第三位置信息生成第三搜索请求信息,直到根据该第三搜索请求信息从缓存中获取到该第三搜索请求信息对应的第三服务数据为止。Continuing to refer to Figure 5, the search gateway queries the cached service data for the second search request information according to the second search request information. When the search gateway queries the second service data corresponding to the second search request information, the cache exists in the cache. For the second service data corresponding to the second search request information, the search gateway obtains the second service data, and step 406 is executed. In response to the search gateway not finding the second service data corresponding to the second search request information, step 404 is executed to modify the second location information in the second search request information to obtain third location information; The information generates the third search request information until the third service data corresponding to the third search request information is obtained from the cache according to the third search request information.
需要说明的一点是,当继续对第二搜索请求信息中的第二位置信息进行修改时,可以选择步骤404中三种方式中的至少一种修改方式进行修改,并且,当仅选择一种修改方式进行修改时,不同的修改过程中,可以交替使用不同的修改方式,或使用同一种修改方式,在本公开实施例中,对此不作具体限定。It should be noted that when continuing to modify the second location information in the second search request information, at least one of the three modifications in step 404 can be selected for modification, and when only one modification is selected When the method is modified, in different modification processes, different modification methods may be used alternately, or the same modification method may be used, which is not specifically limited in the embodiments of the present disclosure.
需要说明的另一点是,当搜索网关对该第一搜索请求信息中包括的搜索指示信息进行分词处理,得到多个分词,根据该多个分词,确定用于表示第四位置信息的第一目标分词,将该第一目标分词表示的第四位置信息、该第二位置信息和该多个分词中除该第一目标分词以外的其他分词组成该第二搜索请求信息时,搜索网关还可以根据不带经纬度的降级策略对第二搜索请求信息中的其他搜索指示信息进行降级处理。Another point that needs to be explained is that when the search gateway performs word segmentation processing on the search indication information included in the first search request information to obtain multiple word segments, the first target used to represent the fourth location information is determined based on the multiple word segments Word segmentation. When the fourth position information indicated by the first target word segmentation, the second position information, and other word segmentation among the plurality of word segmentation other than the first target word segmentation to form the second search request information, the search gateway may also The downgrade strategy without latitude and longitude performs downgrade processing on other search indication information in the second search request information.
步骤407:搜索网关将该第二服务数据返回给该终端。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 the second service data and displays the second service data.
需要说明的一点是,搜索网关没有在缓存的服务数据中获取到搜索请求对应的服务数据时,可以循环多次对搜索请求进行修改,直到查询到对应的服务数据,获取该服务数据返回给终端,从而保证终端发送的搜索请求的响应率。搜索网关还可以在预定次数内对搜索请求进行修改,超过预定次数后,不再对搜索请求进行修改,直接返回出错响应,保证搜索网关返回的服务数据的有效性。One point that needs to be explained is that when the search gateway does not obtain the service data corresponding to the search request in the cached service data, it can modify the search request repeatedly until the corresponding service data is queried, and the service data is obtained and returned to the terminal , So as to ensure the response rate of the search request sent by the terminal. The search gateway can also modify the search request within a predetermined number of times. After the predetermined number of times is exceeded, the search request is no longer modified, and an error response is directly returned to ensure the validity of the service data returned by the search gateway.
在本公开实施例中,接收终端发送的第一搜索请求,获取第一搜索请求对应的第一搜索请求信息;响应于需要对第一搜索请求进行降级处理且缓存中不存在第一搜索请求信息对应的第一服务数据,对第一搜索请求信息进行修改,得到第二搜索请求信息,缓存中存在第二搜索请求信息对应的第二服务数据;根据第二搜索请求信息,从缓存中获取第二搜索请求信息对应的第二服务数据;将第二服务数据返回给终端,从而在对第一搜索请求进行降级处理时,可以保证搜索网关从缓存的服务数据中获取服务数据,返回给终端,从而保证终端发送的搜索请求可以得到响应,提高了搜索请求的响应率。In the embodiment of the present disclosure, the first search request sent by the terminal is received, and the first search request information corresponding to the first search request is obtained; in response to the need to downgrade the first search request and the first search request information does not exist in the cache Corresponding to the first service data, modify the first search request information to obtain the second search request information, and the second service data corresponding to the second search request information exists in the cache; according to the second search request information, the first search request information is obtained from the cache. 2. The second service data corresponding to the search request information; the second service data is returned to the terminal, so that when the first search request is downgraded, the search gateway can ensure that the search gateway obtains the service data from the cached service data and returns it to the terminal, Therefore, it is ensured that the search request sent by the terminal can be responded to, and the response rate of the search request is improved.
图6是根据一示例性实施例示出的一种信息搜索方法流程图,本实施例以搜索网关执行不带经纬度的降级策略为例进行说明,如图6所示,该信息搜索方法包括以下步骤:Fig. 6 is a flow chart showing an information search method according to an exemplary embodiment. This embodiment takes the search gateway to execute a downgrade strategy without latitude and longitude as an example for description. As shown in Fig. 6, the information search method includes the following steps :
步骤601:搜索网关接收终端发送的第一搜索请求,获取该第一搜索请求对应的第一搜索请求信息。Step 601: The search gateway receives the first search request sent by the terminal, and obtains the first search request information corresponding to the first search request.
在本实施例中,该第一搜索请求信息至少包括终端提供的用于指示搜索目标的搜索指示信息。该第一搜索请求信息还可以包括其他用于辅助搜索的辅助搜索信息。In this embodiment, the first search request information includes at least search indication information provided by the terminal and used to indicate a search target. The first search request information may also include other auxiliary search information used to assist the search.
本步骤与步骤401相似,在此不再赘述。This step is similar to step 401 and will not be repeated here.
步骤602:搜索网关确定是否对第一搜索请求进行降级处理。Step 602: The search gateway determines whether to perform downgrade processing on the first search request.
本步骤与步骤402相似,在此不再赘述。This step is similar to step 402 and will not be repeated here.
步骤603:响应于需要对该第一搜索请求进行降级处理,搜索网关根据第一搜索请求从缓存中查询第一搜索请求对应的第一服务数据。Step 603: In response to the need to perform downgrade processing on the first search request, the search gateway queries the cache for the first service data corresponding to the first search request according to the first search request.
本步骤与步骤403相似,在此不再赘述。This step is similar to step 403 and will not be repeated here.
步骤604:响应于需要对该第一搜索请求进行降级处理且缓存中不存在该第一搜索请求信息对应的第一服务数据,搜索网关对该第一搜索请求信息中包括的搜索指示信息进行分词 处理,得到多个分词。Step 604: In response to the need to downgrade the first search request and the first service data corresponding to the first search request information does not exist in the cache, the search gateway performs word segmentation on the search indication information included in the first search request information Processing, get multiple word segmentation.
本步骤与步骤405中对目标搜索指示信息进行分词处理的过程相似,在此不再赘述。This step is similar to the process of performing word segmentation on the target search indication information in step 405, and will not be repeated here.
步骤605:搜索网关根据每个分词的权重,从该多个分词中确定至少两个第二目标分词。Step 605: The search gateway determines at least two second target word segmentation from the plurality of word segmentation according to the weight of each word segmentation.
在本步骤中,搜索网关可以根据不同的分词携带的信息量确定每个分词的权重,从而选择携带信息量大的至少两个第二目标分词。例如,搜索指示信息为“街道A附近的服装店”,则进行分词处理得到的多个分词为“街道A”、“附近的”和“服装店”,则根据每个分词的词性和分词的含义,可以确定携带信息量较大的分词为“街道A”和“服装店”,从而将“街道A”和“服装店”作为第二目标分词。In this step, the search gateway may determine the weight of each word segmentation according to the amount of information carried by different word segmentation, thereby selecting at least two second target word segmentation that carry a large amount of information. For example, if the search instruction information is "clothing store near street A", the multiple word segmentation obtained by word segmentation are "street A", "nearby", and "clothing store". Meaning, it can be determined that the participles that carry a large amount of information are "street A" and "clothing store", so that "street A" and "clothing store" are used as the second target participles.
步骤606:搜索网关根据该至少两个第二目标分词,生成该第二搜索请求信息。Step 606: 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 can directly compose the at least two target word segmentation into the second search request information, and the search gateway can also convert the target word segmentation carrying location information in the second target word segmentation to obtain the fifth location information, and then The second search request information is formed according to the fifth location information and the second target word segmentation.
相应的,在一种可能的实现方式中,搜索网关对该至少两个第二目标分词进行拼接得到该第二搜索请求信息。在另一种可能的实现方式中,搜索网关根据每个第二目标分词的词性,从该至少两个第二目标分词中确定用于表示位置信息的第三目标分词;根据该第三目标分词表示的第五位置信息和该至少两个第二目标分词中除该第三目标分词以外的目标分词,生成该第二搜索请求信息。本步骤与步骤405中,根据第四位置信息、第二位置信息和除该第一目标分词以外的目标分词,生成该第二搜索请求信息的过程相似,在此不再赘述。Correspondingly, in a possible implementation manner, the search gateway splices the at least two second target word segmentation to obtain the second search request information. In another possible implementation manner, the search gateway determines a third target participle representing location information from the at least two second target participles according to the part of speech of each second target participle; according to the third target participle The indicated fifth position information and the target participles other than the third target participle of the at least two second target participles are used to generate the second search request information. This step is similar to the process of generating the second search request information according to the fourth location information, the second location information and the target word segmentation other than the first target word segmentation in step 405, and will not be repeated here.
步骤607:搜索网关根据该第二搜索请求信息,从该缓存中获取该第二搜索请求信息对应的第二服务数据。Step 607: The search gateway obtains the second service data corresponding to the second search request information from the cache according to the second search request information.
本步骤与步骤405相似,在此不再赘述。This step is similar to step 405 and will not be repeated here.
需要说明的一点是,响应于缓存的服务数据中不存在第二搜索请求信息对应的第二服务数据时,搜索网关可以再次执行步骤604,对第二搜索请求信息进行修改。当该第二搜索请求信息中携带第五位置信息时,搜索网关还可以通过步骤404提供的三种实现方式中的至少一种实现方式对第五位置信息进行修改。根据修改后的第二搜索请求信息得到第三搜索请求信息,直到根据第三搜索请求信息获取到第三服务数据为止。It should be noted that, in response to the second service data corresponding to the second search request information being absent in the cached service data, the search gateway may perform 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 also modify the fifth location information through at least one of the three implementation manners provided in step 404. The third search request information is obtained according to the modified second search request information, until the third service data is obtained according to the third search request information.
步骤608:搜索网关将该第二服务数据返回给该终端。Step 608: The search gateway returns the second service data to the terminal.
本步骤与步骤406相似,在此不再赘述。This step is similar to step 406 and will not be repeated here.
在本公开实施例中,接收终端发送的第一搜索请求,获取第一搜索请求对应的第一搜索请求信息;响应于需要对第一搜索请求进行降级处理且缓存中不存在第一搜索请求信息对应的第一服务数据,对第一搜索请求信息进行修改,得到第二搜索请求信息,缓存中存在第二搜索请求信息对应的第二服务数据;根据第二搜索请求信息,从缓存中获取第二搜索请求信息对应的第二服务数据;将第二服务数据返回给终端,从而在对第一搜索请求进行降级处理时,可以保证搜索网关从缓存的服务数据中获取服务数据,返回给终端,从而保证终端发送的搜索请求可以得到响应,提高了搜索请求的响应率。In the embodiment of the present disclosure, the first search request sent by the terminal is received, and the first search request information corresponding to the first search request is obtained; in response to the need to downgrade the first search request and the first search request information does not exist in the cache Corresponding to the first service data, modify the first search request information to obtain the second search request information, and the second service data corresponding to the second search request information exists in the cache; according to the second search request information, the first search request information is obtained from the cache. 2. The second service data corresponding to the search request information; the second service data is returned to the terminal, so that when the first search request is downgraded, the search gateway can ensure that the search gateway obtains the service data from the cached service data and returns it to the terminal, Therefore, it is ensured that the search request sent by the terminal can be responded to, and the response rate of the search request is improved.
图7是根据一示例性实施例示出的一种信息搜索装置的框图,如图7所示,该信息搜索装置包括:Fig. 7 is a block diagram showing an information search device according to an exemplary embodiment. As shown in Fig. 7, the information search device includes:
接收模块701,用于接收终端发送的第一搜索请求,获取该第一搜索请求对应的第一搜索请求信息;The receiving module 701 is configured to receive a first search request sent by a terminal, and obtain first search request information corresponding to the first search request;
修改模块702,用于响应于需要对该第一搜索请求进行降级处理且缓存中不存在该第一搜索请求信息对应的第一服务数据,对该第一搜索请求信息进行修改,得到第二搜索请求The modification module 702 is configured to modify the first search request information to obtain the second search request in response to the need to downgrade the first search request and the first service data corresponding to the first search request information does not exist in the cache. ask
获取模块703,用于根据该第二搜索请求信息,从该缓存中获取该第二搜索请求信息对应的第二服务数据;The obtaining module 703 is configured to obtain the second service data corresponding to the second search request information from the cache according to the second search request information;
发送模块704,用于将该第二服务数据返回给该终端。The sending module 704 is configured to return the second service data to the terminal.
在一种可能的实现方式中,该修改模块702,还用于响应于该第一搜索请求信息中包括第一位置信息,对该第一位置信息进行修改,得到第二位置信息;根据该第二位置信息和该第一搜索请求信息中用于指示搜索目标的搜索指示信息,生成该第二搜索请求信息。In a possible implementation manner, the modification module 702 is further configured to modify the first location information to obtain second location information in response to the first search request information including the first location information; 2. The location information and the search indication information used to indicate the search target in the first search request information to generate the second search request information.
在另一种可能的实现方式中,该修改模块702,还用于根据预设精准度,对该第一位置信息进行截取,得到该第三位置信息;In another possible implementation manner, the modification module 702 is further configured to intercept the first position information according to a preset accuracy to obtain the third position information;
该修改模块702,还用于对该第三位置信息中的第一目标字段的位置信息进行调整,和/或者,删除该第三位置信息中的第二目标字段的位置信息,得到该第二位置信息。The modification module 702 is further configured to adjust the position information of the first target field in the third position information, and/or delete the position information of the second target field in the third position information to obtain the second target field. location information.
在另一种可能的实现方式中,该修改模块702,还用于将该第二位置信息和该第一搜索请求信息中的搜索指示信息,组成该第二搜索请求信息;或者,In another possible implementation, the modification module 702 is further configured to form the second search request information with the second location information and the search indication information in the first search request information; or,
该修改模块702,还用于对该第一搜索请求信息中包括的搜索指示信息进行分词处理,得到多个分词,根据该多个分词,确定用于表示第四位置信息的第一目标分词,将该第一目标分词表示的第四位置信息、该第二位置信息和该多个分词中除该第一目标分词以外的其他分词组成该第二搜索请求信息。The modification module 702 is further configured to perform word segmentation processing on the search indication information included in the first search request information to obtain a plurality of word segmentation, and determine the first target word segmentation used to represent the fourth position information according to the plurality of word segmentation, The fourth location information indicated by the first target word segmentation, the second location information, and other word segmentation in the plurality of word segmentation except the first target word segmentation form the second search request information.
在另一种可能的实现方式中,该修改模块702,还用于响应于该第一搜索请求信息中不包括第一位置信息,对该第一搜索请求信息中包括的搜索指示信息进行分词处理,得到多个分词;根据每个分词的权重,从该多个分词中确定至少两个第二目标分词;根据该至少两个第二目标分词,生成该第二搜索请求信息。In another possible implementation manner, the modification module 702 is further configured to, in response to the first search request information not including the first location information, perform word segmentation processing on the search indication information included in the first search request information , Obtain a plurality of word segmentation; determine at least two second target word segmentation from the plurality of word segmentation according to the weight of each word segmentation; generate the second search request information according to the at least two second target word segmentation.
在另一种可能的实现方式中,该修改模块702,还用于将该至少两个第二目标分词组成该第二搜索请求信息;或者,In another possible implementation manner, the modification module 702 is further configured to form the at least two second target word segmentation into the second search request information; or,
该修改模块702,还用于根据每个第二目标分词的词性,从该至少两个第二目标分词中确定用于表示位置信息的第三目标分词;根据该第三目标分词表示的第五位置信息和该至少两个第二目标分词中除该第三目标分词以外的目标分词,生成该第二搜索请求信息。The modification module 702 is further configured to determine a third target participle representing location information from the at least two second target participles according to the part of speech of each second target participle; The location information and the target participles other than the third target participle of the at least two second target participles are used to generate the second search request information.
在另一种可能的实现方式中,该修改模块702,还用于将该第三目标分词表示的第五位置信息和该至少两个第二目标分词中除该第三目标分词以外的目标分词,组成该第二搜索请求信息;或者,In another possible implementation manner, the modification module 702 is further used for the fifth position information represented by the third target participle and the target participles other than the third target participle in the at least two second target participles , Compose the second search request information; or,
该修改模块702,还用于对该第五位置信息进行修改,得到第六位置信息,将该第六位置信息和该至少两个第二目标分词中除该第三目标分词以外的目标分词,组成该第二搜索请求信息。The modification module 702 is further configured to modify the fifth position information to obtain sixth position information, and the sixth position information and the target participle of the at least two second target participles other than the third target participle, Compose the second search request information.
在另一种可能的实现方式中,该装置还包括:In another possible implementation manner, the device further includes:
第一确定模块,用于获取搜索服务器的当前无结果率,以及,获取该搜索服务器的基准无结果率;根据该当前无结果率和该基准无结果率,确定当前的无结果率增量;响应于该无结果率增量大于预设阈值,确定需要对该第一搜索请求进行降级处理;或者,The first determining module is used to obtain the current non-result rate of the search server and obtain the reference non-result rate of the search server; determine the current non-result rate increment according to the current non-result rate and the reference non-result rate; In response to the increase in the non-result rate being greater than the preset threshold, it is determined that the first search request needs to be downgraded; or,
第一确定模块,还用于响应于在预设时长内未接收到该搜索服务器返回的搜索结果,确定需要对该第一搜索请求进行降级处理。The first determining module is further configured to determine that the first search request needs to be downgraded in response to not receiving the search result returned by the search server within the preset time period.
在另一种可能的实现方式中,该装置还包括:In another possible implementation manner, the device further includes:
第二确定模块,用于确定当前降级搜索率;The second determining module is used to determine the current degraded search rate;
该第一确定模块,还用于响应于该当前降级搜索率小于该无结果率增量,执行确定需要对该第一搜索请求进行降级处理的步骤。The first determining module is further configured to perform the step of determining that the first search request needs to be degraded in response to the current degraded search rate being less than the ineffective rate increment.
在另一种可能的实现方式中,该获取模块703,还用于向缓存服务器发送该第二搜索请求信息,该缓存服务器用于缓存服务数据,根据该第二搜索请求信息,确定该第二搜索请求信息对应的第二服务数据;接收该缓存服务器返回的该第二服务数据。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 used to cache service data, and determine the second search request information according to the second search request information. Search for the second service data corresponding to the request information; receive the second service data returned by the cache server.
在另一种可能的实现方式中,该接收模块701,还用于对该第一搜索请求进行解密处理,得到该第一搜索请求对应的第一位置信息和搜索指示信息,以及,根据该第一搜索请求获取该第一搜索请求对应的辅助搜索信息;将该第一位置信息、该搜索指示信息和该辅助搜索信息组成该第一搜索请求对应的第一搜索请求信息。In another possible implementation manner, the receiving module 701 is further configured to perform decryption processing on the first search request to obtain first location information and search indication information corresponding to the first search request, and according to the first search request. A search request obtains auxiliary search information corresponding to the first search request; the first location information, the search indication information, and the auxiliary search information form first search request information corresponding to the first search request.
在本公开实施例中,接收终端发送的第一搜索请求,获取第一搜索请求对应的第一搜索请求信息;响应于需要对第一搜索请求进行降级处理且缓存中不存在第一搜索请求信息对应的第一服务数据,对第一搜索请求信息进行修改,得到第二搜索请求信息,缓存中存在第二搜索请求信息对应的第二服务数据;根据第二搜索请求信息,从缓存中获取第二搜索请求信息对应的第二服务数据;将第二服务数据返回给终端,从而在对第一搜索请求进行降级处理时,可以保证搜索网关从缓存的服务数据中获取服务数据,返回给终端,从而保证终端发送的搜索请求可以得到响应,提高了搜索请求的响应率。In the embodiment of the present disclosure, the first search request sent by the terminal is received, and the first search request information corresponding to the first search request is obtained; in response to the need to downgrade the first search request and the first search request information does not exist in the cache Corresponding to the first service data, modify the first search request information to obtain the second search request information, and the second service data corresponding to the second search request information exists in the cache; according to the second search request information, the first search request information is obtained from the cache. 2. The second service data corresponding to the search request information; the second service data is returned to the terminal, so that when the first search request is downgraded, the search gateway can ensure that the search gateway obtains the service data from the cached service data and returns it to the terminal, Therefore, it is ensured that the search request sent by the terminal can be responded to, and the response rate of the search request is improved.
需要说明的是:上述实施例提供的信息搜索装置在信息搜索时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将终端的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的信息搜索装置与信息搜索方法实施例属于同一构思,其实现过程详见方法实施例,这里不再赘述。It should be noted that when the information search device provided in the above embodiment searches for information, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned function allocation can be completed by different functional modules according to needs, i.e. 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 device provided in the foregoing embodiment and the information search method embodiment belong to the same concept, and the implementation process is detailed in the method embodiment, which will not be repeated here.
图8是本公开实施例提供的一种搜索网关的结构示意图,该搜索网关800可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(Central Processing Units,CPU)801和一个或一个以上的存储器802,其中,该存储器802中存储有至少一条指令,该至少一条指令由该处理器801加载并执行以实现上述各个方法实施例提供的信息搜索方法。当然,该搜索网关800还可以具有有线或无线网络接口、键盘以及输入输出接口等部件,以便进行输入输出,该搜索网关800还可以包括其他用于实现设备功能的部件,在此不做赘述。FIG. 8 is a schematic structural diagram of a search gateway provided by an embodiment of the present disclosure. The search gateway 800 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 801 And one or more memories 802, where at least one instruction is stored in the memory 802, and the at least one instruction is loaded and executed by the processor 801 to implement the information search method provided by the foregoing method embodiments. Of course, the search gateway 800 may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface for input and output. The search gateway 800 may also include other components for implementing device functions, which will not be described here.
在示例性实施例中,还提供了一种计算机可读存储介质,计算机可读存储介质中存储至少一条指令,至少一条指令由服务器加载并执行,以实现上述实施例中信息搜索方法。该计算机可读存储介质可以是存储器。例如,该计算机可读存储介质可以是ROM(Read-Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、CD-ROM(Compact Disc Read-Only Memory,紧凑型光盘只读储存器)、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a computer-readable storage medium is also provided, and the computer-readable storage medium stores at least one instruction, and the at least one instruction is loaded and executed by a server, so as to implement the information search method in the foregoing embodiment. The computer-readable storage medium may be a memory. For example, the computer-readable storage medium may be ROM (Read-Only Memory), RAM (Random Access Memory, random access memory), CD-ROM (Compact Disc Read-Only Memory, compact disc read-only memory) Storage), magnetic tapes, floppy disks and optical data storage devices, etc.
在实例性实施例中,还提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机程序代码,该计算机程序代码存储在计算机可读存储介质中。终端的处理器从计算机可读存储介质读取该计算机程序代码,处理器执行该计算机程序代码,使得该终端执行上述方面的各种可选实现方式中提供的信息搜索方法。In an exemplary embodiment, a computer program product or computer program is also provided. The computer program product or computer program includes computer program code, and the computer program code is stored in a computer-readable storage medium. The processor of the terminal reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the terminal executes the information search method provided in the various optional implementation manners of the foregoing aspects.
在一些实施例中,本申请实施例所涉及的计算机程序可被部署在一个计算机设备上执行,或者在位于一个地点的多个计算机设备上执行,又或者,在分布在多个地点且通过通信网络互连的多个计算机设备上执行,分布在多个地点且通过通信网络互连的多个计算机设备可以组成区块链系统。In some embodiments, the computer programs involved in the embodiments of the present application can be deployed and executed on one computer device, or executed on multiple computer devices located in one location, or, in multiple locations and through communication. It is executed on multiple computer devices interconnected by a network, and multiple computer devices distributed in multiple locations and interconnected through a communication network can form a blockchain system.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,该程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the foregoing embodiments can be implemented by hardware, or by a program instructing relevant hardware to be completed. The program can be stored in a computer-readable storage medium, as mentioned above. The storage medium can be read-only memory, magnetic disk or optical disk, etc.
以上内容仅为本公开的可选实施例,并不用以限制本公开,凡在本公开的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。The above content is only optional embodiments of the present disclosure, and is not intended to limit the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure. within.

Claims (14)

  1. 一种信息搜索方法,其中,所述方法包括:An information search method, wherein the method includes:
    接收终端发送的第一搜索请求,获取所述第一搜索请求对应的第一搜索请求信息;Receiving a first search request sent by a terminal, and obtaining first search request information corresponding to the first search request;
    响应于需要对所述第一搜索请求进行降级处理且缓存中不存在所述第一搜索请求信息对应的第一服务数据,对所述第一搜索请求信息进行修改,得到第二搜索请求信息,所述缓存中存在所述第二搜索请求信息对应的第二服务数据;In response to the need to downgrade the first search request and the first service data corresponding to the first search request information does not exist in the cache, the first search request information is modified to obtain the second search request information, The second service data corresponding to the second search request information exists in the cache;
    根据所述第二搜索请求信息,从所述缓存中获取所述第二搜索请求信息对应的第二服务数据;Obtaining second service data corresponding to the second search request information from the cache according to the second search request information;
    将所述第二服务数据返回给所述终端。Returning the second service data to the terminal.
  2. 根据权利要求1所述的方法,其中,所述对所述第一搜索请求信息进行修改,得到第二搜索请求信息,包括:The method according to claim 1, wherein said modifying said first search request information to obtain second search request information comprises:
    响应于所述第一搜索请求信息中包括第一位置信息,对所述第一位置信息进行修改,得到第二位置信息;In response to the first location information included in the first search request information, modifying the first location information to obtain second location information;
    根据所述第二位置信息和所述第一搜索请求信息中用于指示搜索目标的搜索指示信息,生成所述第二搜索请求信息。The second search request information is generated according to the second location information and the search indication information used to indicate the search target in the first search request information.
  3. 根据权利要求2所述的方法,其中,所述对所述第一位置信息进行修改,得到第二位置信息,包括:The method according to claim 2, wherein said modifying said first location information to obtain second location information comprises:
    根据预设精准度,对所述第一位置信息进行截取,得到第三位置信息;Intercept the first location information according to the preset accuracy to obtain third location information;
    对所述第三位置信息中的第一目标字段的位置信息进行调整,和/或者,删除所述第三位置信息中的第二目标字段的位置信息,得到所述第二位置信息。The position information of the first target field in the third position information is adjusted, and/or the position information of the second target field in the third position information is deleted to obtain the second position information.
  4. 根据权利要求2所述的方法,其中,所述根据所述第二位置信息和所述第一搜索请求信息中用于指示搜索目标的搜索指示信息,生成所述第二搜索请求信息,包括:The method according to claim 2, wherein the generating the second search request information according to the second location information and the search indication information used to indicate the search target in the first search request information comprises:
    将所述第二位置信息和所述第一搜索请求信息中的搜索指示信息,组成所述第二搜索请求信息;或者,The second location information and the search indication information in the first search request information form the second search request information; or,
    对所述第一搜索请求信息中包括的搜索指示信息进行分词处理,得到多个分词,根据所述多个分词,确定用于表示第四位置信息的第一目标分词,将所述第一目标分词表示的第四位置信息、所述第二位置信息和所述多个分词中除所述第一目标分词以外的其他分词组成所述第二搜索请求信息。Perform word segmentation processing on the search indication information included in the first search request information to obtain a plurality of word segmentation, determine the first target word segmentation used to represent the fourth location information according to the plurality of word segmentation, and divide the first target The fourth position information represented by the word segmentation, the second position information, and other word segmentation among the plurality of word segmentation except the first target word segmentation constitute the second search request information.
  5. 根据权利要求1所述的方法,其中,所述对所述第一搜索请求信息进行修改,得到第二搜索请求信息,包括:The method according to claim 1, wherein said modifying said first search request information to obtain second search request information comprises:
    响应于所述第一搜索请求信息中不包括第一位置信息,对所述第一搜索请求信息中包括的搜索指示信息进行分词处理,得到多个分词;In response to the first search request information not including the first location information, performing word segmentation processing on the search indication information included in the first search request information to obtain multiple word segmentation;
    根据每个分词的权重,从所述多个分词中确定至少两个第二目标分词;According to the weight of each participle, determine at least two second target participles from the multiple participles;
    根据所述至少两个第二目标分词,生成所述第二搜索请求信息。According to the at least two second target word segmentation, the second search request information is generated.
  6. 根据权利要求5所述的方法,其中,所述根据所述至少两个第二目标分词,生成所述第二搜索请求信息,包括:The method according to claim 5, wherein said generating said second search request information according to said at least two second target word segmentation comprises:
    将所述至少两个第二目标分词组成所述第二搜索请求信息;或者,Compose the at least two second target word segmentation into the second search request information; or,
    根据每个第二目标分词的词性,从所述至少两个第二目标分词中确定用于表示位置信息的第三目标分词;根据所述第三目标分词表示的第五位置信息和所述至少两个第二目标分词 中除所述第三目标分词以外的目标分词,生成所述第二搜索请求信息。According to the part of speech of each second target participle, a third target participle representing position information is determined from the at least two second target participles; according to the fifth position information represented by the third target participle and the at least The target participles other than the third target participle among the two second target participles generate the second search request information.
  7. 根据权利要求6所述的方法,其中,所述根据所述第三目标分词表示的第五位置信息和所述至少两个第二目标分词中除所述第三目标分词以外的目标分词,生成所述第二搜索请求信息,包括:7. The method according to claim 6, wherein said generating according to the fifth position information represented by the third target participle and the target participles other than the third target participle in the at least two second target participles The second search request information includes:
    将所述第三目标分词表示的第五位置信息和所述至少两个第二目标分词中除所述第三目标分词以外的目标分词,组成所述第二搜索请求信息;或者,Combining the fifth position information represented by the third target participle and the target participles other than the third target participle among the at least two second target participles to form the second search request information; or,
    对所述第五位置信息进行修改,得到第六位置信息,将所述第六位置信息和所述至少两个第二目标分词中除所述第三目标分词以外的目标分词,组成所述第二搜索请求信息。The fifth position information is modified to obtain sixth position information, and the sixth position information and the target participles other than the third target participle among the at least two second target participles are combined to form the first target participle. 2. Search for requested information.
  8. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    获取搜索服务器的当前无结果率,以及,获取所述搜索服务器的基准无结果率;根据所述当前无结果率和所述基准无结果率,确定当前的无结果率增量;响应于所述无结果率增量大于预设阈值,确定需要对所述第一搜索请求进行降级处理;或者,Acquire the current non-result rate of the search server, and obtain the reference non-result rate of the search server; determine the current non-result rate increment according to the current non-result rate and the reference non-result rate; respond to the The increase in the rate of no results is greater than the preset threshold, and it is determined that the first search request needs to be downgraded; or,
    响应于在预设时长内未接收到所述搜索服务器返回的搜索结果,确定需要对所述第一搜索请求进行降级处理。In response to not receiving the search result returned by the search server within the preset time period, it is determined that the first search request needs to be downgraded.
  9. 根据权利要求8所述的方法,其中,所述确定需要对所述第一搜索请求进行降级处理之前,所述方法还包括:The method according to claim 8, wherein, before the determining that the first search request needs to be downgraded, the method further comprises:
    确定当前降级搜索率;Determine the current degraded search rate;
    响应于所述当前降级搜索率小于所述无结果率增量,执行确定需要对所述第一搜索请求进行降级处理的步骤。In response to the current degraded search rate being less than the unresult rate increment, a step of determining that the first search request needs to be degraded is performed.
  10. 根据权利要求1-9任一项所述的方法,其中,所述根据所述第二搜索请求信息,从所述缓存中获取所述第二搜索请求信息对应的第二服务数据,包括:8. The method according to any one of claims 1-9, wherein the obtaining the second service data corresponding to the second search request information from the cache according to the second search request information comprises:
    向缓存服务器发送所述第二搜索请求信息,所述缓存服务器用于缓存服务数据,根据所述第二搜索请求信息,确定所述第二搜索请求信息对应的第二服务数据;Sending the second search request information to a cache server, where the cache server is used to cache service data, and according to the second search request information, determine second service data corresponding to the second search request information;
    接收所述缓存服务器返回的所述第二服务数据。Receiving the second service data returned by the cache server.
  11. 根据权利要求1所述的方法,其中,所述获取所述第一搜索请求对应的第一搜索请求信息,包括:The method according to claim 1, wherein said acquiring first search request information corresponding to said first search request comprises:
    对所述第一搜索请求进行解密处理,得到所述第一搜索请求对应的第一位置信息和搜索指示信息,以及,根据所述第一搜索请求获取所述第一搜索请求对应的辅助搜索信息;Perform decryption processing on the first search request to obtain first location information and search indication information corresponding to the first search request, and obtain auxiliary search information corresponding to the first search request according to the first search request ;
    将所述第一位置信息、所述搜索指示信息和所述辅助搜索信息组成所述第一搜索请求对应的第一搜索请求信息。The first location 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 device, wherein the device includes:
    接收模块,用于接收终端发送的第一搜索请求,获取所述第一搜索请求对应的第一搜索请求信息;A receiving module, configured to receive a first search request sent by a terminal, and obtain first search request information corresponding to the first search request;
    修改模块,用于响应于需要对所述第一搜索请求进行降级处理且缓存中不存在所述第一搜索请求信息对应的第一服务数据,对所述第一搜索请求信息进行修改,得到第二搜索请求获取模块,用于根据所述第二搜索请求信息,从所述缓存中获取所述第二搜索请求信息对应的第二服务数据;The modification module is configured to modify the first search request information in response to the need to downgrade the first search request and the first service data corresponding to the first search request information does not exist in the cache to obtain the first search request information. 2. A search request obtaining module, configured to obtain second service data corresponding to the second search request information from the cache according to the second search request information;
    发送模块,用于将所述第二服务数据返回给所述终端。The sending module is configured to return the second service data to the terminal.
  13. 一种搜索网关,其中,所述搜索网关包括一个或多个处理器和一个或多个存储器,所述一个或多个存储器中存储有至少一条指令,所述至少一条指令由所述一个或多个处理器加 载并执行以实现如权利要求1至权利要求11任一项所述的信息搜索方法所执行的操作。A search gateway, wherein the search gateway includes one or more processors and one or more memories, and at least one instruction is stored in the one or more memories, and the at least one instruction is controlled by the one or more Each processor is loaded and executed to implement the operations performed by the information search method according to any one of claims 1 to 11.
  14. 一种非临时性计算机可读存储介质,其中,所述存储介质中存储有至少一条指令,所述至少一条指令由处理器加载并执行以实现如权利要求1至权利要求11任一项所述的信息搜索方法所执行的操作。A non-transitory computer-readable storage medium, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the method described in any one of claims 1 to 11 The operation performed by the information search method.
PCT/CN2021/090344 2020-05-26 2021-04-27 Information search WO2021238555A1 (en)

Applications Claiming Priority (2)

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

Publications (1)

Publication Number Publication Date
WO2021238555A1 true WO2021238555A1 (en) 2021-12-02

Family

ID=72434856

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/090344 WO2021238555A1 (en) 2020-05-26 2021-04-27 Information search

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
CN114139039B (en) * 2021-11-30 2022-08-09 百度在线网络技术(北京)有限公司 Service stability determination method, device, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102479207A (en) * 2010-11-29 2012-05-30 阿里巴巴集团控股有限公司 Information searching method and system and information searching equipment
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
CN107291864A (en) * 2017-06-12 2017-10-24 北京三快在线科技有限公司 A kind of searching method and device, electronic equipment
CN107924413A (en) * 2015-08-12 2018-04-17 三星电子株式会社 Bifurcated is searched for
CN108090153A (en) * 2017-12-11 2018-05-29 深圳云天励飞技术有限公司 A kind of searching method, device, electronic equipment and storage medium
CN111680210A (en) * 2020-05-26 2020-09-18 北京三快在线科技有限公司 Information searching method, device, searching gateway and storage medium

Family Cites Families (4)

* 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
CN103425659B (en) * 2012-05-15 2017-06-09 阿里巴巴集团控股有限公司 Information search method and server based on geographical position
US11294911B2 (en) * 2017-09-29 2022-04-05 Apple Inc. Methods and systems for client side search ranking improvements
CN109145020A (en) * 2018-07-23 2019-01-04 程之琴 Information query method, from server, client and computer readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102479207A (en) * 2010-11-29 2012-05-30 阿里巴巴集团控股有限公司 Information searching method and system and information searching equipment
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
CN107924413A (en) * 2015-08-12 2018-04-17 三星电子株式会社 Bifurcated is searched for
CN107291864A (en) * 2017-06-12 2017-10-24 北京三快在线科技有限公司 A kind of searching method and device, electronic equipment
CN108090153A (en) * 2017-12-11 2018-05-29 深圳云天励飞技术有限公司 A kind of searching method, device, electronic equipment and storage medium
CN111680210A (en) * 2020-05-26 2020-09-18 北京三快在线科技有限公司 Information searching method, device, searching gateway and storage medium

Also Published As

Publication number Publication date
CN111680210B (en) 2022-07-15
CN111680210A (en) 2020-09-18

Similar Documents

Publication Publication Date Title
WO2021238555A1 (en) Information search
US7630960B2 (en) Data processing systems and methods for data retrieval
US10515077B2 (en) Execution optimization of database statements involving encrypted data
US8966118B2 (en) Unauthenticated redirection requests with protection
US11720708B2 (en) Privacy preserving data collection and analysis
US20210158353A1 (en) Methods, systems, apparatuses, and devices for processing request in consortium blockchain
US11347808B1 (en) Dynamically-adaptive bloom-filter
WO2018233051A1 (en) Data release method and device, and server and storage medium
JP7238213B2 (en) Using secure multi-party computation to improve the integrity of the content selection process
KR20220126767A (en) Secure Access to Content Distribution Information Using Secure MPC and Vector Calculations
JP7509948B2 (en) Secure management of data distribution restrictions
TWI812366B (en) A data sharing method, device, equipment and storage medium
US20150220648A1 (en) Systems and Methods for Performing Machine-Implemented Tasks
CN113377817A (en) Data processing method, system, device and storage medium
CN116723002B (en) Intelligent encryption method for power report based on situation awareness
KR20220061239A (en) Privacy protection data collection and analysis
CN111651425B (en) Data extraction method, device, terminal and storage medium of data mart
CN116028950A (en) Encryption database connection query optimization method under trusted execution environment based on hash
JP2023516541A (en) Additive and subtractive noise for privacy protection
US11782901B2 (en) Method and system for performing computations in a distributed system
CN118200054B (en) Security detection method and device, storage medium and electronic equipment
TW202321949A (en) Webpage access flow limiting method and device and computer readable storage medium
Lei et al. A study of location privacy protection about k interesting points queries based on agent service
CN115374456A (en) Multi-source data fusion method and system based on tobacco retail store analysis request
JP2020008868A (en) Search and retrieval of keyed data maintained using keyed database

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21811741

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21811741

Country of ref document: EP

Kind code of ref document: A1