CN116467358A - Customer information query method, device, equipment and readable storage medium - Google Patents

Customer information query method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN116467358A
CN116467358A CN202310445683.0A CN202310445683A CN116467358A CN 116467358 A CN116467358 A CN 116467358A CN 202310445683 A CN202310445683 A CN 202310445683A CN 116467358 A CN116467358 A CN 116467358A
Authority
CN
China
Prior art keywords
database
client
layer
target
group
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
CN202310445683.0A
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 CN202310445683.0A priority Critical patent/CN116467358A/en
Publication of CN116467358A publication Critical patent/CN116467358A/en
Pending legal-status Critical Current

Links

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/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • 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/2228Indexing structures
    • G06F16/2255Hash tables
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application discloses a client information query method, a client information query device, client information query equipment and a readable storage medium, and the client information query method, the client information query device and the readable storage medium can be applied to the financial field or other fields. Responding to an inquiry request of a user, and determining a client number according to the inquiry request; acquiring a target group and a target database corresponding to the client number based on a database Info table; determining a target table according to the target group and the target database; and acquiring the client information corresponding to the query request according to the target table. Therefore, the concept of the group is added, the database is divided into the group layer, the database layer and the table layer, the group layer, the database layer and the table layer are combined to realize data average distribution, the corresponding group layer, the database layer and the table layer can be determined according to the client number, the client information corresponding to the query request is acquired from the table layer, the server is enabled to operate in a balanced state, and the data query efficiency can be effectively improved.

Description

Customer information query method, device, equipment and readable storage medium
Technical Field
The present application relates to the field of finance, and in particular, to a method, an apparatus, a device, and a readable storage medium for querying customer information.
Background
With the rapid development of the financial industry, banks have a huge customer volume. The business processing process involves the inquiry or modification of the customer information, and the storage and read-write IO performance of the customer information face great challenges. The database is replaced from a powerful ORACLE to a lightweight messenger cloud enterprise-level distributed database (Tencent Distributed Database, TDSQL) to meet existing needs.
However, the database and table dividing mode adopted at present has the problems of uneven data distribution, complex database capacity expansion and migration, and low data query efficiency.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus, a device, and a readable storage medium for querying client information, which can effectively improve data query efficiency.
In order to solve the problems, the technical scheme provided by the application is as follows:
in a first aspect, the present application provides a client information query method, where the method is applied to a server, and includes:
responding to an inquiry request of a user, and determining a client number according to the inquiry request;
acquiring a target group and a target database corresponding to the client number based on a database Info table;
determining a target table according to the target group and the target database;
and acquiring the client information corresponding to the query request according to the target table.
In one possible implementation manner, the determining a target table according to the target group and the target database includes:
determining a target group corresponding to the client number and the database number of the target group from the database Info table;
determining the target database according to the client number and the database number;
and determining the target table according to the client number, the target group and the target database.
In one possible implementation, the method further includes:
responding to an acquired data capacity expansion request, and determining a to-be-allocated client number and client information of the to-be-allocated client number according to the data capacity expansion request;
distributing the client numbers to be distributed to a group layer by adopting a Range vertical partition strategy;
distributing the client numbers to be distributed to the group layer to a database layer by utilizing a hash surplus strategy;
and storing the client information of the client numbers to be allocated to the database layer to the table layer by adopting the Range vertical partition strategy.
In one possible implementation manner, the allocating the client number to be allocated to the group layer to the database layer by using the hash redundancy policy includes:
and distributing the client numbers to be distributed to the group layer to the database layer according to the bearing data proportion of each database in the database layer and the preset divisor value of the hash algorithm.
In one possible implementation, the method further includes:
and updating the database Info table according to the client number to be allocated, the group layer and the database layer.
In a second aspect, the present application provides a client information query apparatus, the apparatus being applied to a server, including:
the determining module is used for responding to the query request of the acquired user and determining the client number according to the query request;
the acquisition module is used for acquiring a target group and a target database corresponding to the client number based on the database Info table;
the determining module is further used for determining a target table according to the target group and the target database;
the acquisition module is further configured to acquire client information corresponding to the query request according to the target table.
In one possible implementation manner, the determining module is configured to determine a target table according to the target group and the target database, and includes:
a determining submodule, configured to determine a target group corresponding to the client number and a database number of the target group from the database Info table; determining the target database according to the client number and the database number; and determining the target table according to the client number, the target group and the target database.
In one possible implementation, the apparatus further includes:
the determining module is also used for responding to the acquired data capacity expansion request and determining a client number to be allocated and client information of the client number to be allocated according to the data capacity expansion request;
the distribution module is used for distributing the client numbers to be distributed to a group layer by adopting a Range vertical partition strategy;
the distribution module is further used for distributing the client numbers to be distributed to the group layer to the database layer by utilizing a hash redundancy strategy;
and the storage module is used for storing the client information of the client numbers to be distributed, which are distributed to the database layer, to the table layer by adopting the Range vertical partition strategy.
In one possible implementation manner, the allocation module is configured to allocate, to a database layer, the client number to be allocated to the group layer by using a hash redundancy policy, where the allocation module includes: and distributing the client numbers to be distributed to the group layer to the database layer according to the bearing data proportion of each database in the database layer and the preset divisor value of the hash algorithm.
In one possible implementation, the apparatus further includes:
and the updating module is used for updating the database Info table according to the client number to be allocated, the group layer and the database layer.
In a third aspect, the present application provides a client information query apparatus, including: a processor, memory, system bus;
the processor and the memory are connected through the system bus;
the memory is configured to store one or more programs, the one or more programs comprising instructions, which when executed by the processor, cause the processor to perform the client information query method of the first aspect described above.
In a fourth aspect, the present application provides a computer readable storage medium storing instructions that, when executed on a device, cause the device to perform the client information query method of the first aspect.
From this, this application has following beneficial effect:
the application provides a client information query method, a device, equipment and a readable storage medium, wherein a query request of a user is obtained in response to the client information query method, the device, the equipment and the readable storage medium, and a client number is determined according to the query request; acquiring a target group and a target database corresponding to the client number based on a database Info table; determining a target table according to the target group and the target database; and acquiring the client information corresponding to the query request according to the target table. Therefore, the concept of the group is added, the database is divided into the group layer, the database layer and the table layer, the group layer, the database layer and the table layer are combined to realize data average distribution, the corresponding group layer, the database layer and the table layer can be determined according to the client number, the client information corresponding to the query request is acquired from the table layer, the server is enabled to operate in a balanced state, and the data query efficiency can be effectively improved.
Drawings
Fig. 1 is a flow chart of a client information query method provided in an embodiment of the present application;
fig. 2 is an interaction schematic diagram of a gateway server and a distributed database module according to an embodiment of the present application;
fig. 3 is a schematic diagram of a correspondence between a data hierarchy and a database and table policy according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a client information query device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a client information query device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The TDSQL kernel is MySQL, whose single table can store 10 hundred million data, but performs poorly when fully loaded. It is well accepted that MySQL single table capacity is the best state below 1 million. Therefore, the mode of library and table division is also a mode which is necessary to be adopted by all distributed systems with large data volume and high concurrency and is used for breaking through the limitation of single machine performance. The database splitting and table splitting are used for solving the problem of reduced performance of the database caused by overlarge data volume, the original independent database is split into a plurality of database components, and the large data table is split into a plurality of data tables, so that the data volume of a single database and a single data table is reduced, and the aim of improving the performance of the database is fulfilled.
Although the database and table dividing mode can improve the data query efficiency and slow down the database pressure, the common database and table dividing scheme has the problems that data may be unevenly distributed and the database expansion and migration are complex, so that the data query efficiency is lower.
Based on the above, the embodiments of the present application provide a method, an apparatus, a device, and a readable storage medium for querying client information, where, in response to obtaining a query request of a user, a client number is determined according to the query request; acquiring a target group and a target database corresponding to the client number based on a database Info table; determining a target table according to the target group and the target database; and acquiring the client information corresponding to the query request according to the target table. Therefore, the concept of the group is added, the database is divided into the group layer, the database layer and the table layer, the group layer, the database layer and the table layer are combined to realize data average distribution, the corresponding group layer, the database layer and the table layer can be determined according to the client number, the client information corresponding to the query request is acquired from the table layer, the server is enabled to operate in a balanced state, and the data query efficiency can be effectively improved.
In order to facilitate understanding of the technical solutions provided by the embodiments of the present application, a method, an apparatus, a device, and a readable storage medium for querying client information provided by the embodiments of the present application are described below with reference to the accompanying drawings.
It should be noted that there are two routing policies, namely a Range vertical partition mapping policy and a hash modulo routing policy. The Range vertical partition mapping strategy is to sequentially cut the client numbers, newly add a single database when the database expands, and put the newly added client numbers with a certain Range in the same newly added database. The strategy is to distribute data with different ranges according to the configuration performance of the database, the range of the data stored in each database is different, and a plurality of newly added databases cannot help the databases to share pressure. New data are frequently inserted, IO interaction pressure is high, problems of hot databases are easy to occur, accidents such as downtime are caused, and customer information query efficiency is further affected.
The hash modulo routing policy includes a simple hash, a consistent hash, and a consistent hash with virtual nodes.
Simple hashing is the assumption that there are n nodes in a distributed system, and traditional schemes use mod (key, n) to map data and nodes. When the capacity is expanded or contracted, even if only 1 node is increased or decreased, the mapping relation is changed into mod (key, n+1)/mod (key, n-1), and most of the mapping relation of data is invalid, so that large-area data migration is required.
Consistent hashing is to hash a corresponding key to have 2 according to a commonly used hash algorithm 32 In the space of individual nodes, i.e. 0-2 32 -1 in the digital space. The digits may be concatenated into a closed loop. For example: there are three servers: s0, S1 and S2, client information with client numbers of 0-100w, 100w-200w and 200w-300w is required to be stored respectively. Generating a hash function: h=hash (server name)% 2 32 The hash value obtained using this function must be found in the hash ring, mapping the server on the ring. When the client information needs to be queried, the client information is also queried according to hash (client number)% 2 32 And (3) mapping the rule of the client information to the ring, finding a first server node according to the clockwise direction, storing the corresponding client information on a corresponding database server, and inquiring the client information from the database server. Although the method avoids the failure of the mapping relation between the large-area data and the servers caused by adding the nodes to a certain extent, the data mapping relation on at least one server still fails, and data migration is still needed.
The consistent hash can greatly optimize the mapping relation problem between data and service caused by simple hash, but when a comparatively poor hash function is used, several servers can be mapped together in the ring hash, so that a lot of space on the hash ring is not utilized, namely, the phenomenon of hash deflection. The consistent hashing algorithm introduces a virtual node mechanism, computes multiple hashes for each service node, and places one such service node in each computation result location, referred to as a virtual node. Specific: the number of virtual nodes associated with each physical node may be determined first and then the number may be incremented after the ip or hostname. Taking the above three servers as an example, three virtual nodes may be calculated for each server, and then hash values of "s0#1", "s0#2", "s0#3", "s1#1", "s1#2", "s1#3", "s2#1", "s2#2", "s2#3" may be calculated, respectively, to form nine virtual nodes. Meanwhile, the data positioning algorithm is unchanged, and only the mapping from virtual nodes to actual nodes is increased, for example, data positioned to three virtual nodes of S0#1, S0#2 and S0#3 are all positioned to an S0 server, data positioned to three virtual nodes of S1#1, S1#2 and S1#3 are all positioned to an S1 server, and so on. The problem of data skew when the serving node is small can be solved, but the hash offset problem is only improved.
As can be seen, the hash modulo routing strategy is to evenly disperse the newly added client numbers into all newly added databases, so that the problem of overheating of the databases in the Range vertical partition mapping strategy is solved. However, the Hash partition has a divisor factor that cannot be arbitrarily changed. And as the data volume is continuously increased, the strategy of simultaneous database and table division of the capacity-expanding database is changed, the divisor factor can influence the positioning of the existing data, the data migration is needed, the system is stopped for data migration, and the normal operation of partial businesses is influenced. If data migration is not performed or is wrong, the data to be used may exist in the database, but the corresponding data cannot be found due to the change of the unit positioning strategy, so that the business process is wrong, and the searching efficiency and the user experience are seriously reduced.
Based on this, the embodiments of the present application propose a Group concept, each Group containing several database nodes, each Group having a separate hash routing algorithm. The number of the specific nodes can be adjusted according to the expansion. For example: when the bank needs to expand the customer number data once, the expanded bank customer number range needs to be evaluated first, taking the range as (N, n+m) as an example, the storage data amount can be predicted according to the performance configuration of a single DataBase node (DataBase, DB), for example, the storage data amount is a, how many databases are needed as a group, that is, M/a DataBase nodes are needed, and the customer number is mapped into the DataBase nodes through a Hash partition strategy. In each database node, there are multiple sub-tables, because of the limitation of MYSQL performance, each sub-Table generally stores up to 2000 ten thousand pieces of data, and in each database, these client numbers are mapped into corresponding sub-Table tables (tables) by a Range vertical partition strategy.
The client information query method provided by the embodiment of the application can be applied to a server, more specifically, a database server and a gateway server, and the embodiment of the application is not limited to this. Referring to fig. 1, fig. 1 is a flowchart of a client information query method provided in an embodiment of the present application, where the method specifically includes S101-S104.
S101: and responding to a query request of the acquired user, and determining a client number according to the query request.
When a user queries client information, the user triggers the generation of a query request, which may carry a client number. The server may receive the query request and extract the client number through the gateway module. The embodiment of the application is not limited to a client number extraction mode, and can be selected according to actual requirements.
S102: and acquiring a target group and a target database corresponding to the client number based on the database Info table.
The database information table may be a database Info table (DBInfo table) previously constructed before the determination of the target group and target database corresponding to the client number is performed. The DBInfo table is used for partitioning client number mapping and hash modulo client number mapping codes of Range policy client number Range. The table may include the Group pid to which the client number belongs (i.e., the target Group), the Group start client number to which the client number belongs, the Group end client number to which the client number belongs, the Group to which the client number belongs containing a DB number that is a hash partition divisor factor, DBId (i.e., the target DB, each Group is encoded starting from 1). Wherein the primary bond is a combined primary bond consisting of GroupId and DBId. The DBInfo table can obtain the GroupID and DB numbers corresponding to the client numbers.
The database application service is built in advance, and the configuration file can comprise information such as DBIP address, DB port number, DB login user name, encryption password and the like. The Table layer can be divided according to actual conditions, for example, a Group has 3 DB with the same or different configuration, 3 DB is expected to store 30 hundred million data volume, one DB stores 10 hundred million data volume according to the memory configuration parameter plan of the server, and each Table stores 1800 ten thousand data, and the Table layer needs to be divided into 56 tables.
In one possible implementation, the DBId may be determined by the customer number and DB number. After receiving the query request, the gateway module queries the DBInfo table, finds the GroupID corresponding to the client number based on Range mapping service, determines the DB number contained in the Group based on hash modulo mapping service, and implements a hash algorithm in the gateway routing code, wherein the formula is as follows:
DBId = client number mod DB number
The IP address of the corresponding DB is located according to GroupID and DBId.
S103: and determining a target table according to the target group and the target database.
Taking a gateway server as an example for explanation, referring to fig. 2, fig. 2 is an interaction schematic diagram of a gateway server and a distributed database module according to an embodiment of the present application. In one possible implementation manner, the determining a target table according to the target group and the target database includes: determining a target group corresponding to the client number and the database number of the target group from the database Info table; determining the target database according to the client number and the database number; and determining the target table according to the client number, the target group and the target database.
The gateway server calls the Group positioning service, takes the client number as an entry, and inquires and returns the Group corresponding to the client number. And calling a DB positioning service, taking the client number and the Group as the entry, and inquiring and returning to the DB corresponding to the client number. And calling the Table positioning service, taking the client number, the DB and the Group as the entry, and inquiring and returning the Table corresponding to the client number.
S104: and acquiring the client information corresponding to the query request according to the target table.
The Table layer uses a Range partition strategy, the client number partition Range is the Range of the whole Group, for example, the Group stores 0-30 hundred million client numbers, a certain DB under the Group divides 56 sub-tables, then the first sub-Table Range is 0-5357 ten thousand (30 hundred million divided by 56), but the Table only stores 1786 ten thousand pieces of data (30 hundred million divided by 3 divided by 56), because the data in the Table is hashed and partitioned, and the TDSQL performance requirement is met.
After the target table is determined, customer information corresponding to the customer number of the query request may be obtained from the data stored in the target table. It should be noted that, the embodiment of the present application is not limited to the manner of acquiring the client information, and may be selected according to actual requirements.
According to the embodiment of the application, a database-division, table-division and capacity-expansion scheme for optimizing the Range vertical partition strategy by adopting the Hash modulus is adopted, and the advantages that mails of the node pressure of the database are scored by the Hash modulus and the Range vertical partition capacity expansion is not required to be transferred are combined. And adopting a Group mode, and uniformly distributing the newly increased data pressure to all databases in the Group by Hash, or dynamically distributing the data quantity according to the performance of each database server. The method can avoid overlarge pressure of a newly-added database caused by database capacity expansion of Range vertical partitions.
Based on the content of the steps S101 to S104, responding to a query request of a user, and determining a client number according to the query request; acquiring a target group and a target database corresponding to the client number based on a database Info table; determining a target table according to the target group and the target database; and acquiring the client information corresponding to the query request according to the target table. Therefore, the concept of the group is added, the database is divided into the group layer, the database layer and the table layer, the group layer, the database layer and the table layer are combined to realize data average distribution, the corresponding group layer, the database layer and the table layer can be determined according to the client number, the client information corresponding to the query request is acquired from the table layer, the server is enabled to operate in a balanced state, and the data query efficiency can be effectively improved.
In another possible implementation manner, when the capacity expansion database is needed, the method further includes: responding to an acquired data capacity expansion request, and determining a to-be-allocated client number and client information of the to-be-allocated client number according to the data capacity expansion request; distributing the client numbers to be distributed to a group layer by adopting a Range vertical partition strategy; distributing the client numbers to be distributed to the group layer to a database layer by utilizing a hash surplus strategy; and storing the client information of the client numbers to be allocated to the database layer to the table layer by adopting the Range vertical partition strategy.
When the capacity expansion database is needed, only the Group needs to be increased, the Group which is increased in capacity expansion each time is in parallel relation with the original Group, the mutual influence is avoided, only the newly increased Group information and the DB and Table information under the Group need to be maintained in the gateway server, and no data migration is needed.
Referring to fig. 3, fig. 3 is a schematic diagram of a correspondence relationship between a data hierarchy and a database and table splitting policy according to an embodiment of the present application. It can be known that the Group layer and the Table layer adopt a database and Table dividing strategy of Range partition, and the DB layer adopts a database and Table dividing strategy of hash remainder.
In one possible implementation manner, the allocating the client number to be allocated to the group layer to the database layer by using the hash redundancy policy includes: and distributing the client numbers to be distributed to the group layer to the database layer according to the bearing data proportion of each database in the database layer and the preset divisor value of the hash algorithm.
The hash redundancy policy is described below, and the hash redundancy algorithm can be optimized in a basic flow according to the embodiment of the application.
If the performances of the nodes of the newly added databases are different, the hot spot problem still occurs by using a common Hash algorithm to halve the data pressure, so that the divisor of the Hash algorithm can be set to be fixed to 10, the remainder is 0 to 9, and the proportion of data born by each database is analyzed according to the performances of the capacity-expansion databases. It should be noted that, the dividend is a client number, and the default client number is sequentially increased. Database performance is determined based on server memory configuration, for example: the running memory 16G of the database server a, the storage memory 1T, the running memory 32G of the database server B, and the storage memory 5T, it can be known that the data amount born by the database server B can be 5 times that of the database server a, the database server a can store the client numbers with the remainder of 0 and 1, and the database server B can store the client numbers of 2-9.
Specifically, for example, db_0 has twice the performance of db_1 and db_2, five remainders of remainders 0, 1, 2, 3, and 4 can be mapped to db_0, three remainders of remainders 5, 6, and 7 are mapped to db_1, and the remaining remainders 8 and 9 are mapped to db_2, so that data size distribution can be designed according to the server index. The above is merely an example, where the hash algorithm simply divides the data into the DBs by scattering and averaging, so long as the amount of data stored in each DB is guaranteed to be relatively averaged, and the above specific example does not impose any limitation on the present application.
In one possible implementation manner, after the database is newly added, the method further includes: and updating the database Info table according to the client number to be allocated, the group layer and the database layer.
Client information inquiry is realized according to the updated database Info table, more perfect data inquiry can be supported, and client information inquiry efficiency and user experience are improved.
It should be noted that the method, the device, the equipment and the readable storage medium for querying client information provided by the application can be used in the financial field or other fields, for example, can be used in the application scenario of client information query in the financial field. Other fields are any field other than the financial field, such as the data processing technical field. The foregoing is merely an example, and is not intended to limit the application fields of the client information query method, apparatus, device and readable storage medium provided in the present application.
The foregoing embodiments of the present application provide a client information query method based on the foregoing. Next, a description will be given of a client information query apparatus further provided in the embodiments of the present application, where the apparatus performs the method shown in fig. 1, and next, a description will be given of a function of the client information query apparatus, and a schematic structure diagram of the client information query apparatus is shown in fig. 4, where the determining module 401 and the acquiring module 402 are shown.
A determining module 401, configured to respond to a query request of a user, and determine a client number according to the query request;
an obtaining module 402, configured to obtain a target group and a target database corresponding to the client number based on a database Info table;
the determining module 401 is further configured to determine a target table according to the target group and the target database;
the obtaining module 402 is further configured to obtain client information corresponding to the query request according to the target table.
In one possible implementation manner, the determining module 401 is configured to determine a target table according to the target group and the target database, including:
a determining submodule, configured to determine a target group corresponding to the client number and a database number of the target group from the database Info table; determining the target database according to the client number and the database number; and determining the target table according to the client number, the target group and the target database.
In one possible implementation, the apparatus further includes:
the determining module is also used for responding to the acquired data capacity expansion request and determining a client number to be allocated and client information of the client number to be allocated according to the data capacity expansion request;
the distribution module is used for distributing the client numbers to be distributed to a group layer by adopting a Range vertical partition strategy;
the distribution module is further used for distributing the client numbers to be distributed to the group layer to the database layer by utilizing a hash redundancy strategy;
and the storage module is used for storing the client information of the client numbers to be distributed, which are distributed to the database layer, to the table layer by adopting the Range vertical partition strategy.
In one possible implementation manner, the allocation module is configured to allocate, to a database layer, the client number to be allocated to the group layer by using a hash redundancy policy, where the allocation module includes: and distributing the client numbers to be distributed to the group layer to the database layer according to the bearing data proportion of each database in the database layer and the preset divisor value of the hash algorithm.
In one possible implementation, the apparatus further includes:
and the updating module is used for updating the database Info table according to the client number to be allocated, the group layer and the database layer.
The embodiment of the application provides a client information query device which comprises a determining module and an obtaining module. The determining module is used for responding to the query request of the acquired user and determining the client number according to the query request; the acquisition module is used for acquiring a target group and a target database corresponding to the client number based on the database Info table; the determining module is further used for determining a target table according to the target group and the target database; the acquisition module is also used for acquiring the client information corresponding to the query request according to the target table. Therefore, the concept of the group is added, the database is divided into the group layer, the database layer and the table layer, the group layer, the database layer and the table layer are combined to realize data average distribution, the corresponding group layer, the database layer and the table layer can be determined according to the client number, the client information corresponding to the query request is acquired from the table layer, the server is enabled to operate in a balanced state, and the data query efficiency can be effectively improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a client information query device according to an embodiment of the present application. Based on the client information query method provided by the above method embodiment, the embodiment of the present application further provides a client information query device, including: a processor, memory, system bus;
the processor and the memory are connected through the system bus;
the memory is configured to store one or more programs, the one or more programs comprising instructions, which when executed by the processor, cause the processor to perform the client information query method of any of the embodiments described above.
Based on the client information query method provided by the above method embodiment, the present application further provides a computer readable storage medium, where the computer readable storage medium stores instructions, when the instructions are executed on a device, cause the device to execute the client information query method described in any one of the above embodiments.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for a system or system embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, with reference to the description of the method embodiment being made in part. The systems and system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A client information query method, wherein the method is applied to a server and comprises the following steps:
responding to an inquiry request of a user, and determining a client number according to the inquiry request;
acquiring a target group and a target database corresponding to the client number based on a database Info table;
determining a target table according to the target group and the target database;
and acquiring the client information corresponding to the query request according to the target table.
2. The method of claim 1, wherein said determining a target table from said target group and said target database comprises:
determining a target group corresponding to the client number and the database number of the target group from the database Info table;
determining the target database according to the client number and the database number;
and determining the target table according to the client number, the target group and the target database.
3. The method according to claim 1, wherein the method further comprises:
responding to an acquired data capacity expansion request, and determining a to-be-allocated client number and client information of the to-be-allocated client number according to the data capacity expansion request;
distributing the client numbers to be distributed to a group layer by adopting a Range vertical partition strategy;
distributing the client numbers to be distributed to the group layer to a database layer by utilizing a hash surplus strategy;
and storing the client information of the client numbers to be allocated to the database layer to the table layer by adopting the Range vertical partition strategy.
4. The method of claim 3, wherein the assigning the client number to be assigned to the group layer to the database layer using a hash-redundancy policy comprises:
and distributing the client numbers to be distributed to the group layer to the database layer according to the bearing data proportion of each database in the database layer and the preset divisor value of the hash algorithm.
5. A method according to claim 3, characterized in that the method further comprises:
and updating the database Info table according to the client number to be allocated, the group layer and the database layer.
6. A client information query apparatus, the apparatus being applied to a server, comprising:
the determining module is used for responding to the query request of the acquired user and determining the client number according to the query request;
the acquisition module is used for acquiring a target group and a target database corresponding to the client number based on the database Info table;
the determining module is further used for determining a target table according to the target group and the target database;
the acquisition module is further configured to acquire client information corresponding to the query request according to the target table.
7. The apparatus of claim 6, wherein the means for determining a target table from the target group and the target database comprises:
a determining submodule, configured to determine a target group corresponding to the client number and a database number of the target group from the database Info table; determining the target database according to the client number and the database number; and determining the target table according to the client number, the target group and the target database.
8. The apparatus of claim 6, wherein the apparatus further comprises:
the determining module is also used for responding to the acquired data capacity expansion request and determining a client number to be allocated and client information of the client number to be allocated according to the data capacity expansion request;
the distribution module is used for distributing the client numbers to be distributed to a group layer by adopting a Range vertical partition strategy;
the distribution module is further used for distributing the client numbers to be distributed to the group layer to the database layer by utilizing a hash redundancy strategy;
and the storage module is used for storing the client information of the client numbers to be distributed, which are distributed to the database layer, to the table layer by adopting the Range vertical partition strategy.
9. The apparatus of claim 8, wherein the means for assigning the client number to be assigned to the group layer to the database layer using a hash redundancy policy comprises: and distributing the client numbers to be distributed to the group layer to the database layer according to the bearing data proportion of each database in the database layer and the preset divisor value of the hash algorithm.
10. The apparatus of claim 8, wherein the apparatus further comprises:
and the updating module is used for updating the database Info table according to the client number to be allocated, the group layer and the database layer.
CN202310445683.0A 2023-04-23 2023-04-23 Customer information query method, device, equipment and readable storage medium Pending CN116467358A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310445683.0A CN116467358A (en) 2023-04-23 2023-04-23 Customer information query method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310445683.0A CN116467358A (en) 2023-04-23 2023-04-23 Customer information query method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN116467358A true CN116467358A (en) 2023-07-21

Family

ID=87180474

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310445683.0A Pending CN116467358A (en) 2023-04-23 2023-04-23 Customer information query method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116467358A (en)

Similar Documents

Publication Publication Date Title
US10467245B2 (en) System and methods for mapping and searching objects in multidimensional space
US8990243B2 (en) Determining data location in a distributed data store
US10275184B2 (en) Framework for volatile memory query execution in a multi node cluster
US8209306B2 (en) Method and apparatus for adding a database partition
US7899851B2 (en) Indexing method of database management system
US9935919B2 (en) Directory partitioned system and method
EP3376403A1 (en) Method of accessing distributed database and device providing distributed data service
US11140220B1 (en) Consistent hashing using the power of k choices in server placement
CN110569302A (en) method and device for physical isolation of distributed cluster based on lucene
CN105045762A (en) Management method and apparatus for configuration file
WO2016191995A1 (en) Method and device for partitioning association table in distributed database
CN112199427A (en) Data processing method and system
Cheng et al. Coupling decentralized key-value stores with erasure coding
US10534765B2 (en) Assigning segments of a shared database storage to nodes
CN111367884A (en) Fragmentation database routing method, system, equipment and storage medium
EP4295235A1 (en) Cache indexing using data addresses based on data fingerprints
CN112422611B (en) Virtual bucket storage processing method and system based on distributed object storage
CN116467358A (en) Customer information query method, device, equipment and readable storage medium
Datta et al. On de Bruijn routing in distributed hash tables: there and back again
CN111428114A (en) Index creating method and device for Elasticissearch search engine
US11310309B1 (en) Arc jump: per-key selection of an alternative server when implemented bounded loads
CN104639570A (en) Resource object storage processing method and device
CN117075823B (en) Object searching method, system, electronic device and storage medium
US11683374B2 (en) Containerized gateways and exports for distributed file systems
US20240169072A1 (en) Native multi-tenant row table encryption

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