CN113486023A - Database and table dividing method and device - Google Patents

Database and table dividing method and device Download PDF

Info

Publication number
CN113486023A
CN113486023A CN202110851079.9A CN202110851079A CN113486023A CN 113486023 A CN113486023 A CN 113486023A CN 202110851079 A CN202110851079 A CN 202110851079A CN 113486023 A CN113486023 A CN 113486023A
Authority
CN
China
Prior art keywords
main key
self
data information
database
key
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.)
Pending
Application number
CN202110851079.9A
Other languages
Chinese (zh)
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.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202110851079.9A priority Critical patent/CN113486023A/en
Publication of CN113486023A publication Critical patent/CN113486023A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR 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/24Querying
    • G06F16/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Abstract

The invention discloses a database sub-base and sub-table method and a device, which can be used in the technical field of big data, wherein the method comprises the following steps: receiving first data information; determining the business main key of the first data information corresponding to the self-adding main key according to the business main key of the first data information and the mapping relation between the business main key and the self-adding main key; determining the position of the database corresponding to the service main key of the first data information and the self-adding main key according to the mapping relation between the self-adding main key and the sub-database sub-table rule; and storing the first data information into the database position corresponding to the self-increment main key corresponding to the service main key of the first data information. When newly added data information needs to be put into a database, original data information does not need to be redistributed, and the newly added data information is distributed to the corresponding database table in a self-increment mode, so that the database sorting efficiency can be improved, and the processing flow can be simplified.

Description

