Database migration method and device, equipment, medium and computer program product

By dividing the database data into multiple combined blocks and distributing them for transmission, and by reversing the data space, the problems of data traces and transmission interference during the database migration process are solved, thus achieving a safe and reliable database migration.

CN121807802APending Publication Date: 2026-04-07CHINA MOBILE INTERNET CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

During database migration, relay routing nodes may temporarily store core data content, leading to data trace issues. Furthermore, the transmission process is susceptible to electromagnetic interference and frequency band conflicts, affecting data consistency, integrity, and compliance.

Method used

The data in the database is broken down into smaller parts, divided into multiple blocks, and distributed and transmitted through routing nodes. The data is inverted by using a data spacer method to ensure that the data is self-hidden during transmission, avoids data traces left by relay nodes, and deletes temporary information after transmission is completed.

Benefits of technology

It achieves self-hiding during the database migration process, ensuring secure transmission, avoiding data trace issues, and guaranteeing data consistency, integrity, and compliance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807802A_ABST
    Figure CN121807802A_ABST
Patent Text Reader

Abstract

The invention discloses a database migration method and device, equipment, a medium and a computer program product, and the method comprises the steps: segmenting each layer of data in a source database based on a database segmentation type combination mode, and obtaining a plurality of combination blocks; each combination block corresponds to at least one main key; determining an initial migration path of the source database according to the combination of the primary keys; inverting the initial migration path according to the chaos inversion degree of the database segmentation type combination mode; and determining a routing node meeting information singularity according to all transfer points of the migration path before and after inversion, migrating the combined block, and deleting temporary state information in the routing node after migration is completed. According to the method, the data in the database is broken up into parts, the divided combination blocks are distributed and transmitted according to the routing nodes, and data interlaced inversion is carried out in the transmission process, so that the purpose of self-hiding in the database migration process is achieved, the problem of data trace leaving of transfer nodes is avoided, and the transmission safety is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a database migration method, apparatus, device, medium, and computer program product. Background Technology

[0002] With the widespread deployment of enterprise-level database systems in critical industries such as finance and telecommunications, high data reliability, cross-regional availability, and disaster recovery capabilities have become core requirements for infrastructure construction. During off-site disaster recovery, backup, or migration of databases, large-scale data transmission typically requires high-speed networks. However, limited by cross-regional network distances, bandwidth bottlenecks, and node topology, database migration often necessitates the use of multiple relay routing nodes as temporary hops to forward data from the source node to the target node.

[0003] However, in actual data migration, relay routing nodes, acting as hop points, may temporarily store core data content or its summary information, resulting in data trail issues at these relay nodes. Furthermore, the transmission process is susceptible to electromagnetic interference, frequency band conflicts, and other factors, leading to the introduction of uncontrollable noise components into the migrated data, thereby affecting the consistency, integrity, and compliance of the migrated data. Summary of the Invention

[0004] The purpose of this invention is to provide a database migration method, apparatus, device, medium, and computer program product that breaks down the data in the database into smaller parts, distributes the multiple combined blocks according to routing nodes, and reverses the data intervals during transmission, thereby achieving self-hiding during database migration, avoiding data traces at transit nodes, and ensuring transmission security.

[0005] To achieve the above objectives, embodiments of the present invention provide a database migration method, including: The data at each level of the source database is divided based on the database partitioning type combination method to obtain multiple combined blocks; wherein each of the combined blocks corresponds to at least one primary key; Based on the combination of the primary keys, determine the initial migration path to migrate the source database to the target database; The initial migration path is inverted based on the degree of disorder and inversion of the database partitioning type combination method. Based on all transit points of the migration path before and after the inversion, determine the routing nodes that satisfy the preset information oddity. The combined block is migrated to the target database based on the routing node, and the temporary information in the routing node is deleted after the migration is completed.

[0006] As an improvement to the above scheme, before dividing the data of each layer in the source database based on the database partitioning type combination method to obtain multiple combined blocks, the following steps are also included: Determine the hierarchical structure of the source database; Based on the hierarchical structure, determine the segmentation type of each layer of data in the source database; The combination method of database partitioning types is determined based on the partitioning type of each layer of data in the source database and the single-layer data coupling entropy of each layer of data.

[0007] As an improvement to the above scheme, the hierarchical structure includes the number of main layers in each layer of the source database, the type span between layers, and the capacity idleness of a single layer.

[0008] As an improvement to the above solution, determining the hierarchical structure of the source database includes: The heterogeneous features of each layer of entity structure in the source database are extracted sequentially to construct a three-dimensional tensor of inter-field reference network, field structural heterogeneity, storage pressure and space surplus distribution; Based on the three-dimensional tensor, a heterogeneous graph structure is constructed to generate the spectral layer structure of the source database; Based on the spectral layer structure, determine the number of primary layers in each layer of the source database, the type span between the layers, and the single-layer capacity availability.

[0009] As an improvement to the above scheme, the step of constructing a heterogeneous graph structure based on the three-dimensional tensor to generate the spectral layer structure of the source database includes: The heterogeneous graph structure is constructed by using the entity structures in the source database as nodes and the relationships between the layers in the source database as edges; wherein the attributes of the nodes are determined based on the three-dimensional tensor. The heteromorphic graph structure is subjected to spectral domain projection, and the heteromorphic graph structure is decomposed into multiple tension spectral subdomains; The spectral layer structure of the source database is formed based on the multiple tension spectral subdomains.

[0010] As an improvement to the above scheme, the spectral layer structure includes multiple spectral layers, each of which represents a structural tension direction in the source database.

[0011] As an improvement to the above scheme, the step of determining the number of principal layers in each layer of the source database, the type span between layers, and the single-layer capacity availability based on the spectral layer structure includes: Based on the multiple spectral layers of the spectral layer structure, determine the number of principal layers for each layer in the source database; Calculate the structural heterogeneity of the spectral layer to obtain the type span between each layer in the source database; Calculate the spatial activity carrying capacity index of the spectral layer to identify potential buffer layer candidate regions; Calculate the spatial redundancy ratio of the potential buffer layer candidate regions to obtain the single-layer capacity idleness of each layer in the source database.

[0012] As an improvement to the above scheme, the calculation of the spatial activity carrying capacity index of the spectral layer and the identification of potential buffer layer candidate regions include: Calculate the spatial activity carrying capacity index for each spectral layer and compare the spatial activity carrying capacity index with a first preset threshold; If the spatial activity carrying capacity index is greater than or equal to the first preset threshold, then the corresponding spectral layer is a potential buffer layer candidate region.

[0013] As an improvement to the above scheme, determining the partitioning type of each layer of data in the source database based on the hierarchical structure includes: The number of main layers, the type span between layers, and the single-layer capacity idleness of each layer in the source database are projected onto a virtual four-quadrant graphic space to obtain two-dimensional coordinate points. Based on the distribution of the two-dimensional coordinate points in the virtual four-quadrant graphic space, the segmentation type of each layer of data in the source database is determined.

[0014] As an improvement to the above scheme, the segmentation types include checkerboard segmentation, columnar segmentation, diagonal grid segmentation, and diagonal segmentation.

[0015] As an improvement to the above scheme, determining the segmentation type of each layer of data in the source database based on the distribution of the two-dimensional coordinate points in the virtual four-quadrant graphic space includes: If the two-dimensional coordinate point is located in the first quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the chessboard segmentation type; If the two-dimensional coordinate point is located in the second quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the columnar segmentation type; If the two-dimensional coordinate point is located in the third quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the diagonal mesh segmentation type; If the two-dimensional coordinate point is located in the fourth quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the diagonal segmentation type.

