Information retrieval method, apparatus, device, and medium

By replacing the document vector and version identifier of the shard nodes one by one, and utilizing the multi-version encoding technology of the dual-tower retrieval model, the problems of service interruption and storage resource waste caused by the update of the dual-tower retrieval model are solved, and efficient and accurate information retrieval is achieved.

CN123030737APending Publication Date: 2026-11-03BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611200702.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-07
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

When updating the dual-tower retrieval model, existing technologies require taking the system offline for the update, resulting in service interruption, or require sharded nodes to store data for both the old and new versions simultaneously, leading to wasted storage resources and inaccurate retrieval results.

Method used

By replacing the document vectors and version identifiers stored in the shard nodes one by one, the query requests are encoded using the first and second version query models respectively, and each shard node selects the query vector with the same version identifier for retrieval, ensuring that the query vector and document vector version are consistent during the update process.

Benefits of technology

It improved the accuracy of search results, reduced the consumption of storage resources, and avoided service interruptions and resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123030737A_ABST
    Figure CN123030737A_ABST
Patent Text Reader

Abstract

The present disclosure provides an information retrieval method, device and medium, relates to the technical field of artificial intelligence, in particular to the technical field of machine learning, recommendation system and the like, and can be used in application scenarios such as generative search, intelligent document editing, intelligent assistants, virtual assistants, intelligent e-commerce and the like. The method comprises: obtaining a second version of a query model and a document model, and additionally deploying the second version of the query model online; using the second version of the document model to encode to obtain a second document vector; distributing the second document vector and a version identifier to a plurality of shard nodes in a per-shard manner; in response to receiving a query request before the distribution is completed, using the query model of two versions to encode to obtain two query vectors respectively; sending the two query vectors and the respective version identifiers to each shard node; for each shard node, selecting a query vector with a version identifier consistent with the shard node to search in the document vector stored in the shard node; and aggregating the search results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, particularly to the fields of machine learning and recommendation systems, and can be used in application scenarios such as generative search, intelligent document editing, intelligent assistants, virtual assistants, and intelligent e-commerce. Specifically, it relates to an information retrieval method, an information retrieval device, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology

[0002] Artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies mainly include natural language processing, computer vision, speech recognition, machine learning / deep learning, big data processing, and knowledge graph technologies.

[0003] The methods described in this section are not necessarily methods that had been previously conceived or adopted. Unless otherwise specified, no method described in this section should be assumed to be prior art simply because it is included in this section. Similarly, unless otherwise specified, the issues mentioned in this section should not be considered to be accepted in any prior art. Summary of the Invention

[0004] This disclosure provides an information retrieval method, an information retrieval device, an electronic device, a computer-readable storage medium, and a computer program product.

[0005] According to one aspect of this disclosure, an information retrieval method is provided. Multiple shard nodes each store a corresponding first document vector and a first version identifier. The first document vector is obtained by encoding a document using a first version document model, and the first version query model is in an online deployment state. The method includes: obtaining a second version query model and a document model, and additionally deploying the second version query model online; encoding the document using the second version document model to obtain a second document vector; distributing the second document vector and the second version identifier to the multiple shard nodes segment by segment to replace the first document vector and the first version identifier stored in each shard node segment by segment; in response to receiving a query request before the distribution is complete, encoding the query request using the first version query model and the second version query model respectively to obtain a first query vector and a second query vector; sending the first query vector, the second query vector, and their respective corresponding version identifiers to the multiple shard nodes; for each shard node, selecting a query vector whose version identifier matches the version identifier stored in the first query vector and the second query vector, and performing a retrieval within the document vector stored in that shard node; and summarizing the retrieval results from the multiple shard nodes to obtain the retrieval result for the query request.

[0006] According to another aspect of this disclosure, an information retrieval apparatus is provided. Multiple shard nodes each store a corresponding first document vector and a first version identifier. The first document vector is obtained by encoding a document using a first version document model, and the first version query model is deployed online. The apparatus includes: an acquisition unit configured to acquire a second version of a query model and a document model, and additionally deploy the second version of the query model online; a document encoding unit configured to encode a document using the second version of the document model to obtain a second document vector; a distribution unit configured to distribute the second document vector and a version identifier of the second version to multiple shard nodes piecewise, thereby replacing the first document vector and the version identifier of the first version stored in each shard node piecewise; a query encoding unit configured to, in response to receiving a query request before distribution is complete, encode the query request using the first version of the query model and the second version of the query model respectively to obtain a first query vector and a second query vector; a sending unit configured to send the first query vector and the second query vector, along with their respective version identifiers, to multiple shard nodes; a retrieval unit configured to, for each shard node, select a query vector whose version identifier matches the version identifier stored in the first query vector and the second query vector, and perform a retrieval in the document vector stored in the shard node; and a summarizing unit configured to summarize the retrieval results of multiple shard nodes to obtain retrieval results for the query request.

