WO2020135737A1 - 分区管理、数据存储和查询方法及装置、设备、介质 - Google Patents

分区管理、数据存储和查询方法及装置、设备、介质 Download PDF

Info

Publication number
WO2020135737A1
WO2020135737A1 PCT/CN2019/129277 CN2019129277W WO2020135737A1 WO 2020135737 A1 WO2020135737 A1 WO 2020135737A1 CN 2019129277 W CN2019129277 W CN 2019129277W WO 2020135737 A1 WO2020135737 A1 WO 2020135737A1
Authority
WO
WIPO (PCT)
Prior art keywords
partition
data
partition information
time interval
specified value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2019/129277
Other languages
English (en)
French (fr)
Inventor
李冰杰
王辉
徐志威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Publication of WO2020135737A1 publication Critical patent/WO2020135737A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Definitions

  • This application relates to the field of database technology, and in particular to a method, device, device, and medium for partition management, data storage, and query.
  • a distributed database such as HBase is the product of a combination of database technology and network technology.
  • a distributed database can include multiple partitions for distributed storage and load balancing, and data can be stored in the partitions.
  • partitions are created uniformly, and the partition numbers of all partitions are divided at the time of creation.
  • the partition number is the serial number of the corresponding partition.
  • all partition numbers are divided according to the total number of partitions. For example, there are 32 partitions.
  • the partition number includes 0 to 31.
  • the data obtained in a period of time may be distributed and stored in many partitions.
  • the data in all the partitions needs to be searched, resulting in low search efficiency.
  • this application provides a partition management, data storage and query method and device, equipment, and media.
  • the created partitions are divided according to time intervals.
  • data query only the partition corresponding to the time interval needs to be searched, which is helpful to improve the search. effectiveness.
  • a first aspect of the present application provides a partition management method, including: when a partition needs to be created, determine the number N of first partitions required to store data in a first time interval T1; the smaller time endpoint of T1 is later than Current time t0; create the N first partitions in the database, and record the T1 corresponding to the partition information of the first partition in a preset partition information table.
  • a second aspect of the present application provides a data storage method, including: acquiring a time stamp in first data to be stored; determining at least one corresponding to a time interval matching the time stamp from a preset partition information table Fourth partition information; the partition information table records the partition information of the created partition in the database and the corresponding time interval; the second partition for storing the first data is determined according to the fourth partition information, and The first data is stored in the second partition of the database.
  • a third aspect of the present application provides a data query method, including: acquiring query conditions required for querying second data; determining at least one target time interval T4 satisfying the query conditions from a preset partition information table, and determining The fifth partition information corresponding to the T4 in the partition information table; the partition information table records the partition information of the created partition in the database and the corresponding time interval; from the database corresponds to the fifth partition information Query the second data in the partition.
  • a fourth aspect of the present application provides a partition management device, including: a quantity determination module for determining the number N of first partitions required to store data in a first time interval T1 when a partition needs to be created; The smaller time endpoint is later than the current time t0; the partition creation module is used to create the N first partitions in the database, and record the T1 corresponding to the partition information of the first partition in a preset partition Information table.
  • a fifth aspect of the present application provides a data storage device, including: a time stamp acquisition module for acquiring a time stamp in first data to be stored; a first information determination module for determining from a preset partition information table Output at least one fourth partition information corresponding to the time interval matching the time stamp; the partition information table records the partition information of the created partition in the database and the corresponding time interval; the data storage module is used to The fourth partition information determines a second partition for storing the first data, and stores the first data in the second partition of the database.
  • a sixth aspect of the present application provides a data query device, including: a condition acquisition module for acquiring query conditions required for querying second data; a second information determination module for determining satisfaction from a preset partition information table At least one target time interval T4 of the query condition, and determine the fifth partition information corresponding to T4 in the partition information table; the partition information table records the partition information of the created partition in the database and the corresponding time interval A data query module for querying the second data from the partition of the database corresponding to the fifth partition information.
  • a seventh aspect of the present application provides an electronic device, including a processor and a memory; the memory stores a program that can be called by the processor; wherein, when the processor executes the program, the implementation is as described in the foregoing embodiment Partition management method, data storage method, or data query method.
  • An eighth aspect of the present application provides a machine-readable storage medium on which a program is stored.
  • a partition management method, a data storage method, or a data query method as described in the foregoing embodiment is implemented.
  • FIG. 1 is a schematic flowchart of a partition management method according to an embodiment of the present application
  • FIG. 2 is a structural block diagram of a partition management device according to an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a data storage method according to an embodiment of the present application.
  • FIG. 4 is a structural block diagram of a data storage device according to an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a data query method according to an embodiment of the present application.
  • FIG. 6 is a structural block diagram of a data query device according to an embodiment of the present application.
  • FIG. 7 is a structural block diagram of an electronic device according to an embodiment of the present application.
  • first, second, third, etc. may be used in this application to describe various devices, this information should not be limited to these terms. These terms are only used to distinguish devices of the same type from each other.
  • the first device may also be referred to as the second device, and similarly, the second device may also be referred to as the first device.
  • the word "if” as used herein may be interpreted as "when” or “when” or “in response to a determination”.
  • HBase HadoopDatabase is a high-reliability, high-performance, column-oriented, and scalable distributed storage system. HBase technology can be used to build large-scale structured storage clusters on physical machines.
  • the first aspect of the present application provides a partition management method.
  • the following describes the partition management method of the embodiment of the present application in more detail, but it should not be limited to this.
  • a partition management method according to an embodiment of the present application is shown, including the following steps:
  • S200 Create the N first partitions in the database, and record the T1 corresponding to the partition information of the first partition in a preset partition information table.
  • the partition management method of the embodiment of the present application may be applied to electronic devices, and the electronic devices may be computer devices and the like.
  • the database is a distributed database, including but not limited to HBase.
  • the partition created by the electronic device may be on the electronic device or on other devices, as long as it is in the database.
  • the electronic device may be a physical machine where the partition service node HregionServer in the HBase cluster is located, or a physical machine where the management node Hmaster is located.
  • HRegionServer can serve multiple partition regions; HMaster manages the load balancing of HRegionServer and adjusts the distribution of partitions.
  • step S100 when a partition needs to be created, the number N of first partitions required to store data in the first time interval T1 is determined.
  • One way to determine that a partition needs to be created is, for example, when a first instruction to create a first partition is received, it is determined that the first partition needs to be created.
  • the first instruction may be triggered regularly in the electronic device, and it is triggered every other time, for example, the first instruction may be triggered every other month (the interval may also be a day or a few days, etc., the specific time is not limited) . In this way, you can periodically create new partitions for new data.
  • the first command may also be input from outside, and the specific is not limited.
  • the N may be a fixed value, that is, the number of first partitions created each time is the same; or, the N may be variable, and the number of first partitions created each time may be determined according to needs. It can be understood that N is greater than or equal to 1.
  • step S200 when the partition is created for the first time, a set number of partitions can be created to meet the data storage needs within a certain period of time; when the partition is subsequently created, it can be determined according to the amount of data stored in the created partition in the database N, of course, the way of determining N is not limited to this.
  • the N first partitions are created in the database, and the T1 and the partition information of the first partition are recorded in a preset partition information table correspondingly.
  • Each first partition has corresponding partition information.
  • the partition information of the first partition may include, for example, the start row position information and the end row position information of the first partition in the database.
  • the partition information can be found in the database corresponding to the first partition.
  • the partition information of the N first partitions created this time corresponds to T1. If the N of the first partition created each time is different, the partition information of the first partition corresponding to T1 of the first partition created each time is also different.
  • the size of each first partition may be the same or of course different.
  • the smaller time endpoint of T1 is later than the current time t0, which can be the time of the system clock of the device when the first partition needs to be created, thus it can be stated that any time in T1 is a future time.
  • the first partition created is used to store data obtained in the future.
  • the data can be obtained from many data sources, such as KafKa, Flume, Twitter, ZeroMQ, Kinesis, TCP sockets and other data sources, of course, other data sources, as long as the data has a time stamp.
  • the data is time-series data, that is, data having a time column and recorded in chronological order. In this way, when storing data in the first partition, a matching time interval can be found according to the time stamp in the data, so that the first partition for storing the data can be determined according to the partition information corresponding to the matching time interval.
  • T1 corresponds to the partition information of the N first partitions currently created in the partition information table, so that when you need to find the data in the first partition, you can first determine T1 in the partition information table, according to the found T1
  • the corresponding partition information finds the first partition in the database, and then finds the required data from the first partition.
  • the created partitions are divided according to time intervals.
  • the time interval is recorded in the partition information table corresponding to the partition information of the partition required to store the data in the time interval; when the data is subsequently stored, the data within a period of time can be stored collectively in several time intervals.
  • partitions when querying data, it is not necessary to search for data within a period of time in all partitions, only need to find the partition corresponding to the time interval, which can reduce the amount of data to be searched, which is conducive to improving search efficiency.
  • partition management method In addition, in the related partition management method, once a partition is created, a new partition cannot be dynamically created subsequently. As a result, after a certain amount of data is stored in the partition, it can only be split through the partition, that is, a partition is split into multiple Partitioning to increase the number of partitions.
  • partitioning brings pressure on HBase services and affects application usage. At the same time, as partitions are split, more partitions need to be searched during data query, which causes a greater burden on the query.
  • a new partition may be created according to the number of partitions required to store data in a period of time in the future.
  • partitions can be created dynamically as needed, without partition splitting to increase partitions, thereby reducing the pressure on HBase services, and avoiding the problem of large search burden caused by too many partitions.
  • the above partition management method may be executed by a partition management device.
  • the partition management device 100 includes two modules: a number determination module 101 and a partition creation module 102.
  • the quantity determination module 101 is used to perform the above step S100
  • the partition creation module 102 is used to perform the above step S200.
  • step S100 determining the number N of first partitions required to store data in the first time interval T1 includes the following steps:
  • S101 Determine the first partition information corresponding to the second time interval T2 from the partition information table, and the larger time endpoint of T2 is not later than the t0;
  • S103 Determine the number of the first partition according to the total amount of data and the set storage capacity of a single partition.
  • step S101 first partition information corresponding to one or more second time intervals earlier than the current time may be found from the partition information table.
  • the larger time endpoint of T2 and the smaller time endpoint of T1 may be two adjacent times, for example, the larger time endpoint of T2 is 10:10 on December 6, 2018 10 Seconds, and the smaller time endpoint of T1 is 10:10:11 on December 6, 2018; or, the larger time endpoint of T2 and the smaller time endpoint of T1 may be the same, of course, in order to avoid the range of the time interval There is overlap, and the time interval may be a half-open half-closed interval, for example, T1 and T2 are both left-open and right-closed intervals.
  • step S101 the total amount of data stored in the partition corresponding to the first partition information corresponding to T2 can be reflected in the amount of data that needs to be stored per unit time, and thus can be used to evaluate the amount of data that needs to be stored in T1.
  • the number of first partitions to be created can be determined.
  • T2 may include multiple time intervals, so that there are multiple first partition information. Of course, T2 may also include only one time interval.
  • the ratio of the duration of T2 and T1 can be calculated first, and then the total data stored in the partition corresponding to all the determined first partition information and the The ratio of the duration ratio determines the ratio as the amount of data to be stored in T1, so that the number of the first partition can be determined; if the duration of T2 is as large as the duration of T1, all partitions corresponding to the first partition information The total amount of stored data is determined as the amount of data to be stored in T1, so that the number of the first partition can be determined.
  • step S103 the number of the first partition can be calculated from the total amount of data and the storage capacity of a single partition, which can be calculated through a simple division operation.
  • the storage capacity of a single partition is, for example, 20GB.
  • the 20GB is a reasonable amount of data stored in a partition in HBase.
  • the actual amount of data that can be stored in a partition can exceed 20GB.
  • the storage capacity of a single partition is not limited, and can be determined according to the actual situation.
  • the number of partitions required is determined by the number of servers, and is generally an integer multiple of the server.
  • the total amount of data required to be stored cannot be predetermined, and the amount of data may be more or less.
  • the amount of data that can be stored in a single partition is small, which increases the burden of HBase services; while the total amount of data to be stored is large and the server.
  • the number is small, there are too few partitions, and the amount of data that can be stored in a single partition is too large, which is inconvenient for querying and using data.
  • partitions can be created over time, and the number of partitions required in the future can be estimated based on the amount of data stored in existing partitions, and new partitions can be flexibly created in HBase, so that flexibility and Expandability is higher.
  • determining the number of the first partition according to the total amount of data and the set storage volume of a single partition includes the following steps: calculating the total data and the set storage of the single partition The ratio of the quantity; round up the ratio, and determine the value obtained by the rounding as the number of the first partition.
  • the method further includes the following steps:
  • S400 Delete a partition corresponding to the second partition information in the database, and delete an entry in the partition information table where the second partition information is located.
  • one way to determine that the partition needs to be deleted is, for example, when a second instruction indicating the deletion of the partition is received, it is determined that the partition needs to be deleted.
  • the second instruction may be triggered periodically in the electronic device, and the instruction may be triggered at intervals, for example, the second instruction may be triggered every month (the interval may also be a day or a few days, etc., the specific time is not limited ). In this way, you can periodically delete the partition you want to delete.
  • the second instruction can also be triggered externally, which is not limited in detail.
  • the set effective duration can be two years, then t1 is the time two years before the current time t0, that is, two years is the validity period of the data, and the partition corresponding to the second partition information stores the data two years ago, which is useful It is not big enough, you can delete these invalid data. For example, if t0 is 10:10:11 on December 6, 2018, data and partitions earlier than 10:10:11 on December 6, 2016 can be deleted.
  • the set effective duration can be determined according to needs.
  • step S400 the partition corresponding to the second partition information in the database is deleted, the data on the partition is also deleted, and at the same time, the entry where the second partition information is located in the partition information table is deleted to avoid partition information There are too many entries in the table.
  • partitions that store data earlier than the current time and set a valid duration can be deleted, so that each partition has a lifetime, and the partition will be deleted when the partition exceeds the lifetime, thereby achieving premature deletion Of invalid data and the purpose of freeing up storage space.
  • the method further includes the following steps:
  • a method for determining whether to delete a partition is determined, for example, when a third instruction indicating whether to delete a partition is received, it is determined whether to delete the partition.
  • the third instruction may be triggered regularly in the electronic device, and the instruction may be triggered at intervals, for example, the third instruction may be triggered every month (the interval may also be a day or a few days, etc., the specific time is not limited ). In this way, you can periodically check whether you need to delete the partition.
  • the third command can also be triggered externally, which is not limited.
  • the amount of data stored in the database can be limited, and when the set data amount is exceeded, the partition corresponding to the earliest time interval is deleted to free up storage space so that the amount of data stored in the database does not exceed the set data Data, so as to avoid the problem that new data cannot be stored due to the large amount of data stored in the database.
  • the second aspect of the present application provides a data storage method.
  • the data storage method according to an embodiment of the present application will be described in more detail below, but it should not be limited thereto.
  • a data storage method according to an embodiment of the present application is shown, including the following steps:
  • T100 Obtain the time stamp in the first data to be stored
  • T200 Determine at least one fourth partition information corresponding to the time interval matching the time stamp from the preset partition information table; the partition information table records the partition information of the created partition in the database and the corresponding Time interval
  • T300 Determine a second partition for storing the first data according to the fourth partition information, and store the first data in the second partition of the database.
  • the data storage method of the embodiment of the present application can also be applied to electronic devices.
  • the related content of the electronic device please refer to the content in the partition management method of the foregoing embodiment, which will not be repeated here.
  • the first data carries a time stamp
  • the first data may be time-series data, which is not limited in detail.
  • the time stamp in the first data is, for example, the time when the event associated with the first data occurs, and the data source carries the time stamp in the first data.
  • step T200 the time interval in the partition information table may be traversed to determine whether the time stamp matches the traversed time interval. If it matches, the partition information corresponding to the traversed time interval is the fourth partition information.
  • Determine whether the timestamp matches the traversed time interval for example: compare the timestamp with the smaller time endpoint of the time interval and the larger time endpoint, if the timestamp is greater than or equal to the smaller time endpoint and less than or equal to the larger time endpoint , It is determined that the time stamp matches the traversed time interval.
  • the partition information table records the partition information of the created partition in the database and the corresponding time interval, which can be implemented based on the partition management method of the foregoing embodiment.
  • the second partition required for storing the first data can be determined according to the determined fourth partition information, and the specific method for determining the second partition may depend on the amount of the determined fourth partition information.
  • the primary key may include a timestamp and a unique identifier of the first data.
  • the timestamp of different data may be the same, but the unique identifier can make the primary key of the data in the database unique, and the unique identifier can be randomly generated.
  • Each partition has corresponding partition information.
  • the partition information can include the start row position information and the end row position information of the partition in the database.
  • the specific is not limited, as long as the corresponding partition can be found in the database according to the partition information .
  • the partition information table records the partition information of the created partition in the database and the corresponding time interval.
  • the data within a period of time can be stored in the partitions corresponding to several time intervals; when querying the data, it is not necessary to search for the data within a period of time in all the partitions, only the partition corresponding to the corresponding time interval That is, the amount of data needed to be searched can be reduced, thereby improving search efficiency.
  • the above data storage method may be executed by a data storage device.
  • the data storage device 200 includes three modules: a time stamp acquisition module 201, a first information determination module 202, and a data storage module 203.
  • the time stamp acquisition module 201 is used to perform the above step T100
  • the first information determination module 202 is used to perform the above step T200
  • the data storage module 203 is used to perform the above step T300.
  • step T300 determining the second partition for storing the first data according to the fourth partition information includes:
  • T301 When a piece of fourth partition information is determined, determine the partition corresponding to the fourth partition information as the second partition;
  • T302 When at least two fourth partition information is determined, one fourth partition information is selected from all fourth partition information, and the partition corresponding to the selected fourth partition information is determined as the second partition.
  • a random selection method may be adopted, or the fourth partition information corresponding to the partition with the least stored data may be selected, which is not limited.
  • the data storage method in the embodiment of the present application can be implemented on the basis of the aforementioned partition management method in the embodiment of the present application. After the partition for storing data is initially created and the partition information table is recorded, the data can be stored. Over time, new partitions can be continuously created and premature partitions can be deleted to ensure sustainable data storage.
  • a third aspect of the present application provides a data query method.
  • the data query method in the embodiments of the present application will be described in more detail below, but it should not be limited to this.
  • a data query method according to an embodiment of the present application is shown, including the following steps:
  • U200 Determine at least one target time interval T4 satisfying the query condition from the preset partition information table, and determine the fifth partition information corresponding to the T4 in the partition information table; the partition information table records The partition information and corresponding time interval of the created partition in the database;
  • U300 query the second data from a partition of the database corresponding to the fifth partition information.
  • the data query method of the embodiment of the present application can also be applied to electronic devices.
  • the related content of the electronic device please refer to the content in the partition management method of the foregoing embodiment, which will not be repeated here.
  • the query condition may be externally input, and the specific format and content of the query condition are not limited, as long as the required target time interval can be found.
  • step U200 at least one T4 satisfying the query condition is determined from the partition information table according to the query conditions. Since the partition information table records the partition information of the created partition in the database and the corresponding time interval, it is determined At T4, the fifth partition information corresponding to T4 can be determined.
  • the fifth partition information may include one or more, and each fifth partition information corresponds to a different partition.
  • Each partition has corresponding partition information.
  • the partition information can include the start row position information and the end row position information of the partition in the database.
  • the specific is not limited, as long as the corresponding partition can be found in the database according to the partition information .
  • step U300 after determining the partition required for querying the second data, the second data can be queried from the partition of the database corresponding to the fifth partition information.
  • the partition information table records the partition information of the created partition in the database and the corresponding time interval.
  • the above data query method may be executed by a data query device.
  • the data query device 300 includes three modules: a condition acquisition module 301, a second information determination module 302, and a data query module 303.
  • the condition acquisition module 301 is used to perform the above step U100
  • the second information determination module 302 is used to perform the above step U200
  • the data query module 303 is used to perform the above step U300.
  • the query condition includes a first specified value and a second specified value, the first specified value is less than the second specified value;
  • step U300 querying the second data from the partition of the database corresponding to the fifth partition information includes the following steps:
  • U301 Traverse the data in the partition corresponding to the fifth partition information, and determine whether the timestamp in the traversed data is greater than or equal to the first specified value and less than or equal to the second specified value;
  • the partitions that may have the required data are determined. After the partitions to be searched are determined, the required time can be accurately found from these partitions according to the query conditions.
  • the second data in the segment realizes the secondary filtering of the data.
  • the query condition includes a first specified value and a second specified value, the first specified value is less than the second specified value;
  • step U200 determining at least one target time interval T4 satisfying the query condition from the preset partition information table includes the following steps:
  • U202 For the traversed time interval, when the first specified value is greater than or equal to the minimum time stamp of the time interval and less than or equal to the maximum time stamp of the time interval, or when the second specified value is greater than or equal to the minimum time stamp of the time interval and Less than or equal to the maximum time stamp of the time interval, or when the first specified value is less than the minimum time stamp of the time interval and the second specified value is greater than the maximum time stamp of the time interval, the time interval is determined as the T4.
  • the above query method can ensure that all or part of the time range between the first specified value and the second specified value of the search condition is queried, and also avoid too many time intervals from being queried, thereby ensuring the search Full rate and query speed.
  • the smaller time endpoint is 20180715181001.100
  • the larger time endpoint is 20180715184001.100
  • the first specified value is 20180715180501.100
  • the second specified value is 20180715183501.100
  • 20180715183501.100 is greater than the smaller time endpoint and Less than the larger time endpoint, so the time interval is T4.
  • the data query method in the embodiment of the present application may be implemented based on the foregoing partition management method and data storage method in the embodiment of the present application.
  • the partition for storing data is initially created, the partition information table is recorded, and the data is stored. After that, you can use the above method for data query.
  • a fourth aspect of the present application provides a partition management device.
  • the partition management device 100 includes:
  • the quantity determination module 101 is used to determine the number N of the first partitions needed to store data in the first time interval T1 when a partition needs to be created; the smaller time endpoint of T1 is later than the current time t0;
  • the partition creation module 102 is configured to create the N first partitions in the database, and record the T1 in the preset partition information table corresponding to the partition information of the first partition.
  • the quantity determination module includes:
  • the historical information determining unit is configured to determine the first partition information corresponding to the second time interval T2 from the partition information table, and the larger time endpoint of T2 is not later than the t0;
  • a data total amount determining unit which determines the total amount of data stored in the partition corresponding to the first partition information in the database
  • the number determining unit is used to determine the number of the first partition according to the total amount of data and the set storage capacity of a single partition.
  • the quantity determination unit includes:
  • a first calculation subunit used to calculate the ratio of the total amount of data to the set storage capacity of a single partition
  • the second calculation subunit is used to round up the ratio, and determine the rounded value as the number of the first partition.
  • the device further includes:
  • the expiration information determination module is used to determine at least one second partition information corresponding to the third time interval T3 from the partition information table when the partition needs to be deleted, the larger time endpoint of T3 is earlier than the specified time t1, The t1 is set earlier than the t0 for an effective duration;
  • the first deletion module is configured to delete a partition corresponding to the second partition information in the database, and delete an entry where the second partition information is located in the partition information table.
  • the device further includes:
  • the deletion judgment module is used to judge whether the amount of data stored in the database exceeds the set amount of data when it is necessary to determine whether to delete the partition;
  • the second deletion module is used to determine at least one third partition information recorded in the partition information table from the partition information table at the earliest, and delete the partition corresponding to the third partition information in the database And delete the entry where the third partition information is located in the partition information table.
  • a fifth aspect of the present application provides a data storage device.
  • the data storage device 200 includes:
  • a time stamp obtaining module 201 configured to obtain a time stamp in the first data to be stored
  • the first information determination module 202 is configured to determine at least one fourth partition information corresponding to the time interval matching the time stamp from a preset partition information table; the partition information table records that the database has been created Partition information and corresponding time interval of the partition;
  • the data storage module 203 is configured to determine a second partition for storing the first data according to the fourth partition information, and store the first data in the second partition of the database.
  • the data storage module includes:
  • a first determining unit configured to determine the partition corresponding to the fourth partition information as the second partition when determining the fourth partition information
  • the second determining unit is configured to select one fourth partition information from all fourth partition information when determining at least two fourth partition information, and determine the partition corresponding to the selected fourth partition information as the first Two partitions.
  • a sixth aspect of the present application provides a data query device.
  • the data query device 300 includes:
  • the condition acquisition module 301 is used to acquire query conditions required for querying the second data
  • the second information determining module 302 is configured to determine at least one target time interval T4 satisfying the query condition from the preset partition information table, and determine fifth partition information corresponding to the T4 in the partition information table;
  • the partition information table records the partition information of the created partition in the database and the corresponding time interval;
  • the data query module 303 is configured to query the second data from the partition of the database corresponding to the fifth partition information.
  • the query condition includes a first specified value and a second specified value, the first specified value is less than the second specified value;
  • the data query module includes:
  • a traversal search unit used to traverse the data in the partition corresponding to the fifth partition information, and determine whether the timestamp in the traversed data is greater than or equal to the first specified value and less than or equal to the second specified value;
  • the data determining unit is configured to determine the traversed data as the second data if it is.
  • the query condition includes a first specified value and a second specified value, the first specified value is less than the second specified value;
  • the second information determination module includes:
  • a time interval traversing unit used to traverse the time interval in the partition information table
  • Time interval determination unit for the traversed time interval, when the first specified value is greater than or equal to the minimum time stamp of the time interval and less than or equal to the maximum time stamp of the time interval, or when the second specified value is greater than or equal to the time interval.
  • the minimum time stamp of and less than or equal to the maximum time stamp of the time interval, or when the first specified value is less than the minimum time stamp of the time interval and the second specified value is greater than the maximum time stamp of the time interval is determined as The T4.
  • the relevant part can be referred to the description of the method embodiment.
  • the device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units.
  • the present application also provides an electronic device, including a processor and a memory; the memory stores a program that can be called by the processor; wherein, when the processor executes the program, the partition as described in the foregoing embodiment is implemented Management method, data storage method, or data query method.
  • FIG. 7 is a hardware structure diagram of the electronic device where the partition management device 10 is shown according to an exemplary embodiment of the present application, except for the processor 510 and memory shown in FIG. 7.
  • the electronic device where the apparatus 10 is located may generally include other hardware according to the actual function of the electronic device, which will not be repeated here.
  • the present application also provides a machine-readable storage medium on which a program is stored, and when the program is executed by a processor, a partition management method, a data storage method, or a data query method as described in any one of the foregoing embodiments is implemented .
  • This application may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code.
  • Machine-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology.
  • the information may be computer readable instructions, data structures, modules of programs, or other data.
  • machine-readable storage media include, but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only Memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD), or other optical storage , Magnetic tape cassette, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media, can be used to store information that can be accessed by computing devices.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read-only Memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technologies
  • CD-ROM compact disc-read-only memory
  • DVD digital versatile disk
  • Magnetic tape cassette magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media, can be used to store information that can be accessed by computing devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种分区管理、数据存储和查询方法及装置、设备、介质,该分区管理方法,包括:在需创建分区时,确定在第一时间区间T1内存储数据所需的第一分区的数量N;所述T1的较小时间端点晚于当前时间t0(S100);在数据库中创建所述N个第一分区,并将所述T1与所述第一分区的分区信息对应地记录在预设的分区信息表中(S200)。创建的分区是按照时间区间划分的,数据查询时只需查找时间区间对应的分区,有利于提升查找效率。