[0016] As an improvement to the above scheme, determining the database partitioning type combination method based on the partitioning type of each layer of data in the source database and the single-layer data coupling entropy of each layer includes: Calculate the single-layer data coupling entropy of each layer of data in the source database; Based on the single-layer data coupling entropy of each layer of data in the source database, determine the coupling entropy morphological characteristics and coupling strength level of the source database; Based on the coupling entropy morphological characteristics and the coupling strength level, the combination method of the source database segmentation type is determined.

[0017] As an improvement to the above scheme, the coupling entropy morphology features include single-peak, multi-peak, and mean diffusion; the coupling strength levels include strong, medium, and weak.

[0018] As an improvement to the above scheme, determining the combination method of the source database segmentation type based on the coupling entropy morphological characteristics and the coupling strength level includes: If the coupling entropy morphological feature is multi-peaked and the coupling strength level is strong, then the source database segmentation type combination method is a combination of 3 segmentation types; If the coupling entropy morphology is multi-peaked and the coupling strength level is medium, then the source database segmentation type combination method is a combination of 2 to 3 segmentation types; If the coupling entropy morphology is multi-peaked and the coupling strength level is weak, then the source database segmentation type combination method is a combination of up to two segmentation types.

[0019] As an improvement to the above scheme, determining the combination method of the source database segmentation type based on the coupling entropy morphological characteristics and the coupling strength level includes: If the coupling entropy morphology is a single peak or mean diffusion, and the coupling strength level is strong, then the source database segmentation type combination method is a combination of two segmentation types. If the coupling entropy morphology is a single peak or mean diffusion, and the coupling strength level is medium, then the source database segmentation type combination method is a combination of two segmentation types. If the coupling entropy morphology is unimodal or mean diffusion, and the coupling strength level is weak, then the source database segmentation type combination method is a combination of one segmentation type.

[0020] As an improvement to the above scheme, the step of reversing the initial migration path based on the degree of disorder inversion of the database partitioning type combination method includes: Construct a sequence of combined blocks based on the combined blocks; The degree of structural difference between different partition types and the complexity penalty between different combinations of database partition types are determined based on the database partition type combination method. Based on the combined block sequence, the disorder inversion degree of the database partitioning type combination method is calculated according to the degree of structural difference and the complexity penalty number; If the degree of disorder inversion is less than a preset threshold for disorder inversion, then the initial migration path is inverted.

[0021] As an improvement to the above scheme, the inversion of the initial migration path includes: The combined block sequence is inverted by N intervals of positive and negative terms; where N is a positive integer.

[0022] As an improvement to the above scheme, the step of inverting the combined block sequence by N intervals of positive and negative terms includes: Multiple subsequences are selected from the combined block sequence at intervals N; The subsequences are inverted sequentially, with the positive and / or negative terms reversed.

[0023] As an improvement to the above scheme, the step of determining the routing nodes that satisfy the preset information singularity based on all transit points of the migration paths before and after the inversion includes: A migration path transition graph is constructed based on the migration paths before and after inversion; wherein, the nodes in the migration path transition graph are determined by the key primary key pairs of each of the combined blocks, and the side lengths in the migration path transition graph are determined by the transit points; Based on the migration path jump graph, calculate the information singularity of each migration path; The migration paths whose information oddness is less than the preset information oddness are filtered out, and the corresponding nodes are determined as the routing nodes.

[0024] As an improvement to the above solution, the method further includes: Calculate the average number of intervals and the standard deviation based on all sets of inverted intervals; The transmission interval is determined by weighted summation based on the average interval number and the standard deviation; The combined blocks are migrated to the target database according to the transmission interval.

[0025] As an improvement to the above solution, the method further includes: After the migration is complete, the inverted combo blocks are restored to their original logical order according to the inverted order, and the primary key path and reference chain structure are restored.

[0026] This invention also provides a database migration apparatus, comprising: The data segmentation module is used to segment the data at each level of the source database based on the combination of database segmentation types to obtain multiple combined blocks; wherein each of the combined blocks corresponds to at least one primary key; The path determination module is used to determine the initial migration path for migrating the source database to the target database based on the combination of the primary keys. The path inversion module is used to invert the initial migration path according to the degree of disorder inversion of the combination of the database partition types; The node determination module is used to determine the routing nodes that satisfy the preset information oddity based on all transit points of the migration path before and after the inversion. The data migration module is used to migrate the combined block to the target database based on the routing node, and delete the temporary information in the routing node after the migration is completed.

[0027] This invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the database migration method described in any of the preceding claims.

[0028] This invention also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the database migration method described above.

[0029] This invention also provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the database migration method described above.

[0030] Compared to existing technologies, the beneficial effects of the database migration method, apparatus, device, medium, and computer program product provided by this invention are as follows: Data in each layer of the source database is segmented based on a database segmentation type combination method to obtain multiple combined blocks; each combined block corresponds to at least one primary key; an initial migration path for migrating the source database to the target database is determined based on the combination of the primary keys; the initial migration path is inverted based on the disorder inversion degree of the database segmentation type combination method; routing nodes that satisfy a preset information singularity are determined based on all transit points of the migration path before and after inversion; the combined blocks are migrated to the target database based on the routing nodes, and temporary information in the routing nodes is deleted after the migration transmission is completed. This invention breaks down the data in the database into smaller parts, distributes the segmented combined blocks according to the routing nodes, and inverts the data bitwise during transmission, thereby achieving self-hiding during database migration, avoiding data traces at transit nodes, and ensuring transmission security. Attached Figure Description

[0031] Figure 1 This is a flowchart illustrating a preferred embodiment of a database migration method provided by the present invention; Figure 2 This is a schematic diagram of chessboard partitioning in a database migration method provided by the present invention; Figure 3 This is a schematic diagram of columnar partitioning in a database migration method provided by the present invention; Figure 4 This is a schematic diagram of diagonal mesh segmentation in a database migration method provided by the present invention; Figure 5 This is a schematic diagram of diagonal segmentation in a database migration method provided by the present invention; Figure 6 This is a schematic diagram of a preferred embodiment of a database migration device provided by the present invention; Figure 7 This is a schematic diagram of a preferred embodiment of a terminal device provided by the present invention. Detailed Implementation

[0032] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0033] Please see Figure 1 , Figure 1 This is a flowchart illustrating a preferred embodiment of a database migration method provided by the present invention. The database migration method includes: S1, the data of each layer in the source database is divided according to the database partitioning type combination method to obtain multiple combined blocks; wherein, each of the combined blocks corresponds to at least one primary key; S2, determine the initial migration path to migrate the source database to the target database based on the combination of the primary keys; S3, the initial migration path is reversed according to the degree of disorder inversion of the database partitioning type combination method; S4. Based on all transit points of the migration path before and after the inversion, determine the routing nodes that satisfy the preset information oddity. S5, based on the routing node, migrate the combined block to the target database, and delete the temporary information in the routing node after the migration is completed.

[0034] It should be noted that before segmenting the data at each level of the source database based on the database segmentation type combination method as described in S1 to obtain multiple combined blocks, the method further includes: S01, Determine the hierarchical structure of the source database; S02, Based on the hierarchical structure, determine the segmentation type of each layer of data in the source database; S03, determine the combination method of database partitioning types based on the partitioning type of each layer of data in the source database and the single-layer data coupling entropy of each layer of data.