[0007] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods described above.

[0008] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to perform the above-described method.

[0009] According to another aspect of this disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above-described method when executed by a processor.

[0010] According to one or more embodiments of this disclosure, during the process of updating the version of the dual-tower retrieval model, the document vectors and version identifiers stored by each shard node are replaced piece by piece. Then, the query requests are encoded using the first version and the second version of the query model, and each shard node selects a query vector whose version identifier matches the version identifier stored by that shard node to perform the retrieval. This ensures that the query vectors and document vectors used for retrieval on each shard node are always consistent in version during the update process, improving the accuracy of the retrieval results. Furthermore, each shard node does not need to maintain two versions of document vectors simultaneously, reducing the consumption of storage resources.

[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0012] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0013] Figure 1 A schematic diagram of an exemplary system in which the various methods described herein may be implemented according to embodiments of the present disclosure is shown; Figure 2 A flowchart of an information retrieval method according to an embodiment of the present disclosure is shown; Figure 3 A flowchart of an information retrieval method according to an embodiment of the present disclosure is shown; Figure 4 A structural block diagram of an information retrieval device according to an embodiment of the present disclosure is shown; Figure 5 A structural block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation

[0014] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0015] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to limit the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.

[0016] The terminology used in the description of the various examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. Furthermore, the term "and / or" as used in this disclosure covers any one of the listed items and all possible combinations thereof.

[0017] In related technologies, updating the version of the dual-tower retrieval model usually requires taking the system offline for the update, which leads to service interruption; or after calculating the document vector of the entire document using the new document model, the new document vector is sent to multiple shard nodes without interrupting the service, which requires the storage capacity of the shard nodes to accommodate the data of the old and new versions at the same time, resulting in a waste of storage resources.

[0018] To address the aforementioned issues, this disclosure replaces the document vectors and version identifiers stored on each shard node piece by piece during the update of the dual-tower retrieval model. Then, it encodes the query requests using the first and second version query models respectively. Each shard node selects a query vector whose version identifier matches the version identifier stored on that shard node to perform the retrieval. This ensures that the query vectors and document vectors used for retrieval on each shard node remain consistent throughout the update process, improving the accuracy of the retrieval results. Furthermore, each shard node does not need to maintain two versions of document vectors simultaneously, reducing storage resource consumption.

[0019] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0020] Figure 1 A schematic diagram of an exemplary system 100 in which the various methods and apparatus described herein can be implemented according to embodiments of this disclosure is shown. Reference Figure 1 The system 100 includes one or more client devices 101, 102, 103, 104, 105 and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105 and 106 can be configured to execute one or more applications.

[0021] In embodiments of this disclosure, server 120 may run one or more services or software applications that enable the execution of the methods of this disclosure.

[0022] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtual and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, such as to users of client devices 101, 102, 103, 104, 105 and / or 106 under a Software as a Service (SaaS) model.

[0023] exist Figure 1 In the configuration shown, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or combinations thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 can sequentially interact with server 120 using one or more client applications to utilize the services provided by these components. It should be understood that various different system configurations are possible and may differ from system 100. Therefore, Figure 1 This is an example of a system used to implement the various methods described herein, and is not intended to be limiting.

[0024] Users can use client devices 101, 102, 103, 104, 105, and / or 106 for human-computer interaction. The client devices provide interfaces that enable users to interact with them. The client devices can also output information to the user through these interfaces. Although... Figure 1 Only six client devices are described, but those skilled in the art will understand that this disclosure can support any number of client devices.

[0025] Client devices 101, 102, 103, 104, 105, and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors, or other sensing devices. These computer devices can run various types and versions of software applications and operating systems, such as Microsoft Windows, Apple iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as Google Chrome OS); or include various mobile operating systems, such as Microsoft Windows Mobile OS, iOS, Windows Phone, and Android. Portable handheld devices may include cellular phones, smartphones, tablets, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Gaming systems may include various handheld gaming devices, internet-enabled gaming devices, etc. Client devices are capable of executing various applications, such as various internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and can use various communication protocols.