Database and table dividing method and device
Technical Field
The invention relates to the technical field of big data, in particular to a database sorting and tabulating method and device.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
In actual life, the data volume in the database is not necessarily controllable, and under the condition that the database is not subjected to database partitioning and table partitioning, along with the increase of time and the continuous development and development of system service volume, the tables in the database are more and more, the data volume in the tables is also more and more, and correspondingly, the expenses of data operation, increase, deletion, modification and check are also more and more increased; moreover, the resources of the server are limited, and finally, the data volume and the data processing capacity carried by the database are all subjected to bottlenecks, and at this time, the database needs to be sorted and tabulated to solve the problems. The existing database sub-table and sub-database schemes comprise a vertical segmentation scheme and a horizontal segmentation scheme, when new data needs to be put into a database and put into a table, the original data and the new data need to be redistributed, and the corresponding data are distributed to corresponding database tables, so that the processing flow is complex, the processing efficiency is low, and a large amount of manpower and material resources are consumed.
Disclosure of Invention
The embodiment of the invention provides a database sorting and tabulating method, which is used for improving the efficiency of database sorting and tabulating and simplifying the processing flow and comprises the following steps:
receiving first data information;
determining the business main key of the first data information corresponding to the self-adding main key according to the business main key of the first data information and the mapping relation between the business main key and the self-adding main key;
determining the position of the database corresponding to the service main key of the first data information and the self-adding main key according to the mapping relation between the self-adding main key and the sub-database sub-table rule;
and storing the first data information into the database position corresponding to the self-increment main key corresponding to the service main key of the first data information.
The embodiment of the invention also provides a database and table dividing device, which is used for improving the database and table dividing efficiency and simplifying the processing flow and comprises the following steps:
the data receiving module is used for receiving first data information;
the first self-increment key determining module is used for determining the self-increment key corresponding to the service main key of the first data information according to the service main key of the first data information and the mapping relation between the service main key and the self-increment key;
the first position determining module is used for determining the position of the database corresponding to the service main key of the first data information and the self-increment main key according to the mapping relation between the self-increment main key and the sub-database sub-table rule;
and the data storage module is used for storing the first data information into the database position corresponding to the self-increment main key corresponding to the service main key of the first data information.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the database sub-base and sub-table method when executing the computer program.
The embodiment of the invention also provides a computer readable storage medium, and the computer readable storage medium stores a computer program for executing the database sub-database and sub-table method.
In the embodiment of the invention, first data information is received; determining the business main key of the first data information corresponding to the self-adding main key according to the business main key of the first data information and the mapping relation between the business main key and the self-adding main key; determining the position of the database corresponding to the service main key of the first data information and the self-adding main key according to the mapping relation between the self-adding main key and the sub-database sub-table rule; compared with the technical scheme of performing library division and table division by vertical segmentation or horizontal segmentation in the prior art, the method has the advantages that the first data information is stored in the database position corresponding to the service main key of the first data information and the self-increment main key, and the mapping relation between the service main key and the self-increment main key and the mapping relation between the self-increment main key and the rule of the library division and table division are adopted, when newly added data information needs to be put into a library and a table, the original data information does not need to be redistributed, and the newly added data information is distributed to the corresponding database table in a self-increment mode, so that the efficiency of the library division and table division of the database can be improved, and the processing flow is simplified.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
FIG. 1 is a flowchart of a method for database sorting and tabulation according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an embodiment of a method for database sorting and tabulating according to the present invention;
FIG. 3 is a flowchart illustrating an embodiment of a method for database sorting and tabulating according to the present invention;
FIG. 4 is a flowchart illustrating an embodiment of a method for database sorting and tabulating according to the present invention;
FIG. 5 is a schematic structural diagram of an apparatus for database sorting and tabulation according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating an exemplary structure of an apparatus for sorting and tabulating a database according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating an exemplary structure of an apparatus for splitting database into banks and tables according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an embodiment of an apparatus for database sorting and table sorting according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
In order to improve the efficiency of database division and table division and simplify the processing flow, the embodiment of the invention distributes the newly added data information to the corresponding database table in a self-increasing mode through the mapping relation between the service main key and the self-increasing main key and the mapping relation between the self-increasing main key and the table division rule of the database. FIG. 1 is a flowchart of a database sorting and tabulating method according to an embodiment of the present invention. As shown in fig. 1, the method for database sorting and table sorting in the embodiment of the present invention may include:
step 101, receiving first data information;
step 102, determining an autonomous key corresponding to the business primary key of the first data information according to the business primary key of the first data information and the mapping relation between the business primary key and the autonomous key;
103, determining the position of the database corresponding to the service main key of the first data information and the self-adding main key according to the mapping relation between the self-adding main key and the sub-database sub-table rule;
and step 104, storing the first data information into a database position corresponding to the service main key of the first data information and the self-increment main key.
It can be known from the flow shown in fig. 1 that the database sub-table of the embodiment of the present invention is different from the technical scheme of performing sub-table division by vertical division or horizontal division in the prior art, and the mapping relationship between the service main key and the auto-increment main key and the mapping relationship between the auto-increment main key and the sub-table rule are used, when newly added data information needs to be put into a table, the original data information does not need to be redistributed, and the newly added data information is distributed to the corresponding database table in an auto-increment manner, so that the database sub-table efficiency can be improved, and the processing flow can be simplified.
In one embodiment, the receiving the first data information may be: the Database receives first data information from a DBMS (Database Management System), which is a large software for manipulating and managing the Database and is used for building, using and maintaining the Database, users access data in the Database through the DBMS, and a Database administrator maintains the Database through the DBMS, and the DBMS can support a plurality of applications and users to build, modify and query the Database at the same time or different times in different ways. For example, the database receives the first data message from the DBMS as an incremental data message.
In one embodiment, after the first data information is received, the service primary key of the first data information is determined to correspond to the self-adding primary key according to the service primary key of the first data information and the mapping relation between the service primary key and the self-adding primary key.
The service primary key of the data information refers to a field having a service logic meaning in a database table in the data information, for example, the service primary key according to the first data information is: identification document ID (identification number).
The method comprises the steps that an automatic addition main key which is added with one according to the field value is stored in a database, a one-to-one mapping relation is established between the business main key of the first data information and the automatic addition main key, and the business main key of the first data information can be determined by corresponding to the automatic addition main key.
For example, 1000 autonomous keys with field values of 1 to 1000 are stored in the database, and after the first data information is received, the autonomous key corresponding to the business primary key ID1 of the first data information is determined to be the autonomous key with field value 1 according to the business primary key ID1 of the first data information and the mapping relation established between the business primary key ID1 of the first data information and the autonomous key with field value 1.
In one embodiment, after determining that the business main key of the first data information corresponds to the self-increment main key according to the business main key of the first data information and the mapping relation between the business main key and the self-increment main key, determining the database position corresponding to the business main key of the first data information corresponding to the self-increment main key according to the business main key of the first data information corresponding to the self-increment main key and the mapping relation between the self-increment main key and the database sub-table rule. For example, according to the value of the self-increment key with the value of 1 corresponding to the service primary key ID1 of the first data information and the mapping relationship between the self-increment key with the value of 1 and the sub-database sub-table rule, the database position corresponding to the self-increment key with the value of 1 corresponding to the service primary key ID1 of the first data information is determined.
In one embodiment, in step 103, the sub-library and sub-table rule may include: each data bin size, and each data bin table size. For example, the database partitioning rule may be to partition the database, each database size may be to set a capacity size of each database to a fixed value, and each data partitioning size may be to set a capacity size of each table to a fixed value. The sub-database and sub-table rule can be a sub-database and sub-table rule table stored in a database or a cache. The sub-library and sub-table rule table can also describe: and the number of the autonomic keys is the same as that of the data information stored in the database, and each autonomic key and each row of data information in each data sub-table establish a one-to-one mapping relation, wherein the autonomic keys can be automatically added in a form of automatically adding one according to field values.
For example, each data sub-library has a size of 10000, two databases are a first library and a second library, each data sub-table has a size of 5000, one database has two data tables, the two data tables of the first library are a first table and a second table, the two data tables of the second library are a third table and a fourth table, the sub-library sub-table rule table is stored in the database, and the self-increment key is described in the sub-library sub-table rule table as follows: mapping a first base of autonomous keys with the field value of 1-10000, mapping a first table of autonomous keys with the field value of 1-5000, and mapping a second table of autonomous keys with the field value of 5001-10000; the second library of autonomous key mapping with field value of 10001-20000, the third table of autonomous key mapping with field value of 10001-15000, and the fourth table of autonomous key mapping with field value of 15000-20000.
In one embodiment, after the database position corresponding to the self-increment key corresponding to the service main key of the first data information is determined according to the mapping relation between the self-increment key and the database-dividing rule, the first data information is stored in the database position corresponding to the self-increment key corresponding to the service main key of the first data information. For example, the first data information is stored in the database location corresponding to the service primary key ID1 of the first data information and the self-increment key with the field value of 1, for example, in the first library.
FIG. 2 is a flowchart illustrating an embodiment of a method for database sorting and tabulating according to the present invention. As shown in fig. 2, the method for database sorting and table sorting in the embodiment of the present invention may further include:
step 201, receiving a query request for second data information;
step 202, determining an autonomous key corresponding to the business primary key of the second data information according to the business primary key of the second data information and the mapping relation between the business primary key and the autonomous key;
step 203, determining the database position corresponding to the service main key of the second data information and the self-increment main key according to the mapping relation between the self-increment main key and the sub-database sub-table rule;
and step 204, inquiring the second data information from the database position corresponding to the service main key of the second data information and the self-increment main key.
As can be seen from the flow shown in fig. 2, when querying data information stored in the database, the database sub-table according to the embodiment of the present invention queries the data information from the database location corresponding to the self-increment main key through the mapping relationship between the service main key and the self-increment main key and the mapping relationship between the self-increment main key and the sub-table rule, so as to implement efficient query of the data information in the database.
In one embodiment, the receiving of the query request for the second data information may be: the database receives a query request for the second data information in the DBMS, for example, the query request may be for ID information.
For example, the autonomous key corresponding to the business primary key of the second data information is determined according to the business primary key of the second data information and the mapping relationship between the business primary key and the autonomous key, for example, the autonomous key corresponding to the business primary key ID1 of the second data information is determined as the autonomous key with the field value of 1 according to the business primary key ID1 of the second data information and the mapping relationship between the business primary key ID1 and the autonomous key.
In one embodiment, after determining that the service primary key of the second data information corresponds to the self-increment primary key according to the service primary key of the second data information and the mapping relationship between the service primary key and the self-increment primary key, the database position corresponding to the service primary key of the second data information corresponding to the self-increment primary key is determined according to the mapping relationship between the self-increment primary key of the second data information and the database partitioning rule. For example, according to the self-increment key 1 corresponding to the service primary key ID1 of the second data information and the mapping relation between the self-increment key 1 and the sub-library and sub-list rule table, the position of the database corresponding to the self-increment key 1 of the service primary key ID1 of the second data information is determined to be the first row of the first table of the first library.
In one embodiment, after determining the database position corresponding to the service main key of the second data information according to the mapping relationship between the service main key of the second data information and the self-adding main key and the sub-database sub-table rule, the second data information is queried from the database position corresponding to the self-adding main key corresponding to the service main key of the second data information. For example, the second data information is queried to request ID card ID information from the first row of the first table of the first library corresponding to the self-increment key 1 corresponding to the service primary key ID1 of the second data information.
FIG. 3 is a flowchart illustrating an embodiment of a method for database sorting and tabulating according to the present invention. As shown in fig. 3, the method for database sorting and table sorting in the embodiment of the present invention may further include:
step 301, receiving a first update request of a mapping relation between a service main key and an autonomic key;
and step 302, updating the mapping relation between the service main key and the self-adding main key according to the first updating request.
As can be known from the flow shown in fig. 3, in the embodiment of the present invention, the mapping relationship between the service primary key and the autonomic key may be updated according to the requirement.
In one embodiment, the receiving of the first update request of the mapping relationship between the business primary key and the autonomic key may be: requesting to add a new service primary key, and establishing a mapping relation between the new service primary key and the self-adding primary key. For example, a new name is requested to be added as a service primary key, and a mapping relationship between the new name service primary key and the self-adding primary key is established.
In one embodiment, after receiving a first update request of the mapping relationship between the service primary key and the autonomic key, the mapping relationship between the service primary key and the autonomic key is updated according to the first update request. For example, according to a first update request of the mapping relationship between the name service primary key and the self-adding primary key, the name service primary key is newly added, and the mapping relationship between the newly added name service primary key and the self-adding primary key is established.
FIG. 4 is a flowchart illustrating an embodiment of a method for database sorting and tabulating according to the present invention. As shown in fig. 4, the method for database sorting and table sorting in the embodiment of the present invention may further include:
step 401, receiving a second updating request of the mapping relation between the self-increment key and the sub-base and sub-table rules;
and step 402, updating the mapping relation between the self-increment key and the sub-base and sub-table rules according to the second updating request.
As can be seen from the flow shown in fig. 4, in the embodiment of the present invention, the mapping relationship between the autonomic key and the sub-library and sub-table rule may be updated according to the requirement.
In one embodiment, the second update request for receiving the mapping relationship between the autonomic key and the sub-base and sub-table rule may be: and the database is full of data information, and a new database is requested to be added to store the data information. For example, when the first library and the second library are full of 20000 pieces of data information, and the 20001 th piece of data information is to be stored in the database, a new database is requested to store the data information, and the mapping relationship between the autonomic key and the sub-library and sub-table rule is updated accordingly.
In one embodiment, after receiving a second updating request of the mapping relation between the self-increment key and the sub-base sub-table rule, the mapping relation between the self-increment key and the sub-base sub-table rule is updated according to the second updating request. For example, a third library is added, and the mapping relation between the autonomous key with the field value of 20001-30000 and the third library is updated.
The embodiment of the invention also provides a database sub-database and sub-table device, which is described in the following embodiment. Because the principle of solving the problems of the device is similar to the database sorting and listing method, the implementation of the device can refer to the implementation of the database sorting and listing method, and repeated parts are not repeated.
FIG. 5 is a schematic structural diagram of an apparatus for database sorting and table sorting according to an embodiment of the present invention. As shown in fig. 5, the apparatus for database sorting and table sorting in the embodiment of the present invention may include:
a data receiving module 501, configured to receive first data information;
a first autonomic key determining module 502, configured to determine, according to a business principal key of the first data information and a mapping relationship between the business principal key and the autonomic key, that the business principal key of the first data information corresponds to the autonomic key;
the first position determining module 503 is configured to determine, according to the autonomous key corresponding to the service primary key of the first data information and the mapping relationship between the autonomous key and the sub-database sub-table rule, a database position corresponding to the autonomous key corresponding to the service primary key of the first data information;
the data storage module 504 is configured to store the first data information in a database location corresponding to the service master key of the first data information and the self-increment master key.
Fig. 6 is a schematic structural diagram of an embodiment of an apparatus for database sorting and table sorting according to an embodiment of the present invention. As shown in fig. 6, the apparatus for database sorting and table sorting shown in fig. 5 may further include:
a data query module 601, configured to receive a query request for second data information;
a second autonomic key determining module 602, configured to determine, according to the business primary key of the second data information and the mapping relationship between the business primary key and the autonomic key, that the business primary key of the second data information corresponds to the autonomic key;
a second position determining module 603, configured to determine, according to the autonomous key corresponding to the service primary key of the second data information and the mapping relationship between the autonomous key and the sub-database sub-table rule, a database position corresponding to the autonomous key corresponding to the service primary key of the second data information;
the query module 604 is configured to query the second data information from a database location corresponding to the service primary key of the second data information and the self-increment primary key.
In one embodiment, the library and table rules comprise: each data bin size, and each data bin table size.
Fig. 7 is a schematic structural diagram of an embodiment of an apparatus for database sorting and table sorting according to an embodiment of the present invention. As shown in fig. 7, the apparatus for database sorting and table sorting shown in fig. 5 may further include:
a first updating module 701, configured to receive a first updating request of a mapping relationship between a service primary key and an autonomic key;
and updating the mapping relation between the service main key and the self-adding main key according to the first updating request.
The first updating module 701 in the embodiment may also be included in the device for database sub-table shown in fig. 6.
Fig. 8 is a schematic structural diagram of an embodiment of an apparatus for database sorting and table sorting according to an embodiment of the present invention. As shown in fig. 8, the apparatus for database sorting and table sorting shown in fig. 5 may further include:
a second updating module 801, configured to receive a second updating request of a mapping relationship between an autonomic key and a sub-base and sub-table rule;
and updating the mapping relation between the self-increment main key and the sub-base and sub-table rules according to the second updating request.
The second updating module 801 in this embodiment may also be included in the database sub-table apparatus shown in fig. 6 or fig. 7.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the database sub-base and sub-table method when executing the computer program.
The embodiment of the invention also provides a computer readable storage medium, and the computer readable storage medium stores a computer program for executing the database sub-database and sub-table method.
In the embodiment of the present invention, data information is received, where the data information includes: receiving first data information; determining the business main key of the first data information corresponding to the self-adding main key according to the business main key of the first data information and the mapping relation between the business main key and the self-adding main key; determining the position of the database corresponding to the service main key of the first data information and the self-adding main key according to the mapping relation between the self-adding main key and the sub-database sub-table rule; compared with the technical scheme of performing library division and table division by vertical segmentation or horizontal segmentation in the prior art, the method has the advantages that the first data information is stored in the database position corresponding to the service main key of the first data information and the self-increment main key, and the mapping relation between the service main key and the self-increment main key and the mapping relation between the self-increment main key and the rule of the library division and table division are adopted, when newly added data information needs to be put into a library and a table, the original data information does not need to be redistributed, and the newly added data information is distributed to the corresponding database table in a self-increment mode, so that the efficiency of the library division and table division of the database can be improved, and the processing flow is simplified.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (12)

