CN112685417A - Database operation method, system, device, server and storage medium - Google Patents

Database operation method, system, device, server and storage medium Download PDF

Info

Publication number
CN112685417A
CN112685417A CN202011613781.3A CN202011613781A CN112685417A CN 112685417 A CN112685417 A CN 112685417A CN 202011613781 A CN202011613781 A CN 202011613781A CN 112685417 A CN112685417 A CN 112685417A
Authority
CN
China
Prior art keywords
object identifier
server
target
index table
written
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.)
Granted
Application number
CN202011613781.3A
Other languages
Chinese (zh)
Other versions
CN112685417B (en
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.)
JD Digital Technology Holdings Co Ltd
Original Assignee
JD Digital Technology Holdings Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by JD Digital Technology Holdings Co Ltd filed Critical JD Digital Technology Holdings Co Ltd
Priority to CN202011613781.3A priority Critical patent/CN112685417B/en
Publication of CN112685417A publication Critical patent/CN112685417A/en
Application granted granted Critical
Publication of CN112685417B publication Critical patent/CN112685417B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a database operation method, a system, a device, a server and a storage medium, comprising the following steps: receiving a first query statement sent by a routing device, wherein the first query statement comprises a first object identifier to be queried; acquiring a target second object identifier corresponding to the first object identifier to be inquired from an index table stored in a target server according to the first object identifier to be inquired; and according to the target second object identifier, acquiring first target detail information corresponding to the target second object identifier from a detail table stored in the target server. In the database operation method, on one hand, the plurality of servers respectively store the data related to the corresponding first object identification, so that the pressure of a single server can be reduced, and high-concurrency query can be realized, and on the other hand, the data is stored in each server by adopting an index table and a detail table, so that quick query can be realized, and the query efficiency is improved.

Description

