Method, device and equipment for realizing retrieval based on index version switching and medium
By determining the task identification number management before index switching, the rapid and stable index switching is achieved, the problem of time-consuming and data inconsistent existing index switching is solved, and the stability and availability of retrieval services are improved.
Patent Information
- Application Number
- CN202411207538.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-27
AI Technical Summary
The existing index switching process takes significant time when the corpus data is large, resulting in unstable retrieval application and failure to build indexes may lead to data inconsistency.
After determining that the index construction task is completed through the preset dispatch center, switch the current index version to the next index version to ensure that the index switching takes a short time and avoid data inconsistency. Introduce task identification number management to support online switching.
It greatly improves the stability and availability of retrieval services, avoids the risk of instability caused by index building failure, ensures data consistency, and supports rollback and monitoring of index versions.
Smart Images

Figure CN119202320A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data query, and in particular to a method, device, equipment and medium for implementing version switching based on an index. Background Art
[0002] In the field of AI retrieval, content retrieval services usually need to rely on various forms of indexes, such as es index (index structure used by Elasticsearch search engine), sm index (Semantic index, used for semantic vector retrieval), pre index (preprocessing positive structure index), etc. The above indexes need to rely on the pre-construction of corpus data to provide retrieval services. When there are changes in the corpus, such as new corpus, changes in the corpus data structure, etc., the index also needs to be updated to continue to complete the retrieval service;
[0003] The construction and switching process of the existing index mainly includes: first uninstalling the old index, then building a new index, and finally completing the loading of the new index; during this period, various indexes are updated independently. If the corpus data is large, the switching process of the existing index takes more time. It can be seen that the retrieval application faces the risk of instability during the transition period from index uninstallation to index construction and before the switching is completed. At the same time, with the development of business, the complexity of the index continues to increase, and some indexes may fail to be built. The retrieval application also faces the risk of instability and data inconsistency.
[0004] Therefore, those skilled in the art are in urgent need of finding a new technical solution to solve the above problems. Summary of the invention
[0005] Based on this, a method, device, equipment and medium for implementing version switching based on an index are provided to solve the problems of instability and data inconsistency faced by existing index retrieval applications.
[0006] A method for implementing version switching based on an index, comprising:
[0007] When obtaining the user's search resource demand instruction, generate the current search service;
[0008] After all index building tasks under the task identification number of the preset index building middle station are determined by the preset scheduling center to be built, the first index of the current index version corresponding to the current search service is switched to the second index of the next index version; one task identification number corresponds to at least one second index;
[0009] The search resource of the current search service is acquired according to the second index.
[0010] A device for implementing retrieval based on index version switching, comprising:
[0011] The first acquisition module is used to generate the current search service when acquiring the user's search resource demand instruction;
[0012] A switching module, for switching the first index of the current index version corresponding to the current search service to the second index of the next index version after all index construction tasks under the task identification number of the preset index construction middle station determined by the preset scheduling center are completed; one of the task identification numbers corresponds to at least one of the second indexes;
[0013] A second acquisition module is configured to acquire the search resources of the current search service according to the second index.
[0014] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for retrieval based on index version switching when executing the computer program.
[0015] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for implementing retrieval based on index version switching is implemented.
[0016] The above-mentioned method, device, computer equipment and storage medium for implementing retrieval based on index version switching generate the current retrieval service when the user's retrieval resource demand instruction is obtained; after the preset scheduling center determines that all index construction tasks under the task identification number of the preset index construction center are completed, the first index of the current index version corresponding to the current retrieval service is switched to the second index of the next index version; one of the task identification numbers corresponds to at least one of the second indexes; and the retrieval resources of the current retrieval service are obtained according to the second index. When the current retrieval service depends on the index, when the preset scheduling center determines that all index construction tasks under the task identification number of the preset index construction center are completed, it is equivalent to determining that the second index of the next index version is completed. At this time, the first index is switched to the second index. In this way, the index switching takes a short time and the user is almost unaware, which greatly improves the stability and availability of the current retrieval service, and can avoid the risk of instability of the current retrieval service and data inconsistency caused by the failure of some index construction. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0018] Figure 1 is a schematic diagram of an application environment of a method for implementing retrieval based on index version switching in one embodiment of the present invention;
[0019] Figure 2 is a flow chart of a method for implementing retrieval based on index version switching in one embodiment of the present invention;
[0020] Figure 3 It is a structural schematic diagram of a device for implementing retrieval based on index version switching in one embodiment of the present invention;
[0021] Figure 4 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] The method for implementing retrieval based on index version switching provided by the present invention can be applied in the following aspects: Figure 1 In an application environment, a client communicates with a server via a network. The client may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server may be implemented as an independent server or a server cluster consisting of multiple servers.
[0024] In one embodiment, if Figure 2 As shown, a method for implementing version switching based on an index is provided, and the method is applied in Figure 1 The server in the example is used as an example to illustrate the process, including the following steps:
[0025] S10, when the user's search resource demand instruction is obtained, the current search service is generated.
[0026] It can be understood that the retrieval resource demand instruction can be a retrieval instruction triggered by the user on the relevant retrieval platform or retrieval software, such as a button that triggers the retrieval after the user enters the retrieval content in the corresponding interface; the current retrieval service can be a retrieval service formed by the server based on the user's retrieval content, such as the need to form corresponding retrieval resources based on the retrieval content provided by the user.
[0027] S20, after all the index construction tasks under the task identification number of the preset index construction center are determined by the preset scheduling center to be completed, the first index of the current index version corresponding to the current retrieval service is switched to the second index of the next index version; one task identification number corresponds to one second index.
[0028] It can be understood that there is a communication relationship between the preset scheduling center and the preset index building middle station (information transmission can be achieved through Http requests). The preset scheduling center can be responsible for scheduling notification index construction, loading, unloading, switching, etc. The preset index building middle station can be responsible for the construction of various index structures such as es (Elasti csearch), sm, pre, etc.; the task identification number can be task I d, which is an identifier used to uniquely identify a specific task or operation. In various scenarios such as software development, project management, database operations, workflow management, etc., task I d plays an important role, which can help the system or user track, manage, query and control specific tasks or processes. Among them, the format of the task identification number can be 20230413111 and 20230413222 (can be based on the current time + a specific order of numbers). The index building task under the task identification number is equivalent to the index building process. The construction of a second index can correspond to an index building task. Different task identification numbers correspond to different index versions (changing the task identification is equivalent to changing the index corresponding to the index version); the first index and the second index can be in the format of their corresponding task identification numbers. Generate, that is, each index will construct a name or path according to the format of the current task identification number. It can be seen that the first index and the second index are indexes generated under different index versions (the generation time point of the next index version is later than the current index version), and the generation time between the two is different. The format of the first index can be set to 20230413111_es_app1, and the format of the second index can be set to 20230413222_es_app1. Specifically, after the preset scheduling center determines that the above-mentioned second index is fully generated by the task identification number, the previous first index can be switched to the second index;
[0029] The preset scheduling center in this embodiment decouples the preset index construction middle platform and the retrieval service, implements index switching after the current retrieval service receives a message from the preset scheduling center, shields the details of multiple index constructions, and is conducive to service maintenance and expansion.
[0030] S30: Acquire search resources of the current search service according to the second index.
[0031] It can be understood that after the retrieval resource requirement instruction has been obtained in step S10 (the retrieval resource requirement instruction may include at least one or more retrieval requirements, including full-text retrieval requirements, keyword retrieval requirements, image retrieval requirements, and semantic retrieval requirements, etc.), the retrieval result - retrieval resource is obtained in the corresponding index structure according to the second index. After the retrieval resource is obtained, the resource can be sorted by relevance.
[0032] It should be noted that after the index construction of the preset index construction center is completed, it will be reported to the preset scheduling center in the form of an HTTP request; when the current retrieval service completes the index switching, the preset scheduling center will also be notified in the form of an HTTP request.
[0033] In the actual application scenario of intelligent customer service projects, business knowledge can be stored in the preset knowledge base in various forms of corpus such as FAQ and knowledge graph. After building an index based on the above corpus, the corpus can be quickly retrieved during online services. For example, the intelligent customer service robot will answer relevant business knowledge based on the user's questions through index retrieval.
[0034] In the embodiment of steps S10 to S30, when the current retrieval service depends on the index, when the preset scheduling center determines that all index construction tasks under the task identification number of the preset index construction center have been completed, it is equivalent to determining that the second index of the next index version has been completed. At this time, the first index is switched to the second index. In this way, the index switching is time-saving and the user is almost unaware. The change of the task identification number can support online switching of the index, which greatly improves the stability and availability of the current retrieval service and avoids the risk of instability of the current retrieval service caused by the failure of some index construction and the problem of data inconsistency.
[0035] Furthermore, before all index building tasks under the task identification number of the preset index building middle station are determined by the preset scheduling center to be completed, the method further includes:
[0036] The preset index building platform stores all completed records of the index building tasks under the task identification number in the preset database.
[0037] Understandably, the preset database can select a variety of mainstream databases, such as DB database;
[0038] Specifically, in the process of the preset index construction platform constructing the second index, a task identification number corresponding to the second index is first generated, and then the index construction task under the task identification number is persisted through the preset index construction platform, and finally the message of the completion of the construction is reported to the preset scheduling center through the preset index construction platform, wherein the persistence process is to store the index construction task record of this time in the preset database;
[0039] This embodiment stores the construction record in a preset database. Even if the index construction is abnormally interrupted, the construction task record will not disappear, which is conducive to information tracing for subsequent users.
[0040] Furthermore, before all index building tasks under the task identification number of the preset index building middle station are determined by the preset scheduling center to be completed, the method further includes:
[0041] After determining through the preset scheduling center that the index building tasks under the task identification number of the preset index building middle station have not been fully built, determining through the preset scheduling center within a preset time period whether the index building tasks under the task identification number have been fully built;
[0042] When it is determined that the index building task under the task identification number has not been fully built within the preset time period, a warning message is triggered.
[0043] Understandably, there is a process of determining the quantity of the construction of the task identification number. If the number in the format corresponding to the above-mentioned task identification number does not reach the preset number, it can be considered that the index construction task under the current task identification number has not been fully constructed; the preset time period is the spin waiting time, and spin waiting is a waiting mechanism commonly used in computer programming, especially in multi-threaded programming and high-concurrency environments, wherein, after the preset index construction platform completes the construction of the index, the preset scheduling center can be notified to determine whether the index construction tasks under the task identification number of the preset index construction center have been fully constructed; the warning information can be notified to the user through a variety of notification methods, such as by email reminder, wherein triggering the warning information is equivalent to the index construction task being in a failed construction state;
[0044] This embodiment determines whether all index building tasks under the task identification number have been completed by setting a specified time, so as to trigger an early warning message to remind the user when the index building fails or the waiting time expires, enhance the monitoring of the index building process, and avoid the potential instability risk of subsequent retrieval services affecting the current retrieval service.
[0045] Further, the predetermined scheduling center determines that all index building tasks under the task identification number of the predetermined index building middle station are completed, including:
[0046] Acquire all status fields corresponding to the task identification number constructed in the preset database through the preset scheduling center;
[0047] When it is determined that none of the status fields exist in the preset status field, the preset scheduling center determines that all index construction tasks under the task identification number of the preset index construction center have been completed.
[0048] Understandably, the status field may be expressed in a variety of types, such as string, enumeration, and integer, wherein the status field may represent "completed" or "uncompleted", etc. During the index construction process, each second index construction process will be recorded through a preset database, so that when it is determined that all status fields have preset status fields, it can be determined that all index construction tasks under the task identification number have been completed;
[0049] This embodiment centrally manages the status information of index building tasks, and can grasp the progress of each index building task in real time or near real time. The centralized status monitoring and confirmation mechanism simplifies the complexity of task management and improves overall efficiency. By checking all relevant status fields to confirm whether the index building task is completed, omissions or incorrect judgments of task status can be reduced. For retrieval applications that rely on index building results, rapid index building completion means retrieval stability and better user experience.
[0050] In other embodiments, when it is determined that one of the status fields does not have a preset status field, the preset scheduling center determines that the index construction task under the task identification number of the preset index construction center has not been fully constructed.
[0051] Furthermore, the switching of the first index of the current index version corresponding to the current search service to the second index of the next index version includes:
[0052] When it is determined that the task identification number corresponding to the second index is in effect, the task identification number corresponding to the second index is fed back to the current search service through the preset scheduling center in a preset request manner;
[0053] After the task identification number corresponding to the first index is changed to the task identification number corresponding to the second index through the current search service, the first index of the current index version is switched to the second index of the next index version.
[0054] Understandably, the task identification numbers under different index versions are different. The change of the task identification number means that the current index version is changed to the next index version, and the task identification number corresponding to the second index is in effect at this time. The original retrieval service has the first index of the current index version. To complete the switch of the first index, it is necessary to request the task identification number in the current retrieval service to be changed through the preset scheduling center, and then the first index under the original task identification number can be switched to the second index under the new task identification number. In addition, after the switch is completed, the current retrieval service can notify the preset scheduling center that the index switching process has been completed, so as to feedback the switching information and ensure the realization of the switching function of the preset scheduling center.
[0055] When the task identification number corresponding to the second index in this embodiment is confirmed to be in an effective state, it is immediately fed back to the current retrieval service through a preset request method, reducing unnecessary waiting time and ensuring the speed of index switching; by changing the task identification number corresponding to the first index to the task identification number corresponding to the second index, it is ensured that the index switching process is based on the unique task identification number, thereby ensuring the accuracy of the index switching process.
[0056] Furthermore, after switching the first index of the current index version corresponding to the current search service to the second index of the next index version, the method further includes:
[0057] The completion information of switching the second index is fed back to the preset index platform, and the index of the previous index version of the first index of the current index version is uninstalled through the preset index platform to control the preset scheduling center to always maintain the indexes of the two index versions.
[0058] Specifically, after the index switch is completed, the preset scheduling center is used to notify the preset index building station to uninstall or delete the previous version of the index (that is, the index of the previous index version of the first index), that is, to keep the number of versions in the corresponding memory of the preset index building station;
[0059] It should be noted that the present embodiment can adjust the number of stored indexes according to storage requirements to increase the number of index versions that can be rolled back; the existing entire index construction switching process is irreversible, and in scenarios such as version release and corpus structure changes, it is impossible to follow the version rollback, and the use flexibility of the index version is insufficient;
[0060] This embodiment always reserves index resources of two available index versions to support rollback operations at the index level and enhance the compatibility and stability of index versions. By deleting old index versions that are no longer needed, valuable storage resources can be released to provide space for new data or index versions. Maintaining two index versions ensures that query requests can still be responded to quickly when switching index versions. When users search and the switching of index versions is not completed, the first index of the previous index version can continue to be used until the new index version - the next index version is completely stable.
[0061] Further, the acquiring the search resource of the current search service according to the second index includes:
[0062] Get the corresponding index structure;
[0063] The search resources of the current search service corresponding to the second index are acquired according to a preset search order corresponding to the index structure.
[0064] Understandably, in the above-mentioned different index structures, under different index structures, the search order may be circulated in different nodes until the search resource of the current search service corresponding to the second index is obtained. For example, after parsing the structure of the index, different nodes can be located according to the parsed structure until the search resource corresponding to the last node is determined;
[0065] The index in this embodiment is a data structure in the database used to improve data retrieval speed. It stores the values of specific columns in the data table and the physical addresses of their corresponding data rows, allowing the database system to quickly locate specific retrieval resource data in the table. Through the index and the preset retrieval order, the retrieval scope and number of retrieval times of data scanning can be reduced, thereby improving retrieval efficiency.
[0066] Furthermore, before acquiring the search resource of the current search service according to the second index, the method further includes:
[0067] After performing word segmentation processing on the preset text document corresponding to the search resource, each independent word item is obtained;
[0068] Each of the independent terms is mapped to a document with a document identification number, and a search resource corresponding to the second index under the task identification number is obtained.
[0069] Understandably, there are many ways of word segmentation, such as dictionary-based word segmentation and model-based word segmentation, wherein the preset text may be a commonly used search resource text in the search field, and through the word segmentation processing method, independent independent terms may be obtained; the document identification number document is provided with a correspondence between the document identification number and the text, and after the independent term and the text are matched, the search resource may carry the task identification number corresponding to the document identification number, and the task identification number and the second index have a corresponding relationship, and the corresponding search resource may be queried through the second index later;
[0070] It should be noted that the index structure used in this embodiment may be an ES index, and the index type used by the ES index is an inverted index. When the inverted index is generated, the above-mentioned word segmentation process may be performed;
[0071] The word segmentation process in this embodiment divides continuous text into independent terms. The independent terms more accurately reflect the content of the text. The independent terms are mapped to the document identification number document. During the retrieval process, the documents of the relevant terms can be located more accurately, thereby improving the accuracy and efficiency of information retrieval. The word segmentation and mapping process helps to reduce the amount of calculation during retrieval. By breaking down the text into smaller units (independent terms), the query conditions can be matched faster and unnecessary document traversal can be reduced.
[0072] In summary, the above provides a method for implementing version switching based on indexes, and when a user's search resource demand instruction is obtained, a current search service is generated;
[0073] After all the index building tasks under the task identification number of the preset index building station are determined to be completed through the preset scheduling center, the first index of the current index version corresponding to the current retrieval service is switched to the second index of the next index version; one task identification number corresponds to at least one second index; the retrieval resources of the current retrieval service are obtained according to the second index. In this way, when the current retrieval service depends on the index, when all the index building tasks under the task identification number of the preset index building station are determined to be completed through the preset scheduling center, it is equivalent to determining that the second index of the next index version is completed. At this time, the first index is switched to the second index. The index switching takes a short time and the user is almost unaware (equivalent to no delay in index switching). The change of the task identification number can support online switching of the index, greatly improving the stability and availability of the current retrieval service, and avoiding the risk of instability of the current retrieval service and data inconsistency caused by the failure of some index constructions; the preset scheduling center is introduced to decouple the index construction With the retrieval service (the preset scheduling center decouples the index builder and the user, so that the offline / online index construction can be flexibly expanded without affecting the online retrieval service), the index switch is notified only when all index construction is completed, and multiple versions of the index are always available, making the switching process extremely fast and almost unaware to the downstream users, ensuring the consistency of the final data; the index with multiple index versions supports version rollback, enhancing the compatibility and stability of the index version, greatly improving the flexibility of index construction and the availability and stability of the retrieval service. In addition, the version rollback process introduces an early warning information mechanism to enhance the monitoring of the index construction process and improve the observability of the construction process.
[0074] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0075] In one embodiment, a device for implementing retrieval based on index version switching is provided, and the device for implementing retrieval based on index version switching corresponds one-to-one to the method for implementing retrieval based on index version switching in the above embodiment. Figure 3 As shown, the device for implementing retrieval based on index version switching includes a first acquisition module 11, a switching module 12, and a second acquisition module 13. The functional modules are described in detail as follows:
[0076] The first acquisition module 11 is used to generate a current search service when acquiring a user's search resource demand instruction;
[0077] The switching module 12 is used to switch the first index of the current index version corresponding to the current search service to the second index of the next index version after all the index construction tasks under the task identification number of the preset index construction middle station determined by the preset scheduling center are completed; one of the task identification numbers corresponds to at least one of the second indexes;
[0078] The second acquisition module 13 is used to acquire the search resources of the current search service according to the second index.
[0079] Furthermore, the device for implementing retrieval based on index version switching also includes:
[0080] A determination module, for determining, through the preset scheduling center within a preset time period, whether all index construction tasks under the task identification number have been completed after determining through the preset scheduling center that the index construction tasks under the task identification number of the preset index construction center have not been fully constructed;
[0081] The trigger module is used to trigger warning information when it is determined that the index construction task under the task identification number has not been fully constructed within the preset time period.
[0082] Furthermore, the switching module includes:
[0083] A first acquisition unit, configured to acquire, through the preset scheduling center, all status fields corresponding to the task identification number constructed in the preset database;
[0084] The determination unit is used to determine that all index construction tasks under the task identification number of the preset index construction center have been completed through the preset scheduling center when it is determined that none of the status fields exist in the preset status field.
[0085] Furthermore, the switching module includes:
[0086] a feedback unit, configured to feed back the task identification number corresponding to the second index to the current search service in a preset request manner through the preset scheduling center when determining that the task identification number corresponding to the second index is in effect;
[0087] A switching unit is used to switch the first index of the current index version to the second index of the next index version after changing the task identification number corresponding to the first index to the task identification number corresponding to the second index through the current search service.
[0088] Furthermore, the device for implementing retrieval based on index version switching also includes:
[0089] A deletion unit is used to feed back the completion information of switching the second index to the preset index platform, and uninstall the index of the previous index version of the first index of the current index version through the preset index platform to control the preset scheduling center to always maintain the index of the two index versions.
[0090] Furthermore, the second acquisition module includes:
[0091] A second acquisition unit, used to acquire a corresponding index structure;
[0092] A third acquisition unit is configured to acquire, according to a preset search order corresponding to the index structure, search resources of the current search service corresponding to the second index.
[0093] Furthermore, the device for implementing retrieval based on index version switching also includes:
[0094] A word segmentation processing unit, used to perform word segmentation processing on a preset text document corresponding to the search resource to obtain independent terms;
[0095] A mapping unit is used to map each of the independent terms to a document with a document identification number, and obtain a search resource corresponding to the second index under the task identification number.
[0096] For the specific limitations on the device for implementing retrieval based on index version switching, please refer to the limitations on the method for implementing retrieval based on index version switching above, which will not be repeated here. Each module in the above-mentioned device for implementing retrieval based on index version switching can be implemented in whole or in part through software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0097] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data involved in the method for implementing retrieval based on index version switching. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for implementing version switching based on an index is implemented.
[0098] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method for implementing retrieval based on index version switching in the above embodiment are implemented, such as Figure 2 Alternatively, when the processor executes the computer program, the functions of each module / unit of the device for implementing retrieval based on index version switching in the above embodiment are implemented, for example Figure 3 The functions of modules 11 to 13 are shown in Figure 1. To avoid repetition, they will not be described here.
[0099] In one embodiment, a computer-readable storage medium is provided on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for implementing retrieval based on index version switching in the above embodiment are implemented, such as Figure 2 Alternatively, when the computer program is executed by the processor, the functions of each module / unit of the device for implementing retrieval based on index version switching in the above embodiment are realized, for example Figure 3 The functions of modules 11 to 13 are shown in Figure 1. To avoid repetition, they will not be described here.
[0100] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0101] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0102] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for implementing retrieval based on index version switching, characterized in that: Including: When receiving a retrieval resource requirement instruction from a user, generating a current retrieval service; After all the index construction tasks under the task identification number of the preset index construction middle platform are determined to be completed by a preset scheduling center, switching the first index of the current index version corresponding to the current retrieval service to the second index of the next index version; at least one of the second indexes corresponds to one task identification number; Obtaining the retrieval resources of the current retrieval service according to the second index.
2. The method for implementing retrieval based on index version switching according to claim 1, characterized in that: Before the step of "after all the index construction tasks under the task identification number of the preset index construction middle platform are determined to be completed by a preset scheduling center", it further includes: When it is determined that not all the index construction tasks under the task identification number of the preset index construction middle platform are completed by the preset scheduling center, determining within a preset time period whether all the index construction tasks under the task identification number are completed by the preset scheduling center; When it is determined within the preset time period that not all the index construction tasks under the task identification number are completed, triggering a warning message.
3. The method for implementing retrieval based on index version switching according to claim 1, characterized in that: The step of "determining that all the index construction tasks under the task identification number of the preset index construction middle platform are completed by a preset scheduling center" includes: Obtaining all the status fields corresponding to the task identification number constructed in the preset database through the preset scheduling center; When it is determined that all the status fields do not have a preset status field, determining through the preset scheduling center that all the index construction tasks under the task identification number of the preset index construction middle platform are completed.
4. The method for implementing retrieval based on index version switching according to claim 1, characterized in that: The step of "switching the first index of the current index version corresponding to the current retrieval service to the second index of the next index version" includes: When it is determined that the task identification number corresponding to the second index is in effect, feedbacking the task identification number corresponding to the second index to the current retrieval service in a preset request manner through the preset scheduling center; After changing the task identification number corresponding to the first index to the task identification number corresponding to the second index through the current retrieval service, switching the first index of the current index version to the second index of the next index version.
5. The method for implementing retrieval based on index version switching according to claim 1, characterized in that: After the step of "switching the first index of the current index version corresponding to the current retrieval service to the second index of the next index version", it further includes: Feedbacking the completion information of switching the second index to the preset index platform, and unloading the index of the previous index version of the first index of the current index version through the preset index platform, so as to control the preset scheduling center to always maintain indexes of two index versions.
6. The method for implementing retrieval based on index version switching according to claim 1, characterized in that: The step of "obtaining the retrieval resources of the current retrieval service according to the second index" includes: Obtaining a corresponding index structure; Obtaining the retrieval resources of the current retrieval service corresponding to the second index according to the preset retrieval order corresponding to the index structure.
7. The method for implementing retrieval based on index version switching according to claim 1, characterized in that: Before the step of "switching the first index of the current index version corresponding to the current retrieval service to the second index of the next index version", it further includes: Performing word segmentation on the preset text document corresponding to the retrieval resources to obtain each independent word item; Each of the independent terms is mapped to a document with a document identification number, and a search resource corresponding to the second index under the task identification number is obtained.
8. A device for implementing retrieval based on index version switching, characterized in that, include: The first acquisition module is used to generate the current search service when acquiring the user's search resource demand instruction; A switching module, for switching the first index of the current index version corresponding to the current search service to the second index of the next index version after all index construction tasks under the task identification number of the preset index construction middle station determined by the preset scheduling center are completed; one of the task identification numbers corresponds to at least one of the second indexes; A second acquisition module is configured to acquire the search resources of the current search service according to the second index.
9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the method for implementing retrieval based on index version switching as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, the method for implementing retrieval based on index version switching as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Retrieval system and method for implementing data fast indexing
CN101246500A
Network video index updating method and device
CN104598550A
Index switching method, device and system and index switching center control device
CN108681592A
Data processing method and device, storage medium and server
CN111767284A
Search system index switching method and search system
CN1975717A