[0026] Network 110 can be any type of network well known to those skilled in the art, and can support data communication using any of a variety of available protocols (including but not limited to TCP / IP, SNA, IPX, etc.). By way of example only, one or more networks 110 can be a local area network (LAN), an Ethernet-based network, a token ring network, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.

[0027] Server 120 may include one or more general-purpose computers, special-purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running a virtual operating system, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that can be virtualized to maintain virtual storage devices for servers). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0028] The computing unit in server 120 can run one or more operating systems, including any of the aforementioned operating systems and any commercially available server operating system. Server 120 can also run any of a variety of additional server applications and / or middleware applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.

[0029] In some implementations, server 120 may include one or more applications to analyze and merge data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105 and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105 and / or 106.

[0030] In some implementations, server 120 can be a server for a distributed system or a server integrated with blockchain. Server 120 can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in the cloud computing service system, designed to address the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.

[0031] System 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. Databases 130 may reside in various locations. For example, a database used by server 120 may be local to server 120, or it may be located away from server 120 and may communicate with server 120 via a network-based or dedicated connection. Databases 130 may be of different types. In some embodiments, the database used by server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve data from and from the databases in response to commands.

[0032] In some embodiments, one or more of the databases 130 may also be used by an application to store application data. The databases used by the application may be of different types, such as key-value stores, object stores, or regular stores supported by a file system.

[0033] Figure 1The system 100 can be configured and operated in various ways to enable the application of the various methods and apparatus described in this disclosure.

[0034] According to one aspect of this disclosure, an information retrieval method is provided. Figure 2 A flowchart of an information retrieval method 200 according to an exemplary embodiment is shown.

[0035] Method 200 is applied to information retrieval scenarios based on a dual-tower retrieval model. The dual-tower retrieval model includes a query model and a document model. The query model encodes query requests into query vectors, and the document model encodes documents into document vectors. Documents relevant to the query request are determined by calculating the similarity between the query vector and the document vector. The same version of the query model and document model are jointly trained and share the same vector space. Therefore, the similarity calculation is only valid when the query vector and document vector are generated by the same version of the query model and document model, respectively.

[0036] The document vectors of the full set of documents are distributed across multiple shard nodes. Each shard node stores the document vectors of a subset of the full set of documents and performs retrievals within its own stored document vectors. A version identifier is used to characterize the version of the model that generated the document vectors or query vectors. For example, the version identifier can be represented by the version number of the document model, the version number of the query model, or the batch number of the version update; this disclosure does not limit this.

[0037] Before method 200 begins, each of the multiple shard nodes stores its own first document vector and first version identifier. The first document vector is obtained by encoding the document using the first version document model. The first version query model is in an online deployment state, that is, the first version query model receives query requests online and encodes them.

[0038] refer to Figure 2 In step S201, the second version of the query model and document model are obtained, and the second version of the query model is deployed online.

[0039] The second version of the query model and document model are new versions of the model used to update the dual-tower retrieval model. In some embodiments, the second version of the query model and document model may be obtained by retraining the dual-tower retrieval model using newly added business data, so that the model keeps up with changes in business data. Additional online deployment refers to deploying the second version of the query model while keeping the first version of the query model online, so that both versions of the query model are online simultaneously and can encode query requests. In some embodiments, the second version of the query model can be deployed by adding a new online model service, which is independent of the model service that deploys the first version of the query model.

[0040] In step S202, the document is encoded using the second version of the document model to obtain the second document vector.

[0041] In some embodiments, the document being encoded and the document used to obtain the first document vector can be the same full document set. The resulting second document vector corresponds to the same document as the first document vector but is in a different vector space. In some embodiments, encoding can be performed offline in batches. The encoding of the second document vector and the distribution in the subsequent step S203 can be performed sequentially after encoding is completed, or they can be performed alternately in a segmented pipeline. This disclosure does not limit this.

[0042] In step S203, the second document vector and the version identifier of the second version are distributed to multiple shard nodes piece by piece, so as to replace the first document vector and the version identifier of the first version stored in each shard node piece by piece.