[0035] Preferably, the hierarchical structure includes the number of primary layers in each layer of the source database, the type span between layers, and the capacity idleness of a single layer.

[0036] Further, in step S01, determining the hierarchical structure of the source database includes: S011, sequentially extract the heterogeneous features of each layer of entity structure in the source database, and construct a three-dimensional tensor of inter-field reference network, field structural heterogeneity, storage pressure and space surplus distribution; S012, Construct a heterogeneous graph structure based on the three-dimensional tensor to generate the spectral layer structure of the source database; S013, based on the spectral layer structure, determine the number of main layers in each layer of the source database, the type span between the layers, and the single-layer capacity availability.

[0037] It should be noted that the structural complexity and uneven space utilization of databases are significant causes of performance bottlenecks and security risks, and traditional table-level modeling methods cannot accurately identify the coupling strength between different layers / heterogeneous structures and abnormal layer clustering. Therefore, this embodiment of the invention considers using a combination of methods such as structural tensors, spectral embedding, and graph modeling to determine the database hierarchical structure as a basis for data-driven structural segmentation, making subsequent layering strategies more scientific.

[0038] Specifically, in this embodiment of the invention, firstly, the heterogeneous features of the entity structures of each layer (such as the ODS layer, DW layer, and DM layer) in the source database are extracted sequentially, and a three-dimensional tensor is constructed to represent the inter-field reference network, field structural heterogeneity, storage pressure, and space availability distribution. The inter-field reference network is used to represent semantic dependencies, foreign key connections, and call topology. Field structural heterogeneity includes field granularity, normalization level, nesting structure, and distribution type. Storage pressure and space availability distribution are used to record changes in the total amount of data in the database, version evolution trends, and space availability. Then, a heterogeneous graph structure is constructed based on the three-dimensional tensor to generate the spectral layer structure of the source database. Finally, based on the spectral layer structure of the source database, the number of principal layers in each layer, the type span between layers, and the single-layer capacity availability are determined.

[0039] Further, in step S012, constructing a heterogeneous graph structure based on the three-dimensional tensor to generate the spectral layer structure of the source database includes: S0121, the entity structure in the source database is used as the node of the heterogeneous graph structure, and the relationship between the layers in the source database is used as the edge of the heterogeneous graph structure to construct the heterogeneous graph structure; wherein, the attributes of the node are determined according to the three-dimensional tensor. S0122, Spectral domain projection is performed on the heteromorphic graph structure to decompose the heteromorphic graph structure into multiple tension spectral subdomains; S0123, Based on the multiple tension spectral subdomains, form the spectral layer structure of the source database.

[0040] Specifically, in this embodiment of the invention, physical tables or logical views with entity structure and metadata information in the source database are used as nodes of a heterogeneous graph structure. The relationships between layers in the source database, such as references, aggregations, and derivations, are used as edges of the heterogeneous graph structure. Each node's attributes are derived from slices of a three-dimensional tensor, i.e., the attribute vector corresponding to that table. Node attributes cover the number of historical versions of the table, field fluctuation frequency, reference weight, input / output activity, etc.; edges represent references, aggregations, and derivations between different layers. Each layer of the graph represents a structural tension domain, used to express the tension coupling mode between the table structures at that layer. The Laplacian eigenmap method is used to project the heterogeneous graph structure into a spectral domain, decomposing the heterogeneous graph structure into multiple tension spectral subdomains. Based on these multiple tension spectral subdomains, a spectral layer structure of the source database is formed. The spectral layer structure comprises multiple spectral layers, each representing a stable structural tension direction in the source database.

[0041] Further, in step S013, based on the spectral layer structure, determining the number of principal layers in each layer of the source database, the type span between layers, and the single-layer capacity availability includes: S0131, Based on the multiple spectral layers of the spectral layer structure, determine the number of the main layers for each layer in the source database; S0132, Calculate the structural heterogeneity of the spectral layer to obtain the type span between each layer in the source database; S0133, Calculate the spatial activity carrying capacity index of the spectral layer and identify potential buffer layer candidate regions; S0134, calculate the spatial redundancy ratio of the potential buffer layer candidate region to obtain the single-layer capacity idleness of each layer in the source database.

[0042] Specifically, in this embodiment of the invention, the number of principal layers for each layer in the source database is determined based on the multiple spectral layers of the spectral layer structure. For example, the spectral layer structure is as follows: The number of primary layers in the source database. Define the structural heterogeneity index of the spectral layers. The complex abrupt changes between spectral layers are quantified, and the complex abrupt changes between spectral layers are used as the type span between the ODS layer, DW layer, and DM layer in the source database.

[0043] For example, for the first spectral layers Its structural isomerism for: ; In the formula, Calculated from the standard deviation of the field type distribution in the tensor attribute; The higher the value, the higher the complexity of the internal structure of the spectral layer, and the more intense or unstable the cross-layer structural relationships. It is the structural dispersion of the internal structure of the spectral layer.

[0044] Calculate the spatial activity carrying capacity index for each spectral layer for: ; In the formula, Extracted from the tensor capacity dimension, representing the space occupancy rate; It is a heat normalization that reflects the frequency of read and write calls; It is a structural fluctuation normalization that reflects field changes, version switching, etc. It is the structural uncertainty entropy; These are adjustable parameters that control the degree of influence of space occupancy rate, heat normalization, and structural uncertainty entropy.

[0045] The spatial activity carrying capacity index is compared with a first preset threshold. If the spatial activity carrying capacity index is greater than or equal to the first preset threshold, the corresponding spectral layer is a potential buffer layer candidate region. For example, if If so, this layer can serve as a buffer spectral region for structural transfer.

[0046] Calculate the spatial redundancy ratio of the candidate regions of the potential buffer layer to obtain the single-layer capacity idleness of each layer in the source database.

[0047] The embodiments of the present invention use a combination of structural tensors, spectral embedding, graph modeling and other methods to determine the database hierarchical structure, including the number of main layers, the type span between layers and the capacity idleness of a single layer, so as to avoid the problems of traditional table-level modeling methods failing to accurately identify the coupling strength between cross-layer / heterogeneous layers and abnormal layer aggregation.

[0048] Furthermore, in step S02, based on the hierarchical structure, the segmentation type of each layer of data in the source database is determined, including: S021, Project the number of main layers, the type span between layers, and the single-layer capacity idleness of each layer in the source database onto the virtual four-quadrant graphic space to obtain two-dimensional coordinate points; S022, Based on the distribution of the two-dimensional coordinate points in the virtual four-quadrant graphic space, determine the segmentation type of each layer of data in the source database.

[0049] Specifically, in this embodiment of the invention, the number of main layers in each layer of the source database, the type span between layers, and the single-layer capacity availability are taken as a triple. This triple is then used as input and projected onto a virtual four-quadrant graphics space to obtain two-dimensional coordinate points. , The horizontal axis represents the type span between the ODS, DW, and DM layers in the source database, while the vertical axis represents the capacity availability of a single layer.

[0050] ; In the formula, and These are the mapping functions corresponding to the main level; , and , For weights.

[0051] Based on the distribution of two-dimensional coordinate points in the virtual four-quadrant graphic space, determine the segmentation type of each layer of data in the source database.

[0052] Preferably, different quadrants represent different segmentation types, including checkerboard segmentation, columnar segmentation, diagonal grid segmentation, and diagonal segmentation.