Description

分区管理、数据存储和查询方法及装置、设备、介质
相关申请的交叉引用
本专利申请要求于2018年12月28日提交的、申请号为2018116286685的中国专利申请的优先权,该申请的全文以引用的方式并入本文中。
技术领域
本申请涉及数据库技术领域,尤其涉及的是一种分区管理、数据存储和查询方法及装置、设备、介质。
背景技术
分布式数据库比如HBase,是数据库技术与网络技术相结合的产物。分布式数据库可以包括多个用于分布式存储及负载均衡的分区,数据可存入到分区中。
相关的分区管理方式中,分区是统一创建的,创建时会一次性划分好所有分区的分区号,分区号是对应分区的序号,一般依据分区总数来划分所有分区号,比如有32个分区,则分区号比如包括0~31。在存储数据时,根据需存储的数据计算分区号后,将该数据存入到该分区号对应的分区中,在查询数据时,依据数据的时间戳从各个分区中查找出需要的数据。
此种方式中,一段时间内获取到的数据可能会分散地存储在很多分区内,相应的,查询一段时间内的数据时,需要对所有分区中的数据进行查找,导致查找效率较低。
发明内容
有鉴于此,本申请提供一种分区管理、数据存储和查询方法及装置、设备、介质,创建的分区是按照时间区间划分的,数据查询时只需查找时间区间对应的分区,有利于提升查找效率。
本申请第一方面提供一种分区管理方法,包括:在需创建分区时,确定在第一时间区间T1内存储数据所需的第一分区的数量N;所述T1的较小时间端点晚于当前时间t0;在数据库中创建所述N个第一分区,并将所述T1与所述第一分区的分区信息对应地记录在预设的分区信息表中。
本申请第二方面提供一种数据存储方法,包括:获取待存储的第一数据中的时间戳;从预设的分区信息表中确定出与所述时间戳匹配的时间区间所对应的至少一个第四分区信息;所述分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间;依据所述第四分区信息确定用于存储所述第一数据的第二分区,并将所述第一数据存储至所述数据库的第二分区中。
本申请第三方面提供一种数据查询方法,包括:获取查询第二数据所需的查询条件;从预设的分区信息表中确定出满足所述查询条件的至少一个目标时间区间T4,并确定分区信息表中与所述T4对应的第五分区信息;所述分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间;从所述数据库的与所述第五分区信息对应的分区中查询所述第二数据。
本申请第四方面提供一种分区管理装置,包括:数量确定模块,用于在需创建分区时,确定在第一时间区间T1内存储数据所需的第一分区的数量N;所述T1的较小时间端点晚于当前时间t0;分区创建模块,用于在数据库中创建所述N个第一分区,并将所述T1与所述第一分区的分区信息对应地记录在预设的分区信息表中。
本申请第五方面提供一种数据存储装置,包括:时间戳获取模块,用于获取待存储的第一数据中的时间戳;第一信息确定模块,用于从预设的分区信息表中确定出与所述时间戳匹配的时间区间所对应的至少一个第四分区信息;所述分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间;数据存储模块,用于依据所述第四分区信息确定用于存储所述第一数据的第二分区,并将所述第一数据存储至所述数据库的第二分区中。
本申请第六方面提供一种数据查询装置,包括:条件获取模块,用于获取查询第二数据所需的查询条件;第二信息确定模块,用于从预设的分区信息表中确定出满足所述查询条件的至少一个目标时间区间T4,并确定分区信息表中与所述T4对应的第五分区信息;所述分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间;数据查询模块,用于从所述数据库的与所述第五分区信息对应的分区中查询所述第二数据。
本申请第七方面提供一种电子设备,包括处理器及存储器;所述存储器存储有可被处理器调用的程序;其中,所述处理器执行所述程序时,实现如前述实施例所述的分区管理方法、数据存储方法、或数据查询方法。
本申请第八方面提供一种机器可读存储介质,其上存储有程序,该程序被处理器执行时,实现如前述实施例所述的分区管理方法、数据存储方法、或数据查询方法。
附图说明
图1是本申请一实施例的分区管理方法的流程示意图;
图2是本申请一实施例的分区管理装置的结构框图;
图3是本申请一实施例的数据存储方法的流程示意图;
图4是本申请一实施例的数据存储装置的结构框图;
图5是本申请一实施例的数据查询方法的流程示意图;
图6是本申请一实施例的数据查询装置的结构框图;
图7是本申请一实施例的电子设备的结构框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。
在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本申请可能采用术语第一、第二、第三等来描述各种器件,但这些信息不应限于这些术语。这些术语仅用来将同一类型的器件彼此区分开。例如,在不脱离本申请范围的情况下,第一器件也可以被称为第二器件,类似地,第二器件也可以被称为第一器件。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
为了使得本申请的描述更清楚简洁,下面对本申请中的一些技术术语进行解释:
HBase:Hadoop Database,是一个高可靠性、高性能、面向列、可伸缩的分布式存 储系统,利用HBase技术可在物理机上搭建起大规模结构化的存储集群。
本申请第一方面提供一种分区管理方法,下面对本申请实施例的分区管理方法进行更具体的描述,但不应以此为限。在一个实施例中,参看图1,示出了本申请实施例的一种分区管理方法,包括以下步骤:
S100:在需创建第一分区时,确定在第一时间区间T1内存储数据所需的第一分区的数量N;所述T1的较小时间端点晚于当前时间t0;
S200:在数据库中创建所述N个第一分区,并将所述T1与所述第一分区的分区信息对应地记录在预设的分区信息表中。
本申请实施例的分区管理方法可以应用于电子设备,电子设备可以是计算机设备等。数据库为分布式数据库,包括但不限于HBase,电子设备创建的分区可以处于电子设备上或处于其他设备上,只要是在数据库中即可。
以数据库为HBase为例,电子设备可以是HBase集群中的分区服务节点HregionServer所在的物理机、或管理节点Hmaster所在的物理机。HRegionServer可以服务多个分区Region;HMaster管理HRegionServer的负载均衡,调整分区的分布。
步骤S100中,在需创建分区时,确定在第一时间区间T1内存储数据所需的第一分区的数量N。
一种确定需创建分区的方式比如是,当收到指示创建第一分区的第一指令时,确定需创建第一分区。该第一指令可以是电子设备中定时触发的,每隔一段时间触发一次,比如可以每隔一个月触发一次该第一指令(所隔时间也可以是一天或几天等,具体时间不限)。如此,可以定期地为新数据创建新的分区。当然,该第一指令也可以由外部输入,具体不限。
该N可以是固定值,即每次创建的第一分区的数量都相同;或者,该N可以是可变的,每次创建的第一分区的数量可以根据需要来确定。可以理解,N大于等于1。
具体的,在首次创建分区时,可以创建设定数量的分区,能够满足一定时间内的数据存储需求即可;在后续创建分区时,可以根据数据库中已创建的分区中存储的数据量来确定N,当然,N的确定方式也不限于此。步骤S200中,在数据库中创建所述N个第一分区,并将所述T1与所述第一分区的分区信息对应地记录在预设的分区信息表中。
每个第一分区都有相应的分区信息,第一分区的分区信息比如可以包括第一分区在数据库中的起始行位置信息和结束行位置信息等,具体不限,只要依据第一分区的分区信息可以在数据库中找到对应的第一分区即可。
本次创建的N个第一分区的分区信息与T1对应,如果每次创建第一分区的N不同,则每次创建第一分区的T1对应的第一分区的分区信息也不同。每个第一分区的大小可以是相同的,当然也可以不同。
所述T1的较小时间端点晚于当前时间t0,该t0可以是在需创建第一分区时本设备的系统时钟的时间,由此可说明T1中的任一个时间都是未来的时间,当前创建的第一分区用于存储未来时间获取到的数据。
该数据可以从较多的数据源中获取,比如KafKa、Flume、Twitter、ZeroMQ、Kinesis、TCP sockets等数据源,当然也可以是其他数据源,只要数据中具有时间戳即可。优选的,该数据是时序数据,即具有时间列且按照时间顺序记录的数据。如此,在将数据存储到第一分区时,可以根据数据中的时间戳找到匹配的时间区间,从而可依据匹配的时间区间对应的分区信息确定用于存储该数据的第一分区。
T1和当前创建的N个第一分区的分区信息对应地记录在分区信息表中,从而当需要查找第一分区中的数据时,可先在分区信息表中确定出T1,根据查找到的T1对应的分区信息找到数据库中的第一分区,再从第一分区中找到所需的数据。
本申请实施例中,创建的分区是按照时间区间划分的。分区创建时,将时间区间与该时间区间内存储数据所需分区的分区信息对应地记录在分区信息表中;后续进行数据存储时,一段时间内的数据可集中存储到几个时间区间对应的分区中;查询数据时,不必在所有分区中查找一段时间内的数据,只需要查找符合的时间区间对应的分区即可,由此可减少所需查找的数据量,从而有利于提升查找效率。
此外,相关的分区管理方式中,分区一旦创建之后,后续不能动态创建新的分区,由此导致分区中存储的数据达到一定量之后,只能通过分区分裂,即,由一个分区分裂成多个分区,来实现分区数量的增加。但是分区分裂时给HBase服务带来压力,对应用使用带来影响,同时随着分区的分裂,数据查询时所需查找的分区更多了,给查询造成了更大的负担。
而本申请实施例中,可以根据未来一段时间内存储数据所需的分区的数量创建新的分区。换言之,分区可以根据需要而动态创建,无需进行分区分裂来增加分区,从而 减少HBase服务的压力,也可以避免分区过多而导致的查找负担大的问题。
在一个实施例中,上述分区管理方法可由分区管理装置执行,如图2所示,分区管理装置100包含2个模块:数量确定模块101和分区创建模块102。数量确定模块101用于执行上述步骤S100,分区创建模块102用于执行上述步骤S200。
在一个实施例中,步骤S100中,确定在第一时间区间T1内存储数据所需的第一分区的数量N,包括以下步骤:
S101:从所述分区信息表中确定出第二时间区间T2对应的第一分区信息,所述T2的较大时间端点不晚于所述t0;
S102:确定数据库中与所述第一分区信息对应的分区所存储的数据总量;
S103:依据所述数据总量及设定的单个分区存储量,确定所述第一分区的数量。
步骤S101中,可从分区信息表中找到早于当前时间的、与一个或多个第二时间区间对应的第一分区信息。
为了保证数据存储的时间连续性,T2的较大时间端点与T1的较小时间端点可以是两个相邻的时间,比如T2的较大时间端点为2018年12月6日10点10分10秒,而T1的较小时间端点为2018年12月6日10点10分11秒;或者,T2的较大时间端点与T1的较小时间端点可以是相同的,当然为了避免时间区间的范围存在重叠,时间区间可以是半开半闭的区间,比如T1和T2都是左开右闭的区间。
步骤S101中,T2对应的第一分区信息所对应的分区存储的数据总量,可以体现在单位时间内所需存储的数据量,由此可用来评估T1内所需存储的数据量,相应便可确定所需创建的第一分区的数量。
T2可以包括多个时间区间,从而对应有多个第一分区信息,当然,T2也可以仅包含一个时间区间。计算第一分区的数量时,若T2的时长比T1的时长大,则可先计算T2与T1的时长比,再计算确定出的所有第一分区信息对应的分区所存储的数据总量与该时长比的比值,将该比值确定为T1内所需存储的数据量,从而可以确定第一分区的数量;若T2的时长与T1的时长一样大,则将所有第一分区信息对应的分区所存储的数据总量确定为T1内所需存储的数据量,从而可以确定第一分区的数量。
步骤S103中,可通过数据总量与单个分区存储量来计算出第一分区的数量,其可通过简单的除法运算来计算得到。
单个分区存储量比如是20GB,该20GB是HBase中一个分区合理的存储数据量,分区中实际可存储的数据量可以超过20GB,但是分区过大有可能造成分区浪费,而过小则有可能导致分区数量过多,因而可选择适中的大小。当然,单个分区存储量具体不限,可以根据实际情况确定。
相关的分区管理方式中,所需创建分区的数量是依据服务器的数量而定的,一般是服务器的整数倍。但是,所需存储的数据总量是无法预先确定的,数据量有可能多也有可能少。该方式中,所需存储的数据总量小、且服务器多时,划分的分区会过多,单个分区可存储的数据量较小,增加HBase服务负担;而需存储的数据总量大、且服务器数量少时,划分的分区会过少,单个分区可存储的数据量太多,为查询使用数据带来不便。
本申请实施例中,分区可随时间的推移而创建,未来需要的分区数量可以依据已有分区中存储的数据量预估,可灵活地在HBase中创建新的分区,从而使灵活性、可扩展性更高。
优选的,步骤S103中,依据所述数据总量及设定的单个分区存储量,确定所述第一分区的数量,包括以下步骤:计算所述数据总量与所述设定的单个分区存储量的比值;对所述比值进行向上取整,将取整所得值确定为所述第一分区的数量。
比如,当前需要创建10月份数据存储所用的分区,可以依据9月份对应的分区所存储的数据量计算10月所需的分区数量。比如,9月份有310GB的数据量,单个分区存储量是20GB,310GB与20GB之比为15.5,那么,10月份应该需要创建16个分区。
在一个实施例中,该方法还包括以下步骤:
S300:在需删除分区时,从所述分区信息表中确定出至少一个第三时间区间T3对应的第二分区信息,所述T3的较大时间端点早于指定时间t1,所述t1比所述t0早设定的有效时长;
S400:删除数据库中与所述第二分区信息对应的分区,并删除所述分区信息表中的所述第二分区信息所在表项。
步骤S300中,一种确定需删除分区的方式比如是,当收到指示删除分区的第二指令时,确定需删除分区。该第二指令可以是电子设备中定时触发的,每隔一段时间触发一次指令,比如可以每隔一个月触发一次该第二指令(所隔时间也可以是一天或几天等,具体时间不限)。如此,可以定期删除所需删除的分区。该第二指令也可以由外部触发, 具体不限。
设定的有效时长比如可以是两年,则t1是距当前时间t0两年前的时间,即两年是数据的有效期,第二分区信息所对应的分区存储的是两年前的数据,用处已不大,可将这些无效数据删除。比如,t0为2018年12月6日10点10分11秒,则早于2016年12月6日10点10分11秒的数据及分区可被删除。当然,设定的有效时长可以根据需要而定。
步骤S400中,将数据库中与第二分区信息对应的分区删除,分区上的数据也被一并删除,同时,将分区信息表中的所述第二分区信息所在表项删除,可避免分区信息表的表项过多。
相关分区管理方式中,由于一段时间内的数据可能分散地存储在很多个甚至所有的分区内,因而无法对已创建的分区进行删除,否则会导致需要的数据被删除。
本申请实施例中,可以将存储了早于当前时间设定有效时长的数据的分区进行删除,使得每个分区都有生命期,当分区超出生命期时就会被删除,从而实现删除过早的无效数据及释放存储空间的目的。
在一个实施例中,该方法还包括以下步骤:
S500:在需判断是否删除分区时,判断所述数据库中已存储的数据量是否超过设定数据量;
S600:若是,从所述分区信息表中确定出至少一个最早记录至所述分区信息表中的第三分区信息,删除数据库中与所述第三分区信息对应的分区,并删除所述分区信息表中的所述第三分区信息所在表项。
一种确定需判断是否删除分区的方式,比如是,当收到指示判断是否删除分区的第三指令时,确定需判断是否删除分区。该第三指令可以是电子设备中定时触发的,每隔一段时间触发一次指令,比如可以每隔一个月触发一次该第三指令(所隔时间也可以是一天或几天等,具体时间不限)。如此,可以定期地检查是否需要删除分区。该第三指令也可以由外部触发,具体不限。
设定数据量比如500GB,当数据库中所有分区已存储的数据量大于500GB时,可删除最早的一个分区或者一批分区,使得数据库中已存储的数据量不超过设定数据量,并删除分区信息表中的第三分区信息所在表项。
本申请实施例中,可以对数据库存储的数据量进行限额,在超过设定数据量时,删除最早时间区间对应的分区,从而释放存储空间,使得数据库中已存储的数据量不超过设定数据量,从而避免新的数据因数据库已存储数据量过大而无法存入的问题。
本申请第二方面提供一种数据存储方法,下面对本申请实施例的数据存储方法进行更具体的描述,但不应以此为限。在一个实施例中,参看图3,示出了本申请实施例的一种数据存储方法,包括以下步骤:
T100:获取待存储的第一数据中的时间戳;
T200:从预设的分区信息表中确定出与所述时间戳匹配的时间区间所对应的至少一个第四分区信息;所述分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间;
T300:依据所述第四分区信息确定用于存储所述第一数据的第二分区,并将所述第一数据存储至所述数据库的第二分区中。
本申请实施例的数据存储方法同样可应用于电子设备,电子设备的相关内容可参看前述实施例的分区管理方法中的内容,在此不再赘述。
步骤T100中,第一数据中携带有时间戳,该第一数据可以是时序数据,具体不限。第一数据中的时间戳比如是与第一数据关联的事件发生的时间,数据源会将时间戳携带在第一数据中。
步骤T200中,可遍历分区信息表中的时间区间,判断时间戳与遍历到的时间区间是否匹配,如果匹配,则该遍历到的时间区间对应的分区信息即为第四分区信息。
判断时间戳与遍历到的时间区间是否匹配,比如可以是:将时间戳与时间区间的较小时间端点和较大时间端点比较,若时间戳大于等于较小时间端点且小于等于较大时间端点,则确定时间戳与遍历到的时间区间匹配。
分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间,可以基于前述实施例的分区管理方法来实现。分区信息表中与时间戳匹配的时间区间只会有一个,但是该时间区间所对应的第四分区信息可以包括一个或多个,每个第四分区信息可以对应于不同的分区。
步骤T300中,依据确定出的第四分区信息可以确定存储第一数据所需的第二分区,具体确定第二分区的方式可以视确定出的第四分区信息的数量而定。
将所述第一数据存储至所述数据库的第二分区中,在将第一数据存入至第二分区之前,还可以生成数据库所需的第一数据的主键,其值能唯一地标识数据库中的每一条记录。主键比如可以包括第一数据的时间戳及唯一标识,不同数据的时间戳可能会相同,但该唯一标识可以使得数据库中数据的主键均是唯一的,唯一标识可随机生成。
每个分区都有相应的分区信息,分区信息比如可以包括分区在数据库中的起始行位置信息和结束行位置信息等,具体不限,只要依据分区信息可以在数据库中找到对应的分区即可。
本申请实施例中,分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间。在进行数据存储时,一段时间内的数据可集中存储到几个时间区间对应的分区中;查询数据时,不必在所有分区中查找一段时间内的数据,只需要查找符合的时间区间对应的分区即可,由此可减少所需查找的数据量,从而有利于提升查找效率。
在一个实施例中,上述数据存储方法可由数据存储装置执行,如图4所示,数据存储装置200包含3个模块:时间戳获取模块201,第一信息确定模块202和数据存储模块203。时间戳获取模块201用于执行上述步骤T100,第一信息确定模块202用于执行上述步骤T200,数据存储模块203用于执行上述步骤T300。
在一个实施例中,步骤T300中,依据所述第四分区信息确定用于存储所述第一数据的第二分区,包括:
T301:当确定出一个第四分区信息时,将所述第四分区信息对应的分区确定为所述第二分区;
T302:当确定出至少两个第四分区信息时,从所有第四分区信息中选取出一个第四分区信息,将选取出的第四分区信息对应的分区确定为所述第二分区。
从所有第四分区信息中选取出一个第四分区信息时,可以采用随机选取方式,或者选取存储数据最少的分区对应的第四分区信息,具体不限。
本申请实施例的数据存储方法可以在基于本申请实施例前述的分区管理方法的基础上实现,在初始创建好用于存储数据的分区、记录好分区信息表后,便可进行数据存储。随时间推移,可不断创建新的分区,删除过早的分区,保证数据可持续存储。
本申请第三方面提供一种数据查询方法,下面对本申请实施例的数据查询方法进行更具体的描述,但不应以此为限。在一个实施例中,参看图5,示出了本申请实施例的一种数据查询方法,包括以下步骤:
U100:获取查询第二数据所需的查询条件;
U200:从预设的分区信息表中确定出满足所述查询条件的至少一个目标时间区间T4,并确定分区信息表中与所述T4对应的第五分区信息;所述分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间;
U300:从数据库的与所述第五分区信息对应的分区中查询所述第二数据。
本申请实施例的数据查询方法同样可应用于电子设备,电子设备的相关内容可参看前述实施例的分区管理方法中的内容,在此不再赘述。
步骤U100中,查询条件可以是外部输入的,查询条件的具体格式及内容不限,只要能够找出需要的目标时间区间即可。
步骤U200中,依据查询条件先从分区信息表中确定出满足所述查询条件的至少一个T4,由于分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间,因而在确定出T4时,便可确定出与T4对应的第五分区信息。第五分区信息可以包括一个或多个,每个第五分区信息对应于不同的分区。
每个分区都有相应的分区信息,分区信息比如可以包括分区在数据库中的起始行位置信息和结束行位置信息等,具体不限,只要依据分区信息可以在数据库中找到对应的分区即可。
步骤U300中,确定查询第二数据所需的分区后,便可从数据库的与所述第五分区信息对应的分区中查询第二数据。
本申请实施例中,分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间。查询数据时,不必在所有分区中查找一段时间内的数据,只需要查找符合的时间区间对应的分区即可,由此可减少所需查找的数据量,从而有利于提升查找效率。
在一个实施例中,上述数据查询方法可由数据查询装置执行,如图6所示,数据查询装置300包含3个模块:条件获取模块301,第二信息确定模块302和数据查询模块303。条件获取模块301用于执行上述步骤U100,第二信息确定模块302用于执行上述步骤U200,数据查询模块303用于执行上述步骤U300。
在一个实施例中,所述查询条件包括第一指定值和第二指定值,所述第一指定值小于第二指定值;
步骤U300中,从数据库的与所述第五分区信息对应的分区中查询所述第二数据, 包括以下步骤:
U301:遍历所述第五分区信息对应的分区中的数据,判断遍历到的数据中的时间戳是否大于等于所述第一指定值且小于等于所述第二指定值;
U302:若是,则确定遍历到的数据为所述第二数据。
根据查询条件确定分区时,为了避免数据遗漏,会将有可能存在所需数据的分区都确定出来,在确定出所需查找的分区后,可再依据查询条件从这些分区中精确找到所需时间段内的第二数据,实现数据的二次过滤。
在一个实施例中,所述查询条件包括第一指定值和第二指定值,所述第一指定值小于第二指定值;
步骤U200中,从预设的分区信息表中确定出满足所述查询条件的至少一个目标时间区间T4,包括以下步骤:
U201:遍历所述分区信息表中的时间区间;
U202:针对遍历到的时间区间,当第一指定值大于等于该时间区间的最小时间戳且小于等于该时间区间的最大时间戳,或者当第二指定值大于等于该时间区间的最小时间戳且小于等于该时间区间的最大时间戳,或者当第一指定值小于该时间区间的最小时间戳且第二指定值大于该时间区间的最大时间戳时,将该时间区间确定为所述T4。
上述查询方式可保证全部或部分时间范围处于查询条件的第一指定值与第二指定值之间的时间区间均被查询到,同时也可避免过多的时间区间被查询到,从而保证了查全率及查询速度。
比如,一个时间区间中,较小时间端点为20180715181001.100,较大时间端点为20180715184001.100,第一指定值为20180715180501.100,第二指定值为20180715183501.100,那么,20180715183501.100(第二指定值)大于较小时间端点且小于较大时间端点,因而该时间区间为T4。
本申请实施例的数据查询方法可以是基于本申请实施例前述的分区管理方法和数据存储方法的基础上实现的,在初始创建好用于存储数据的分区、记录好分区信息表、存储好数据后,便可采用上述方式进行数据查询。
本申请第四方面提供一种分区管理装置,在一个实施例中,参看图2,该分区管理装置100包括:
数量确定模块101,用于在需创建分区时,确定在第一时间区间T1内存储数据所需的第一分区的数量N;所述T1的较小时间端点晚于当前时间t0;
分区创建模块102,用于在数据库中创建所述N个第一分区,并将所述T1与所述第一分区的分区信息对应地记录在预设的分区信息表中。
在一个实施例中,所述数量确定模块,包括:
历史信息确定单元,用于从所述分区信息表中确定出第二时间区间T2对应的第一分区信息,所述T2的较大时间端点不晚于所述t0;
数据总量确定单元,确定所述数据库中与所述第一分区信息对应的分区所存储的数据总量;
数量确定单元,用于依据所述数据总量及设定的单个分区存储量,确定所述第一分区的数量。
在一个实施例中,所述数量确定单元,包括:
第一计算子单元,用于计算所述数据总量与所述设定的单个分区存储量的比值;
第二计算子单元,用于对所述比值进行向上取整,将取整所得值确定为所述第一分区的数量。
在一个实施例中,该装置还包括:
过期信息确定模块,用于在需删除分区时,从所述分区信息表中确定出至少一个第三时间区间T3对应的第二分区信息,所述T3的较大时间端点早于指定时间t1,所述t1比所述t0早设定有效时长;
第一删除模块,用于删除所述数据库中与所述第二分区信息对应的分区,并删除所述分区信息表中的所述第二分区信息所在表项。
在一个实施例中,该装置还包括:
删除判断模块,用于在需判断是否删除分区时,判断所述数据库中已存储的数据量是否超过设定数据量;
第二删除模块,用于若是,从所述分区信息表中确定出至少一个最早记录至所述分区信息表中的第三分区信息,删除所述数据库中与所述第三分区信息对应的分区,并删除所述分区信息表中的所述第三分区信息所在表项。
上述分区管理装置中各个单元的功能和作用的实现过程具体详见上述分区管理方法中对应步骤的实现过程,在此不再赘述。
本申请第五方面提供一种数据存储装置,在一个实施例中,参看图4,该数据存储装置200包括:
时间戳获取模块201,用于获取待存储的第一数据中的时间戳;
第一信息确定模块202,用于从预设的分区信息表中确定出与所述时间戳匹配的时间区间所对应的至少一个第四分区信息;所述分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间;
数据存储模块203,用于依据所述第四分区信息确定用于存储所述第一数据的第二分区,并将所述第一数据存储至所述数据库的第二分区中。
在一个实施例中,所述数据存储模块,包括:
第一确定单元,用于当确定出一个第四分区信息时,将所述第四分区信息对应的分区确定为所述第二分区;
第二确定单元,用于当确定出至少两个第四分区信息时,从所有第四分区信息中选取出一个第四分区信息,将选取出的第四分区信息对应的分区确定为所述第二分区。
上述数据存储装置中各个单元的功能和作用的实现过程具体详见上述数据存储方法中对应步骤的实现过程,在此不再赘述。
本申请第六方面提供一种数据查询装置,在一个实施例中,参看图6,该数据查询装置300包括:
条件获取模块301,用于获取查询第二数据所需的查询条件;
第二信息确定模块302,用于从预设的分区信息表中确定出满足所述查询条件的至少一个目标时间区间T4,并确定分区信息表中与所述T4对应的第五分区信息;所述分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间;
数据查询模块303,用于从所述数据库的与所述第五分区信息对应的分区中查询所述第二数据。
在一个实施例中,所述查询条件包括第一指定值和第二指定值,所述第一指定值小于所述第二指定值;
所述数据查询模块,包括:
遍历查找单元,用于遍历所述第五分区信息对应的分区中的数据,判断遍历到的数据中的时间戳是否大于等于所述第一指定值且小于等于所述第二指定值;
数据确定单元,用于若是,则确定遍历到的数据为所述第二数据。
在一个实施例中,所述查询条件包括第一指定值和第二指定值,所述第一指定值小于所述第二指定值;
所述第二信息确定模块,包括:
时间区间遍历单元,用于遍历所述分区信息表中的时间区间;
时间区间确定单元,用于针对遍历到的时间区间,当第一指定值大于等于该时间区间的最小时间戳且小于等于该时间区间的最大时间戳,或者当第二指定值大于等于该时间区间的最小时间戳且小于等于该时间区间的最大时间戳,或者当第一指定值小于该时间区间的最小时间戳且第二指定值大于该时间区间的最大时间戳时,将该时间区间确定为所述T4。
上述数据查询装置中各个单元的功能和作用的实现过程具体详见上述数据查询方法中对应步骤的实现过程,在此不再赘述。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元。
本申请还提供一种电子设备,包括处理器及存储器;所述存储器存储有可被处理器调用的程序;其中,所述处理器执行所述程序时,实现如前述实施例中所述的分区管理方法、数据存储方法、或数据查询方法。
本申请分区管理装置、数据存储装置、数据查询装置的实施例可以应用在电子设备上。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在电子设备的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图7所示,图7是本申请根据一示例性实施例示出的分区管理装置10所在电子设备的一种硬件结构图,除了图7所示的处理器510、内存530、接口520、以及非易失性存储器540之外,实施例中装置10所在的电子设备通常根据该电子设备的实际功能,还 可以包括其他硬件,对此不再赘述。
本申请还提供一种机器可读存储介质,其上存储有程序,该程序被处理器执行时,实现如前述实施例中任意一项所述的分区管理方法、数据存储方法、或数据查询方法。
本申请可采用在一个或多个其中包含有程序代码的存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。机器可读存储介质包括永久性和非永久性、可移动和非可移动媒体,可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。机器可读存储介质的例子包括但不限于:相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。