[0043] Shard-by-shard distribution refers to distributing data sequentially at the shard node level. Upon receiving the distributed data, a shard node replaces its original first document vector and version identifier with a second document vector and a second version identifier. After the replacement, the shard node provides retrieval based on the second document vector. Because the document vectors of all documents are large, replacing all shard nodes shard-by-shard takes time. During this period, multiple shard nodes may simultaneously contain both the first document vector and the first version identifier, and the second document vector and the second version identifier.

[0044] In some embodiments, the version identifier of the second version can be transmitted as a field in the distributed data along with the second document vector, and saved by the shard node as the version identifier of the shard node when the replacement is completed.

[0045] In step S204, in response to receiving a query request before the distribution is completed, the query request is encoded using the first version of the query model and the second version of the query model respectively to obtain the first query vector and the second query vector.

[0046] Before the distribution is complete, i.e., before all the aforementioned replacements are finished, query requests received online during this period are encoded by two versions of the query model that are online simultaneously. The resulting first query vector carries the semantics of the first version, and the second query vector carries the semantics of the second version. In some embodiments, the encoding of query requests by the two versions of the query model can be performed in parallel to avoid increasing the response latency of query requests.

[0047] In step S205, the first query vector and the second query vector, along with their respective version identifiers, are sent to multiple shard nodes.

[0048] In this context, the version identifier corresponding to the first query vector is the version identifier of the first version, and the version identifier corresponding to the second query vector is the version identifier of the second version. That is, the version identifier corresponding to the query vector represents the version to which the query model that generated the query vector belongs. In some embodiments, each query vector and its corresponding version identifier can be carried in the same retrieval request and sent to each of the multiple shard nodes via the online retrieval link.

[0049] In step S206, for each shard node, a query vector whose version identifier matches the version identifier stored in the shard node is selected from the first query vector and the second query vector, and the retrieval is performed in the document vector stored in the shard node.

[0050] For any shard node, the version identifier stored in the shard node is compared with the version identifier corresponding to the first query vector and the version identifier corresponding to the second query vector. If the shard node has not been replaced, its stored version identifier is consistent with the version identifier corresponding to the first query vector, and the first query vector is selected for retrieval in the first document vector stored in the shard node. If the shard node has been replaced, its stored version identifier is consistent with the version identifier corresponding to the second query vector, and the second query vector is selected for retrieval in the second document vector stored in the shard node.

[0051] Therefore, regardless of whether the shard node is in its pre-replacement or post-replacement state, the query vector and document vector used for retrieval on that shard node are generated from the same version of the query model and document model. In some embodiments, the retrieval can be an approximate nearest neighbor retrieval, that is, calculating the similarity between the selected query vector and each document vector stored in the shard node, and returning documents whose similarity meets preset conditions as the retrieval results of the shard node.

[0052] In step S207, the search results of multiple shard nodes are aggregated to obtain the search results for the query request.

[0053] Since each shard node stores the document vector of a portion of the full document, the retrieval results of each shard node come from different parts of the full document. The retrieval results from multiple shard nodes are then aggregated to obtain the retrieval results for the entire document. In some embodiments, the aggregation may include sorting the documents returned by each shard node according to similarity, selecting a predetermined number of documents at the top of the sorted list as the retrieval results for the query request, and providing these retrieval results to subsequent sorting stages for further processing.

[0054] According to embodiments of this disclosure, during the process of updating the version of the dual-tower retrieval model, the document vectors and version identifiers stored in each shard node are replaced piece by piece. Then, the query requests are encoded using the first and second version query models respectively. Each shard node selects a query vector whose version identifier matches the version identifier stored in that shard node to perform the retrieval. This ensures that the query vectors and document vectors used for retrieval on each shard node are always consistent in version during the update process, improving the accuracy of the retrieval results. Furthermore, each shard node does not need to maintain two versions of document vectors simultaneously, reducing the consumption of storage resources.

