Retrieval result output method and system, computer equipment and storage medium

By determining the target search request and canceling other requests in multiple search request scenarios, the problem of errors in the correspondence between the results and the request when the client receives a large number of search requests, and the correct correspondence between the search results and the request is achieved.

CN119719463APending Publication Date: 2025-03-28ZHONGDIAN DATA IND CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411801938.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When the number of search requests received by the server is huge, it is difficult for the client to receive search results in a timely manner, resulting in an error in the correspondence between the search results and the request.

Method used

By detecting that the number of search requests on the current page is greater than one, the target search request is determined from each search request, other requests other than the target search request are cancelled, and the target search request results are received transmitted by the server.

Benefits of technology

Ensure that the search results output by the client match the target search request, and avoid errors in the correspondence between the search results and the request.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719463A_ABST
    Figure CN119719463A_ABST
Patent Text Reader

Abstract

The invention discloses a retrieval result output method and system, computer equipment and a storage medium, and relates to the technical field of network communication.The disclosed retrieval result output method comprises the steps that when it is detected that the number of retrieval requests of a current page is larger than one, a target retrieval request is determined from all the retrieval requests, taking other retrieval requests except the target retrieval request as to-be-adjusted requests; obtaining a preset cancel l Token instance corresponding to each request to be adjusted, and cancelling each request to be adjusted based on each cancel l Token instance; and receiving a retrieval result corresponding to the target retrieval request transmitted by the server, and outputting the retrieval result. According to the technical scheme, the technical problem of how to avoid errors of the corresponding relation between the retrieval result output by the client side and the retrieval request is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communication technology, and in particular to a search result output method, system, computer device and storage medium. Background Art

[0002] A search request is a keyword, phrase, or command that a user enters into a search engine or retrieval system to find specific information or resources. Search requests are the basis of interaction between users and search engines, helping search engines understand users' intent and thus return relevant and useful results.

[0003] Usually, after the client sends a search request to the server, the server will send the search result corresponding to the search request back to the client so that the client can display the search result. However, when the server receives a large number of search requests, it is usually difficult for the server to send the search result to the client in a timely manner, which may easily cause the user to input multiple search requests in a short period of time.

[0004] It is understandable that although the search requests received by the client are in order, the server usually has difficulty returning the search results in the order of the search requests due to the large amount of data processed by the server. Therefore, when the user initiates search requests on the client multiple times in a row, there is a problem that the corresponding relationship between the search results output by the client and the search requests is wrong. Summary of the invention

[0005] The main purpose of this application is to provide a search result output method, system, computer device and storage medium, aiming to solve the technical problem of how to avoid errors in the correspondence between the search results output by the client and the search request.

[0006] To achieve the above purpose, the present application proposes a search result output method, the method comprising:

[0007] When it is detected that the number of search requests for the current page is greater than one, determining a target search request from the search requests, and treating the other search requests except the target search request as requests to be adjusted;

[0008] Obtaining a preset cancelToken instance corresponding to each of the requests to be adjusted, and canceling each of the requests to be adjusted based on the cancelToken instance;

[0009] Receive the search result corresponding to the target search request transmitted by the server, and output the search result.

[0010] In one embodiment, the step of determining a target search request from each of the search requests includes:

[0011] Obtaining the creation time corresponding to each of the search requests, and based on the creation time, taking the latest search request among the search requests as the target search request;

[0012] or,

[0013] Extracting the search terms corresponding to each of the search requests, and combining the search terms to obtain a comprehensive search term;

[0014] A search request corresponding to the comprehensive search term is created, and the search request corresponding to the comprehensive search term is used as a target search request.

[0015] In one embodiment, the method further comprises:

[0016] After receiving the search result transmitted by the server, determining whether the search result corresponds to the target search request;

[0017] If it is detected that the search result corresponds to the target search request, the step of outputting the search result is performed;

[0018] If it is detected that the retrieval result does not correspond to the target retrieval request, the retrieval result is discarded.

[0019] In one embodiment, before the step of determining a target search request from each of the search requests when it is detected that the number of search requests for the current page is greater than one, the method further includes:

[0020] Compare the current search terms with the search terms of the created search request;

[0021] If it is detected that the current search term does not exist in the search terms of the created search request, a search request corresponding to the current search term is constructed, and a cancelToken instance corresponding to the search request is created.

[0022] In one embodiment, after the step of outputting the search result, the method further includes:

[0023] In a preset storage space, the search terms in the target search request and the search results corresponding to the target search request are stored in association;

