Database management method and apparatus

By acquiring and verifying the incremental data of the database, automated database expansion management is achieved, which solves the problem of manual operation of database expansion and scaling in the existing technology, and improves management accuracy and flexibility.

WO2025035872A1PCT designated stage expired Publication Date: 2025-02-20JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD

Patent Information

Application Number
PCT/CN2024/094216
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-14
Filing Date
2024-05-20
Publication Date
2025-02-20

AI Technical Summary

Technical Problem

Existing databases need to be manually operated during scaling, and data distribution cannot be observed in real time, resulting in waste of resources and business risks.

Method used

By obtaining the incremental data and meta information of the database, we can determine whether the expansion conditions are met, and data checksum migration is carried out to realize automated database expansion management.

Benefits of technology

It improves the accuracy and flexibility of database management, reduces the intervention of operation and maintenance personnel, realizes unaware expansion of the database, and reduces business risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024094216_20022025_PF_FP_ABST
    Figure CN2024094216_20022025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present disclosure are a database management method and apparatus. The database management method comprises: firstly, on the basis of the current moment, acquiring first incremental data of a database and a meta-information list of the first incremental data; then, on the basis of the first incremental data, determining whether the database meets a capacity expansion condition; next, in response to determining that the database meets the capacity expansion condition, performing a data check on the first incremental data on the basis of the meta-information list, so as to obtain checked incremental data; and finally, on the basis of a new database and the database, performing data migration on the checked incremental data, so as to implement capacity expansion management of the database.
Need to check novelty before this filing date? Find Prior Art

Description

Database management method and device

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This patent application claims priority to the Chinese patent application filed on August 14, 2023, with application number 202311024253.8 and invention name “Database Management Method and Device”, the full text of which is incorporated by reference into this application. Technical Field

[0003] The embodiments of the present disclosure relate to the fields of computer technology and database storage technology, and in particular to a database management method and apparatus. Background Art

[0004] Most current database products offer elastic scaling capabilities, meaning they can expand and shrink capacity. In distributed scenarios, this often involves resharding logic. Scaling and shrinking the database also requires data redistribution, a significant workload and significant loss of system performance, often resulting in system downtime.

[0005] The inventors discovered that currently, scaling the database is essentially done manually by operations and maintenance personnel, who are unable to observe the specific data distribution of the current machine. In complex sharding scenarios, scaling the database will also occupy enormous physical resources, potentially leading to online business problems due to incorrect time estimates by operations and maintenance personnel.

[0006] Summary of the Invention

[0007] Embodiments of the present disclosure provide a database management method, a database management device, an electronic device, and a computer-readable medium.

[0008] In one or more embodiments, a database management method is provided, which includes: based on the current moment, obtaining first incremental data of the database and a metadata list of the first incremental data; based on the first incremental data, determining whether the database meets the expansion conditions; in response to determining that the database meets the expansion conditions, performing data verification on the first incremental data according to the metadata list to obtain verified incremental data; based on the new database and the database, performing data migration on the verified incremental data to complete the expansion management of the database.

[0009] In one or more embodiments, a database management device is provided, which includes: an acquisition module configured to acquire first incremental data of a database and a metadata list of the first incremental data based on a current moment; a judgment module configured to judge whether the database meets expansion conditions based on the first incremental data; a verification module configured to, in response to determining that the database meets the expansion conditions, perform data verification on the first incremental data according to the metadata list to obtain verified incremental data; an expansion module configured to perform data migration on the verified incremental data based on a new database and a database to complete database expansion management.

[0010] In one or more embodiments, an electronic device is provided, comprising: one or more processors; a storage device on which one or more programs are stored; when the one or more programs are executed by one or more processors, the one or more processors implement the database management method described in any embodiment of the first aspect.

[0011] In one or more embodiments, a non-transitory computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the database management method described in any embodiment of the first aspect is implemented.