Database operation method, system, device, server and storage medium
Technical Field
The embodiment of the invention relates to the field of computers, in particular to a database operation method, a database operation system, a database operation device, a database operation server and a storage medium.
Background
The information quantity of the internet industry is huge, and mass data need to be stored in order to meet the data query requirement.
The existing mass data storage scheme is as follows: main fields in one table are reserved in a main table, and other information is split into an extension table on the same server to be stored.
However, in the process of implementing the present invention, at least the following technical problems are found in the prior art: according to the scheme, the data in the main table and the data in the extended table are stored in the same server, and the query efficiency is low during high-concurrency data query.
Disclosure of Invention
The invention provides a database operation method, a system, a device, a server and a storage medium, which aim to solve the technical problem of low query efficiency in the conventional database operation method.
In a first aspect, an embodiment of the present invention provides a database operation method, applied to a target server, including:
receiving a first query statement sent by a routing device; the first query statement comprises a first object identifier to be queried, the routing equipment is connected with a plurality of servers including the target server, and the target server is a server corresponding to the first object identifier to be queried, which is determined by the routing equipment according to the corresponding relation between the first object identifier and the server; each server stores an index table and a detail table corresponding to the index table, wherein the index table is used for indicating the mapping relationship between a first object identifier and a second object identifier corresponding to the server, and the detail table is used for indicating the mapping relationship between the second object identifier and detail information;
acquiring a target second object identifier corresponding to the first object identifier to be inquired from an index table stored in the target server according to the first object identifier to be inquired;
and acquiring first target detail information corresponding to the target second object identifier from a detail table stored in the target server according to the target second object identifier.
In a second aspect, an embodiment of the present invention provides a database operating system, including:
a routing device and a plurality of servers connected to the routing device;
the routing equipment acquires a first query statement; wherein the first query statement comprises a first object identifier to be queried;
the routing equipment determines a target server corresponding to the first object identifier to be inquired in the plurality of servers according to the corresponding relation between the first object identifier and the servers; each server stores an index table and a detail table corresponding to the index table, wherein the index table is used for indicating the mapping relationship between a first object identifier and a second object identifier corresponding to the server, and the detail table is used for indicating the mapping relationship between the second object identifier and detail information;
the routing equipment sends the first query statement to the target server;
the target server is configured to perform the database operation method according to the first aspect.
In a third aspect, an embodiment of the present invention provides a database operating apparatus, where the database operating apparatus is disposed in a target server, and includes:
the receiving module is used for receiving a first query statement sent by the routing equipment; the first query statement comprises a first object identifier to be queried, the routing equipment is connected with a plurality of servers including the target server, and the target server is a server corresponding to the first object identifier to be queried, which is determined by the routing equipment according to the corresponding relation between the first object identifier and the server; each server stores an index table and a detail table corresponding to the index table, wherein the index table is used for indicating the mapping relationship between a first object identifier and a second object identifier corresponding to the server, and the detail table is used for indicating the mapping relationship between the second object identifier and detail information;
a first obtaining module, configured to obtain, according to the first object identifier to be queried, a target second object identifier corresponding to the first object identifier to be queried from an index table stored in the target server;
and the second obtaining module is used for obtaining first target detail information corresponding to the target second object identifier from a detail table stored in the target server according to the target second object identifier.
In a fourth aspect, an embodiment of the present invention further provides a server, where the server includes:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the database operation method as provided in the first aspect.
In a fifth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the database operation method as provided in the first aspect.
The embodiment of the invention provides a database operation method, a system, a device, a server and a storage medium, wherein the method comprises the following steps: receiving a first query statement sent by a routing device, wherein the first query statement comprises a first object identifier to be queried, the routing device is connected with a plurality of servers including a target server, and the target server is a server corresponding to the first object identifier to be queried, which is determined by the routing device according to the corresponding relation between the first object identifier and the servers; each server stores an index table and a detail table corresponding to the index table, wherein the index table is used for indicating the mapping relation between a first object identifier and a second object identifier corresponding to the server, and the detail table is used for indicating the mapping relation between the second object identifier and the detail information; acquiring a target second object identifier corresponding to the first object identifier to be inquired from an index table stored in a target server according to the first object identifier to be inquired; and according to the target second object identifier, acquiring first target detail information corresponding to the target second object identifier from a detail table stored in the target server. In the database operation method, on one hand, the plurality of servers respectively store the data related to the corresponding first object identification, so that the pressure of a single server can be reduced, the bottleneck in query is avoided, and high concurrent query can be realized. Therefore, the database operation method provided by the embodiment can realize high-concurrency quick query.
Drawings
FIG. 1 is a block diagram of a database operating system according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a database operation method according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a correspondence relationship between a first object identifier and a server in the database operation method according to the present invention;
FIG. 4 is a schematic diagram of an index table and a list table in the database operation method according to the present invention;
FIG. 5 is another diagram of an index table in the database operation method according to the present invention;
FIG. 6 is a schematic diagram of information interaction of the database operation method provided in the embodiment shown in FIG. 2;
FIG. 7 is a flowchart illustrating a database operation method according to another embodiment of the present invention;
FIG. 8 is a diagram illustrating a method for operating a database according to the present invention;
FIG. 9 is a schematic diagram of information interaction of the database operation method provided in the embodiment shown in FIG. 7;
FIG. 10 is a flow chart illustrating a database operation method according to another embodiment of the present invention;
FIG. 11 is a schematic diagram of modifying data in the database operation method provided by the present invention;
FIG. 12 is a schematic diagram of information interaction of the database operation method provided by the embodiment shown in FIG. 10;
FIG. 13 is a flowchart illustrating a database operation method according to yet another embodiment of the present invention;
FIG. 14 is a schematic diagram of information interaction of the database operation method provided in the embodiment shown in FIG. 13;
FIG. 15 is a schematic structural diagram of a database operating apparatus according to an embodiment of the present invention;
fig. 16 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Fig. 1 is a schematic structural diagram of a database operating system according to an embodiment of the present invention. As shown in fig. 1, the system includes: a routing device 11 and a plurality of servers 12 connected to the routing device 11. The data is stored in a plurality of servers 12 in the present embodiment. The data stored in this embodiment includes: and detail information corresponding to the first object identifier, the second object identifier and the second object identifier. The first object identifier has a corresponding relationship with the server. To improve the efficiency of the query, inside each server, the data is stored in two tables: an index table and a list table corresponding to the index table. The index table is used for indicating the mapping relation between the first object identification and the second object identification corresponding to the server, and the detail table is used for indicating the mapping relation between the second object identification and the detail information. In other words, in the database operating system provided in this embodiment, on one hand, data is stored in a plurality of servers, so as to reduce the pressure of a single server, and on the other hand, a manner of storing data in an index table and a detail table is adopted inside the server, so as to improve query efficiency.
Based on the database operating system, the embodiment provides a database operating method to improve the database query efficiency. The database operation method provided by the present embodiment is described in detail below.
Fig. 2 is a flowchart illustrating a database operation method according to an embodiment of the present invention. The embodiment is suitable for a scene of querying the database. The present embodiment may be performed by a database operating device, which may be implemented by software and/or hardware, and may be integrated in a target server. As shown in fig. 2, the database operation method provided in this embodiment includes the following steps:
step 201: and receiving a first query statement sent by the routing equipment.
The first query statement comprises a first object identifier to be queried. The routing device connects a plurality of servers including the target server. The target server is a server corresponding to the first object identifier to be inquired, which is determined by the routing equipment according to the corresponding relation between the first object identifier and the server. Each server stores an index table and a detail table corresponding to the index table. The index table is used for indicating the mapping relation between the first object identification and the second object identification corresponding to the server. The detail table is used for indicating the mapping relation between the second object identification and the detail information.
Specifically, the routing device in this embodiment is a device that can determine a target server corresponding to the first object identifier to be queried according to the correspondence between the first object identifier and the server. The routing device may receive a first query statement. The first query statement in this embodiment may be a query statement sent by user equipment or a query statement sent by operation and maintenance personnel equipment.
The correspondence between the first object identification and the server is predetermined. When determining the target server, the routing device may determine, as the target server, a server corresponding to the first object identifier to be queried in the correspondence. Fig. 3 is a corresponding relationship between a first object identifier and a server in the database operation method provided by the present invention. As shown in fig. 3, each first object id corresponds to only one server. Each server stores an index table and a detail table.
Alternatively, the corresponding server may be determined according to the data of the preset bit number of the tail of the first object identifier. More specifically, assume that the number of servers is 2nN is an integer greater than or equal to 2, and the number of bits of the first object identifier is greater than n, the correspondence between the first object identifier and the server may be: for 2 according to the first object identificationnThe result of the remainder is obtained by calculating,and determining the server corresponding to the first object identifier, wherein the essence is that the last n bits of the first object identifier correspond to the server. Based on the implementation manner, the routing device may determine, according to the last n bits of the first object identifier to be queried, a target server corresponding to the first object identifier to be queried. And after determining the target server corresponding to the first object identifier to be queried, the routing equipment sends a first query statement to the target server.
The target server receives a first query statement sent by the routing device. As can be seen from the foregoing description, the target server stores an index table and a detail table corresponding to the index table. The index table is used for indicating the mapping relation between the first object identification and the second object identification corresponding to the target server. The detail table is used for indicating the mapping relation between the second object identification and the detail information.
Illustratively, the first object identifier in this embodiment may be a user identifier, and the second object identifier may be a marketing information identifier. The operations such as mass data storage, query and the like under the marketing scene are realized. The user identifier in this embodiment may be a Personal Identification Number (PIN) of the user.
More specifically, the marketing message may be a coupon. The detail information includes at least one of: the type of the coupon, the denomination of the coupon, the use condition of the coupon, the coupon withdrawal rule corresponding to the coupon and the state of the coupon. The coupon returning rule refers to a rule that a user returns goods after using a coupon, and whether the used coupon is returned to the user. The status of the coupon includes: a coupon used status, a coupon unused status, and a coupon used status.
Step 202: and acquiring a target second object identifier corresponding to the first object identifier to be inquired from an index table stored in the target server according to the first object identifier to be inquired.
Step 203: and according to the target second object identifier, acquiring first target detail information corresponding to the target second object identifier from a detail table stored in the target server.
Specifically, in this embodiment, in order to improve the query efficiency of the target server, the query may be performed by querying the index table first and then querying the detail table. In step 202, the target server may obtain a target second object identifier corresponding to the first object identifier to be queried from an index table stored by the target server. Then, in step 203, based on the target second object identifier queried in step 202, the first target detail information corresponding to the target second object identifier is obtained from the detail table stored in the step. In the process, since the detail information is not stored in the index table, the amount of the stored data is less, and the target second object identification can be inquired from the index table more quickly. Then, based on the target second object identification, the first target detail information corresponding to the target second object identification can be inquired from the detail table more quickly. The query efficiency of the query mode is high. And in a scene of high concurrent query, faster query can be realized.
Optionally, after step 203, the target server may feed back the first target detail information to the routing device.
FIG. 4 is a diagram illustrating an index table and a list table in the database operation method according to the present invention. As in fig. 4, the fields stored in the index table include: the first object identification and the second object identification. The fields stored in the list include: the second object identification and detail information.
Of course, it is understood that other fields may be included in the index table. For example, in a scenario where the second object is a coupon, the index table may further include fields of a coupon related time, a coupon status, and the like. Correspondingly, in order to improve the query efficiency, in this scenario, the information of these fields as shown before may also be included in the first query statement. Other fields may also be included in the list. For example, the detail table may also include fields such as the time associated with the coupon.
Alternatively, in this embodiment, the index table may be stored in the Elasticsearch, and the detail table may be stored in the HBase. The elastic search can achieve real-time search, and is stable, reliable, rapid and convenient to install and use. HBase is a distributed, column-oriented open-ended database. Because the Elasticissearch is flexible, the HBase can realize quick query for the second object identification. Therefore, the implementation mode can further improve the efficiency and reliability of the query.
Fig. 6 is an information interaction diagram of the database operation method provided by the embodiment shown in fig. 2. The following describes the database operation method provided by the present embodiment from the perspective of interaction between the routing device and the target server. As shown in fig. 6, the high database operation method includes the following steps:
step 601: the routing device obtains a first query statement.
Step 602: and the routing equipment determines a target server corresponding to the first object identifier to be inquired in the plurality of servers according to the corresponding relation between the first object identifier and the servers.
Step 603: the routing device sends the first query statement to the target server.
Step 604: the target server receives a first query statement sent by the routing device.
Step 605: and the target server acquires a target second object identifier corresponding to the first object identifier to be inquired from an index table stored in the target server according to the first object identifier to be inquired.
Step 606: and the target server acquires first target detail information corresponding to the target second object identifier from a detail table stored in the target server according to the target second object identifier.
In a more particular implementation, the first query statement further includes: the first object to be queried identifies the relevant time of the corresponding target second object. Correspondingly, the index table of the server comprises a plurality of sub index tables. Each sub-index table is used for indicating the mapping relation of the first object identification, the second object identification and the relevant time of the second object corresponding to the server. The time ranges formed by the relevant time of the second object in different sub-index tables are different. That is, in this implementation, the index table is split into a plurality of sub-index tables according to the difference of the time range formed by the correlation time of the second object, so as to refine the index table.
Illustratively, the time range here may be days, months, etc. That is, the mapping relationship of the first object identifier, the second object identifier, and the relevant time of the second object on the same day may be stored in the same sub index table. Alternatively, the mapping relationship of the first object identifier, the second object identifier and the relevant time of the second object in the same month may be stored in the same sub index table.
In a scenario where the second object is a coupon, the relevant time of the second object includes at least one of: the coupon's pickup time, the coupon's activation time, the coupon's usage time, and the coupon's expiration date.
Fig. 5 is another schematic diagram of an index table in the database operation method provided by the present invention. As shown in fig. 5, the index table includes a plurality of sub index tables. Suppose the first object is a user, the second object is a coupon, and the relevant time of the second object is the time of getting the coupon. The time ranges formed by the picking time of the coupons in different sub-index tables are different. For example, in the sub-index table 5.1, the coupons are all received at 2020.12.1 days; in the sub-index table 5.2, the coupon picking time is 2020.12.2 days; in the sub-index table 5.3, the coupon is collected at 2020.12.3 days.
Based on this implementation, step 202 may specifically include: determining a sub-index table corresponding to the first object identifier to be inquired in an index table stored in a target server according to the first object identifier to be inquired and the relevant time of the target second object; and acquiring a target second object identifier corresponding to the first object identifier to be inquired from the sub-index table corresponding to the first object identifier to be inquired. The implementation mode can be positioned in the sub index table during query, and the target second object identification is obtained based on the sub index table, so that the query efficiency is further improved.
Optionally, the database operation method provided in this embodiment further includes the following steps: acquiring the relevant time of a second object in each sub-index table stored in the target server at a preset frequency; and deleting the whole piece of data of which the relevant time of the corresponding second object in the sub index table and the detail table stored in the target server meets the preset condition. Illustratively, the preset condition may be that the current date is 2020.1.1 days ago, and based on the preset condition, the corresponding sub-index table stored in the target server and the corresponding second object in the detail table are deleted, and the related time of the corresponding second object is the whole data before 2020.1.1 days. The whole data means all data corresponding to the time associated with the second object satisfying the predetermined condition in the index table and the list table.
Deleting the whole data of which the relevant time of the corresponding second object in the sub index table and the detail table stored in the target server meets the preset condition, releasing the storage resource when the deletion condition is met, improving the resource utilization rate and ensuring the stable query performance.
It should be noted that, although the detail table may not store the relevant time of the second object, since the first object identifier, the second object identifier and the relevant time of the second object have a mapping relationship, and the detail table is used to indicate the mapping relationship between the second object identifier and the detail information, it can be seen that the second object identifier and the relevant time of the detail information and the second object also have a mapping relationship in the detail table.
In a specific scenario, the first object is a user, the second object is a coupon, the index table may include an index table of a coupon instance table and an index table of a coupon operation log table, and the detail table may include a detail table of the coupon instance table and a detail table of the coupon operation log table. Then, in this scenario, the table name of the index table may be included in the first query statement to determine whether to query the index table of the coupon instance table or the index table of the coupon operation log table. The coupon instance table is the same as the initial field included in the coupon operation log table, except that the field in the coupon operation log table is only increased and is not modified or deleted. For example, when a coupon is consumed, data of one consumption coupon is added to a coupon operation log table (an index table or a detail table, which is not limited herein).
The database operation method provided by the embodiment comprises the following steps: receiving a first query statement sent by a routing device, wherein the first query statement comprises a first object identifier to be queried, the routing device is connected with a plurality of servers including a target server, and the target server is a server corresponding to the first object identifier to be queried, which is determined by the routing device according to the corresponding relation between the first object identifier and the servers; each server stores an index table and a detail table corresponding to the index table, wherein the index table is used for indicating the mapping relation between a first object identifier and a second object identifier corresponding to the server, and the detail table is used for indicating the mapping relation between the second object identifier and the detail information; acquiring a target second object identifier corresponding to the first object identifier to be inquired from an index table stored in a target server according to the first object identifier to be inquired; and according to the target second object identifier, acquiring first target detail information corresponding to the target second object identifier from a detail table stored in the target server. In the database operation method, on one hand, the plurality of servers respectively store the data related to the corresponding first object identification, so that the pressure of a single server can be reduced, the bottleneck in query is avoided, and high concurrent query can be realized. Therefore, the database operation method provided by the embodiment can realize high-concurrency quick query.
Fig. 7 is a flowchart illustrating a database operation method according to another embodiment of the present invention. The embodiment is suitable for a scene of data writing in the database. The embodiment of the present invention provides a detailed description of how to write data to the target server based on the embodiment shown in fig. 2 and various alternative implementations. As shown in fig. 7, the process of writing data in the database operation method provided in this embodiment is as follows:
step 701: and receiving the write statement sent by the routing equipment.
The writing statement comprises a first object identifier to be written, a second object identifier to be written generated according to the first object identifier to be written, the correlation time of the second object to be written and detail information corresponding to the second object identifier to be written. And the target server is the server which is determined by the routing equipment to be written into the first object identifier according to the corresponding relation between the first object identifier and the server.
Specifically, the write statement in this embodiment may be a write statement sent by user equipment or a write statement sent by operation and maintenance personnel equipment.
Optionally, the correspondence between the first object identifier and the server may be: the last n bits of the first object identification correspond to the server. Based on the implementation manner, the routing device may determine, according to the last n bits to be written into the first object identifier, the target server corresponding to the first object identifier to be written into. And after determining the target server corresponding to the first object identifier to be written, the routing equipment sends a written statement to the target server.
The second object identifier to be written in the present embodiment may be generated according to the first object identifier to be written.
Optionally, the number of servers is 2nN is an integer greater than or equal to 2, and the number of bits to be written into the first object identifier is greater than n. The second object identifier to be written is data formed by the routing equipment generating a unique string according to a preset algorithm and adding the last n bits of data of the first object identifier to be written at the tail of the unique string.
The preset algorithm may be a snowflake algorithm or other distributed algorithm. The number of bits of the unique string may be a predetermined number of bits. Illustratively, the number of bits of the unique string may be 60 bits. In the process of generating the unique string, the type of the different second object is considered, and the anti-duplication time stamp is added to ensure that the generated unique string is not duplicated. After the unique string is generated, the last n bits of data to be written with the first object identifier are added at the tail of the unique string to form a second object identifier to be written.
The mode of generating the second object identifier based on the first object identifier can ensure that data query can be realized by using the first object identifier or the second object identifier, namely, query of two dimensions is supported, and the query flexibility is higher.
Step 702: and determining a sub index table corresponding to the first object identifier to be written in the index table stored in the target server according to the first object identifier to be written and the relevant time of the second object to be written.
Step 702 is similar to the specific implementation process of step 202, and is not described here again.
Step 703: and writing the first object identifier to be written, the second object identifier to be written and the relevant time of the second object to be written into the sub index table corresponding to the first object identifier to be written.
Step 704: and writing the second object identifier to be written and the detailed information corresponding to the second object identifier to be written into a detailed table stored in the target server.
After step 702 is performed, step 703 and step 704 are performed. There is no timing relationship between steps 703 and 704, and they can be performed in any order or in parallel.
FIG. 8 is a diagram illustrating data writing in the database operation method according to the present invention. As shown in fig. 8, the first object id to be written, the second object id to be written, and the relative time to be written to the second object are written in the sub-index table 8.1. And writing the second object identifier to be written and the detail information corresponding to the second object identifier to be written in the detail table.
It should be noted that the steps of querying the data shown in step 201 to step 203 may be performed before, after, or at the same time of writing the data, and for simplicity, the process of querying the data is not described in this embodiment.
Fig. 9 is an information interaction diagram of the database operation method provided by the embodiment shown in fig. 7. The following describes the database operation method provided by the present embodiment from the perspective of interaction between the routing device and the target server. As shown in fig. 9, the high database operation method further includes the following steps:
step 901: the routing device generates a write statement.
Specifically, the routing device generates a corresponding to-be-written second object identifier according to the received to-be-written first object identifier, and packages the received to-be-written first object identifier, the correlation time of the to-be-written second object, the detail information corresponding to the to-be-written second object identifier, and the generated to-be-written second object identifier into a write statement.
Step 902: and the routing equipment determines a target server corresponding to the first object identifier to be written in the plurality of servers according to the corresponding relation between the first object identifier and the servers.
Step 903: the routing device sends the write statement to the target server.
Step 904: and the target server receives the written statement sent by the routing equipment.
Step 905: and the target server determines a sub-index table corresponding to the first object identifier to be written in the index table stored in the target server according to the first object identifier to be written and the relevant time of the second object to be written.
Step 906: and the target server writes the first object identifier to be written, the second object identifier to be written and the relevant time of the second object to be written into the sub index table corresponding to the first object identifier to be written.
Step 907: and the target server writes the second object identifier to be written and the detail information corresponding to the second object identifier to be written into the detail table stored in the target server.
The database operation method provided by the embodiment further includes: receiving a write-in statement sent by the routing equipment, wherein the write-in statement comprises a first object identifier to be written in, a second object identifier to be written in generated according to the first object identifier to be written in, the correlation time of the second object to be written in and detail information corresponding to the second object identifier to be written in, and the target server is a server corresponding to the first object identifier to be written in and determined by the routing equipment according to the corresponding relationship between the first object identifier and the server; determining a sub index table corresponding to the first object identifier to be written in the index table stored in the target server according to the first object identifier to be written and the relevant time of the second object to be written; writing the first object identifier to be written, the second object identifier to be written and the relevant time of the second object to be written into a sub index table corresponding to the first object identifier to be written; and writing the second object identifier to be written and the detailed information corresponding to the second object identifier to be written into a detailed table stored in the target server. In the database operation method, based on the writing process, on one hand, data can be stored in a plurality of servers, the pressure of a single server can be reduced, bottleneck in writing and inquiring can be avoided, high-concurrency writing and inquiring can be achieved, on the other hand, in each server, a mode of storing data by using the index table and the detail table is adopted, quick inquiring can be achieved subsequently, and inquiring efficiency is improved.
Fig. 10 is a flowchart illustrating a database operation method according to another embodiment of the present invention. The embodiment is suitable for a scene of data modification of the database. The embodiment of the present invention provides a detailed description of how to modify the data in the target server based on the embodiments shown in fig. 2 and fig. 7 and various alternative implementations. As shown in fig. 10, the process of modifying data in the database operation method provided in this embodiment is as follows:
step 1001: and receiving the modification statement sent by the routing equipment.
The modification statement comprises a first object identifier to be modified, the relevant time of a second object to be modified corresponding to the first object identifier to be modified, and modification information corresponding to the first object identifier to be modified. And the target server is the server corresponding to the first object identifier to be modified, which is determined by the routing equipment according to the corresponding relation between the first object identifier and the server.
Specifically, the modification statement in this embodiment may be a modification statement sent by the user equipment or a modification statement sent by the operation and maintenance personnel equipment.
Optionally, the correspondence between the first object identifier and the server may be: the last n bits of the first object identification correspond to the server. Based on the implementation manner, the routing device may determine, according to the last n bits of the first object identifier to be modified, a target server corresponding to the first object identifier to be modified. And after determining the target server corresponding to the first object identifier to be modified, the routing equipment sends a modification statement to the target server.
Step 1002: and determining a sub index table corresponding to the first object identifier to be modified in the index table stored in the target server according to the first object identifier to be modified and the relevant time of the second object to be modified.
Step 1002 is similar to the specific implementation process of step 202, and is not described herein again.
Step 1003: and acquiring a second object identifier to be modified corresponding to the first object identifier to be modified from the sub-index table corresponding to the first object identifier to be modified.
Step 1004: and acquiring the detail information corresponding to the second object identifier to be modified from the detail table stored in the target server according to the second object identifier to be modified.
Step 1005: and modifying the detail information corresponding to the second object identifier to be modified according to the modification information corresponding to the first object identifier to be modified.
In step 1005, modifying the detail information corresponding to the second object identifier to be modified may include the following two implementation manners: one is to replace the information needing to be replaced in the detailed information corresponding to the second object identification to be modified by the modification information corresponding to the first object identification to be modified; and the other is to add the modification information corresponding to the first object identifier to be modified in the detail information corresponding to the second object identifier to be modified.
Fig. 11 is a schematic diagram of modified data in the database operation method provided by the present invention. As shown in fig. 11, assuming that the second object is a coupon, the detail information is a state of the coupon, and the modification information corresponding to the first object identifier to be modified is a state of the coupon changed from unused to used, the "unused" in the state of the coupon corresponding to the second object identifier to be modified in the detail table is modified to "used".
It should be noted that, before, after, or at the same time of modifying the data, the steps of querying the data shown in step 201 to step 203 and/or the steps of writing the data shown in step 701 to step 704 may be performed, and for simplicity, the processes of querying the data and writing the data are not described in this embodiment.
Fig. 12 is an information interaction diagram of the database operation method according to the embodiment shown in fig. 10. The following describes the database operation method provided by the present embodiment from the perspective of interaction between the routing device and the target server. As shown in fig. 12, the high database operation method further includes the following steps:
step 1201: the routing device obtains the modification statement.
Step 1202: and the routing equipment determines a target server corresponding to the first object identifier to be modified in the plurality of servers according to the corresponding relation between the first object identifier and the servers.
Step 1203: the routing device sends the modification statement to the target server.
Step 1204: and the target server receives the modification statement sent by the routing equipment.
Step 1205: and the target server determines a sub-index table corresponding to the first object identifier to be modified in the index table stored in the target server according to the first object identifier to be modified and the relevant time of the second object to be modified.
Step 1206: and the target server acquires a second object identifier to be modified corresponding to the first object identifier to be modified from the sub-index table corresponding to the first object identifier to be modified.
Step 1207: and the target server acquires the detail information corresponding to the second object identifier to be modified from the detail table stored in the target server according to the second object identifier to be modified.
Step 1208: and the target server modifies the detailed information corresponding to the second object identifier to be modified according to the modification information corresponding to the first object identifier to be modified.
The database operation method provided by the embodiment further includes: receiving a write-in statement sent by the routing equipment, wherein the write-in statement comprises a first object identifier to be written in, a second object identifier to be written in generated according to the first object identifier to be written in, the correlation time of the second object to be written in and detail information corresponding to the second object identifier to be written in, and the target server is a server corresponding to the first object identifier to be written in and determined by the routing equipment according to the corresponding relationship between the first object identifier and the server; determining a sub index table corresponding to the first object identifier to be written in the index table stored in the target server according to the first object identifier to be written and the relevant time of the second object to be written; writing the first object identifier to be written, the second object identifier to be written and the relevant time of the second object to be written into a sub index table corresponding to the first object identifier to be written; and writing the second object identifier to be written and the detailed information corresponding to the second object identifier to be written into a detailed table stored in the target server. In the database operation method, on one hand, the plurality of servers respectively store the data related to the corresponding first object identification, so that the pressure of a single server can be reduced, the bottleneck in modification is avoided, and high concurrent modification can be realized.
Fig. 13 is a flowchart illustrating a database operation method according to still another embodiment of the present invention. The embodiment is suitable for the scene of querying the database by using the second object identifier. This embodiment describes a process of querying data in a target server by using a second object identifier based on the embodiments shown in fig. 2, fig. 7, and fig. 10 and various alternative implementations. As shown in fig. 13, the process of querying data in the database operation method provided in this embodiment is as follows:
step 1301: and receiving a second query statement sent by the routing equipment.
The second query statement comprises a second object identifier to be queried, and the second object identifier to be queried is generated according to the corresponding first object identifier. And the target server is a server corresponding to the second object identifier to be inquired, which is determined by the routing equipment according to the corresponding relation between the first object identifier and the server.
Specifically, since the second object identifier to be queried is generated according to the corresponding first object identifier, that is, the first object identifier and the second object identifier have a corresponding relationship, and the first object identifier and the server have a corresponding relationship, it can be determined that the second object identifier and the server also have a corresponding relationship. In other words, the routing device may determine, according to the correspondence between the first object identifier and the server, a server corresponding to the second object identifier to be queried.
Optionally, the number of servers is 2nN is an integer greater than or equal to 2, and the number of bits of the first object identifier is greater than n. The second object identification is data formed by the routing equipment generating a unique string according to a preset algorithm and adding the last n bits of data of the corresponding first object identification at the tail part of the unique string.
The preset algorithm may be a snowflake algorithm or other distributed algorithm. The number of bits of the unique string may be a predetermined number of bits. Illustratively, the number of bits of the unique string may be 60 bits. In the process of generating the unique string, the type of the different second object is considered, and the anti-duplication time stamp is added to ensure that the generated unique string is not duplicated. After the unique string is generated, the last n bits of data of the corresponding first object identifier are added at the tail of the unique string to form a second object identifier.
The mode of generating the second object identifier based on the first object identifier can ensure that data query can be realized by using the first object identifier or the second object identifier on the premise of not storing data redundantly, namely, query of two dimensions is supported, the query flexibility is higher, and the resource utilization is friendly.
The difference between this embodiment and the embodiment shown in fig. 2 and various alternative implementations is that in this embodiment, the query is implemented according to the identifier of the second object.
Step 1302: and according to the second object identifier to be queried, acquiring second target detail information corresponding to the second object identifier to be queried from a detail table stored in the target server.
In step 1302, according to the second object identifier to be queried, second target detail information corresponding to the second object identifier to be queried is obtained from a detail table stored in the target server.
Optionally, after step 1302, the target server may feed back the second target detail information to the routing device.
It should be noted that, before, after, or at the same time of querying the data by using the second object identifier, at least one of the steps of querying the data shown in step 201 to step 203, writing the data shown in step 701 to step 704, and modifying the data shown in step 1001 to step 1005 may be performed.
Fig. 14 is an information interaction diagram of the database operation method provided in the embodiment shown in fig. 13. The following describes the database operation method provided by the present embodiment from the perspective of interaction between the routing device and the target server. As shown in fig. 14, the high database operation method further includes the steps of:
step 1401: the routing device obtains a second query statement.
Step 1402: and the routing equipment determines a target server corresponding to the second object identifier to be inquired in the plurality of servers according to the corresponding relation between the first object identifier and the servers.
Step 1403: and the routing equipment sends the second query statement to the target server.
Step 1404: and the target server receives the second query statement sent by the routing equipment.
Step 1405: and the target server acquires second target detail information corresponding to the second object identifier to be inquired from the detail table stored in the target server according to the second object identifier to be inquired.
The database operation method provided by the embodiment further includes: receiving a second query statement sent by the routing device, wherein the second query statement comprises a second object identifier to be queried, the second object identifier to be queried is generated according to the corresponding first object identifier, and the target server is a server corresponding to the second object identifier to be queried, which is determined by the routing device according to the corresponding relationship between the first object identifier and the server; and according to the second object identifier to be queried, acquiring second target detail information corresponding to the second object identifier to be queried from a detail table stored in the target server. According to the database operation method, on one hand, multi-dimensional query can be achieved on the premise that redundant storage data does not exist, the query flexibility is high, on the other hand, data related to corresponding first object identifications are stored in the multiple servers respectively, the pressure of a single server can be reduced, bottleneck in query is avoided, and high-concurrency query can be achieved.
An embodiment of the present invention further provides a database operating system, including: a routing device and a plurality of servers connected to the routing device.
The routing equipment acquires a first query statement, wherein the first query statement comprises a first object identifier to be queried.
And the routing equipment determines a target server corresponding to the first object identifier to be inquired in the plurality of servers according to the corresponding relation between the first object identifier and the servers. Each server stores an index table and a detail table corresponding to the index table, the index table is used for indicating the mapping relation between the first object identifier and the second object identifier corresponding to the server, and the detail table is used for indicating the mapping relation between the second object identifier and the detail information.
The routing device sends the first query statement to the target server.
The target server is used for executing the database operation method provided by any embodiment of the invention.
The database operating system provided by the embodiment has the corresponding functional modules and beneficial effects of the execution method.
Fig. 15 is a schematic structural diagram of a database operating apparatus according to an embodiment of the present invention. The database operating device may be provided in the target server. As shown in fig. 15, the database operating apparatus provided in this embodiment includes the following modules: a receiving module 151, a first obtaining module 152, and a second obtaining module 153.
The receiving module 151 is configured to receive the first query statement sent by the routing device.
The first query statement comprises a first object identifier to be queried. The routing device connects a plurality of servers including the target server. The target server is a server corresponding to the first object identifier to be inquired, which is determined by the routing equipment according to the corresponding relation between the first object identifier and the server. Each server stores an index table and a detail table corresponding to the index table, the index table is used for indicating the mapping relation between the first object identifier and the second object identifier corresponding to the server, and the detail table is used for indicating the mapping relation between the second object identifier and the detail information.
The first obtaining module 152 is configured to obtain, according to the first object identifier to be queried, a target second object identifier corresponding to the first object identifier to be queried from an index table stored in the target server.
The second obtaining module 153 is configured to obtain, according to the target second object identifier, first target detail information corresponding to the target second object identifier from a detail table stored in the target server.
Optionally, the first query statement further comprises: the first object to be queried identifies the relevant time of the corresponding target second object. The index table of the server comprises a plurality of sub-index tables, and each sub-index table is used for indicating the mapping relation of the first object identification, the second object identification and the relevant time of the second object corresponding to the server. The time ranges formed by the relevant time of the second object in different sub-index tables are different. The first obtaining module 152 is specifically configured to: determining a sub-index table corresponding to the first object identifier to be inquired in an index table stored in a target server according to the first object identifier to be inquired and the relevant time of the target second object; and acquiring a target second object identifier corresponding to the first object identifier to be inquired from the sub-index table corresponding to the first object identifier to be inquired.
Optionally, the apparatus further comprises: the device comprises a determining module and a writing module.
The receiving module 151 is further configured to receive a write statement sent by the routing device.
The writing statement comprises a first object identifier to be written, a second object identifier to be written generated according to the first object identifier to be written, the correlation time of the second object to be written and detail information corresponding to the second object identifier to be written. And the target server is the server which is determined by the routing equipment to be written into the first object identifier according to the corresponding relation between the first object identifier and the server.
And the determining module is used for determining a sub index table corresponding to the first object identifier to be written in the index table stored in the target server according to the first object identifier to be written in and the relevant time of the second object to be written in.
And the writing module is used for writing the first object identifier to be written, the second object identifier to be written and the relevant time of the second object to be written into the sub index table corresponding to the first object identifier to be written.
And the writing module is further used for writing the second object identifier to be written and the detail information corresponding to the second object identifier to be written into the detail table stored in the target server.
Optionally, the number of servers is 2nN is an integer greater than or equal to 2, and the number of bits to be written into the first object identifier is greater than n. The second object identifier to be written is data formed by the routing equipment generating a unique string according to a preset algorithm and adding the last n bits of data of the first object identifier to be written at the tail of the unique string.
In one implementation, the apparatus further comprises: and modifying the module.
The receiving module 151 is further configured to receive the modification statement sent by the routing device.
The modification statement comprises a first object identifier to be modified, the relevant time of a second object to be modified corresponding to the first object identifier to be modified, and modification information corresponding to the first object identifier to be modified. And the target server is the server corresponding to the first object identifier to be modified, which is determined by the routing equipment according to the corresponding relation between the first object identifier and the server.
And the determining module is further used for determining a sub index table corresponding to the first object identifier to be modified in the index table stored in the target server according to the first object identifier to be modified and the relevant time of the second object to be modified.
The first obtaining module 152 is further configured to obtain a second object identifier to be modified corresponding to the first object identifier to be modified from the sub-index table corresponding to the first object identifier to be modified.
The second obtaining module 153 is further configured to obtain, according to the second object identifier to be modified, detail information corresponding to the second object identifier to be modified from the detail table stored in the target server.
And the modification module is used for modifying the detailed information corresponding to the second object identifier to be modified according to the modification information corresponding to the first object identifier to be modified.
In another implementation manner, the receiving module 151 is further configured to receive a second query statement sent by the routing device. And the second query statement comprises a second object identifier to be queried. The second object identification to be inquired is generated according to the corresponding first object identification. And the target server is a server corresponding to the second object identifier to be inquired, which is determined by the routing equipment according to the corresponding relation between the first object identifier and the server.
The second obtaining module 153 is further configured to obtain, according to the second object identifier to be queried, second target detail information corresponding to the second object identifier to be queried from a detail table stored in the target server.
Optionally, the apparatus further comprises a deletion module.
The first obtaining module 152 is further configured to obtain, at a preset frequency, the relevant time of the second object in each sub-index table stored in the target server.
And the deleting module is used for deleting the whole piece of data of which the related time of the corresponding second object in the sub index table and the detail table stored in the target server meets the preset condition.
Optionally, the first object identifier is a user identifier and the second object identifier is a marketing message identifier.
Illustratively, the marketing message is a coupon. The correlation time of the second object comprises at least one of: the coupon's pickup time, the coupon's activation time, the coupon's usage time, and the coupon's expiration date.
Optionally, the detail information comprises at least one of: the related time of the coupon, the type of the coupon, the denomination of the coupon, the using condition of the coupon, the coupon returning rule corresponding to the coupon and the state of the coupon.
The database operation device provided by the embodiment of the invention can execute the database operation method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Fig. 16 is a schematic structural diagram of a server according to an embodiment of the present invention. As shown in fig. 16, the server includes a processor 60 and a memory 61. The number of the processors 60 in the server may be one or more, and one processor 60 is taken as an example in fig. 16; the processor 60 and the memory 61 of the server may be connected by a bus or other means, as exemplified by the bus connection in fig. 16.
The memory 61 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions and modules corresponding to the database operation method in the embodiment of the present invention (for example, the receiving module 151, the first obtaining module 152, and the second obtaining module 153 in the database operation device). The processor 60 executes various functional applications of the server and database operating methods, i.e., implements the above-described database operating methods, by executing software programs, instructions, and modules stored in the memory 61.
The memory 61 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the server, and the like. Further, the memory 61 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory 61 may further include memory located remotely from the processor 60, which may be connected to a server over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The present invention also provides a storage medium containing computer-executable instructions which, when executed by a computer processor, are operable to perform a method of database operations, the method comprising:
receiving a first query statement sent by a routing device; the first query statement comprises a first object identifier to be queried, the routing equipment is connected with a plurality of servers including the target server, and the target server is a server corresponding to the first object identifier to be queried, which is determined by the routing equipment according to the corresponding relation between the first object identifier and the server; each server stores an index table and a detail table corresponding to the index table, wherein the index table is used for indicating the mapping relationship between a first object identifier and a second object identifier corresponding to the server, and the detail table is used for indicating the mapping relationship between the second object identifier and detail information;
acquiring a target second object identifier corresponding to the first object identifier to be inquired from an index table stored in the target server according to the first object identifier to be inquired;
and acquiring first target detail information corresponding to the target second object identifier from a detail table stored in the target server according to the target second object identifier.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the method operations described above, and may also perform related operations in the database operation method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a server (which may be a personal computer, a computer device, or a network device) to execute the database operation method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the database operating apparatus, the included units and modules are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (14)