[0024] After receiving the current search term, detecting whether the current search term is the same as the search term in the storage space;

[0025] If a search term identical to the current search term is detected in the storage space, a search result corresponding to the search term identical to the current search term is output.

[0026] In one embodiment, the step of outputting the search result includes:

[0027] Obtaining the preference information of the current user, and searching for a target search result matching the preference information in the search results corresponding to the target search request;

[0028] The target search result is output in a search result display area of ​​the current page.

[0029] In one embodiment, after the step of receiving the search result corresponding to the target search request transmitted by the server and outputting the search result, the method further includes:

[0030] Determining the waiting time according to the sending time of the target search request and the receiving time of the search result;

[0031] When it is detected that the waiting time is greater than or equal to a preset time threshold, a server busy prompt message is output in the current page.

[0032] In addition, to achieve the above purpose, the present application also proposes a search result output system, the search result output system comprising:

[0033] a target request determination module, configured to determine a target search request from the search requests when it is detected that the number of search requests for the current page is greater than one, and to use the other search requests except the target search request as requests to be adjusted;

[0034] A cancel module, used for obtaining a preset cancelToken instance corresponding to each of the requests to be adjusted, and canceling each of the requests to be adjusted based on each of the cancelToken instances;

[0035] The result display module is used to receive the search result corresponding to the target search request transmitted by the server and output the search result.

[0036] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the retrieval result output method described above.

[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the retrieval result output method described above are implemented.

[0038] In an embodiment of the present application, when it is detected that the number of retrieval requests of the current page is greater than one, a target retrieval request is determined from each retrieval request, and other retrieval requests except the target retrieval request are used as requests to be adjusted. The target retrieval request can be determined based on the multiple retrieval requests existing in the current page, so that only one target retrieval request can be retained for the retrieval function; then, a preset cancelToken instance corresponding to each request to be adjusted is obtained, and each request to be adjusted is canceled based on each cancelToken instance. For retrieval requests except the target retrieval request, it can be canceled through the cancelToken object in axios; then, the retrieval result corresponding to the target retrieval request transmitted by the server is received, and the retrieval result is output.

[0039] Therefore, when facing multiple search requests, the present application can ensure that the search results displayed on the client match the target search request by retaining only one target search request, thereby solving the technical problem of errors in the correspondence between the search results output by the client and the search request. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0042] Figure 1 A flowchart of the first embodiment of the method for outputting search results of the present application is provided;

[0043] Figure 2 This is a flow chart of determining whether a search term is repeated in Embodiment 2 of the search result output method of the present application;

[0044] Figure 3 A brief flowchart of local storage and application of the second embodiment of the search result output method of the present application;

[0045] Figure 4 This is a schematic diagram of the module structure of the search result output system of the embodiment of the present application;

[0046] Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the search result output method in the embodiment of the present application.

[0047] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0050] A search request is a keyword, phrase, or command that a user enters into a search engine or retrieval system to find specific information or resources. Search requests are the basis of interaction between users and search engines, helping search engines understand users' intent and thus return relevant and useful results.

[0051] Usually, after the client sends a search request to the server, the server will send the search result corresponding to the search request back to the client so that the client can display the search result. However, when the server receives a large number of search requests, it is usually difficult for the server to send the search result to the client in a timely manner, which may easily cause the user to input multiple search requests in a short period of time.

[0052] It is understandable that although the search requests received by the client are in order, the server usually has difficulty returning the search results in the order of the search requests due to the large amount of data processed by the server. Therefore, when the user initiates search requests on the client multiple times in a row, there is a problem that the corresponding relationship between the search results output by the client and the search requests is wrong.

[0053] To solve this problem, when it is detected that the number of retrieval requests on the current page is greater than one, a target retrieval request is determined from each retrieval request, and other retrieval requests except the target retrieval request are used as requests to be adjusted. The target retrieval request can be determined based on the multiple retrieval requests existing in the current page, so that only one target retrieval request can be retained for the retrieval function; then, the preset cancelToken instance corresponding to each request to be adjusted is obtained, and each request to be adjusted is canceled based on each cancelToken instance. For retrieval requests except the target retrieval request, it can be canceled through the cancelToken object in axios; then, the retrieval result corresponding to the target retrieval request passed by the server is received, and the retrieval result is output.

[0054] Therefore, when facing multiple search requests, the present application can ensure that the search results displayed on the client match the target search request by retaining only one target search request, thereby solving the technical problem of errors in the correspondence between the search results output by the client and the search request.