[0053] Furthermore, in step S022, based on the distribution of the two-dimensional coordinate points in the virtual four-quadrant graphic space, the segmentation type of each layer of data in the source database is determined, including: If the two-dimensional coordinate point is located in the first quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the chessboard segmentation type; If the two-dimensional coordinate point is located in the second quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the columnar segmentation type; If the two-dimensional coordinate point is located in the third quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the diagonal mesh segmentation type; If the two-dimensional coordinate point is located in the fourth quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the diagonal segmentation type.

[0054] Specifically, in this embodiment of the invention, each layer of data in the source database is mapped to a segmentation quadrant based on the distribution range of the projection results: First Quadrant: high, high; Second Quadrant: high, Low; Third Quadrant: Low, Low; Fourth Quadrant: Low, high; If the two-dimensional coordinate point is located in the first quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the chessboard segmentation type.

[0055] If the two-dimensional coordinate point is located in the second quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the columnar segmentation type.

[0056] If the two-dimensional coordinate point is located in the third quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the diagonal mesh segmentation type.

[0057] If the two-dimensional coordinate point is located in the fourth quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the diagonal segmentation type.

[0058] For example, please refer to Figures 2 to 5 , Figure 2 This is a schematic diagram of chessboard partitioning in a database migration method provided by the present invention. Figure 3 This is a schematic diagram of columnar partitioning in a database migration method provided by the present invention. Figure 4 This is a schematic diagram of diagonal grid segmentation in a database migration method provided by the present invention. Figure 5 This is a schematic diagram of diagonal segmentation in a database migration method provided by the present invention.

[0059] Chessboard-style partitioning type: The data table is divided into grid cells, such as each table corresponding to a horizontal × vertical grid area, with each cell representing a time period and a user interval of data. Each table can be horizontally partitioned, split into tables, or sharded according to user intervals or time ranges. Each grid block is independently indexed, cached, and queried, and a global query routing table is maintained by metadata, forming a logical chessboard grid.

[0060] For example, the table event log_2024Q1_U001_005 represents the range of users 1 to 5 in the first quarter of 2024.

[0061] Vertical axis (user ID partition) × Horizontal axis (time period partition) = chessboard cell table event_log_2024Q1_user001_100 event_log_2024Q1_user101_200 event_log_2024Q2_user001_100 The structure is as follows: CREATE TABLE event_log_partition_index ( partition_name TEXT, user_range TEXT, time_range TEXT, storage_node TEXT, index_path TEXT ); Columnar partitioning type: All tables that were originally unified at the same level (such as ODS) are split into vertical business stripes. For example, tables starting with ODS_USER_ form one group, tables starting with ODS_VIDEO_ form another group, and tables starting with ODS_ORDER_ form yet another group. Each group of tables only retains fields related to that business domain, and other content does not overlap. Tables within each strip can uniformly use indexes such as biz_id and create_time, and there are no shared fields or index strategies between different stripes.

[0062] For example, in the ODS, DW, and DM structures of a database, different business domains such as users, videos, and orders are independent of each other. Therefore, by using a columnar partitioning method, we can obtain: User stripe table group CREATE TABLE ods_user_info (...); CREATE TABLE ods_user_device (...); Video strip table group CREATE TABLE ods_video_meta (...); CREATE TABLE ods_video_playlog (...); Order strip table group CREATE TABLE ods_order_main (...); CREATE TABLE ods_order_item (...); Diagonal grid format segmentation type: A wide table (e.g., user_profile_all) is split into multiple diagonal grid-style sub-tables, each representing a type of field: a basic field table (user_profile_basic), a behavior field table (user_profile_behavior), and a derived metric table (user_profile_metrics). Each table retains only fields with similar access frequency or lifecycle, such as age and gender as hot fields, and registration time and first login device as cold fields. Hot fields can use in-memory databases, SSD tablespaces, and strong indexes; cold fields can be stored using columnar compression, without indexes, and only archived.

[0063] For example, the original structure is as follows: CREATE TABLE user_profile_all ( user_id VARCHAR, name TEXT, age INT, recent_clicks INT, avg_stay_time FLOAT, registration_time TIMESTAMP ); After splitting, it becomes as follows: CREATE TABLE user_profile_basic ( user_id VARCHAR PRIMARY KEY, name TEXT, age INT ); CREATE TABLE user_profile_behavior ( user_id VARCHAR, recent_clicks INT, avg_stay_time FLOAT ); CREATE TABLE user_profile_archive ( user_id VARCHAR, registration_time TIMESTAMP ); Diagonal split type: Fields with different coupling directions in what was originally a large table are divided into different entity tables. Each entity table only creates indexes on its own core fields and does not create composite indexes across tables, thus forming a diagonal staggered layout in terms of structure.

[0064] For example, if the entire table is user_profile_full, it can be divided into multiple entity tables by diagonal splitting: user_profile_basic (basic information), user_behavior log (behavior log), and user_preference_tag (preference tag). These tables are weakly referenced by the primary key user_id and do not depend on each other.

[0065] The original structure (before splitting) was: CREATE TABLE user_profile_full ( user_id VARCHAR, name TEXT, last_login_time TIMESTAMP, behavior_sequence JSON, preference_tags ARRAY ); The structure after diagonal division is as follows: CREATE TABLE user_profile_basic ( user_id VARCHAR PRIMARY KEY, name TEXT ); CREATE TABLE user_behavior_log ( user_id VARCHAR, event_type TEXT, timestamp TIMESTAMP ); CREATE TABLE user_preference_tag ( user_id VARCHAR, tag TEXT ); This invention, through quantifying the number of main layers, the type span between layers, and the capacity idleness of a single layer, can map the database structure into a spatial layout diagram. This enables database layering and restructuring, avoiding problems such as low query efficiency, redundant resource consumption, and increased complexity in disaster recovery and synchronization strategies caused by unreasonable data layering and partitioning in the database. Moreover, the four spatial layout diagrams described above can also intuitively analyze the structural differences and cross-layer relationships of data in each layer of the database.

[0066] Furthermore, in step S03, based on the partitioning type of each layer of data in the source database and the single-layer data coupling entropy of each layer, the database partitioning type combination method is determined, including: S031, Calculate the single-layer data coupling entropy of each layer of data in the source database; S032, Based on the single-layer data coupling entropy of each layer of data in the source database, determine the coupling entropy morphological characteristics and coupling strength level of the source database; S033, determine the combination method of the source database segmentation type based on the coupling entropy morphological characteristics and the coupling strength level.

[0067] Specifically, in this embodiment of the invention, after determining the segmentation type of each layer of data in the source database, the combination method of the source database segmentation types is further determined by combining the single-layer data coupling entropy of each layer of data in the source database. This includes determining the specific number of segmentation types to use and which segmentation types to select. It should be noted that although a basic segmentation type has been determined for each layer of data based on the structural characteristics of the source database in the aforementioned steps, this selection only considers the complexity of a single layer structure and does not cover the data structure coupling between adjacent layers. In the actual deployment of the database, the data in the same layer is not always uniformly distributed with a single structure, and the difference in coupling strength in different regions will affect the synergistic benefits of the segmentation method. Therefore, segmentation methods based solely on a single-layer perspective will lead to problems such as low cross-layer matching efficiency, redundant data fragment boundaries, and high reorganization costs. Therefore, to avoid these problems, this embodiment of the invention reconstructs the combination of segmentation types based on the aforementioned preliminary segmentation framework, thereby improving the inter-layer adaptability of the segmentation.

[0068] First, the single-layer data coupling entropy of each layer of data in the source database is calculated as follows: ; In the formula, This indicates the data coupling entropy between the current data layer i and the previous layer; It is a value calculated based on field co-occurrence and primary / foreign key connectivity in the current data layer i; It is the data of the current data layer i; It is the data of the layer above data layer i.