Claims (22)

  1. 一种分区管理方法,包括:
    在需创建分区时,确定在第一时间区间T1内存储数据所需的第一分区的数量N;所述T1的较小时间端点晚于当前时间t0;
    在数据库中创建所述N个第一分区,并
    将所述T1与所述第一分区的分区信息对应地记录在预设的分区信息表中。
  2. 如权利要求1所述的分区管理方法,其特征在于,确定在所述第一时间区间T1内存储数据所需的所述第一分区的数量N,包括:
    从所述分区信息表中确定出第二时间区间T2对应的第一分区信息,所述T2的较大时间端点不晚于所述t0;
    确定所述数据库中与所述第一分区信息对应的分区所存储的数据总量;
    依据所述数据总量及设定的单个分区存储量确定所述第一分区的数量。
  3. 如权利要求2所述的分区管理方法,其特征在于,依据所述数据总量及所述设定的单个分区存储量确定所述第一分区的数量,包括:
    计算所述数据总量与所述设定的单个分区存储量的比值;
    对所述比值进行向上取整,
    将取整所得值确定为所述第一分区的数量。
  4. 如权利要求1所述的分区管理方法,其特征在于,该方法进一步包括:
    在需删除分区时,从所述分区信息表中确定出至少一个第三时间区间T3对应的第二分区信息,所述T3的较大时间端点早于指定时间t1,所述t1比所述t0早设定有效时长;
    删除所述数据库中与所述第二分区信息对应的分区,并
    删除所述分区信息表中的所述第二分区信息所在表项。
  5. 如权利要求1所述的分区管理方法,其特征在于,该方法进一步包括:
    在需判断是否删除分区时,判断所述数据库中已存储的数据量是否超过设定数据量;
    若所述数据库中已存储的数据量超过所述设定数据量,从所述分区信息表中确定出至少一个最早记录至所述分区信息表中的第三分区信息,删除所述数据库中与所述第三分区信息对应的分区,并删除所述分区信息表中的所述第三分区信息所在表项。
  6. 一种数据存储方法,包括:
    获取待存储的第一数据中的时间戳;
    从预设的分区信息表中确定出与所述时间戳匹配的时间区间所对应的至少一个第 四分区信息;所述分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间;
    依据所述第四分区信息确定用于存储所述第一数据的第二分区,并将所述第一数据存储至所述数据库的第二分区中。
  7. 如权利要求6所述的数据存储方法,其特征在于,依据所述第四分区信息确定用于存储所述第一数据的第二分区,包括:
    当确定出一个第四分区信息时,将所述第四分区信息对应的分区确定为所述第二分区;
    当确定出至少两个第四分区信息时,从所有第四分区信息中选取出一个第四分区信息,将选取出的第四分区信息对应的分区确定为所述第二分区。
  8. 一种数据查询方法,包括:
    获取查询第二数据所需的查询条件;
    从预设的分区信息表中确定出满足所述查询条件的至少一个目标时间区间T4,并确定分区信息表中与所述T4对应的第五分区信息;所述分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间;
    从所述数据库的与所述第五分区信息对应的分区中查询所述第二数据。
  9. 如权利要求8所述的数据查询方法,其特征在于,所述查询条件包括第一指定值和第二指定值,所述第一指定值小于所述第二指定值;
    从所述数据库的与所述第五分区信息对应的分区中查询所述第二数据,包括:
    遍历所述第五分区信息对应的分区中的数据,判断遍历到的数据中的时间戳是否大于等于所述第一指定值且小于等于所述第二指定值;
    若所述遍历到的数据中的时间戳大于等于所述第一指定值且小于等于所述第二指定值,则确定所述遍历到的数据为所述第二数据。
  10. 如权利要求8所述的数据查询方法,其特征在于,所述查询条件包括所述第一指定值和所述第二指定值,所述第一指定值小于所述第二指定值;
    从预设的分区信息表中确定出满足所述查询条件的至少一个所述目标时间区间T4,包括:
    遍历所述分区信息表中的时间区间;
    针对遍历到的所述时间区间,当所述第一指定值大于等于该时间区间的最小时间戳且小于等于该时间区间的最大时间戳,或者当所述第二指定值大于等于该时间区间的最小时间戳且小于等于该时间区间的最大时间戳,或者当所述第一指定值小于该时间区间 的最小时间戳且所述第二指定值大于该时间区间的最大时间戳时,将该时间区间确定为所述T4。
  11. 一种分区管理装置,包括:
    数量确定模块,用于在需创建分区时,确定在第一时间区间T1内存储数据所需的第一分区的数量N;所述T1的较小时间端点晚于当前时间t0;
    分区创建模块,用于在数据库中创建所述N个第一分区,并将所述T1与所述第一分区的分区信息对应地记录在预设的分区信息表中。
  12. 如权利要求11所述的分区管理装置,其特征在于,所述数量确定模块,包括:
    历史信息确定单元,用于从所述分区信息表中确定出第二时间区间T2对应的第一分区信息,所述T2的较大时间端点不晚于所述t0;
    数据总量确定单元,确定所述数据库中与所述第一分区信息对应的分区所存储的数据总量;
    数量确定单元,用于依据所述数据总量及设定的单个分区存储量确定所述第一分区的数量。
  13. 如权利要求12所述的分区管理装置,其特征在于,所述数量确定单元,包括:
    第一计算子单元,用于计算所述数据总量与所述设定的单个分区存储量的比值;
    第二计算子单元,用于对所述比值进行向上取整,将取整所得值确定为所述第一分区的数量。
  14. 如权利要求11所述的分区管理装置,其特征在于,该装置还包括:
    过期信息确定模块,用于在需删除分区时,从所述分区信息表中确定出至少一个第三时间区间T3对应的第二分区信息,所述T3的较大时间端点早于指定时间t1,所述t1比所述t0早设定有效时长;
    第一删除模块,用于删除所述数据库中与所述第二分区信息对应的分区,并删除所述分区信息表中的所述第二分区信息所在表项。
  15. 如权利要求11所述的分区管理装置,其特征在于,该装置还包括:
    删除判断模块,用于在需判断是否删除分区时,判断所述数据库中已存储的数据量是否超过设定数据量;
    第二删除模块,用于若所述数据库中已存储的数据量超过设定数据量,从所述分区信息表中确定出至少一个最早记录至所述分区信息表中的第三分区信息,删除所述数据库中与所述第三分区信息对应的分区,并删除所述分区信息表中的所述第三分区信息所在表项。
  16. 一种数据存储装置,包括:
    时间戳获取模块,用于获取待存储的第一数据中的时间戳;
    第一信息确定模块,用于从预设的分区信息表中确定出与所述时间戳匹配的时间区间所对应的至少一个第四分区信息;所述分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间;
    数据存储模块,用于依据所述第四分区信息确定用于存储所述第一数据的第二分区,并将所述第一数据存储至所述数据库的第二分区中。
  17. 如权利要求16所述的数据存储装置,其特征在于,所述数据存储模块,包括:
    第一确定单元,用于当确定出一个第四分区信息时,将所述第四分区信息对应的分区确定为所述第二分区;
    第二确定单元,用于当确定出至少两个第四分区信息时,从所有第四分区信息中选取出一个第四分区信息,将选取出的第四分区信息对应的分区确定为所述第二分区。
  18. 一种数据查询装置,包括:
    条件获取模块,用于获取查询第二数据所需的查询条件;
    第二信息确定模块,用于从预设的分区信息表中确定出满足所述查询条件的至少一个目标时间区间T4,并确定分区信息表中与所述T4对应的第五分区信息;所述分区信息表中记录有数据库中已创建分区的分区信息及对应的时间区间;
    数据查询模块,用于从所述数据库的与所述第五分区信息对应的分区中查询所述第二数据。
  19. 如权利要求18所述的数据查询装置,其特征在于,所述查询条件包括第一指定值和第二指定值,所述第一指定值小于所述第二指定值;
    所述数据查询模块,包括:
    遍历查找单元,用于遍历所述第五分区信息对应的分区中的数据,判断遍历到的数据中的时间戳是否大于等于所述第一指定值且小于等于所述第二指定值;
    数据确定单元,用于若所述遍历到的数据中的时间戳大于等于所述第一指定值且小于等于所述第二指定值,则确定所述遍历到的数据为所述第二数据。
  20. 如权利要求18所述的数据查询装置,其特征在于,所述查询条件包括所述第一指定值和所述第二指定值,所述第一指定值小于所述第二指定值;
    所述第二信息确定模块,包括:
    时间区间遍历单元,用于遍历所述分区信息表中的时间区间;
    时间区间确定单元,用于针对遍历到的所述时间区间,当所述第一指定值大于等于 该时间区间的最小时间戳且小于等于该时间区间的最大时间戳,或者当所述第二指定值大于等于该时间区间的最小时间戳且小于等于该时间区间的最大时间戳,或者当所述第一指定值小于该时间区间的最小时间戳且第二指定值大于该时间区间的最大时间戳时,将该时间区间确定为所述T4。
  21. 一种电子设备,其特征在于,包括处理器及存储器;所述存储器存储有可被处理器调用的程序;其中,所述处理器执行所述程序时,实现如权利要求1-5中任意一项所述的分区管理方法、权利要求6或7所述的数据存储方法、或权利要求8-10中任意一项所述的数据查询方法。
  22. 一种机器可读存储介质,其特征在于,其上存储有程序,该程序被处理器执行时,实现如权利要求1-5中任意一项所述的分区管理方法、权利要求6或7所述的数据存储方法、或权利要求8-10中任意一项所述的数据查询方法。
