Space partitioning method for database table, device and storage medium
Disclosed is a space partitioning method for a database table, including: determining a first data amount within a first time period and a second data amount within a second time period of the database table; calling a target network model, inputting the first data amount and the second data amount into the target network model, and outputting a third data amount within the target time period, wherein the target network model is configured to predict a data amount of a next time period based on data amounts of a previous time period and a current time period; and determining a number of target regions based on the third data amount within the target time period, and partitioning, based on the number of target regions, a space in the database table configured to store the data to be stored.
1 . A space partitioning method for a database table, comprising:
acquiring a plurality of groups of data by partitioning, based on a time stamp of data in the database table, the data in the database table according to a predetermined period length, wherein each group of data corresponds to one partitioning region;
partitioning each partitioning region again to acquire a plurality of sub-regions corresponding to each partitioning region, wherein a number of the plurality of sub-regions corresponding to each partitioning region is as same as that of storage nodes in a database, and each of the plurality of sub-regions is distributed to each of the storage nodes in the database;
determining a first data amount within a first time period and a second data amount within a second time period of the database table by counting a data amount in the first time period and counting a data amount in the second time period from the plurality of groups of data, wherein the first time period and the second time period are prior to a target time period corresponding to data to be stored, the first time period and the second time period are adjacent ones, and the first time period is a previous time period of the target time period;
calling a target network model, inputting the first data amount and the second data amount into the target network model, and outputting a third data amount within the target time period, wherein the target network model is configured to predict a data amount of a next time period based on a data amount of the previous time period and a data amount of a current time period; and
determining a number of regions into which space configured to store data to be stored in the database table is to be partitioned, based on the third data amount within the target time period, and partitioning, based on the number of the regions, the space.
2 . The method according to claim 1 , wherein determining the number of regions based on the third data amount within the target time period comprises:
determining the number of regions by formula:
k
=
⌈
n
m
⌉
based on the third data amount within the target time period;
wherein k is the number of regions, n is the third data amount within the target time period, m indicates a maximum storage capacity of a single area, and “┌ ┐” represents a rounding-up operation.
3 . The method according to claim 1 , wherein the target network model is obtained by training a neural network model based on a data amount within a plurality of time periods and a data amount of one time period upon elapse of each of the plurality of time periods.
4 . A space partitioning device for a database table, comprising:
a processor and a memory configured to store a computer program, wherein the processor, when running the computer program, is caused to perform a space partitioning method for a database table comprising:
acquiring a plurality of groups of data by partitioning, based on a time stamp of data in the database table, the data in the database table according to a predetermined period length, wherein each group of data corresponds to one partitioning region;
partitioning each partitioning region again to acquire a plurality of sub-regions corresponding to each partitioning region, wherein a number of the plurality of sub-regions corresponding to each partitioning region is as same as that of storage nodes in a database, and each of the plurality of sub-regions is distributed to each of the storage nodes in the database;
determining a first data amount within a first time period and a second data amount within a second time period of the database table by counting a data amount in the first time period and counting a data amount in the second time period from the plurality of groups of data, wherein the first time period and the second time period are prior to a target time period corresponding to data to be stored, the first time period and the second time period are adjacent ones, and the first time period is a previous time period of the target time period;
calling a target network model, inputting the first data amount and the second data amount into the target network model, and outputting a third data amount within the target time period, wherein the target network model is configured to predict a data amount of a next time period based on a data amount of the previous time period and a data amount of a current time period; and
determining a number of regions into which space configured to store data to be stored in the database table is to be partitioned, based on the third data amount within the target time period, and partitioning, based on the number of the regions, the space.
5 . The device according to claim 4 , wherein determining the number of regions based on the third data amount within the target time period comprises:
determining the number of regions by formula:
k
=
⌈
n
m
⌉
based on the third data amount within the target time period;
wherein k is the number of regions, n is the third data amount within the target time period, m indicates a maximum storage capacity of a single area, and “┌ ┐” represents a rounding-up operation.
6 . The device according to claim 4 , wherein the target network model is obtained by training a neural network model based on a data amount within a plurality of time periods and a data amount of one time period after each of the plurality of time periods.
7 . A non-transitory computer-readable storage medium storing instructions therein, wherein the instructions, when executed by a processor, causes the processor to perform a space partitioning method for a database table, comprising:
acquiring a plurality of groups of data by partitioning, based on a time stamp of data in the database table, the data in the database table according to a predetermined period length, wherein each group of data corresponds to one partitioning region;
partitioning each partitioning region again to acquire a plurality of sub-regions corresponding to each partitioning region, wherein a number of the plurality of sub-regions corresponding to each partitioning region is as same as that of storage nodes in a database, and each of the plurality of sub-regions is distributed to each of the storage nodes in the database;
determining a first data amount within a first time period and a second data amount within a second time period of the database table by counting a data amount in the first time period and counting a data amount in the second time period from the plurality of groups of data, wherein the first time period and the second time period are prior to a target time period corresponding to data to be stored, the first time period and the second time period are adjacent ones, and the first time period is a previous time period of the target time period;
calling a target network model, inputting the first data amount and the second data amount into the target network model, and outputting a third data amount within the target time period, wherein the target network model is configured to predict a data amount of a next time period based on a data amount of the previous time period and a data amount of a current time period; and
determining a number of regions into which space configured to store data to be stored in the database table is to be partitioned, based on the third data amount within the target time period, and partitioning, based on the number of the regions, the space.
8 . The non-transitory computer-readable storage medium according to claim 7 , wherein determining the number of regions based on the third data amount within the target time period comprises:
determining the number of regions by formula:
k
=
⌈
n
m
⌉
based on the third data amount within the target time period;
wherein k is the number of regions, n is the third data amount within the target time period, m indicates a maximum storage capacity of a single area, and “┌ ┐” represents a rounding-up operation.
9 . The non-transitory computer-readable storage medium according to claim 7 , wherein the target network model is obtained by training a neural network model based on a data amount within a plurality of time periods and a data amount of one time period upon elapse of each of the plurality of time periods.
10 . A computer device comprising a processor and a memory configured to store a computer program, wherein the processor, when running the computer program, is caused to perform a space partitioning method for a database table, comprising:
acquiring a plurality of groups of data by partitioning, based on a time stamp of data in the database table, the data in the database table according to a predetermined period length, wherein each group of data corresponds to one partitioning region;
partitioning each partitioning region again to acquire a plurality of sub-regions corresponding to each partitioning region, wherein a number of the plurality of sub-regions corresponding to each partitioning region is as same as that of storage nodes in a database, and each of the plurality of sub-regions is distributed to each of the storage nodes in the database;
determining a first data amount within a first time period and a second data amount within a second time period of the database table by counting a data amount in the first time period and counting a data amount in the second time period from the plurality of groups of data, wherein the first time period and the second time period are prior to a target time period corresponding to data to be stored, the first time period and the second time period are adjacent ones, and the first time period is a previous time period of the target time period;
calling a target network model, inputting the first data amount and the second data amount into the target network model, and outputting a third data amount within the target time period, wherein the target network model is configured to predict a data amount of a next time period based on a data amount of the previous time period and a data amount of a current time period; and
determining a number of regions into which space configured to store data to be stored in the database table is to be partitioned, based on the third data amount within the target time period, and partitioning, based on the number of the regions, the space.
11 . The computer device according to claim 10 , wherein determining the number of regions based on the third data amount within the target time period comprises:
determining the number of regions by formula:
k
=
⌈
n
m
⌉
based on the third data amount within the target time period;
wherein k is the number of regions, n is the third data amount within the target time period, m indicates a maximum storage capacity of a single area, and “| |” represents a rounding-up operation.
12 . The computer device according to claim 10 , wherein the target network model is obtained by training a neural network model based on a data amount within a plurality of time periods and a data amount of one time period upon elapse of each of the plurality of time periods.