1. A database and table dividing method is characterized by comprising the following steps:
receiving first data information;
determining the business main key of the first data information corresponding to the self-adding main key according to the business main key of the first data information and the mapping relation between the business main key and the self-adding main key;
determining the position of the database corresponding to the service main key of the first data information and the self-adding main key according to the mapping relation between the self-adding main key and the sub-database sub-table rule;
and storing the first data information into the database position corresponding to the self-increment main key corresponding to the service main key of the first data information.
2. The method of claim 1, further comprising:
receiving a query request for second data information;
determining the business main key of the second data information corresponding to the self-increment main key according to the business main key of the second data information and the mapping relation between the business main key and the self-increment main key;
determining the position of the database corresponding to the service main key of the second data information and the self-increment main key according to the mapping relation between the self-increment main key and the sub-database sub-table rule;
and querying the second data information from the database position corresponding to the self-increment main key corresponding to the service main key of the second data information.
3. The method of claim 1, wherein the banking and tabulating rules comprise:
each data bin size, and each data bin table size.
4. The method of claim 1, further comprising:
receiving a first updating request of a mapping relation between a service main key and an autonomic key;
and updating the mapping relation between the service main key and the self-adding main key according to the first updating request.
5. The method of claim 1, further comprising:
receiving a second updating request of the mapping relation between the self-increment main key and the sub-base and sub-table rules;
and updating the mapping relation between the self-increment main key and the sub-base and sub-table rules according to the second updating request.
6. An apparatus for database sorting and tabulation, comprising:
the data receiving module is used for receiving first data information;
the first self-increment key determining module is used for determining the self-increment key corresponding to the service main key of the first data information according to the service main key of the first data information and the mapping relation between the service main key and the self-increment key;
the first position determining module is used for determining the position of the database corresponding to the service main key of the first data information and the self-increment main key according to the mapping relation between the self-increment main key and the sub-database sub-table rule;
and the data storage module is used for storing the first data information into the database position corresponding to the self-increment main key corresponding to the service main key of the first data information.
7. The apparatus of claim 6, further comprising:
the data query module is used for receiving a query request for the second data information;
the second self-increment key determining module is used for determining the self-increment key corresponding to the service main key of the second data information according to the service main key of the second data information and the mapping relation between the service main key and the self-increment key;
the second position determining module is used for determining the position of the database corresponding to the service main key of the second data information and the self-increment main key according to the mapping relation between the self-increment main key and the sub-database sub-table rule;
and the query module is used for querying the second data information from the database position corresponding to the service main key of the second data information and the self-increment main key.
8. The apparatus of claim 6, wherein the banking and tabulating rules comprise:
each data bin size, and each data bin table size.
9. The apparatus of claim 6, further comprising:
the first updating module is used for receiving a first updating request of the mapping relation between the service main key and the self-adding main key;
and updating the mapping relation between the service main key and the self-adding main key according to the first updating request.
10. The apparatus of claim 6, further comprising:
the second updating module is used for receiving a second updating request of the mapping relation between the self-increment key and the sub-base and sub-table rules; and updating the mapping relation between the self-increment main key and the sub-base and sub-table rules according to the second updating request.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 5 when executing the computer program.
12. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 1 to 5.
CN202110851079.9A 2021-07-27 2021-07-27 Database and table dividing method and device Pending CN113486023A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110851079.9A CN113486023A (en) 2021-07-27 2021-07-27 Database and table dividing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110851079.9A CN113486023A (en) 2021-07-27 2021-07-27 Database and table dividing method and device