[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Other features, objects and advantages of the present disclosure will become more apparent from a reading of the detailed description of non-limiting embodiments made with reference to the following drawings:

[0014] FIG1 is a diagram of an exemplary system architecture in which an embodiment of the present disclosure may be applied;

[0015] FIG2 is a flow chart of an embodiment of a database management method according to the present disclosure;

[0016] FIG3 is a flow chart of an embodiment of performing data migration on verified incremental data according to the present disclosure;

[0017] FIG4 is a flow chart of an embodiment of completing capacity expansion management of a database according to the present disclosure;

[0018] FIG5 is a flow chart of an embodiment of completing database shrinkage management according to the present disclosure;

[0019] FIG6 is a flow chart of an embodiment of performing capacity expansion management or capacity reduction management on a database according to the present disclosure;

[0020] FIG7 is a schematic structural diagram of an embodiment of a database management device according to the present disclosure;

[0021] FIG8 is a schematic structural diagram of an electronic device suitable for implementing the embodiments of the present disclosure. DETAILED DESCRIPTION

[0022] The present disclosure is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the relevant disclosure and are not intended to limit the disclosure. It should also be noted that, for ease of description, only portions relevant to the relevant disclosure are shown in the accompanying drawings.

[0023] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0024] FIG. 1 shows an exemplary system architecture 100 to which an embodiment of the database management method or database management apparatus of the present disclosure may be applied.

[0025] As shown in Figure 1, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 is a medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0026] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Terminal devices 101, 102, and 103 can be user terminal devices on which various client applications can be installed, such as e-commerce platform applications, image applications, video applications, search applications, financial applications, etc.

[0027] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting receiving server messages, including but not limited to smart phones, tablet computers, e-book readers, electronic players, laptop computers, desktop computers, and the like.

[0028] Terminal devices 101, 102, and 103 can be hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices. When terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software or software modules (for example, multiple software modules for providing distributed services), or as a single software or software module. No specific limitations are given here.

[0029] The server 105 may be a server that provides various services, such as a backend server that receives requests sent by a terminal device that establishes a communication connection with the server 105. The backend server may receive and analyze the requests sent by the terminal device and generate a processing result.

[0030] Server 105 can obtain the first incremental data of the database and the metadata list of the first incremental data based on the current moment, and then determine whether the database meets the expansion conditions based on the first incremental data. After that, in response to determining that the database meets the expansion conditions, the server 105 performs data verification on the first incremental data according to the metadata list to obtain the verified incremental data. Finally, based on the new database and the database, the server 105 performs data migration on the verified incremental data to complete the expansion management of the database.

[0031] It should be noted that a server can be either hardware or software. When the server is hardware, it can be various electronic devices that provide various services to terminal devices. When the server is software, it can be implemented as multiple software programs or software modules that provide various services to terminal devices, or it can be implemented as a single software program or software module that provides various services to terminal devices. This is not specifically limited here.

[0032] It should be noted that the database management method provided in the embodiments of the present disclosure may be executed by the server 105 , and accordingly, the database management device may be provided in the server 105 .

[0033] It should be understood that the number of terminal devices, networks, and servers in Figure 1 is merely illustrative and any number of terminal devices, networks, and servers may be provided as required.

[0034] 2 , a flow chart 200 of an embodiment of a database management method according to the present disclosure is shown. The database management method comprises the following steps:

[0035] Step 210: Based on the current moment, obtain the first incremental data and the metadata list of the first incremental data from the database.

[0036] In this step, the execution entity on which the database management method runs (for example, the server 105 in Figure 1) can obtain the current moment, and based on the current moment, obtain the data stored in the database after the current moment, and determine the data as the first incremental data of the database. While storing the first incremental data in the database, the metadata corresponding to the first incremental data is obtained. The metadata can represent the information of the first incremental data, and can include the primary key ID, physical node serial number and other information corresponding to the first incremental data. Then, the above-mentioned execution entity can organize the metadata of the first incremental data into a metadata list, and the metadata list can include metadata corresponding to multiple first incremental data.

[0037] As an optional implementation method, the above-mentioned step 210, based on the current moment, obtaining the first incremental data of the database and the metadata list of the first incremental data, may include the following steps: based on the current moment, determining whether the data volume of the database is greater than the first threshold; in response to determining that the data volume of the database is greater than the first threshold, based on the current moment, obtaining the first incremental data corresponding to the database, and obtaining the metadata list corresponding to the first incremental data.