[0055] Specifically, since document vector replacement is performed shard-by-shard, before the replacement is complete, multiple shard nodes simultaneously contain shard nodes storing the first version of the document vector and shard nodes storing the second version of the document vector. If only a single version of the query model is used to encode the query request, the resulting query vector will be inconsistent with the version of the document vector stored by some of the shard nodes. Performing a search on these shard nodes will produce invalid similarity calculation results. This disclosure generates a first query vector and a second query vector for the same query request and sends them along with their respective version identifiers to each shard node. Regardless of whether a shard node stores the first or second version of the document vector, that shard node can select a query vector with the same version. Thus, at any time during the replacement process, all shard nodes can participate in the search, and the search is always performed between vectors with the same version. This avoids invalid search results caused by version inconsistency and also avoids the service interruption or resource doubling issues caused by suspending the search service or maintaining a complete set of document vectors for each version to ensure version consistency.

[0056] The method 200 disclosed herein can be implemented in an information retrieval system. The architecture of the information retrieval system may include a model training platform, a task scheduling platform, a vector encoding service, a vector index management system, and a vector retrieval engine. The model training platform is used to train various versions of the query model and document model. The task scheduling platform is used to maintain the state of the version update process and trigger version updates. For example, the state maintained by the task scheduling platform may include the training state of each version of the model, the encoding and distribution state of document vectors, the state of the version update process, and the corresponding records of each version and model deployment location. The vector encoding service includes a query encoding service and a document encoding service. The query encoding service deploys a query model for online encoding of query requests, and the document encoding service deploys a document model for offline encoding of all documents. The vector index management system is used to construct a vector index based on the document vectors output by the document encoding service and distribute the vector index to the vector retrieval engine. The vector retrieval engine includes multiple shard nodes. Each shard node stores a portion of the document vectors corresponding to that shard node in the vector index and performs retrieval within its stored document vectors.

[0057] In some embodiments, the creation and distribution of vector indexes may include: the vector index management system obtaining the version identifier of the document model used in this version update, organizing the document vectors output by the document encoding service into a vector index by shards, writing the version identifier into the index configuration information of the vector index, and distributing the index configuration information and document vectors to each shard node of the vector retrieval engine shard by shard.

[0058] In some embodiments, the query vectors obtained by encoding the query request and their corresponding version identifiers can be sent to each shard node of the vector retrieval engine via an online retrieval link. The online retrieval link refers to the transmission link through which the query request travels from its receipt to each shard node. For example, the version identifier can be a field in the transmission protocol at each level of the online retrieval link, passed layer by layer to each shard node along with the query vector. In some embodiments, this field can be optional; nodes that have not upgraded their transmission protocol ignore this field and continue to transmit the query vector, allowing the upgrade of the transmission protocol to be performed gradually at each node of the online retrieval link without affecting the normal operation of the retrieval service.

[0059] It should be noted that the above architecture is only an example, and the methods of this disclosure are not limited to being executed by the above-described systems or services. The systems or services can be merged, split, or deployed on the same or different physical devices.

[0060] According to some embodiments, a first model name pair and a second model name pair with fixed names can be pre-set. Each model name pair corresponds to a query model slot and a document model slot. The first query model slot and the first document model slot of the first model name pair can be loaded with a first version of the query model and the document model, respectively. The current online model name pair is the first model name pair. In step S201, additionally deploying the second version of the query model online may include: loading the second version of the query model into the second query model slot of the second model name pair.

[0061] Therefore, model deployment is carried out in units of fixed model name pairs. When the version is updated, no new model name is generated. Instead, the new version of the model is loaded into the slot of the fixed name pair. This allows the online retrieval link and each shard node to only be aware of the fixed model name pair, without needing to be aware of the specific version number, thus reducing the complexity of synchronizing version information.

[0062] A model name pair refers to a fixed combination of names consisting of a query model slot and a document model slot that are bound together. A slot is a model deployment location that provides services externally with a fixed name. The model loaded into a slot can be replaced, but the slot name remains unchanged. Query models and document models of the same version are loaded into the two slots of the same model name pair, and their pairing relationship is guaranteed by the binding relationship of the model name pair.

[0063] In one exemplary embodiment, the first model name pair may include a query model slot named QueryModel_A and a document model slot named DocModel_A, and the second model name pair may include a query model slot named QueryModel_B and a document model slot named DocModel_B. The currently online model name pair refers to the model name pair on which the current retrieval service is provided.

[0064] Figure 3 A flowchart of an information retrieval method 300 according to an exemplary embodiment of the present disclosure is shown. The operation and effects of steps S301 to S307 in method 300 can be referred to the description of steps S201 to S207 in method 200 above, and will not be repeated here.

