The method and system of a kind of Cloud Server load balancing and data redundancy backup
Technical field
The present invention relates to computer network cluster server field, particularly the method and system of a kind of Cloud Server load balancing and data redundancy backup.
Background technology
The method that existing servo load balance method and system thereof provide, substantially can realize the load balancing of Cloud Server and the target of redundancy backup, but all use the mode of separate responses, client need select the scheme of back-level server voluntarily, analysis, location service node, cannot be independently synchronous.Simultaneously client-side interface is complicated, and the interface that needs lead with server adapts, while at server end, idle server, due to separate responses, lacks integrated scheduling balanced, and therefore server operating pressure can rise rapidly, make server normally cannot provide service, reduce server service efficiency.
Summary of the invention
The invention provides the method and system of a kind of Cloud Server load balancing and data redundancy backup, solve client-side interface complexity, server need rely on the problem of independent load regulation server.
The method that Cloud Server load balancing regulates, comprising:
Server receives service request;
Judge service offer category, select method of service; Described service offer category is task requests or update request, requesting query flow process of executing the task when service request is task requests, performs server update flow process when service request is update request;
Described task requests querying flow is:
A. obtain load balancing list, judge whether task requests belongs to book server service range, if so, then perform step B, otherwise perform step D;
B. judge whether server load reaches preset upper limit, if reach preset upper limit, then book server task requests Query Result is empty, if do not reach preset upper limit, then carries out local job enquiry;
C. judge that whether book server task requests Query Result is empty, if be empty, then execution step D, otherwise by task requests Query Result return service request transmitting terminal, end task requesting query flow process;
D. according to load balancing list and exempt from Query List, determine job enquiry server node, book server is added to and exempts from Query List, and forward task requests to the job enquiry server node determined; Described job enquiry server node is served for providing this type of, and the server be not queried;
E. task requests Query Result is obtained, and judge whether task requests Query Result is empty, if be empty, then by task requests Query Result return service request transmitting terminal, end task requesting query flow process, otherwise judge whether task requests belongs to book server service range, if, then the task requests Query Result of acquisition is updated to book server, and by task requests Query Result return service request transmitting terminal, end task requesting query flow process, otherwise directly by task requests Query Result return service request transmitting terminal, end task requesting query flow process.
Described server update flow process is:
F. obtain load balancing list, judge whether update request belongs to book server service range, whether the data namely upgraded belong to the scope that book server provides service, if, then according to update request, book server is upgraded, and perform step G, otherwise directly perform step G;
G. according to load balancing list and exempt to upgrade list, determine update server node, book server is added to and exempts to upgrade list, and forward update request to the update server node determined; Described update server node is inquired about for providing this type of task requests, and the server be not updated;
H. obtain and upgrade result, and return service request transmitting terminal.
In described method, described server receives in service request, and described service request is that client or other servers send.
In described method, described load balancing list is pre-stored within each server.
Prestore all enabled nodes of load bridging in load balancing list, be stored in each server in a static manner, and can carry out orientation renewal, load balancing list can be preserved with document form or database form.
In described method, described exempt from Query List and exempt to upgrade list to be contained in service request;
Described Query List of exempting from is the server list of having inquired about;
It is described that to exempt to upgrade list be updated server list.
Described exempting from Query List and exempt to upgrade list is information subsidiary in service request, before carrying out service request and forwarding, the identifying information of book server is added by every station server and exempt from Query List or exempt to upgrade in list, make the server of follow-up acquisition service request service request be forwarded again.
The system that Cloud Server load balancing regulates, comprise multiple servers, every station server comprises:
Receiver module, receives service request for server;
Judge module, for judging service offer category, select method of service, described service offer category is task requests or update request;
Task requests enquiry module, requesting query flow process of executing the task during for judging that service request is task requests when judge module;
Server update module, performs server update flow process during for judging that service request is update request when judge module;
Described task requests enquiry module also comprises:
First service judges submodule, obtains load balancing list, judges whether task requests belongs to book server service range, if so, then enter load judgment submodule, otherwise enter the first forwarding submodule;
Load judgment submodule, for judging whether server load reaches preset upper limit, if reach preset upper limit, then book server task requests Query Result is empty, if do not reach preset upper limit, then carries out local job enquiry;
Query Result judges submodule, judges whether book server task requests Query Result is empty, if be empty, then enter the first forwarding submodule, otherwise enters result feedback submodule;
First forwards submodule, for according to load balancing list and exempt from Query List, determines job enquiry server node, is added to by book server and exempt from Query List, and forwards task requests to the job enquiry server node determined;
Forward result and judge submodule, for obtaining task requests Query Result, and judge whether task requests Query Result is empty, if be empty, then enter result feedback submodule, otherwise judge whether task requests belongs to book server service range, if, then the task requests Query Result of acquisition is updated to book server, and enters result feedback submodule, otherwise directly enter result feedback submodule;
Result feedback submodule, for by task requests Query Result return service request transmitting terminal;
Described server update module also comprises:
Second service judges submodule, for obtaining load balancing list, judging whether update request belongs to book server service range, if so, then entering renewal submodule, and enter the second forwarding submodule, otherwise directly enter the second forwarding submodule;
Upgrading submodule, for upgrading book server according to update request, and entering the second forwarding submodule;
Second forwards submodule, for according to load balancing list and exempt to upgrade list, determines update server node, is added to by book server and exempt to upgrade list, and forward update request to the update server node determined;
Result obtains submodule, for obtaining renewal result, and return service request transmitting terminal.
In described system, described server receives in service request, and described service request is that client or other servers send.
In described system, described load balancing list is pre-stored within each server.
In described system, described exempt from Query List and exempt to upgrade list to be contained in service request;
Described Query List of exempting from is the server list of having inquired about;
It is described that to exempt to upgrade list be updated server list.
Method provided by the present invention, client, without the need to carrying out analyzing and positioning to server, can be initiated service request to any server, eliminate the dependence of client to server version; Every station server has oneself load balancing list, except forwarding task, only bear inquiry and the renewal of own task, in all available server nodes that cloud Data distribution8 is recorded to load balancing list, and the load balancing list that each server node has is different, and the subtree of non-higher level's forwarding server load balancing list, makes the webbed topological structure of multiple server node shapes; And the service request of server forwards and upgrades, server can be supplemented database automatically, after making server access service system, do not need the operation forcing to carry out data inputting, shorten on-line time, and only upgrade nearest task requests Query Result, decrease database pressure, server required preventive maintenance time of reaching the standard grade greatly is reduced, improves flexibility and high efficiency that cloud service system arranges; Every station server can carry out load condition identification, has departed from the dependence to load guide server in prior art, and improve the real-time of load balancing management, entirety improves service ability and the stability of Cloud Server.
The invention provides the method and system of a kind of Cloud Server load balancing and data redundancy backup, client can send service request to any server, and the server receiving service request judges service offer category, selects method of service; To execute the task when service request is task requests requesting query flow process, perform server update flow process when service request is update request; When service request be not book server service range or book server task requests Query Result for time empty, can forward service request to other servers, the task requests Query Result simultaneously returned according to other servers, upgrades book server.By method of the present invention, server can carry out autonomous state identification, improves the stability of Cloud Server; Simultaneously the task requests forwarding inquiries of server and renewal, can make server automatically will obtain data filling to book server from other servers, improve the flexibility of server update.
Accompanying drawing explanation
In order to be illustrated more clearly in the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, the accompanying drawing that the following describes is only some embodiments recorded in the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the method flow diagram of a kind of Cloud Server load balancing and data redundancy backup;
Fig. 2 is server architecture figure in the system of a kind of Cloud Server load balancing and data redundancy backup;
Embodiment
In order to make those skilled in the art person understand technical scheme in the embodiment of the present invention better, and enable above-mentioned purpose of the present invention, feature and advantage become apparent more, below in conjunction with accompanying drawing, technical scheme in the present invention is described in further detail.
The invention provides the method and system of a kind of Cloud Server load balancing and data redundancy backup, solve client-side interface complexity, server need rely on the problem of independent load regulation server.
The method that Cloud Server load balancing regulates, as shown in Figure 1, comprising:
S101: server receives service request;
S102: judge service offer category, selects method of service; Described service offer category is task requests or update request, performs S103 when service request is task requests, performs S110 when service request is update request;
S103: obtain load balancing list, judge whether task requests belongs to book server service range, if so, then perform S104, otherwise perform S106;
S104: judge whether server load reaches preset upper limit, if reach preset upper limit, then book server task requests Query Result is empty, if do not reach preset upper limit, then carries out local job enquiry;
S105: judge that whether book server task requests Query Result is empty, if be sky, then perform S106, otherwise by task requests Query Result return service request transmitting terminal, end task requesting query flow process;
S106: according to load balancing list and exempt from Query List, determines job enquiry server node, is added to by book server and exempt from Query List, and forwards task requests to the job enquiry server node determined; Described job enquiry server node is served for providing this type of, and the server be not queried;
S107: obtain task requests Query Result, and judge whether task requests Query Result is empty, if be empty, then by task requests Query Result return service request transmitting terminal, end task requesting query flow process, otherwise execution S108;
S108: judge whether task requests belongs to book server service range, if so, then perform S109, otherwise directly by task requests Query Result return service request transmitting terminal, end task requesting query flow process;
S109: the task requests Query Result of acquisition is updated to book server, and by task requests Query Result return service request transmitting terminal, end task requesting query flow process.
S110: obtain load balancing list, judge whether update request belongs to book server service range, whether the data namely upgraded belong to the scope that book server provides service, if so, then perform S111, otherwise directly perform S112;
S111: book server is upgraded according to update request, and perform S112;
S112: according to load balancing list and exempt to upgrade list, determines update server node, is added to by book server and exempt to upgrade list, and forward update request to the update server node determined; Described update server node is inquired about for providing this type of task requests, and the server be not updated;
S113: obtain and upgrade result, and return service request transmitting terminal.
In described method, described server receives in service request, and described service request is that client or other servers send.
In described method, described load balancing list is pre-stored within each server.
Prestore all enabled nodes of load bridging in load balancing list, be stored in each server in a static manner, and can carry out orientation renewal, load balancing list can be preserved with document form or database form.
In described method, described exempt from Query List and exempt to upgrade list to be contained in service request;
Described Query List of exempting from is the server list of having inquired about;
It is described that to exempt to upgrade list be updated server list.
Described exempting from Query List and exempt to upgrade list is information subsidiary in service request, before carrying out service request and forwarding, the identifying information of book server is added by every station server and exempt from Query List or exempt to upgrade in list, make the server of follow-up acquisition service request service request be forwarded again.
The system that Cloud Server load balancing regulates, comprise multiple servers, as shown in Figure 2, every station server comprises:
Receiver module 201, receives service request for server;
Judge module 202, for judging service offer category, select method of service, described service offer category is task requests or update request;
Task requests enquiry module 203, for requesting query flow process of executing the task when judge module 202 judges that service request is task requests;
Server update module 204, for performing server update flow process when judge module 202 judges that service request is update request;
Described task requests enquiry module 203 also comprises:
First service judges submodule 203-1, obtains load balancing list, judges whether task requests belongs to book server service range, if so, then enter load judgment submodule 203-1, otherwise enter the first forwarding submodule 203-4;
Load judgment submodule 203-2, for judging whether server load reaches preset upper limit, if reach preset upper limit, then book server task requests Query Result is empty, if do not reach preset upper limit, then carries out local job enquiry;
Query Result judges submodule 203-3, judges whether book server task requests Query Result is empty, if be empty, then enter the first forwarding submodule 203-4, otherwise enters result feedback submodule 203-6;
First forwards submodule 203-4, for according to load balancing list and exempt from Query List, determines job enquiry server node, is added to by book server and exempt from Query List, and forward task requests to the job enquiry server node determined;
Forward result and judge submodule 203-5, for obtaining task requests Query Result, and judge whether task requests Query Result is empty, if be empty, then enter result feedback submodule 203-6, otherwise judge whether task requests belongs to book server service range, if, then the task requests Query Result of acquisition is updated to book server, and enters result feedback submodule 203-6, otherwise directly enter result feedback submodule 203-6;
Result feedback submodule 203-6, for by task requests Query Result return service request transmitting terminal;
Described server update module 204 also comprises:
Second service judges submodule 204-1, for obtaining load balancing list, judging whether update request belongs to book server service range, if so, then entering renewal submodule, otherwise directly enter the second forwarding submodule;
Upgrading submodule 204-2, for upgrading book server according to update request, and entering the second forwarding submodule;
Second forwards submodule 204-3, for according to load balancing list and exempt to upgrade list, determines update server node, is added to by book server and exempt to upgrade list, and forward update request to the update server node determined;
Result obtains submodule 204-4, for obtaining renewal result, and return service request transmitting terminal.
In described system, described server receives in service request, and described service request is that client or other servers send.
In described system, described load balancing list is pre-stored within each server.
In described system, described exempt from Query List and exempt to upgrade list to be contained in service request;
Described Query List of exempting from is the server list of having inquired about;
It is described that to exempt to upgrade list be updated server list.
Method provided by the present invention, client, without the need to carrying out analyzing and positioning to server, can be initiated service request to any server, eliminate the dependence of client to server version; Every station server has oneself load balancing list, except forwarding task, only bear inquiry and the renewal of own task, in all available server nodes that cloud Data distribution8 is recorded to load balancing list, and the load balancing list that each server node has is different, and the subtree of non-higher level's forwarding server load balancing list, makes the webbed topological structure of multiple server node shapes; And the service request of server forwards and upgrades, server can be supplemented database automatically, after making server access service system, do not need the operation forcing to carry out data inputting, shorten on-line time, and only upgrade nearest task requests Query Result, decrease database pressure, server required preventive maintenance time of reaching the standard grade greatly is reduced, improves flexibility and high efficiency that cloud service system arranges; Every station server can carry out load condition identification, has departed from the dependence to load guide server in prior art, and improve the real-time of load balancing management, entirety improves service ability and the stability of Cloud Server.
The invention provides the method and system of a kind of Cloud Server load balancing and data redundancy backup, client can send service request to any server, and the server receiving service request judges service offer category, selects method of service; To execute the task when service request is task requests requesting query flow process, perform server update flow process when service request is update request; When service request be not book server service range or book server task requests Query Result for time empty, can forward service request to other servers, the task requests Query Result simultaneously returned according to other servers, upgrades book server.By method of the present invention, server can carry out autonomous state identification, improves the stability of Cloud Server; Simultaneously the task requests forwarding inquiries of server and renewal, can make server automatically will obtain data filling to book server from other servers, improve the flexibility of server update.
Although depict the present invention by embodiment, those of ordinary skill in the art know, the present invention has many distortion and change and do not depart from spirit of the present invention, and the claim appended by wishing comprises these distortion and change and do not depart from spirit of the present invention.