1. A database operation method is applied to a target server, and the method comprises the following steps:
receiving a first query statement sent by a routing device; the first query statement comprises a first object identifier to be queried, the routing equipment is connected with a plurality of servers including the target server, and the target server is a server corresponding to the first object identifier to be queried, which is determined by the routing equipment according to the corresponding relation between the first object identifier and the server; each server stores an index table and a detail table corresponding to the index table, wherein the index table is used for indicating the mapping relationship between a first object identifier and a second object identifier corresponding to the server, and the detail table is used for indicating the mapping relationship between the second object identifier and detail information;
acquiring a target second object identifier corresponding to the first object identifier to be inquired from an index table stored in the target server according to the first object identifier to be inquired;
and acquiring first target detail information corresponding to the target second object identifier from a detail table stored in the target server according to the target second object identifier.
2. The method of claim 1, wherein the first query statement further comprises: the correlation time of a target second object corresponding to the first object identifier to be inquired is identified; the index table of the server comprises a plurality of sub-index tables, each sub-index table is used for indicating the mapping relation of the first object identification, the second object identification and the relevant time of the second object corresponding to the server, and the time ranges formed by the relevant time of the second object in different sub-index tables are different;
the obtaining, according to the first object identifier to be queried, a second object identifier of a target corresponding to the first object identifier to be queried from an index table stored in the target server includes:
determining a sub-index table corresponding to the first object identifier to be inquired in an index table stored in the target server according to the first object identifier to be inquired and the relevant time of the target second object;
and acquiring a target second object identifier corresponding to the first object identifier to be inquired from the sub-index table corresponding to the first object identifier to be inquired.
3. The method of claim 2, further comprising:
receiving a write statement sent by the routing equipment; the writing statement comprises a first object identifier to be written, a second object identifier to be written generated according to the first object identifier to be written, the correlation time of the second object to be written and detail information corresponding to the second object identifier to be written, and the target server is a server corresponding to the first object identifier to be written, which is determined by the routing equipment according to the corresponding relationship between the first object identifier and the server;
determining a sub-index table corresponding to the first object identifier to be written in an index table stored in the target server according to the first object identifier to be written and the relevant time of the second object to be written;
writing the first object identifier to be written, the second object identifier to be written and the relevant time of the second object to be written into a sub index table corresponding to the first object identifier to be written;
and writing the second object identifier to be written and the detail information corresponding to the second object identifier to be written into a detail table stored in the target server.
4. The method of claim 3, wherein the number of servers is 2nN is an integer greater than or equal to 2, and the bit number of the first object identifier to be written is greater than n;
the second object identifier to be written is a unique string generated by the routing equipment according to a preset algorithm, and data formed by the last n bits of data of the first object identifier to be written is added at the tail of the unique string.
5. The method of claim 2, further comprising:
receiving a modification statement sent by the routing equipment; the modification statement comprises a first object identifier to be modified, relevant time of a second object to be modified corresponding to the first object identifier to be modified and modification information corresponding to the first object identifier to be modified, and the target server is a server corresponding to the first object identifier to be modified, which is determined by the routing device according to the corresponding relationship between the first object identifier and the server;
determining a sub-index table corresponding to the first object identifier to be modified in an index table stored in the target server according to the first object identifier to be modified and the relevant time of the second object to be modified;
acquiring a second object identifier to be modified corresponding to the first object identifier to be modified from a sub-index table corresponding to the first object identifier to be modified;
according to the second object identifier to be modified, obtaining detail information corresponding to the second object identifier to be modified from a detail table stored in the target server;
and modifying the detail information corresponding to the second object identifier to be modified according to the modification information corresponding to the first object identifier to be modified.
6. The method of claim 1, further comprising:
receiving a second query statement sent by the routing equipment; the second query statement comprises a second object identifier to be queried, the second object identifier to be queried is generated according to the corresponding first object identifier, and the target server is a server corresponding to the second object identifier to be queried, which is determined by the routing device according to the corresponding relation between the first object identifier and the server;
and acquiring second target detail information corresponding to the second object identifier to be inquired from a detail table stored in the target server according to the second object identifier to be inquired.
7. The method according to any one of claims 2 to 5, further comprising:
acquiring the relevant time of a second object in each sub-index table stored in the target server at a preset frequency;
and deleting the whole piece of data of which the relevant time of the corresponding second object in the sub index table and the detail table stored in the target server meets the preset condition.
8. The method of any of claims 2 to 5, wherein the first object identifier is a user identifier and the second object identifier is a marketing message identifier.
9. The method of claim 8, wherein the marketing message is a coupon and the time of relevance of the second object comprises at least one of: a pickup time of the coupon, an activation time of the coupon, a usage time of the coupon, and an expiration date of the coupon.
10. The method of claim 9, wherein the detail information comprises at least one of: the method comprises the following steps of obtaining the relevant time of the coupon, the type of the coupon, the denomination of the coupon, the using condition of the coupon, a coupon returning rule corresponding to the coupon and the state of the coupon.
11. A database operating system, comprising: a routing device and a plurality of servers connected to the routing device;
the routing equipment acquires a first query statement; wherein the first query statement comprises a first object identifier to be queried;
the routing equipment determines a target server corresponding to the first object identifier to be inquired in the plurality of servers according to the corresponding relation between the first object identifier and the servers; each server stores an index table and a detail table corresponding to the index table, wherein the index table is used for indicating the mapping relationship between a first object identifier and a second object identifier corresponding to the server, and the detail table is used for indicating the mapping relationship between the second object identifier and detail information;
the routing equipment sends the first query statement to the target server;
the target server is used for executing the database operation method according to any one of claims 1 to 10.
12. A database operation device, disposed in a target server, includes:
the receiving module is used for receiving a first query statement sent by the routing equipment; the first query statement comprises a first object identifier to be queried, the routing equipment is connected with a plurality of servers including the target server, and the target server is a server corresponding to the first object identifier to be queried, which is determined by the routing equipment according to the corresponding relation between the first object identifier and the server; each server stores an index table and a detail table corresponding to the index table, wherein the index table is used for indicating the mapping relationship between a first object identifier and a second object identifier corresponding to the server, and the detail table is used for indicating the mapping relationship between the second object identifier and detail information;
a first obtaining module, configured to obtain, according to the first object identifier to be queried, a target second object identifier corresponding to the first object identifier to be queried from an index table stored in the target server;
and the second obtaining module is used for obtaining first target detail information corresponding to the target second object identifier from a detail table stored in the target server according to the target second object identifier.
13. A server, characterized in that the server comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method of database operation as claimed in any one of claims 1 to 10.
14. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of operating a database according to any one of claims 1 to 10.
CN202011613781.3A 2020-12-30 2020-12-30 Database operation method, system, device, server and storage medium Active CN112685417B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011613781.3A CN112685417B (en) 2020-12-30 2020-12-30 Database operation method, system, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011613781.3A CN112685417B (en) 2020-12-30 2020-12-30 Database operation method, system, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN112685417A true CN112685417A (en) 2021-04-20
CN112685417B CN112685417B (en) 2024-04-05