[0065] like Figure 3 As shown, method 300 may further include: step S308, loading the second version of the document model into the second document model slot of the second model name pair before encoding the document using the second version of the document model; and step S309, after distribution is completed, switching the current online model name pair to the second model name pair, wherein, for query requests received after the switch, the query model in the current online model name pair is used for encoding.

[0066] Therefore, the second version of the query model and document model are loaded into two slots of the same model name pair, and the switching of the current online model name pair occurs after distribution is complete. This ensures that the version update takes effect on a model name pair basis, guaranteeing version consistency between the query model and the document model before and after the update. After the switch, only the query model in the current online model name pair is used for encoding, saving the computational overhead of doubling the encoding of query requests.

[0067] In some embodiments, after a switch, the first version of the query model and document model loaded in the slot of the first model name pair can remain online and serve as the target slot for loading the new version model during the next version update, thereby the two model name pairs take turns to receive the new version model.

[0068] According to some embodiments, the information retrieval method may further include: in response to receiving a rollback instruction before distribution is completed, stopping distribution, reverting the second document vector and the version identifier of the second version stored in the replaced shard node to the first document vector and the version identifier of the first version, and maintaining the current online model name pair as the first model name pair.

[0069] Therefore, when an anomaly occurs in the second version, it is only necessary to stop distribution and roll back the data of the replaced shard nodes, without reloading the model. Since the first version of the query model and document model loaded in the slot of the first model name pair always remain online, the rollback process does not involve reloading the model, reducing the time consumption of the rollback operation and improving the efficiency of anomaly handling.

[0070] A rollback command can be triggered when an abnormality is detected in the second version of the model or during the distribution process. In an exemplary embodiment, the rollback command can be issued by operations personnel via a one-click rollback operation.

[0071] According to some embodiments, a second version of the query model and document model can be obtained when the following conditions are met: the second version of the query model and document model has been trained; the previous version update process has reached a termination state; and there is currently no document vector encoding and distribution being performed.

[0072] Therefore, version updates are only triggered when the new version model is ready, the previous update process has ended, and there are no coding or distribution tasks running at present. This avoids resource contention and data overwriting caused by multiple rounds of concurrent version updates, and improves the stability of the version update process.

[0073] The termination state refers to the final state of a version update process, including both successful update and rollback completed states. It's important to note that the ongoing encoding and distribution of document vectors is not limited to encoding and distribution triggered by version updates; it can also include re-encoding and distribution of document vectors caused by document set updates. In some embodiments, after a document set update, the updated document set can be encoded using the current online document model to obtain updated document vectors, and then the updated document vectors and their corresponding version identifiers can be distributed to multiple shard nodes on a shard-by-shard basis. During this encoding and distribution process, the operation of obtaining new versions of the query model and document model may not be performed.

[0074] In some embodiments, the above conditions can be determined by polling. For example, the model training platform can be polled to determine whether the model has completed training, the status record of the version update process can be polled to determine whether it has reached the termination state, and the status of the coding and distribution tasks can be polled to determine whether there are currently any tasks being executed.

[0075] According to some embodiments, the information retrieval method may further include: before distribution is completed, in response to the completion of training of the third version of the query model and document model, adding the third version to the waiting queue; and in response to the above conditions being met again, selecting the latest version in the waiting queue, loading the query model and document model of the selected version into the first query model slot and the first document model slot of the first model name pair, respectively, and performing encoding and distribution for the selected version to replace the second document vector and the version identifier of the second version stored in each shard node piece by piece.

[0076] Therefore, when a new version model is produced during a version update, the new version enters the waiting queue without immediately triggering an update, and the latest version in the waiting queue is selected in the next round of updates. This ensures that the system always updates to the latest available version when producing multiple versions in succession, saving the computational overhead of encoding and distributing intermediate versions.

[0077] In some embodiments, versions not selected in the waiting queue can be marked as skipped, and versions marked as skipped do not participate in subsequent version updates. In an exemplary embodiment, if the query model and document model of versions three and four are trained and added to the waiting queue before the distribution of version two is completed, then when the condition is met again, version four is selected for updating, and version three is marked as skipped.

[0078] According to some embodiments, the information retrieval method may further include: skipping the retrieval on a shard node where the stored version identifier is inconsistent with the version identifiers corresponding to the first query vector and the second query vector.