[0069] Secondly, based on the single-layer data coupling entropy of each layer in the source database, the coupling entropy morphology and coupling strength level of the source database are determined. The coupling entropy morphology includes unimodal, multimodal, and mean diffusion; the coupling strength level includes strong, medium, and weak.

[0070] Finally, based on the morphological characteristics of coupling entropy and the level of coupling strength, the combination method of source database partitioning types is determined.

[0071] Preferably, step S033, determining the source database segmentation type combination method based on the coupling entropy morphological characteristics and the coupling strength level, includes: If the coupling entropy morphological feature is multi-peaked and the coupling strength level is strong, then the source database segmentation type combination method is a combination of 3 segmentation types; If the coupling entropy morphology is multi-peaked and the coupling strength level is medium, then the source database segmentation type combination method is a combination of 2 to 3 segmentation types; If the coupling entropy morphology is multi-peaked and the coupling strength level is weak, then the source database segmentation type combination method is a combination of up to two segmentation types.

[0072] Preferably, step S033, determining the source database segmentation type combination method based on the coupling entropy morphological characteristics and the coupling strength level, includes: If the coupling entropy morphology is a single peak or mean diffusion, and the coupling strength level is strong, then the source database segmentation type combination method is a combination of two segmentation types. If the coupling entropy morphology is a single peak or mean diffusion, and the coupling strength level is medium, then the source database segmentation type combination method is a combination of two segmentation types. If the coupling entropy morphology is unimodal or mean diffusion, and the coupling strength level is weak, then the source database segmentation type combination method is a combination of one segmentation type.

[0073] For example, as shown in Table 1 below: Table 1

[0074] Combination condition 1: If the single-layer data coupling entropy of all layers in the source database exhibits a multi-peak structure and the coupling strength level is strong, then use a combination of 3 database partitioning types.

[0075] Combination condition 2: If the single-layer data coupling entropy of all layers in the source database exhibits a single peak or mean diffusion, and the coupling strength level is strong, then a combination of two database partitioning types is used.

[0076] Combination condition 3: If the single-layer data coupling entropy of all layers in the source database exhibits a multi-peak structure and the coupling strength level is medium, then use 2 to 3 (adjustable) database partitioning type combinations.

[0077] Combination condition 4: If the single-layer data coupling entropy of all layers in the source database exhibits a single peak or mean diffusion, and the coupling strength level is medium, then a combination of two database partitioning types is used.

[0078] Combination condition 5: If the single-layer data coupling entropy of all layers in the source database exhibits a multi-peak structure and the coupling strength level is weak, then a maximum of 2 database partitioning types can be combined.

[0079] Combination condition 6: If the single-layer data coupling entropy of all layers in the source database exhibits a single peak or mean diffusion, and the coupling strength level is weak, then use one database partitioning type combination.

[0080] It should be noted that the segmentation types in the above combination conditions are all selected from the set of segmentation types used in the i-th layer determined in the preceding steps.

[0081] Furthermore, in this embodiment of the invention, based on the determined number of combinations, candidate combinations are screened, as shown in Table 2 below.

[0082] Table 2

[0083] In this embodiment of the invention, after determining the combination method of database partitioning types (number of combinations and combination type), the source database is partitioned according to the combination method of database partitioning types. After each layer of data is partitioned, multiple combination blocks are formed. Each combination block corresponds to one or more primary key information. The starting point and ending point of the initial migration path for migrating the source database to the target database are determined according to the combination of primary keys.

[0084] In another preferred embodiment, step S3, reversing the initial migration path based on the degree of disorder inversion of the database partitioning type combination method, includes: S31, Construct a combination block sequence based on the combination block; S32, determine the degree of structural difference between different partition types and the complexity penalty number between different combination types according to the database partition type combination method; S33, Based on the combined block sequence, calculate the disorder inversion degree of the database partitioning type combination method according to the degree of structural difference and the complexity penalty number; S34, if the degree of disorder inversion is less than a preset degree of disorder inversion threshold, then the initial migration path is inverted.

[0085] Specifically, in this embodiment of the invention, the combined block sequence is constructed based on the multiple combined blocks formed after segmentation as follows:

[0086] Each element Represents a combined block of data from one layer in the source database; each The corresponding data combination block contains a set of database partition types. Used to divide the data in this layer.

[0087] Based on the combination type in the database partitioning type combination method, the degree of structural difference between different partitioning types is determined, as shown in Table 3 below.

[0088] Table 3

[0089] Based on the combination types in the database partitioning type combination method, the complexity penalty between different combination types is calculated as follows: ; In the formula, It is the number of complexity penalties; The maximum number of segmentation types supported by the system is 4 in this embodiment of the invention; It represents the number of combinations in the combination method.

[0090] Based on the combined block sequence, and according to the degree of structural difference and complexity penalty, the disorder inversion degree of the combination method of database partitioning type is calculated as follows: ; In the formula, It is the degree of chaos inversion; Indicates whether there is a reverse order in the combination sequence; It reflects the structural differences in the partitioning types involved in the combination; n is the number of combined blocks after the database is partitioned according to the database partitioning type combination method.

[0091] If the disorder inversion degree is less than the preset disorder inversion degree threshold, it means that the current combined block sequence is too ordered or too consistent, and the initial migration path needs to be inverted.

[0092] Furthermore, the inversion of the initial migration path includes: The combined block sequence is inverted by N intervals of positive and negative terms; where N is a positive integer.

[0093] It should be noted that since each composite block corresponds to one or more primary key information, and the starting point and ending point of the initial migration path of the source database are mainly composed of combinations of primary keys, this step of reversing the initial migration path is actually reversing the composite block sequence by N intervals of forward and reverse terms.

[0094] For example, if If N = [n / 2], then N = [n / 2].

[0095] if If N = [n / 3], then N = [n / 3].

[0096] if Then N = [n / 4].

[0097] Preferably, the step of inverting the combined block sequence by N intervals of positive and negative terms includes: Multiple subsequences are selected from the combined block sequence at intervals N; The subsequences are inverted sequentially, with the positive and / or negative terms reversed.

[0098] Specifically, inverting N alternating positive and negative terms in the combined block sequence Perform the following operations: First, from the sequence of combined blocks, spaced apart (every N positions). Selecting a subsequence from; Secondly, the selected subsequences are sequentially inverted using their positive and / or negative terms. The inversions alternate, affecting one or more database hierarchy combinations at a time.

[0099] It is important to note that inversion must maintain the legality of the combination and the connectivity of the path; in addition, it is forbidden to invert the same position twice consecutively to prevent the path of the split data blocks from oscillating; and after every k inversions, a complete database migration path check and structural stability reconstruction are required.

[0100] In yet another preferred embodiment, step S4, determining routing nodes that satisfy a preset information singularity based on all transit points of the migration paths before and after the inversion, includes: S41, construct a migration path jump graph based on the migration paths before and after inversion; wherein, the nodes in the migration path jump graph are determined by the key primary key pairs of each of the combined blocks, and the side lengths in the migration path jump graph are determined by the transfer points; S42, Based on the migration path jump graph, calculate the information singularity of each migration path; S43, filter migration paths whose information oddness is less than the preset information oddness, and determine the corresponding nodes as the routing nodes.