[0055] It should be noted that the execution subject of the search result output method of the present application can be a computer device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes a computer as an example of a client to illustrate various embodiments of the search result output method of the present application.

[0056] Based on this, the present application embodiment provides a search result output method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the search result output method of the present application.

[0057] In this embodiment, the search result output method includes steps S10 to S30:

[0058] Step S10, when it is detected that the number of search requests for the current page is greater than one, determining a target search request from the search requests, and treating the other search requests except the target search request as requests to be adjusted;

[0059] It is understandable that when the number of search requests for the current page is only one, the client receives only one search result, so the current page will not have a technical problem of an error in the correspondence between the search request and the search result. Therefore, this application is designed for when the number of search requests for the current page is greater than one.

[0060] It should be noted that the target search request refers to a search request obtained by combining multiple search requests.

[0061] In this embodiment, when the number of current page search requests is greater than one, it is necessary to determine the target search request from the search requests that are still in progress. Thus, multiple search requests can be converted into one search request, thereby avoiding the problem that the search request does not correspond to the search result. It is understandable that after determining the target search request, in order to avoid other search requests other than the target search request from still being transmitted to the server, the search requests other than the target search request can also be used as the search requests to be adjusted.

[0062] In a feasible implementation manner, the above step S10 includes:

[0063] Step S101, obtaining the creation time corresponding to each of the search requests, and based on the creation time, taking the latest search request among the search requests as the target search request;

[0064] It is understandable that when the current page has multiple search requests, the latest search request can be determined from the multiple search requests according to the creation time of the search request, and the latest search request can be used as the target search request. Thus, the latest search term input by the user can be used as the search basis.

[0065] Step S102, extracting the search terms corresponding to the respective search requests, and merging the search terms to obtain a comprehensive search term;

[0066] It should be noted that the search term refers to the term entered by the user on the page for searching. The comprehensive search term refers to the term obtained by combining various search terms.

[0067] Step S103: creating a search request corresponding to the comprehensive search term, and using the search request corresponding to the comprehensive search term as a target search request.

[0068] It is understandable that, in addition to using the latest search request among the various search requests as the target search request, the search terms of the various search requests in progress can also be merged to obtain a comprehensive search term. For example, the union of the various search terms is calculated, and the search terms in the union are used as the comprehensive search term. Thus, for search requests in which the user has entered search terms but has not received search results, all search terms can be obtained by merging the search terms, and then the search request can be reconstructed based on the merged search terms, so that the reconstructed search request is used as the target search request.

[0069] It is understandable that the above method of using the latest search request as the target search request can be applicable to scenarios where the search terms entered by users are quite different; and the above method of combining the search terms and creating a search request based on the combined search terms as the target search request can be applicable to scenarios where the search terms entered by users are highly similar. Therefore, the present application can improve the universality and user experience of the present application by setting different target search request determination strategies in different scenarios.

[0070] Step S20, obtaining a preset cancelToken instance corresponding to each of the requests to be adjusted, and canceling each of the requests to be adjusted based on each of the cancelToken instances;

[0071] It should be noted that the cancelToken instance is a function instance used to cancel a request when using Axios for HTTP requests. Axios is a Promise-based HTTP client for browsers and node.js.

[0072] In this embodiment, when a user initiates a search request, a new cancelToken instance will be created. This instance will be closely associated with the search request and used to control the cancellation operation of the request later. At the same time, it is also necessary to add the cancelToken instance to the configuration object of the current search request so that axios can recognize it when sending the request and make corresponding cancellation operation judgments based on it. Therefore, after determining the request to be adjusted, the request to be adjusted can be canceled based on the preset cancelToken instance corresponding to the request to be adjusted.

[0073] Step S30, receiving the search result corresponding to the target search request transmitted by the server, and outputting the search result.

[0074] It is understandable that after determining the target search request, the target search request will be transmitted to the server, and then the search result corresponding to the target search request transmitted by the server can be received, and the search result can be output to the page for the user to view.

[0075] In addition, when rendering the search results to the page, you can also use the rendering mechanism of a suitable front-end framework (such as React, Vue, etc.) according to the specific page layout and data display requirements. For example, in React, you can update the component status through setState and other methods to trigger the page to re-render and display new data.

