Data migration method and device, equipment, medium and program product
By breaking down migration requests into multiple tasks and using intelligent agents for precise tool calls and resource configuration, the problems of low efficiency and high cost in heterogeneous database migration are solved, achieving efficient and accurate data migration.
Patent Information
- Application Number
- CN202511297406.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-11
- Publication Date
- 2026-01-13
AI Technical Summary
Existing technologies for migrating heterogeneous databases suffer from problems such as long migration cycles, error-prone manual operations, high costs, and inaccurate performance and resource planning, resulting in low migration efficiency and resource waste.
The migration request is split into multiple independent tasks and executed sequentially by the target agent based on a preset set of tools. Non-target tools are shielded using masking technology, the migration strategy is dynamically adjusted, and resource allocation is optimized by combining key-value caching and performance evaluation.
It improved migration efficiency, reduced the error rate, optimized resource utilization, ensured the accuracy and efficiency of migration, and avoided resource waste.
Smart Images

Figure CN121326876A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, to the application of large models in information security and fintech, and specifically to a data migration method, apparatus, device, medium, and program product. Background Technology
[0002] In the process of digital transformation of modern enterprises, databases, as the core data storage system, face increasing demands for migration and transformation. Database migration typically involves moving from one database product (source database) to another (target database), i.e., heterogeneous database migration. Due to significant structural differences between the source and target databases and dynamic changes in business load, existing migration methods suffer from long migration cycles, error-prone manual operations, and high costs. Furthermore, performance and resource planning rely on historical experience, making it impossible to accurately assess the target database's performance and resource requirements beforehand, leading to insufficient performance or wasted resources. Summary of the Invention
[0003] In view of the above problems, this application provides data migration methods, apparatus, devices, media and program products.
[0004] According to a first aspect of this application, a data migration method is provided, comprising: in response to a migration request to migrate target data from a first database to a second database, invoking a target agent to split the migration request into N migration tasks, wherein the first database and the second database have different database structures, and N is an integer greater than or equal to 2; invoking the target agent to sequentially execute the N migration tasks based on a preset toolset to migrate the target data from the first database to the second database; wherein, when at least one target migration task is executed among the N migration tasks, at least one non-target tool in the preset toolset is pre-masked based on the target migration task to be executed, and the target agent is configured to invoke tools based on the masked preset toolset.
[0005] According to an embodiment of this application, when executing at least one target migration task among N migration tasks, the method further includes: determining target context content based on the target migration task to be executed, a masked preset toolset, and the execution results of prior migration tasks, wherein the execution results include at least one of performance evaluation results, simulated migration results, and business simulation execution results based on simulated migration; and invoking a target agent to execute the target migration task based on the target context content.
[0006] According to embodiments of this application, determining the target context content based on the target migration task to be executed, the masked preset toolset, and the execution results of previous migration tasks includes: obtaining static content, which includes the same content under different target migration tasks; obtaining dynamic content based on the target migration task to be executed, the masked preset toolset, and the execution results of previous migration tasks; and obtaining the target context content based on the static content and the dynamic content.
[0007] According to an embodiment of this application, invoking the target agent to perform a target migration task based on the target context content includes: matching target cache data from a key-value cache based on static content, wherein the key-value cache includes cached data of the execution process of the previously executed migration task and cached execution results; and invoking the target agent to perform the target migration task based on the target cache data and the differences between the dynamic content and the target cache data.
[0008] According to an embodiment of this application, at least one target migration task includes a performance configuration task; when performing the performance configuration task, the method further includes: invoking a target agent to determine at least one target tool corresponding to the target service from a preset set of tools behind a mask; based on the target data and at least one target tool, performing the target service in a second database based on simulation to obtain a performance evaluation result; and configuring the performance data of the second database based on the performance evaluation result.
[0009] According to an embodiment of this application, the preset tool set includes N sets of preset tools for N migration tasks, wherein each of the N sets of preset tools is configured with N migration fields, and the migration fields are common fields in the names of the preset tools in the corresponding groups; masking at least one non-target tool in the preset tool set based on the target migration task to be executed includes: masking the migration fields in the mapping table that do not have a mapping relationship with the target migration task to be executed, wherein the mapping table includes the mapping relationship between N migration tasks and N migration fields.
[0010] According to an embodiment of this application, configuring a target agent to invoke tools based on a masked preset tool set includes: inputting a preset prompt word into the target agent, the preset prompt word including N transition fields, the preset prompt word being used to guide the target agent to predict the name of the tool to be invoked based on the transition fields; in response to the target agent generating a candidate tool list, setting the prediction probability of non-target tools in the candidate tool list to zero, non-target tools including candidate tools whose names contain masked transition fields from the mapping table, the candidate tool list including at least one candidate tool name and its corresponding prediction probability.
[0011] A second aspect of this application provides a data migration apparatus, comprising: a splitting module, configured to, in response to a migration request to migrate target data from a first database to a second database, invoke a target agent to split the migration request into N migration tasks, wherein the first database and the second database have different database structures, and N is an integer greater than or equal to 2; and a migration module, configured to invoke a target agent to sequentially execute the N migration tasks based on a preset toolset to migrate the target data from the first database to the second database; wherein, when at least one target migration task is executed among the N migration tasks, at least one non-target tool in the preset toolset is pre-masked based on the target migration task to be executed, and the target agent is configured to invoke tools based on the masked preset toolset.
[0012] A third aspect of this application provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0013] A fourth aspect of this application also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.
[0014] The fifth aspect of this application also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method. Attached Figure Description
[0015] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0016] Figure 1 The illustrations depict application scenarios of data migration methods, apparatuses, devices, media, and program products according to embodiments of this application.
[0017] Figure 2 A flowchart illustrating a data migration method according to an embodiment of this application is shown schematically.
[0018] Figure 3 Another flowchart illustrating a data migration method according to an embodiment of this application is shown schematically;
[0019] Figure 4 A flowchart illustrating the determination of target context content according to an embodiment of this application is shown schematically;
[0020] Figure 5This illustration schematically shows a flowchart of a process for invoking a target agent to perform a target migration task based on target context content, according to an embodiment of this application.
[0021] Figure 6 This schematically illustrates yet another flowchart of a data migration method according to an embodiment of this application;
[0022] Figure 7 A schematic block diagram of a data migration apparatus according to an embodiment of this application is shown; and
[0023] Figure 8 A block diagram schematically illustrates an electronic device suitable for implementing a data migration method according to an embodiment of this application. Detailed Implementation
[0024] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0025] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0026] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0027] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0028] In the technical solution of this application, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with relevant laws, regulations, and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.
[0029] In scenarios involving automated decision-making using personal information, the methods, devices, and systems provided in this application all offer users corresponding entry points for choosing to agree to or reject the automated decision-making results. If the user chooses to reject, the process proceeds to the expert decision-making stage. Here, "automated decision-making" refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests, or economic, health, and credit status through computer programs, and then making a decision. Here, "expert decision-making" refers to the activity of making decisions by personnel who specialize in a particular field, possess specialized experience, knowledge, and skills, and have reached a certain level of professional expertise.
[0030] The following is an explanation of some of the technical terms used in this application:
[0031] An intelligent agent is an entity capable of perceiving its environment and taking actions to achieve specific goals. It can be software, hardware, or a system, possessing autonomy, adaptability, and interactivity. Unlike traditional computer programs, intelligent agents exhibit a degree of autonomy and intelligence, enabling them to make decisions and take actions in complex and ever-changing environments. Their core functions include perception, reasoning, decision-making, and execution.
[0032] Key-Value Cache (KV Cache): Key-value caching is a key technique for optimizing the inference efficiency of large language models. It avoids redundant computation and improves inference speed by caching the key and value tensors already computed in the attention mechanism, thus preventing repeated computation during subsequent generation.
[0033] Heterogeneous database migration refers to the process of migrating data from one database system (source database) to another completely different database system (target database). This migration typically involves different database types or versions. Due to differences in architecture, syntax, and storage mechanisms between the source and target databases, special attention must be paid to compatibility and data consistency during the migration process.
[0034] Embodiments of this application provide a data migration method, comprising: responding to a migration request to migrate target data from a first database to a second database, invoking a target agent to split the migration request into N migration tasks, wherein the first database and the second database have different database structures, and N is an integer greater than or equal to 2; invoking the target agent to sequentially execute the N migration tasks based on a preset tool set to migrate the target data from the first database to the second database; wherein, when executing at least one target migration task among the N migration tasks, at least one non-target tool in the preset tool set is pre-masked based on the target migration task to be executed, and the target agent is configured to call tools based on the masked preset tool set. By decomposing the complex heterogeneous migration into N independent tasks, flexible task granularity control is supported, and migration failure problems caused by task confusion can be avoided; by pre-masking the non-target tools in the preset tool set, cross-task interference can be avoided, the error rate can be reduced, resources can be optimized, and migration efficiency and accuracy can be improved.
[0035] Figure 1 The diagram illustrates an application scenario of the data migration method according to an embodiment of this application.
[0036] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0037] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0038] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0039] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0040] It should be noted that the data migration method provided in this application embodiment can generally be executed by server 105. Correspondingly, the data migration device provided in this application embodiment can generally be located in server 105. The data migration method provided in this application embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the data migration device provided in this application embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0041] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0042] The following will be based on Figure 1 The described scene, through Figures 2-6 The data migration method according to the embodiments of this application will be described in detail.
[0043] Figure 2 A flowchart illustrating a data migration method according to an embodiment of this application is shown schematically.
[0044] like Figure 2 As shown, the data migration method in this embodiment includes operations S210 to S220.
[0045] In operation S210, in response to the migration request to migrate target data from the first database to the second database, the target agent is invoked to split the migration request into N migration tasks. The database structures of the first database and the second database are different, and N is an integer greater than or equal to 2.
[0046] In the embodiments of this application, heterogeneous databases refer to two databases with different structures, such as one being relational and the other being distributed. The first database refers to the database before migration, i.e., the source database (e.g., the old database, old storage system); the second database refers to the database after migration (e.g., the new database, cloud platform), i.e., the target database. The first and second databases have different database structures. A migration request can refer to a requirement instruction initiated by a user, business system, or operation and maintenance platform to migrate data. It typically includes core information such as the connection method of the first database (source database), the type of the second database (target database), the range of data to be migrated (target data), and the migration completion deadline. Target data refers to the final data set migrated from the first database (source database) to the second database (target database), including but not limited to throughput, query response time, transactions per second, storage IOPS (Input / Output Operations Per Second), processor (Central Processing Unit) utilization, memory utilization, and differences in the architecture between the source and target databases. The target intelligent agent can refer to an AI-driven automated unit with capabilities such as task planning, tool invocation, and result analysis. It works based on context engineering and reasoning action frameworks. For example, it first analyzes migration requirements, then breaks down tasks and invokes tools, and finally adjusts the next operation based on the results, without human intervention.
[0047] For example, when the structures of the first database (source database) and the second database (target database) differ, a direct full migration may result in data loss or logical conflicts. The target agent parses the migration request and breaks it down into multiple sub-tasks according to preset rules. These sub-tasks can be independent tasks. For instance, differences in table structure, indexes, and constraints can be prioritized to reduce migration complexity; horizontal splitting (by time / range) or vertical splitting (by business module) can reduce the load of a single migration; the failure of a single task does not affect the overall process, and it supports breakpoint resumption and partial rollback.
[0048] In operation S220, the target agent is invoked to sequentially execute N migration tasks based on a preset tool set to migrate target data from the first database to the second database; wherein, when at least one target migration task is executed among the N migration tasks, at least one non-target tool in the preset tool set is masked in advance based on the target migration task to be executed, and the target agent is configured to invoke tools based on the masked preset tool set.
[0049] In the embodiments of this application, the preset toolset can be a predefined set of APIs (Application Programming Interfaces), functions, classes, or tools. Each tool corresponds to a specific migration operation. Tools are not dynamically added or removed during task execution, helping to quickly implement functions without having to write them from scratch. Examples include data extraction tools, capacity assessment tools, data migration tools, and rollback tools. Sequential execution can refer to the agent executing N tasks sequentially according to task dependencies, with the result of the previous task serving as the input for the next task, avoiding logical confusion. For example, metadata (knowing the table structure) must be extracted before performing capacity assessment (simulating traffic based on the table structure). Non-target tools can be tools in the preset toolset that are unrelated to the current target migration task. Dynamic masking refers to disabling (masking) tools unrelated to the currently executing target migration task in advance by managing tool availability through a state machine, forming a simplified tool call set. The target agent only calls tools that are not masked, thereby avoiding misoperation and improving execution efficiency. For example, irrelevant tools can be masked through probability suppression or syntax constraints.
[0050] The database migration task is broken down into multiple subtasks, and the target agent executes the migration tasks in the order of the tasks. At the same time, non-target tool calls are restricted through dynamic masking. For example, a tool whitelist is dynamically generated based on the migration task (such as structure migration or full migration), CPU / memory usage is monitored, high-load tools are automatically masked, and the generation probability of tools not in the current stage is set to 0, so that the migration is carried out in sequence, starting from masking non-current stage tools before migration until completion.
[0051] According to the embodiments of this application, by breaking down complex heterogeneous migration into N independent tasks, flexible task granularity control can be supported, and migration failure problems caused by task confusion can be avoided. By pre-masking non-target tools in the preset tool set and calling the target agent to execute migration tasks sequentially based on the preset tool set, cross-task interference can be avoided, the error rate can be reduced, resources can be optimized, and migration efficiency and accuracy can be improved.
[0052] Figure 3 Another flowchart illustrating a data migration method according to an embodiment of this application is shown schematically.
[0053] like Figure 3 As shown, in the case of executing at least one target migration task among N migration tasks, the data migration method in this embodiment further includes operations S310 to S320.
[0054] In operation 310, based on the target migration task to be executed, the masked preset toolset, and the execution results of the previous migration tasks, the target context content is determined. The execution results include at least one of the following: performance evaluation results, simulated migration results, and business simulation execution results based on the simulated migration.
[0055] In the embodiments of this application, the target migration task to be executed can refer to a subtask that is about to be executed after being broken down. The execution result of the prior migration task can refer to the output result of the prior subtask that has been completed before the target migration task to be executed. It is the historical basis for the agent to execute the current task and can include at least one of the following: performance evaluation results, simulated migration results, and business simulation execution results based on the simulated migration. The performance evaluation result refers to the predicted value of the resource configuration required by the target database, such as the number of CPU cores, memory capacity, storage IOPS, etc.; the simulated migration result refers to the migration process status markers (success / failure / partial failure) and error logs, etc.; the business simulation execution result refers to the time-series data pattern reflecting the characteristics of business traffic, such as daily / weekly traffic cycle characteristics, peak period request volume ratio (e.g., 40% of the total daily traffic at 5 pm), the scale distribution of batch write operations (e.g., 80% of single writes are between 10,000 and 100,000 rows), etc. The target context content is a set of information dynamically generated by the agent during the migration process according to the current task requirements. For example, based on the type of subtask to be processed (such as capacity assessment, data migration, etc.), the scope of tools available at the current stage, and the data output by historical tasks, a set of information that can be dynamically generated according to the current task requirements can be determined.
[0056] In operation 320, the target agent is invoked to perform the target migration task based on the target context content.
[0057] In the embodiments of this application, the target agent is invoked to generate an information set based on the current task requirements, complete the operation according to the requirements of the target task to be executed, output the execution result, and can append the execution result (success / failure, resource consumption, time consumption, etc.) to the context, so as to dynamically adjust the tool mask strategy and priority of subsequent tasks based on the result.
[0058] According to embodiments of this application, by integrating the target migration task, the masked preset toolset, and the execution results of the prior migration task, an adaptive contextual content environment is constructed, enabling the intelligent agent to dynamically adjust the migration strategy, improve adjustment and error self-healing capabilities, and thereby improve migration efficiency and accuracy.
[0059] Figure 4 A flowchart illustrating the determination of target context content according to an embodiment of this application is shown.
[0060] like Figure 4As shown, in this embodiment, the target context content is determined based on the target migration task to be executed, the preset toolset after masking, and the execution result of the previous migration task, including operations S410 to S430.
[0061] In operation 410, static content is retrieved, which includes the same content regardless of whether different target migration tasks are performed.
[0062] In the embodiments of this application, static content refers to a fixed set of information that remains unchanged when performing different target migration tasks. This information is used to improve the basic consistency and rule constraints of the migration process and may include general migration rules, complete tool definitions, and global constraints. For example, during the capacity assessment phase, only the `replay_prefix` tool is allowed to be called; the `replay_workload` tool is used to simulate historical business traffic, with input parameters including concurrency and perturbation coefficients, and outputting a performance assessment report; hash calculation rules for key-value caches (KV caches) include, for example, generating cache keys based on system prompts. Static content remains unchanged in any target task. For example, when performing metadata extraction and capacity assessment, the tool definitions and general migration rules are completely identical and will not be added, removed, or modified due to different tasks.
[0063] In operation 420, dynamic content is obtained based on the target migration task to be executed, the masked preset toolset, and the execution results of the previous migration tasks.
[0064] In the embodiments of this application, dynamic content can refer to specific information that changes with the target migration task type, execution progress, data characteristics, etc., and serves only the decision-making of the current task. It can be added to the context incrementally (without modifying historical dynamic content) to improve the task-specific nature of the context. Dynamic content may include specific information about the target migration task to be executed, such as the target, scope, and parameters of the current task; specific information about the preset tool set after masking, such as the list of tools available for the current task (not all tools, only whitelisted tools) and calling constraints; specific information about the execution results of previous migration tasks, such as the output data of the preceding task (which must be strongly correlated with the current task), etc.
[0065] In operation 430, the target context content is obtained based on static and dynamic content.
[0066] In the embodiments of this application, the acquired static content can be used as a fixed prefix of the target context, and the generated dynamic content can be used as an incremental suffix. These are combined in the order of static content first, followed by dynamic content, to form the complete target context content. Long text information needs to be written to the file system, and only the path is retained in the context to avoid exceeding character limits.
[0067] For example, static content enables key-value cache reuse; for instance, a fixed prefix allows contexts from different tasks to share the same key-value cache (e.g., all tasks have the same tool definition prefix, making the cache reusable), reducing inference costs. Dynamic content improves task adaptability; for example, incremental information allows the context to accurately serve the current task, avoiding decision-making confusion caused by too much general information. If the dynamic content contains long text (e.g., a table structure with 100,000 rows), the long text can be written to a file, and the context only retains the file path, increasing the length of input for a single inference iteration.
[0068] According to embodiments of this application, determining the target context content through static and dynamic content enables key-value cache reuse, reduces inference costs, and improves the accuracy and traceability of agent decision-making.
[0069] Figure 5 The illustration shows a flowchart of a process for invoking a target agent to perform a target migration task based on the target context content, according to an embodiment of this application.
[0070] like Figure 5 As shown, the target agent in this embodiment performs the target migration task based on the target context content, including operations S510 to S520.
[0071] In operation 510, target cached data is matched from the key-value cache based on static content. The key-value cache includes the execution process data of the migration task that was executed earlier and the cache of the execution results.
[0072] In the embodiments of this application, prior task data related to the current target task is accurately matched from the KV cache using static content, including execution process data and execution results. KV caching refers to a caching technology that stores data in key-value pairs, allowing reuse of historical calculation results and reducing latency and cost associated with repetitive reasoning. In heterogeneous database migration scenarios, the stored values can be the execution process data and results of prior migration tasks, and the keys can be strongly correlated with static content (because static content is stable and can serve as a unique matching identifier). Prior migration tasks are not limited to the task preceding the current target task but can also include multiple earlier tasks, and different target tasks can reuse multiple sets of prior task data from the same key-value cache.
[0073] For example, all tasks have completely identical static content (such as migration rules, tool definitions, etc.). For instance, a hash value serves as a unique cache key, ensuring that cross-task requests point to the same key-value cache entry. The key-value cache stores the datasets of all prior tasks; when different target tasks request data, only the subset relevant to itself is matched. Cross-task requests do not modify cached data; only the results of the new task are appended, ensuring that all requested prior data is up-to-date and consistent. For example, migration results appended in Task 3 can be reused in real-time by Task 4.
[0074] In operation 520, the target agent is invoked to perform a target migration task based on the target cached data and the differences between the dynamic content and the target cached data.
[0075] In the embodiments of this application, for target cached data that already has a cache, the result calculated by the self-attention mechanism is directly reused to avoid repeated QKV (Query, Key, Value) matrix operations; for different content that has no cache, the QKV matrix operation in the self-attention mechanism is re-executed to generate incremental results. Finally, the agent integrates the reused and incremental results to execute the target migration task, and at the same time appends the new results to the cache for reuse in subsequent tasks.
[0076] According to the embodiments of this application, by having the target agent perform the target migration task based on cached data and differing content, it is possible to avoid multi-task logic confusion, improve adaptability to complex scenarios, reduce redundant calculations, increase cache hit rate, and improve migration efficiency.
[0077] Figure 6 This schematically illustrates yet another flowchart of a data migration method according to an embodiment of this application.
[0078] like Figure 6 As shown, at least one target migration task in this embodiment includes a performance configuration task; when performing the performance configuration task, the migration method further includes operations S610 to S630.
[0079] In operation 610, the target agent is invoked to determine at least one target tool corresponding to the target business from the preset tool set behind the mask.
[0080] In the embodiments of this application, a performance configuration task refers to a sub-task among the N independent migration tasks that break down heterogeneous database migration. This sub-task must have at least one core objective: accurately evaluating and configuring the performance of the second database. This performance configuration task must be executed before core data migration tasks such as full migration. The target agent can filter tools from a masked, preset toolset that are only used for the corresponding performance configuration task. For example, in a performance configuration task scenario, tools unrelated to performance evaluation, such as full migration tools, are masked, and only performance configuration-specific tools are retained. During the filtering process, static content such as tool definitions can directly reuse cached values without recalculation.
[0081] In Operation 620, based on target data and at least one target tool, the target business is executed in a second database using simulation to obtain performance evaluation results.
[0082] In the embodiments of this application, the intelligent agent first needs to create a matching empty table structure in the second database based on the metadata (table structure, index) of the target data, and then simulate the target business's operation on the table, such as querying order data, so that the simulated scenario is consistent with the real migration. In the second database (without migrating real data, only the target data table structure is created), the real traffic characteristics of the target business, such as concurrency and query type, are reproduced through the target tool. After simulating the execution of the target business, the resource specifications and performance indicators required for the second database to support the target business are output, such as the number of CPU cores, memory capacity, storage type, IOPS threshold, response latency, and data throughput. During the simulation, static content such as table structure can be reused and cached; dynamic content such as concurrency can be incrementally calculated, and finally, performance evaluation results are generated.
[0083] In operation 620, the performance data of the second database is configured based on the performance evaluation results.
[0084] In the embodiments of this application, the hardware / software configuration parameters of the second database, i.e., performance data, are adjusted based on the generated performance evaluation results.
[0085] According to the embodiments of this application, by obtaining performance evaluation results through performance configuration tasks, the CPU, memory and other resources required by the second database can be accurately evaluated, so that the transformed database system meets business needs and avoids resource waste and performance bottlenecks.
[0086] In embodiments of this application, the preset tool set includes N sets of preset tools for N migration tasks, each set of N preset tools being configured with N migration fields, wherein the migration fields are common fields in the names of the preset tools in the corresponding sets; pre-masking at least one non-target tool in the preset tool set based on the target migration task to be executed includes: masking migration fields in the mapping table that do not have a mapping relationship with the target migration task to be executed, wherein the mapping table includes the mapping relationship between N migration tasks and N migration fields.
[0087] N preset tool groups refer to N subsets of tools divided into migration tasks. Each tool group is used to execute only one corresponding migration task. Different tool groups are used at different stages, and tools must be explicitly grouped according to task stages. A migration field is a unique identifier field for each preset tool group, a string or naming prefix common to all tool names in that group, used to quickly identify the migration task to which a tool belongs. A mapping table records the correspondence between N migration tasks and N migration fields, serving as the basis for masking operations. Each row in the table can contain the migration task name and its corresponding migration field, ensuring that each task is accurately matched to a unique tool group.
[0088] For example, a preset toolset is divided into N groups based on N migration tasks. Each group is configured with a unique migration field (the tool name contains this field), and a mapping table is established to record the correspondence between tasks and fields. The target agent determines the current target migration task to be executed based on the migration progress. It then searches the mapping table for the migration field corresponding to the target migration task. Only the tool group corresponding to this migration field is retained, while all other migration fields and their tool groups are masked, i.e., their access permissions are blocked. The target agent can only call the unmasked tool groups to complete the current migration task.
[0089] According to embodiments of this application, precise invocation of a preset set of tools is achieved through tool grouping, migration fields, and mapping tables, thereby improving the efficiency and reliability of heterogeneous database data migration.
[0090] In embodiments of this application, configuring the target agent to invoke tools based on a masked preset tool set includes: inputting a preset prompt word into the target agent, the preset prompt word including N transition fields, the preset prompt word being used to guide the target agent to predict the name of the tool to be invoked based on the transition fields; in response to the target agent generating a candidate tool list, setting the prediction probability of non-target tools in the candidate tool list to zero, non-target tools including candidate tools whose names contain masked transition fields from the mapping table, the candidate tool list including at least one candidate tool name and its corresponding prediction probability.
[0091] Predefined prompts refer to pre-defined static text used to guide the target agent in predicting tools based on transfer fields. This includes definitions of N transfer fields, association rules between tool names and transfer fields, and the target transfer field corresponding to the current task. It does not contain dynamic content such as timestamps, facilitating key-value caching and reuse. The candidate tool list refers to the set of tools that the target agent might call based on the predefined prompts, with each tool corresponding to a prediction probability. The prediction probability represents the agent's confidence in predicting the use of a particular tool to complete the current task, ranging from 0 to 1. It can be calculated by the output layer of a self-attention deep learning model; a higher probability indicates that the agent considers the tool more suitable for the current task.
[0092] For example, a pre-constructed set of prompts containing N migration fields is input into the target agent. Based on the association between the migration fields in the prompts and the tool names (e.g., if a tool name contains a `config_perf` field, it's used for performance configuration), the agent automatically predicts the tool names that the current task might call, ensuring the prediction direction remains accurate. The target agent, based on the pre-constructed prompts, generates a candidate tool list containing at least one candidate tool name and its corresponding predicted probability. According to the masked migration field, it identifies non-target tools in the list (tools whose names contain the masked field) and forces their predicted probability to 0. Ultimately, only the target tool (the tool whose name contains the available field) retains a valid probability, and the agent can only call tools with non-zero probabilities. For example, logarithmic bias can be used to force the logarithmic probability of the tool name corresponding to a non-target tool to -∞ (corresponding to a predicted probability of 0), preventing the agent from selecting that tool. However, the tool name and definition remain in the candidate list and context, without disrupting the key-value cache.
[0093] According to the embodiments of this application, by guiding the prediction and non-target tool probabilities to zero through preset prompt words, the target agent can make tool calls, which can improve the accuracy of tool calls and avoid key-value cache invalidation, thereby improving migration efficiency.
[0094] Based on the above data migration method, this application also provides a data migration apparatus. The following will be combined with... Figure 7 The device is described in detail.
[0095] Figure 7 A schematic block diagram of a data migration apparatus according to an embodiment of this application is shown.
[0096] like Figure 7 As shown, the data migration apparatus 700 of this embodiment includes a splitting module 710 and a migration module 720.
[0097] The splitting module 710 is used to respond to a migration request to migrate target data from the first database to the second database by invoking the target agent to split the migration request into N migration tasks. The first database and the second database have different database structures, and N is an integer greater than or equal to 2. In one embodiment, the splitting module 710 can be used to perform the operation S210 described above, which will not be repeated here.
[0098] The migration module 720 is used to invoke the target agent to sequentially execute N migration tasks based on a preset toolset to migrate target data from the first database to the second database. Specifically, when executing at least one target migration task among the N migration tasks, at least one non-target tool in the preset toolset is masked based on the target migration task to be executed, and the target agent is configured to invoke tools based on the masked preset toolset. In one embodiment, the migration module 720 can be used to execute the operation S220 described above, which will not be repeated here.
[0099] According to an embodiment of this application, the migration module 720 is further configured to determine the target context content based on the target migration task to be executed, the masked preset toolset, and the execution results of the prior migration tasks. The execution results include at least one of the performance evaluation results, the simulated migration results, and the business simulation execution results based on the simulated migration. The target agent is then invoked to execute the target migration task based on the target context content.
[0100] According to an embodiment of this application, the migration module 720 is further configured to obtain static content, which includes the same content under different target migration tasks; obtain dynamic content based on the target migration task to be executed, the masked preset toolset and the execution result of the previous migration task; and obtain target context content based on the static content and the dynamic content.
[0101] According to an embodiment of this application, the migration module 720 is further configured to match target cache data from the key-value cache based on static content, the key-value cache including the execution process data of the prior migration task and the cache of the execution result; and to call the target agent to execute the target migration task based on the target cache data and the difference between the dynamic content and the target cache data.
[0102] According to an embodiment of this application, the data migration apparatus 700 further includes a determination module, a performance prediction module, and a configuration module. When at least one target migration task includes a performance configuration task, and the performance configuration task is being executed, the determination module is used to call the target agent to determine at least one target tool corresponding to the target service from a preset set of tools behind the mask; the performance prediction module is used to obtain a performance evaluation result by simulating the execution of the target service in a second database based on the target data and at least one target tool; and the configuration module is used to configure the performance data of the second database based on the performance evaluation result.
[0103] According to an embodiment of this application, the data migration apparatus 700 further includes a field module and a mask module. The field module is used for N sets of preset tools for N migration tasks, wherein each of the N sets of preset tools is configured with N migration fields, and the migration fields are fields common to the names of the preset tools in the corresponding groups. The mask module is used to pre-mask at least one non-target tool in the preset tool set based on the target migration task to be executed, specifically including: masking the migration fields in the mapping table that do not have a mapping relationship with the target migration task to be executed, wherein the mapping table includes the mapping relationship between N migration tasks and N migration fields.
[0104] According to an embodiment of this application, the data migration device 700 further includes a tool invocation module. The tool invocation module is used to input a preset prompt word into the target agent. The preset prompt word includes N migration fields. The preset prompt word is used to guide the target agent to predict the name of the tool to be invoked based on the migration fields. In response to the target agent generating a candidate tool list, the prediction probability of non-target tools in the candidate tool list is set to zero. Non-target tools include candidate tools whose names have masked migration fields in the mapping table. The candidate tool list includes at least one candidate tool name and its corresponding prediction probability.
[0105] According to embodiments of this application, any plurality of modules in the split module 710 and the migration module 720 can be merged into one module, or any one of these modules can be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules can be combined with at least a portion of the functionality of other modules and implemented in one module. According to embodiments of this application, at least one of the split module 710 and the migration module 720 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the split module 710 and the migration module 720 can be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.
[0106] Figure 8 A block diagram schematically illustrates an electronic device suitable for implementing a data migration method according to an embodiment of this application.
[0107] like Figure 8As shown, an electronic device 800 according to an embodiment of this application includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage portion 809 into a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.
[0108] RAM 803 stores various programs and data required for the operation of electronic device 800. Processor 801, ROM 802, and RAM 803 are interconnected via bus 804. Processor 801 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 802 and / or RAM 803. It should be noted that the programs may also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in said one or more memories.
[0109] According to embodiments of this application, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to a bus 804. The electronic device 800 may also include one or more of the following components connected to the input / output (I / O) interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 809 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output (I / O) interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the storage section 809 as needed.
[0110] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0111] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include ROM 802 and / or RAM 803 and / or one or more memories other than ROM 802 and RAM 803 described above.
[0112] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to enable the computer system to implement the data migration method provided in the embodiments of this application.
[0113] When the computer program is executed by the processor 801, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0114] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 809, and / or installed from a removable medium 811. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0115] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, it performs the functions defined in the system of this application embodiment. According to the embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0116] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0117] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0118] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
Claims
1. A data migration method, comprising: in response to a migration request of migrating target data in a first database to a second database, calling a target agent to split the migration request into N migration tasks, the first database being different from a database structure of the second database, N being an integer greater than or equal to 2; calling the target agent to sequentially execute the N migration tasks based on a preset tool set to migrate the target data in the first database to the second database; wherein in a case of executing at least one target migration task in the N migration tasks, at least one non-target tool in the preset tool set is masked in advance based on a target migration task to be executed, and the target agent is configured to call a tool based on the masked preset tool set.
2. The method of claim 1, wherein, in a case of executing at least one target migration task in the N migration tasks, the method further comprises: determining target context content based on the target migration task to be executed, the masked preset tool set, and an execution result of a previous migration task, the execution result comprising at least one of a performance evaluation result, a simulated migration result, and a business simulation execution result based on a simulated migration; calling the target agent to execute the target migration task based on the target context content.
3. The method of claim 2, wherein, The determination of the target context content based on the target migration task to be executed, the masked preset tool set, and the execution result of the previous migration task comprises: obtaining static content, the static content comprising the same content in a case of executing different target migration tasks; obtaining dynamic content based on the target migration task to be executed, the masked preset tool set, and the execution result of the previous migration task; obtaining the target context content based on the static content and the dynamic content.
4. The method of claim 3, wherein, The calling of the target agent to execute the target migration task based on the target context content comprises: matching target cache data from a key-value cache based on the static content, the key-value cache comprising execution process data and an execution result of a previous migration task; calling the target agent to execute the target migration task based on the target cache data and difference content between the dynamic content and the target cache data.
5. The method of claim 1, wherein, The at least one target migration task comprises a performance configuration task; in a case of executing the performance configuration task, the method further comprises: calling the target agent to determine at least one target tool corresponding to a target business of the target data from the masked preset tool set; based on the target data and the at least one target tool, performing the target business in the second database based on simulation to obtain a performance evaluation result; configuring performance data of the second database based on the performance evaluation result.
6. The method of claim 1, wherein, The preset tool set comprises N groups of preset tools respectively for the N migration tasks, wherein N groups of preset tools are one-to-one corresponding to N migration fields, and the migration fields are fields common to the names of the corresponding groups of preset tools; The pre-masking of at least one non-target tool in the preset tool set based on the target migration task to be executed comprises: masking migration fields in the mapping table that do not have a mapping relationship with the target migration task to be executed, wherein the mapping table includes the mapping relationship between the N migration tasks and the N migration fields.
7. The method of claim 6, wherein, The target agent is configured to call tools based on the masked preset tool set, which comprises: inputting a preset prompt word into the target agent, the preset prompt word including the N migration fields, the preset prompt word being used to guide the target agent to predict the tool name to be called based on the migration field; in response to the target agent generating a candidate tool list, setting the prediction probability of a non-target tool in the candidate tool list to zero, the non-target tool including a candidate tool having the masked migration field in the mapping table in the name, and the candidate tool list including at least one candidate tool name and the corresponding prediction probability.
8. A data migration apparatus, characterized by comprising: The device comprises: a splitting module configured to, in response to a migration request for migrating target data in a first database to a second database, invoke a target agent to split the migration request into N migration tasks, the database structure of the first database being different from that of the second database, and N being an integer greater than or equal to 2; and a migration module configured to invoke the target agent to sequentially execute the N migration tasks based on a preset tool set to migrate the target data in the first database to the second database; wherein in the case of executing at least one target migration task of the N migration tasks, at least one non-target tool in the preset tool set is pre-masked based on the target migration task to be executed, and the target agent is configured to call tools based on the masked preset tool set.
9. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1-7.
10. A computer readable storage medium having stored thereon a computer program or instructions, characterized in that, The computer program or instructions are executed by the processor to implement the steps of the method according to any one of claims 1-7.
11. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instructions are executed by the processor to implement the steps of the method according to any one of claims 1-7. The computer program or instructions are executed by the processor to implement the steps of the method according to any one of claims 1-7.
Citation Information
Cited By
Financial business processing method, device and equipment based on intelligent agent and storage medium
CN122332665A
Intelligent agent-based financial service processing method, device, equipment and storage medium
CN122332665B