[0101] Specifically, in this embodiment of the invention, a migration path transition graph is constructed based on the migration paths before and after inversion. Nodes in the transition graph are determined by the key primary key pairs of each composite block, and the edge lengths are determined by the transit points. Based on the migration path transition graph, the information singularity of each migration path is calculated as follows: ; In the formula, It is the source database migration path The information singularity, where i and j represent the start and end points of the source database migration path, respectively; It is the source database migration path Frequency of calls in system history paths; This indicates an abnormality in the jump path.

[0102] Migration paths with information oddness less than the preset information oddness are filtered out, and the corresponding nodes are determined as unique routing nodes.

[0103] As a preferred embodiment, the method further includes: Calculate the average number of intervals and the standard deviation based on all sets of inverted intervals; The transmission interval is determined by weighted summation based on the average interval number and the standard deviation; The combined blocks are migrated to the target database according to the transmission interval.

[0104] Specifically, in this embodiment of the invention, the transmission interval of the fixed-length data is determined based on the average number of spacers across all combination methods. This is achieved by statistically analyzing all inverted spacer sets and calculating the average number of spacers and the standard deviation; the transmission interval T of the fixed-length data is then determined based on the weighted sum of the average number of spacers and the standard deviation. The combined blocks are then migrated and transmitted according to the transmission interval T.

[0105] As a preferred embodiment, the method further includes: After the migration is complete, the inverted combo blocks are restored to their original logical order according to the inverted order, and the primary key path and reference chain structure are restored.

[0106] Specifically, in this embodiment of the invention, after the migration and transmission are completed, the original logical order of each composite block in the composite inversion is restored according to the inverted order, and the primary key path and reference chain structure are restored; then, the temporary state information of all relay nodes is cleared, and the logs are overwritten with pseudo-logs; cache write-back is delayed to eliminate time feature traces; and, disguised access information is inserted into the system's database migration audit records. This enables coordinated control among node behavior, data trajectory, and content cleanliness. Finally, it is verified that all path jump points can be reversed to restore the original data, ensuring data consistency.

[0107] This invention employs a multi-layered, self-hiding database migration technique, effectively mitigating the risks of traditional database migration processes that easily expose migration patterns, node traces, and security vulnerabilities. This enhances the concealment, security, and compliance of the database migration process, making it highly suitable for high-security sectors such as finance, government, and energy. Furthermore, this invention integrates database migration into daily operations and maintenance, facilitating uninterrupted business operations and seamless, zero-impact switching, thus meeting the technical requirements of integrated intelligent operations and maintenance.

[0108] Accordingly, the present invention also provides a database migration apparatus capable of implementing all the processes of the database migration method in the above embodiments.

[0109] Please see Figure 6 , Figure 6 This is a schematic diagram of a preferred embodiment of a database migration device provided by the present invention. The database migration device includes: The data segmentation module 601 is used to segment the data of each layer in the source database based on the database segmentation type combination method to obtain multiple combined blocks; wherein, each of the combined blocks corresponds to at least one primary key; The path determination module 602 is used to determine the initial migration path for migrating the source database to the target database based on the combination of the primary keys. The path inversion module 603 is used to invert the initial migration path according to the degree of disorder inversion of the database partitioning type combination method; The node determination module 604 is used to determine the routing nodes that satisfy the preset information oddity based on all transit points of the migration path before and after the inversion. The data migration module 605 is used to migrate the combined block to the target database based on the routing node, and delete the temporary information in the routing node after the migration is completed.

[0110] Preferably, the device further includes a combination method determination module, used before dividing the data of each layer in the source database according to the database partitioning type combination method to obtain multiple combined blocks: Determine the hierarchical structure of the source database; Based on the hierarchical structure, determine the segmentation type of each layer of data in the source database; The combination method of database partitioning types is determined based on the partitioning type of each layer of data in the source database and the single-layer data coupling entropy of each layer of data.

[0111] Preferably, the hierarchical structure includes the number of primary layers in each layer of the source database, the type span between layers, and the capacity idleness of a single layer.

[0112] Preferably, determining the hierarchical structure of the source database includes: The heterogeneous features of each layer of entity structure in the source database are extracted sequentially to construct a three-dimensional tensor of inter-field reference network, field structural heterogeneity, storage pressure and space surplus distribution; Based on the three-dimensional tensor, a heterogeneous graph structure is constructed to generate the spectral layer structure of the source database; Based on the spectral layer structure, determine the number of primary layers in each layer of the source database, the type span between the layers, and the single-layer capacity availability.

[0113] Preferably, the step of constructing a heterogeneous graph structure based on the three-dimensional tensor to generate the spectral layer structure of the source database includes: The heterogeneous graph structure is constructed by using the entity structures in the source database as nodes and the relationships between the layers in the source database as edges; wherein the attributes of the nodes are determined based on the three-dimensional tensor. The heteromorphic graph structure is subjected to spectral domain projection, and the heteromorphic graph structure is decomposed into multiple tension spectral subdomains; The spectral layer structure of the source database is formed based on the multiple tension spectral subdomains.

[0114] Preferably, the spectral layer structure includes multiple spectral layers, each of which represents a structural tension direction in the source database.

[0115] Preferably, determining the number of principal layers in each layer of the source database, the type span between layers, and the single-layer capacity availability based on the spectral layer structure includes: Based on the multiple spectral layers of the spectral layer structure, determine the number of principal layers for each layer in the source database; Calculate the structural heterogeneity of the spectral layer to obtain the type span between each layer in the source database; Calculate the spatial activity carrying capacity index of the spectral layer to identify potential buffer layer candidate regions; Calculate the spatial redundancy ratio of the potential buffer layer candidate regions to obtain the single-layer capacity idleness of each layer in the source database.

[0116] Preferably, calculating the spatial activity carrying capacity index of the spectral layer and identifying potential buffer layer candidate regions includes: Calculate the spatial activity carrying capacity index for each spectral layer and compare the spatial activity carrying capacity index with a first preset threshold; If the spatial activity carrying capacity index is greater than or equal to the first preset threshold, then the corresponding spectral layer is a potential buffer layer candidate region.

[0117] Preferably, determining the partitioning type of each layer of data in the source database based on the hierarchical structure includes: The number of main layers, the type span between layers, and the single-layer capacity idleness of each layer in the source database are projected onto a virtual four-quadrant graphic space to obtain two-dimensional coordinate points. Based on the distribution of the two-dimensional coordinate points in the virtual four-quadrant graphic space, the segmentation type of each layer of data in the source database is determined.

[0118] Preferably, the segmentation types include checkerboard segmentation, columnar segmentation, diagonal grid segmentation, and diagonal segmentation.

[0119] Preferably, determining the segmentation type of each layer of data in the source database based on the distribution of the two-dimensional coordinate points in the virtual four-quadrant graphic space includes: If the two-dimensional coordinate point is located in the first quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the chessboard segmentation type; If the two-dimensional coordinate point is located in the second quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the columnar segmentation type; If the two-dimensional coordinate point is located in the third quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the diagonal mesh segmentation type; If the two-dimensional coordinate point is located in the fourth quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the diagonal segmentation type.

[0120] Preferably, determining the database partitioning type combination method based on the partitioning type of each layer of data in the source database and the single-layer data coupling entropy of each layer includes: Calculate the single-layer data coupling entropy of each layer of data in the source database; Based on the single-layer data coupling entropy of each layer of data in the source database, determine the coupling entropy morphological characteristics and coupling strength level of the source database; Based on the coupling entropy morphological characteristics and the coupling strength level, the combination method of the source database segmentation type is determined.

[0121] Preferably, the coupling entropy morphology features include single-peak, multi-peak, and mean diffusion; the coupling strength levels include strong, medium, and weak.