[0076] For example, when the latest search request is used as the target search request, the principle of canceling each request to be adjusted can be: the front end maintains a global request management queue to store all ongoing but unfinished search requests and their corresponding cancelToken instances. When a new search request is initiated, the request management queue is first traversed, and for the previously unfinished search requests in the queue (that is, the requests for which the interface has not yet returned results), the old requests are canceled by calling the cancel() method of the cancelToken instance corresponding to each search request.

[0077] Specifically, the code of the above principle can be:

[0078]

[0079] Among them, requestQueue is the global request management queue; requestQueue.push function is used to add new requests and corresponding cancelToken to the queue; requestQueue.forEach is used to traverse the queue to cancel the previously unfinished requests.

[0080] In this embodiment, when it is detected that the number of retrieval requests of the current page is greater than one, a target retrieval request is determined from each retrieval request, and other retrieval requests except the target retrieval request are used as requests to be adjusted. The target retrieval request can be determined based on the multiple retrieval requests existing in the current page, so that only one target retrieval request can be retained for the retrieval function; then, the preset cancelToken instance corresponding to each request to be adjusted is obtained, and each request to be adjusted is canceled based on each cancelToken instance. For retrieval requests except the target retrieval request, it can be canceled through the cancelToken object in axios; then, the retrieval result corresponding to the target retrieval request transmitted by the server is received, and the retrieval result is output.

[0081] Therefore, when facing multiple search requests, the present application can ensure that the search results displayed on the client match the target search request by retaining only one target search request, thereby solving the technical problem of errors in the correspondence between the search results output by the client and the search request.

[0082] Furthermore, based on the above-mentioned first embodiment of the method for outputting search results of the present application, a second embodiment of the method for outputting search results of the present application is proposed.

[0083] In this embodiment, the method further includes:

[0084] Step S100, after receiving the search result transmitted by the server, determining whether the search result corresponds to the target search request;

[0085] Step S200, if it is detected that the search result corresponds to the target search request, then the step of outputting the search result is executed;

[0086] Step S300: If it is detected that the search result does not correspond to the target search request, the search result is discarded.

[0087] It is understandable that the cancelToken instance is used to cancel the request on the client side. If the request to be adjusted has been transmitted to the server before the request is canceled through the cancelToken instance, the client will still receive the search result corresponding to the request to be adjusted. Therefore, after receiving the search result, it is necessary to determine whether the search result corresponds to the target search request, so as to avoid the problem that the search terms displayed on the page do not match the search results output on the page.

[0088] In a feasible implementation, it may be possible to determine whether the search result corresponds to the target search request through an identification bit. The present application does not limit the specific method for determining whether the search result corresponds to the target search request.

[0089] Please refer to Figure 2 In a feasible implementation manner, before the above step S10, the method further includes:

[0090] Step S400, comparing the current search term with the search term of the created search request;

[0091] Step S500: If it is detected that the current search term does not exist in the search terms of the created search request, a search request corresponding to the current search term is constructed, and a cancelToken instance corresponding to the search request is created.

[0092] It is understandable that when the server fails to deliver the search results to the client due to the server being busy, the user may click the "Submit", "Search" and other buttons corresponding to the search term input box multiple times, which in turn causes the client to create duplicate search requests, wasting client resources. Therefore, after receiving the current search term, the client needs to determine whether the current search term has already created a search request, so as to avoid wasting client resources.

[0093] Please refer to Figure 3 In a feasible implementation manner, after the above step S30, the method further includes:

[0094] Step S40, in a preset storage space, the search terms in the target search request and the search results corresponding to the target search request are stored in association with each other;

[0095] It should be noted that the above storage space refers to the local storage space in the client. Associative storage refers to associating the search terms and search results through pointers, mappings, etc. on the basis of storing the search terms and search results.

[0096] Step S50, after receiving the current search term, detecting whether the current search term is the same as the search term in the storage space;

[0097] It should be noted that the current search term refers to the search term received at the current moment.

[0098] Step S60: If a search term identical to the current search term is detected in the storage space, the search result corresponding to the search term identical to the current search term is output.

[0099] It is understandable that after determining the search result corresponding to the target search request, the search terms and search results in the target search request, as well as the corresponding relationship between the search terms and the search results, can be recorded through local storage. Thus, after the user enters the search term, if the search result is recorded in the local storage area, the search result can be output without requesting the server, thereby improving the search efficiency. Of course, when the search result corresponding to the current search term is not detected in the local storage space, it is still necessary to establish a search request and obtain the search result through the server.

[0100] In a feasible implementation manner, the above step S30 includes:

