Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
The schematic flow sheet of the data partition control method that Fig. 1 provides for the embodiment of the present invention one, the described data partition control method that the present embodiment provides can be performed by a management node, and this management node is for being arranged in the control system of data partition.As shown in Figure 1, the data partition control method that the present embodiment provides, specifically comprises the steps:
Step 101, reception service request, described service request comprises the type of service mark of pending business;
Step 102, determine to identify corresponding processing node with described type of service;
Step 103, described service request is forwarded to described processing node, to make described processing node, described service request is processed.
Concrete, described management node receives the service request that user sends, described service request comprises the type of service mark of business, according to the type of service mark comprised in service request, determine to identify corresponding processing node with described type of service, and described service request is forwarded to described processing node, described processing node processes according to described service request.Wherein, described type of service can comprise: ticketing, get tickets, change label, returned ticket, Transaction Inquiries etc., and to identify corresponding processing node can be one with same type of service also can be multiple.Described service request mark can be those skilled in the art, as required or preference sets itself, as long as reach the type distinguishing different business request.
What deserves to be explained is, one-to-one relationship can be had with processing node for type of service mark, also the corresponding relation of one-to-many can be had, namely some processing nodes can be set and be specifically designed to the service request processing a certain type of service, multiple processing node also can be set to process the service request of a certain type of service.When the latter and multiple processing node process the service request of a certain type of service, management node, when receiving the service request comprising this type of service mark, can such as be determined to have according to the loading condition of each processing node in multiple processing nodes of correspondence and which processing node to process this service request by.
For example, if certain moment management node have received service request and service request of getting tickets that type of service is ticketing simultaneously, management node is according to ticketing type of service and type of service of getting tickets, determine respectively processing one or more processing node of ticketing business and the one or more processing nodes for the treatment of the business of getting tickets, and then from one or more processing nodes of the process ticketing business determined, determine processing the processing node of this ticketing business, from the process determined get tickets business one or more processing nodes determine processing the processing node of the business of getting tickets, then ticketing and the service request of getting tickets are forwarded to corresponding processing node respectively, alignment processing node processes ticketing business or the business of getting tickets.
The data partition control method that the present embodiment provides, is identified by the type of service according to different business request, determines the processing node processing described service request; Described service request is forwarded to described processing node, to make described processing node, described service request is processed.By business being carried out the division of type, thus at least one processing node corresponding to often kind of type of service is set, make when receiving the service request of different service types, the process of service request can be carried out in a distributed manner, improve the efficiency of system data process, reduce system data and operate the possibility clashed.
Further, the schematic flow sheet of the data partition control method that Fig. 2 provides for the embodiment of the present invention two, as shown in Figure 2, on basis embodiment illustrated in fig. 1, described step 102 is comprised and being realized by following steps:
Step S1, determine to identify corresponding processing node group with described type of service.
Concrete, all processing nodes can be divided into three node groups, the first processing node group is for the treatment of ticketing business; Second processing node group is for the treatment of label of getting tickets, change, returned ticket business; Described 3rd processing node group is for the treatment of inquiry transaction business.When receiving the service request of user, according to the type of service mark comprised in service request, determine described service request which node group corresponding.But above-mentioned processing node group is not limited only to the corresponding service that can only process corresponding node group.The division of above node group is only exemplary illustration, and not being limited with the example described in the present embodiment divides processing node grouping.
Step S1 is by dividing into groups processing node according to type of service, thus, different service request is according to the difference of the type of service corresponding to it, transfer to corresponding processing node group to process, avoid in prior art, system only has a processing node, all business are all processed by a processing node, cause system treatment effeciency low, easily produce the problem of multi-service conflict, substantially increase the treatment effeciency of system.
Step S2, according to preset strategy, from described processing node group, determine described processing node, described processing node group comprises processing node described at least one.
Concrete, can by adopting following preset strategy, to determine by which processing node to process this service request from the processing node group corresponding to identifying with the type of service that comprises service request:
Method one, employing polling method determine described processing node from described processing node group.Concrete, the service request received each time is distributed in turn the processing node in described alignment processing node group.Such as, if current service request type is ticketing, adopt polling method, given by current ticketing request dispatching the first processing node group i-th processing node, so next ticketing request will distribute to the i-th+1 processing node of the first processing node group.
Method two, default poll weighted value according to each described processing node, determine described processing node.Concrete, according to the difference of each processing node disposal ability in described processing node group, distribute different weights in advance each processing node, the service request of corresponding weight value number can be accepted.Such as, the weights that the weights that the weights of node A1 are designed to 2, A2 are designed to 3, A3 are 5, then processing node A1, A2, A3, the service request of corresponding requests type of 20%, 30%, 50% will be accepted respectively.
Method three, determine that the processing node that in described processing node group, load is the lightest is described processing node.Concrete, determine loading condition according to server CPU model, CPU quantity, memory size and current linking number etc., described service request is forwarded to the processing node that in alignment processing node group, load is the lightest and processes.
Method four, determine that the response time of network detection request in described processing node group the shortest processing node is described processing node.Concrete, because certain moment processing node reflects the service conditions of this moment processing node for response time of request, response time is shorter, then illustrate that the disposal ability in this moment of processing node is stronger, therefore, by sending probe requests thereby to each processing node in the processing node group of correspondence, then according to the fastest response time of each processing node, described service request can be forwarded to response time the fastest processing node.
Said method, can apply separately, also can several method connected applications.
According to said method, described management node according to described service request, by said method, can adopt optimum preset strategy, while realizing each processing node load balancing, is conducive to the treatment effeciency of raising business.
Step S3, detect the operating state of described processing node, determine whether described operating state indicates described handle node failures.If described operating state indicates described processing node normally, perform step S4, if described operating state indicates described handle node failures, then perform step S5.
Step S4, by described processing node, described service request to be processed.
Step S5, determine belonging to described processing node described processing node group in other whole processing nodes whether all fault; If not, then perform step S51, if so, then perform step S52.
Step S51, return step S2, according to described preset strategy, from described processing node group, redefine another processing node, and described service request is forwarded to another processing node described and processes.
Step S52, the processing node in the backup node group corresponding with described processing node group is sent to process described service request.In the present embodiment, arrange the backup node group of the second processing node group as the first processing node group, the 3rd processing node group is as the backup node group of the second processing node group.Such as, described service request is ticketing request, if all processing nodes in described first processing node group all break down, then processed by the processing node in the second processing node group described in the processing node group for subsequent use of described first processing node group, determine the method for described processing node, identical with the method for preset strategy in step S2, here repeat no more.
According to detection and the system of selection of above-mentioned processing node, described system by the testing result to described processing node, further can be determined the processing node of described service request, thus improves reliability and the redundancy ability of system.
The structural representation of the data partition control system that Fig. 3 provides for the embodiment of the present invention three, as shown in Figure 3, the data partition control system that the present embodiment provides comprises:
Management node 1 and at least one processing node 2; Described management node 1 comprises:
Receiver module 11, for receiving service request, described service request comprises the type of service mark of pending business;
Determination module 12, identifies corresponding processing node for determining with described type of service;
Sending module 13, for being forwarded to described processing node by described service request;
Described processing node 2, for processing described service request.
The described control system that the present embodiment provides may be used for performing the technical scheme of embodiment of the method as shown in Figure 1, and it realizes principle and technique effect is similar, repeats no more herein.
The structural representation of the data partition control system that Fig. 4 provides for the embodiment of the present invention four, as shown in Figure 4, on basis embodiment illustrated in fig. 3, described determination module 12, also identifies corresponding processing node group for determining with described type of service;
Described determination module 12, also for according to preset strategy, from described processing node group, determine described processing node 2, described processing node group comprises processing node 2 described at least one.
Particularly, described determination module 12 specifically for:
Polling method is adopted to determine described processing node from described processing node group; Or,
According to the default poll weighted value of each described processing node, determine described processing node; Or,
Determine that the processing node that in described processing node group, load is the lightest is described processing node; Or,
Determine that the response time of network detection request in described processing node group the shortest processing node is described processing node.
Further, described system also comprises:
Detection module 14, for detecting the operating state of described processing node, determines whether described operating state indicates described processing node 2 fault;
Described determination module 12, if also indicate described processing node 2 fault for described operating state, then according to described preset strategy, redefines another processing node from described processing node group;
Described sending module 13, also processes for described service request being forwarded to another processing node described.
Further, whether all described determination module 12, if also indicate described processing node 2 fault for described operating state, then determine other the whole processing nodes fault in the described processing node group belonging to described processing node 2;
Described sending module 13, if also for other whole processing nodes described all faults, then sends to the processing node in the backup node group corresponding with described processing node group to process by described service request.
The described control system that the present embodiment provides may be used for performing the technical scheme of embodiment of the method as shown in Figure 2, and it realizes principle and technique effect is similar, repeats no more herein.
One of ordinary skill in the art will appreciate that: all or part of step realizing above-mentioned each embodiment of the method can have been come by the hardware that program command is relevant.Aforesaid program can be stored in a computer read/write memory medium.This program, when performing, performs the step comprising above-mentioned each embodiment of the method; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above each embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to foregoing embodiments to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein some or all of technical characteristic; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.