[0122] Preferably, determining the source database segmentation type combination method based on the coupling entropy morphological characteristics and the coupling strength level includes: If the coupling entropy morphological feature is multi-peaked and the coupling strength level is strong, then the source database segmentation type combination method is a combination of 3 segmentation types; If the coupling entropy morphology is multi-peaked and the coupling strength level is medium, then the source database segmentation type combination method is a combination of 2 to 3 segmentation types; If the coupling entropy morphology is multi-peaked and the coupling strength level is weak, then the source database segmentation type combination method is a combination of up to two segmentation types.

[0123] Preferably, determining the source database segmentation type combination method based on the coupling entropy morphological characteristics and the coupling strength level includes: If the coupling entropy morphology is a single peak or mean diffusion, and the coupling strength level is strong, then the source database segmentation type combination method is a combination of two segmentation types. If the coupling entropy morphology is a single peak or mean diffusion, and the coupling strength level is medium, then the source database segmentation type combination method is a combination of two segmentation types. If the coupling entropy morphology is unimodal or mean diffusion, and the coupling strength level is weak, then the source database segmentation type combination method is a combination of one segmentation type.

[0124] Preferably, the path inversion module 603 is specifically used for: Construct a sequence of combined blocks based on the combined blocks; The degree of structural difference between different partition types and the complexity penalty between different combinations of database partition types are determined based on the database partition type combination method. Based on the combined block sequence, the disorder inversion degree of the database partitioning type combination method is calculated according to the degree of structural difference and the complexity penalty number; If the degree of disorder inversion is less than a preset threshold for disorder inversion, then the initial migration path is inverted.

[0125] Preferably, inverting the initial migration path includes: The combined block sequence is inverted by N intervals of positive and negative terms; where N is a positive integer.

[0126] Preferably, the step of inverting the combined block sequence by N intervals of positive and negative terms includes: Multiple subsequences are selected from the combined block sequence at intervals N; The subsequences are inverted sequentially, with the positive and / or negative terms reversed.

[0127] Preferably, the node determination module 604 is specifically used for: A migration path transition graph is constructed based on the migration paths before and after inversion; wherein, the nodes in the migration path transition graph are determined by the key primary key pairs of each of the combined blocks, and the side lengths in the migration path transition graph are determined by the transit points; Based on the migration path jump graph, calculate the information singularity of each migration path; The migration paths whose information oddness is less than the preset information oddness are filtered out, and the corresponding nodes are determined as the routing nodes.

[0128] Preferably, the device further includes a time interval determination module, used for: Calculate the average number of intervals and the standard deviation based on all sets of inverted intervals; The transmission interval is determined by weighted summation based on the average interval number and the standard deviation; The combined blocks are migrated to the target database according to the transmission interval.

[0129] Preferably, the device further includes a restoration module for: After the migration is complete, the inverted combo blocks are restored to their original logical order according to the inverted order, and the primary key path and reference chain structure are restored.

[0130] In specific implementation, the working principle, control process and technical effects of the database migration device provided in the embodiments of the present invention are the same as those of the database migration method in the above embodiments, and will not be repeated here.

[0131] Please see Figure 7 , Figure 7 This is a schematic diagram of a preferred embodiment of a terminal device provided by the present invention. The terminal device includes a processor 701, a memory 702, and a computer program stored in the memory 702 and configured to be executed by the processor 701. When the processor 701 executes the computer program, it implements the database migration method described in any of the above embodiments.

[0132] Preferably, the computer program can be divided into one or more modules / units (such as computer program 1, computer program 2, ...), and the one or more modules / units are stored in the memory 702 and executed by the processor 701 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.

[0133] The processor 701 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or the processor 701 can be any conventional processor. The processor 701 is the control center of the terminal device, connecting various parts of the terminal device through various interfaces and lines.

[0134] The memory 702 mainly includes a program storage area and a data storage area. The program storage area can store the operating system, applications required for at least one function, etc., and the data storage area can store related data, etc. In addition, the memory 702 can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, and a flash card, etc., or the memory 702 can also be other volatile solid-state storage devices.

[0135] It should be noted that the aforementioned terminal devices may include, but are not limited to, processors and memory, as will be understood by those skilled in the art. Figure 7 The structural diagram is merely an example of the terminal device described above and does not constitute a limitation on the terminal device described above. It may include more or fewer components than shown in the diagram, or combine certain components, or use different components.

[0136] This invention also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the database migration method described in any of the above embodiments.

[0137] This invention also provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the database migration method described in any of the above embodiments.

[0138] This invention provides a database migration method, apparatus, device, medium, and computer program product. It divides the data in a source database into multiple combined blocks based on a database partitioning type combination method. Each combined block corresponds to at least one primary key. An initial migration path for migrating the source database to a target database is determined based on the combinations of the primary keys. The initial migration path is then inverted according to the disorder inversion degree of the database partitioning type combination method. Routing nodes satisfying a preset information singularity are determined based on all transit points of the migration path before and after inversion. The combined blocks are migrated to the target database based on the routing nodes, and temporary information in the routing nodes is deleted after the migration is completed. This invention breaks down the data in the database into smaller parts, distributes the multiple combined blocks according to the routing nodes, and inverts the data bitwise during transmission, thereby achieving self-hiding during database migration, avoiding data traces at transit nodes, and ensuring transmission security.

[0139] It should be noted that the system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the system embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0140] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A database migration method, characterized in that, include: The data at each level of the source database is divided based on the database partitioning type combination method to obtain multiple combined blocks; wherein each of the combined blocks corresponds to at least one primary key; Based on the combination of the primary keys, determine the initial migration path to migrate the source database to the target database; The initial migration path is inverted based on the degree of disorder and inversion of the database partitioning type combination method. Based on all transit points of the migration path before and after the inversion, determine the routing nodes that satisfy the preset information oddity. The combined block is migrated to the target database based on the routing node, and the temporary information in the routing node is deleted after the migration is completed.

2. The database migration method as described in claim 1, characterized in that, Before the step of dividing the data at each level of the source database into multiple combined blocks based on the database partitioning type combination method, the following steps are also included: Determine the hierarchical structure of the source database; Based on the hierarchical structure, determine the segmentation type of each layer of data in the source database; The combination method of database partitioning types is determined based on the partitioning type of each layer of data in the source database and the single-layer data coupling entropy of each layer of data.

3. The database migration method as described in claim 2, characterized in that, The hierarchical structure includes the number of primary layers in each layer of the source database, the type span between layers, and the capacity idleness of a single layer.

4. The database migration method as described in claim 3, characterized in that, Determining the hierarchical structure of the source database includes: The heterogeneous features of each layer of entity structure in the source database are extracted sequentially to construct a three-dimensional tensor of inter-field reference network, field structural heterogeneity, storage pressure and space surplus distribution; Based on the three-dimensional tensor, a heterogeneous graph structure is constructed to generate the spectral layer structure of the source database; Based on the spectral layer structure, determine the number of primary layers in each layer of the source database, the type span between the layers, and the single-layer capacity availability.

5. The database migration method as described in claim 4, characterized in that, The step of constructing a heterogeneous graph structure based on the three-dimensional tensor to generate the spectral layer structure of the source database includes: The heterogeneous graph structure is constructed by using the entity structures in the source database as nodes and the relationships between the layers in the source database as edges; wherein the attributes of the nodes are determined based on the three-dimensional tensor. The heteromorphic graph structure is subjected to spectral domain projection, and the heteromorphic graph structure is decomposed into multiple tension spectral subdomains; The spectral layer structure of the source database is formed based on the multiple tension spectral subdomains.

