Background technology
The essential technological means of Real Application Clusters (Real Application Clusters, RAC) the distributed cloud computing scheme of multinode Cheng Liao telecommunications industry data center.RAC, by increasing database instance node, increases the bulk treatment ability of database, overcomes main frame (example) Single Point of Faliure simultaneously.But the whole capability of RAC not increases and linear increase with database instance node number, because coherency communications between node, internal memory merges can consume certain resource, and restriction whole capability promotes, use bad causing between node to form cluster lock problem, even reduce ability.Current provincial telco customers relation management system (Customer Relationship Management, CRM) carry out longitudinal cutting of data according to the dimension of districts and cities, or the range partition table technology that provides of usage data storehouse carries out subregion to customer data and set up partition table, put forward high performance principle to meet RAC data Physical Extents.
The best practices of RAC should be according to the data structure of application, burst and the discrete design that Service Processing Structure feature is carried out data.Reduce interleaving access, reduce the management consumption of RAC internal communication.Thereby the load between balance node, improves the ability of overall cluster.The method generally using is at present to carry out data fragmentation by physiogeographic administrative division customer data.Or the partition table technology that usage data storehouse provides is carried out burst to customer data.
But there is following problem in these methods:
1, table technology in partitions of database is to index, and inquiry is used, and maintenance requirement complexity, under application scenarios flexibly, shows very large limitation.
2, under municipality directly under the Central Government's pattern or single administrative region data pattern, carry out data cutting according to above method, cause performance, stability, the scalability problem of RAC system to be difficult to be guaranteed, application deployment causes the fault such as GC, GE of RAC to each node.
Concentrate in the current ongoing whole nation, cannot realize the design of valid data burst in the large unified system Construction such as construction of base, there is no blanket data fragmentation method for to data partition.
Embodiment
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is described in detail.
Fig. 1 is the structural representation of mathematical logic partition system in the embodiment of the present invention one.As shown in Figure 1, this mathematical logic partition system is applicable to telecommunications crm system RAC database, comprises client 101, application node 102 and database node 103.
Client is connected with application node, and application node is connected with database node.
Wherein, client obtains for the critical field of importing into by front end at application Access Layer the application node that needs access.
Application node is unique identification for customer number being set for business datum, take described customer number as key assignments, the elimination remainder hash algorithm that employing is no less than 1 stage carries out data fragmentation to business datum, also, according to the database node corresponding to data source configuration access of specifying, and access the burst business datum of storing in described database node by the described Hash route that is no less than 1 stage.
Database node further comprises the data fragmentation that is no less than 1, for storage service data.
Based on said system, the specific embodiment of the present invention has proposed a kind of method of mathematical logic subregion, and Fig. 2 is the process flow diagram of mathematical logic subregion in the embodiment of the present invention two.As shown in Figure 2, this flow process comprises the following steps:
Step 201, by client's business datum internal logic transformation, for all client's business datums, customer number being set is unique identification;
Step 202, take customer number as key assignments, adopt the elimination remainder hash algorithm in 1 stage or n stage to carry out data fragmentation to business datum.
Data fragmentation principle is to consider that data accuracy, data are uniformly distributed, apply the consideration of processing the several aspects of complexity, the performance of safeguards system, stability, extensibility.
Data partition design adopts eliminates remainder Hash (Hash) algorithm, for the relevant business datum table of three family data, comprises three family MSDSs, order table, business record table etc., according to unique identification in business datum as critical field delivery.
According to the parent customer under business datum, be that service attribute data are carried out burst by the unique identification of its body data (as customer number), burst adopts the mode to parent customer delivery, with the business datum that guarantees same client in the submeter of identical data burst, guarantee being uniformly distributed of different business tables of data submeter data, and reduce the complexity that application is processed;
The burst quantity of business datum is planned to 10 (n) are individual altogether, the submeter storage of each data fragmentation to 10 (n) delivery after a rear fragment data; Be Hash (key)=key mod 10[n], wherein key is key assignments.
Under the situation of the increase of application layer progression or mass data, can take the algorithm of two-stage delivery Hash, can guarantee in theory the Quick Extended of data partition.
Realize on the basis of multinode distributed store at CRM business datum internal logic burst, application realizes multiple database node distributed access by the Hash routing algorithm of customer data.Because hash algorithm is unblock distributed algorithm, can support distributed data to locate fast.Fig. 3 is data access flow process figure in the embodiment of the present invention two.As shown in Figure 3, this flow process comprises the following steps:
Step 301, the critical field of importing into by front end at application Access Layer are obtained the application node that needs access.
Database node corresponding to data source configuration access that step 302, this application node are specified when disposing.
Step 303, access by 1 stage or multistage Hash route the fragment data of storing in this database node.In general design, with using multistage Hash under the increase of service application level or mass data environment, i.e. multilayer application is used multistage Hash.
Dissimilar application, the mode that route is set is distinguished to some extent:
Interface adaptation application is carried out route setting in interface code.
Route setting is carried out in background process application in background process master routine.
WEB application, carries out route setting at JSP (Java Server Pages, a kind of java dynamic page standard) page or Action (Java assembly) layer.
Data route key message can be phone number (comprising broadband account number), user ID, account's mark, customer ID, order coding and/or order flowing water according to the key message of data in current crm system.
Concrete business datum burst insertion algorithm I1, I2 and routing inquiry algorithm S1, S2 are described below.
Algorithm I1: client is stored data " Client " with key " c ".First with reference to application node list, (1,2, n), the cryptographic hash of calculating key " c ", supposes that application node 1 is selected.Then two-stage Hash process.
Algorithm 12: client is directly connected to application node 1, refers again to data fragmentation list (a, b, c), calculates the cryptographic hash of key " c ", supposes that application node a is selected.By key " c ", data " Client " are stored into data fragmentation a.
Different clients is used identical client library (hash algorithm that means one-phase, two-stage is identical), also have same application node list (1,2, n) and data fragmentation list (a, b, c).
Client can be stored in data on many database RAC nodes.In the time of data query.
Algorithm S1: first client calculates the cryptographic hash (one-phase Hash) of key " c " with reference to application node list, choose application node 1.
Algorithm S2: client sends to request to choose application node 1, then application node, by the hash algorithm (two-stage Hash) for data fragmentation list (a, b, c), is searched real data " Client " according to key " c ".
Implementation procedure is seen, does not need communication to have good extensibility between each node, and whole process has fine performance when being unblock.
Fig. 4 is the data deployment of crm system in the embodiment of the present invention and the schematic diagram of data access.As shown in Figure 4, when crm system overall design, for crucial routing iinformations such as three family marks, order codings, adopt the coding rule of specifying.System applies is opening an account, when the business processing such as transfer, generate three family marks and order coding according to the coding rule of three family data, and three family data and related service data are stored in corresponding partition table, simultaneously, the mapping (enum) data of phone number and data fragmentation is carried out to buffer memory by buffer memory application interface in buffer memory service end, when being convenient to follow-up business and handling, can carry out route by phone number.
In the deployment of application layer, be divided into multiple application sets group according to the portfolio of different access channels and peripheral interface and safe class, each application sets group comprises 9 physical clusters, wherein 4 cluster correspondence database nodes one, 4 cluster correspondence database nodes two, the node across cluster access disparate databases is put in the assembly of different application cluster, makes two nodes of database can load sharing.
First WEB application, interface adaptation application, background process get crucial routing iinformation while being applied in business processing, carry out obtaining of districts and cities by crucial routing iinformation, and obtain manner is as follows.
Phone number: in being applied by buffer memory, the phone number of buffer memory and data fragmentation mapping relations are applied, and carry out obtaining of data hash burst by phone number.
Client/account/user ID: use coding rule, carry out obtaining of data hash burst by the coding rule of three family marks.
Order coding: the order data generating in new system, order coding and order mark adopt certain coding rule, can be encoded and be carried out obtaining of data hash burst by order.
Apply according to crucial routing information acquisition after data fragmentation information, pass through again relevant configuration data query to the corresponding great district of data fragmentation (database node), routing policy according to configuration carries out the access of cluster-specific, and finally accessing corresponding database node by application cluster carries out data access and operation.
It should be noted that: above embodiment is only unrestricted in order to the present invention to be described, the present invention is also not limited in above-mentioned giving an example, and all do not depart from technical scheme and the improvement thereof of the spirit and scope of the present invention, and it all should be encompassed in claim scope of the present invention.