WO2020124491A1 - 数据的切分方法、装置、计算机设备及存储介质 - Google Patents
数据的切分方法、装置、计算机设备及存储介质 Download PDFInfo
- Publication number
- WO2020124491A1 WO2020124491A1 PCT/CN2018/122380 CN2018122380W WO2020124491A1 WO 2020124491 A1 WO2020124491 A1 WO 2020124491A1 CN 2018122380 W CN2018122380 W CN 2018122380W WO 2020124491 A1 WO2020124491 A1 WO 2020124491A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- tables
- sub
- data table
- obtain multiple
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
Definitions
- the present invention relates to the field of database technology, and in particular, to a data segmentation method, device, computer equipment, and storage medium.
- Big data is a collection of large amounts of data. Through big data, user behavior, product price trends, etc. can be predicted.
- the amount of data stored by the server is getting larger and larger.
- the huge amount of data stored in the server causes the server database to query Too many objects prevent timely response.
- a data segmentation method includes:
- the method further includes: determining the number of databases according to the number of the data tables ; Store the multiple data tables in multiple determined databases.
- the dividing the corresponding data table according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table includes: obtaining each of the data tables The occupied space corresponding to each piece of data in the data; determining the number of data sub-tables corresponding to the data table according to the number of data pieces in the data table and the occupied space corresponding to each piece of data in the data table; The number of the data sub-tables divides the data table to obtain multiple data sub-tables corresponding to each data table.
- the method further includes: The number of data sub-tables determines the number of databases; the multiple data sub-tables are stored in the determined multiple databases.
- the dividing the corresponding data table according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table includes: obtaining each of the data tables Field digital identification corresponding to each piece of data in the field; performing a modular operation on the field digital identification to obtain a modular result; dividing the corresponding data table according to the modular result and the number of data pieces to obtain each Multiple data sub-tables corresponding to the data table.
- the method further includes: The correspondence between the type and the data table, the correspondence between the data table and the corresponding data sub-table, and the data identifier corresponding to each piece of data in the data sub-table are sent to the data table management center, so that all The data table management center searches for data corresponding to the data identifier from the corresponding data sub-table according to the service type and data identifier in the received data processing request.
- a data segmentation device includes:
- a first obtaining module configured to obtain a data set and a service type of data in the data set
- the first division module is used to divide the data of the data set according to the service type to obtain multiple data tables;
- a second obtaining module configured to obtain the number of data in each data table
- the second segmentation module is configured to segment the corresponding data table according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table.
- the data dividing device further includes: a first number determining module, configured to determine the number of databases according to the number of data tables; a first database storage module, used to The multiple data tables are stored in the determined multiple databases.
- the second segmentation module includes: an occupied space acquisition module for acquiring an occupied space corresponding to each piece of data in each of the data tables; an occupied space determination module for The number of data pieces in the data table and the occupied space corresponding to each piece of data in the data table determine the number of data sub-tables corresponding to the data table; the occupied space segmentation module is used to The number of is divided into the data tables to obtain multiple data sub-tables corresponding to each data table.
- the data splitting device further includes: a second number determining module, configured to determine the number of databases based on the number of data sub-tables; the second database storing module, used In order to store the multiple data sub-tables in the determined multiple databases.
- the second segmentation module further includes: a field digital identification acquisition module, used to acquire a field digital identification corresponding to each piece of data in each of the data tables;
- the field digital identifier performs a modular operation to obtain a modular result;
- a modular segmentation module is used to segment the corresponding data table according to the modular result and the number of data pieces to obtain each of the data Multiple data sub-tables corresponding to the table.
- a computer device includes a memory and a processor.
- the memory stores a computer program.
- the processor is caused to perform the following steps:
- a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to perform the following steps:
- the present invention proposes a data segmentation method, device, equipment and storage medium. First, the data set and the service type of the data in the data set are obtained; and the data of the data set is segmented according to the service type, Obtain multiple data tables; then obtain the number of data items in each of the data tables; finally divide the corresponding data table according to the number of data items to obtain multiple data corresponding to each data table Child table.
- FIG. 1 is a schematic diagram of an implementation process of a data segmentation method in an embodiment
- FIG. 2 is a schematic diagram of a piece of data in an embodiment
- FIG. 3 is a schematic diagram of a piece of data in an embodiment
- FIG. 4 is a schematic diagram of a piece of data in an embodiment
- FIG. 5 is a schematic diagram of an implementation process of a data segmentation method in an embodiment
- FIG. 6 is a schematic diagram of a process of segmenting data corresponding to a data segmentation method in an embodiment
- FIG. 7 is a schematic diagram of an implementation process of a data segmentation method in an embodiment
- FIG. 8 is a schematic diagram of a data table management center determining a data sub-table according to a service type and a data identifier in an embodiment
- FIG. 9 is a structural block diagram of a data dividing device in an embodiment
- FIG. 10 is a structural block diagram of a computer device in an embodiment.
- a data segmentation method is provided. This method can be applied to the server or the terminal.
- the server is a high-performance computer or a high-performance computer cluster composed of multiple high-performance computers.
- the terminal may be a desktop terminal or a mobile terminal.
- the desktop terminal is a desktop computer and the mobile terminal is a notebook computer.
- the data segmentation method according to the embodiment of the present invention specifically includes the following steps:
- Step 102 Obtain a data set and a service type of data in the data set.
- the data set is a collection of multiple data.
- the service type of the data indicates different types of data.
- the service types of the data may include an order service type and a user service type.
- the data table of the order business type may contain data of the user field type (user information data), order amount field type data (order amount data), order time field type data (order time data), Coupon field type data (coupon data) and purchase date type data (purchase date data);
- the data table of the user's business type may contain data of the user field type (user information data), and the user's gender field type Data (user gender data), user age field type data (user age data) and user shipping address field type data (user shipping address data).
- Step S104 Divide the data of the data set according to the service type to obtain multiple data tables.
- the first segmentation of the data set is mainly based on the data's business type
- the business type corresponds to a data table
- the order type corresponds to the order data table
- the user type corresponds to the user data table
- the address type corresponds to the address
- the data table specifically, the data belonging to the order business type is stored in the order data table, that is, the user information data, order amount data, order time data, coupon data and purchase date data are stored in the order data table; it will belong to the user business
- the type of data is stored in the user data table, that is, the user information data, user gender data, user age data and user shipping address data are stored in the user data table.
- the method further includes: determining according to the number of the data tables The number of databases; store the multiple data tables in the determined multiple databases.
- the three data tables are placed in three databases; or, three data tables are obtained after segmentation, and two of the data tables are placed in database 1, and the first Put three data tables into database 2.
- Step S106 Acquire the number of data in each data table.
- the number of data refers to a row of data or a column of data in the data table, specifically, the order data table shown in FIG. 2, each row of data represents a piece of data, or, the order data table shown in FIG. 3 , Each column of data represents a piece of data.
- the data table includes data of multiple fields, and one of the fields can be set as the main field.
- the fields are: user field, order amount field, order time field, coupon field and product type field.
- the main field to user, as shown in Figure 2
- the data in the order data table can be divided into three pieces of data.
- set the order time as the main field.
- what field you want to set as the main field can be determined according to actual needs, such as the order form.
- the user field As the main field.
- the user field By setting the user field as the main field, it is possible to better analyze the data of a single user.
- the order time is set as the main field, it can be used for each time period. Better analysis of purchases.
- Step 108 Divide the corresponding data table according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table.
- a corresponding data table may be divided in various ways to obtain multiple data sub-tables corresponding to each data table.
- the data table is divided according to a preset dividing ratio.
- the corresponding data table is divided according to the number of data pieces, to obtain a corresponding number of each data table.
- Data sub-tables including: obtaining a preset split ratio; splitting the corresponding data table according to the preset split ratio and the number of data pieces to obtain multiple corresponding to each data table Data subtable.
- the data table can be evenly divided into 3 according to the number of data in the data table, for example, 60 data There are 20 data in each data sub-table. If the preset split ratio is to divide each data table by 1/6, 1/3 and 1/2, then at this time, you can According to the number of data in the data table, for example, 60 data, the data table is divided into a data sub-table 1 containing 10 data, a data sub-table 2 containing 20 data, and a data sub-table 3 containing 30 data.
- the data table is divided according to occupied space.
- the corresponding data table is divided according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table Including: obtaining the occupied space corresponding to each piece of data in each of the data tables; determining the correspondence of the data table according to the number of data pieces in the data table and the occupied space corresponding to each piece of data in the data table The number of data sub-tables; divide the data table according to the number of the data sub-tables to obtain multiple data sub-tables corresponding to each of the data tables.
- the following method can be used to calculate the occupied space of each piece of data. Assuming that the occupied space of one piece of data in a piece of data is 1 kb, then the occupied space of one piece of data is 4 kb because one piece of data contains 4 data.
- the determining the number of data sub-tables corresponding to the data table according to the number of data pieces in the data table and the occupied space corresponding to each piece of data in the data table specifically includes: 1. According to the number of data pieces and The occupied space corresponding to each piece of data determines the occupied space of the data table, and determines the number of data sub-tables according to the occupied space of the data table; 2. According to the occupied space of each data, determines the number of data stored in each data sub-table, The number of data sub-tables is determined according to the number of data pieces stored in each data sub-table and the number of data pieces in the data table.
- the occupied space of each piece of data is 0.4M and the number of data pieces is 1000, then the total occupied space is 400M. Due to the large space, two large data subtables can be used to store , That is, the number of data subtables is 2, each data subtable stores 200M data, you can also use more data subtables with small storage capacity to store, for example, use 10 data subtables to store 400M data, each Store 40M data in the data sub-table, that is, 100 data.
- each data sub-table stores 250 data, assuming that the data table has 1000 data, then 4 data sub-tables are needed.
- the data in the data table can be evenly stored in each data subtable, or the data in the data table can be stored according to the specific size of the data to be stored in each data subtable Non-uniformly stored data subtable.
- the data table is divided according to the field. Specifically, the corresponding data table is divided according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table,
- the method includes: acquiring a field digital identifier corresponding to each piece of data in each of the data tables; performing a modulo operation on the field digital identifier to obtain a modulo result; according to the modulo result and the number of data
- the data table is divided into multiple data sub-tables corresponding to each of the data tables.
- the field digital identifier is used to uniquely identify the number of a field. For example, in the user field, each user is assigned a field digital ID, the user 1 field ID is 1256, the user 2 field ID is 1058, and the user 3 field ID is 2002.
- the modulus operation is performed on the field digital identification to obtain the modulus result.
- the modulo result of user 1's field digital identifier 1255 is 1
- the modulo result of user 2's field digital identifier 1058 is 3
- the modulo result of user 3's field digital identifier 2002 is 2.
- the corresponding data table is divided according to the modulo results and the number of data pieces. For example, put the data with the modulo result of 1 into the data sub-table 1, put the data with the modulo result of 2 into the data sub-table 2, and put the data with the modulo result of 3 into the data sub-table 3; further, If there is more data in a certain modulus result, for example, there are more data in the modulus result 1, then two data sub-tables can be used to store the data in the modulus result 1, so that the final data sub-table The amount of data stored is almost the same.
- step 108 after dividing the data table according to the number of the data sub-tables to obtain multiple data sub-tables corresponding to each of the data tables, the method further includes :
- Step 109 Determine the number of databases according to the number of data sub-tables.
- Step 110 Store the multiple data sub-tables in the determined multiple databases.
- data table 1 has 6 data sub-tables
- data table 2 has 2 data sub-tables
- data table 3 has 15 data sub-tables
- data table 2 sets up a database for storing two data sub-tables
- data table 3 can set up multiple databases due to the large number of data sub-tables, put different data sub-tables into multiple databases
- set up 5 databases each database stores 3 data sub-tables.
- the 5 databases in data table 3 the first data inventory has 2 data sub-tables, the second database stores 4 data sub-tables, the third database stores 3 data sub-tables, and the fourth database stores 2 Data subtable, the fifth database stores 4 data subtables.
- the data is first segmented according to service type to obtain multiple data tables, and then each data table is segmented to obtain multiple data tables.
- Data subtables are first segmented according to service type to obtain multiple data tables, and then each data table is segmented to obtain multiple data tables. Data subtables.
- the above data segmentation method first obtains the data set and the service type of the data in the data set; and divides the data of the data set according to the service type to obtain multiple data tables; and then obtains each The number of data pieces in the data table; finally, the corresponding data table is divided according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table.
- an embodiment of the present invention provides a data segmentation method, which specifically includes the following steps:
- Step 702 Obtain a data set and a service type of data in the data set.
- Step 704 Divide the data of the data set according to the service type to obtain multiple data tables.
- Step 706 Obtain the number of data in each data table.
- Step 708 Divide the corresponding data table according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table.
- Step 710 Send the correspondence between the service type and the data table, the correspondence between the data table and the corresponding data sub-table, and the data identifier corresponding to each piece of data in the data sub-table to the data A table management center, so that the data table management center searches for data corresponding to the data identification from the corresponding data sub-table according to the service type and data identification in the received data processing request.
- the data identifier is a serial number used to indicate the number of data in the data sub-table, for example, the data identifier 0001 is used to identify the first data in the data sub-table, and 0002 is used to identify the second data in the data sub-table Data; the data identifier is a field identifier, which is used to identify the data of a certain field in the data sub-table. For example, if the main field of a data sub-table is a user, then use the data identifier 0910 to identify user 1, and 0920 to identify user 2. .
- the corresponding relationship indicates that as long as you know the business type, you can know which data table the data of the business type is stored in, or you can know which business type data is stored in the data table as long as you know the data table.
- the storage location of the table (the location reflects the database and server where the table is located, that is, different tables can be stored not only in different databases or even on different servers), as shown in Table 1, for example.
- the data table management center receives the data processing request sent by the terminal, and then obtains the service type and data identifier from the data processing request.
- the data of the service type is stored in In the data table 3, further, according to the data identifier, it is known that the data corresponding to the data identifier is stored in the data sub-table 2, so the data corresponding to the data identifier is searched from the data sub-table 2, which can greatly improve The query efficiency of the data, because it is only used to search in the data sub-table 2.
- an embodiment of the present invention provides a data segmentation device 900.
- the device 900 includes:
- the first obtaining module 902 is configured to obtain a data set and a service type of data in the data set;
- the first division module 904 is used to divide the data of the data set according to the service type to obtain multiple data tables;
- the second obtaining module 906 is configured to obtain the number of data in each data table
- the second segmentation module 908 is configured to segment the corresponding data table according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table.
- the above data segmentation device first obtains the data set and the service type of the data in the data set; and divides the data of the data set according to the service type to obtain multiple data tables; and then obtains each The number of data pieces in the data table; finally, the corresponding data table is divided according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table.
- the data segmentation device 900 further includes:
- the first number determining module is used to determine the number of databases according to the number of data tables
- the first database storage module is used to store the multiple data tables in the determined multiple databases.
- the second segmentation module 908 includes:
- Occupied space acquisition module used to acquire the occupied space corresponding to each piece of data in each data table
- An occupied space determining module configured to determine the number of data sub-tables corresponding to the data table according to the number of data pieces in the data table and the occupied space corresponding to each piece of data in the data table;
- the occupied space segmentation module is configured to segment the data table according to the number of the data sub-tables to obtain multiple data sub-tables corresponding to each data table.
- the data segmentation device 900 further includes:
- the second number determining module is used to determine the number of databases according to the number of the data sub-tables
- the second database storage module is used to store the multiple data sub-tables in the determined multiple databases.
- the second segmentation module 908 further includes:
- a field digital identification obtaining module used to obtain a field digital identification corresponding to each piece of data in each of the data tables
- a module for modulo which is used to perform a modulo operation on the digital identifier of the field to obtain a modulo result
- the die-cutting and dividing module is used to divide the corresponding data table according to the result of the die-finding and the number of data pieces to obtain multiple data sub-tables corresponding to each of the data tables.
- FIG. 10 shows an internal structure diagram of a computer device in an embodiment.
- the computer device may specifically be a server.
- the computer device includes a processor, memory, and network interface connected by a system bus.
- the memory includes a non-volatile storage medium and an internal memory.
- the non-volatile storage medium of the computer device stores an operating system, and may also store a computer program.
- the processor may enable the processor to implement a data division method.
- a computer program may also be stored in the internal memory.
- the processor may be caused to execute the data division method.
- the network interface is used to communicate with the outside.
- FIG. 10 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
- the specific computer device may It includes more or fewer components than shown in the figure, or some components are combined, or have a different component arrangement.
- the data segmentation method provided by this application may be implemented in the form of a computer program, and the computer program may run on the computer device shown in FIG. 10.
- various program templates constituting the data dividing device can be stored. For example, the first obtaining module 902, the first dividing module 904, the second obtaining module 906, and the second dividing module 908.
- the computer device includes a memory and a processor.
- the memory stores a computer program.
- the processor is caused to perform the following steps:
- the above computer device first obtains the data set and the service type of the data in the data set; and divides the data of the data set according to the service type to obtain multiple data tables; then obtains each of the data tables Number of data sheets; finally, the corresponding data table is divided according to the number of data sheets to obtain multiple data sub-tables corresponding to each data table.
- the multiple data tables are stored in the determined multiple databases.
- the segmenting the corresponding data table according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table includes:
- the multiple data sub-tables are stored in the determined multiple databases.
- the segmenting the corresponding data table according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table includes:
- a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to perform the following steps:
- the above computer-readable storage medium first obtains the data set and the service type of the data in the data set; and divides the data of the data set according to the service type to obtain multiple data tables; then obtains each The number of data pieces in the data table; finally, the corresponding data table is divided according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table.
- the multiple data tables are stored in the determined multiple databases.
- the segmenting the corresponding data table according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table includes:
- the multiple data sub-tables are stored in the determined multiple databases.
- the dividing the corresponding data table according to the number of data pieces to obtain multiple data sub-tables corresponding to each data table includes:
- Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
- Volatile memory can include random access memory (RAM) or external cache memory.
- RAM random access memory
- DRAM dynamic RAM
- SDRAM synchronous DRAM
- DDRSDRAM double data rate SDRAM
- ESDRAM enhanced SDRAM
- SLDRAM synchronous chain (Synchlink) DRAM
- RDRAM direct RAM
- DRAM direct memory bus dynamic RAM
- RDRAM memory bus dynamic RAM
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明实施例公开了一种数据的切分方法、装置、计算机设备及存储介质,包括:获取数据集和所述数据集中数据的业务类型;根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;获取每个所述数据表中的数据条数;根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。通过上述方式对数据进行切分,能够在需要进行数据查询时,提高数据查询效率。
Description
本发明涉及数据库技术领域,尤其涉及一种数据的切分方法、装置、计算机设备及存储介质。
随着云时代的来临,大数据也吸引了相关领域人员越来越多的关注。大数据是大量数据的集合,通过大数据,可以对用户行为、产品价格趋势等进行预测。
随着大数据技术的不断发展,服务器存储的数据量越来越大,在对千万乃至上亿级以上的数据量进行查询的时候,由于服务器中存储的数据量巨大,导致服务器数据库由于查询对象过多导致无法及时响应。
基于此,有必要针对上述问题,提出一种提高查询效率的数据的切分方法、装置、计算机设备及存储介质。
一种数据的切分方法,所述方法包括:
获取数据集和所述数据集中数据的业务类型;
根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;
获取每个所述数据表中的数据条数;
根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
在其中一个实施例中,在所述根据所述业务类型对所述数据集的数据进行切分,得到多个数据表之后,还包括:根据所述数据表的个数,确定数据库的个数;将所述多个数据表存放于确定的多个数据库中。
在其中一个实施例中,所述根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表,包括:获取每个所述数据表中的每条数据对应的占用空间;根据所述数据表中的数据条数和所述数据表中的每条数据对应的占用空间确定所述数据表对应的数据子表的个数;根据所述数据子表的个数对所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
在其中一个实施例中,在所述根据所述数据子表的个数对所述数据表进行切分,得到每个所述数据表对应的多个数据子表之后,还包括:根据所述数据子表的个数,确定数据库的个数;将所述多个数据子表存放于确定的多个数据库中。
在其中一个实施例中,所述根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表,包括:获取每个所述数据表中每条数据对应的字段数字标识;对所述字段数字标识进行求模运算,得到求模结果;根据所述求模结果和所述数据条数对相应的数据表进行切分,得到每个所述数据表对应的多个数据子表。
在其中一个实施例中,在所述根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表之后,还包括:将所述业务类型和所述数据表的对应关系、所述数据表与相应的所述数据子表的对应关系以及所述数据子表中的每条数据对应的数据标识发送到数据表管理中心,以使所述数据表管理中心根据接收到的数据处理请求中的业务类型和数据标识从相应的数据子表中查找与所述数据标识对应的数据。
一种数据的切分装置,所述装置包括:
第一获取模块,用于获取数据集和所述数据集中数据的业务类型;
第一切分模块,用于根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;
第二获取模块,用于获取每个所述数据表中的数据条数;
第二切分模块,用于根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
在其中一个实施例中,所述数据的切分装置,还包括:第一个数确定模块,用于根据所述数据表的个数,确定数据库的个数;第一数据库存放模块,用于将所述多个数据表存放于确定的多个数据库中。
在其中一个实施例中,所述第二切分模块,包括:占用空间获取模块,用于获取每个所述数据表中的每条数据对应的占用空间;占用空间确定模块,用于根据所述数据表中的数据条数和所述数据表中的每条数据对应的占用空间确定所述数据表对应的数据子表的个数;占用空间切分模块,用于根据所述数据子表的个数对所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
在其中一个实施例中,所述数据的切分装置,还包括:第二个数确定模块,用于根据所述数据子表的个数,确定数据库的个数;第二数据库存放模块,用于将所述多个数据子表存放于确定的多个数据库中。
在其中一个实施例中,所述第二切分模块,还包括:字段数字标识获取模块,用于获取每个所述数据表中每条数据对应的字段数字标识;求模模块,用于对所述字段数字标识进行求模运算,得到求模结果;求模切分模块,用于根据所述求模结果和所述数据条数对相应的数据表进行切分,得到每个所述数据表对应的多个数据子表。
一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行以下步骤:
获取数据集和所述数据集中数据的业务类型;
根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;
获取每个所述数据表中的数据条数;
根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行以下步骤:
获取数据集和所述数据集中数据的业务类型;
根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;
获取每个所述数据表中的数据条数;
根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
实施本发明实施例,将具有如下效果:
本发明提出了一种数据的切分方法、装置、设备及存储介质,首先获取数据集和所述数据集中数据的业务类型;并且根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;然后获取每个所述数据表中的数据条数;最后根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。可见,通过上述方式,由于获取到了多个数据子表对原始的数据集进行存放,而不是将原始的数据集存放于一个数据表中,所以在后续要查数据的时候,可以直接在某一个数据子表中查询,而不是在一个大的存储原始数据集的数据表中进行查询,由于查询量减少,所以能够提高查询效率,提高响应效率,并且,上述数据的切分方式将数据首先按业务切分,然后再对经过业务切分的表进行再次切分,使得最终得到的数据子表相对只有一次切分得到的数据子表更小,进一步的提高了查询效率和响应效率。
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
其中:
图1为一个实施例中数据的切分方法的实现流程示意图;
图2为一个实施例中一条数据的示意图;
图3为一个实施例中一条数据的示意图;
图4为一个实施例中一条数据的示意图;
图5为一个实施例中数据的切分方法的实现流程示意图;
图6为一个实施例中数据的切分方法对应的切分数据的过程示意图;
图7为一个实施例中数据的切分方法的实现流程示意图;
图8为一个实施例中数据表管理中心根据业务类型和数据标识确定数据子表的示意图;
图9为一个实施例中数据的切分装置的结构框图;
图10为一个实施例中计算机设备的结构框图。
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
如图1所示,在一个实施例中,提供了一种数据的切分方法。该方法可以应用于服务器,也可以应用于终端。所述服务器为高性能计算机或由多个高性能计算机组成的高性能计算机集群,所述终端,可以是台式终端,也可以是移动终端,例如,台式终端为台式电脑,移动终端为笔记本电脑。
如图1所示,本发明实施例所述的数据的切分方法具体包括如下步骤:
步骤102,获取数据集和所述数据集中数据的业务类型。
所述数据集,为多个数据的集合。
所述数据的业务类型,指示不同类型的数据,例如,对某一数据集,其中的数据的业务类型可能有订单业务类型和用户业务类型。其中,订单业务类型的数据表可能包含的数据有用户字段类型的数据(用户信息数据)、订单金额字段类型的数据(订单金额数据)、下单时间字段类型的数据(下单时间数据)、优惠券字段类型的数据(优惠券数据)和购买日期类型的数据(购买日期数据);用户业务类型的数据表可能包含的数据有用户字段类型的数据(用户信息数据)、用户性别字段类型的数据(用户性别数据)、用户年龄字段类型的数据(用户年龄数据)和用户送货地址字段类型的数据(用户送货地址数据)。
步骤S104,根据所述业务类型对所述数据集的数据进行切分,得到多个数据表。
数据集的第一次切分主要是根据数据的业务类型对数据进行的切分,一个业务类型对应一个数据表,例如,订单类型对应订单数据表,用户类型对应用户数据表,地址类型对应地址数据表,具体的,将属于订单业务类型的数据存入订单数据表,即将用户信息数据、订单金额数据、下单时间数据、优惠券数据和购买日期数据存入订单数据表;将属于用户业务类型的数据存入用户数据表,即将用户信息数据、用户性别数据、用户年龄数据和用户送货地址数据存入用户数据表。
作为本发明的一种实施例,在步骤104所述根据所述业务类型对所述数据集的数据进行切分,得到多个数据表之后,还包括:根据所述数据表的个数,确定数据库的个数;将所述多个数据表存放于确定的多个数据库中。
例如,若经过切分得到3个数据表,则将3个数据表分别放入3个数据库中;或者,经过切分得到3个数据表,将其中两个数据表放入数据库1,将第三个数据表放入数据库2。
步骤S106,获取每个所述数据表中的数据条数。
所述数据条数,指代数据表中的一行数据或者一列数据,具体的,如图2所示的订单数据表,每一行的数据代表一条数据,或者,如图3所示的订单数据表,每一列的数据代表一条数据。
需要说明的是,数据表中包括多个字段的数据,可以将其中的某一个字段设置为主字段,通过设置主字段,能够将数据表中的数据较好的划分为多条数据。例如图2或图3,字段为:用户字段、订单金额字段、下单时间字段、优惠券字段和商品类型字段,为了更好的划分数据,将主字段设置为用户,如图2所示,通过将用户字段设置为主字段,能够将订单数据表中的数据划分为3条数据。当然,也可以将其他字段设置为主字段,例如图4所示,将下单时间设置为主字段,当然,具体要将什么字段设置为主字段,可以根据实际需求进行确定,比如订单表,显然将用户字段设置为主字段更好,通过将用户字段设置为主字段,能够更好的对单个用户的数据进行分析,当然,如果将下单时间设置为主字段,能够对各个时间段的购买情况进行更好的分析。
步骤108,根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
在这里,根据所述数据条数可以采用多种方式对相应的数据表进行切分,得到每个所述数据表对应的多个数据子表。
可选的,根据预置的切分比例对数据表进行切分,具体的,所述根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表,包括:获取预置的切分比例;根据预置的切分比例和所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
若预置的切分比例为将每个数据表均匀的切分为3个数据子表,则此时可以根据数据表中的数据条数,例如60条数据,将数据表均匀的切分成3个数据子表,每个数据子表中有20条数据;若预置的切分比例为将每个数据表按1/6,1/3和1/2进行切分,则此时,可以根据数据表中的数据条数,例如60条数据,将数据表切分为包含10条数据的数据子表1,包含20条数据的数据子表2和包含30条数据的数据子表3。
可选的,根据占用空间对数据表进行切分,具体的,所述根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表,包括:获取每个所述数据表中的每条数据对应的占用空间;根据所述数据表中的数据条数和所述数据表中的每条数据对应的占用空间确定所述数据表对应的数据子表的个数;根据所述数据子表的个数对所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
如图2所示,可以采用如下方法计算每条数据的占用空间,假设一条数据中的一个数据占用空间是1kb,那么由于一条数据包含有4个数据,所以一条数据的占用空间是4kb。
所述根据所述数据表中的数据条数和所述数据表中的每条数据对应的占用空间确定所述数据表对应的数据子表的个数,具体包括:一、根据数据条数和每条数据对应的占用空间确定数据表的占用空间,根据数据表的占用空间确定数据子表的个数;二、根据每条数据的占用空间,确定每个数据子表存放的数据条数,根据每个数据子表存放的数据条数和所述数据表的数据条数,确定数据子表的个数。
对于第一种情况,例如,每条数据的占用空间为0.4M,数据条数为1000条,那么总共的占用空间是400M,由于该空间较大,可以用两个大的数据子表进行存放,即数据子表的个数为2,每个数据子表存200M数据,也可以用更多的存储量小的数据子表进行存放,例如,用10个数据子表存放400M数据,每个数据子表中存40M数据,即100条数据。对于第二种情况,例如,每条数据的占用空间为0.4M,预设的每个数据子表的存放数据量是100M(当然预置的每个数据子表的存储空间也可以不太相同,这里只是为了方便说明),于是,可以确定每个数据子表存放250条数据,假设数据表有1000条数据,那么需要4个数据子表。
在确定了数据子表的个数之后,可以将数据表中的数据均匀的存入每个数据子表,也可以根据每个数据子表需要存放的数据的具体大小,将数据表中的数据非均匀的存入数据子表。
可选的,根据字段对数据表进行切分,具体的,所述根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表,包括:获取每个所述数据表中每条数据对应的字段数字标识;对所述字段数字标识进行求模运算,得到求模结果;根据所述求模结果和所述数据条数对相应的数据表进行切分,得到每个所述数据表对应的多个数据子表。
所述字段数字标识,用于唯一标识一个字段的数字。例如,用户字段,为每个用户分配一个字段数字标识,用户1的字段数字标识为1256,用户2的字段数字标识为1058,用户3的字段数字标识为2002。
然后对字段数字标识进行求模运算,得到求模结果。例如,用户1的字段数字标识1255的求模结果为1,用户2的字段数字标识1058的求模结果是3,用户3的字段数字标识2002的求模结果为2。
最后根据求模结果和数据条数对相应的数据表进行切分。例如,将求模结果为1的数据放入数据子表1,将求模结果为2的数据放入数据子表2,将求模结果为3的数据放入数据子表3;进一步的,若某一求模结果的数据较多,例如,求模结果为1的数据较多,那么可以用两个数据子表来存放求模结果为1的数据,以使最终得到的数据子表中存放的数据量都差不多。
进一步的,如图5所示,在步骤108所述根据所述数据子表的个数对所述数据表进行切分,得到每个所述数据表对应的多个数据子表之后,还包括:
步骤109,根据所述数据子表的个数,确定数据库的个数。
步骤110,将所述多个数据子表存放于确定的多个数据库中。
例如,假设数据表1有6个数据子表,数据表2有2个数据子表,数据表3有15个数据子表;则为数据表1设置2个数据库,每个数据库放3个数据子表;数据表2设置一个数据库,用于存放两个数据子表;数据表3由于数据子表个数较多,于是可以设置多个数据库,将不同的数据子表放入多个数据库中,例如,设置5个数据库,每个数据库存放3个数据子表。当然,在确定每个数据库存放的数据子表的数据量的时候,不一定设置为每个数据库存放的数据子表的数量相同。例如,数据表3的5个数据库,第一个数据库存2个数据子表,第二个数据库存放4个数据子表,第三个数据库存放3个数据子表,第四个数据库存放2个数据子表,第五个数据库存放4个数据子表。
为了更清楚的说明本发明实施例中对数据的切分,如图6所示,首先按业务类型将数据切分,得到多个数据表,然后再对每个数据表进行切分,得到多个数据子表。
上述数据的切分方法,首先获取数据集和所述数据集中数据的业务类型;并且根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;然后获取每个所述数据表中的数据条数;最后根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。可见,通过上述方式,由于获取到了多个数据子表对原始的数据集进行存放,而不是将原始的数据集存放于一个数据表中,所以在后续要查数据的时候,可以直接在某一个数据子表中查询,而不是在一个大的存储原始数据集的数据表中进行查询,由于查询量减少,所以能够提高查询效率,提高响应效率,并且,上述数据的切分方式将数据首先按业务切分,然后再对经过业务切分的表进行再次切分,使得最终得到的数据子表相对只有一次切分得到的数据子表更小,进一步的提高了查询效率和响应效率。
如图7所示,本发明实施例提供一种数据的切分方法,具体包括如下步骤:
步骤702,获取数据集和所述数据集中数据的业务类型。
步骤704,根据所述业务类型对所述数据集的数据进行切分,得到多个数据表。
步骤706,获取每个所述数据表中的数据条数。
步骤708,根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
步骤710,将所述业务类型和所述数据表的对应关系、所述数据表与相应的所述数据子表的对应关系以及所述数据子表中的每条数据对应的数据标识发送到数据表管理中心,以使所述数据表管理中心根据接收到的数据处理请求中的业务类型和数据标识从相应的数据子表中查找与所述数据标识对应的数据。
所述数据标识,为序号,用于指示数据子表中的第几条数据,例如,用数据标识0001标识该数据子表中的第一条数据,用0002标识数据子表中的第二条数据;所述数据标识,为字段标识,用于标识数据子表中某一字段的数据,例如,某一数据子表的主字段为用户,那么用数据标识0910标识用户1,0920标识用户2。
所述对应关系,指示只要知道业务类型就知道该业务类型的数据存放在哪个数据表,或者只要知道数据表就能知道该数据表存放的是哪个业务类型的数据,同时,根据对应关系还知道表存放的位置(所述位置反映表所在的数据库和服务器,即不同的表不仅可以存放于不同的数据库,甚至可以存放在不同的服务器上面),例如表1所示。
表1
如图8所示,数据表管理中心接收到终端发送的数据处理请求,然后从该数据处理请求中获取到业务类型和数据标识,首先根据获取到的业务类型,知道该业务类型的数据存放于数据表3中,进一步的,根据数据标识,知道该数据标识对应的数据存放于数据子表2中,于是从数据子表2中查找与所述数据标识对应的数据,这样,能够大大的提高数据的查询效率,因为其只用在数据子表2中进行查找既可。
如图9所示,本发明实施例提供一种数据的切分装置900,该装置900包括:
第一获取模块902,用于获取数据集和所述数据集中数据的业务类型;
第一切分模块904,用于根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;
第二获取模块906,用于获取每个所述数据表中的数据条数;
第二切分模块908,用于根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
上述数据的切分装置,首先获取数据集和所述数据集中数据的业务类型;并且根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;然后获取每个所述数据表中的数据条数;最后根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。可见,通过上述方式,由于获取到了多个数据子表对原始的数据集进行存放,而不是将原始的数据集存放于一个数据表中,所以在后续要查数据的时候,可以直接在某一个数据子表中查询,而不是在一个大的存储原始数据集的数据表中进行查询,由于查询量减少,所以能够提高查询效率,提高响应效率,并且,上述数据的切分方式将数据首先按业务切分,然后再对经过业务切分的表进行再次切分,使得最终得到的数据子表相对只有一次切分得到的数据子表更小,进一步的提高了查询效率和响应效率。
在其中一个实施例中,所述数据的切分装置900,还包括:
第一个数确定模块,用于根据所述数据表的个数,确定数据库的个数;
第一数据库存放模块,用于将所述多个数据表存放于确定的多个数据库中。
在其中一个实施例中,所述第二切分模块908,包括:
占用空间获取模块,用于获取每个所述数据表中的每条数据对应的占用空间;
占用空间确定模块,用于根据所述数据表中的数据条数和所述数据表中的每条数据对应的占用空间确定所述数据表对应的数据子表的个数;
占用空间切分模块,用于根据所述数据子表的个数对所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
在其中一个实施例中,所述数据的切分装置900,还包括:
第二个数确定模块,用于根据所述数据子表的个数,确定数据库的个数;
第二数据库存放模块,用于将所述多个数据子表存放于确定的多个数据库中。
在其中一个实施例中,所述第二切分模块908,还包括:
字段数字标识获取模块,用于获取每个所述数据表中每条数据对应的字段数字标识;
求模模块,用于对所述字段数字标识进行求模运算,得到求模结果;
求模切分模块,用于根据所述求模结果和所述数据条数对相应的数据表进行切分,得到每个所述数据表对应的多个数据子表。
图10示出了一个实施例中计算机设备的内部结构图。该计算机设备具体可以是服务器。如图10所示,该计算机设备包括通过系统总线连接的处理器、存储器和网络接口。其中,存储器包括非易失性存储介质和内存储器。该计算机设备的非易失性存储介质存储有操作系统,还可存储有计算机程序,该计算机程序被处理器执行时,可使得处理器实现数据的切分方法。该内存储器中也可储存有计算机程序,该计算机程序被处理器执行时,可使得处理器执行数据的切分方法。网络接口用于与外部进行通信。本领域技术人员可以理解,图10中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,本申请提供的数据的切分方法可以实现为一种计算机程序的形式,计算机程序可在如图10所示的计算机设备上运行。计算机设备的存储器中可存储组成数据的切分装置的各个程序模板。比如,第一获取模块902、第一切分模块904、第二获取模块906以及第二切分模块908。
具体的,本发明实施例所述的计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如下步骤:
获取数据集和所述数据集中数据的业务类型;
根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;
获取每个所述数据表中的数据条数;
根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
上述计算机设备,首先获取数据集和所述数据集中数据的业务类型;并且根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;然后获取每个所述数据表中的数据条数;最后根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。可见,通过上述方式,由于获取到了多个数据子表对原始的数据集进行存放,而不是将原始的数据集存放于一个数据表中,所以在后续要查数据的时候,可以直接在某一个数据子表中查询,而不是在一个大的存储原始数据集的数据表中进行查询,由于查询量减少,所以能够提高查询效率,提高响应效率,并且,上述数据的切分方式将数据首先按业务切分,然后再对经过业务切分的表进行再次切分,使得最终得到的数据子表相对只有一次切分得到的数据子表更小,进一步的提高了查询效率和响应效率。
在其中一个实施例中,上述计算机程序被所述处理器执行时,还用于执行以下步骤:
根据所述数据表的个数,确定数据库的个数;
将所述多个数据表存放于确定的多个数据库中。
在其中一个实施例中,所述根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表,包括:
获取每个所述数据表中的每条数据对应的占用空间;
根据所述数据表中的数据条数和所述数据表中的每条数据对应的占用空间确定所述数据表对应的数据子表的个数;
根据所述数据子表的个数对所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
在其中一个实施例中,上述计算机程序被所述处理器执行时,还用于执行以下步骤:
根据所述数据子表的个数,确定数据库的个数;
将所述多个数据子表存放于确定的多个数据库中。
在其中一个实施例中,所述根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表,包括:
获取每个所述数据表中每条数据对应的字段数字标识;
对所述字段数字标识进行求模运算,得到求模结果;
根据所述求模结果和所述数据条数对相应的数据表进行切分,得到每个所述数据表对应的多个数据子表。
在其中一个实施例中,上述计算机程序被所述处理器执行时,还用于执行以下步骤:
将所述业务类型和所述数据表的对应关系、所述数据表与相应的所述数据子表的对应关系以及所述数据子表中的每条数据对应的数据标识发送到数据表管理中心,以使所述数据表管理中心根据接收到的数据处理请求中的业务类型和数据标识从相应的数据子表中查找与所述数据标识对应的数据。
一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行如下步骤:
获取数据集和所述数据集中数据的业务类型;
根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;
获取每个所述数据表中的数据条数;
根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
上述计算机可读存储介质,首先获取数据集和所述数据集中数据的业务类型;并且根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;然后获取每个所述数据表中的数据条数;最后根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。可见,通过上述方式,由于获取到了多个数据子表对原始的数据集进行存放,而不是将原始的数据集存放于一个数据表中,所以在后续要查数据的时候,可以直接在某一个数据子表中查询,而不是在一个大的存储原始数据集的数据表中进行查询,由于查询量减少,所以能够提高查询效率,提高响应效率,并且,上述数据的切分方式将数据首先按业务切分,然后再对经过业务切分的表进行再次切分,使得最终得到的数据子表相对只有一次切分得到的数据子表更小,进一步的提高了查询效率和响应效率。
在其中一个实施例中,上述计算机程序被所述处理器执行时,还用于执行以下步骤:
根据所述数据表的个数,确定数据库的个数;
将所述多个数据表存放于确定的多个数据库中。
在其中一个实施例中,所述根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表,包括:
获取每个所述数据表中的每条数据对应的占用空间;
根据所述数据表中的数据条数和所述数据表中的每条数据对应的占用空间确定所述数据表对应的数据子表的个数;
根据所述数据子表的个数对所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
在其中一个实施例中,上述计算机程序被所述处理器执行时,还用于执行以下步骤:
根据所述数据子表的个数,确定数据库的个数;
将所述多个数据子表存放于确定的多个数据库中。
在其中一个实施例中,所述根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表,包括:
获取每个所述数据表中每条数据对应的字段数字标识;
对所述字段数字标识进行求模运算,得到求模结果;
根据所述求模结果和所述数据条数对相应的数据表进行切分,得到每个所述数据表对应的多个数据子表。
在其中一个实施例中,上述计算机程序被所述处理器执行时,还用于执行以下步骤:
将所述业务类型和所述数据表的对应关系、所述数据表与相应的所述数据子表的对应关系以及所述数据子表中的每条数据对应的数据标识发送到数据表管理中心,以使所述数据表管理中心根据接收到的数据处理请求中的业务类型和数据标识从相应的数据子表中查找与所述数据标识对应的数据。
需要说明的是,上述数据的切分方法实施例、数据的切分装置实施例、计算机设备实施例和计算机可读存储介质实施例属于同一发明构思,方法实施例、装置实施例、计算机设备实施例和计算机可读存储介质实施例中的内容可相互适用。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink) DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。
Claims (10)
- 一种数据的切分方法,其特征在于,所述方法包括:获取数据集和所述数据集中数据的业务类型;根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;获取每个所述数据表中的数据条数;根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
- 如权利要求1所述的方法,其特征在于,在所述根据所述业务类型对所述数据集的数据进行切分,得到多个数据表之后,还包括:根据所述数据表的个数,确定数据库的个数;将所述多个数据表存放于确定的多个数据库中。
- 如权利要求1所述的方法,其特征在于,所述根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表,包括:获取每个所述数据表中的每条数据对应的占用空间;根据所述数据表中的数据条数和所述数据表中的每条数据对应的占用空间确定所述数据表对应的数据子表的个数;根据所述数据子表的个数对所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
- 如权利要求3所述的方法,其特征在于,在所述根据所述数据子表的个数对所述数据表进行切分,得到每个所述数据表对应的多个数据子表之后,还包括:根据所述数据子表的个数,确定数据库的个数;将所述多个数据子表存放于确定的多个数据库中。
- 如权利要求1所述的方法,其特征在于,所述根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表,包括:获取每个所述数据表中每条数据对应的字段数字标识;对所述字段数字标识进行求模运算,得到求模结果;根据所述求模结果和所述数据条数对相应的数据表进行切分,得到每个所述数据表对应的多个数据子表。
- 如权利要求1至5任一项所述的方法,其特征在于,在所述根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表之后,还包括:将所述业务类型和所述数据表的对应关系、所述数据表与相应的所述数据子表的对应关系以及所述数据子表中的每条数据对应的数据标识发送到数据表管理中心,以使所述数据表管理中心根据接收到的数据处理请求中的业务类型和数据标识从相应的数据子表中查找与所述数据标识对应的数据。
- 一种数据的切分装置,其特征在于,所述装置包括:第一获取模块,用于获取数据集和所述数据集中数据的业务类型;第一切分模块,用于根据所述业务类型对所述数据集的数据进行切分,得到多个数据表;第二获取模块,用于获取每个所述数据表中的数据条数;第二切分模块,用于根据所述数据条数对相应的所述数据表进行切分,得到每个所述数据表对应的多个数据子表。
- 如权利要求7所述的装置,其特征在于,还包括:第一个数确定模块,用于根据所述数据表的个数,确定数据库的个数;第一数据库存放模块,用于将所述多个数据表存放于确定的多个数据库中。
- 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如权利要求1至6中任一项所述方法的步骤。
- 在一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行如权利要求1至6中任一项所述方法的步骤。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811559134.1 | 2018-12-19 | ||
| CN201811559134.1A CN111339133B (zh) | 2018-12-19 | 2018-12-19 | 数据的切分方法、装置、计算机设备及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020124491A1 true WO2020124491A1 (zh) | 2020-06-25 |
Family
ID=71100999
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/122380 Ceased WO2020124491A1 (zh) | 2018-12-19 | 2018-12-20 | 数据的切分方法、装置、计算机设备及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN111339133B (zh) |
| WO (1) | WO2020124491A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114625716A (zh) * | 2022-01-20 | 2022-06-14 | 湖南亚信安慧科技有限公司 | 数据库分库分表扩容方法、装置及计算机可读存储介质 |
| CN114691119A (zh) * | 2022-05-10 | 2022-07-01 | 中国建设银行股份有限公司 | 一种业务中新增内容的实现方法、装置、设备及介质 |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116204526A (zh) * | 2022-12-12 | 2023-06-02 | 中国电信股份有限公司 | 一种数据的获取方法、装置、电子设备和存储介质 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103605755A (zh) * | 2013-11-23 | 2014-02-26 | 华中科技大学 | 一种谚文数据库、构建方法及谚文数据库检索系统 |
| CN106294740A (zh) * | 2016-08-10 | 2017-01-04 | 北京创锐文化传媒有限公司 | 数据处理方法、装置及服务器 |
| US9600553B1 (en) * | 2014-05-31 | 2017-03-21 | Veritas Technologies Llc | Distributed replication in cluster environments |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP3860992B2 (ja) * | 2001-11-09 | 2006-12-20 | 株式会社ターボデータラボラトリー | データの結合・提示方法、および、データ結合・提示プログラム |
| JP4758429B2 (ja) * | 2005-08-15 | 2011-08-31 | 株式会社ターボデータラボラトリー | 共有メモリ型マルチプロセッサシステム及びその情報処理方法 |
| CN102004804B (zh) * | 2010-12-31 | 2012-09-05 | 西北大学 | 一种范围型数据的存储及查询方法 |
| US10108669B1 (en) * | 2014-03-21 | 2018-10-23 | Xactly Corporation | Partitioning data stores using tenant specific partitioning strategies |
| US10140343B2 (en) * | 2015-02-09 | 2018-11-27 | Ca, Inc. | System and method of reducing data in a storage system |
| CN105488231B (zh) * | 2016-01-22 | 2018-07-20 | 杭州电子科技大学 | 一种基于自适应表维度划分的大数据处理方法 |
| CN108090225B (zh) * | 2018-01-05 | 2023-06-30 | 腾讯科技(深圳)有限公司 | 数据库实例的运行方法、装置、系统及计算机可读存储介质 |
-
2018
- 2018-12-19 CN CN201811559134.1A patent/CN111339133B/zh active Active
- 2018-12-20 WO PCT/CN2018/122380 patent/WO2020124491A1/zh not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103605755A (zh) * | 2013-11-23 | 2014-02-26 | 华中科技大学 | 一种谚文数据库、构建方法及谚文数据库检索系统 |
| US9600553B1 (en) * | 2014-05-31 | 2017-03-21 | Veritas Technologies Llc | Distributed replication in cluster environments |
| CN106294740A (zh) * | 2016-08-10 | 2017-01-04 | 北京创锐文化传媒有限公司 | 数据处理方法、装置及服务器 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114625716A (zh) * | 2022-01-20 | 2022-06-14 | 湖南亚信安慧科技有限公司 | 数据库分库分表扩容方法、装置及计算机可读存储介质 |
| CN114691119A (zh) * | 2022-05-10 | 2022-07-01 | 中国建设银行股份有限公司 | 一种业务中新增内容的实现方法、装置、设备及介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111339133A (zh) | 2020-06-26 |
| CN111339133B (zh) | 2022-08-05 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR101994021B1 (ko) | 파일 조작 방법 및 장치 | |
| US9721015B2 (en) | Providing a query results page | |
| CN107704202B (zh) | 一种数据快速读写的方法和装置 | |
| CN112015820A (zh) | 分布式图数据库实现的方法、系统、电子装置和存储介质 | |
| CN105677904B (zh) | 基于分布式文件系统的小文件存储方法及装置 | |
| CN107911461B (zh) | 云存储系统中的对象处理方法、存储服务器及云存储系统 | |
| WO2016074370A1 (zh) | 一种KeyValue数据库的数据表的更新方法与表数据更新装置 | |
| CN102725753A (zh) | 优化数据访问的方法及装置、优化数据存储的方法及装置 | |
| CN107015985A (zh) | 一种数据存储与获取方法及装置 | |
| CN107798135B (zh) | 分页查询方法及装置和电子设备 | |
| WO2019165763A1 (zh) | 一种用于查询数据的方法 | |
| CN111723161B (zh) | 一种数据处理方法、装置及设备 | |
| US20140019454A1 (en) | Systems and Methods for Caching Data Object Identifiers | |
| WO2017161540A1 (zh) | 数据查询的方法、数据对象的存储方法和数据系统 | |
| CN115994148B (zh) | 多表数据的更新方法、装置、电子设备及可读存储介质 | |
| CN116860700B (zh) | 处理分布式文件系统中元数据的方法、装置、设备及介质 | |
| CN111435376A (zh) | 信息处理方法及系统、计算机系统和计算机可读存储介质 | |
| WO2020124491A1 (zh) | 数据的切分方法、装置、计算机设备及存储介质 | |
| CN116303657B (zh) | 群体画像生成方法、装置、计算机设备和存储介质 | |
| CN115062044B (zh) | 一种数据查询方法、装置、设备及存储介质 | |
| CN107402982A (zh) | 数据写入、数据匹配方法、装置及计算设备 | |
| CN115185573A (zh) | 应用配置信息的配置方法、装置、计算机设备和存储介质 | |
| CN111651466B (zh) | 数据采样方法及装置 | |
| CN111209284B (zh) | 基于元数据的分表方法及装置 | |
| CN114519062B (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: 18943661 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: 18943661 Country of ref document: EP Kind code of ref document: A1 |