6. The database migration method as described in claim 5, characterized in that, The spectral layer structure includes multiple spectral layers, each of which represents a structural tension direction in the source database.

7. The database migration method as described in claim 6, characterized in that, The step of determining the number of principal layers in each layer of the source database, the type span between layers, and the single-layer capacity availability based on the spectral layer structure includes: Based on the multiple spectral layers of the spectral layer structure, determine the number of principal layers for each layer in the source database; Calculate the structural heterogeneity of the spectral layer to obtain the type span between each layer in the source database; Calculate the spatial activity carrying capacity index of the spectral layer to identify potential buffer layer candidate regions; Calculate the spatial redundancy ratio of the potential buffer layer candidate regions to obtain the single-layer capacity idleness of each layer in the source database.

8. The database migration method as described in claim 7, characterized in that, The calculation of the spatial activity carrying capacity index of the spectral layer and the identification of potential buffer layer candidate regions include: Calculate the spatial activity carrying capacity index for each spectral layer and compare the spatial activity carrying capacity index with a first preset threshold; If the spatial activity carrying capacity index is greater than or equal to the first preset threshold, then the corresponding spectral layer is a potential buffer layer candidate region.

9. The database migration method as described in claim 3, characterized in that, The step of determining the partitioning type of each layer of data in the source database based on the hierarchical structure includes: The number of main layers, the type span between layers, and the single-layer capacity idleness of each layer in the source database are projected onto a virtual four-quadrant graphic space to obtain two-dimensional coordinate points. Based on the distribution of the two-dimensional coordinate points in the virtual four-quadrant graphic space, the segmentation type of each layer of data in the source database is determined.

10. The database migration method as described in claim 9, characterized in that, The segmentation types include checkerboard segmentation, columnar segmentation, diagonal grid segmentation, and diagonal line segmentation.

11. The database migration method as described in claim 10, characterized in that, The step of determining the segmentation type of each layer of data in the source database based on the distribution of the two-dimensional coordinate points in the virtual four-quadrant graphic space includes: If the two-dimensional coordinate point is located in the first quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the chessboard segmentation type; If the two-dimensional coordinate point is located in the second quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the columnar segmentation type; If the two-dimensional coordinate point is located in the third quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the diagonal mesh segmentation type; If the two-dimensional coordinate point is located in the fourth quadrant of the virtual four-quadrant graphic space, then the segmentation type is determined to be the diagonal segmentation type.

12. The database migration method as described in claim 10, characterized in that, The step of determining the database partitioning type combination method based on the partitioning type of each layer of data in the source database and the single-layer data coupling entropy of each layer of data includes: Calculate the single-layer data coupling entropy of each layer of data in the source database; Based on the single-layer data coupling entropy of each layer of data in the source database, determine the coupling entropy morphological characteristics and coupling strength level of the source database; Based on the coupling entropy morphological characteristics and the coupling strength level, the combination method of the source database segmentation type is determined.

13. The database migration method as described in claim 12, characterized in that, The coupling entropy morphology features include single-peak, multi-peak, and mean diffusion; the coupling strength levels include strong, medium, and weak.

14. The database migration method as described in claim 13, characterized in that, The step of determining the source database segmentation type combination method based on the coupling entropy morphological characteristics and the coupling strength level includes: If the coupling entropy morphological feature is multi-peaked and the coupling strength level is strong, then the source database segmentation type combination method is a combination of 3 segmentation types; If the coupling entropy morphology is multi-peaked and the coupling strength level is medium, then the source database segmentation type combination method is a combination of 2 to 3 segmentation types; If the coupling entropy morphology is multi-peaked and the coupling strength level is weak, then the source database segmentation type combination method is a combination of up to two segmentation types.

15. The database migration method as described in claim 13, characterized in that, The step of determining the source database segmentation type combination method based on the coupling entropy morphological characteristics and the coupling strength level includes: If the coupling entropy morphology is a single peak or mean diffusion, and the coupling strength level is strong, then the source database segmentation type combination method is a combination of two segmentation types. If the coupling entropy morphology is a single peak or mean diffusion, and the coupling strength level is medium, then the source database segmentation type combination method is a combination of two segmentation types. If the coupling entropy morphology is unimodal or mean diffusion, and the coupling strength level is weak, then the source database segmentation type combination method is a combination of one segmentation type.

16. The database migration method as described in claim 1, characterized in that, The step of reversing the initial migration path based on the degree of disorder inversion of the database partitioning type combination method includes: Construct a sequence of combined blocks based on the combined blocks; The degree of structural difference between different partition types and the complexity penalty between different combinations of database partition types are determined based on the database partition type combination method. Based on the combined block sequence, the disorder inversion degree of the database partitioning type combination method is calculated according to the degree of structural difference and the complexity penalty number; If the degree of disorder inversion is less than a preset threshold for disorder inversion, then the initial migration path is inverted.

17. The database migration method as described in claim 16, characterized in that, The inversion of the initial migration path includes: The combined block sequence is inverted by N intervals of positive and negative terms; where N is a positive integer.

18. The database migration method as described in claim 17, characterized in that, The step of inverting the combined block sequence by N intervals of positive and negative terms includes: Multiple subsequences are selected from the combined block sequence at intervals N; The subsequences are inverted sequentially, with the positive and / or negative terms reversed.

19. The database migration method as described in claim 1, characterized in that, The step of determining routing nodes that satisfy a preset information singularity based on all transit points of the migration paths before and after the inversion includes: A migration path transition graph is constructed based on the migration paths before and after inversion; wherein, the nodes in the migration path transition graph are determined by the key primary key pairs of each of the combined blocks, and the side lengths in the migration path transition graph are determined by the transit points; Based on the migration path jump graph, calculate the information singularity of each migration path; The migration paths whose information oddness is less than the preset information oddness are filtered out, and the corresponding nodes are determined as the routing nodes.

20. The database migration method as described in claim 18, characterized in that, The method further includes: Calculate the average number of intervals and the standard deviation based on all sets of inverted intervals; The transmission interval is determined by weighted summation based on the average interval number and the standard deviation; The combined blocks are migrated to the target database according to the transmission interval.

21. The database migration method as described in claim 18, characterized in that, The method further includes: After the migration is complete, the inverted combo blocks are restored to their original logical order according to the inverted order, and the primary key path and reference chain structure are restored.

22. A database migration device, characterized in that, include: The data segmentation module is used to segment the data at each level of the source database based on the combination of database segmentation types to obtain multiple combined blocks; wherein each of the combined blocks corresponds to at least one primary key; The path determination module is used to determine the initial migration path for migrating the source database to the target database based on the combination of the primary keys. The path inversion module is used to invert the initial migration path according to the degree of disorder inversion of the combination of the database partition types; The node determination module is used to determine the routing nodes that satisfy the preset information oddity based on all transit points of the migration path before and after the inversion. The data migration module is used to migrate the combined block to the target database based on the routing node, and delete the temporary information in the routing node after the migration is completed.

23. A terminal device, characterized in that, The system includes a processor and a memory, the memory storing a computer program configured to be executed by the processor, wherein the processor, when executing the computer program, implements the database migration method as described in any one of claims 1 to 21.

24. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the device containing the computer-readable storage medium executes the computer program, it implements the database migration method as described in any one of claims 1 to 21.

25. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions, which, when executed by a processor, implement the database migration method as described in any one of claims 1 to 21.