[0038] Specifically, the execution entity can obtain the current moment and, based on the current moment, obtain the corresponding data volume of the database. The data volume can include information representing the amount of data stored in the database, and can also include information representing the utilization rate of database resources, such as CPU usage, etc. The data volume can also include other information representing the proportion of data in the database, and this disclosure does not specifically limit this. The execution entity can compare the data volume of the database with a first threshold to determine whether the data volume of the database is greater than the first threshold. The first threshold can be a value set by the staff based on experience, and this disclosure does not specifically limit this.

[0039] If the execution entity determines, after comparison, that the amount of data in the database is greater than a first threshold, it determines that the database needs to be expanded, triggers a database pre-expansion operation, analyzes traffic information from multiple proxy clusters, and selects a proxy cluster with a smaller load from the multiple proxy clusters to manage the database expansion. After the execution entity determines the proxy cluster, it obtains data stored in the database after the current moment through the proxy cluster, identifies this data as the first incremental data of the database, and simultaneously obtains metadata corresponding to the first incremental data while storing the first incremental data in the database. The metadata of the first incremental data can then be assembled into a metadata list.

[0040] In this implementation, the accuracy of database management is improved by judging the amount of data in the database at the current moment to determine whether the database needs to be expanded, and a proxy cluster with a smaller load is used to perform expansion management. While ensuring database expansion, the database can provide services normally to the outside world, reducing business impact, and can perform database expansion management without perception.

[0041] Step 220: Based on the first incremental data, determine whether the database meets the expansion conditions.

[0042] In this step, after the above-mentioned execution entity obtains the first incremental data, it can obtain the time interval corresponding to the first incremental data. The time interval can be the time period during which the first incremental data remains within the preset data range. The preset data range can be the data volume interval of the first incremental data set by the staff based on experience. It is determined whether the time interval corresponding to the first incremental data exceeds the preset time threshold to determine whether the database meets the expansion conditions.

[0043] If the time interval of the first incremental data exceeds the preset time threshold, it indicates that the first incremental data of the database remains within the preset data range for a period of time, and it is determined that the database meets the expansion conditions; if the time interval of the first incremental data does not exceed the preset time threshold, it indicates that the first incremental data of the database fluctuates for a period of time, and it is determined that the database does not meet the expansion conditions.

[0044] Step 230 : In response to determining that the database meets the expansion condition, the first incremental data is verified according to the meta-information list to obtain verified incremental data.

[0045] In this step, the above-mentioned execution entity determines that the database meets the expansion conditions after judgment, and then reads the stored data in the database according to each piece of metadata in the metadata list corresponding to the first incremental data to find out whether there is stored data corresponding to the metadata, so as to realize data verification of the first incremental data according to the metadata list and the stored data in the database. If so, the stored data corresponding to the metadata is determined as the verified incremental data.

[0046] As an optional implementation, the aforementioned expansion condition may include that the data volume of the first incremental data is greater than a second threshold. Furthermore, the aforementioned step 230, in response to determining that the database meets the expansion condition, performing data verification on the first incremental data according to the metadata list to obtain verified incremental data, may include the following steps: in response to determining that the data volume of the first incremental data is greater than the second threshold, obtaining corresponding target data from the stored data in the database according to the metadata list of the first incremental data; and performing data verification on the target data based on the physical node information to obtain verified incremental data.

[0047] Specifically, the above-mentioned execution subject can obtain the data volume corresponding to the first incremental data, and determine whether the data volume of the first incremental data is greater than a second threshold value. The second threshold value can be a value set by the staff based on experience to determine whether the database meets the expansion conditions. After the above-mentioned execution subject determines that the data volume of the first incremental data is greater than the second threshold value, it can read the stored data in the database according to each piece of metadata in the metadata list corresponding to the first incremental data to find out whether there is stored data corresponding to the metadata. If so, the stored data corresponding to the metadata is determined as the corresponding target data. The above-mentioned execution subject can further perform data verification on the acquired target data based on the physical node information, perform a double check on the target data, and determine whether the target data is accurate to obtain the verified incremental data.