Publications (1)

Publication Number Publication Date
CN113486023A true CN113486023A (en) 2021-10-08

Family

ID=77942829

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110851079.9A Pending CN113486023A (en) 2021-07-27 2021-07-27 Database and table dividing method and device

Country Status (1)

Country Link
CN (1) CN113486023A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114006703A (en) * 2021-11-02 2022-02-01 中国银行股份有限公司 Intersystem data transmission method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893466A (en) * 2016-03-28 2016-08-24 中国建设银行股份有限公司 Data processing method and system applied to database
WO2017201970A1 (en) * 2016-05-21 2017-11-30 乐视控股(北京)有限公司 Branch base database system and routing method therefor
CN108694218A (en) * 2017-04-12 2018-10-23 大唐移动通信设备有限公司 A kind of method and apparatus data write-in and read
CN109213761A (en) * 2018-08-06 2019-01-15 北京马上慧科技术有限公司 Table method is divided in point library that a kind of spread exempts from migration
CN110019125A (en) * 2017-11-27 2019-07-16 北京京东尚科信息技术有限公司 The method and apparatus of data base administration
CN110795419A (en) * 2019-10-08 2020-02-14 中国建设银行股份有限公司 Method and device for dynamic database-based routing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893466A (en) * 2016-03-28 2016-08-24 中国建设银行股份有限公司 Data processing method and system applied to database
WO2017201970A1 (en) * 2016-05-21 2017-11-30 乐视控股(北京)有限公司 Branch base database system and routing method therefor
CN108694218A (en) * 2017-04-12 2018-10-23 大唐移动通信设备有限公司 A kind of method and apparatus data write-in and read
CN110019125A (en) * 2017-11-27 2019-07-16 北京京东尚科信息技术有限公司 The method and apparatus of data base administration
CN109213761A (en) * 2018-08-06 2019-01-15 北京马上慧科技术有限公司 Table method is divided in point library that a kind of spread exempts from migration
CN110795419A (en) * 2019-10-08 2020-02-14 中国建设银行股份有限公司 Method and device for dynamic database-based routing

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114006703A (en) * 2021-11-02 2022-02-01 中国银行股份有限公司 Intersystem data transmission method and device
CN114006703B (en) * 2021-11-02 2024-04-19 中国银行股份有限公司 Intersystem data transmission method and device