[0101] Step S301, obtaining the preference information of the current user, and searching for a target search result matching the preference information in the search results corresponding to the target search request;

[0102] It should be noted that preference information is used to represent topics, fields, and other information that users are interested in.

[0103] Step S302: outputting the target search result in the search result display area of ​​the current page.

[0104] It is understandable that after determining the search results corresponding to the target search request, the search results can also be filtered according to the user's preference information to determine the target search results that meet the user's preference information. Thus, the present application can improve the user's search experience by filtering the search results according to the preference information.

[0105] In a feasible implementation manner, after the above step S30, the method further includes:

[0106] Step S70, determining the waiting time according to the sending time of the target search request and the receiving time of the search result;

[0107] It can be understood that the waiting time is the difference between the receiving time and the sending time.

[0108] Step S80: When it is detected that the waiting time is greater than or equal to a preset time threshold, a server busy prompt message is output in the current page.

[0109] In this embodiment, after the target search request is transmitted to the server, the timing can be started. If the search result of the target search request is not returned within the specified time, prompt information such as network busy and server busy can be output on the page. If the search result is received within the specified time, the waiting time can be calculated, and then based on the comparison result of the waiting time and the time threshold, it can be determined whether the server is in a busy state. Then, when it is determined that the server is in a busy state, the server busy prompt information can be output to improve the interactive experience between the user and the client.

[0110] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the search result output method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0111] This application also provides a search result output system, please refer to Figure 4 , the search result output system comprises:

[0112] A target request determination module 10, configured to determine a target search request from the search requests when it is detected that the number of search requests for the current page is greater than one, and to use the search requests other than the target search request as requests to be adjusted;

[0113] The canceling module 20 is used to obtain a preset cancelToken instance corresponding to each of the requests to be adjusted, and cancel each of the requests to be adjusted based on each of the cancelToken instances;

[0114] The result display module 30 is used to receive the search result corresponding to the target search request transmitted by the server, and output the search result.

[0115] In one embodiment, the target request determination module 10 is further configured to:

[0116] Obtaining the creation time corresponding to each of the search requests, and based on the creation time, taking the latest search request among the search requests as the target search request;

[0117] Extracting the search terms corresponding to each of the search requests, and combining the search terms to obtain a comprehensive search term;

[0118] A search request corresponding to the comprehensive search term is created, and the search request corresponding to the comprehensive search term is used as a target search request.

[0119] In one embodiment, the search result output system includes:

[0120] A first detection module, configured to determine whether the search result corresponds to the target search request after receiving the search result transmitted by the server;

[0121] A switching module, configured to execute the step of outputting the search result if it is detected that the search result corresponds to the target search request;

[0122] The content discarding module is used to discard the retrieval result if it is detected that the retrieval result does not correspond to the target retrieval request.

[0123] In one embodiment, the search result output system includes:

[0124] A content comparison module, used to compare the current search term with the search term of the created search request;

[0125] The request creation module is used to construct a search request corresponding to the current search term if it is detected that the current search term does not exist in the search terms of the created search request, and to create a cancelToken instance corresponding to the search request.

[0126] In one embodiment, the search result output system includes:

[0127] A content storage module, used to associate and store the search terms in the target search request and the search results corresponding to the target search request in a preset storage space;

[0128] A second detection module, configured to detect, after receiving the current search term, whether the current search term is the same as the search term in the storage space;

[0129] The local output module is used to output the search result corresponding to the search term identical to the current search term if a search term identical to the current search term is detected in the storage space.

[0130] In one embodiment, the result display module 30 is further used for:

[0131] Obtaining the preference information of the current user, and searching for a target search result matching the preference information in the search results corresponding to the target search request;

[0132] The target search result is output in a search result display area of ​​the current page.

[0133] In one embodiment, the search result output system further includes:

[0134] A waiting time calculation module, used to determine the waiting time according to the sending time of the target search request and the receiving time of the search result;

[0135] The page prompt module is used to output a server busy prompt message in the current page when it is detected that the waiting time is greater than or equal to a preset time threshold.

[0136] The search result output system provided by the present application adopts the search result output method in the above embodiment, which can solve the technical problem of how to avoid errors in the correspondence between the search results output by the client and the search request. Compared with the prior art, the beneficial effects of the search result output system provided by the present application are the same as the beneficial effects of the search result output method provided by the above embodiment, and other technical features of the search result output system are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0137] The present application provides a computer device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the search result output method in the above-mentioned embodiment 1.

[0138] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer device suitable for implementing an embodiment of the present application. Figure 5 The computer device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0139] like Figure 5As shown, the computer device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the computer device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the computer device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a computer device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0140] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0141] The computer device provided by the present application adopts the search result output method in the above embodiment, which can solve the technical problem of how to avoid errors in the correspondence between the search results output by the client and the search request. Compared with the prior art, the beneficial effects of the computer device provided by the present application are the same as the beneficial effects of the search result output method provided by the above embodiment, and other technical features in the computer device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0142] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0143] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0144] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the search result output method in the above-mentioned embodiment.

[0145] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0146] The computer-readable storage medium may be included in the computer device; or may exist independently without being installed in the computer device.

[0147] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by a computer device, the computer device: when it is detected that the number of retrieval requests for the current page is greater than one, determines the target retrieval request from each retrieval request, and treats other retrieval requests except the target retrieval request as requests to be adjusted; obtains a preset cancelToken instance corresponding to each request to be adjusted, and cancels each request to be adjusted based on each cancelToken instance; receives the retrieval result corresponding to the target retrieval request transmitted by the server, and outputs the retrieval result.

[0148] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0149] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0150] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0151] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned search result output method, and can solve the technical problem of how to avoid errors in the correspondence between the search results output by the client and the search request. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the search result output method provided by the above-mentioned embodiment, and will not be repeated here.

[0152] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A search result output method, characterized in that: The search result output method comprises: When it is detected that the number of search requests for the current page is greater than one, determining a target search request from the search requests, and treating the other search requests except the target search request as requests to be adjusted; Obtaining a preset cancelToken instance corresponding to each of the requests to be adjusted, and canceling each of the requests to be adjusted based on the cancelToken instance; Receive the search result corresponding to the target search request transmitted by the server, and output the search result.

2. The search result output method according to claim 1, characterized in that: The step of determining a target search request from each of the search requests comprises: Obtaining the creation time corresponding to each of the search requests, and based on the creation time, taking the latest search request among the search requests as the target search request; or, Extracting the search terms corresponding to each of the search requests, and combining the search terms to obtain a comprehensive search term; A search request corresponding to the comprehensive search term is created, and the search request corresponding to the comprehensive search term is used as a target search request.

3. The search result output method according to claim 1, characterized in that: The method further comprises: After receiving the search result transmitted by the server, determining whether the search result corresponds to the target search request; If it is detected that the search result corresponds to the target search request, the step of outputting the search result is performed; If it is detected that the retrieval result does not correspond to the target retrieval request, the retrieval result is discarded.

4. The search result output method according to claim 1, characterized in that: Before the step of determining a target search request from each of the search requests when it is detected that the number of search requests for the current page is greater than one, the method further includes: Compare the current search terms with the search terms of the created search request; If it is detected that the current search term does not exist in the search terms of the created search request, a search request corresponding to the current search term is constructed, and a cancelToken instance corresponding to the search request is created.

5. The search result output method according to claim 1, characterized in that: After the step of outputting the search result, the method further includes: In a preset storage space, the search terms in the target search request and the search results corresponding to the target search request are stored in association; After receiving the current search term, detecting whether the current search term is the same as the search term in the storage space; If a search term identical to the current search term is detected in the storage space, a search result corresponding to the search term identical to the current search term is output.

6. The search result output method according to claim 1, characterized in that: The step of outputting the search result comprises: Obtaining the preference information of the current user, and searching for a target search result matching the preference information in the search results corresponding to the target search request; The target search result is output in a search result display area of ​​the current page.

7. The search result output method according to claim 1, characterized in that: After the step of receiving the search result corresponding to the target search request transmitted by the server and outputting the search result, the method further includes: Determining the waiting time according to the sending time of the target search request and the receiving time of the search result; When it is detected that the waiting time is greater than or equal to a preset time threshold, a server busy prompt message is output in the current page.

8. A search result output system, characterized in that: The search result output system comprises: a target request determination module, configured to determine a target search request from the search requests when it is detected that the number of search requests for the current page is greater than one, and to use the other search requests except the target search request as requests to be adjusted; A cancel module, used for obtaining a preset cancelToken instance corresponding to each of the requests to be adjusted, and canceling each of the requests to be adjusted based on each of the cancelToken instances; The result display module is used to receive the search result corresponding to the target search request transmitted by the server and output the search result.

9. A computer device, characterized in that: The computer device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the search result output method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the search result output method according to any one of claims 1 to 7 are implemented.