[0048] In this implementation, the first incremental data is verified twice according to the meta-information list and the physical node information to ensure the accuracy of the first incremental data, thereby improving the accuracy of the data verification and making the verified incremental data more accurate.

[0049] Step 240: Based on the new database and the database, migrate the verified incremental data to complete the database expansion management.

[0050] In this step, after the above-mentioned execution entity obtains the verified incremental data, it can obtain a new database, and based on the new database and the existing database, determine the database in which the verified incremental data needs to be stored, and perform data migration on the verified incremental data, thereby completing the database expansion management.

[0051] The embodiment of the present disclosure provides a database management method, in which the execution subject first obtains the first incremental data of the database and the metadata list of the first incremental data based on the current moment, and then determines whether the database meets the expansion conditions based on the first incremental data. After that, in response to determining that the database meets the expansion conditions, the first incremental data is verified according to the metadata list to obtain the verified incremental data. Finally, based on the new database and the database, the verified incremental data is migrated to complete the expansion management of the database. When the database meets the expansion conditions, the first incremental data can be verified to improve the accuracy of the incremental data, and data migration can be performed based on the verified incremental data to complete the expansion management of the database. The first incremental data can be expanded in seconds, and accurate and fast migration of incremental data is achieved without affecting data storage, thereby achieving imperceptible expansion of the database without database downtime, thereby improving the flexibility and accuracy of database management.

[0052] 3 , which shows a flowchart 300 of an embodiment of performing data migration on verified incremental data, i.e., step 230 above, in response to determining that the database meets the expansion conditions, performing data verification on the first incremental data according to the metadata list to obtain the verified incremental data may include the following steps:

[0053] Step 310 : In response to obtaining the verified incremental data, sending database expansion information to the client, so that the client presents the database expansion information.

[0054] In this step, after obtaining the verified incremental data, the execution entity can generate database expansion information indicating that the database is under high data pressure and requires database expansion. This information is then sent to the client via an alert method such as email or phone call, so that the client can see the database expansion information. After viewing the database expansion information through the client, the staff member enters a confirmation operation for the database expansion on the client. The client then generates a database expansion instruction based on the confirmation operation and sends the database expansion instruction to the execution entity.

[0055] Step 320: In response to receiving the database expansion instruction returned by the client, a new database is obtained.

[0056] In this step, after receiving the database expansion instruction returned by the client, the execution entity may obtain a new database according to the database expansion instruction.

[0057] Step 330: Based on the new database and the database, migrate the verified incremental data to complete the database expansion management.

[0058] In this step, after the above-mentioned execution entity obtains the new data, it determines the database where the verified incremental data needs to be stored based on the new database and the existing database, and migrates the verified incremental data to complete the database expansion management.

[0059] In this embodiment, by sending database expansion information to the client, a new database is obtained according to the database expansion instruction returned by the client, which requires further confirmation by the staff, thereby improving the security of database expansion.

[0060] 4 , which shows a flowchart 400 of an embodiment for completing database expansion management, that is, step 330 described above, performing data migration on the verified incremental data based on the new database and the database to complete database expansion management, may include the following steps:

[0061] Step 410: Determine new data storage rules based on the new database and database.

[0062] In this step, after the execution entity obtains the new database and databases, it can determine new data storage rules based on the new database and the multiple databases. The new storage rules may include the correspondence between data numbers and databases, or a hash algorithm for determining the data storage location, etc. In other words, when only the database existed, the data could be stored directly according to the original data storage rules. Now that the new database has been added, new data storage rules need to be redefined to ensure that the data can be stored in the database and the new database.

[0063] Step 420 : Based on the new data storage rule, determine the data to be migrated from the verified incremental data.

[0064] In this step, after the above-mentioned execution entity determines the new data storage rules, it can calculate the verified incremental data according to the new data storage rules, determine the storage location of each verified incremental data, and determine the data that needs to be stored in the new database from the verified incremental data, and determine the data as the data to be migrated.

[0065] Step 430: Store the data to be migrated in the new database, and delete the data to be migrated in the database.

[0066] In this step, after the execution entity determines the data to be migrated, it may store the data to be migrated in the new database. After determining that the data to be migrated has been stored in the new database, the data to be migrated stored in the database is deleted.