[0079] Therefore, shard nodes whose version identifiers are inconsistent with each query vector do not participate in the retrieval, thus avoiding the introduction of invalid retrieval results into the aggregation by performing similarity calculations between vectors generated by models with inconsistent versions, thereby improving the accuracy of retrieval results.

[0080] In some embodiments, a shard node whose stored version identifier is inconsistent with the version identifier corresponding to each query vector may be a shard node that has not yet completed the transmission protocol upgrade or whose version update process has encountered an anomaly. Skipping the retrieval on this shard node is a degradation process that ensures the validity of the retrieval results at the cost of a slight reduction in the number of recalls.

[0081] According to some embodiments, step S203, distributing the second document vector and the version identifier of the second version to multiple shard nodes on a shard-by-shard basis, may include (not shown in the figure): writing the version identifier of the second version into the index configuration information corresponding to the second document vector; and distributing the index configuration information and the second document vector together to multiple shard nodes, wherein each shard node uses the version identifier in the index configuration information as the version identifier stored by the shard node.

[0082] Therefore, the version identifier is distributed along with the second document vector as part of the index configuration information. The shard node obtains the corresponding version identifier at the same time as receiving the distributed data, without the need to synchronize version information through an additional path, which reduces system complexity and improves reliability.

[0083] Index configuration information refers to configuration information describing how document vectors stored in shard nodes are organized. In an exemplary embodiment, index configuration information may include a field called doc_model_version carrying a version identifier, and may also include fields such as vector dimensions.

[0084] According to another aspect of this disclosure, an information retrieval device is provided. For example... Figure 4As shown, the information retrieval device 400 includes: an acquisition unit 410 configured to acquire a second version of a query model and a document model, and additionally deploy the second version of the query model online; a document encoding unit 420 configured to encode documents using the second version of the document model to obtain a second document vector; a distribution unit 430 configured to distribute the second document vector and the version identifier of the second version to multiple shard nodes piecewise, thereby replacing the first document vector and the version identifier of the first version stored in each shard node piecewise; and a query encoding unit 440 configured to, in response to receiving a query request before the distribution is completed, respectively utilize the first... The query request is encoded using a version-specific query model and a second version-specific query model to obtain a first query vector and a second query vector. A sending unit 450 is configured to send the first query vector, the second query vector, and their respective version identifiers to multiple shard nodes. A retrieval unit 460 is configured to, for each shard node, select a query vector whose version identifier matches the version identifier stored in the first and second query vectors, and perform a retrieval within the document vectors stored in that shard node. A summarizing unit 470 is configured to summarize the retrieval results from multiple shard nodes to obtain the retrieval results for the query request.

[0085] Each of the multiple shard nodes stores its own first document vector and first version identifier. The first document vector is obtained by encoding the document using the first version document model, and the first version query model is in an online deployment state.

[0086] It is understood that the operation and effects of units 410 to 470 in the information retrieval device 400 can be referred to the description of steps S201 to S207 in the information retrieval method 200 above, and will not be repeated here.

[0087] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0088] According to embodiments of this disclosure, an electronic device, a readable storage medium, and a computer program product are also provided.

[0089] refer to Figure 5The present invention describes a structural block diagram of an electronic device 500 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0090] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. The RAM 503 may also store various programs and data required for the operation of the electronic device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0091] Multiple components in electronic device 500 are connected to I / O interface 505, including: input unit 506, output unit 507, storage unit 508, and communication unit 509. Input unit 506 can be any type of device capable of inputting information to electronic device 500. Input unit 506 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device, and may include, but is not limited to, a mouse, keyboard, touchscreen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 507 can be any type of device capable of presenting information, and may include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 508 may include, but is not limited to, disk and optical disk. Communication unit 509 allows electronic device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0092] The computing unit 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods, processes, and / or processes described above. For example, in some embodiments, these methods, processes, and / or processes may be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the methods, processes, and / or processes described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform these methods, processes, and / or processes by any other suitable means (e.g., by means of firmware).

[0093] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0094] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0095] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0096] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0097] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.

[0098] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0099] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0100] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of this disclosure is not limited by these embodiments or examples, but only by the granted claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.

Claims

