SQL Server database-based migration method, device, electronic device, and storage medium
By receiving migration requests, determining associated servers and migration paths, screening idle databases and optimizing the transfer order, it solves the tedious problem of manual file migration in SQL Server databases and improves file transfer efficiency and user experience.
Patent Information
- Application Number
- CN202210241353.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-03-11
AI Technical Summary
In SQL Server databases, manually selecting and migrating large numbers of files is tedious and results in low user efficiency.
By receiving migration requests, determining associated servers and migration paths, screening idle databases, and using multi-threaded transfer or offline transfer mode, files are automatically transferred to idle databases. The transfer order is optimized based on file type, access time, and number of accesses, and encrypted files are unlocked using dynamic keys.
It improves file transfer efficiency, reduces the need for manual operations, avoids saturation of idle databases, and optimizes user experience.
Smart Images

Figure CN114741371B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data transmission, and in particular to a migration method, device, electronic device and storage medium based on an SQL database. Background Art
[0002] A database is a warehouse that organizes, stores, and manages data according to data structures. As the amount of database data gradually increases, SQL Server technology will be used to manage the large amount of data in the database.
[0003] In related technologies, users usually manually select the files to be migrated on the SQL Server operation interface and drag the files to be migrated to other objects. The other objects can be online servers or local servers. The files can be transferred to the other objects to achieve file migration.
[0004] During the implementation of this application, the inventors discovered that this technology has at least the following problems:
[0005] When there are a large number of files in the database, manual selection is tedious, which reduces the user's work efficiency. Summary of the Invention
[0006] In order to improve the problem of tedious manual migration of files in a database, the present application provides a migration method, device, electronic device and storage medium based on an SQL database.
[0007] In the first aspect, the present application provides a migration method based on a SQL Server database, which adopts the following technical solutions:
[0008] A migration method based on a SQL Server database includes the following steps:
[0009] receiving a migration request uploaded by a user, the migration request carrying first address information of a first server and information to be migrated;
[0010] Determining a second server associated with the first server and corresponding second address information, and generating a migration path;
[0011] Obtaining a database and corresponding storage capacity in the second server;
[0012] According to the databases and corresponding available storage capacities, screening idle databases that match the information to be migrated;
[0013] According to the migration path, each file matching the information to be migrated is transferred to the idle database.
[0014] By employing the above technical solution, the SQL server receives a user's migration request, determines the object to be migrated (i.e., the second server), and obtains the migration path between the first and second servers. The SQL server then selects idle databases that match the information to be migrated and, based on the migration path, transfers the matching files to the idle databases. By pre-selecting the idle databases on the second server before transferring matching files to the second server, the SQL server can reduce the possibility of idle database saturation during the file transfer process and reduce the likelihood of manual user operations leading to lower work efficiency.
[0015] Optionally, determining the second server associated with the first server and the corresponding second address information includes the following steps:
[0016] Get the user's association ID and the corresponding server key;
[0017] determining, according to the association identifier, a second server associated with the first server;
[0018] If the server key matches the second server, the access permission of the second server is obtained, and the second address information corresponding to the second server is obtained;
[0019] Otherwise, a prompt message is sent to the user to enter the password again.
[0020] By adopting the above technical solution, some online servers require keys for unlocking, and the associated servers can be unlocked through the user-preset keys, reducing the need for users to enter the corresponding keys before transmission and shortening the time it takes for SQL servers to transmit files.
[0021] Optionally, the step of transferring each file matching the to-be-migrated information to an idle database according to the migration path includes the following steps:
[0022] If both the first server and the second server are local servers, an offline transfer mode is enabled, and each file matching the to-be-migrated information is transferred to an idle database according to the migration path;
[0023] Otherwise, enable multi-threaded transfer mode;
[0024] In the multi-threaded transmission mode, obtaining the data volume of each file matched by the information to be migrated;
[0025] According to a preset queue allocation order, each file is allocated to a corresponding queue, and according to a migration path, each file is transferred to an idle database.
[0026] By adopting the above technical solution, when two servers are connected via a line and / or communication, the SQL server can directly transfer files from the first server to the second server. When one of the servers is an online server, multi-threaded transmission can be used to improve the efficiency of file transfer to the second server.
[0027] Optionally, the step of transferring each file matching the to-be-migrated information to an idle database according to the migration path includes the following steps:
[0028] Obtain the file type of each file that matches the information to be migrated, and obtain the associated file package based on the preset file relationship chain;
[0029] The associated file packages are transferred to the idle database according to a preset preference order and migration path.
[0030] By employing the above technical solution, the SQL server obtains the file type of each file, such as office files, entertainment files, and tool files. Based on a pre-set file relationship chain, it obtains associated file packages consisting of multiple files or a single file. Based on user preferences, the SQL server can prioritize the transmission of high-priority associated file packages, allowing users to access downloaded, high-priority files, thereby improving the user experience.
[0031] Optionally, the step of transferring each file matching the to-be-migrated information to an idle database according to the migration path includes the following steps:
[0032] Obtaining the access time and access count of each file matching the migration information;
[0033] Generate a user access comparison table based on the access time and access count of each file;
[0034] Obtaining a priority transmission order according to a preset current time and the access comparison table;
[0035] According to the priority transmission order and the migration path, each file matching the to-be-migrated information is transmitted to the idle database.
[0036] By adopting this technical solution, the SQL server can determine the access period of each file based on access time and access count, thereby generating a user access comparison table. Based on the user access comparison table and the user's time period (i.e., the current time), SQL determines the priority transmission order. This allows users to prioritize downloading required files in different time periods.
[0037] Optionally, the migration request further carries a disk partition identifier and corresponding disk usage;
[0038] The step of screening, based on the databases and the corresponding available storage capacities, an idle database matching the information to be migrated comprises the following steps:
[0039] Get the current transfer volume of each database and the corresponding storage capacity;
[0040] According to the current transmission volume of each database and the corresponding storage capacity, the simulated storage capacity of each database is obtained;
[0041] Generate the preferred database order based on the simulated storage capacity of each database and the number of disk partition identifiers;
[0042] Selecting an idle database that matches the information to be migrated based on the preferred database order and disk usage;
[0043] If the simulated storage capacity of the idle database is insufficient, a prompt message indicating insufficient database space will be sent to the user.
[0044] By adopting the above technical solution, when certain databases on the second server are currently storing files, the SQL server obtains the remaining storage capacity (i.e., simulated storage capacity) after these databases are stored. Based on this simulated storage capacity and the number of partitions corresponding to the files transferred from the first server, the SQL server generates an order of preference for databases (i.e., the preferred database order). Based on the preferred database order and disk usage, the SQL server determines the available databases that match the information to be migrated. This effectively reduces the possibility of insufficient disk usage for a database that is currently storing files due to the SQL server transferring new files to that database.
[0045] Optionally, after transferring the files matching the to-be-migrated information to the idle database according to the migration path, the following steps are further included:
[0046] If the target file is identified as an encrypted file, a dynamic key is generated based on the pre-stored key group;
[0047] Unlocking the target file using the dynamic key;
[0048] Transfer the target files to the idle database according to the migration path.
[0049] By adopting the above technical solution, the SQL server can generate a dynamic key based on the stored key group and unlock the encrypted file, reducing the pauses during the transmission process.
[0050] In a second aspect, the present application provides a migration device based on a SQL Server database, which adopts the following technical solution:
[0051] A migration device based on a SQL Server database, comprising:
[0052] The first receiving module is configured to receive a migration request uploaded by a user, where the migration request carries first address information of a first server and information to be migrated.
[0053] a first determining module, configured to determine a second server associated with the first server and corresponding second address information, and generate a migration path;
[0054] A first acquisition module is used to acquire the database and the corresponding storage capacity in the second server;
[0055] A screening module, configured to screen, based on the databases and corresponding available storage capacities, idle databases that match the information to be migrated;
[0056] The transmission module is used to transmit each file matched with the information to be migrated to the idle database according to the migration path.
[0057] By adopting the above technical solution, the SQL server can pre-screen the idle databases in the second server and then transfer the files matching the information to be migrated to the second server. On the one hand, it can reduce the saturation of the idle database during the file transfer process, and on the other hand, it can reduce the possibility of low work efficiency caused by manual operations of users.
[0058] In a third aspect, the present application provides an electronic device, which adopts the following technical solution:
[0059] Optionally, the electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement a migration method based on an SQL database as described in the first aspect.
[0060] By adopting the above technical solution, an electronic device can implement the above-mentioned migration method based on the SQL Server database according to the relevant computer program stored in the memory, thereby improving the collaboration between information from different sources during database file transmission, thereby improving the efficiency of database file transmission.
[0061] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:
[0062] Optionally, the storage medium stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement a migration method based on a SQL Server database as described in the first aspect.
[0063] By adopting the above technical solution, the corresponding program can be stored, thereby improving the collaboration between information from different sources during database file transmission, thereby improving the efficiency of database file transmission.
[0064] In summary, this application includes at least one of the following beneficial technical effects:
[0065] The SQL server can pre-screen the idle databases on the second server and then transfer the files matching the information to be migrated to the second server. This can reduce the saturation of idle databases during the file transfer process and reduce the possibility of manual operations that lead to low work efficiency.
[0066] Some online servers require a key to unlock them. With the user-preset key, the associated server can be unlocked, eliminating the need for users to enter the corresponding key before transmission and shortening the time it takes for SQL servers to transfer files.
[0067] When two servers are connected via a line and / or communication connection, the SQL server can directly transfer files from the first server to the second server. When one of the servers is an online server, multi-threaded transfer can be used to improve the efficiency of file transfer to the second server. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0069] Figure 1 This is a structural block diagram of a migration device based on a SQL Server database in an embodiment of the present application.
[0070] Figure 2 This is a flowchart of a migration method based on a SQL Server database in an embodiment of the present application.
[0071] Figure 3 This is a flow chart of a migration device based on a SQL Server database according to an embodiment of the present application. DETAILED DESCRIPTION
[0072] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0073] The embodiment of the present application provides a migration method based on SQL Server database, which can be applied to a migration device based on SQL Server database. The framework structure of a migration device based on SQL Server database can be as follows: Figure 1 As shown, the method may include an SQL server and a terminal. The terminal may be a cloud-based or local server distinct from the SQL server. Specifically, the method may be executed by the SQL server, with assistance from the terminal. After receiving a user request (i.e., a migration request) to transfer a file from a first server to a second server (i.e., a file transfer request), the SQL server obtains a migration path and a free database based on the information to be migrated from the first server and the database and available storage capacity of the second server, enabling the first server to transfer the file to the free database of the second server. Specifically, the SQL server receives the migration request from the user and, based on the migration request, obtains the information to be migrated from the first server and determines the database and corresponding available storage capacity of the second server. The SQL server obtains the migration path based on the first address information of the first server and the second address information of the second server. Based on the information to be migrated, the database, and the corresponding available storage capacity, the SQL server obtains the free database. The first server can then transfer the file to the second server using the migration path and the free database.
[0074] The following will be combined with specific implementation methods. Figure 2 The processing flow shown is described in detail, and the content can be as follows:
[0075] Step 201: Receive a migration request uploaded by a user. The migration request carries first address information of a first server and information to be migrated.
[0076] In an embodiment, a user can log in to the SQL service interface through SQL software and select the file migration box in the SQL service interface. After clicking the file migration box, a pop-up information form appears on the SQL service interface. After completing the form, the user presses the OK button to enter the address information (i.e., first address information) of a server (i.e., first server) and the information to be migrated. This allows the SQL server to receive the migration request uploaded by the user. The migration request carries the first address information of the first server and the information to be migrated. The address information can be a MAC address or an IP address, and the information to be migrated indicates the location of the file to be transferred.
[0077] Step 202: Determine the second server associated with the first server and the corresponding second address information, and generate a migration path.
[0078] In this embodiment, a user can pre-associate one server with another. Alternatively, the SQL server, upon detecting that a user has different servers, associates each server for that user. When the SQL server receives a migration request, it determines the server (the second server) associated with the first server and the server's address information (i.e., the corresponding second address information). Based on the first and second address information and the network protocol, the SQL server generates a data transmission path (i.e., the migration path) between the first and second servers.
[0079] Optionally, obtain the user's association identifier and the corresponding server key. Based on the association identifier, determine the second server associated with the first server. If the server key matches the second server, obtain access rights to the second server and obtain the second address information corresponding to the second server. Otherwise, send a prompt to the user to enter the password again.
[0080] In this embodiment, the SQL server pre-stores an association identifier for each user. The association identifier is used to represent the association between the user's first server and the second server. If the second server is an encryption server, the SQL server obtains the user's association identifier and the corresponding server key. The server key can be a user-defined string of numbers, a gesture, or a facial expression. Based on the association identifier, the SQL server determines the second server associated with the first server. If the server key matches the second server, the SQL server obtains access rights to the second server and retrieves the second address information corresponding to the second server. Otherwise, the user is prompted to enter their password again.
[0081] Step 203: Obtain the database in the second server and the corresponding storage capacity.
[0082] In an embodiment, the SQL server obtains the database and the corresponding available storage capacity of the second server. When the second server is a local server, the SQL server obtains the disk (ie, the database) and the corresponding remaining storage capacity (ie, available storage capacity) of the second server.
[0083] Step 204: Filter idle databases that match the information to be migrated based on the databases and their corresponding available storage capacities.
[0084] In an embodiment, the SQL server screens databases (ie, free databases) that can be used to store files corresponding to the information to be migrated based on the databases and the corresponding available storage capacities.
[0085] Optionally, obtain the current transfer volume and corresponding available storage capacity of each database. Based on the current transfer volume and the corresponding available storage capacity of each database, obtain the simulated storage capacity of each database. Generate a preferred database order based on the simulated storage capacity of each database and the number of partition identifiers. Based on the preferred database order and disk usage, select an idle database that matches the information to be migrated. If the simulated storage capacity of any idle database is insufficient, a message indicating insufficient database space will be sent to the user.
[0086] In this embodiment, the migration request also carries a partition identifier and the corresponding disk usage. The partition identifier can be a serial number or a string. The last digit of the partition identifier represents the sequence number of each partition on the first server. Each partition identifier corresponds to the corresponding disk usage (i.e., disk usage). The migration request can carry one or more partition identifiers. When the partition identifier is one, the last digit of the partition identifier is 1 and corresponds to the disk usage of the partition. When there are multiple partition identifiers, the last digit of each partition identifier corresponds to a corresponding digit, and each partition identifier corresponds to a disk usage. The SQL server obtains the current transfer capacity and the corresponding available storage capacity of each database. Based on the current transfer capacity and the corresponding available storage capacity of each database, the SQL server determines the remaining storage capacity (i.e., simulated storage capacity) of each database after the file transfer task of each database is completed. Based on the simulated storage capacity of each database and the number of partition identifiers, the SQL server selects the database with the largest simulated storage capacity that corresponds to the number of partition identifiers. Each database is associated with a database identifier. Based on the selected databases and their corresponding database identifiers, the preferred database order is determined. The SQL server selects a free database that matches the amount of data to be migrated based on the preferred database order and disk usage. If the SQL server detects insufficient simulated storage for a free database, it sends a message to the user indicating insufficient database space.
[0087] Step 205: Transfer each file that matches the information to be migrated to the idle database according to the migration path.
[0088] In an embodiment, the SQL server transfers each file matching the information to be migrated to the idle database according to the migration path.
[0089] Optionally, if both the first and second servers are local servers, offline transfer mode is enabled, and each file matching the to-be-migrated information is transferred to the idle database according to the migration path. Otherwise, multi-threaded transfer mode is enabled, and in this mode, the data volume of each file matching the to-be-migrated information is obtained. Each file is assigned to a corresponding queue according to a preset queue allocation order, and each file is transferred to the idle database according to the migration path.
[0090] In an embodiment, if the SQL server identifies that both the first server and the second server are local servers, it activates offline transfer mode and transfers each file matching the to-be-migrated information to an idle database according to the migration path. Otherwise, it activates multi-threaded transfer mode. In multi-threaded transfer mode, the data volume of each file matching the to-be-migrated information is obtained. Based on the amount of data to be transferred in each queue, the SQL server sequentially selects queues with smaller amounts of data to be transferred, thereby determining a queue allocation order. The SQL server then assigns each file to the corresponding queue according to the preset queue allocation order and transfers each file to the idle database according to the migration path.
[0091] Optionally, the file type of each file matching the information to be migrated is obtained, and a related file package is obtained based on a preset file relationship chain, and the related file package is transferred to the idle database according to a preset preference order and migration path.
[0092] In an embodiment, the SQL server pre-stores different file types, such as office files, entertainment files, and tool files. The SQL server also associates and stores files of the same or different types (i.e., a file relationship chain exists between files). For example, a file relationship chain can be established between drawing files and CAD software. The SQL server obtains the file type of each file that matches the information to be migrated and, based on the pre-set file relationship chain, generates an associated file package. The SQL server also pre-stores a preference order, which can be set based on user preferences. Based on the pre-set preference order and migration path, the SQL server transfers the associated file packages to the idle database.
[0093] Optionally, the access time and access count of each file matching the migration information are obtained. A user access comparison table is generated based on the access time and access count of each file. A priority transfer order is determined based on the preset current time and the access comparison table. Based on the priority transfer order and the migration path, each file matching the migration information is transferred to the idle database.
[0094] In an embodiment, the SQL server obtains the access time and access count of each file matching the migration information. Based on the access time and access count of each file, the SQL server generates a user access comparison table, which represents the access count of each file in different time periods. Based on the chronological order from the current time, the SQL server sequentially selects files with the highest access counts and determines a priority transfer order for the files. Based on the priority transfer order and the migration path, the SQL server transfers each file matching the migration information to the idle database.
[0095] Optionally, if the target file is identified as an encrypted file, a dynamic key is generated based on a pre-stored key group. The target file is unlocked using the dynamic key and transferred to the idle database according to the migration path.
[0096] In this embodiment, after transferring all files matching the to-be-migrated information to the idle database, if the SQL server identifies a file (i.e., the target file) as encrypted, it generates a dynamic key based on a pre-stored key group. The key group can be a multi-segment string, each of which can be entered by the user. These strings are then sorted and combined to generate the dynamic key. The dynamic key is used to unlock the target file and transfer it to the idle database according to the migration path.
[0097] Based on the same technical concept, the embodiment of the present application also discloses a migration device based on SQL database, a migration device based on SQL Server database includes a SQL server, such as Figure 3 As shown, the SQL server includes:
[0098] The first receiving module is configured to receive a migration request uploaded by a user, where the migration request carries first address information of a first server and information to be migrated.
[0099] A first determining module, configured to determine a second server associated with the first server and corresponding second address information, and generate a migration path;
[0100] A first acquisition module is used to acquire the database and the corresponding storage capacity in the second server;
[0101] A screening module is used to screen idle databases that match the information to be migrated based on the databases and their corresponding available storage capacity;
[0102] The transmission module is used to transmit each file matching the information to be migrated to the idle database according to the migration path.
[0103] Optionally, a second acquisition module is used to obtain the user's association identifier and the corresponding server key;
[0104] A second determining module, configured to determine a second server associated with the first server according to the association identifier;
[0105] Optionally, the first obtaining module is configured to obtain access rights of the second server and obtain second address information corresponding to the second server when the server key matches the second server;
[0106] The first sending module is used to send a prompt message to the user to input the password again when the server key does not match the second server key.
[0107] The transmission module is further configured to enable an offline transmission mode when both the first server and the second server are local servers, and transmit each file matching the information to be migrated to the idle database according to the migration path.
[0108] An enabling module, configured to enable a multi-threaded transmission mode when the first server and the second server are not local servers;
[0109] A third acquisition module is used to obtain the data volume of each file matching the information to be migrated in a multi-threaded transmission mode;
[0110] The transmission module is further used to allocate each file to a corresponding queue according to a preset queue allocation order, and to transfer each file to an idle database according to a migration path.
[0111] Optionally, a fourth acquisition module is used to obtain the file type of each file matching the information to be migrated, and obtain an associated file package based on a preset file relationship chain;
[0112] The transmission module is further used to transmit the associated file packages to the idle database according to a preset preference order and migration path.
[0113] Optionally, a fifth acquisition module is used to obtain the access time and access count of each file matching the migration information;
[0114] The first generating module is used to generate a user access comparison table according to the access time and access count of each file;
[0115] The second obtaining module is used to obtain the priority transmission order according to the preset current time and the access comparison table;
[0116] The transmission module is further configured to transmit each file matching the to-be-migrated information to the idle database according to a priority transmission sequence and a migration path.
[0117] Optionally, a sixth acquisition module is used to obtain the current transmission volume of each database and the corresponding storage capacity;
[0118] The third obtaining module is used to obtain the simulated storage capacity of each database according to the current transmission capacity of each database and the corresponding storage capacity;
[0119] The second generation module is used to generate a preferred database order according to the simulated storage capacity of each database and the number of partition identifiers;
[0120] A selection module is used to select an idle database that matches the information to be migrated based on the preferred database order and disk usage;
[0121] The second sending module is used to send a prompt message of insufficient database space to the user when the simulated storage capacity of the idle database is insufficient.
[0122] Optionally, a third generating module is configured to generate a dynamic key based on a pre-stored key group when the target file is identified as an encrypted file;
[0123] Unlocking module, used to unlock the target file using a dynamic key;
[0124] The transfer module is further used to transfer the target file to the idle database according to the migration path.
[0125] An embodiment of the present application further discloses an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute the above-mentioned migration method based on the SQL Server database.
[0126] An embodiment of the present application also discloses a computer-readable storage medium, which stores a computer program that can be loaded by a processor and execute the above-mentioned SQL Server database-based migration method. The computer-readable storage medium includes, for example: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0127] The above embodiments are intended only to illustrate the technical solutions of this application and are not intended to limit the scope of protection of this application. Obviously, the embodiments described are only some of the embodiments of this application, not all of them. Based on these embodiments, all other embodiments obtained by persons of ordinary skill in the art without inventive effort are also within the scope of protection to be protected by this application.
Claims
1. A migration method based on SQL Server database, characterized in that: The following steps are involved: receiving a migration request uploaded by a user, the migration request carrying first address information of a first server and information to be migrated; Determine the second server associated with the first server and the corresponding second address information, and generate a migration path; Obtaining a database and corresponding storage capacity in the second server; Filtering, based on the databases and their corresponding available storage capacities, idle databases that match the information to be migrated; According to the migration path, transfer the files matching the information to be migrated to the idle database; The step of determining the second server associated with the first server and the corresponding second address information includes the following steps: Get the user's association ID and the corresponding server key; determining, according to the association identifier, a second server associated with the first server; The method of transferring each file matching the to-be-migrated information to the idle database according to the migration path includes the following steps: Obtain the file type of each file matching the information to be migrated, and obtain the associated file package based on the preset file relationship chain; the file types include office files, entertainment files, and tool files; transferring the associated file packages to an idle database according to a preset preference order and migration path; The migration request also carries one or more disk identifiers and corresponding disk usage; the last digit of the disk identifier represents the sequence number of each disk in the first server, and each disk identifier corresponds to the usage of the corresponding disk; The step of screening, based on the databases and the corresponding available storage capacities, an idle database matching the information to be migrated comprises the following steps: Get the current transfer volume of each database and the corresponding storage capacity; According to the current transmission volume of each database and the corresponding storage capacity, the simulated storage capacity of each database is obtained; Based on the simulated storage capacity of each database and the number of partition identifiers, select the database with the largest simulated storage capacity that corresponds to the number of partition identifiers. Each database has a corresponding database identifier. Based on the selected databases and their corresponding database identifiers, generate a preferred database order; Selecting an idle database that matches the information to be migrated based on the preferred database order and disk usage; If the simulated storage capacity of the idle database is insufficient, a prompt message indicating insufficient database space will be sent to the user; The method of transferring each file matching the to-be-migrated information to the idle database according to the migration path includes the following steps: Obtaining the access time and access count of each file matching the migration information; Generate a user access comparison table based on the access time and access count of each file; Obtaining a priority transmission order according to a preset current time and the access comparison table; According to the priority transmission order and the migration path, each file matching the to-be-migrated information is transmitted to the idle database.
2. The migration method based on SQL Server database according to claim 1, characterized in that: The step of determining the second server associated with the first server and the corresponding second address information further includes the following steps: If the server key matches the second server, the access permission of the second server is obtained, and the second address information corresponding to the second server is obtained; Otherwise, a prompt message is sent to the user to enter the password again.
3. The migration method based on SQL Server database according to claim 1, characterized in that: The method of transferring each file matching the to-be-migrated information to the idle database according to the migration path includes the following steps: If both the first server and the second server are local servers, an offline transfer mode is enabled, and each file matching the to-be-migrated information is transferred to an idle database according to the migration path; Otherwise, enable multi-threaded transfer mode; In the multi-threaded transmission mode, obtaining the data volume of each file matched by the information to be migrated; According to a preset queue allocation order, each file is allocated to a corresponding queue, and according to a migration path, each file is transferred to an idle database.
4. The migration method based on SQL Server database according to claim 1, characterized in that: After transferring the files matching the to-be-migrated information to the idle database according to the migration path, the following steps are also included: If the target file is identified as an encrypted file, a dynamic key is generated based on the pre-stored key group; Unlocking the target file using the dynamic key; Transfer the target files to the idle database according to the migration path.
5. A migration device based on SQL Server database, characterized in that: include: A first receiving module is configured to receive a migration request uploaded by a user, wherein the migration request carries first address information of a first server and information to be migrated; A first determining module, configured to determine a second server associated with the first server and corresponding second address information, and generate a migration path; A first acquisition module is used to acquire the database and the corresponding storage capacity in the second server; A screening module, configured to screen idle databases matching the information to be migrated based on the databases and corresponding available storage capacities; A transfer module, configured to transfer files matching the information to be migrated to an idle database according to a migration path; The step of determining the second server associated with the first server and the corresponding second address information includes the following steps: Get the user's association ID and the corresponding server key; determining, according to the association identifier, a second server associated with the first server; The method of transferring each file matching the to-be-migrated information to the idle database according to the migration path includes the following steps: Obtain the file type of each file matching the information to be migrated, and obtain the associated file package based on the preset file relationship chain; the file types include office files, entertainment files, and tool files; transferring the associated file packages to an idle database according to a preset preference order and migration path; The migration request also carries one or more disk identifiers and corresponding disk usage; the last digit of the disk identifier represents the sequence number of each disk in the first server, and each disk identifier corresponds to the usage of the corresponding disk; The step of screening, based on the databases and the corresponding available storage capacities, an idle database matching the information to be migrated comprises the following steps: Get the current transfer volume of each database and the corresponding storage capacity; According to the current transmission volume of each database and the corresponding storage capacity, the simulated storage capacity of each database is obtained; Based on the simulated storage capacity of each database and the number of partition identifiers, select the database with the largest simulated storage capacity that corresponds to the number of partition identifiers. Each database has a corresponding database identifier. Based on the selected databases and their corresponding database identifiers, generate a preferred database order; Selecting an idle database that matches the information to be migrated based on the preferred database order and disk usage; If the simulated storage capacity of the idle database is insufficient, a prompt message indicating insufficient database space will be sent to the user; The method of transferring each file matching the to-be-migrated information to the idle database according to the migration path includes the following steps: Obtaining the access time and access count of each file matching the migration information; Generate a user access comparison table based on the access time and access count of each file; Obtaining a priority transmission order according to a preset current time and the access comparison table; According to the priority transmission order and the migration path, each file matching the to-be-migrated information is transmitted to the idle database.
6. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Redis data migration system, migration method, device and terminal
CN111190551A
Method of database management, database management device and database management program
WO2012017529A1