A method and system for progressive migration of incomplete original text heterogeneous vector spaces
By employing a stepwise migration method, the problem of vector space migration caused by incomplete original text was solved, achieving query continuity and accuracy during the incomplete document recovery process, and avoiding data congestion and increased query costs.
Patent Information
- Application Number
- CN202611554511.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-09
- Publication Date
- 2026-11-27
AI Technical Summary
When the original text is incomplete, existing technologies cannot effectively migrate heterogeneous vector spaces. This results in data preparation progress changing little by little according to the document, while the system switches according to the entire set, leading to problems such as long-term data loss, doubled query costs, retrieval gaps, and incompatibility with vector spaces.
A progressive migration method for heterogeneous vector spaces with incomplete original text is adopted. By establishing a routing version, registering a document migration list, receiving original text recovery events, reconstructing vectors according to the second route and performing retrieval confirmation, the routing version is switched step by step to ensure that the model and set take effect together with the same routing version, avoiding direct copying of old vectors to the new set.
It enables the gradual migration of trusted documents even when the original text is incomplete, avoiding long-term data congestion and increased query costs, ensuring the continuity and accuracy of queries, and reducing issues such as duplicate results and vector space incompatibility.
Smart Images

Figure CN123178495A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of data migration, vector databases and semantic retrieval technology, and in particular to a method and system for progressive migration of heterogeneous vector spaces with incomplete original text. Background Technology
[0002] Currently, the typical process for knowledge base question answering, enterprise search, and similar content retrieval is as follows: First, the document is divided into several text blocks. Then, an embedding model is used to convert each block into a vector. Finally, the vector vector, along with the document number and text block number, is written into a vector database. During a query, the same or compatible model is used to calculate the query vector, and then a nearest neighbor search is performed in the corresponding set.
[0003] Embedding models and vector sets are not two parts that can be arbitrarily assembled. Historical vectors stored in a set are typically only valid for the embedding model that generated them, along with its associated dimensions, metrics, and normalization rules. If a second embedding model is used to generate query vectors, but the query is still performed within the first vector set, even if the database interface is accessible, the calculated similarity will not reflect the expected semantics; if the dimensions also don't match, the query will fail. Therefore, changing the embedding model essentially means obtaining the original text or text blocks and recalculating the vectors using the new model.
[0004] If the original text is incomplete, early systems might only have retained vectors, document numbers, and titles, while the object storage containing the original files has long been decommissioned. Some documents can be retrieved from the business database or archive disk, some require users to re-upload, and a batch are simply impossible to find in the short term. Even if the files are found, it's not guaranteed to be the version used to generate the old vectors. If the migration waits until all the original text is collected, the upgrade will be delayed indefinitely by those few problematic documents; however, if the old vectors are directly copied to the new set, the problem of model changes and vector space incompatibility remains unresolved.
[0005] In addition, while the old vector library is still available for querying, some historical documents have lost their original text or only incomplete parts have been recovered. Instead of waiting for all original texts to be recovered, the system works backwards, recovering texts one by one. For each document whose reliable original text is recovered first, the new embedding model is used to recalculate its vectors and add them to a new vector set. Only after confirming that these vectors can indeed be retrieved from the query and that the original text was not modified during generation is the query route for that document switched.
[0006] A typical blue-green migration process usually involves first migrating the existing data, then performing a dual write operation on the incremental data, and finally switching over the entire dataset after verification. This process works smoothly when the original text is complete; however, if the original text is missing, and the switching unit is still the entire set, the following problems arise:
[0007] 1) You need to wait until all the original text is recovered before switching. A few long-term lost original texts may block the upgrade of the entire database or the embedded model.
[0008] 2) If the old vectors are directly copied into the new set and the new model is used to look them up, the model and the vector space will not match, and the resulting similarity will be unreliable.
[0009] 3) Once a document is successfully reconstructed, the entire collection will be switched to the new set, and those documents that have not yet been restored to their original form will disappear from the search results.
[0010] 4) If all queries are performed on both spaces simultaneously without distinction for a long period of time, the migrated documents will produce duplicate results, doubling the query cost.
[0011] 5) Even if the new vector is successfully written, it may not be in a searchable state. If you change the document route to the new space, the user will encounter a search window.
[0012] 6) During the process of "reading the original text - segmenting - generating vectors - writing to the database", the original text may be modified by the business system. Without verifying the source version, the new vector calculated from the old content may overwrite the route of the corresponding updated content.
[0013] 7) Recording only a "migration successful" boolean value without recording the model version, set, dimension, measurement method and block version may result in mismatch between the query model and set during operation.
[0014] 8) When the first and second vector spaces are generated by different embedding models, the distribution range of similarity scores may be different. If the original cosine scores are directly mixed, candidates in a certain space may dominate the results for a long time due to their overall high scores.
[0015] In summary, there is a problem where the data preparation progress changes little by little on a document basis, but the system switches according to the entire collection. Summary of the Invention
[0016] In view of the shortcomings of the prior art, the present invention aims to provide a progressive migration method for heterogeneous vector spaces with incomplete original text. The original text does not need to be collected all at once. Each time the archive system recovers a reliable document, it can migrate that document forward separately. The remaining problematic data will not block the upgrade of the entire database or the embedded model.
[0017] To achieve the objectives of this invention, the technical solution adopted is: a progressive migration method for heterogeneous vector spaces with incomplete original text, comprising:
[0018] S1. Establish route versions: Establish the first route version V1 on the existing network and establish the second route version V2 on the target network;
[0019] S2. Register the document migration list: Extract the stable document identifier document_id, and create a migration list based on document_id;
[0020] S3, Receive the recovery event of the original text: When the original text of a document is completely recovered, submit the document_id and source version to the migration task;
[0021] S4. Reconstruct vectors according to the second route: Generate new vectors from the original text according to the block division rules of the second route version V2 and the second embedding model;
[0022] S5. Use the retrieved new vector as the routing switching condition, and simultaneously verify the source version;
[0023] S6. After retrieving the new vector and verifying its consistency, switch the current valid route of the document from the first route version to the second route version using the overall update method, and update the migration status synchronously.
[0024] As an optimization of the present invention, when the recovered part of the original text can be independently retrieved, the version can be independently determined, and the content boundary of the business content unit is clear, an independent stable document identifier is assigned to the business content unit and migration is performed separately; when the recovered content belongs to a random missing segment of the same document or the integrity of the content cannot be confirmed, a valid vector of the second routing version V2 is not constructed based on the recovered content, and the document remains valid in the first routing version V1 until a complete and credible source or a confirmed new version is obtained.
[0025] As an optimization scheme of the present invention, the first routing version V1 includes a first embedding model A, a first vector set A, a first vector dimension, a first metric method, and a first block rule; the second routing version V2 includes a second embedding model B, a second vector set B, a second vector dimension, a second metric method, and a second block rule.
[0026] As an optimized solution of the present invention, the new vector execution retrieval confirmation includes:
[0027] 1) Detect the record corresponding to document_id or migration batch number migration_batch_id in the second vector set B;
[0028] 2) Verify the source_version, route_version, model_signature, and chunk_version in the records;
[0029] 3) The number of valid text blocks detected has reached the target number;
[0030] 4) When the target text block is temporarily not visible due to query copy synchronization, index refresh, or eventual consistency, a limited number of retries will be performed within the preset waiting time limit; if the retrieval confirmation conditions are not met after the number of retries or the waiting time limit has been reached, no route switching will be performed.
[0031] As an optimized solution of the present invention, the document migration state includes the first route valid state LEGACY_A, the target route reconstruction state REBUILDING_B, the dual route ready state DUAL_READY, the second route valid state ACTIVE_B, and the first route decommissioned state RETIRED_A.
[0032] As an optimization of the present invention, during the online query phase of the migration transition period, the query request reads the route version snapshot that has been verified for integrity when it starts processing, and uses the route version snapshot throughout the entire processing of the request; the route version snapshot is identified by a monotonically increasing route version number route_epoch, which is used to identify the snapshot version and perform concurrent verification when updating the execution conditions.
[0033] As an optimized solution of the present invention, a search is performed on the first vector set and the second vector set respectively to obtain their respective Top-N text block candidates; within each search channel, text block candidates are merged according to stable document identifiers, invalid candidates are filtered based on the current valid routes and currently effective batches in the routing version snapshot, the channel ranking is re-determined for the filtered valid documents, and the reciprocal ranking of document d is calculated using the following formula to fuse the RRF score:
[0034] Score(d) = I_V1(d) / (K + Rank_V1(d)) + I_V2(d) / (K + Rank_V2(d))
[0035] In the formula, Rank_V1(d) and Rank_V2(d) are the ranks of document d in the effective document lists of the first and second retrieval channels, respectively, K is a smoothing constant greater than zero, and I_V1(d) and I_V2(d) are valid route identifiers; a unified list of candidate documents is output in descending order of the RRF score to avoid directly comparing the original similarity scores of heterogeneous vector spaces and to avoid the same document being returned repeatedly.
[0036] As an optimization of the present invention, after a document is switched to the second route, the first vector set A records a period of observation, allowing rollback to a single document.
[0037] As an optimization of the present invention, at the end of the observation period, the old records of document_id in the first set are marked as deleted and then deleted asynchronously. After deletion, the status is changed to RETIRED_A. The retirement of old records and route switching are executed separately, and the switching, rollback and deletion are decoupled from each other.
[0038] To achieve the objective of this invention, the technical solution adopted is: a heterogeneous vector space progressive migration system for incomplete original text, comprising: a document migration status and route binding module and a retrieval confirmation and document-level switching module;
[0039] The document migration status and route binding module is used to maintain stable document identifiers, document migration status, currently valid routes, current source versions, currently effective batches, and route version numbers, and binds embedded models and vector sets in units of complete route versions;
[0040] The retrieval confirmation and document-level switching module is used to reconstruct and idempotently write the target route into the text block vector. It performs retrieval confirmation and source version verification through the actual query entry point, performs document-level conditional atomic switching when the switching conditions are met, and filters candidates and performs inverse ranking fusion based on the fixed route version snapshot during the migration transition period.
[0041] This invention has the following positive effects: 1) The original text of this invention does not need to be collected all at once. Each time a reliable document is recovered by the archiving system, that document can be migrated forward separately, and the remaining problematic data will not clog the entire database;
[0042] 2) This invention ensures that models and sets take effect together with the same routing version, so even if configuration updates occur at different times, combinations such as "model A queries set B, model B queries set A" will not occur.
[0043] 3) The basis for the switching of this invention is that the online query entry can already detect the target batch; rather than just the write interface returning success, so it can bypass the brief window created by the asynchronous processes of index building and query copy refresh.
[0044] 4) If the original text of this invention is modified during the reconstruction, this batch will not be activated. Instead, the new version will be regenerated to avoid the problem of "old content existing in the new library". The effective vectors in the new space are still regenerated from the reliable text. The old vectors are not directly copied to the new model, nor is the vector inversion that cannot guarantee word-for-word consistency.
[0045] 5) During the transition period of this invention, the retrieval capabilities of both the old and new spaces are retained. Invalid candidates are first eliminated by stable document identifier, current route and active batch, and then valid candidates are fused by RRF. This avoids duplicate results and does not compare similarity across spaces.
[0046] 6) In this invention, switching and rollback both occur on a single document. When an archive file encounters a problem, only the corresponding document_id is rolled back, without switching the entire collection back to the old database. Old vectors are not deleted at the moment of switching. Switching first, then observing, and then asynchronously retiring provides a rollback window while preventing large-scale deletions from blocking online requests. Attached Figure Description
[0047] The present invention will be further described in detail below with reference to the accompanying drawings and practical examples;
[0048] Figure 1 This is a schematic diagram of the process of the present invention;
[0049] Figure 2 This is a schematic diagram of the system structure of the present invention;
[0050] Figure 3 This is a flowchart of the single-document migration and routing switching sub-process of the present invention;
[0051] Figure 4 This is a flowchart of the RRF result fusion sub-process for routing validity constraints in this invention. Detailed Implementation
[0052] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0053] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 This invention provides a method for progressive transfer of heterogeneous vector spaces with incomplete original text.
[0054] Step S101: Establish route versions. Create a first route version V1 for the live network, embedding the first embedded model A, the first vector set A, the first vector dimension, the first metric, and the first partitioning rule into a single version record. Then create a second route version V2 for the target environment, embedding the second embedded model B, the second vector set B, and their associated parameters into it. Before deployment, run a static validation test to verify at least: the model output dimension matches the set field dimension, the metric is supported by the target set, the partitioning version exists, and the set read / write permissions are normal. If the validation fails, this route version cannot be released.
[0055] Step S102: Register the document migration list. Extract the stable document identifier `document_id` from the historical vector records and create a migration list. For documents with directly obtainable trusted original text, register the original text storage location `source_location` and the source version identifier `source_version`; where `source_location` is used to locate the business database, object storage, or archive location for reading the original text, and `source_version` is used to identify the content version on which this vector generation is based and to determine whether the content has changed during the reconstruction. Documents for which trusted original text cannot be obtained temporarily maintain the first route valid state `LEGACY_A`. If the first vector set only contains the text block identifier `chunk_id` and lacks `document_id`, supplement it through the business mapping table or historical import list. Records whose ownership cannot be confirmed are isolated separately and not included in the automatic switching process.
[0056] Step S103: Receive the original text recovery event. When the original text of a document is recovered from the archiving system, business database, object storage, or manual data entry, the document_id, source_location, and source_version are submitted to the migration task. The migration task first checks whether the document still needs to be migrated, and then uses the document_id and source_version to construct an idempotent condition to prevent the same recovery event from being processed repeatedly.
[0057] Step S104: Lock the starting source version. The task reads the original text and notes the starting source version. "Locking" does not mean locking the business document indefinitely, but rather noting the starting version. Business modifications can continue as usual, and the versions can be compared again before the switch. Another scenario is when only a portion of the original text is recovered. If this portion can be considered a separate document unit in the business logic, it can be assigned a separate document_id before migration. However, if only a few pages are randomly missing from the same document and the completeness of the content cannot be guaranteed, the original text should remain unrecovered; incomplete text should not be treated as a complete document for the switch.
[0058] Step S105: Reconstruct vectors according to the second route. Process the original text according to the V2 chunking rules, generate a chunk identifier (chunk_id) for each text chunk, and generate vectors using the second embedding model in V2. Each vector record carries a stable document identifier (document_id), a source version identifier (source_version), a chunk version (chunk_version), a model signature (model_signature), a route version (route_version), and a migration batch number (migration_batch_id). The model signature is used to uniquely identify the actual executed model configuration and can be determined by the model name, model file or service version summary, output dimension, and normalized configuration to avoid misidentification as the same route configuration after upgrading a model with the same name.
[0059] Step S106: Idempotent writing to the second vector set. Concatenate document_id, source_version, chunk_id, and route_version into an idempotent write key and write the vector into the second vector set B. During retries, records with the same key are overwritten or ignored, ensuring no duplicate records are left. If the number of chunks in a document changes, first write the records of this batch into a pending confirmation area with migration_batch_id. At this time, the old batch is still the current valid batch, and queries are unaffected. Once the entire batch is confirmed, this batch becomes the current batch for the target document. Old failed batches can be cleared asynchronously, but they must never be selected as valid batches by the routing module.
[0060] Step S107: Perform retrieval confirmation. After the write interface returns success, the actual confirmation is achieved through an end-to-end retrieval verification via the V2 query entry point, rather than simply checking the write logs. At least the following should be verified:
[0061] 1) It can retrieve the record corresponding to the current document_id or current migration_batch_id in the second set;
[0062] 2) The detected source_version, route_version, model_signature, and chunk_version in the record band match the current task.
[0063] 3) The number of detected valid text blocks has reached the target number. If the system design allows "at least one representative block to be visible", it must be specified in the configuration. Moreover, this relaxation cannot be used in scenarios that require all blocks to be searchable.
[0064] 4) When the target vector database uses query replication, asynchronous index refresh or eventual consistency mechanism, there may be a propagation delay between successful write and query visibility; therefore, the number of retries is limited within the preset waiting time limit and backoff is allowed. If the confirmation condition is not met after the time limit or the maximum number of attempts is reached, V1 will remain valid in this round of migration and no route switch will be performed.
[0065] 5) Optionally, a probe query can be generated using the phrases extracted from the original text in this round to confirm that the nearest neighbor retrieval link can return the current document_id - this is an enhanced check and cannot replace metadata version comparison.
[0066] Step S108: Verify the source version. After verification, read the current source_version from the source system again. If it differs from the initial source version recorded in S104, it means the document was modified during the reconstruction period. In this case, the new vectors in this batch must not be switched to the current valid version, but must be marked as an expired batch, and S104 to S108 must be rerun with the new source_version.
[0067] Step S109: Document-level atomic switch. Conditional atomic updates are only performed after verification and consistency with the source version: The current_route_version is changed to V2 and the migration status is changed to ACTIVE_B only if the document_id's current_route_version is still V1, the record's source_version is still equal to the initial source version, and the migration status meets expectations. The active_batch_id and the new route_epoch are then recorded. "Atomic" means that all these fields either take effect together or none of them take effect. This can be achieved using relational database transactions, key-value stores that support comparison and exchange, conditional updates with version numbers, or consistent metadata services. If the conditional update affects zero rows, there is a high probability that duplicate tasks, rollbacks, manual freezes, or source version changes occurred during the process. The task needs to reread the status and decide whether to terminate or retry; it cannot be unconditionally overwritten.
[0068] The core judgment in S109 can be implemented using the pseudocode below. The query visibility check in the pseudocode follows the online query path, and compareAndSetRoute represents an atomic update with version conditions.
[0069] Pseudocode 1: Single Document Migration and Route Switching
[0070] function migrateOneDocument(documentId): route = loadDocumentRoute(documentId) if route.currentRoute != V1: return SKIP source =loadTrustedSource(documentId) if source == null: return KEEP_V1 startVersion= source.version batchId = rebuildAndWrite(source, targetRoute = V2) visible= queryVisible( documentId, batchId, startVersion, V2.modelSignature ) ifvisible == false: markBatchRetry(batchId) return KEEP_V1 ifloadCurrentSourceVersion(documentId) != startVersion: invalidateBatch(batchId) return RETRY_WITH_NEW_SOURCE switched = compareAndSetRoute(documentId, expectedRoute = V1, expectedSourceVersion = startVersion, newRoute = V2, activeBatchId = batchId ) if switched == false:invalidateBatch(batchId) return RELOAD_STATE return ACTIVE_B
[0071] Figure 3 The inputs to pseudocode 1 are document routing records and trusted original text; the intermediate result is a target vector batch with the starting source version, the target routing version, and the migration batch number; the judgment conditions are, in order, target batch retrieval confirmation, source version consistency, and successful atomic update of the condition; the output is one of the following: keep V1, retry according to the new source version, reread the routing status, or enter ACTIVE_B.
[0072] Step S110: Executed by route version during the query. At the start of the query request, the currently available route snapshot is read, along with the RRF smoothing constant and candidate number configuration bound to this snapshot. For ACTIVE_B, the second embedding model and second set from V2 are used; for LEGACY_A, the first embedding model and first set from V1 are used.
[0073] For general semantic retrieval of candidate document_ids that are unknown beforehand, retrieval is performed using V1 and V2 respectively during the migration transition period. Here, a "channel" is an independent retrieval and its candidate list performed by a complete routing version; a "text chunk" is a vectorized retrieval unit formed by dividing a document according to corresponding chunking rules, identified by chunk_id; a "document" is a migration and routing control unit identified by a stable document identifier document_id, and a document can contain multiple text chunks. Each channel first merges its text chunk candidates by document_id, and then filters candidate records based on current_route_version and active_batch_id in the same query snapshot; V1 candidates are only valid when the document's current route is V1, and V2 candidates are only valid when the document's current route is V2 and the candidate batch equals the currently effective batch.
[0074] Reciprocal Ranking Fusion (RRF) is performed on the filtered valid document candidates. The purpose of RRF is to convert the ranks formed by the two heterogeneous vector spaces into summable ranking contributions, thereby generating a unified document ranking without directly comparing the original similarity scores, which may have different distributions. The fusion score of document d is calculated using the following formula:
[0075] Score(d) = I_V1(d) / (K + Rank_V1(d)) + I_V2(d) / (K + Rank_V2(d))
[0076] In the formula, Rank_V1(d) and Rank_V2(d) are the ranks of document d in the valid candidate lists V1 and V2, respectively; K is a positive smoothing constant, which can be 60 or other positive numbers; I_V1(d) and I_V2(d) are route validity identifiers. When the current route of a document is V1, I_V1(d) for the V1 candidate is 1; when the current route of a document is V2 and the candidate batch is equal to active_batch_id, I_V2(d) for the V2 candidate is 1; in other cases, the corresponding I value is 0. When a document does not appear in a certain candidate list, the item corresponding to that channel is also counted as 0. Finally, the results are returned from high to low according to Score(d); if the scores are tied, the best ranking of each valid channel is compared first, and then a stable sort is performed according to document_id to ensure the determinism of the result.
[0077] This algorithm doesn't directly compare the cosine scores of two vector spaces; instead, it compares the rankings within each channel. RRF is an existing ranking fusion method. What this solution adds during the query phase is a route validity constraint: invalid old routes, inactive new batches, and rolled-back batches, even with high similarity, cannot receive points through RRF. In this way, ranking fusion is determined by the current route status of a single document, rather than by the similarity result determining which space a document should use.
[0078] A single query request uses the same route_epoch snapshot from beginning to end. Even if the document switches from V1 to V2 at the exact moment the request is executed, the request will still run according to the complete route it started with. The next request will then use the new route, ensuring that no cross-combination of models and collections occurs in a single request.
[0079] Pseudocode 2: Fusion of RRF Results for Route Validity Constraints
[0080] function mergeByRouteAwareRRF(oldList, newList, routeSnapshot, K): oldRanks = bestRankByDocument( filterByActiveRoute(oldList, routeSnapshot,V1) ) newRanks = bestRankByDocument( filterByActiveRoute(newList,routeSnapshot, V2) ) scores = emptyMap() for documentId in union(keys(oldRanks), keys(newRanks)): score = 0 if documentId in oldRanks: score =score + 1 / (K + oldRanks[documentId]) if documentId in newRanks: score =score + 1 / (K + newRanks[documentId]) scores[documentId] = score returnsortByScoreDescending(scores)
[0081] Figure 4 The inputs to pseudocode 2 are candidate lists of text blocks V1 and V2 and a snapshot of the route version under the same route_epoch; in the processing stage, the documents are first merged, then invalid routes and invalid batches are filtered, and the remaining valid documents are renumbered; the output is a unified document candidate list determined according to the RRF score and tie rules.
[0082] Step S111: Observation and Rollback. After a document enters ACTIVE_B, during the preset observation period, the old records in the first set are retained. If monitoring detects an anomaly in the V2 query, the target set becomes unavailable, or business personnel confirm that the reconstructed text is incorrect, a conditional atomic update is performed to roll back the document's current_route_version to V1 and update the migration status to rollback to the first route state ROLLBACK_A. Rollback only applies to documents where the first route is still available and the old records have not been deleted. During rollback, it is not necessary to delete records in the second set; simply set their active_batch_id to invalid, and then re-migrate once the cause is identified.
[0083] Step S112: Delay the retirement of old records. After the observation period ends, V2 runs stably, and the business retention policy allows, mark the old record with document_id in the first set as deletable, and then delete it asynchronously. If the deletion is successful, the status is changed to RETIRED_A. The retirement of old records and route switching are run separately: the switching does not wait for that large batch of deletions, and deletion failures do not delay V2 from continuing to provide services; however, before all deletions are completed, the query for deduplication must be based on current_route_version to avoid old records appearing in the results again.
[0084] The specific methods of query processing include:
[0085] In a search with business filtering conditions, if the caller has provided a document_id set, the query service can first read the current_route_version of these documents, split the set into V1 group and V2 group, call the corresponding route for each, and finally merge them. In this way, each document does not need to be queried in two spaces.
[0086] Full-database semantic search differs in that the caller does not know in advance which set will be hit. In this case, the query service generates query vectors using model A and model B respectively, and queries set A and set B respectively. For candidates from both channels, invalid versions are first filtered out based on document_id, current_route_version, and active_batch_id. Then, valid candidates are fused according to the RRF formula in S110. For documents already in ACTIVE_B, candidates in set A, even if they have higher original similarity, must be discarded; for documents still in LEGACY_A, candidates from inactive batches in set B must also be discarded.
[0087] To reduce query costs during the transition period, the number of candidates can be gradually adjusted based on migration coverage. For example, when V2 coverage is low, V1 should be the primary candidate, with V2 as a supplement; once coverage increases, V2 should be the primary candidate, and V1 should only handle documents that haven't been migrated yet. Alternatively, a "not yet migrated" filter can be added to the first set, and an "activated" filter can be added to the second set to reduce duplicate candidates from the source.
[0088] The method for determining the original text recovery method is not necessarily to retrieve the originally uploaded file, but rather to obtain a reliable text source that can serve as the basis for generating new vectors, confirming both document ownership and version. A reliable source can be the main text of the business database, historical versions from object storage, archived files, export results from the content management system, or a manually verified re-uploaded document. Approximate text generated solely from old vectors using an inversion model is not considered reliable original text by default. If the business requires the use of approximate recovered text, it must be labeled with a different `source_type`, provided with a new `source_version`, and undergo manual or rule-based review before being treated as a new source; it cannot be equated with the original text corresponding to the old vectors. When multiple suspicious sources emerge for the same document, the system can calculate a content summary, compare business timestamps, and then have rules or manual verification select an authoritative source. Until an authoritative source is determined, the document continues to migrate via V1, without affecting the migration of other documents.
[0089] Three hurdles to prevent erroneous switching: This invention sets three direct and engineering-verifiable hurdles before document switching. The first hurdle is route integrity: Model identifiers, set identifiers, dimensions, metrics, and block versions in V2 must all pass configuration verification. The query end must receive a complete version, not a set of temporarily concatenated parameters. The second hurdle is query verification: Records in the current batch within the second set must be retrieved from the actual query entry point, and the retrieved records' document_id, source_version, and model signature must be correct. Simply returning a successful write operation is insufficient to pass this hurdle. The third hurdle is source version consistency: The current source version read after retrieval confirmation must match the source version at the start of reconstruction; if they do not match, the switching of this batch is abandoned. Only when all three hurdles are passed can document-level atomic switching be executed. It is important to emphasize that this condition can be achieved using ordinary database fields, condition updates, and query interfaces, without requiring complex predictive models.
[0090] Document routing records can be stored in a relational database, with fields including: stable document identifier (document_id), used to uniquely identify the migration and routing control unit; current valid route version (current_route_version), used to determine whether the query uses V1 or V2; migration status (migration_state), used to describe the migration stage of the document; current source version (current_source_version), used for concurrent verification; current active batch number (active_batch_id), used to limit the batches allowed to participate in V2 queries; route version sequence number (route_epoch), used for snapshot identification and optimistic concurrency control; legacy retirement period (legacy_retire_after), used to determine whether the observation period has ended; and updated time (updated_at), used to record the most recent change time of the routing record.
[0091] The route version record may include: route_version, embedding_model_id, model_signature, vector_collection_id, vector_dimension, distance_metric, normalization_mode, chunk_rule_version, query_parameter_version, and enabled. These fields together constitute an indivisible route configuration. The fusion configuration corresponding to the query parameter version may include the RRF smoothing constant rrf_constant, the number of first route candidates legacy_candidate_count, the number of target route candidates target_candidate_count, and the tie-break_rule, used to ensure consistency of query parameters under the same route snapshot.
[0092] The migration batch record may include: migration batch number (migration_batch_id), used to uniquely identify a reconstruction write; stable document identifier (document_id); starting source version (start_source_version); target route version (target_route_version); expected number of text chunks (expected_chunk_count); visible number of query-visible text chunks (visible_chunk_count), used to record the number of target chunks (id) visible after deduplication at the actual query entry point; visibility status (visibility_status); creation time (created_at); confirmation time (confirmed_at); and failure reason (failure_reason). These fields are used to determine whether the target batch meets the criteria for searchability and confirmation, and whether it is allowed to enter the switching step. Based on these fields, implementing this invention requires clearly specifying "which document should currently follow which complete model—set routing," "which source version this batch of new vectors is based on," and "whether the new vectors are visible from the query end."
[0093] Exception handling: If the second embedded model call fails, the document remains valid (V1). The task retryes a limited number of times; if this limit is exceeded, it enters the manual inspection queue. If some blocks in the second set are written successfully while others fail, the entire migration batch will not switch. During retries, idempotent keys will be used to complete or overwrite the remaining blocks until the target number of blocks is reached and the retrieval confirmation is passed. If the second set is unavailable during the retrieval confirmation period, no switch will be performed; V1 will remain valid, and online retrieval will continue to use the old space. If the original document recovery event arrives repeatedly, tasks with the same document_id, source_version, and target route version will be merged into the same idempotent task, and no repeated switching will occur. If a document is deleted during the migration, the deletion event will be written to the document route record first. If the task detects that a document has been deleted before the switch, it will terminate and delete both side vectors. There will never be a situation where a deleted document is reactivated simply because the old task has finished running. For business processes that generate new content after ACTIVE_B, the normal incremental link will directly generate a new vector according to V2, and update active_batch_id after the new batch is searchable; V1 is only reserved for rollback during the observation period, and new versions of this document will no longer be accepted.
[0094] Document-level routing records can be stored in relational databases, distributed key-value stores, configuration centers, or metadata containing vector records. A recommended approach is to use a separate metadata store that supports conditional updates and transactions, decoupling route switching from large-scale vector writes. There are multiple methods for retrieval confirmation: filtering by document_id, reading by primary key, scalar filtering combined with vector queries, dedicated probe queries, or combinations of these are all acceptable. As long as the path is verified to have indeed traversed the index or copy relied upon by the external query, it qualifies as retrieval confirmation as described in this invention.
[0095] The smallest unit for migration is usually a document, which is the simplest approach. However, it can also be a knowledge entry, chapter, product, work order, or session that can be independently retrieved and restored from a business perspective. If using a chapter-level unit, a stable identifier must be assigned to each chapter, and this identifier must be used for state and route switching.
[0096] The second vector space can be created using different vector databases or different sets of the same database. Whether the second vector dimension is larger, smaller, or equal to the first dimension is irrelevant—the two sets of query vectors are generated by their respective models, and no dimension conversion is needed between the two spaces.
[0097] Example
[0098] Example 1: A company's knowledge base contains 100,000 documents. The original system used Model A to generate 768-dimensional vectors, which are stored in collection_a. The plan is to switch to Model B to generate 1024-dimensional vectors and store them in collection_b. During historical data cleanup, it was found that 60,000 documents could be retrieved directly from the business database, 20,000 documents had to be restored piecemeal from the archive disk, and the remaining 20,000 documents only had vectors and document numbers. The system created routes V1—Model A, collection_a, 768-dimensional vectors, cosine metric, and partitioning rule v1; and route V2—Model B, collection_b, 1024-dimensional vectors, cosine metric, and partitioning rule v2. Initially, the current_route_version for all 100,000 documents was V1.
[0099] The 60,000 original documents that can be retrieved immediately are processed in batches by document_id. Document D1001: The current source_version in the business database is 37. The task records version 37, segments it into 12 text blocks according to the block segmentation rule v2, calls model B to generate 12 1024-dimensional vectors, and writes them into collection_b in batch MB9001. After the write returns successfully, the task queries the online query service, goes through the V2 entry point, and queries by document_id=D100 plus migration_batch_id=MB9001, retrieving 12 blocks, and each record has a source_version of 37 and a model_signature consistent with V2. The task reads the business database again, and the source_version is still 37, so it updates the current_route_version of document D1001 from V1 to V2, changes the status to ACTIVE_B, changes the active_batch_id to MB9001, and increments the route_epoch. After that, D1001 was retrieved using model B and collection_b. D90001, for which the original text was not yet available, remained at V1 and was then retrieved using model A and collection_a. One month later, the original text of D90001 was retrieved from the archive disk, and the same steps were repeated for it separately. The entire process did not require waiting for all 100,000 original texts to be recovered.
[0100] Example 2: When document D2002 begins migration, its source_version is 15. The task reads the original text of version 15, and the segmentation, embedding, and writing are all completed. Before retrieval confirmation, a business user modifies the document, changing the current source_version to 16. Although the vector for version 15 can be retrieved in collection_b, the system finds that 15 is not equal to 16 during the review in step S108, so it does not switch current_route_version. Document D2002 still relies on V1 for the old retrieval, and this batch is marked as expired. Subsequently, the task reads the original text of version 16 and regenerates the vector. Only after the retrieval of only the version 16 vector is confirmed, and the source version is compared again and found to be consistent, is D2002 switched to V2. This example corresponds to a common concurrent update in production—looking only at the write results is insufficient, and looking only at the document version is also insufficient; these two checks must be completed together in the same round of switchover judgment.
[0101] Example 3; The target vector database uses asynchronous indexes and multiple query replicas. The write interface for all eight text blocks of document D3003 returned success, but the first online query only retrieved three blocks. The system recorded the visible_chunk_count of the query as 3, did not switch, and retried with a backoff mechanism within a limited time. The second query retrieved six blocks, and the third retrieved eight, with the version field also correct. After verifying that the source version had not changed, D3003 was switched to V2. If there are consistently fewer than eight blocks within the maximum waiting time, D3003 remains in V1, and the task enters the target route retry state RETRY_B; other successfully retrieved documents are unaffected.
[0102] Example 4: When migration coverage reaches 60%, the user inputs a natural language question without pre-defined document_id. The query service reads the current route version configuration, generates query vectors using model A and model B respectively, queries collection_a and collection_b, and selects candidates from each. A document D4004 is already ACTIVE_B, but the old vector is still under observation, so both collections return D4004. The result processing stage checks that the current_route_version of D4004 is V2, so it keeps the candidate corresponding to active_batch_id in collection_b and discards the candidate from collection_a. Another document D4005 is still LEGACY_A, so only the candidate from collection_a is kept. After filtering for route validity, the system performs RRF fusion on the remaining candidates. In this example, K=60: if a valid document is ranked 2nd in collection_a, this channel contributes 1 / (60+2); if another valid document is ranked 3rd in collection_b, that channel contributes 1 / (60+3). The system aggregates the contributions from each valid channel and returns the results in descending order of fusion score, prioritizing documents with higher rankings or those supported by multiple valid channels. This ranking is generated by summing the ranking contributions, rather than directly comparing the original cosine scores of the two spaces. Candidates with invalid routes or inactive batches have zero contributions, thus preventing old vectors or inactive new batches from entering the results during the observation period and avoiding duplicate entries of the same document in the results.
[0103] Example 5: After document D5005 was switched to V2, a seven-day observation period was initiated. On the third day, business personnel discovered that the archive file used to restore this document was missing attachment pages. While the vectors could technically be retrieved, the content was incomplete. The operations team froze the migration task for D5005 and, through a conditional update, rolled back the current_route_version from V2 to V1, changing the status to ROLLBACK_A. Since the old vectors in collection_a had not yet been deleted, the next query request was immediately executed as V1. Once the complete archive file was obtained, the system re-migrated D5005 using the new source_version. This rollback only affected one document routing record; other migrated documents were not affected, and there was no need to switch collection_b back entirely.
[0104] Example 6: The first and second vector spaces are both deployed on the same vector database instance, using collection_a and collection_b respectively. Although their embedding models, dimensions, and partitioning rules are different, they constitute heterogeneous vector spaces. The system does not perform database-level blue-green switching; instead, it stores V1 or V2 in the document routing record. The migration and switching steps are the same as in the previous examples. It is clear that the "space migration" mentioned in this invention does not require changing the database; the focus is on the binding of models and collections, and the document-level activation conditions.
[0105] Example 7: The document routing table uses `document_id` as the primary key and `route_epoch` as an optimistic version. When a task prepares to switch document D7007 from V1 to V2, it sends a conditional update: `document_id` equals D7007, `current_route_version` equals V1, `current_source_version` equals the source version at the start of this iteration, `route_epoch` equals the value read by the task, and `migration_state` equals `DUAL_READY`. Only when all these conditions are met does the database change `current_route_version` to V2, `migration_state` to `ACTIVE_B`, and `active_batch_id` to the current batch value within the same transaction, and increment `route_epoch` by one. If the number of affected rows is zero, the task rereads the record. This implementation uses only transactions and conditional updates typical of relational databases and is easily implemented on existing backend systems.
[0106] During the migration process, challenges arise such as the need for uninterrupted database operation, incomplete original text, and the gradual rollout of new embedding models. This invention addresses these issues by rebuilding and switching to documents whose original text has been retrieved and is considered reliable. Documents without original text are left on the old route. Both types of documents can be simultaneously available for retrieval for a period, without requiring a complete migration at once.
[0107] Specifically, the technical problem solved and the technical effects of this invention are as follows:
[0108] 1) How to avoid the query vector calculated by the second embedding model being mistakenly sent into the first vector set, or vice versa.
[0109] This invention ensures that models and sets take effect together with the same routing version, so even if configuration updates occur at different times, combinations such as "model A queries set B, model B queries set A" will not occur.
[0110] 2) How to avoid switching routes when the new vector has just been written and before the retrieval confirmation has been completed, thus creating a retrieval gap.
[0111] The basis for the switching in this invention is that the online query entry can already detect the target batch; rather than just the write interface returning success, so it can bypass the brief window created by the asynchronous processes of index building and query copy refresh.
[0112] 3) How to prevent the original text from being modified during reconstruction, and avoid mistaking the new vector of the old version as the current valid version.
[0113] If the original text is modified during the rebuild, it will not be activated in this batch. Instead, it will be regenerated with the new version to avoid "old content in the new library".
[0114] 4) During the transition period, how to solve the challenges of result fusion and ranking during cross-space retrieval while ensuring the coexistence of retrieval capabilities in both the old and new spaces? Specifically, how to effectively filter invalid candidates, avoid direct cross-domain comparison of similarity scores between the old and new spaces, and eliminate the problem of duplicate results caused by multi-path retrieval; and how to ensure the accuracy of new space vector data during the iteration of old and new models, and overcome the risks of insufficient accuracy and consistency caused by direct reuse of old vectors or vector inversion.
[0115] During the transition period, the retrieval capabilities of both the old and new spaces are retained—invalid candidates are first eliminated based on stable document identifiers, current routes, and active batches, and then valid candidates are fused using RRF, avoiding duplicate results and avoiding cross-space similarity comparisons. Valid vectors in the new space are still regenerated from reliable text, neither directly copying old vectors and feeding them to the new model, nor relying on vector inversion that cannot guarantee word-for-word consistency.
[0116] 5) If there is a problem with the new space, the entire vector library needs to be scrapped and rebuilt.
[0117] Switching and rolling back both occur on a single document. If an archive file encounters a problem, only the corresponding document_id is rolled back; the entire collection is not switched back to the old database.
[0118] This invention neither performs numerical conversions from old to new vectors nor substitutes approximate text derived from inversion for the original. The system first assigns a unique `document_id` to each document across databases, then records the current routing version. This routing version is not an isolated set name, but a complete set of configurations, including at least the embedding model, vector set, dimension, and metric. The query end can only read the entire set; it is not allowed to temporarily combine a model with another set. After a document is retrieved, the migration task first records the `source_version`, then calculates the new vector according to the block division rules and model defined in V2. Successful database writing only means the database has received the data; the routing cannot be changed immediately. The task then retrieves this batch of data from the actual query entry point and reads the original version again. Only if the query returns a result and the version remains unchanged is the document changed from V1 to V2 through a conditional update; if any condition is not met, the online system continues to use V1. Documents for which the original text has not been retrieved do not undergo a fake migration; their `current_route_version` remains in V1. When encountering a full-database semantic search where the exact documents to be hit are unknown beforehand, V1 and V2 can be searched in parallel. After filtering by document_id, current route, and active batch, RRF can be used to combine the valid candidates from both channels. The speed of migration depends on the actual recovery progress of the original document, rather than being limited by when the last original document is found.
[0119] Key data definition:
[0120] (1) Stable document identifier document_id. document_id is used to identify the same business document across vector spaces. No matter how many blocks the document is divided into in the first and second vector sets, each of its vector records carries the same document_id. The text block is chunk_id to avoid mistaking the block identifier for the document identifier. document_id is generally taken from the business primary key, the document number of the content management system, or a normalized globally unique identifier; it will not change during migration due to changes in the set or the embedding model.
[0121] (2) Source version. source_version indicates which version of the original text the vector is based on. It can be the version number in the business database, the update time plus the content summary, the version number in the object storage, or other identifiers that can determine whether the content has changed. When the system first rebuilds, it records the starting source version. Before completing the retrieval confirmation and switching, it reads the current source version again. If the two do not match, the result of this round cannot be switched to a valid route and must be marked as pending reconstruction, or the new version must be used to start over.
[0122] (3) Route Version. A route version must include at least: the embedded model identifier, the target vector set identifier, the vector dimension, and the distance metric. If possible, the text chunking rule version, normalization method, query parameter set, and model file summary should also be included. For example, the first route version V1 can be "first embedded model A + first vector set A + first dimension + first metric + first chunk version", and the second route version V2 can be "second embedded model B + second vector set B + second dimension + second metric + second chunk version". The route version should be read and updated as a whole. The query service cannot take a model configuration that can be modified separately and combine it with another set configuration that can be modified separately to temporarily create a route. This will cause incorrect combinations if the configuration is refreshed at different times.
[0123] (4) Document migration status. Each document must be in at least one of the following states: LEGACY_A, at this point only the first route is guaranteed to be available, the original document may not have been recovered yet; REBUILDING_B, the original document and the initial source version have been obtained, and a new vector is being generated and written according to the second route; DUAL_READY, the record in the second set has been confirmed by retrieval, the corresponding source version is still the current version, and the first route is still retained; ACTIVE_B, the current valid route for this document has been atomically switched to the second route; RETIRED_A, after the observation period, the old record of this document in the first set has been deleted or marked as no longer participating in the rollback. In addition, there can be RETRY_B and ROLLBACK_A, which respectively indicate retrying due to reconstruction failure and reverting from the second route to the first route.
[0124] (5) Retrieve confirmation record. This record must contain at least the document_id, target route version, starting source version, batch number, number of target text blocks, number of detected target text blocks, confirmation time, and confirmation result. It is not to prove that the similarity effect of the new model is better than that of the old one, but that the target record can indeed be seen from the predetermined query entry point, and that these visible records belong to the current target route and the current source version.
[0125] like Figure 2As shown, this invention includes two core functional modules:
[0126] 1) Document migration state and route binding module. It maintains document_id, migration_state, current_route_version, source_version, target route, and route_epoch. When the query service reads the route, it uses a complete, validated configuration instead of reading the model address and collection name separately and then piecing them together. The model and collection cannot be updated separately: when a route is updated, the model identifier, collection identifier, and associated parameters are updated together. If any one of these fails validation, the entire update will not take effect. Updates use conditional updates—for example, the database state must still be REBUILDING_B or DUAL_READY, the source version must still be the version at the start of the task, and the current route must still be V1. All three conditions must be met before changing to V2. If the update affects zero rows, the task rereads the records to determine whether it's a duplicate execution, an original update, or a manual freeze; it cannot be directly overwritten.
[0127] 2) Retrieval Confirmation and Document-Level Switching Module. After the second set is written, the module uses the query entry point actually used by V2 to query. First, it retrieves the records of this batch by document_id or migration_batch_id, verifies source_version, model_signature, and chunk_version, and then checks if the number of visible text blocks is correct. If there are independent query copies or caches in the deployment, a probe query generated using the original text phrase can be added to confirm that the entire retrieval chain is working. After querying, the module needs to read the current version of the original text again. Only if the query can see the text and the source version has not changed should a document-level atomic switch be submitted. During the switch, at least current_route_version and migration_state should be changed together, and route_epoch should be incremented by one. A query that is already running is bound to route_epoch and will not change routes midway. If the check times out, the number of records doesn't match, or the source version has changed, this batch will be recorded as a retry or invalidated, but current_route_version will remain unchanged to ensure that the online documentation can still be found in the old space when the migration task fails.
[0128] The following are the key technical points of this invention:
[0129] (1) The present invention uses a single document with a stable document identifier or a business content unit that can be independently retrieved as the unit for migration and routing switching; documents that have not recovered the credible original text continue to use the first routing version, while documents that have recovered the credible original text are reconstructed into the second vector set using the second embedding model.
[0130] (2) The present invention binds the embedded model identifier and the vector set identifier into an inseparable routing version, and further binds the vector dimension, distance metric, and optional block rule version, normalization method and model signature in it; the query end generates query vector and accesses the corresponding set based on the complete routing version.
[0131] (3) Each document of this invention maintains at least the migration status including "old route valid, target route under reconstruction, target route confirmed, target route valid, old route decommissioned", and also maintains the current valid route version, source version and active migration batch.
[0132] (4) After obtaining the credible original text of a document, the present invention records the starting source version, generates a new vector according to the segmentation rules of the second routing version and the second embedding model, and writes the document_id, source_version, model signature, segmentation version and migration batch into the second vector set.
[0133] (5) In this invention, “detecting the target record from the actual query entry” is used as one of the routing switching conditions. The stable document identifier, source version, target route version and model signature of the detected record must be consistent with the current migration task. Routing switching is not triggered if the write interface is successful.
[0134] (6) After the present invention is confirmed, the current source version of the original text is read again. Switching is allowed only if it is consistent with the initial source version; if the versions are inconsistent, the current batch is invalidated and regenerated based on the new version.
[0135] (7) The present invention uses transactions, comparison and exchange or conditional updates with version numbers to atomically change the current valid route of a single document from the first route version to the second route version, and synchronously update the migration status, active batch and / or route version number; the existing status is not overwritten when the conditions are not met.
[0136] (8) In this invention, the same route version snapshot or route_epoch is used for the query request during one processing process to prevent the request from changing routes midway, which would lead to cross-matching of the query model and vector set.
[0137] (9) When the first and second vector spaces are searched simultaneously during the migration transition period of this invention, the text blocks belonging to the same stable document identifier in the same channel are first merged into document names, and then the effective routing identifier of each channel is determined according to the current effective routing version and active batch of the document; the effective candidates are ranked and merged using RRF, where the score item corresponding to the invalid route is zero - thereby avoiding direct comparison of the original similarity of different vector spaces, and also avoiding interference of old vectors or non-activated new batches during the observation period on the sorting.
[0138] (10) After the document is switched to the second route, the first vector record is retained for an observation period, allowing atomic rollback to be performed on a single document; the first vector record of the document is asynchronously retired after the observation period ends, so that switching, rollback and deletion are decoupled from each other.
[0139] (11) The present invention also provides a system for implementing the above method, including a document migration status and route binding module, and a retrieval confirmation and document-level switching module; the former maintains the document status and complete route version, and the latter triggers a document-level atomic switch after the new vector retrieval is confirmed and the source version is consistent. The new logic is concentrated on these two modules, and the existing splitter, embedding service, and vector library do not need to be rewritten, making the modification relatively controllable.
[0140] The above method is applicable to both cases where the first and second vector spaces are located in different vector databases and cases where they are located in different sets of the same vector database; the dimension of the second vector can be different from that of the first vector, without the need to perform cross-space transformation on the old vector.
[0141] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A progressive transfer method for heterogeneous vector spaces with incomplete original text, characterized in that, include: S1. Establish route versions: Establish the first route version V1 on the existing network and establish the second route version V2 on the target network; S2. Register the document migration list: Extract the stable document identifier document_id, and create a migration list based on document_id; S3, Receive the recovery event of the original text: When the original text of a document is completely recovered, submit the document_id and source_version to the migration task; S4. Reconstruct vectors according to the second route: Generate new vectors from the original text according to the block division rules of the second route version V2 and the second embedding model; S5. Use the retrieved new vector as the routing switching condition, and simultaneously verify the source version; S6. After retrieving the new vector and verifying its consistency, switch the current valid route of the document from the first route version to the second route version using the overall update method, and update the migration status synchronously.
2. The method for progressive transfer of heterogeneous vector space with incomplete original text according to claim 1, characterized in that: When the recovered original text can be independently retrieved, its version can be independently determined, and its content boundaries are clearly defined, an independent stable document identifier is assigned to the business content unit and migration is performed separately; when the recovered content belongs to a random missing segment of the same document or the integrity of the content cannot be confirmed, the document remains valid in the first routing version V1 until a complete and credible source or a confirmed new version is obtained.
3. The method for progressive transfer of heterogeneous vector space with incomplete original text according to claim 2, characterized in that: The first routing version V1 includes a first embedding model A, a first vector set A, a first vector dimension, a first metric method, and a first block rule; the second routing version V2 includes a second embedding model B, a second vector set B, a second vector dimension, a second metric method, and a second block rule.
4. The method for progressive transfer of heterogeneous vector space with incomplete original text as described in claim 3, characterized in that: The new vector execution retrieval confirmation includes: 1) Detect the record corresponding to document_id or migration batch number migration_batch_id in the second vector set B; 2) Verify the source_version, route_version, model_signature, and chunk_version in the records; 3) The number of valid text blocks detected has reached the target number; 4) When the target text block is temporarily not visible due to query copy synchronization, index refresh, or eventual consistency, a limited number of retries will be performed within the preset waiting time limit; if the retrieval confirmation conditions are not met after the number of retries or the waiting time limit has been reached, no route switching will be performed.
5. The method for progressive transfer of heterogeneous vector space with incomplete original text according to claim 4, characterized in that, The document migration status includes the first route active status LEGACY_A, the destination route reconstruction status REBUILDING_B, the dual route ready status DUAL_READY, the second route active status ACTIVE_B, and the first route decommissioning status RETIRED_A.
6. The method for progressive transfer of heterogeneous vector space with incomplete original text according to claim 5, characterized in that: During the online query phase of the migration transition, the query request reads the route version snapshot that has been verified for integrity when it begins processing, and uses the route version snapshot throughout the entire processing of the request; the route version snapshot is identified by a monotonically increasing route version sequence number route_epoch, which is used to identify the snapshot version and perform concurrent verification when updating the execution conditions.
7. The method for progressive transfer of heterogeneous vector space with incomplete original text according to claim 6, characterized in that, Perform searches on the first vector set and the second vector set respectively to obtain their respective Top-N text block candidates; Within each retrieval channel, text block candidates are merged according to stable document identifiers. Invalid candidates are filtered based on the currently valid routes and currently active batches in the route version snapshot. The channel rankings are then re-determined for the filtered valid documents, and the reciprocal ranking of document d is calculated using the following formula to fuse the RRF score: Score(d) = I_V1(d) / (K + Rank_V1(d)) + I_V2(d) / (K + Rank_V2(d)) In the formula, Rank_V1(d) and Rank_V2(d) are the ranks of document d in the effective document lists of the first and second retrieval channels, respectively, K is a smoothing constant greater than zero, and I_V1(d) and I_V2(d) are valid route identifiers; a unified list of candidate documents is output in descending order of the RRF score to avoid directly comparing the original similarity scores of heterogeneous vector spaces and to avoid the same document being returned repeatedly.
8. The method for progressive transfer of heterogeneous vector space with incomplete original text according to claim 7, characterized in that: After a document is switched to the second route, the first vector set A records a period of observation, allowing rollback to a single document.
9. The method for progressive transfer of heterogeneous vector space with incomplete original text according to claim 8, characterized in that: At the end of the observation period, the old records with document_id in the first set are marked for deletion and then deleted asynchronously. After deletion, the status is changed to RETIRED_A. The retirement of old records and route switching are executed separately, and the switching, rollback, and deletion are decoupled from each other.
10. A progressive transfer system for heterogeneous vector spaces with incomplete original text, characterized in that, include: The module for document migration status and route binding, and the module for retrieval confirmation and document-level switching; The document migration status and route binding module is used to maintain stable document identifiers, document migration status, currently valid routes, current source versions, currently effective batches, and route version numbers, and binds embedded models and vector sets in units of complete route versions; The retrieval confirmation and document-level switching module is used to reconstruct and idempotently write the target route into the text block vector. It performs retrieval confirmation and source version verification through the actual query entry point, performs document-level conditional atomic switching when the switching conditions are met, and filters candidates and performs inverse ranking fusion based on the fixed route version snapshot during the migration transition period.