1. An information retrieval method, wherein, Multiple shard nodes each store a corresponding first document vector and a first version identifier. The first document vector is obtained by encoding the document using the first version document model. The first version query model is in an online deployment state. The method includes: Obtain the second version of the query model and document model, and additionally deploy the second version of the query model online; The document is encoded using the second version of the document model to obtain a second document vector; The second document vector and the version identifier of the second version are distributed to the plurality of shard nodes in a shard-by-shard manner, so as to replace the first document vector and the version identifier of the first version stored in each shard node in a shard-by-shard manner. In response to receiving a query request before the distribution is completed, the query request is encoded using a first version of the query model and a second version of the query model to obtain a first query vector and a second query vector. Send the first query vector and the second query vector, along with their respective version identifiers, to the multiple shard nodes; For each shard node, select a query vector from the first and second query vectors whose version identifier matches the version identifier stored in that shard node, and then perform a search within the document vector stored in that shard node; and The search results from the multiple shard nodes are aggregated to obtain the search results for the query request.

2. The method according to claim 1, wherein, There are pre-set first model name pairs and second model name pairs with fixed names. Each model name pair corresponds to one query model slot and one document model slot. The first query model slot and the first document model slot of the first model name pair are respectively loaded with the first version of the query model and the document model. The currently online model name pair is the first model name pair. The additional online deployment of the second version of the query model includes: Load the second version of the query model into the second query model slot in the second model name pair.

3. The method according to claim 2, further comprising: Before encoding the document using the second version of the document model, the second version of the document model is loaded into the second document model slot of the second model name pair; as well as After the distribution is completed, the current online model name pair is switched to the second model name pair. For query requests received after the switch, the query model in the current online model name pair is used for encoding.

4. The method according to claim 3, wherein, The second version of the query model and document model is retrieved if the following conditions are met: The second version of the query model and document model has been trained; The previous version update process has reached a terminated state; and There is currently no document vector encoding and distribution in progress.

5. The method according to claim 4, further comprising: Before the distribution is completed, in response to the fact that the third version of the query model and document model has been trained, the third version is added to the waiting queue; as well as In response to the condition being met again, the latest version in the waiting queue is selected, and the query model and document model of the selected version are loaded into the first query model slot and the first document model slot of the first model name pair, respectively. Encoding and distribution are performed for the selected version to replace the second document vector and the version identifier of the second version stored in each shard node on a shard-by-shard basis.

6. The method according to claim 2, further comprising: In response to receiving a rollback instruction before the distribution is completed, the distribution is stopped, the second document vector and the version identifier of the second version stored in the replaced shard node are rolled back to the first document vector and the version identifier of the first version, and the current online model name pair is maintained as the first model name pair.

7. The method according to any one of claims 1-6, further comprising: For shard nodes whose stored version identifiers are inconsistent with the version identifiers corresponding to both the first query vector and the second query vector, skip performing the retrieval on that shard node.

8. The method according to any one of claims 1-6, wherein, The step of distributing the second document vector and the version identifier of the second version to the multiple shard nodes segment by segment includes: Write the version identifier of the second version into the index configuration information corresponding to the second document vector; and The index configuration information and the second document vector are distributed to the multiple shard nodes, wherein each shard node uses the version identifier in the index configuration information as the version identifier stored by that shard node.

9. An information retrieval device, wherein, Multiple shard nodes each store a corresponding first document vector and a first version identifier. The first document vector is obtained by encoding the document using the first version document model. The first version query model is in an online deployment state. The device includes: The retrieval unit is configured to retrieve a second version of the query model and document model, and additionally deploy the second version of the query model online; The document encoding unit is configured to encode the document using the second version of the document model to obtain a second document vector; The distribution unit is configured to distribute the second document vector and the version identifier of the second version to the plurality of shard nodes piece by piece, so as to replace the first document vector and the version identifier of the first version stored in each shard node piece by piece; The query encoding unit is configured to encode the query request using a first version of the query model and a second version of the query model in response to receiving a query request before the distribution is completed, to obtain a first query vector and a second query vector. The sending unit is configured to send the first query vector and the second query vector, along with their respective version identifiers, to the plurality of shard nodes; The retrieval unit is configured to, for each shard node, select a query vector from the first query vector and the second query vector whose version identifier matches the version identifier stored in that shard node, and then perform a retrieval within the document vector stored in that shard node; and The aggregation unit is configured to aggregate the search results of the multiple shard nodes to obtain the search results for the query request.

10. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 8.

11. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 8.

12. A computer program product comprising a computer program, wherein, The computer program, when executed by a processor, implements the method of any one of claims 1 to 8.