PCT/CN2019/129277 2018-12-28 2019-12-27 分区管理、数据存储和查询方法及装置、设备、介质 Ceased WO2020135737A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811628668.5A CN111382197B (zh) 2018-12-28 2018-12-28 分区管理、数据存储和查询方法及装置、设备、介质
CN201811628668.5 2018-12-28

Publications (1)

Publication Number Publication Date
WO2020135737A1 true WO2020135737A1 (zh) 2020-07-02

Family

ID=71127771

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/129277 Ceased WO2020135737A1 (zh) 2018-12-28 2019-12-27 分区管理、数据存储和查询方法及装置、设备、介质

Country Status (2)

Country Link
CN (1) CN111382197B (zh)
WO (1) WO2020135737A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590675A (zh) * 2021-06-29 2021-11-02 阿里巴巴新加坡控股有限公司 数据存储、查询、管理方法、装置、设备、系统及程序
CN116627990A (zh) * 2023-06-16 2023-08-22 中国银行股份有限公司 数据库表处理方法、装置、设备和存储介质
CN119513206A (zh) * 2025-01-13 2025-02-25 中电科金仓(北京)科技股份有限公司 数据库中数据的范围分区方法、介质、产品及设备
WO2025202763A1 (zh) * 2024-03-27 2025-10-02 云智能资产控股(新加坡)私人股份有限公司 文件处理方法、计算设备、存储介质及程序产品

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297135B (zh) * 2021-02-10 2025-04-04 阿里巴巴集团控股有限公司 数据处理方法以及装置
CN119166679A (zh) * 2024-09-06 2024-12-20 北京奥星贝斯科技有限公司 应用于分区分裂过程中的数据查询方法及装置、电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080172526A1 (en) * 2007-01-11 2008-07-17 Akshat Verma Method and System for Placement of Logical Data Stores to Minimize Request Response Time
CN105573889A (zh) * 2015-12-15 2016-05-11 上海仪电(集团)有限公司 虚拟机监控数据的存取方法及装置
CN106407191A (zh) * 2015-07-27 2017-02-15 中国移动通信集团公司 一种数据处理方法及服务器
CN107861989A (zh) * 2017-10-17 2018-03-30 平安科技(深圳)有限公司 数据的分区存储方法、装置、计算机设备及存储介质

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7734615B2 (en) * 2005-05-26 2010-06-08 International Business Machines Corporation Performance data for query optimization of database partitions
US20080228783A1 (en) * 2007-03-14 2008-09-18 Dawn Moffat Data Partitioning Systems
US20090198736A1 (en) * 2008-01-31 2009-08-06 Jinmei Shen Time-Based Multiple Data Partitioning
CN102063490B (zh) * 2010-12-20 2012-12-19 大唐移动通信设备有限公司 一种数据库分区方法和分区装置
US10108690B1 (en) * 2013-06-06 2018-10-23 Amazon Technologies, Inc. Rolling subpartition management
CN105446991B (zh) * 2014-07-07 2018-10-30 阿里巴巴集团控股有限公司 数据存储方法、查询方法及设备
CN105868071A (zh) * 2016-03-23 2016-08-17 乐视网信息技术(北京)股份有限公司 监测数据的处理方法及装置
CN107657058A (zh) * 2017-10-19 2018-02-02 上海大汉三通数据通信有限公司 一种数据的查询方法及相关装置
CN108197267B (zh) * 2018-01-02 2021-04-27 武汉斗鱼网络科技有限公司 数据库分区表的扩展分析方法、装置及终端设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080172526A1 (en) * 2007-01-11 2008-07-17 Akshat Verma Method and System for Placement of Logical Data Stores to Minimize Request Response Time
CN106407191A (zh) * 2015-07-27 2017-02-15 中国移动通信集团公司 一种数据处理方法及服务器
CN105573889A (zh) * 2015-12-15 2016-05-11 上海仪电(集团)有限公司 虚拟机监控数据的存取方法及装置
CN107861989A (zh) * 2017-10-17 2018-03-30 平安科技(深圳)有限公司 数据的分区存储方法、装置、计算机设备及存储介质

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590675A (zh) * 2021-06-29 2021-11-02 阿里巴巴新加坡控股有限公司 数据存储、查询、管理方法、装置、设备、系统及程序
CN116627990A (zh) * 2023-06-16 2023-08-22 中国银行股份有限公司 数据库表处理方法、装置、设备和存储介质
WO2025202763A1 (zh) * 2024-03-27 2025-10-02 云智能资产控股(新加坡)私人股份有限公司 文件处理方法、计算设备、存储介质及程序产品
CN119513206A (zh) * 2025-01-13 2025-02-25 中电科金仓(北京)科技股份有限公司 数据库中数据的范围分区方法、介质、产品及设备