Family

ID=75455353

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011613781.3A Active CN112685417B (en) 2020-12-30 2020-12-30 Database operation method, system, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN112685417B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113205361A (en) * 2021-04-30 2021-08-03 携程商旅信息服务(上海)有限公司 Management method, management system, electronic device and storage medium of electronic coupon
CN115712664A (en) * 2023-01-10 2023-02-24 无锡容智技术有限公司 Method and system for screening cases according to time frame based on log data

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070130118A1 (en) * 2005-12-01 2007-06-07 International Business Machines Corporation Method and apparatus for manipulating data within a remote database in a multiple tier environment
US9449008B1 (en) * 2014-03-31 2016-09-20 Amazon Technologies, Inc. Consistent object renaming in distributed systems
CN108694218A (en) * 2017-04-12 2018-10-23 大唐移动通信设备有限公司 A kind of method and apparatus data write-in and read
CN110276002A (en) * 2019-06-26 2019-09-24 浙江大搜车软件技术有限公司 Search for application data processing method, device, computer equipment and storage medium
CN110879819A (en) * 2019-11-20 2020-03-13 北京明略软件系统有限公司 Method, device, server and storage medium for quickly and accurately identifying routing information
CN111814020A (en) * 2020-06-23 2020-10-23 五八有限公司 Data acquisition method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070130118A1 (en) * 2005-12-01 2007-06-07 International Business Machines Corporation Method and apparatus for manipulating data within a remote database in a multiple tier environment
US9449008B1 (en) * 2014-03-31 2016-09-20 Amazon Technologies, Inc. Consistent object renaming in distributed systems
CN108694218A (en) * 2017-04-12 2018-10-23 大唐移动通信设备有限公司 A kind of method and apparatus data write-in and read
CN110276002A (en) * 2019-06-26 2019-09-24 浙江大搜车软件技术有限公司 Search for application data processing method, device, computer equipment and storage medium
CN110879819A (en) * 2019-11-20 2020-03-13 北京明略软件系统有限公司 Method, device, server and storage medium for quickly and accurately identifying routing information
CN111814020A (en) * 2020-06-23 2020-10-23 五八有限公司 Data acquisition method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113205361A (en) * 2021-04-30 2021-08-03 携程商旅信息服务(上海)有限公司 Management method, management system, electronic device and storage medium of electronic coupon
CN115712664A (en) * 2023-01-10 2023-02-24 无锡容智技术有限公司 Method and system for screening cases according to time frame based on log data