[0067] In this embodiment, new data storage rules are determined based on the new database and database so that the verified incremental data can be stored according to the new data storage rules, thereby completing data migration and database expansion without affecting database services.

[0068] As an optional implementation, the above database management method may further include the following steps: in response to receiving the data to be stored, based on the new data storage rules, determining the target database corresponding to the data to be stored from the new database and the database; and storing the data to be stored in the target database.

[0069] Specifically, the above-mentioned execution entity can continue to receive the data to be stored, which can be the data received during the data migration process, or the data received after the database expansion management is completed. That is, the data to be stored can be calculated according to the new data storage rules, and the target database where the data to be stored needs to be stored can be determined, and the data to be stored can be stored in the target database.

[0070] In this implementation, by storing the received data to be stored based on the new data storage rule, the data to be stored can be stored in a timely manner, thereby improving the flexibility and timeliness of data storage.

[0071] As an optional implementation, the above-mentioned database management method may further include the following steps: migrating the existing data in the database based on the new data storage rules; in response to determining that the data migration of the existing data in the database is completed, deleting the existing data based on the current storage location of the existing data.

[0072] Specifically, after the above-mentioned execution subject determines the new data storage rules, it can calculate the existing data in the database according to the new data storage rules to determine the storage location corresponding to the existing data. If it is determined that a certain part of the existing data needs to be stored in the new database, the part of the existing data can be migrated to the new database, and the above-mentioned execution subject can use asynchronous tasks to migrate the existing data, and the asynchronous tasks can limit the flow according to the current traffic conditions. After the above-mentioned execution subject determines that the data migration of the existing data in the database is completed, the existing data in the database that has been migrated to the new database can be deleted to release database resources.

[0073] In this implementation, the existing data is migrated through asynchronous tasks. The asynchronous tasks can limit the flow according to the current traffic conditions. Before the asynchronous tasks are completed, there will be no significant perception of the existing business. The data migration of the existing data can be completed accurately and imperceptibly, realizing the imperceptible expansion of the database.

[0074] As an optional implementation, the above database management method may further include the following steps: in response to receiving a data access request for target data, determining a storage database for the target data; and performing data access on the target data based on the storage database.

[0075] Specifically, if the execution entity receives a data access request during the data migration process, it can obtain the timestamp of the target data and determine the stage at which the target data was stored based on the timestamp. Furthermore, the target data's storage database can be determined based on the timestamp. If the target data's storage database is determined to be an existing database, the data access request can be sent to the database corresponding to the target data in accordance with the previously established data access rules to access the target data.

[0076] If the execution entity receives a data access request after completing database expansion management, it can determine the target data's storage database based on the new data access rules. If the target data's storage database is determined to be an existing database, the data access request is sent to the database corresponding to the target data to access the target data. If the target data's storage database is determined to be a new database, the data access request is sent to the database corresponding to the target data to access the target data.

[0077] In this implementation, different data access operations can be performed according to data access requests received at different stages, thereby improving the targetedness of data access. In addition, different data access rules can be used to access data according to data access requests at different stages, thereby improving the accuracy of data access.

[0078] 5 , which shows a flowchart 500 of an embodiment for completing database shrinkage management, the above database management method may further include the following steps:

[0079] Step 510: Determine whether the amount of data in the database is lower than a third threshold.

[0080] In this step, the execution entity may obtain the data volume corresponding to the database at the current moment. The data volume may include information representing the amount of data stored in the database, and may also include information representing the utilization rate of database resources, such as CPU usage. The data volume may also include other information representing the proportion of data in the database, and this disclosure does not specifically limit this. The execution entity may compare the data volume of the database with a third threshold to determine whether the data volume of the database is lower than the third threshold. The third threshold may be a value set by the staff based on experience, and this disclosure does not specifically limit this.

[0081] Step 520: In response to determining that the amount of data in the database is lower than the third threshold, obtain second incremental data corresponding to the database.

[0082] In this step, if the execution entity determines that the amount of data in the database is lower than the third threshold, it can obtain the data stored in the database after the current moment based on the current moment and determine the data as the second incremental data of the database.

[0083] Step 530 : In response to determining that the second incremental data is less than the fourth threshold, a scaling operation is performed on the database, and data migration is performed on the database to complete scaling management of the database.

[0084] In this step, the above-mentioned execution entity can obtain the data volume corresponding to the second incremental data, and determine whether the data volume of the second incremental data is less than the fourth threshold. The fourth threshold can be a value set by the staff based on experience to determine whether the database meets the reduction conditions.

[0085] If the execution entity determines that the amount of the second incremental data is less than the fourth threshold value, the database can be scaled down and data can be migrated to complete the database scale-down management.

[0086] In this embodiment, the amount of data in the database is judged to determine whether the database meets the shrinking conditions, and when the second incremental data is less than the fourth threshold, it is determined that the amount of data in the database is continuously low, and then the database is shrunk, thereby improving the accuracy of the database shrinking process, preventing rapid shrinkage, and improving the user experience.

[0087] 6 , which shows a flowchart 600 of an embodiment of managing the expansion or contraction of a database, the above database management method may further include the following steps:

[0088] Step 610 : predicting the data storage status of the database based on the historical storage data of the database.

[0089] In this step, the above-mentioned execution entity can obtain the historical storage data corresponding to the database through network reading and other methods, and perform data analysis on the historical storage data. As an example, a normal distribution model is established based on the historical storage data to predict the data storage volume corresponding to each time point in the database, and the data storage volume corresponding to each time point in the database is determined as the data storage status corresponding to the database.

[0090] Step 620: Based on the data storage status, perform capacity expansion management or capacity reduction management on the database.

[0091] In this step, the execution entity determines the peak data storage capacity of the database according to the data storage status in the database, and performs expansion or contraction management on the database before the time point of the peak data storage capacity.

[0092] In this embodiment, the data storage capacity peak of the database is predicted by historical storage data, and the database is expanded or reduced in advance according to the peak value, thereby improving the flexibility and accuracy of database management.

[0093] 7 , as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a database management device, which corresponds to the method embodiment shown in FIG2 .

[0094] As shown in FIG. 7 , the database management device 700 of this embodiment may include: an acquisition module 710 , a determination module 720 , a verification module 730 , and a capacity expansion module 740 .

[0095] The acquisition module 710 is configured to acquire the first incremental data and the metadata list of the first incremental data from the database based on the current moment;

[0096] The judgment module 720 is configured to judge whether the database meets the expansion condition based on the first incremental data;

[0097] The verification module 730 is configured to, in response to determining that the database meets the expansion condition, perform data verification on the first incremental data according to the meta-information list to obtain verified incremental data;

[0098] The capacity expansion module 740 is configured to perform data migration on the verified incremental data based on the new database and the database to complete the capacity expansion management of the database.

[0099] In some optional implementations of the present embodiment, the acquisition module 710 is further configured to: determine whether the amount of data in the database is greater than a first threshold based on the current moment; in response to determining that the amount of data in the database is greater than the first threshold, obtain the first incremental data corresponding to the database based on the current moment, and obtain a metadata list corresponding to the first incremental data.

[0100] In some optional implementations of the present embodiment, the expansion condition includes that the data volume of the first incremental data is greater than the second threshold; and the verification module 730 is further configured to: in response to determining that the data volume of the first incremental data is greater than the second threshold, obtain the corresponding target data from the storage data of the database according to the metadata list of the first incremental data; perform data verification on the target data based on the physical node information to obtain the verified incremental data.

[0101] In some optional implementations of the present embodiment, the expansion module 740 is further configured to: in response to obtaining the verified incremental data, send database expansion information to the client so that the client presents the database expansion information; in response to receiving the database expansion instruction returned by the client, obtain a new database; based on the new database and the database, migrate the verified incremental data to complete the database expansion management.

[0102] In some optional implementations of this embodiment, the expansion module 740 is further configured to: determine new data storage rules based on the new database and database; determine the data to be migrated from the verified incremental data based on the new data storage rules; store the data to be migrated in the new database, and delete the data to be migrated in the database.

[0103] In some optional implementations of this embodiment, the device also includes: a determination module, configured to: in response to receiving the data to be stored, determine the target database corresponding to the data to be stored from the new database and the database based on the new data storage rules; a storage module, configured to: store the data to be stored in the target database.

[0104] In some optional implementations of this embodiment, the device also includes: a deletion module; the deletion module is configured to: migrate the existing data in the database based on the new data storage rules; in response to determining that the data migration of the existing data in the database is completed, delete the existing data based on the current storage location of the existing data.

[0105] In some optional implementations of this embodiment, the device also includes: a scaling module; a judgment module 720, further configured to: judge whether the data volume of the database is lower than a third threshold; an acquisition module 710, further configured to: in response to determining that the data volume of the database is lower than the third threshold, obtain the second incremental data corresponding to the database; the scaling module is configured to: in response to determining that the second incremental data is less than a fourth threshold, scale down the database, and migrate data on the database to complete the scaling management of the database.

[0106] In some optional implementations of this embodiment, the device also includes: a prediction module; the prediction module is configured to: predict the data storage status corresponding to the database based on the historical storage data corresponding to the database; and perform expansion or contraction management on the database based on the data storage status.

[0107] The above-mentioned embodiments of the present disclosure provide a database management device, in which the above-mentioned execution subject first obtains the first incremental data of the database and the metadata list of the first incremental data based on the current moment, and then determines whether the database meets the expansion conditions based on the first incremental data. After that, in response to determining that the database meets the expansion conditions, the first incremental data is verified according to the metadata list to obtain the verified incremental data. Finally, based on the new database and the database, the verified incremental data is migrated to complete the expansion management of the database. When the database meets the expansion conditions, the first incremental data can be verified to improve the accuracy of the incremental data, and data migration can be performed based on the verified incremental data to complete the expansion management of the database. The first incremental data can be expanded in seconds, and accurate and fast migration of incremental data is achieved without affecting data storage, thereby achieving imperceptible expansion of the database without database downtime, thereby improving the flexibility and accuracy of database management.

[0108] Those skilled in the art will appreciate that the above-mentioned apparatus also includes some other well-known structures, such as a processor, a memory, etc. In order to unnecessarily obscure the embodiments of the present disclosure, these well-known structures are not shown in FIG. 7 .

[0109] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, and storage of user personal information involved in the technical solutions disclosed herein all comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken with respect to user personal information to prevent unauthorized access to user personal information data and to safeguard the security of user personal information, network security, and national security.

[0110] Reference is now made to FIG8 , which illustrates a schematic diagram of the structure of an electronic device 800 suitable for implementing an embodiment of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as smart screens, laptop computers, PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and the like, as well as fixed terminals such as digital TVs and desktop computers. The terminal device shown in FIG8 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.

[0111] As shown in Figure 8, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. Various programs and data required for the operation of the electronic device 800 are also stored in the RAM 803. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0112] Typically, the following devices can be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 can allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although FIG8 shows an electronic device 800 with various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or provided alternatively. Each box shown in FIG8 may represent one device, or may represent multiple devices as needed.

[0113] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed. It should be noted that the computer-readable medium of the embodiment of the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including, but not limited to, an electromagnetic signal, an optical signal, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wire, optical cable, RF (radio frequency), etc., or any suitable combination thereof.

[0114] Computer program code for performing the operations of embodiments of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0115] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0116] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. The units described may also be provided in a processor. For example, it may be described as follows: a processor includes an acquisition module, a judgment module, a verification module, and an expansion module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.

[0117] As another aspect, the present disclosure further provides a computer-readable medium, which may be included in the electronic device; or may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: based on the current moment, obtains the first incremental data of the database and the metadata list of the first incremental data; based on the first incremental data, determines whether the database meets the expansion conditions; in response to determining that the database meets the expansion conditions, performs data verification on the first incremental data according to the metadata list to obtain the verified incremental data; based on the new database and the database, performs data migration on the verified incremental data to complete the expansion management of the database.

[0118] The above description is merely a preferred embodiment of the present disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also encompass other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned inventive concept. For example, a technical solution formed by mutually replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.

Claims

1. A database management method, the method comprising: Based on the current moment, obtaining first incremental data of the database and a meta information list of the first incremental data; Based on the first incremental data, determining whether the database meets the expansion condition; In response to determining that the database meets the expansion condition, performing data verification on the first incremental data according to the meta information list to obtain verified incremental data; Based on the new database and the database, data migration is performed on the verified incremental data to complete the database expansion management.

2. The method according to claim 1, wherein: The acquiring, based on the current moment, first incremental data of the database and a list of meta information of the first incremental data includes: Based on the current moment, determining whether the amount of data in the database is greater than a first threshold; In response to determining that the amount of data in the database is greater than the first threshold, based on the current moment, first incremental data corresponding to the database is obtained, and a meta information list corresponding to the first incremental data is obtained.

3. The method according to claim 1, wherein: The capacity expansion condition includes that the amount of the first incremental data is greater than a second threshold; and In response to determining that the database meets the expansion condition, performing data verification on the first incremental data according to the meta information list to obtain verified incremental data includes: In response to determining that the data volume of the first incremental data is greater than the second threshold, acquiring corresponding target data from the stored data of the database according to the meta information list of the first incremental data; The target data is verified based on the physical node information to obtain verified incremental data.

4. The method according to claim 1, wherein: The step of performing data migration on the verified incremental data based on the new database and the database to complete the database expansion management includes: In response to obtaining the verified incremental data, the database expansion information is sent to the client. So that the client presents the database expansion information; In response to receiving the database expansion instruction returned by the client, obtaining a new database; Based on the new database and the database, data migration is performed on the verified incremental data to complete the database expansion management.

5. The method according to claim 4, wherein: The step of performing data migration on the verified incremental data based on the new database and the database to complete the database expansion management includes: Based on the new database and the database, determining a new data storage rule; Based on the new data storage rule, determining the data to be migrated from the verified incremental data; The data to be migrated is stored in the new database, and the data to be migrated in the database is deleted.

6. The method according to claim 5, further comprising: In response to receiving the data to be stored, determining a target database corresponding to the data to be stored from the new database and the database based on the new data storage rule; The data to be stored is stored in the target database.

7. The method according to any one of claims 5 or 6, further comprising: Based on the new data storage rule, migrate the existing data in the database; In response to determining that the stock data in the database has completed data migration, the stock data is deleted based on the current storage location of the stock data.

8. The method according to any one of claims 1 to 6, further comprising: Determining whether the amount of data in the database is lower than a third threshold; In response to determining that the amount of data in the database is lower than the third threshold, acquiring second incremental data corresponding to the database; In response to determining that the second incremental data is less than a fourth threshold, a scaling-down operation is performed on the database, and data migration is performed on the database to complete scaling-down management of the database.

9. The method according to claim 8, further comprising: Based on the historical storage data corresponding to the database, predicting the data storage status corresponding to the database; Based on the data storage status, the database is managed for expansion or reduction.

10. A database management device, comprising: An acquisition module, configured to acquire first incremental data of a database and a meta information list of the first incremental data based on a current moment; a judgment module, configured to judge whether the database meets the expansion condition based on the first incremental data; a verification module configured to, in response to determining that the database meets the expansion condition, perform data verification on the first incremental data according to the meta information list to obtain verified incremental data; The capacity expansion module is configured to perform data migration on the verified incremental data based on the new database and the database to complete the capacity expansion management of the database.

11. The device according to claim 10, further comprising: Shrink module; The determination module is further configured to: determine whether the amount of data in the database is lower than a third threshold; The acquisition module is further configured to: in response to determining that the amount of data in the database is lower than the third threshold, acquire second incremental data corresponding to the database; The shrinking module is configured to: in response to determining that the second incremental data is less than a fourth threshold, shrink the database, migrate data on the database, and complete the shrinking management of the database.

12. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method according to any one of claims 1 to 9.

13. A non-transitory computer readable medium having a computer program stored thereon, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

14. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Database management method and device

    CN117076422A

  • Data migration system and method

    CN107122355A

  • Data migration system and method

    CN107122360A

  • Database cluster capacity expansion method and device, computer equipment and storage medium

    CN115221156A

  • Intelligent data migration method and device based on big data

    CN116431564A

Cited By

  • MySQL table partition management method and device and medium

    CN120631890A

  • A MySQL table partition management method, device and medium

    CN120631890B