Search Method, Device, Electronic Device, and Storage Medium
By dynamically adjusting the search result acquisition method in the search engine system and reserving the current target business volume based on historical search volume, the search flexibility problem during operation activities is solved, timely response of non-target services and real-time guarantee of target services is achieved, and the stability and efficiency of the overall search system are improved.
Patent Information
- Application Number
- CN202111396649.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-23
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-11-23
AI Technical Summary
During the Internet product operation activities, the search engine system faces high traffic shocks, resulting in poor flexibility in search results and it is difficult to ensure the search efficiency and availability of non-target services and target services at the same time.
By obtaining the search engine system's non-target business search volume in the historical time period, determining the target business reservation volume in the current time period, and switching in real time the way of obtaining search results based on the search volume, including from the search engine system, the target business subsystem and preset bypass cache results, to achieve flexible search results acquisition.
It improves the flexibility and efficiency of searches, ensures that non-target services requests are responded in a timely manner, and at the same time, the bypass cache results are used to ensure the real-time and availability of target services during peak search volumes of target services, and avoids the crash of the search system.
Smart Images

Figure CN116150459B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and particularly relates to a search method, apparatus, electronic device, and storage medium. Background Art
[0002] With the rapid development of the current Internet, in order to improve user activity, some product operation activities are often held. For example, if a user performs a certain operation within a period of time, they can obtain the activity rewards corresponding to the operation, and so on. Generally, during the activity period, the access traffic for searching product operation activities is relatively high. Especially at the moment when the activity starts, a large number of users will perform operations simultaneously, generating requests and sending them to the server, bringing a great traffic impact to the search engine system.
[0003] To ensure the stability of the operation activity search server and ensure the normal response of the activity, generally, the search results corresponding to the operation activity words are cached in advance, and the corresponding search results can be directly obtained from the cache and returned to the user during the peak activity traffic period, resulting in poor search flexibility. Summary of the Invention
[0004] Embodiments of the present application provide a search method, apparatus, electronic device, and storage medium, which can effectively improve the flexibility of search.
[0005] Embodiments of the present application provide a search method, including:
[0006] Obtain the non-target business search volume of the search engine system in a historical time period, where the search engine system includes at least one target business subsystem;
[0007] Determine the target business reservation volume in the current time period based on the non-target business search volume in the historical time period;
[0008] Real-time statistics of the target business search volume in the current time period. When the target business search volume is less than the target business reservation volume, obtain the search results of the search engine system in real time;
[0009] When the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem, obtain the search results of the target business subsystem, and update the preset bypass cache results using the search results of the target business subsystem, where the preset bypass cache results are the search results based on the target business and pre-cached in the bypass system of the search engine system;
[0010] When the target business search volume is greater than or equal to the target business reservation volume and greater than or equal to the search capacity of the target business subsystem, obtain the preset bypass cache results of the search engine system.
[0011] Correspondingly, an embodiment of the present application further provides a search device, including:
[0012] An obtaining unit, configured to obtain the non-target business search volume of the search engine system in a historical time period, where the search engine system includes at least one target business subsystem;
[0013] A determining unit, configured to determine the target business reservation volume in the current time period based on the non-target business search volume in the historical time period;
[0014] A first search unit, configured to statistically obtain the target business search volume in real time in the current time period. When the target business search volume is less than the target business reservation volume, obtain the search results of the search engine system in real time;
[0015] A second search unit, configured to obtain the search results of the target business subsystem and update the preset bypass cache results by using the search results of the target business subsystem when the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem, where the preset bypass cache results are search results based on the target business and pre-cached in the bypass system of the search engine system;
[0016] A third search unit, configured to obtain the preset bypass cache results of the search engine system when the target business search volume is greater than or equal to the target business reservation volume and greater than or equal to the search capacity of the target business subsystem.
[0017] Optionally, in some embodiments, the determining unit may specifically be configured to determine the non-target business reservation volume in the current time period based on the non-target business search volume in the historical time period; and determine the target business reservation volume in the current time period according to the search capacity of the search engine system and the non-target business reservation volume.
[0018] Optionally, in some embodiments, the determining unit may specifically be configured to obtain the upper limit of the search capacity of each business type subsystem in the search engine system; and determine the minimum value of the upper limits of the search capacities in the business type subsystems as the search capacity of the search engine system.
[0019] Optionally, in some embodiments, the first search unit may be specifically configured to, when the search engine system receives a search query request, obtain the query keyword corresponding to the search query request; if the query keyword is a target service keyword, update the target service search volume for the current time period based on the search query request; if the query keyword is not a target service keyword, update the non-target service search volume for the current time period based on the search query request, and obtain the search result corresponding to the search query request from the search engine system.
[0020] Optionally, in some embodiments, the first search unit may be specifically configured to, when the acquisition of the search result of the search engine system fails in real time, obtain the preset bypass cache result corresponding to the target service.
[0021] Optionally, in some embodiments, the second search unit may be specifically configured to, when the target service search volume is greater than or equal to the target service reservation volume, obtain the search capacity of the target service subsystem corresponding to the target service; if the target service search volume is less than the search capacity of the target service subsystem, obtain the search result corresponding to the target service from the target service subsystem in real time through the search engine system; obtain the preset bypass cache result corresponding to the target service, and update the preset bypass cache result corresponding to the target service by using the search result corresponding to the target service obtained in real time by the search engine system to obtain an updated bypass cache result.
[0022] Optionally, in some embodiments, the second search unit may be specifically configured to fuse the search result corresponding to the target service obtained in real time by the search engine system with the updated bypass cache result to obtain a fused search result; use the fused search result as the target search result of the target service; if the acquisition of the search result corresponding to the target service by the search engine system fails in real time, use the preset bypass cache result as the target search result of the target service.
[0023] Optionally, in some embodiments, the third search unit may be specifically configured to, when the target service search volume is greater than or equal to the target service reservation volume, obtain the search capacity of the target service subsystem corresponding to the target service; if the target service search volume is greater than or equal to the search capacity of the target service subsystem, obtain the preset bypass cache result corresponding to the target service.
[0024] Optionally, in some embodiments, the search device may further include a cache unit, which is specifically configured to retrieve a target warm-up task from the first warm-up task queue, where the target warm-up task carries the service information of the target service; execute the target warm-up task according to the service information of the target service to obtain a first warm-up result corresponding to the target service; store the first warm-up result and the service information in a bypass system in a corresponding manner, and add the target warm-up task to the task loop queue; when the target warm-up task is retrieved from the task loop queue, execute the target warm-up task according to the service information of the target service to obtain a second warm-up result corresponding to the target service; store the second warm-up result and the service information in a bypass system in a corresponding manner to obtain a preset bypass cache result.
[0025] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps in any one of the search methods provided by the embodiments of the present application.
[0026] In addition, an embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the steps in any one of the search methods provided by the embodiments of the present application.
[0027] According to one aspect of the present application, there is provided a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various optional implementation manners of the above search aspect.
[0028] This embodiment can obtain the non-target business search volume of the search engine system in a historical time period, where the search engine system includes at least one target business subsystem; then, determine the target business reservation volume for the current time period based on the non-target business search volume in the historical time period; next, statistically count the target business search volume in the current time period in real time. When the target business search volume is less than the target business reservation volume, obtain the search results of the search engine system in real time; when the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem, obtain the search results of the target business subsystem and update the preset bypass cache results with the search results of the target business subsystem, where the preset bypass cache results are the search results based on the target business and pre-cached in the bypass system of the search engine system; when the target business search volume is greater than or equal to the target business reservation volume and greater than or equal to the search capacity of the target business subsystem, obtain the preset bypass cache results of the search engine system. This solution can effectively improve the flexibility of the search. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0030] Figure 1a is a schematic diagram of the scenario of the search method provided by the embodiment of the present application;
[0031] Figure 1b is the first flowchart of the search method provided by the embodiment of the present application;
[0032] Figure 2a is the second flowchart of the search method provided by the embodiment of the present application;
[0033] Figure 2b is a schematic diagram of the active and inactive traffic statistics provided by the embodiment of the present application;
[0034] Figure 2c is the third flowchart of the search method provided by the embodiment of the present application;
[0035] Figure 2d is a search schematic diagram provided by the embodiment of the present application;
[0036] Figure 3 is a schematic diagram of the structure of the search device provided by the embodiment of the present application;
[0037] Figure 4It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0038] Next, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present application.
[0039] The principle of the present application is illustrated by way of example in a suitable computing environment. In the following description, specific embodiments of the present application will be described with reference to steps and symbols executed by one or more computers, unless otherwise stated. Therefore, these steps and operations will be referred to several times as being executed by a computer. As used herein, a computer execution includes operations of a computer processing unit that represents electronic signals in a structured form of data. This operation transforms the data or maintains it at a location in the computer's memory system, which can be reconfigured or otherwise changed in a manner well known to those skilled in the art to change the operation of the computer. The data structure maintained by the data is the physical location of the memory, which has specific characteristics defined by the data format. However, the principle of the present application is described in the above text, which does not represent a limitation. Those skilled in the art will understand that the following various steps and operations can also be implemented in hardware.
[0040] The term "unit" as used herein can be regarded as a software object executed on the computing system. Different components, units, engines, and services herein can be regarded as implementation objects on the computing system. The devices and methods herein can be implemented in software, and of course, they can also be implemented in hardware, all within the protection scope of the present application.
[0041] The terms "first", "second", "third", etc. in the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units. Instead, some embodiments also include steps or units not listed, or some embodiments also include other steps or units inherent to these processes, methods, products, or devices.
[0042] References to "embodiments" in this specification mean that a particular feature, structure, or characteristic described in connection with the embodiments can be included in at least one embodiment of the present application. The phrase appears in various places in the specification and is not necessarily referring to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive of other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0043] An embodiment of the present application provides a search method, apparatus, electronic device, and storage medium. Among them, the search apparatus can be integrated in the electronic device, and the electronic device can be a server or a terminal device, etc.
[0044] For example, as Figure 1aAs shown in the figure, first, the electronic device integrated with the search device can obtain the non-target business search volume of the search engine system in the historical time period, where the search engine system includes at least one target business subsystem; then, determine the target business reservation volume for the current time period based on the non-target business search volume in the historical time period; next, statistically count the target business search volume in real time for the current time period. When the target business search volume is less than the target business reservation volume, obtain the search results of the search engine system in real time; when the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem, obtain the search results of the target business subsystem, and use the search results of the target business subsystem to update the preset bypass cache results, where the preset bypass cache results are the search results based on the target business and pre-cached in the bypass system of the search engine system; when the target business search volume is greater than or equal to the target business reservation volume and greater than or equal to the search capacity of the target business subsystem, obtain the preset bypass cache results of the search engine system. Since this solution can flexibly use the preset bypass cache results according to the actual search volume, slide the time period to statistically count the real-time search volume of the target business and non-target business, use the non-target business search volume in the previous time period as a reference to reserve the non-target business search volume for the current time period, and protect the requests for the non-target business search volume; at the same time, according to the comparison between the target business search volume and the upper limit of the target business capacity, and the comparison between the overall search volume and the normal capacity upper limit of the search engine, automatically flexibly switch between several search result acquisition methods such as full-service real-time search, target business real-time search, fusion of non-target business using preset bypass cache results, and full-service using preset bypass cache results, which greatly improves the flexibility of the search. This solution not only protects the requests for the non-target business search volume; at the same time, when the overall search volume is low, it fully guarantees the timeliness of the overall search results by recalling through the search engine system. When the target business search volume does not exceed the upper limit of the target business type capacity, it obtains the target business type results in real time, ensuring the real-time nature of the target business type and maximizing the use of the service capabilities of the target business subsystem; the preset bypass cache results are used as the overall fallback results and are used when the traffic is high or the request fails, ensuring the availability of the target business search results and greatly improving the search efficiency.
[0045] The following will be described in detail respectively. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments.
[0046] This embodiment will be described from the perspective of the search device. The search device can be specifically integrated in an electronic device, which can be a server or a terminal device, etc.; among them, the terminal can include devices such as mobile phones, tablet computers, laptop computers, and personal computers (PCs).
[0047] A search method includes: obtaining the non-target business search volume of a search engine system in a historical time period, where the search engine system includes at least one target business subsystem; then, determining the target business reservation volume for the current time period based on the non-target business search volume in the historical time period; next, statistically counting the target business search volume in the current time period in real time. When the target business search volume is less than the target business reservation volume, obtaining the search results of the search engine system in real time; when the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem, obtaining the search results of the target business subsystem and updating the preset bypass cache results with the search results of the target business subsystem, where the preset bypass cache results are the search results based on the target business and pre-cached in the bypass system of the search engine system; when the target business search volume is greater than or equal to the target business reservation volume and greater than or equal to the search capacity of the target business subsystem, obtaining the preset bypass cache results of the search engine system.
[0048] As Figure 1b shown, the specific process of this search method can be as follows:
[0049] 101. Obtain the non-target business search volume of the search engine system in the historical time period, where the search engine system includes at least one target business subsystem.
[0050] Among them, the search engine system can refer to a system that retrieves specified information from the Internet according to user needs and certain algorithms and uses specific strategies to feedback it to the user. The bypass system can refer to a system other than the normal information storage of the search engine system. In the embodiments of the present application, the bypass data storage of the target business can be realized through the bypass system, and a certain task or certain tasks in the search engine system can be completed without affecting the current running process of the search engine system.
[0051] The historical time period can refer to the time period before the current time period. In order to make the real-time performance of the search results stronger, the historical time period can specifically refer to the previous time period of the current time period. Among them, the time period can refer to a preset time of a certain length, such as 100 ms, etc.
[0052] Among them, there are many ways to set the time period. For example, it can be flexibly set according to the actual application requirements, or it can be preset and stored in the electronic device. In addition, the time period can be built into the electronic device, or it can be stored in the memory and sent to the electronic device, etc.
[0053] Among them, the search service can include non-target services and at least one target service. The target service can refer to a service preset in the search service. For example, specifically, it can refer to an operation activity in the search operation activity, and so on. The non-target service can refer to a service that is not preset in the search service. For example, specifically, it can refer to a non-operation activity in the search operation activity, and so on.
[0054] Among them, the service can be to display a preset page after the user searches for a certain keyword in the search engine system, or the service can be that the user obtains a consumption voucher after interacting with a certain social account in the social application, or the service can be that the user clicks on a certain control in the game application to obtain a game reward, and so on.
[0055] Among them, the search engine system can include at least one target service subsystem. For example, the search service can include multiple target services, and each target service corresponds to a subsystem. For example, the activity service is divided into multiple activity services according to different operation activities, and the activity service is also one of the subsystems of the search engine.
[0056] 102. Determine the target service reservation volume for the current time period based on the non-target service search volume in the historical time period.
[0057] For example, specifically, the non-target service reservation volume for the current time period can be determined based on the non-target service search volume in the historical time period; the target service reservation volume for the current time period can be determined according to the search capacity of the search engine system and the non-target service reservation volume.
[0058] Among them, the search engine system can include multiple service type subsystems. The capacity C of the search engine system is determined by the minimum value among the upper limits of the capacities of each service type subsystem of the engine. For example, the search engine system can include three service types: articles, videos, and music. The upper limits of their subsystem capacities can be expressed in terms of the number of requests per second (Queries-per-second, QPS, also known as the query rate per second). For example, for articles, videos, and music, they are 3200 qps, 3000 qps, and 2500 qps respectively. Then the capacity of the search engine system is 2500 qps, and so on. For example, specifically, the upper limit of the search capacity of each service type subsystem in the search engine system can be obtained; the minimum value among the upper limits of the search capacities of the service type subsystems is determined as the search capacity of the search engine system.
[0059] For example, when the current time period starts, the non-target business search volume L0 of the previous time period can be used as a reference and regarded as the non-target business reservation volume for the current time period. When the non-target business search volume does not exceed L0, the search volume directly requested by the target business search to recall from the search engine system is C - L0; when the non-target business search volume exceeds L0 (such as L0'), the search volume directly requested by the target business search to recall from the engine is C - L0'. The non-target business search volume L0 of the previous time period is used as the non-target business reservation volume for the current time period. Then, based on the capacity C of the search engine system and the non-target business search volume L0' of the current time period, the search volume A that allows the target business search volume to directly request the engine to recall is obtained as A = min(C - L0, C - L0').
[0060] 103. Real-time statistics of the target business search volume in the current time period. When the target business search volume is less than the target business reservation volume, the search results of the search engine system are obtained in real time.
[0061] For example, specifically, when the search engine system receives a search query request, the query keyword corresponding to the search query request is obtained; if the query keyword is a target business keyword, the target business search volume in the current time period is updated based on the search query request; if the query keyword is not a target business keyword, the non-target business search volume in the current time period is updated based on the search query request, and the search results corresponding to the search query request are obtained from the search engine system. For instance, when a search query request arrives, it is determined whether it is a target business keyword. If it is a target business keyword, the corresponding target business search volume count is incremented by 1. If it is not a target business keyword, the non-target business search volume count is incremented by 1. The non-target business search volume can directly request the search engine system to obtain search results.
[0062] Among them, the query keyword can refer to information that can trigger the processing of a business, including but not limited to characters, words, links, and pictures input by the user, or instructions generated based on the user's operations in the search engine system, etc.
[0063] To ensure the availability of the target business search results, improve the search efficiency, and ensure the normal use of the search engine system, when the search results of the search engine system cannot be obtained successfully, the preset bypass cache results can be obtained. For example, specifically, when the search results of the search engine system cannot be obtained in real time, the preset bypass cache results corresponding to the target business are obtained.
[0064] For example, if the target business search volume of the current time period statistically in real time by the target business i is Li, then the total target business search volume in the current time period is Lt = L1 + L2 + … + LN. If Lt < A, the current query keyword search request first obtains real-time result recall through the request search engine system. If the request fails, the preset bypass cache result is returned as the search result.
[0065] To improve search efficiency, the search results of the target business can be cached in advance in the bypass system of the search engine system, that is, the search results of the target business are cached in advance in the bypass system of the search engine system. Among them, there are many ways to cache the search results of the target business in the bypass system of the search engine system, which are not limited here. To ensure the timeliness of the data stored in the cache and reduce the dependence on human resources, for example, a bypass preheating mechanism with three queues for preheating can be used. Preheating tasks are generated through target business configuration, the preheating tasks are added to the fast queue to start the bypass preheating process, and the tasks are added to the circular queue and the preheating queue for cyclic preheating according to the time period. Among them, the fast queue ensures that the newly modified target business can be quickly preheated for results, the circular queue improves the timeliness of the preheated results, and the preheating queue preheats the target business from the global cache center to the local cache in advance to avoid penetration of the global cache center during peak traffic. For example, specifically, the target preheating task can be taken out from the first preheating task queue, and the target preheating task carries the business information of the target business; the target preheating task is executed according to the business information of the target business to obtain the first preheating result corresponding to the target business; the first preheating result is stored in the bypass system corresponding to the business information, and the target preheating task is added to the task circular queue; when the target preheating task is taken out from the task circular queue, the target preheating task is executed according to the business information of the target business to obtain the second preheating result corresponding to the target business; the second preheating result is stored in the bypass system corresponding to the business information to obtain the preset bypass cache result.
[0066] 104. When the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem, obtain the search results of the target business subsystem, and update the preset bypass cache result by using the search results of the target business subsystem.
[0067] Among them, the preset bypass cache result is the search result based on the target business and cached in advance in the bypass system of the search engine system.
[0068] To improve the timeliness of the preset bypass cache results and thus enhance the timeliness of the search, the preset bypass cache results can be updated using the search results obtained in real time. For example, specifically, when the search volume of the target service is greater than or equal to the reserved volume of the target service, the search capacity of the target service subsystem corresponding to the target service can be obtained; if the search volume of the target service is less than the search capacity of the target service subsystem, the search results corresponding to the target service are obtained in real time from the target service subsystem through the search engine system; the preset bypass cache results corresponding to the target service are obtained, and the preset bypass cache results corresponding to the target service are updated using the search results corresponding to the target service obtained in real time by the search engine system to obtain the updated bypass cache results.
[0069] To improve the comprehensiveness of the returned target search results, the search results of the target service can be fused with the preset bypass cache results before being returned. For example, specifically, the search results corresponding to the target service obtained in real time by the search engine system are fused with the updated bypass cache results to obtain the fused search results; the fused search results are used as the target search results of the target service; if the search results corresponding to the target service cannot be obtained in real time by the search engine system, the preset bypass cache results are used as the target search results of the target service.
[0070] For example, as the search volume of the target service in the current time period gradually increases, i.e., when Lt >= A, assuming that the current search query request query is a request for target service i, the search volume of target service i in the current time period is Li, and the upper limit of its subsystem capacity is Ci. If Li < Ci, the search results of the target service subsystem are obtained separately through the search engine system, and at the same time, the preset bypass cache results are obtained. The search results of the target subsystem in the preset bypass cache results are replaced with the search results of the target service subsystem recalled in real time by the search engine system, and the real-time search results of the target service subsystem and the preset bypass cache results are fused and returned as the final search results. If the search results of the target service subsystem cannot be obtained through the search engine system, the preset bypass cache results are directly used as the final search results.
[0071] 105. When the search volume of the target service is greater than or equal to the reserved volume of the target service and greater than or equal to the search capacity of the target service subsystem, obtain the preset bypass cache results of the search engine system.
[0072] For example, specifically, when the search volume of the target service is greater than or equal to the reserved volume of the target service, the search capacity of the target service subsystem corresponding to the target service is obtained; if the search volume of the target service is greater than or equal to the search capacity of the target service subsystem, the preset bypass cache result corresponding to the target service is obtained. For instance, if Li >= Ci, the preset bypass cache result is directly obtained and returned as the final search result.
[0073] It should be noted that in order to improve the security of the search, all data storage in the above method is stored in the blockchain. Among them, the blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. The blockchain, in essence, is a decentralized database, a series of data blocks generated by using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. The blockchain can include the blockchain underlying platform, the platform product service layer, and the application service layer.
[0074] The blockchain underlying platform can include processing modules such as user management, basic services, smart contracts, and operation monitoring. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining the generation of public and private keys (account management), key management, and the maintenance of the correspondence between the real identity of the user and the blockchain address (permission management). And under the authorization, it supervises and audits the transaction situations of certain real identities, and provides the rule configuration for risk control (risk control audit); the basic service module is deployed on all blockchain node devices, used to verify the validity of business requests, and after consensus on the valid requests, record them on the storage. For a new business request, the basic service first performs interface adaptation parsing and authentication processing (interface adaptation), then encrypts the business information through the consensus algorithm (consensus management), and after encryption, transmits it to the shared ledger completely and consistently (network communication), and records and stores it; the smart contract module is responsible for the registration and issuance of contracts, as well as the triggering and execution of contracts. Developers can define contract logic through a certain programming language, publish it to the blockchain (contract registration), and according to the logic of the contract terms, call keys or other events to trigger the execution, complete the contract logic, and at the same time also provide the functions of contract upgrade and cancellation; the operation monitoring module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation during the product release process, and the visual output of the real-time state during the product operation, such as: alarming, monitoring the network situation, monitoring the health status of node devices, etc.
[0075] The platform product service layer provides the basic capabilities and implementation frameworks of typical applications. Developers can build on these basic capabilities, overlay the characteristics of the business, and complete the blockchain implementation of the business logic. The application service layer provides application services based on the blockchain solution for business participants to use.
[0076] As can be seen from the above, in this embodiment, the non-target business search volume of the search engine system in the historical time period can be obtained. The search engine system includes at least one target business subsystem. Then, based on the non-target business search volume in the historical time period, the target business reservation volume in the current time period is determined. Next, the target business search volume in the current time period is statistically monitored in real time. When the target business search volume is less than the target business reservation volume, the search results of the search engine system are obtained in real time. When the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem, the search results of the target business subsystem are obtained, and the preset bypass cache results are updated using the search results of the target business subsystem. The preset bypass cache results are the search results based on the target business and pre-cached in the bypass system of the search engine system. When the target business search volume is greater than or equal to the target business reservation volume and greater than or equal to the search capacity of the target business subsystem, the preset bypass cache results of the search engine system are obtained. Since this solution can flexibly use the preset bypass cache results according to the actual search volume, statistically monitor the real-time search volumes of the target business and non-target business in a time period sliding manner, and use the non-target business search volume in the previous time period as a reference to reserve the non-target business search volume for the current time period, the requests for the non-target business search volume are protected. At the same time, according to the comparison between the target business search volume and the upper limit of the target business capacity, and the comparison between the overall search volume and the normal capacity upper limit of the search engine, it automatically and flexibly switches between several search result acquisition methods, such as full-service real-time search, target business real-time search, fusion of non-target business using preset bypass cache results, and full-service using preset bypass cache results, greatly improving the flexibility of the search. This solution protects the requests for the non-target business search volume. At the same time, when the overall search volume is low, the timeliness of the overall search results is fully guaranteed by recalling through the search engine system. When the target business search volume does not exceed the upper limit of the target business type capacity, the target business type results are obtained in real time, ensuring the real-time nature of the target business type and maximizing the use of the service capabilities of the target business subsystem. The preset bypass cache results are used as the overall fallback results and are used when the traffic is high or the request fails, ensuring the availability of the target business search results and greatly improving the search efficiency. Since this solution can support the impact of a large search volume for the target business, by presetting the bypass cache results for the keywords of the target business search in advance and flexibly using the preset bypass cache results according to the actual search volume, the impact of the target business search volume is alleviated, effectively ensuring the stability of the search engine.
[0077] According to the method described in the previous embodiment, the following will give examples for further detailed description.
[0078] In this embodiment, an example will be given with the search device specifically integrated in an electronic device, the target service specifically being an activity service, the non-target service specifically being an inactive service, the target service search volume specifically being activity traffic, and the non-target service search volume specifically being inactive traffic.
[0079] (1) First, the search results of the target service can be preheated and cached in advance, specifically as follows:
[0080] To improve the search efficiency, the search results of the target service can be cached in the bypass system of the search engine system in advance, that is, the search results of the target service are cached in the bypass system of the search engine system in advance.
[0081] To ensure the timeliness of the data stored in the cache and reduce the dependence on human resources, for example, a bypass preheating mechanism with three queues for preheating can be used. Preheating tasks are generated through the configuration of the target service, and the preheating tasks are added to the fast queue to start the bypass preheating process and the tasks are added to the circular queue and the preheating queue for cyclic repeated preheating according to the time period. Among them, the fast queue ensures that the newly modified target service can be quickly preheated for the results, the circular queue improves the timeliness of the preheated results, and the preheating queue preheats the target service from the global cache center to the local cache in advance to avoid penetration of the global cache center during the traffic peak.
[0082] For example, the electronic device can specifically retrieve the target preheating task from the first preheating task queue, and the target preheating task carries the service information of the target service; execute the target preheating task according to the service information of the target service to obtain the first preheating result corresponding to the target service; store the first preheating result and the service information correspondingly in the bypass system, and add the target preheating task to the task circular queue; when the target preheating task is retrieved from the task circular queue, execute the target preheating task according to the service information of the target service to obtain the second preheating result corresponding to the target service; store the second preheating result and the service information correspondingly in the bypass system to obtain the preset bypass cache result.
[0083] (2) Using the cached preset bypass cache result, the search can be performed based on the search query request, specifically referring to Figure 2a and Figure 2c .
[0084] As Figure 2a shown, a search method, the specific process can be as follows:
[0085] 201. The electronic device obtains the non-target business search volume of the search engine system in the historical time period.
[0086] Among them, the search engine system includes at least one target business subsystem. To make the real-time performance of the search results stronger, the historical time period can specifically refer to the previous time period of the current time period. Among them, the time period can refer to a preset time length, such as 100 ms, etc.
[0087] Among them, in addition to using the non-active traffic in the previous time period as the non-active traffic reservation volume for the current time period, time averaging or weighted averaging, etc. can also be used as the non-active traffic reservation volume.
[0088] Among them, there are many ways to set the time period. For example, it can be flexibly set according to the requirements of actual applications, or it can be preset and stored in the electronic device. In addition, the time period can be built into the electronic device, or it can be stored in the memory and sent to the electronic device, etc.
[0089] Among them, the search business can include non-target business and at least one target business. The target business can refer to the business preset in the search business. For example, it can specifically refer to the activity business (also called operation activity) in the search operation activity, etc. The non-target business can refer to the business not preset in the search business. For example, it can specifically refer to the non-activity business (also called non-operation activity) in the search operation activity, etc.
[0090] Among them, the search engine system can include at least one target business subsystem. For example, the search business can include multiple target businesses, and each target business corresponds to a subsystem. For example, the activity business is divided into multiple activity businesses according to different operation activities, and the activity business is also one of the subsystems of the search engine. For example, the search engine system can include at least one activity business subsystem.
[0091] For operation activity i, the activity party will determine the activity operation words in advance (such as "activity keyword A", "activity keyword B", etc.) and the activity time (for example, it starts precisely at 8 pm on Friday). After the pre-event publicity work, a large number of users will enter the search engine simultaneously at 8 pm on Friday to search for the activity operation words to participate in the activity. At this time, it will generate a relatively large traffic impact pressure on the search engine system. To ensure the normal response of the search for activity operation words, the three-queue bypass preheating mechanism can be applied to preheat and cache the search results of activity operation words in advance, and the elastic use bypass preheating cache mechanism of this application can be used to recall the search results of activity operation words during the activity.
[0092] 202. The electronic device determines the non-target service reservation volume for the current time period based on the non-target service search volume in the historical time period.
[0093] For example, when the current time period starts, the inactive traffic L0 in the previous time period can be used as a reference and regarded as the inactive traffic reservation volume for the current time period.
[0094] 203. The electronic device determines the target service reservation volume for the current time period according to the search capacity of the search engine system and the non-target service reservation volume.
[0095] Among them, the search engine system may include multiple service type subsystems. The capacity C of the search engine system is determined by the minimum value among the upper limits of the capacities of the subsystems of each service type of the engine. For example, the search engine system may include three service types: articles, videos, and music. The upper limits of their subsystem capacities can be expressed in queries per second (QPS, also known as the query rate per second). For example, for articles, videos, and music, they are 3200 qps, 3000 qps, and 2500 qps respectively. Then the capacity of the search engine system is 2500 qps, and so on. For example, the electronic device can specifically obtain the upper limit of the search capacity of each service type subsystem in the search engine system; and determine the minimum value of the upper limits of the search capacities in the service type subsystems as the search capacity of the search engine system.
[0096] When the inactive traffic does not exceed L0, the search volume allowed for the active traffic to directly request the search engine system to recall is C - L0; when the inactive traffic exceeds L0 (such as L0'), the traffic allowed for the active traffic to directly request the engine to recall is C - L0'. For example, it can be specifically as shown in Table 1 below:
[0097] Table 1. Examples of System Capacity and Traffic
[0098]
[0099] The inactive traffic L0 in the previous time period is used as the inactive traffic reservation volume for the current time period. Then, according to the search engine system capacity C and the actual inactive traffic L0' in the current time period, the traffic A allowed for the active traffic to directly request the engine to recall is obtained as A = min(C - L0, C - L0').
[0100] 204. The electronic device statistically counts the target service search volume in the current time period in real time.
[0101] For example, when the search query request is received by the electronic device in the search engine system, the query keyword corresponding to the search query request is obtained; if the query keyword is a target service keyword, the target service search volume for the current time period is updated based on the search query request; if the query keyword is not a target service keyword, the non-target service search volume for the current time period is updated based on the search query request, and the search results corresponding to the search query request are obtained from the search engine system.
[0102] For instance, Figure 2b as shown, when a search query request arrives, it is determined whether it is an active keyword. If it is an active keyword, the corresponding active traffic count is incremented by 1. If it is not an active keyword, the inactive traffic count is incremented by 1. The inactive traffic can directly request the search engine system to obtain the search results.
[0103] Among them, the query keyword can refer to information that can trigger the processing of a service, including but not limited to characters, words, links, and pictures input by the user, or instructions generated based on the user's operations in the search engine system, etc.
[0104] 205. When the target service search volume is less than the target service reserved volume, the electronic device obtains the search results of the search engine system in real time.
[0105] To ensure the availability of the target service search results, improve the search efficiency, and ensure the normal use of the search engine system, when the acquisition of the search results of the search engine system fails, the preset bypass cache results can be obtained. For example, when the electronic device fails to obtain the search results of the search engine system in real time, the preset bypass cache results corresponding to the target service are obtained.
[0106] For example, if the active traffic of the active service i in the current time period is statistically L_i, then the total active traffic in the current time period is L_t = L_1 + L_2 + … + L_N. If L_t < A, the current search query request first requests the search engine system to obtain the real-time result recall. If the request fails, the preset bypass cache results are returned as the search results.
[0107] 206. When the target service search volume is greater than or equal to the target service reserved volume and less than the search capacity of the target service subsystem, the electronic device obtains the search results of the target service subsystem and updates the preset bypass cache results using the search results of the target service subsystem.
[0108] Among them, the preset bypass cache results are the search results obtained by searching based on the target service and pre-cached in the bypass system of the search engine system.
[0109] To improve the timeliness of the preset bypass cache results and thus improve the timeliness of the search, the preset bypass cache results can be updated using the search results obtained in real time. For example, specifically, when the search volume of the target service is greater than or equal to the reserved volume of the target service, the electronic device can obtain the search capacity of the target service subsystem corresponding to the target service; if the search volume of the target service is less than the search capacity of the target service subsystem, the search results corresponding to the target service are obtained in real time from the target service subsystem through the search engine system; the preset bypass cache results corresponding to the target service are obtained, and the preset bypass cache results corresponding to the target service are updated using the search results corresponding to the target service obtained in real time by the search engine system to obtain the updated bypass cache results.
[0110] To improve the comprehensiveness of the returned target search results, the search results of the target service can be fused with the preset bypass cache results before being returned. For example, specifically, the electronic device can fuse the search results corresponding to the target service obtained in real time by the search engine system with the updated bypass cache results to obtain the fused search results; use the fused search results as the target search results of the target service; if the search results corresponding to the target service cannot be obtained in real time by the search engine system, use the preset bypass cache results as the target search results of the target service.
[0111] For example, as the traffic of the active keyword in the current time period gradually increases, that is, when Lt >= A, assume that the current search query request query is a request for active service i, the traffic of active service i in the current time period is Li, and the upper limit of its subsystem capacity is Ci. If Li < Ci, the search results of the active operation zone (i.e., the search results of the active service subsystem) are obtained separately through the search engine system, and the preset bypass cache results are obtained at the same time. The results of the active operation zone in the preset bypass cache results are replaced with the operation zone search results recalled in real time by the search engine system, and the real-time results of the operation activity service and the preset bypass cache results are fused and returned as the final search results. If the results of the active operation zone cannot be obtained through the search engine system, the preset bypass cache results are directly used as the final search results.
[0112] 207. When the search volume of the target service is greater than or equal to the reserved volume of the target service and greater than or equal to the search capacity of the target service subsystem, the electronic device obtains the preset bypass cache results of the search engine system.
[0113] For example, when the search volume of the target service is greater than or equal to the reserved volume of the target service, the electronic device can specifically obtain the search capacity of the target service subsystem corresponding to the target service; if the search volume of the target service is greater than or equal to the search capacity of the target service subsystem, then obtain the preset bypass cache result corresponding to the target service. For example, if Li >= Ci, directly obtain the preset bypass cache result as the final search result and return it. The specific flowchart can be as Figure 2c shown, and the search result display can be as Figure 2d shown.
[0114] This solution statistically counts the active and inactive traffic in real time by time segments. Taking the inactive traffic of the previous time segment as a reference for the current time segment, a certain traffic margin is reserved for the inactive traffic of the current time segment to prevent the active traffic from occupying all real-time search query requests and making it impossible to process inactive search requests. Moreover, on the basis of reserving the inactive traffic, all active activities compete for the remaining capacity of the search engine system at the same time to ensure that the distribution of the active traffic recalled by the search engine system currently is consistent with the distribution of the arriving active traffic. Also, when the active traffic is not high, the active traffic can all be recalled through the search engine system to ensure the timeliness of the request results. When the active traffic is relatively high, exceeding the capacity of the search engine system but not exceeding the active service capacity, the active service requests the search engine system in real time and merges with the results of other services in the bypass preheating cache, which not only ensures that the search engine system is not impacted and crashed by the active traffic but also ensures the timeliness of the results in the active operation zone. When the active traffic exceeds the active service capacity, it is directly returned from the bypass preheating cache to ensure the stability of the active service subsystem.
[0115] This solution realizes the ability to automatically use the bypass preheating cache according to the real-time active traffic. In addition, according to the comparison of the search traffic of the operation activity with the upper limit of the activity capacity and the comparison of the overall search traffic with the normal upper limit of the search engine capacity, it automatically makes flexible switches among several search result acquisition methods, such as full-service real-time search, active-service real-time search and the fusion of the results of using the preheating cache for inactive services, and full-service use of the preheating cache results.
[0116] As can be seen from the above, in this embodiment, the non-target business search volume of the search engine system in the historical time period can be obtained, and the search engine system includes at least one target business subsystem; then, based on the non-target business search volume in the historical time period, the target business reservation volume in the current time period is determined; then, the target business search volume in the current time period is statistically monitored in real time. When the target business search volume is less than the target business reservation volume, the search results of the search engine system are obtained in real time; when the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem, the search results of the target business subsystem are obtained, and the preset bypass cache results are updated by using the search results of the target business subsystem, where the preset bypass cache results are the search results based on the target business and pre-cached in the bypass system of the search engine system; when the target business search volume is greater than or equal to the target business reservation volume and greater than or equal to the search capacity of the target business subsystem, the preset bypass cache results of the search engine system are obtained. Since this solution can flexibly use the bypass preheated cache results (i.e., the preset bypass cache results) according to the actual search traffic size, statistically monitor the real-time traffic of operation activities and inactivities in a time period sliding manner, use the traffic in the previous time period as a reference, reserve the inactivity traffic margin for the current time period, and protect the requests of the inactivity traffic; at the same time, according to the comparison of the operation activity search traffic with the activity capacity upper limit and the comparison of the overall search traffic with the normal capacity upper limit of the search engine, automatically and flexibly switch between several search result acquisition methods, such as full-service real-time search, activity service real-time search, fusion of inactivity service using preheated cache results, and full-service using preheated cache results, which greatly improves the flexibility of the search. This solution not only protects the requests of the inactivity traffic; at the same time, when the overall search traffic is low, the timeliness of the overall results is fully guaranteed by recalling through the search engine system. When the activity traffic does not exceed the capacity upper limit of the operation activity service type, the results of the operation activity service type are obtained in real time to ensure the real-time nature of the operation result special area type, and the service capacity of the operation activity service subsystem is utilized to the maximum extent; the bypass preheated cache results serve as the overall fallback results and are used when the traffic is high or the request fails, which guarantees the availability of the search results for the operation activity words and greatly improves the search efficiency. Since this solution can support the impact of large traffic of operation activities, by preheating and caching the search results of the operation activity words in the bypass in advance and flexibly using the bypass preheated cache results according to the actual search traffic size, the impact of the operation activity traffic is alleviated, and the stability of the search engine is guaranteed.
[0117] To better implement the above method, correspondingly, an embodiment of the present application further provides a search device, which can be specifically integrated in an electronic device. The electronic device can be a server or a terminal device, etc.
[0118] For example, as Figure 3As shown in the figure, the search device may include an acquisition unit 301, a determination unit 302, a first search unit 303, a second search unit 304, and a third search unit 305, as follows:
[0119] The acquisition unit 301 is configured to acquire the non-target business search volume of the search engine system in a historical time period, where the search engine system includes at least one target business subsystem;
[0120] The determination unit 302 is configured to determine the target business reservation volume in the current time period based on the non-target business search volume in the historical time period;
[0121] The first search unit 303 is configured to statistically obtain the target business search volume in real time in the current time period. When the target business search volume is less than the target business reservation volume, obtain the search results of the search engine system in real time;
[0122] The second search unit 304 is configured to, when the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem, obtain the search results of the target business subsystem and update the preset bypass cache results by using the search results of the target business subsystem, where the preset bypass cache results are the search results based on the target business and pre-cached in the bypass system of the search engine system;
[0123] The third search unit 305 is configured to, when the target business search volume is greater than or equal to the target business reservation volume and greater than or equal to the search capacity of the target business subsystem, obtain the preset bypass cache results of the search engine system.
[0124] Optionally, in some embodiments, the determination unit 302 may specifically be configured to determine the non-target business reservation volume in the current time period based on the non-target business search volume in the historical time period; and determine the target business reservation volume in the current time period according to the search capacity of the search engine system and the non-target business reservation volume.
[0125] Optionally, in some embodiments, the determination unit 302 may specifically be configured to obtain the upper limit of the search capacity of each business type subsystem in the search engine system; and determine the minimum value of the upper limits of the search capacities in the business type subsystems as the search capacity of the search engine system.
[0126] Optionally, in some embodiments, the first search unit 303 may be specifically configured to, when the search engine system receives a search query request, obtain the query keyword corresponding to the search query request; if the query keyword is a target service keyword, update the target service search volume for the current time period based on the search query request; if the query keyword is not a target service keyword, update the non-target service search volume for the current time period based on the search query request, and obtain the search result corresponding to the search query request from the search engine system.
[0127] Optionally, in some embodiments, the first search unit 303 may be specifically configured to, when the acquisition of the search result of the search engine system fails in real time, obtain the preset bypass cache result corresponding to the target service.
[0128] Optionally, in some embodiments, the second search unit 304 may be specifically configured to, when the target service search volume is greater than or equal to the target service reservation volume, obtain the search capacity of the target service subsystem corresponding to the target service; if the target service search volume is less than the search capacity of the target service subsystem, obtain the search result corresponding to the target service from the target service subsystem in real time through the search engine system; obtain the preset bypass cache result corresponding to the target service, and update the preset bypass cache result corresponding to the target service by using the search result corresponding to the target service obtained in real time by the search engine system to obtain an updated bypass cache result.
[0129] Optionally, in some embodiments, the second search unit 304 may be specifically configured to fuse the search result corresponding to the target service obtained in real time by the search engine system with the updated bypass cache result to obtain a fused search result; use the fused search result as the target search result of the target service; if the acquisition of the search result corresponding to the target service by the search engine system fails in real time, use the preset bypass cache result as the target search result of the target service.
[0130] Optionally, in some embodiments, the third search unit 305 may be specifically configured to, when the target service search volume is greater than or equal to the target service reservation volume, obtain the search capacity of the target service subsystem corresponding to the target service; if the target service search volume is greater than or equal to the search capacity of the target service subsystem, obtain the preset bypass cache result corresponding to the target service.
[0131] Optionally, in some embodiments, the search device may further include a cache unit, which is specifically configured to retrieve a target warm-up task from the first warm-up task queue, where the target warm-up task carries the service information of the target service; execute the target warm-up task according to the service information of the target service to obtain a first warm-up result corresponding to the target service; store the first warm-up result and the service information in a bypass system in a corresponding manner, and add the target warm-up task to the task loop queue; when the target warm-up task is retrieved from the task loop queue, execute the target warm-up task according to the service information of the target service to obtain a second warm-up result corresponding to the target service; store the second warm-up result and the service information in a bypass system in a corresponding manner to obtain a preset bypass cache result.
[0132] In specific implementation, each of the above units may be implemented as an independent entity, or may be combined arbitrarily to be implemented as the same or several entities. For the specific implementation of each of the above units, reference may be made to the foregoing method embodiments, which will not be elaborated herein.
[0133] As can be seen from the above, in this embodiment, the acquisition unit 301 can acquire the non-target business search volume of the search engine system in the historical time period, where the search engine system includes at least one target business subsystem; then, the determination unit 302 determines the target business reservation volume in the current time period based on the non-target business search volume in the historical time period; next, the first search unit 303 statistically obtains the target business search volume in the current time period in real time. When the target business search volume is less than the target business reservation volume, the search results of the search engine system are obtained in real time; the second search unit 304, when the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem, obtains the search results of the target business subsystem and updates the preset bypass cache results by using the search results of the target business subsystem, where the preset bypass cache results are the search results obtained by searching based on the target business and pre-cached in the bypass system of the search engine system; the third search unit 305, when the target business search volume is greater than or equal to the target business reservation volume and greater than or equal to the search capacity of the target business subsystem, obtains the preset bypass cache results of the search engine system. Since this solution can flexibly use the preset bypass cache results according to the actual search volume, slide the time period to statistically obtain the real-time search volumes of the target business and the non-target business, use the non-target business search volume in the previous time period as a reference to reserve the non-target business search volume for the current time period, and protect the requests for the non-target business search volume; at the same time, it automatically and flexibly switches between several search result acquisition methods such as full-service real-time search, target business real-time search, fusion of non-target business using preset bypass cache results, and full-service using preset bypass cache results in real time according to the comparison between the target business search volume and the target business capacity upper limit, and the comparison between the overall search volume and the normal capacity upper limit of the search engine, greatly improving the flexibility of the search. This solution not only protects the requests for the non-target business search volume; at the same time, when the overall search volume is low, the timeliness of the overall search results is fully guaranteed by the recall of the search engine system. When the target business search volume does not exceed the capacity upper limit of the target business type, the target business type results are obtained in real time, ensuring the real-time nature of the target business type and maximizing the use of the service capabilities of the target business subsystem; the preset bypass cache results are used as the overall fallback results and are used when the traffic is high or the request fails, ensuring the availability of the target business search results and greatly improving the search efficiency.
[0134] In addition, an embodiment of the present application further provides an electronic device, as Figure 4 shown, which shows a schematic structural diagram of the electronic device involved in the embodiment of the present application. Specifically:
[0135] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art can understand that Figure 4 the structure of the electronic device shown in Figure 4 does not limit the electronic device, and it may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements. Among them:
[0136] The processor 401 is the control center of the electronic device. It connects various parts of the entire electronic device through various interfaces and circuits. By running or executing software programs and / or modules stored in the memory 402, and by invoking data stored in the memory 402, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 401 either.
[0137] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 mainly includes a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the electronic device. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. Correspondingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0138] The electronic device also includes a power supply 403 that powers each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 403 may also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0139] The electronic device may further include an input unit 404, which may be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0140] Although not shown, the electronic device may further include a display unit and the like, which will not be elaborated here. Specifically, in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402 to implement various functions as follows:
[0141] Obtain the non-target business search volume of the search engine system in the historical time period, where the search engine system includes at least one target business subsystem; then, determine the target business reservation volume in the current time period based on the non-target business search volume in the historical time period; then, statistically obtain the target business search volume in the current time period in real time. When the target business search volume is less than the target business reservation volume, obtain the search results of the search engine system in real time; when the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem, obtain the search results of the target business subsystem, and update the preset bypass cache results with the search results of the target business subsystem, where the preset bypass cache results are the search results based on the target business and pre-cached in the bypass system of the search engine system; when the target business search volume is greater than or equal to the target business reservation volume and greater than or equal to the search capacity of the target business subsystem, obtain the preset bypass cache results of the search engine system.
[0142] For the specific implementation of each of the above operations, reference may be made to the previous embodiments and will not be elaborated here.
[0143] As can be seen from the above, in this embodiment, the non-target business search volume of the search engine system in the historical time period can be obtained, and the search engine system includes at least one target business subsystem; then, based on the non-target business search volume in the historical time period, the target business reservation volume in the current time period is determined; next, the target business search volume in the current time period is statistically calculated in real time. When the target business search volume is less than the target business reservation volume, the search results of the search engine system are obtained in real time; when the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem, the search results of the target business subsystem are obtained, and the preset bypass cache results are updated by using the search results of the target business subsystem, where the preset bypass cache results are the search results obtained by searching based on the target business and pre-cached in the bypass system of the search engine system; when the target business search volume is greater than or equal to the target business reservation volume and greater than or equal to the search capacity of the target business subsystem, the preset bypass cache results of the search engine system are obtained. Since this solution can flexibly use the preset bypass cache results according to the actual search volume, slide statistics of the real-time search volumes of the target business and non-target business are performed in time periods, and the non-target business search volume in the previous time period is used as a reference to reserve the non-target business search volume for the current time period, protecting the requests for the non-target business search volume; at the same time, according to the comparison between the target business search volume and the upper limit of the target business capacity, and the comparison between the overall search volume and the upper limit of the normal capacity of the search engine, the search results are automatically and flexibly switched between several search result acquisition methods such as full-service real-time search, target business real-time search, fusion of non-target business using preset bypass cache results, and full-service using preset bypass cache results, greatly improving the flexibility of the search. This solution not only protects the requests for the non-target business search volume; at the same time, when the overall search volume is low, the timeliness of the overall search results is fully guaranteed by recalling through the search engine system. When the target business search volume does not exceed the upper limit of the target business type capacity, the target business type results are obtained in real time, ensuring the real-time nature of the target business type and maximizing the use of the service capabilities of the target business subsystem; the preset bypass cache results are used as the overall backup results and are used when the traffic is high or the request fails, ensuring the availability of the target business search results and greatly improving the search efficiency.
[0144] Those of ordinary skill in the art can understand that all or part of the steps in the above various methods of the embodiments can be completed by instructions or by controlling related hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0145] For this reason, an embodiment of the present application further provides a storage medium, which stores multiple instructions that can be loaded by a processor to execute the steps in any one of the search methods provided by the embodiments of the present application. For example, the instructions can execute the following steps:
[0146] Obtain the non-target business search volume of the search engine system in the historical time period, where the search engine system includes at least one target business subsystem; then, determine the target business reservation volume in the current time period based on the non-target business search volume in the historical time period; next, statistically obtain the target business search volume in the current time period in real time. When the target business search volume is less than the target business reservation volume, obtain the search results of the search engine system in real time; when the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem, obtain the search results of the target business subsystem, and update the preset bypass cache results with the search results of the target business subsystem, where the preset bypass cache results are the search results based on the target business and pre-cached in the bypass system of the search engine system; when the target business search volume is greater than or equal to the target business reservation volume and greater than or equal to the search capacity of the target business subsystem, obtain the preset bypass cache results of the search engine system.
[0147] For the specific implementation of each of the above operations, reference may be made to the previous embodiments, which will not be elaborated herein.
[0148] Among them, the storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.
[0149] Since the instructions stored in the storage medium can execute the steps in any of the search methods provided in the embodiments of the present application, the beneficial effects achievable by any of the search methods provided in the embodiments of the present application can be realized. For details, reference may be made to the previous embodiments, which will not be elaborated herein.
[0150] The above has introduced in detail a search method, device, electronic device, and storage medium provided in the embodiments of the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A search method, characterized in that, Including: Obtaining the non-target business search volume of the search engine system in a historical time period, where the search engine system includes at least one target business subsystem; Determining the target business reservation volume for the current time period based on the non-target business search volume in the historical time period; Real-time statistics of the target business search volume in the current time period. When the target business search volume is less than the target business reservation volume, the search results of the search engine system are obtained in real time; When the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem, obtain the search results of the target business subsystem, and update the preset bypass cache results with the search results of the target business subsystem, where the preset bypass cache results are the search results based on the target business and pre-cached in the bypass system of the search engine system; When the target business search volume is greater than or equal to the target business reservation volume and greater than or equal to the search capacity of the target business subsystem, obtain the preset bypass cache results of the search engine system.
2. The method according to claim 1, characterized in that, The determining the target business reservation volume for the current time period based on the non-target business search volume in the historical time period includes: [[ID=७]]Determining the non-target business reservation volume for the current time period based on the non-target business search volume in the historical time period; Determining the target business reservation volume for the current time period according to the search capacity of the search engine system and the non-target business reservation volume.
3. The method according to claim 2, wherein Before the determining the target business reservation volume for the current time period according to the search capacity of the search engine system and the non-target business reservation volume, it further includes: Obtaining the upper limit of the search capacity of each business type subsystem in the search engine system; Determining the minimum value of the upper limit of the search capacity in the business type subsystem as the search capacity of the search engine system.
4. The method according to claim 1, characterized in that The real-time statistics of the target business search volume in the current time period includes: When the search engine system receives a search query request, obtaining the query keyword corresponding to the search query request; If the query keyword is a target business keyword, updating the target business search volume for the current time period based on the search query request; If the query keyword is not a target business keyword, updating the non-target business search volume for the current time period based on the search query request, and obtaining the search results corresponding to the search query request from the search engine system.
5. The method according to claim 1, characterized in that After the obtaining the search results of the search engine system in real time when the target business search volume is less than the target business reservation volume, it further includes: When the obtaining of the search results of the search engine system in real time fails, obtaining the preset bypass cache results corresponding to the target business.
6. The method according to claim 1, characterized in that, The obtaining the search results of the target business subsystem and updating the preset bypass cache results with the search results of the target business subsystem when the target business search volume is greater than or equal to the target business reservation volume and less than the search capacity of the target business subsystem includes: When the target business search volume is greater than or equal to the target business reservation volume, obtaining the search capacity of the target business subsystem corresponding to the target business; If the search volume of the target service is less than the search capacity of the target service subsystem, obtain the search results corresponding to the target service from the target service subsystem in real time through the search engine system; Obtain the preset bypass cache result corresponding to the target service, and update the preset bypass cache result corresponding to the target service with the search results corresponding to the target service obtained in real time by the search engine system to obtain the updated bypass cache result.
7. The method according to claim 6, characterized in that, After updating the preset bypass cache result corresponding to the target service with the search results corresponding to the target service obtained in real time by the search engine system to obtain the updated bypass cache result, it further includes: Fuse the search results corresponding to the target service obtained in real time by the search engine system with the updated bypass cache result to obtain the fused search result; Use the fused search result as the target search result of the target service; If the search results corresponding to the target service cannot be obtained in real time by the search engine system, use the preset bypass cache result as the target search result of the target service.
8. The method according to claim 1, wherein When the search volume of the target service is greater than or equal to the reserved volume of the target service and greater than or equal to the search capacity of the target service subsystem, obtaining the preset bypass cache result of the search engine system includes: When the search volume of the target service is greater than or equal to the reserved volume of the target service, obtain the search capacity of the target service subsystem corresponding to the target service; If the search volume of the target service is greater than or equal to the search capacity of the target service subsystem, obtain the preset bypass cache result corresponding to the target service.
9. The method according to claim 1, characterized in that, Before updating the preset bypass cache result with the search results of the target service subsystem, it further includes: Take out the target preheating task from the first preheating task queue, and the target preheating task carries the service information of the target service; Execute the target preheating task according to the service information of the target service to obtain the first preheating result corresponding to the target service; Correspondingly store the first preheating result and the service information into the bypass system, and add the target preheating task to the task loop queue; When the target preheating task is taken out from the task loop queue, execute the target preheating task according to the service information of the target service to obtain the second preheating result corresponding to the target service; Correspondingly store the second preheating result and the service information into the bypass system to obtain the preset bypass cache result.
10. A search device, characterized in that, It includes: An acquisition unit, configured to acquire the non-target service search volume of the search engine system in a historical time period, where the search engine system includes at least one target service subsystem; A determination unit, configured to determine the reserved volume of the target service in the current time period based on the non-target service search volume in the historical time period; A first search unit, configured to statistically obtain the search volume of the target service in real time in the current time period, and when the search volume of the target service is less than the reserved volume of the target service, obtain the search results of the search engine system in real time; A second search unit, configured to obtain a search result of the target service subsystem and update a preset bypass cache result by using the search result of the target service subsystem when the search volume of the target service is greater than or equal to the reserved volume of the target service and less than the search capacity of the target service subsystem, where the preset bypass cache result is a search result obtained by searching based on the target service and pre-cached in a bypass system of a search engine system; A third search unit, configured to obtain the preset bypass cache result of the search engine system when the search volume of the target service is greater than or equal to the reserved volume of the target service and greater than or equal to the search capacity of the target service subsystem.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the search method according to any one of claims 1 to 9.
12. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, When the processor executes the program, the steps in the search method according to any one of claims 1 to 9 are implemented.
13. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instruction is executed by the processor, the steps in the search method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Webpage search method and system
CN105447187A
Business result obtaining method and device
CN108470043A