Also Published As

Publication number Publication date
CN112685417B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
CN103019960B (en) Distributed caching method and system
CN107066498B (en) Key value KV storage method and device
KR101994021B1 (en) File manipulation method and apparatus
US8381230B2 (en) Message passing with queues and channels
US20160350302A1 (en) Dynamically splitting a range of a node in a distributed hash table
US11157445B2 (en) Indexing implementing method and system in file storage
CN109977129A (en) Multi-stage data caching method and equipment
WO2019062574A1 (en) Metadata query method and device
US20160364407A1 (en) Method and Device for Responding to Request, and Distributed File System
WO2016086819A1 (en) Method and apparatus for writing data into shingled magnetic record smr hard disk
CN109445702B (en) block-level data deduplication storage system
CN102142032B (en) Method and system for reading and writing data of distributed file system
CN112947856B (en) Memory data management method and device, computer equipment and storage medium
CN111722918A (en) Service identification code generation method and device, storage medium and electronic equipment
CN106156070B (en) A kind of querying method, file mergences method and relevant apparatus
CN105677904B (en) Small documents storage method and device based on distributed file system
CN112685417B (en) Database operation method, system, device, server and storage medium
CN110334069B (en) Data sharing method among multiple processes and related device
CN104423982A (en) Request processing method and device
CN109144406A (en) Metadata storing method, system and storage medium in distributed memory system
CN112307119A (en) Data synchronization method, device, equipment and storage medium
US10747773B2 (en) Database management system, computer, and database management method
CN115470156A (en) RDMA-based memory use method, system, electronic device and storage medium
CN111046106A (en) Cache data synchronization method, device, equipment and medium
US20110246582A1 (en) Message Passing with Queues and Channels

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
CB02 Change of applicant information

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant after: Jingdong Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant before: Jingdong Digital Technology Holding Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant