WO2020259191A1 - 一种数据中心节点分配方法、装置、系统及计算机设备 - Google Patents
一种数据中心节点分配方法、装置、系统及计算机设备 Download PDFInfo
- Publication number
- WO2020259191A1 WO2020259191A1 PCT/CN2020/092732 CN2020092732W WO2020259191A1 WO 2020259191 A1 WO2020259191 A1 WO 2020259191A1 CN 2020092732 W CN2020092732 W CN 2020092732W WO 2020259191 A1 WO2020259191 A1 WO 2020259191A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- data center
- center node
- stored
- weight value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
- G06F16/2255—Hash tables
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2471—Distributed queries
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Definitions
- the present invention relates to the field of data storage of financial technology (Fintech), and in particular to a data center node allocation method, device, system and computer equipment.
- the embodiments of the present application provide a data center node allocation method, device, system, and computer equipment, which solve the problems of insufficient flexibility and low efficiency in the storage space allocation of data information in the prior art.
- an embodiment of the present application provides a data center node allocation method: obtaining data information to be stored; determining the weight value of each data center node according to at least one factor of each data center node in at least one data center node; Wherein, the at least one factor includes: the number of data information stored in the data center node of the same type as the data information to be stored, and the number of data information of the same type is negatively correlated with the weight value of the data center node; The weight value is used to characterize the probability value that the data center node is assigned to store the data information to be stored; according to the weight value of each data center node, determine to store the to-be-stored data from the at least one data center node The data center node of the data information.
- the weight value of each data center node is determined according to at least one factor of each data center node in at least one data center node, because the weight value is used to characterize the distribution of the data center node.
- the data center node stores the probability value of the data information to be stored, and determines the method of the data center node storing the data information to be stored, thereby increasing the randomness and flexibility of the data center node for data information storage.
- the number of data information stored in the data center node of the same type as the data information to be stored is negatively correlated with the weight value of the data center node, and therefore, is related to the data information to be stored
- a data center node with a larger number of data information of the same type of data information has a higher probability of being randomly fetched, thereby improving the distribution efficiency of data center nodes allocated to the data information to be stored.
- determining the data center node storing the data information to be stored from the at least one data center node according to the weight value of each data center node includes: The weight value of the node determines the total weight value; the total weight value is positively correlated with the sum of the weight values of the data center nodes; the weight value of each data center node is mapped to the data element of each data center node; According to the data elements of each data center node, the data center node of the data information to be stored is determined.
- the total weight value that is positively correlated with the sum of the weight value of each data center node is determined, and the weight value of each data center node is mapped to the data element of each data center node;
- the data elements of the nodes are distributed in the data space corresponding to the total weight value, thereby constructing a randomly selected probability model according to the weight value of each data center node, thereby improving the randomness of the data center node determination.
- the determining the data center node of the data information to be stored according to the data elements of each data center node includes: distributing the data elements of each data center node to a total weight corresponding to In the data space; according to the hash value corresponding to the data information to be stored, determine the position of the data information to be stored in the data space corresponding to the total weight value; the data element closest to the position The corresponding data center node is determined as the data center node storing the data information to be stored.
- the data elements of each data center node are distributed in the data space corresponding to the total weight value, and then according to the hash value corresponding to the data information to be stored, the position of the data space will be closest to the position
- the data center node corresponding to the data element of is determined as the data center node storing the data information to be stored, thereby improving the randomness of determining the data center node.
- the determining the weight value of each data center node includes: using the number of data information of the same type as the data information to be stored in each data center node as the weight value of each data center node; data corresponding to the total weight value
- the space is an array consistent with the total value of the weight; the data element of each data center node corresponds to an element in the array; the hash value corresponding to the data information to be stored is determined to be
- the location of the data information in the data space corresponding to the total weight value includes: obtaining the hash value of the data information to be stored by executing a preset hash algorithm on the data information to be stored and a preset prime number;
- the subscript of the array corresponding to the hash value of the data information to be stored is determined as the position of the data information to be stored in the data space corresponding to the total weight value.
- the data space corresponding to the total weight value is embodied as For an array with the same total weight value, the data element of each data center node corresponds to an element in the array, so that the hash value randomly corresponds to the subscript of the array, so that the number of data center nodes is more balanced.
- the at least one factor further includes: the storage capacity of each data center node in the at least one data center node, and the storage capacity of the data center node is proportional to the weight value of the data center node. Negative correlation.
- the above method gives another factor related to the weight value of the data center node. Since the storage capacity of the data center node is negatively related to the weight value of the data center node, the data center node with the lower storage capacity is The higher the probability of selection, it promotes the load balancing of the data center nodes.
- the at least one data center node is selected from other data center nodes except the data center node in the preset whitelist
- the weight value is set to 0; the preset whitelist is a list of data center nodes that are allowed to be allocated to the preset customer number among the at least one data center node.
- the weight value of the at least one data center node in the at least one data center node except the data center node in the preset white list is set to 0 through the preset white list, so as to realize the special situation Accurate allocation of data center nodes.
- an embodiment of the present application provides a data center node allocation device, including: an acquisition module for acquiring data information to be stored; a processing module for acquiring data based on at least one of the data center nodes in at least one data center node
- the item factor determines the weight value of each data center node; wherein the at least one factor includes: the number of data information stored in the data center node of the same type as the data information to be stored, and the number of data information of the same type Is negatively correlated with the weight value of the data center node; the weight value is used to characterize the probability value of the data center node to store the data information to be stored; according to the weight value of each data center node, from the Determine the data center node storing the data information to be stored among at least one data center node.
- the processing module is specifically configured to: determine the total weight value according to the weight value of each data center node; the sum of the total weight value and the weight value of each data center node is positive Correlation; Map the weight value of each data center node to the data element of each data center node; determine the data center node of the data information to be stored according to the data element of each data center node.
- the processing module is specifically configured to: distribute the data elements of each data center node in the data space corresponding to the total weight value; determine according to the hash value corresponding to the data information to be stored The position of the data information to be stored in the data space corresponding to the total weight value; and the data center node corresponding to the data element closest to the position is determined as the data center node storing the data information to be stored.
- the processing module is specifically configured to: use the number of data information of the same type as the data information to be stored in each data center node as the weight value of each data center node; and the total weight value
- the corresponding data space is an array consistent with the total value of the weight; the data element of each data center node corresponds to an element in the array; the preset hash algorithm is executed on the data information to be stored and the preset prime number , Obtain the hash value of the data information to be stored; determine the subscript of the array corresponding to the hash value of the data information to be stored as the total weight value of the data information to be stored The location of the corresponding data space.
- the at least one factor further includes: the storage capacity of each data center node in the at least one data center node, and the storage capacity of the data center node is proportional to the weight value of the data center node. Negative correlation.
- the processing module is further configured to: if the preset customer number has a preset whitelist, add the at least one data center node to the data center in the preset whitelist The weight value of other data center nodes other than the node is set to 0; the preset whitelist is a list of data center nodes that are allowed to be allocated to the preset customer number among the at least one data center node.
- this application provides a data center node distribution system, including: each data center node is used to store data information; a data center node distribution device is used to obtain the data information to be stored from the business system, according to each data center
- the weight value of the node determines the data center node that stores the data information to be stored; the weight value is used to indicate the probability value that the data center node stores the data information to be stored; the factors that affect the weight value It includes at least: the number of data information of the same type as the data information to be stored stored in the data center node, and the number of data information of the same type is negatively related to the weight value of the data center node.
- the system further includes: a distributed storage device for synchronizing data information stored in each data center node and providing a query interface to the outside; an update device for determining if the business system If the data information is updated, a notification message is sent to the distributed storage device; the notification message is used to instruct to update the data information stored in the distributed storage device to the business system Data information after the data information is updated.
- the data center node allocation device is specifically configured to: determine a total weight value according to the weight value of each data center node; the total weight value and the weight of each data center node The sum of the values is positively correlated; the weight value of each data center node is mapped to the data element of each data center node; the data element of each data center node is distributed in the data space corresponding to the total weight value; according to the to-be-stored Determine the location of the data information to be stored in the data space corresponding to the total weight value; determine the data center node corresponding to the data element closest to the location to store the The data center node of the data information to be stored.
- an embodiment of the present application provides a computer device, including a program or instruction, when the program or instruction is executed, it is used to execute the methods of the foregoing first aspect and each embodiment of the first aspect.
- an embodiment of the present application provides a storage medium including a program or instruction, and when the program or instruction is executed, the method of the foregoing first aspect and each embodiment of the first aspect is executed.
- FIG. 1 is a schematic structural diagram of a data center node allocation system provided by an embodiment of the application
- FIG. 2 is a schematic diagram of a sequence of opening an account of a data center node allocation system provided by an embodiment of the application;
- FIG. 3 is a schematic diagram of a sequence of querying customer DCN of a data center node distribution system provided by an embodiment of the application;
- FIG. 4 is a schematic diagram of a specific architecture of a data center node allocation system provided by an embodiment of the application.
- FIG. 5 is a schematic diagram of multiple types of DCN accessing the GNS system provided in an embodiment of the application.
- FIG. 6 is a schematic flowchart of steps of a method for allocating data center nodes according to an embodiment of the application
- FIG. 7 is a schematic structural diagram of a data center node allocation device provided by an embodiment of the application.
- the data information of the customer number can only be allocated according to the order of storage space, and it is determined that the data information storage of the customer number cannot be flexibly allocated Which database to go to?
- the storage characteristics of different databases are also different.
- the databases are allocated according to the order in which the databases are created, there is no distinction between the databases, so the allocation efficiency is higher low. This situation does not meet the needs of banks and other financial institutions, and cannot guarantee the efficient operation of various businesses of financial institutions.
- DCN Data center node
- Customers are distinguished by DCN.
- One DCN contains all the services of a part of customers and all their data.
- GNS Global naming service
- C/S client/server
- the client provides application program interfaces for business system integration.
- the server is a highly available multi-data center node distributed system based on key value databases and relational databases. GNS can be used to manage the binding relationship between customers and DCN.
- FIG. 1 it is a schematic structural diagram of a data center node allocation system provided by an embodiment of this application.
- the architecture shown in Figure 1 can be implemented based on GNS.
- the data center node distribution system includes the following parts:
- Each data center node is used to store data information.
- the database corresponding to the data center node is a non-relational high-performance database.
- the identity of the data center node can be stored in Redis, and one Redis can store the identities of multiple data center nodes.
- the data center node allocation device is used to obtain the data information to be stored from the business system, and is used to determine the data center node storing the data information to be stored according to the weight value of each data center node.
- the weight value is used to indicate the probability value of assigning the data center node to store the data information to be stored.
- the factors affecting the weight value include at least: the number of data information of the same type as the data information to be stored stored in the data center node, and the number of data information of the same type is negatively correlated with the weight value of the data center node .
- the name of the data center node distribution device is also not limited, such as GNS-UPDATE, which is responsible for the management and distribution of DCN.
- the input function can also be implemented directly through each data center node, or the input function can be implemented through a device alone.
- the data center node allocation device may determine the data center node storing the data information to be stored in the following manner:
- the total weight value is determined according to the weight value of each data center node; the total weight value is positively correlated with the sum of the weight value of each data center node; the weight value of each data center node is mapped to each data
- the data elements of the central node; the data elements of each data center node are distributed in the data space corresponding to the total weight value; according to the hash value corresponding to the data information to be stored, it is determined that the data information to be stored is in the The position of the data space corresponding to the total weight value; the data center node corresponding to the data element closest to the position is determined as the data center node storing the data information to be stored.
- the distributed storage device is used to synchronize the data information stored in each data center node and provide an external query interface. Such as providing a query system to provide users with a query interface.
- the name of the distributed storage device is also not limited, such as GNS-QUERY.
- the update device is configured to send a notification message to the distributed storage device if it is determined that the data information in the business system is updated; the notification message is used to instruct to store the data stored in the distributed storage device
- the data information is updated to data information after the data information in the business system is updated.
- the name of the update device is also not limited, such as GNS-RECNCLN.
- Relational storage device which uses a relational database to store data of all data center nodes in the data center node distribution system.
- the name of the relational storage device is also not limited, such as DB.
- Data can be written to relational databases first, and then written asynchronously to non-relational databases such as Redis, TiKV, and CKV.
- a verification device can be added to verify whether the data stored in the data center node and the relational storage device are consistent, such as realizing the reconciliation function of DB and Redis data.
- FIG. 2 an account opening sequence diagram of a data center node distribution system according to an embodiment of the present application is provided.
- User registration or account opening The user opens an account in the business system.
- the business system first calls the customer management system to create a customer number, and the customer management system calls GNS to assign a DCN.
- the customer management system broadcasts customer information, including mobile phone number, bank card number, bank account number, WeChat login account, partner account number, ID card number and other information to GNS.
- GNS binds the customer number and customer information to serve as a routing query index.
- FIG. 3 the sequence diagram of the customer DCN query of the data center node distribution system provided by this embodiment of the application .
- Login or transaction When a customer logs in to the system or transaction, the business system needs to obtain the customer's DCN. At this time, the routing information such as the mobile phone number or WeChat login account that the customer filled in when logging in is used to obtain DCN from GNS. Then proceed to the next step.
- the routing information such as the mobile phone number or WeChat login account that the customer filled in when logging in is used to obtain DCN from GNS. Then proceed to the next step.
- FIG. 4 it is a schematic diagram of a specific architecture of a data center node allocation system provided by an embodiment of this application.
- Database is the full database of the system, and Redis is used to achieve high performance. Synchronize the full amount of data to Redis.
- the network delay across data centers will generally be relatively large.
- this application is designed in each data center (IDC, Internet Data Center, also known as Internet Data Center) deploys a set of independent Redis and maintains a set of full data copies. Deploy GNS-QUERY that only accesses Redis in this data center in each data center. According to the pressure test data, a single instance can support 20,000 query per second (QPS) on an 8-core 16G machine. High availability of the system can also be achieved in the following ways:
- Redis uses a storage structure of one primary and two backups, that is, one primary database and two backup databases to ensure that data will not be lost.
- GNS-UPDATE When the data is updated, GNS-UPDATE will cross the data and put it in the retry queue to wait for retry to achieve data consistency. The center synchronizes the data to each Redis, and if the write fails, it will immediately retry.
- GNS-VERIFY will regularly check the differences between the IDC DB and Redis data. Ensure the ultimate consistency of the data.
- GNS-QUERY uses Bloom Filter to reduce the empty query rate and improve performance.
- there are a large number of empty queries in user routing and there are often a large number of unopened accounts to query DCN.
- this solution uses Bloom filters to reduce the consumption of this part of empty queries.
- Bloom filter is a highly space-efficient data structure used to retrieve whether an element belongs to a collection. If the Bloom filter determines that the element does not exist, it must not exist. If the Bloom filter determines that the element exists, it may not exist. Therefore, in some cases, it is not necessary to continue to access the underlying storage and directly return the result of the unopened account.
- FIG. 5 this is a schematic diagram of the multi-type DCN accessing the GNS system provided in the embodiment of this application.
- GNS provides an application program interface (API) for realizing GNS of different types of services (only service A GNS, service B GNS, business C GNS as an example) to realize independent storage.
- API application program interface
- a unified client is designed to identify the line of business ID parameters to implement multi-service routing, and the client is provided for business system integration in the form of API. For example, when the ID of service A is passed in to check DCN, the client automatically retrieves the GNS of service A.
- the business line is different from the products mentioned in the above DCN weight, and there are multiple products under one business line. DCNs under the same business line are of the same kind, and DCNs under different business lines are different.
- FIG. 6 it is a schematic flow chart of the steps of a data center node allocation method provided by an embodiment of this application.
- Step 601 Obtain data information to be stored
- Step 602 Determine the weight value of each data center node according to at least one factor of each data center node in at least one data center node.
- the at least one factor includes: the number of data information stored in the data center node of the same type as the data information to be stored, and the number of data information of the same type is negatively correlated with the weight value of the data center node;
- the weight value is used to characterize the probability value that the data center node is allocated to store the data information to be stored.
- the at least one factor may also include the storage capacity of each data center node in the at least one data center node, and the storage capacity of the data center node is negatively related to the weight value of the data center node.
- the DCN weight may be defined in advance through configuration information, and may be stored in an extensible markup language (XML) format.
- DCN weight information is placed under product attributes, and each product independently allocates its own weight.
- product attributes There are many types of products in the business of financial institutions, such as deposit products, loan products, etc., and different types of products have different attributes.
- DCN nodes There are multiple DCN nodes for storage under each product. Each DCN node contains two attributes: name and weight. The weight describes the probability of a new customer opening an account in this DCN.
- step 602 weight configuration is performed on the DCN to control the capacity of the DCN. For example, reduce the weight of the DCN with a higher capacity load rate and increase the weight of the DCN with a lower capacity load rate to achieve load balancing.
- step 602 Another optional implementation manner of step 602 is as follows:
- the preset white list is a list of data center nodes that are allowed to be allocated to the preset customer number among the at least one data center node.
- the weight represents the possibility for a new customer to open this DCN, and the configuration of the weight will be ignored when opening an account with a designated DCN.
- the business requires precise DCN account opening and strictly controls the DCN of the customer's account opening. For example, if you want to launch a new DCN, you need to perform a grayscale test for the application under this DCN. At this time, adjust the weight of this DCN to 0, and at the same time specify a user to fall on the specified DCN by means of a whitelist, all functions are tested After passing, the volume is increased.
- Step 603 According to the weight value of each data center node, determine the data center node storing the data information to be stored from the at least one data center node.
- step 603 is the following steps 1 to 5:
- the first step is to determine the total weight value according to the weight value of each data center node.
- the total weight value is positively correlated with the sum of the weight values of the data center nodes.
- the corresponding weight values of data center node 1, data center node 2, and data center node 3 are 300, 400, and 500 respectively, and the total weight value is 1200.
- the second step is to map the weight value of each data center node to the data element of each data center node.
- the second step can specifically be:
- the data space corresponding to the total weight value is an array consistent with the total weight value.
- the third step is to determine the data center node of the data information to be stored according to the data elements of each data center node.
- the third step can specifically include the following steps (1) to (3):
- Step (1) Distribute the data elements of each data center node in the data space corresponding to the total weight value.
- data center node 1, data center node 2, data center node 3 can be mapped to an array with subscripts 0 to 1199, 0 to 299 are mapped to data center node 1, and 300 to 699 are mapped It is data center node 2, and 700 to 1199 are mapped to data center node 3.
- Step (2) Determine the position of the data information to be stored in the data space corresponding to the total weight value according to the hash value corresponding to the data information to be stored.
- Step (2) can be specifically as follows:
- Obtain the hash value of the data information to be stored by executing a preset hash algorithm on the data information to be stored and preset prime numbers; determine the array corresponding to the hash value of the data information to be stored As the position of the data information to be stored in the data space corresponding to the total weight value.
- the customer number is 0999960000134036
- the preset prime number is 131
- the preset hash algorithm is the BKDR hash algorithm in the string hash algorithm
- the hash value is 1280.
- Step (3) Determine the data center node corresponding to the data element closest to the location as the data center node storing the data information to be stored.
- the weight value of each data center node is determined according to at least one factor of each data center node in at least one data center node, because the weight value is used to characterize the distribution of the data center node.
- the data center node stores the probability value of the data information to be stored, and determines the method of the data center node storing the data information to be stored, thereby increasing the randomness and flexibility of the data center node for data information storage.
- the number of data information stored in the data center node of the same type as the data information to be stored is negatively correlated with the weight value of the data center node, and therefore, is related to the data information to be stored
- a data center node with a larger number of data information of the same type of data information has a higher probability of being randomly fetched, thereby improving the distribution efficiency of data center nodes allocated to the data information to be stored.
- FIG. 7 a schematic structural diagram of an apparatus for allocating data center nodes is provided in an embodiment of this application.
- An embodiment of the present application provides a data center node allocation device, including: an acquisition module 701, configured to acquire data information to be stored; a processing module 702, configured according to at least one factor of each data center node in at least one data center node , Determine the weight value of each data center node; wherein the at least one factor includes: the number of data information stored in the data center node of the same type as the data information to be stored, the number of data information of the same type and the The weight value of the data center node is negatively correlated; the weight value is used to characterize the probability value of the data center node that is allocated to store the data information to be stored; according to the weight value of each data center node, from the at least one The data center node that stores the data information to be stored is determined among the data center nodes.
- the processing module 702 is specifically configured to: determine a total weight value according to the weight value of each data center node; the sum of the total weight value and the weight value of each data center node Positive correlation; map the weight value of each data center node to the data element of each data center node; determine the data center node of the data information to be stored according to the data element of each data center node.
- the processing module 702 is specifically configured to: distribute the data elements of each data center node in the data space corresponding to the total weight value; according to the hash value corresponding to the data information to be stored, Determine the position of the data information to be stored in the data space corresponding to the total weight value; determine the data center node corresponding to the data element closest to the position as the data center node storing the data information to be stored .
- the processing module 702 is specifically configured to: use the number of data information of the same type as the data information to be stored in each data center node as the weight value of each data center node;
- the data space corresponding to the value is an array consistent with the total value of the weight; the data element of each data center node corresponds to an element in the array; by performing preset hashing on the data information to be stored and the preset prime number Algorithm to obtain the hash value of the data information to be stored; determine the subscript of the array corresponding to the hash value of the data information to be stored as the total weight of the data information to be stored The location of the data space corresponding to the value.
- the at least one factor further includes: the storage capacity of each data center node in the at least one data center node, and the storage capacity of the data center node is proportional to the weight value of the data center node. Negative correlation.
- the processing module 702 is further configured to: if the preset customer number has a preset whitelist, remove the data in the preset whitelist from the at least one data center node The weight value of other data center nodes other than the central node is set to 0; the preset whitelist is a list of data center nodes that are allowed to be allocated to the preset customer number among the at least one data center node.
- An embodiment of the application provides a computer device, including a program or instruction, when the program or instruction is executed, it is used to execute a data center node allocation method and any optional method provided in the embodiment of the application.
- the embodiment of the present application provides a storage medium including a program or instruction, and when the program or instruction is executed, it is used to execute a data center node allocation method and any optional method provided in the embodiment of the present application.
- the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program codes.
- a computer-usable storage media including but not limited to disk storage, optical storage, etc.
- These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
- the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Fuzzy Systems (AREA)
- Mathematical Physics (AREA)
- Probability & Statistics with Applications (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种数据中心节点分配方法、装置、系统及计算机设备,其中方法为:获取待存储的数据信息;根据至少一个数据中心节点中各数据中心节点的至少一项因素,确定各数据中心节点的权重值;其中,至少一项因素包括:数据中心节点中存储与待存储的数据信息类型相同的数据信息的数目,类型相同的数据信息的数目与该数据中心节点的权重值呈负相关;权重值用于表征分配该数据中心节点存储待存储的数据信息的概率值;根据各数据中心节点的权重值,从至少一个数据中心节点中确定存储待存储的数据信息的数据中心节点。上述方法应用于金融科技(Fintech)时,提升了分配给待存储的数据信息的数据中心节点的分配效率。
Description
相关申请的交叉引用
本申请要求在2019年06月28日提交中国专利局、申请号为201910579364.2、申请名称为“一种数据中心节点分配方法、装置、系统及计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及金融科技(Fintech)的数据存储领域,尤其涉及一种数据中心节点分配方法、装置、系统及计算机设备。
随着计算机技术的发展,越来越多的技术(大数据、分布式、区块链(Blockchain)、人工智能等)应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变。目前,金融科技领域中,有各种各样的产品,每种产品下,都有大量客户开户,并需要为每个客户号的数据分配存储空间。
当一个新客户开户生成了客户号后,需要存储相关数据信息,现有技术中,采用关系型数据库分库和分表的方式,顺位存储在关系型数据库中,然而数据库的容量是有限的,当一个数据库存满后,会继续创建一个新数据库作为客户号对应的数据存储空间,后续客户号生成时,又从这个新数据库中继续分配存储空间,这样一来,客户号的数据信息只能根据先后顺序分配存储空间,无法灵活调配客户号的数据信息存储到哪个数据库,另外,由于客户号的数据信息的不同特性,在不同数据库存储时的存储特性也不同,按数据库创建的先后顺序分配数据库时,各个数据库之间并无区分,因此分配的效率较低。现有技术中,客户号的数据信息的存储空间分配不够灵活,效率低下,是一个亟待解决的问题。
发明内容
本申请实施例提供一种数据中心节点分配方法、装置、系统及计算机设备,解决了现有技术中数据信息的存储空间分配不够灵活,效率低下的问题。
第一方面,本申请实施例提供一种数据中心节点分配方法:获取待存储的数据信息;根据至少一个数据中心节点中各数据中心节点的至少一项因素,确定各数据中心节点的权重值;其中,所述至少一项因素包括:数据中心节点中存储与所述待存储的数据信息类型相同的数据信息的数目,类型相同的数据信息的数目与该数据中心节点的权重值呈负相关;所述权重值用于表征分配该数据中心节点存储所述待存储的数据信息的概率值;根据所述各数据中心节点的权重值,从所述至少一个数据中心节点中确定存储所述待存储的数据信息的数据中心节点。
上述方法中,在获取了待存储的数据信息后,根据至少一个数据中心节点中各数据中心节点的至少一项因素,确定各数据中心节点的权重值,由于所述权重值用于表征分配该数据中心节点存储所述待存储的数据信息的概率值,确定存储所述待存储的数据信息的数据中心节点的方式,从而增加了数据信息存储的数据中心节点的随机性和灵活性,另外,由于数据中心节点中存储的与所述待存储的数据信息类型相同的数据信息的数目,类型相同的数据信息的数目与该数据中心节点的权重值呈负相关,因此,与所述待存储的数据信息类型相同的数据信息的数目更多的数据中心节点被随机取到的概率更高,从而提升了分配给待存储的数据信息的数据中心节点的分配效率。
一种可选实施方式中,根据所述各数据中心节点的权重值,从所述至少一个数据中心节点中确定存储所述待存储的数据信息的数据中心节点,包括:根据所述各数据中心节点的权重值,确定权重总值;所述权重总值与所述各数据中心节点的权重值之和呈正相关;将所述各数据中心节点的权重值映射为各数据中心节点的数据元素;根据所述各数据中心节点的数据元素,确定所述待存储的数据信息的数据中心节点。
上述方法中,确定出了与所述各数据中心节点的权重值之和呈正相关的权重总值,将所述各数据中心节点的权重值映射为各数据中心节点的数据元素;将各数据中心节点的数据元素分布于权重总值对应的数据空间中,从而根据各数据中心节点的权重值构建出随机选取的概率模型,从而提升了数据中心节点确定的随机性。
一种可选实施方式中,所述根据所述各数据中心节点的数据元素,确定所述待存储的数据信息的数据中心节点,包括:将各数据中心节点的数据元素分布于权重总值对应的数据空间中;根据所述待存储的数据信息对应的哈希值,确定所述待存储的数据信息在所述权重总值对应的数据空间的位置;将与所述位置最接近的数据元素对应的数据中心节点确定为存储所述待存储的数据信息的数据中心节点。
上述方法中,将各数据中心节点的数据元素分布于权重总值对应的数据空间中,再根据所述待存储的数据信息对应的哈希值,数据空间的位置,将与所述位置最接近的数据元素对应的数据中心节点确定为存储所述待存储的数据信息的数据中心节点,从而提升了确定数据中心节点的随机性。
所述确定各数据中心节点的权重值,包括:将各数据中心节点中存储与所述待存储的数据信息类型相同的数据信息的数目作为各数据中心节点的权重值;权重总值对应的数据空间为与所述权重总值一致的数组;各数据中心节点的数据元素对应所述数组中的一个元素;所述根据所述待存储的数据信息对应的哈希值,确定所述待存储的数据信息在所述权重总值对应的数据空间的位置,包括:通过对所述待存储的数据信息和预设质数执行预设哈希算法,获取所述待存储的数据信息的哈希值;确定所述待存储的数据信息的哈希值对应的所述数组的下标,以作为所述待存储的数据信息在所述权重总值对应的数据空间的位置。
上述方法中,通过将各数据中心节点中存储与所述待存储的数据信息类型相同的数据信息的数目作为各数据中心节点的权重值,将权重总值对应的数据空间具体化为与所述权 重总值一致的数组,各数据中心节点的数据元素对应所述数组中的一个元素,从而通过哈希值随机对应所述数组的下标,使得各数据中心节点的数目更加均衡。
一种可选实施方式中,所述至少一项因素还包括:所述至少一个数据中心节点中每个数据中心节点的存储容量,该数据中心节点的存储容量与该数据中心节点的权重值呈负相关。
上述方式给出了另一项与数据中心节点的权重值相关的因素,由于数据中心节点的存储容量与该数据中心节点的权重值呈负相关,从而使得存储容量越低的数据中心节点,被选中的概率越高,促进了各数据中心节点的负载均衡。
一种可选实施方式中,若所述预设客户号存在预设白名单,则将所述至少一个数据中心节点中,除所述预设白名单中数据中心节点之外其它数据中心节点的权重值设为0;所述预设白名单为所述至少一个数据中心节点中,允许分配给所述预设客户号的数据中心节点的名单。
上述方式下,通过预设白名单,将所述至少一个数据中心节点中,除所述预设白名单中数据中心节点之外其它数据中心节点的权重值设为0,从而实现特殊情景下的数据中心节点精准分配。
第二方面,本申请实施例提供一种数据中心节点分配装置,包括:获取模块,用于获取待存储的数据信息;处理模块,用于根据至少一个数据中心节点中各数据中心节点的至少一项因素,确定各数据中心节点的权重值;其中,所述至少一项因素包括:数据中心节点中存储与所述待存储的数据信息类型相同的数据信息的数目,类型相同的数据信息的数目与该数据中心节点的权重值呈负相关;所述权重值用于表征分配该数据中心节点存储所述待存储的数据信息的概率值;根据所述各数据中心节点的权重值,从所述至少一个数据中心节点中确定存储所述待存储的数据信息的数据中心节点。
一种可选实施方式中,所述处理模块具体用于:根据所述各数据中心节点的权重值,确定权重总值;所述权重总值与所述各数据中心节点的权重值之和呈正相关;将所述各数据中心节点的权重值映射为各数据中心节点的数据元素;根据所述各数据中心节点的数据元素,确定所述待存储的数据信息的数据中心节点。
一种可选实施方式中,所述处理模块具体用于:将各数据中心节点的数据元素分布于权重总值对应的数据空间中;根据所述待存储的数据信息对应的哈希值,确定所述待存储的数据信息在所述权重总值对应的数据空间的位置;将与所述位置最接近的数据元素对应的数据中心节点确定为存储所述待存储的数据信息的数据中心节点。
一种可选实施方式中,所述处理模块具体用于:将各数据中心节点中存储与所述待存储的数据信息类型相同的数据信息的数目作为各数据中心节点的权重值;权重总值对应的数据空间为与所述权重总值一致的数组;各数据中心节点的数据元素对应所述数组中的一个元素;通过对所述待存储的数据信息和预设质数执行预设哈希算法,获取所述待存储的数据信息的哈希值;确定所述待存储的数据信息的哈希值对应的所述数组的下标,以作为所述待存储的数据信息在所述权重总值对应的数据空间的位置。
一种可选实施方式中,所述至少一项因素还包括:所述至少一个数据中心节点中每个数据中心节点的存储容量,该数据中心节点的存储容量与该数据中心节点的权重值呈负相关。
一种可选实施方式中,所述处理模块还用于:若所述预设客户号存在预设白名单,则将所述至少一个数据中心节点中,除所述预设白名单中数据中心节点之外其它数据中心节点的权重值设为0;所述预设白名单为所述至少一个数据中心节点中,允许分配给所述预设客户号的数据中心节点的名单。
上述第二方面及第二方面各个实施例的有益效果,可以参考上述第一方面及第一方面各个实施例的有益效果,这里不再赘述。
第三方面,本申请提供一种数据中心节点分配系统,包括:各数据中心节点,用于存储数据信息;数据中心节点分配设备,用于从业务系统获取待存储的数据信息,根据各数据中心节点的权重值,确定存储所述待存储的数据信息的数据中心节点;所述权重值用于表示分配该数据中心节点存储所述待存储的数据信息的概率值;影响所述权重值的因素至少包括:数据中心节点中存储的与所述待存储的数据信息类型相同的数据信息的数目,类型相同的数据信息的数目与该数据中心节点的权重值呈负相关。
一种可选实施方式中,所述系统还包括:分布式存储设备,用于同步所述各数据中心节点存储的数据信息并对外提供查询接口;更新设备,用于若确定所述业务系统中的所述数据信息发生更新,则向所述分布式存储设备发送通知消息;所述通知消息用于指示,将所述分布式存储设备中存储的所述数据信息,更新为所述业务系统中所述数据信息发生更新后的数据信息。
一种可选实施方式中,所述数据中心节点分配设备,具体用于:根据所述各数据中心节点的权重值,确定权重总值;所述权重总值与所述各数据中心节点的权重值之和呈正相关;将所述各数据中心节点的权重值映射为各数据中心节点的数据元素;将各数据中心节点的数据元素分布于权重总值对应的数据空间中;根据所述待存储的数据信息对应的哈希值,确定所述待存储的数据信息在所述权重总值对应的数据空间的位置;将与所述位置最接近的数据元素对应的数据中心节点确定为存储所述待存储的数据信息的数据中心节点。
上述第三方面及第三方面各个实施例的有益效果,可以参考上述第一方面及第一方面各个实施例的有益效果,这里不再赘述。
第四方面,本申请实施例提供一种计算机设备,包括程序或指令,当所述程序或指令被执行时,用以执行上述第一方面及第一方面各个实施例的方法。
第五方面,本申请实施例提供一种存储介质,包括程序或指令,当所述程序或指令被执行时,用以执行上述第一方面及第一方面各个实施例的方法。
图1为本申请实施例提供的一种数据中心节点分配系统的架构示意图;
图2为本申请实施例提供的一种数据中心节点分配系统的开户的时序示意图;
图3为本申请实施例提供的一种数据中心节点分配系统的查询客户DCN的时序示意图;
图4为本申请实施例提供的一种数据中心节点分配系统的具体架构示意图;
图5为本申请实施例中提供的多类DCN接入GNS系统的示意图;
图6为本申请实施例提供的一种数据中心节点分配方法的步骤流程示意图;
图7为本申请实施例提供的一种数据中心节点分配装置的结构示意图。
为了更好的理解上述技术方案,下面将结合说明书附图及具体的实施方式对上述技术方案进行详细的说明,应当理解本申请实施例以及实施例中的具体特征是对本申请技术方案的详细的说明,而不是对本申请技术方案的限定,在不冲突的情况下,本申请实施例以及实施例中的技术特征可以相互结合。
在金融机构(银行机构、保险机构或证券机构)在进行业务(如银行的贷款业务、存款业务等)运转过程中,有各种各样的产品,每种产品下,都有大量客户开户,并需要为每个客户号的数据分配存储空间。现有技术中,采用关系型数据库分库和分表的方式,顺位存储在关系型数据库中,然而数据库的容量是有限的,当一个数据库存满后,会继续创建一个新数据库作为客户号对应的数据存储空间,后续客户号生成时,又从这个新数据库中继续分配存储空间,这样以来,客户号的数据信息只能根据先后顺序分配存储空间,确定无法灵活调配客户号的数据信息存储到哪个数据库,另外,由于客户号的数据信息的不同特性,在不同数据库存储时的存储特性也不同,按数据库创建的先后顺序分配数据库时,各个数据库之间并无区分,因此分配的效率较低。这种情况不符合银行等金融机构的需求,无法保证金融机构各项业务的高效运转。
为方便叙述,首先介绍下本申请实施例涉及到的缩略语。
数据中心节点(data center node,DCN):用来存储数据信息的节点,客户通过DCN区分,一个DCN包含一部分客户的所有业务以及他们的所有数据。
全局命名服务(global naming service,GNS):一个命名服务系统,用于快速定位客户所在DCN,并在逻辑上划分DCN。本申请实施例提出一个独立的、业务无关的用户路由系统GNS,用于用户DCN分配和查询。GNS是基于客户端/服务器端(C/S)的架构,客户端提供应用程序接口给业务系统集成。服务器是基于关键值型数据库和关系型数据库的高可用多数据中心节点分布式系统,GNS可用于管理客户和DCN的绑定关系。
如图1所示,为本申请实施例提供的一种数据中心节点分配系统的架构示意图。图1示出的架构可基于GNS实现。该数据中心节点分配系统,包括以下部分:
各数据中心节点,用于存储数据信息。数据中心节点对应的数据库为非关系型的高性能数据库。其中,数据中心节点的标识可存储在Redis中,一个Redis可存储多个数据中心节点的标识。
数据中心节点分配设备,用于从业务系统获取待存储的数据信息,用于根据各数据中 心节点的权重值,确定存储所述待存储的数据信息的数据中心节点。所述权重值用于表示分配该数据中心节点存储所述待存储的数据信息的概率值。影响所述权重值的因素至少包括:数据中心节点中存储的与所述待存储的数据信息类型相同的数据信息的数目,类型相同的数据信息的数目与该数据中心节点的权重值呈负相关。数据中心节点分配设备的名称也不做限定,比如称为GNS-UPDATE,负责DCN的管理和分配。
需要说明的是,输入功能也可以直接通过各数据中心节点实现,或者单独通过一个设备实现输入功能。
具体地,所述数据中心节点分配设备,可以通过以下方式确定存储所述待存储的数据信息的数据中心节点:
根据所述各数据中心节点的权重值,确定权重总值;所述权重总值与所述各数据中心节点的权重值之和呈正相关;将所述各数据中心节点的权重值映射为各数据中心节点的数据元素;将各数据中心节点的数据元素分布于权重总值对应的数据空间中;根据所述待存储的数据信息对应的哈希值,确定所述待存储的数据信息在所述权重总值对应的数据空间的位置;将与所述位置最接近的数据元素对应的数据中心节点确定为存储所述待存储的数据信息的数据中心节点。
基于图1,在另一种可能的设计中,还可以在图1示出的系统上增加其他模块,可以增加以下模块的至少一项:
分布式存储设备,用于同步所述各数据中心节点存储的数据信息并对外提供查询接口。如提供查询系统为用户提供查询接口。分布式存储设备的名称也不做限定,比如称为GNS-QUERY。
更新设备,用于若确定所述业务系统中的所述数据信息发生更新,则向所述分布式存储设备发送通知消息;所述通知消息用于指示,将所述分布式存储设备中存储的所述数据信息,更新为所述业务系统中所述数据信息发生更新后的数据信息。更新设备的名称也不做限定,比如称为GNS-RECNCLN。
关系型存储设备,该存储设备采用关系型数据库,用于存储数据中心节点分配系统中所有数据中心节点的数据。关系型存储设备的名称也不做限定,比如称为DB。数据可先写入关系型数据库,后异步方式写入Redis、TiKV、CKV等非关系型数据库。
如果系统中含关系型数据库,还可以增加验证设备,用于验证数据中心节点和关系型存储设备中存储的数据是否一致,如实现DB和Redis数据的对帐功能。
下面结合图2,详细介绍图1示出的数据中心节点分配系统的开户过程,如图2所示,为本申请实施例提供的一种数据中心节点分配系统的开户的时序示意图。
1、用户注册或开户:用户在业务系统中开户,业务系统首先调用客户管理系统,创建一个客户号,客户管理系统调用GNS分配一个DCN。
2、用户信息绑定:客户管理系统将客户的信息,包括手机号、银行卡号、银行帐号、微信登录账号、合作方帐号、身份证号等信息广播给GNS。GNS将客户号和客户信息绑定起来,用作路由查询索引。
下面结合图3,详细介绍图1示出的数据中心节点分配系统的客户DCN查询过程,如图3所示,为本申请实施例提供的一种数据中心节点分配系统的客户DCN查询的时序示意图。
1、登录或交易:客户在进行登录系统或交易时,业务系统需要获取客户所在的DCN。此时通过客户登录时填写的手机号或微信登录账号等路由信息到GNS中获取DCN。然后再进行下一步的处理。
如图4所示,为本申请实施例提供的一种数据中心节点分配系统的具体架构示意图。
图4示出的系统中,Database为系统的全量数据库,使用Redis实现高性能。将全量的数据同步到Redis中,进行路由查询时,GNS-QUERY查询Redis,跨数据中心网络时延一般会比较大,为了提高系统的性能,本申请设计在每个数据中心(IDC,Internet Data Center,也称互联网数据中心)都部署一套独立的Redis,维护一套全量的数据副本。在每个数据中心分别部署只访问本数据中心的Redis的GNS-QUERY。根据压测数据,单个实例在8核16G的机器上可支持2万每秒查询率(query per second,QPS)。还可以通过以下方式实现系统的高可用性:
(1)Redis内部采用一主两备的存储结构,即一个主数据库两个备份数据库,保证数据不会丢失。
(2)当本Redis抖动时,通过DB查询,从而不会出现不能查询的情况,实现高可用。
(3)当本Redis数据有问题或长时间不可用时,通过将流量切换到其他IDC(Internet Data Center)实现高可用。
(4)在数据有更新时,GNS-UPDATE会跨数据放到重试队列中等待重试,实现数据的一致性。中心将数据同步到各个Redis,若写入失败会马上进行重试。
(5)GNS-VERIFY会定时检查各IDC DB和Redis数据的差异。保证数据的最终一致性。
(6)在GNS-QUERY查询Redis时,GNS-QUERY利用布隆过滤器(Bloom Filter)降低空查询率,提高性能。在应用场景中,用户路由存在大量的空查询,经常会有大量未开户的帐户来查询DCN。比如在大量的微信访客进入某产品体验,但由于他们并没有开户,进行DCN查询时就会查不到。为减少对低层存储的访问压力,本方案利用布隆过滤器减少这部分空查询的消耗。布隆过滤器是一种空间效率很高的数据结构,用于检索一个元素是否属于一个集合。如果布隆过滤器判断元素不存在,那么一定不存在,如果布隆过滤器判断元素存在,那么也未必存在,因此一些情况下,不需要继续访问底层存储,直接返回未开户的结果。
另外,在图1或图4所示的DCN架构下,为了支持多种业务,可以设计不同类型的DCN。比如,A类DCN支持A类业务,B类DCN支持B类业务。A类业务与B类业务可能存在重叠的客户。为避免数据冲突,需要将不同业务的路由信息独立存储。如图5所示,为本申请实施例中提供的多类DCN接入GNS系统的示意图,GNS提供应用程序接口(API)以供实现不同类型业务的GNS(图中仅以业务A GNS、业务B GNS、业务C GNS为例说明),实现独立存储。
本申请实施例中,存在多套同构的服务端,支持多个业务(将GNS部署多份,分别为 不同的业务服务)。同时为了屏蔽多个服务端的差异,设计了统一的客户端,识别业务线ID参数实现多业务的路由,客户端以API的形式提供给业务系统集成。比如,传入业务A的ID查DCN时,客户端自动调取业务A的GNS。另外,业务线不同于上述的DCN权重提到的产品,一个业务线下有多个产品。同一业务线下的DCN是同类的,不同业务线下的DCN是不同的。
如图6所示,为本申请实施例提供的一种数据中心节点分配方法的步骤流程示意图。
步骤601:获取待存储的数据信息;
步骤602:根据至少一个数据中心节点中各数据中心节点的至少一项因素,确定各数据中心节点的权重值。
其中,所述至少一项因素包括:数据中心节点中存储与所述待存储的数据信息类型相同的数据信息的数目,类型相同的数据信息的数目与该数据中心节点的权重值呈负相关;所述权重值用于表征分配该数据中心节点存储所述待存储的数据信息的概率值。
需要说明的是,所述至少一项因素还可以包括所述至少一个数据中心节点中每个数据中心节点的存储容量,该数据中心节点的存储容量与该数据中心节点的权重值呈负相关。
本申请实施例中,DCN权重可提前通过配置信息进行定义,可通过可扩展标记语言(extensible markup language,XML)格式存储。DCN权重信息放到产品属性下,每个产品独立调配自己的权重。金融机构的业务中存在多种类型的产品,如存款产品、贷款产品等,不同的类型的产品属性不同。每个产品下都有多个DCN节点用于存储,每个DCN节点包含名称和权重两个属性,其中权重描述新客户开户落到此DCN的概率。
通过步骤602,对DCN进行权重配置来控制DCN的容量。例如将容量负载率较高的DCN权重调小,将容量负载率较低的DCN权重调大,来达到负载均衡。第二,还可以结合产品的属性,不同产品的DCN偏好不同,用户量分布不均,可以针对产品来调节权重,比如A产品在DCN1和DCN2的用户量是1:2,B产品在DCN1和DCN2的用户量是2:1,此时如果要实现用户量分布均衡,需要在A产品中将DCN1权重调大,在B产品中将DCN1权重调小。
步骤602的另一种可选实施方式如下:
若所述预设客户号存在预设白名单,则将所述至少一个数据中心节点中,除所述预设白名单中数据中心节点之外其它数据中心节点的权重值设为0;所述预设白名单为所述至少一个数据中心节点中,允许分配给所述预设客户号的数据中心节点的名单。
也就是说当DCN权重设为0时,新用户的数据信息不会落到此DCN。
权重代表对于一个新客户开到这个DCN的可能性,指定DCN开户会忽略权重的配置。有些情况业务需要精准的DCN开户,严格控制客户开户的DCN。比如,要新上线一个DCN,要对此DCN下的应用进行灰度测试,此时将此DCN的权重调成0,同时通过白名单的方式指定一个用户落到指定的DCN上,所有功能测试通过后再进行放量。
步骤603:根据所述各数据中心节点的权重值,从所述至少一个数据中心节点中确定存储所述待存储的数据信息的数据中心节点。
步骤603的一种可选实施方式为以下第一步至第五步:
第一步、根据所述各数据中心节点的权重值,确定权重总值。
所述权重总值与所述各数据中心节点的权重值之和呈正相关。
举例来说,数据中心节点1、数据中心节点2、数据中心节点3的按顺序对应的权重值分别为300、400和500,权重总值为1200。
第二步、将所述各数据中心节点的权重值映射为各数据中心节点的数据元素。第二步具体可以为:
(1)将各数据中心节点中存储与所述待存储的数据信息类型相同的数据信息的数目作为各数据中心节点的权重值。
(2)权重总值对应的数据空间为与所述权重总值一致的数组。
(3)各数据中心节点的数据元素对应所述数组中的一个元素。
第三步、根据所述各数据中心节点的数据元素,确定所述待存储的数据信息的数据中心节点。
第三步可以具体包括以下(1)~(3)步:
第(1)步:将各数据中心节点的数据元素分布于权重总值对应的数据空间中。
举例来说,第三步中可将数据中心节点1、数据中心节点2、数据中心节点3与一个下标为0~1199的数组映射,0~299映射为数据中心节点1,300~699映射为数据中心节点2,700~1199映射为数据中心节点3。也可以从0开始后,每隔一个元素映射为数据中心节点1,直至映射了300个,每隔两个元素映射为数据中心节点2,直至映射了400个,下标中0~1199的其余元素映射为数据中心节点3,具体地映射方式在此不做限定。
第(2)步:根据所述待存储的数据信息对应的哈希值,确定所述待存储的数据信息在所述权重总值对应的数据空间的位置。
第(2)步具体可以如下:
通过对所述待存储的数据信息和预设质数执行预设哈希算法,获取所述待存储的数据信息的哈希值;确定所述待存储的数据信息的哈希值对应的所述数组的下标,以作为所述待存储的数据信息在所述权重总值对应的数据空间的位置。
举例来说,客户号为0999960000134036,预设质数为131,预设哈希算法为字符串哈希算法中的BKDR哈希算法,哈希值为1280。
第(3)步:将与所述位置最接近的数据元素对应的数据中心节点确定为存储所述待存储的数据信息的数据中心节点。
当哈希值为1280时,对1200取模,得到余数值为80,则将数组中下标为80的元素映射的数据中心节点。
上述方法中,在获取了待存储的数据信息后,根据至少一个数据中心节点中各数据中心节点的至少一项因素,确定各数据中心节点的权重值,由于所述权重值用于表征分配该数据中心节点存储所述待存储的数据信息的概率值,确定存储所述待存储的数据信息的数据中心节点的方式,从而增加了数据信息存储的数据中心节点的随机性和灵活性,另外,由于数据中心节点中存储的与所述待存储的数据信息类型相同的数据信息的数目,类型相 同的数据信息的数目与该数据中心节点的权重值呈负相关,因此,与所述待存储的数据信息类型相同的数据信息的数目更多的数据中心节点被随机取到的概率更高,从而提升了分配给待存储的数据信息的数据中心节点的分配效率。
如图7所示,为本申请实施例提供一种数据中心节点分配装置的结构示意图。
本申请实施例提供一种数据中心节点分配装置,包括:获取模块701,用于获取待存储的数据信息;处理模块702,用于根据至少一个数据中心节点中各数据中心节点的至少一项因素,确定各数据中心节点的权重值;其中,所述至少一项因素包括:数据中心节点中存储与所述待存储的数据信息类型相同的数据信息的数目,类型相同的数据信息的数目与该数据中心节点的权重值呈负相关;所述权重值用于表征分配该数据中心节点存储所述待存储的数据信息的概率值;根据所述各数据中心节点的权重值,从所述至少一个数据中心节点中确定存储所述待存储的数据信息的数据中心节点。
一种可选实施方式中,所述处理模块702具体用于:根据所述各数据中心节点的权重值,确定权重总值;所述权重总值与所述各数据中心节点的权重值之和呈正相关;将所述各数据中心节点的权重值映射为各数据中心节点的数据元素;根据所述各数据中心节点的数据元素,确定所述待存储的数据信息的数据中心节点。
一种可选实施方式中,所述处理模块702具体用于:将各数据中心节点的数据元素分布于权重总值对应的数据空间中;根据所述待存储的数据信息对应的哈希值,确定所述待存储的数据信息在所述权重总值对应的数据空间的位置;将与所述位置最接近的数据元素对应的数据中心节点确定为存储所述待存储的数据信息的数据中心节点。
一种可选实施方式中,所述处理模块702具体用于:将各数据中心节点中存储与所述待存储的数据信息类型相同的数据信息的数目作为各数据中心节点的权重值;权重总值对应的数据空间为与所述权重总值一致的数组;各数据中心节点的数据元素对应所述数组中的一个元素;通过对所述待存储的数据信息和预设质数执行预设哈希算法,获取所述待存储的数据信息的哈希值;确定所述待存储的数据信息的哈希值对应的所述数组的下标,以作为所述待存储的数据信息在所述权重总值对应的数据空间的位置。
一种可选实施方式中,所述至少一项因素还包括:所述至少一个数据中心节点中每个数据中心节点的存储容量,该数据中心节点的存储容量与该数据中心节点的权重值呈负相关。
一种可选实施方式中,所述处理模块702还用于:若所述预设客户号存在预设白名单,则将所述至少一个数据中心节点中,除所述预设白名单中数据中心节点之外其它数据中心节点的权重值设为0;所述预设白名单为所述至少一个数据中心节点中,允许分配给所述预设客户号的数据中心节点的名单。
本申请实施例提供一种计算机设备,包括程序或指令,当所述程序或指令被执行时,用以执行本申请实施例提供的一种数据中心节点分配方法及任一可选方法。
本申请实施例提供一种存储介质,包括程序或指令,当所述程序或指令被执行时,用以执行本申请实施例提供的一种数据中心节点分配方法及任一可选方法。
最后应说明的是:本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。
Claims (11)
- 一种数据中心节点分配方法,其特征在于,包括:获取待存储的数据信息;根据至少一个数据中心节点中各数据中心节点的至少一项因素,确定各数据中心节点的权重值;其中,所述至少一项因素包括:数据中心节点中存储与所述待存储的数据信息类型相同的数据信息的数目,类型相同的数据信息的数目与该数据中心节点的权重值呈负相关;所述权重值用于表征分配该数据中心节点存储所述待存储的数据信息的概率值;根据所述各数据中心节点的权重值,从所述至少一个数据中心节点中确定存储所述待存储的数据信息的数据中心节点。
- 如权利要求1所述的方法,其特征在于,根据所述各数据中心节点的权重值,从所述至少一个数据中心节点中确定存储所述待存储的数据信息的数据中心节点,包括:根据所述各数据中心节点的权重值,确定权重总值;所述权重总值与所述各数据中心节点的权重值之和呈正相关;将所述各数据中心节点的权重值映射为各数据中心节点的数据元素;根据所述各数据中心节点的数据元素,确定所述待存储的数据信息的数据中心节点。
- 如权利要求2所述的方法,其特征在于,所述根据所述各数据中心节点的数据元素,确定所述待存储的数据信息的数据中心节点,包括:将各数据中心节点的数据元素分布于权重总值对应的数据空间中;根据所述待存储的数据信息对应的哈希值,确定所述待存储的数据信息在所述权重总值对应的数据空间的位置;将与所述位置最接近的数据元素对应的数据中心节点确定为存储所述待存储的数据信息的数据中心节点。
- 如权利要求3所述的方法,其特征在于,所述确定各数据中心节点的权重值,包括:将各数据中心节点中存储与所述待存储的数据信息类型相同的数据信息的数目作为各数据中心节点的权重值;权重总值对应的数据空间为与所述权重总值一致的数组;各数据中心节点的数据元素对应所述数组中的一个元素;所述根据所述待存储的数据信息对应的哈希值,确定所述待存储的数据信息在所述权重总值对应的数据空间的位置,包括:通过对所述待存储的数据信息和预设质数执行预设哈希算法,获取所述待存储的数据信息的哈希值;确定所述待存储的数据信息的哈希值对应的所述数组的下标,以作为所述待存储的数据信息在所述权重总值对应的数据空间的位置。
- 如权利要求1-4任一所述的方法,其特征在于,所述至少一项因素还包括:所述至少一个数据中心节点中每个数据中心节点的存储容量,该数据中心节点的存储容量与该数 据中心节点的权重值呈负相关。
- 如权利要求1-4任一所述的方法,其特征在于,还包括:若所述预设客户号存在预设白名单,则将所述至少一个数据中心节点中,除所述预设白名单中数据中心节点之外其它数据中心节点的权重值设为0;所述预设白名单为所述至少一个数据中心节点中,允许分配给所述预设客户号的数据中心节点的名单。
- 一种数据中心节点分配装置,其特征在于,包括:获取模块,用于获取待存储的数据信息;处理模块,用于根据至少一个数据中心节点中各数据中心节点的至少一项因素,确定各数据中心节点的权重值;其中,所述至少一项因素包括:数据中心节点中存储与所述待存储的数据信息类型相同的数据信息的数目,类型相同的数据信息的数目与该数据中心节点的权重值呈负相关;所述权重值用于表征分配该数据中心节点存储所述待存储的数据信息的概率值;根据所述各数据中心节点的权重值,从所述至少一个数据中心节点中确定存储所述待存储的数据信息的数据中心节点。
- 一种数据中心节点分配系统,其特征在于,包括:各数据中心节点,用于存储数据信息;数据中心节点分配设备,用于从业务系统获取待存储的数据信息,根据各数据中心节点的权重值,确定存储所述待存储的数据信息的数据中心节点;所述权重值用于表示分配该数据中心节点存储所述待存储的数据信息的概率值;影响所述权重值的因素至少包括:数据中心节点中存储的与所述待存储的数据信息类型相同的数据信息的数目,类型相同的数据信息的数目与该数据中心节点的权重值呈负相关。
- 如权利要求8所述的系统,其特征在于,还包括:分布式存储设备,用于同步所述各数据中心节点存储的数据信息并对外提供查询接口;更新设备,用于若确定所述业务系统中的所述数据信息发生更新,则向所述分布式存储设备发送通知消息;所述通知消息用于指示,将所述分布式存储设备中存储的所述数据信息,更新为所述业务系统中所述数据信息发生更新后的数据信息。
- 一种计算机设备,其特征在于,包括程序或指令,当所述程序或指令被执行时,如权利要求1至6中任意一项所述的方法被执行。
- 一种存储介质,其特征在于,包括程序或指令,当所述程序或指令被执行时,如权利要求1至6中任意一项所述的方法被执行。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910579364.2 | 2019-06-28 | ||
| CN201910579364.2A CN110263047B (zh) | 2019-06-28 | 2019-06-28 | 一种数据中心节点分配方法、装置、系统及计算机设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020259191A1 true WO2020259191A1 (zh) | 2020-12-30 |
Family
ID=67923293
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/092732 Ceased WO2020259191A1 (zh) | 2019-06-28 | 2020-05-27 | 一种数据中心节点分配方法、装置、系统及计算机设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110263047B (zh) |
| WO (1) | WO2020259191A1 (zh) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114116708A (zh) * | 2021-11-16 | 2022-03-01 | 东方财富信息股份有限公司 | 一种基于自适应哈希算法的业务id生成方法及系统 |
| CN116016094A (zh) * | 2022-12-13 | 2023-04-25 | 平安银行股份有限公司 | 一种分布式架构金融系统及服务调用方法 |
| CN116088756A (zh) * | 2022-12-14 | 2023-05-09 | 中国工商银行股份有限公司 | 数据存储方法、装置及电子设备 |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110263047B (zh) * | 2019-06-28 | 2023-12-22 | 深圳前海微众银行股份有限公司 | 一种数据中心节点分配方法、装置、系统及计算机设备 |
| CN112308915B (zh) | 2020-03-30 | 2025-02-25 | 北京沃东天骏信息技术有限公司 | 用于定位快递包裹的方法和装置 |
| CN111866085B (zh) * | 2020-06-28 | 2021-12-14 | 北京沃东天骏信息技术有限公司 | 基于区块链的数据存储方法、系统和装置 |
| CN117076565A (zh) * | 2023-08-22 | 2023-11-17 | 中国工商银行股份有限公司 | 数据存储方法、装置、非易失性存储介质及电子设备 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104994171A (zh) * | 2015-07-15 | 2015-10-21 | 上海斐讯数据通信技术有限公司 | 一种分布式存储方法与系统 |
| CN105718478A (zh) * | 2014-12-03 | 2016-06-29 | 北京奇虎科技有限公司 | 数据存储的方法和装置 |
| CN108664222A (zh) * | 2018-05-11 | 2018-10-16 | 北京奇虎科技有限公司 | 一种区块链系统及其应用方法 |
| CN110263047A (zh) * | 2019-06-28 | 2019-09-20 | 深圳前海微众银行股份有限公司 | 一种数据中心节点分配方法、装置、系统及计算机设备 |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9836514B2 (en) * | 2011-11-07 | 2017-12-05 | Empire Technology Development Llc | Cache based key-value store mapping and replication |
-
2019
- 2019-06-28 CN CN201910579364.2A patent/CN110263047B/zh active Active
-
2020
- 2020-05-27 WO PCT/CN2020/092732 patent/WO2020259191A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105718478A (zh) * | 2014-12-03 | 2016-06-29 | 北京奇虎科技有限公司 | 数据存储的方法和装置 |
| CN104994171A (zh) * | 2015-07-15 | 2015-10-21 | 上海斐讯数据通信技术有限公司 | 一种分布式存储方法与系统 |
| CN108664222A (zh) * | 2018-05-11 | 2018-10-16 | 北京奇虎科技有限公司 | 一种区块链系统及其应用方法 |
| CN110263047A (zh) * | 2019-06-28 | 2019-09-20 | 深圳前海微众银行股份有限公司 | 一种数据中心节点分配方法、装置、系统及计算机设备 |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114116708A (zh) * | 2021-11-16 | 2022-03-01 | 东方财富信息股份有限公司 | 一种基于自适应哈希算法的业务id生成方法及系统 |
| CN116016094A (zh) * | 2022-12-13 | 2023-04-25 | 平安银行股份有限公司 | 一种分布式架构金融系统及服务调用方法 |
| CN116088756A (zh) * | 2022-12-14 | 2023-05-09 | 中国工商银行股份有限公司 | 数据存储方法、装置及电子设备 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110263047A (zh) | 2019-09-20 |
| CN110263047B (zh) | 2023-12-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110263047B (zh) | 一种数据中心节点分配方法、装置、系统及计算机设备 | |
| US8200705B2 (en) | Method and apparatus for applying database partitioning in a multi-tenancy scenario | |
| US7788233B1 (en) | Data store replication for entity based partition | |
| US9684702B2 (en) | Database redistribution utilizing virtual partitions | |
| US9367600B2 (en) | Policy-based storage structure distribution | |
| US7337226B2 (en) | Method and mechanism for implementing dynamic sizing of session pools | |
| US10579597B1 (en) | Data-tiering service with multiple cold tier quality of service levels | |
| CN112862613B (zh) | 一种交易数据处理方法和装置 | |
| CN112162846B (zh) | 事务处理方法、设备及计算机可读存储介质 | |
| US10191663B1 (en) | Using data store accelerator intermediary nodes and write control settings to identify write propagation nodes | |
| CN103473365B (zh) | 一种基于hdfs的文件存储方法、装置及分布式文件系统 | |
| CN109542611A (zh) | 数据库即服务系统、数据库调度方法、设备及存储介质 | |
| WO2017113962A1 (zh) | 访问分布式数据库的方法和分布式数据服务的装置 | |
| US11609914B2 (en) | Policy-based storage structure distribution | |
| US20220383219A1 (en) | Access processing method, device, storage medium and program product | |
| CN107766343A (zh) | 一种数据存储方法、装置及存储服务器 | |
| CN108573063A (zh) | 一种数据查询方法及系统 | |
| CN104461736B (zh) | 资源分配与搜索方法、资源分配与搜索系统和云服务器 | |
| CN115712660A (zh) | 数据存储方法、装置、服务器及存储介质 | |
| US12007999B1 (en) | Systems, methods, and media for operating a microservices architecture with a shared distributed cache | |
| CN107276914B (zh) | 基于cmdb的自助资源分配调度的方法 | |
| US11138178B2 (en) | Separation of computation from storage in database for better elasticity | |
| US10474653B2 (en) | Flexible in-memory column store placement | |
| CN112669160A (zh) | 数据处理方法、装置、电子设备及存储介质 | |
| CN117290392A (zh) | 一种产品的推荐方法、装置、电子设备及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20832587 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22.04.2022) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20832587 Country of ref document: EP Kind code of ref document: A1 |