Also Published As

Publication number Publication date
CN111382197B (zh) 2023-10-27
CN111382197A (zh) 2020-07-07

Similar Documents

Publication Publication Date Title
WO2020135737A1 (zh) 分区管理、数据存储和查询方法及装置、设备、介质
US10459898B2 (en) Configurable-capacity time-series tables
US10762108B2 (en) Query dispatching system and method
CN107807796B (zh) 一种基于超融合存储系统的数据分层方法、终端及系统
EP3944556B1 (en) Block data storage method and apparatus, and block data access method and apparatus
CN106648446A (zh) 一种用于时序数据的存储方法、装置及电子设备
US10552460B2 (en) Sensor data management apparatus, sensor data management method, and computer program product
CN108196787B (zh) 集群存储系统的配额管理方法以及集群存储系统
US20190087437A1 (en) Scheduling database compaction in ip drives
US11057465B2 (en) Time-based data placement in a distributed storage system
CN113946552B (zh) 数据处理方法及电子装置
CN109299115A (zh) 一种数据存储方法、装置、服务器及存储介质
CN114090577A (zh) 时序数据的存储、读取方法及装置
CN111125171A (zh) 一种监测数据存取方法、装置、设备及可读存储介质
CN112632058A (zh) 轨迹确定方法、装置及设备、存储介质
CN107894942B (zh) 数据表访问量的监控方法和装置
CN115687525B (zh) 客户名单的同步方法以及装置、处理器
WO2016184199A1 (zh) 一种文件管理的方法、设备和系统
CN117539392A (zh) 一种磁带库数据处理方法及系统、电子设备、存储介质
CN105718485B (zh) 一种将数据录入数据库的方法及装置
CN111177077A (zh) 数据存储及数据查询方法、装置、设备、介质
CN111190949B (zh) 数据存储及处理方法、装置、设备、介质
CN107819804B (zh) 云端储存设备系统及决定其架构的高速缓存中数据的方法
US20150006832A1 (en) Vsam data set tier management
CN106326139A (zh) 一种音/视频数据文件循环存储方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19904715

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19904715

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19904715

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 04.02.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19904715

Country of ref document: EP

Kind code of ref document: A1