Similar Documents

Publication Publication Date Title
US9953102B2 (en) Creating NoSQL database index for semi-structured data
CN101876983B (en) Method for partitioning database and system thereof
CN110147407B (en) Data processing method and device and database management server
CN111460023A (en) Service data processing method, device, equipment and storage medium based on elastic search
CN107085570B (en) Data processing method, application server and router
CN105117417A (en) Read-optimized memory database Trie tree index method
CN103488687A (en) Searching system and searching method of big data
CN112015741A (en) Method and device for storing massive data in different databases and tables
CN111966677B (en) Data report processing method and device, electronic equipment and storage medium
CN108073696B (en) GIS application method based on distributed memory database
CN104871153A (en) System and method for flexible distributed massively parallel processing (mpp) database
CN109670975B (en) Method, medium, and electronic device for generating a single number in a computer system
CN106339475A (en) Distributed storage system for mass data
CN106815258B (en) Data storage method and coordination node
CN110674152B (en) Data synchronization method and device, storage medium and electronic equipment
CN103810219A (en) Line storage database-based data processing method and device
CN110413631B (en) Data query method and device
CN108228725B (en) GIS application system based on distributed database
CN109388636A (en) Business datum is inserted into database method, apparatus, computer equipment and storage medium
CN114090695A (en) Query optimization method and device for distributed database
CN113486023A (en) Database and table dividing method and device
EP2662783A1 (en) Data archiving approach leveraging database layer functionality
CN112000825A (en) Method and system for establishing electronic license storage model based on sub-warehouse and sub-table
CN116775712A (en) Method, device, electronic equipment, distributed system and storage medium for inquiring linked list
CN116450607A (en) Data processing method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination