Realize method, server, ballot processing node and the system of internet ballot
Technical field
The present invention relates to internet arena, more particularly to a kind of method for realizing internet ballot, server, ballot processing
Node and system.
Background technology
With developing rapidly for Internet technology, increasing internet interactive service is occurred in that.Internet ballot is made
For one kind in internet interactive service, the advantages of by real-time, agility, the ballot link of many programs is applied to
In.Specifically, when being voted using internet, it will usually set a ballot system voted for certain program, client passes through
The ballot webpage that the ballot system is provided is voted.In order to enable a viewer to be voted by internet in real time, allow spectators
Well with program interaction, the presence of enhancing spectators, it is necessary to propose a kind of method for realizing internet ballot.
Correlation technique realize internet ballot when, it will usually develop a set of ballot system, the system include client and
Server, realizes that internet is voted by the interaction of client and server.Specifically, when client needs to be voted
When, send ballot request to server;Server is received after the ballot request that client is sent, and ballot clothes are provided for client
Business;After the ballot of each client, the ballot paper information of each client of server process, to obtain specific voting results.
During the present invention is realized, inventor has found that correlation technique at least has problems with:
Because correlation technique is when realizing internet ballot, client is directly interacted with server, i.e. ballot system
Only support single node service.In this case, when server can not provide ballot service due to failure, client can not
Participate in ballot.In addition, when the client that synchronization participates in ballot is numerous, server may reach a bottleneck,
Client is caused to vote in time, while causing bad operating experience to user, the effect of influence server process ballot
Rate.
The content of the invention
The problem of in order to solve correlation technique, the embodiments of the invention provide a kind of method for realizing internet ballot, clothes
Business device, ballot processing node and system.The technical scheme is as follows:
First aspect includes there is provided a kind of method for realizing internet ballot, methods described:
The ballot request that client is sent is received, the ballot request carries user's mark;
Selection identifies the target matched ballot processing node with the user from default multiple ballot processing nodes, and
The ballot request is transmitted to the target ballot processing node, it is that the client is carried to make the target ballot processing node
For ballot service.
It is described to receive what client was sent with reference in a first aspect, in the first possible implementation of first aspect
Before ballot request, in addition to:
Receive the ballot configuration information acquisition request that the client is sent;
Acquisition request is obtained according to the ballot configuration information and integrates ballot configuration information, the comprehensive ballot configuration information
Including ballot status information, current poll information and polling option information;
The comprehensive ballot configuration information got is sent to the client, makes the client according to the vote
Item information determines whether to be voted, and if it is determined that being voted, then transmission ballot is asked.
It is described from default multiple ballots with reference in a first aspect, in second of possible implementation of first aspect
Before selection identifies the target matched ballot processing node with the user in processing node, in addition to:
The multiple ballots processing node pre-set is grouped, and sets every group of ballot processing node to be identified with user
Between corresponding relation;
The selection from default multiple ballot processing nodes identifies the target matched ballot processing section with the user
Point, including:
The corresponding relation handled according to every group of ballot of setting between node and user's mark determines user's mark pair
Answer ballot processing node where be grouped, and it is determined that packet in selection one with the user identify match ballot processing
Node is used as target ballot processing node.
With reference to second of possible implementation of first aspect, in the third possible implementation of first aspect
In, before the described pair of multiple ballots processing node pre-set is grouped, in addition to:
One ballot processing node of selection handles node, the master as main ballot from the multiple ballot processing node
Ballot processing node is used to regularly count the ballot configuration information of other ballot processing nodes to obtain comprehensive ballot configuration information
Afterwards, the comprehensive configuration information of voting is broadcast to each client and other ballots handles node, confidence is matched somebody with somebody in the ballot
Breath includes the local ballot status information, local current poll information and local polling option letter of each ballot processing node
Breath;
It is described that acquisition request synthesis ballot configuration information is obtained according to the ballot configuration information, including:
Obtained according to the ballot configuration information and ask to obtain the comprehensive configuration of voting from the main ballot processing node
Information, or, the comprehensive configuration information of voting is broadcasted to each ballot processing node in the main ballot processing node,
Comprehensive ballot configuration information is obtained from any one ballot processing node.
It is described to turn the ballot request with reference in a first aspect, in the 4th kind of possible implementation of first aspect
After issuing target ballot processing node, in addition to:
If the target processing node breaks down, the target ballot processing node is shielded, and distribute described many
Target ballot processing described in ballot processing node processing in individual ballot processing node in addition to the target votes processing node
The currently processed polled data of node.
Second aspect includes there is provided a kind of method for realizing internet ballot, methods described:
The ballot request of the reception server forwarding, the ballot request is sent to the request of the server for client,
And the ballot request carries user's mark of matching;
According to the ballot request ballot service is provided for the client.
With reference to second aspect, in the first possible implementation of second aspect, the reception server forwarding
Before ballot request, in addition to:
The ballot configuration information for receiving the server forwarding obtains request, and the ballot configuration information obtains request by institute
Client is stated to send to the server;
Acquisition request is obtained according to the ballot configuration information and integrates ballot configuration information, the comprehensive ballot configuration information
Including ballot status information, current poll information and polling option information;
The comprehensive ballot configuration information got is sent to the server, makes the server by the comprehensive ballot
Configuration information is transmitted to after the client, makes the client determine whether to be voted according to the polling option information,
And if voted, then send ballot request.
With reference to the first possible implementation of second aspect, in second of possible implementation of second aspect
In, it is described to provide ballot service according to the ballot request for the client, including:
Polling option information is provided for the client according to the ballot status information, receives and caches the client
The ballot paper information that selection ballot object concurrency is sent from the polling option information;
It polymerize the ballot paper information of the identical ballot object of the different clients selection of caching in preset time, and handles polymerization
Ballot paper information afterwards, obtains configuration information of voting, and the ballot configuration information includes local ballot status information, local current ticket
Number information and local polling option information.
With reference to second of possible implementation of second aspect, in the third possible implementation of second aspect
In, it is described processing polymerization after ballot paper information, obtain ballot configuration information after, in addition to:
The synchronous ballot configuration information makes the main ballot processing node timing count each to main ballot processing node
The ballot configuration information of ballot processing node obtains comprehensive ballot configuration information, and the main ballot processing node is the server
The ballot processing node for being used to regularly count the ballot configuration information of the multiple ballot processing node authorized.
With reference to the third possible implementation of second aspect, in the 4th kind of possible implementation of second aspect
In, it is described according to it is described ballot request for the client provides vote service after, in addition to:
Receive the switching command that the server is sent;
Node is managed for main voting booth according to switching command switching, and after switching is main voting booth reason node, timing
The ballot configuration information of the multiple ballot processing node of statistics obtains comprehensive ballot configuration information, and the comprehensive ballot is configured
Information is broadcast to other ballots processing node in each client and the multiple ballot processing node.
The third aspect includes there is provided a kind of server, the server:
First receiving module, the ballot request for receiving client transmission, the ballot request carries user's mark;
Selecting module, for the target throwing that selection is matched with user mark from default multiple ballot processing nodes
Ticket handles node;
Forwarding module, for the ballot request to be transmitted into the target ballot processing node, makes the target vote
Processing node provides ballot service for the client.
With reference to the third aspect, in the first possible implementation of the third aspect, the server, in addition to:
Second receiving module, request is obtained for receiving the ballot configuration information that the client is sent;
Acquisition module, ballot configuration information is integrated for obtaining acquisition request according to the ballot configuration information, described comprehensive
Closing ballot configuration information includes ballot status information, current poll information and polling option information;
Sending module, for the comprehensive ballot configuration information got to be sent into the client, makes the client
Determine whether to be voted according to the polling option information, and if it is determined that being voted, then transmission ballot is asked.
With reference to the third aspect, in second of possible implementation of the third aspect, the server, in addition to:
Grouping module, is grouped, and set every group of ballot processing for multiple ballots processing node to pre-setting
Corresponding relation between node and user's mark;
The selecting module, it is true for handling the corresponding relation between node and user's mark according to every group of ballot of setting
Be grouped where the corresponding ballot processing node of fixed user's mark, and it is determined that packet in selection one marked with the user
The ballot processing node of matching is known as target ballot processing node.
With reference to second of possible implementation of the third aspect, in the third possible implementation of the third aspect
In, the selecting module is additionally operable to one ballot of selection from the multiple ballot processing node and handles node as main ballot
Node is handled, the ballot configuration information that the main ballot processing node is used to regularly count other ballot processing nodes is comprehensive to obtain
Close after ballot configuration information, the comprehensive configuration information of voting be broadcast to each client and other ballots handle node,
The ballot configuration information include the local ballot status information of each ballot processing node, local current poll information and this
Ground polling option information;
The acquisition module, is obtained for obtaining request according to the ballot configuration information from the main ballot processing node
The comprehensive ballot configuration information, or, the comprehensive configuration information of voting is broadcasted to every in the main ballot processing node
After individual ballot processing node, comprehensive ballot configuration information is obtained from any one ballot processing node.
With reference to the third aspect, in the 4th kind of possible implementation of the third aspect, the server, in addition to:
Shroud module, for when target processing node breaks down, shielding the target ballot processing node;
Distribute module, for distributing the throwing in the multiple ballot processing node in addition to the target votes processing node
The currently processed polled data of target ballot processing node described in ticket processing node processing.
Fourth aspect includes there is provided one kind ballot processing node, the ballot processing node:
First receiving module, for the reception server forward ballot request, it is described ballot request for client send to
The request of the server, and the ballot request carries user's mark of matching;
Ballot service module, for providing ballot service according to the ballot request for the client.
With reference to fourth aspect, in the first possible implementation of fourth aspect, the ballot processing node is also wrapped
Include:
Second receiving module, the ballot configuration information for receiving the server forwarding obtains request, and the ballot is matched somebody with somebody
Information acquisition request is put to be sent to the server by the client;
Acquisition module, ballot configuration information is integrated for obtaining acquisition request according to the ballot configuration information, described comprehensive
Closing ballot configuration information includes ballot status information, current poll information and polling option information;
Sending module, for the comprehensive ballot configuration information got to be sent into the server, makes the server
The comprehensive configuration information of voting is transmitted to after the client, the client is determined according to the polling option information
Whether voted, and if voted, then send ballot request.
With reference to the first possible implementation of fourth aspect, in second of possible implementation of fourth aspect
In, the ballot service module, including:
Polling option unit is provided, for providing polling option letter according to the ballot status information for the client
Breath;
Receiving unit, for receiving the choosing that the client selects ballot object concurrency to send from the polling option information
Ticket information;
Buffer unit, for caching the choosing that the client selects ballot object concurrency to send from the polling option information
Ticket information;
Polymerized unit, the ballot paper letter of the identical ballot object of the different clients selection cached for polymerizeing in preset time
Breath;
Processing unit, for handling the ballot paper information after polymerization, obtains vote configuration information, the ballot configuration information bag
Include local ballot status information, local current poll information and local polling option information.
With reference to second of possible implementation of fourth aspect, in the third possible implementation of fourth aspect
In, the ballot processing node, in addition to:
Synchronization module, for the synchronous ballot configuration information to main ballot processing node, makes the main ballot processing section
The ballot configuration information that point timing counts each ballot processing node obtains comprehensive ballot configuration information, the main ballot processing section
Point is the server mandate for regularly counting the ballot processing that the multiple ballot handles the ballot configuration information of node
Node.
With reference to the third possible implementation of fourth aspect, in the 4th kind of possible implementation of fourth aspect
In, the ballot processing node, in addition to:
3rd receiving module, for receiving the switching command that the server is sent;
Handover module, for managing node according to switching command switching for main voting booth;
Statistical module, after in switching for main voting booth reason node, regularly counts the multiple ballot processing node
Configuration information of voting obtains comprehensive ballot configuration information;
Broadcast module, for the comprehensive ballot configuration information of acquisition to be broadcast into each client and the multiple ballot
Handle other ballots processing node in node.
5th aspect includes there is provided a kind of system for realizing internet ballot, the system:Server and multiple ballots
Handle node;
Wherein, server of the server as described in the above-mentioned third aspect;
Ballot processing node of each ballot processing node as described in above-mentioned fourth aspect in multiple ballot processing nodes.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
By from default multiple ballot processing nodes selection and user identify the target that match vote handle node come
Ballot service is provided for client, it is ensured that when realizing internet ballot, when the client that synchronization participates in ballot is numerous,
Node can be handled by multiple ballots to provide ballot service for client, can while improving system processing ballot efficiency
Good operating experience is brought to user.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, makes required in being described below to embodiment
Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for
For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings
Accompanying drawing.
Fig. 1 is a kind of implementation environment schematic diagram of method for realizing internet ballot provided in an embodiment of the present invention;
Fig. 2 is a kind of method flow diagram for realizing internet ballot that the embodiment of the present invention one is provided;
Fig. 3 is another method flow diagram for realizing internet ballot that the embodiment of the present invention one is provided;
Fig. 4 is a kind of method flow diagram for realizing internet ballot that the embodiment of the present invention two is provided;
Fig. 5 is the structural representation for the first server that the embodiment of the present invention three is provided;
Fig. 6 is the structural representation for second of server that the embodiment of the present invention three is provided;
Fig. 7 is the structural representation for the third server that the embodiment of the present invention three is provided;
Fig. 8 is the structural representation for the 4th kind of server that the embodiment of the present invention three is provided;
Fig. 9 is the structural representation for the first ballot processing node that the embodiment of the present invention four is provided;
Figure 10 is the structural representation for second of ballot processing node that the embodiment of the present invention four is provided;
Figure 11 is a kind of structural representation for ballot service module that the embodiment of the present invention four is provided;
The structural representation for the third ballot processing node that Figure 12 embodiment of the present invention four is provided;
The structural representation for the 4th kind of ballot processing node that Figure 13 embodiment of the present invention four is provided;
Figure 14 is a kind of structural representation for system for realizing internet ballot that the embodiment of the present invention five is provided.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention
Formula is described in further detail.
As shown in figure 1, it illustrates a kind of implementation ring for the method for realizing internet ballot provided in an embodiment of the present invention
Border structural representation.There is provided a kind of ballot system in the implementation environment shown in Fig. 1, the ballot system includes multiple clients
End, server and multiple ballots processing node.In embodiments of the present invention, when user needs to participate in certain activity by internet
During ballot, the ballot system can be logged in by the client at place, then by sending ballot request to server, by servicing
Device one ballot processing node of selection from default multiple ballot processing nodes provides ballot service for client.Wherein, it is many
Individual ballot processing node can be distributed in different areas or be distributed in different ISP(Internet Service
Provider, internet provides service provider)In equipment.When providing ballot service for client, server is from multiple voting booths
One ballot processing node of selection provides ballot service for client in reason node.For example, can select at one and client
Ballot processing node in same ISP provides ballot service for client.
For convenience of description, in embodiments of the present invention, the throwing that ballot service is provided for client server selected
Ticket processing node definition is target ballot processing node.In addition, the progresses in real time feelings in order to enable the client to get ballot
Condition, server can handle node by one ballot processing node of selection in multiple ballot processing nodes as main ballot, be used for
Timing counts the ballot situation of each ballot processing node.
The method provided in an embodiment of the present invention for realizing internet ballot is carried out below in conjunction with each embodiment detailed
Illustrate, specific embodiment one and embodiment two as described below:
Embodiment one
Implementation environment structural representation and the above with reference to shown in Fig. 1, are realized the embodiments of the invention provide one kind
The method of internet ballot.By taking the angle that server performs method provided in an embodiment of the present invention as an example, referring to Fig. 2, the present invention
The method flow that embodiment is provided includes:
201:The ballot request that client is sent is received, ballot request carries user's mark;
202:Selection identifies the target matched ballot processing node with user from default multiple ballot processing nodes, and
Ballot request is transmitted to target ballot processing node, target ballot processing node is provided ballot service for client.
Preferably, before the ballot request for receiving client transmission, in addition to:
Receive the ballot configuration information acquisition request that client is sent;
Acquisition request is obtained according to ballot configuration information and integrates ballot configuration information, synthesis ballot configuration information includes throwing
Ticket status information, current poll information and polling option information;
The comprehensive ballot configuration information got is sent to client, makes client be according to the determination of polling option information
It is no to be voted, and if it is determined that being voted, then transmission ballot is asked.
Preferably, selection identifies the target matched ballot processing node with user from default multiple ballot processing nodes
Before, in addition to:
The multiple ballots processing node pre-set is grouped, and sets every group of ballot processing node to be identified with user
Between corresponding relation;
Selection identifies the target matched ballot processing node with user from default multiple ballot processing nodes, including:
Corresponding relation between node and user's mark is handled according to every group of ballot of setting and determines that user's mark is corresponding
Ballot processing node where be grouped, and it is determined that packet in selection one with user identify match ballot processing node conduct
Target ballot processing node.
Preferably, before being grouped to the multiple ballots processing node pre-set, in addition to:
One ballot processing node of selection handles node, the main voting booth as main ballot from multiple ballot processing nodes
Reason node is used to regularly count the ballot configuration information of other ballot processing nodes to obtain after comprehensive ballot configuration information, will be comprehensive
Close ballot configuration information and be broadcast to each client and other ballots processing node, wherein, ballot configuration information includes each
Local ballot status information, local current poll information and the local polling option information of ballot processing node;
Acquisition request is obtained according to ballot configuration information and integrates ballot configuration information, including:
Obtained according to ballot configuration information and ask to obtain comprehensive configuration information of voting from main ballot processing node, or,
Main ballot processing node broadcasts comprehensive ballot configuration information to each ballot processing node, from any one ballot processing section
Point obtains comprehensive ballot configuration information.
Preferably, ballot request is transmitted to after target ballot processing node, in addition to:
If target processing node breaks down, shielding target ballot processing node, and distribute multiple ballot processing sections
One or more ballots processing node processing target ballot processing node in point in addition to target votes processing node is currently located
The polled data of reason.
The angle that any ballot processing node in node performs method provided in an embodiment of the present invention is handled with multiple ballots
Exemplified by degree, referring to Fig. 3, method flow provided in an embodiment of the present invention includes:
301:The ballot request of the reception server forwarding, ballot request is sent to the request of server for client, and
Ballot request carries user's mark of matching.
302:According to ballot request ballot service is provided for client.
Preferably, before the ballot request of the reception server forwarding, in addition to:
The ballot configuration information of the reception server forwarding obtains request, and the ballot configuration information obtains request and sent out by client
Deliver to server;
Acquisition request is obtained according to ballot configuration information and integrates ballot configuration information, synthesis ballot configuration information includes throwing
Ticket status information, current poll information and polling option information;
The comprehensive ballot configuration information got is sent to server, makes server by comprehensive ballot configuration information forwarding
After client, make client determine whether to be voted according to polling option information, and if voted, then send ballot
Request.
Preferably, ballot service is provided for client according to ballot request, including:
Polling option information is provided for client according to ballot status information, receives and cache client is believed from polling option
The ballot paper information that selection ballot object concurrency is sent in breath;
It polymerize the ballot paper information of the identical ballot object of the different clients selection of caching in preset time, and handles polymerization
Ballot paper information afterwards, obtains configuration information of voting, and the ballot configuration information includes local ballot status information, local current poll
Information and local polling option information.
Preferably, processing polymerization after ballot paper information, obtain ballot configuration information after, in addition to:
Synchronous ballot configuration information makes main ballot processing node timing count each ballot processing to main ballot processing node
The ballot configuration information of node obtains comprehensive ballot configuration information, and main ballot processing node is server mandate for regularly uniting
The ballot processing node of the ballot configuration information of the multiple ballot processing nodes of meter.
Preferably, according to ballot request for client provides vote service after, in addition to:
The switching command that the reception server is sent;
Node is managed for main voting booth according to switching command switching, and after switching is main voting booth reason node, timing is counted
The ballot configuration information of multiple ballot processing nodes obtains comprehensive ballot configuration information, and comprehensive ballot configuration information is broadcast to respectively
Other ballots processing node in individual client and multiple ballots processing node.
Method provided in an embodiment of the present invention, passes through selection and user's mark from default multiple ballot processing nodes
The target ballot processing node matched somebody with somebody to provide ballot service for client, it is ensured that when realizing internet ballot, work as synchronization
When the client of participation ballot is numerous, it can be serviced by multiple ballots handle nodes to provide ballot for client, improve system
While processing ballot efficiency, good operating experience can be brought to user.
Embodiment two
The content of implementation environment structural representation and above-described embodiment one with reference to shown in Fig. 1, the embodiment of the present invention is provided
A kind of method for realizing internet ballot.Referring to Fig. 4, method flow provided in an embodiment of the present invention includes:
401:Server is grouped to default multiple ballot processing nodes, and sets every group of ballot processing node with using
Corresponding relation between the mark of family.
Because the method provided in an embodiment of the present invention for realizing internet ballot supports multipoint service, i.e. ballot system to include
Multiple ballot processing nodes, handle node by multiple ballots and provide ballot service simultaneously for different clients.Therefore, server
It can be grouped for default multiple ballot processing nodes in ballot system, and to default multiple ballot processing nodes
Can be different visitors by the ballot processing node in different grouping when providing ballot service for client after being grouped
Family end provides ballot service.
The mode being grouped on server to default multiple ballot processing nodes, can have a variety of.For example, service
Device can be grouped, i.e., by the voting booth in different grouping when being grouped to multiple ballot processing nodes according to area
Reason node is respectively that the client of different regions provides ballot service.For example, server can control the voting booth of Beijing area
Reason node provides ballot service for the client of Beijing area.Server can also enter according to ISP to multiple ballot processing nodes
Row packet, now, server select the ballot processing node matched with the ISP of client to be client according to the ISP of client
Ballot service is provided.
In addition, after server is grouped to default multiple ballot processing nodes, you can in different grouping
Ballot processing node provides ballot service for different clients.In this case, in order to for client providing ballot service
When, rapidly from multiple ballot processing nodes the ballot that can provide ballot service for client can be selected to handle node, clothes
Business device can set the corresponding relation between every group of ballot processing node and user's mark.The embodiment of the present invention is not set to server
The mode for putting the corresponding relation between every group of ballot processing node and user's mark is specifically limited.For example, server can be with
The corresponding relation between area residing for setting ballot processing node and client.
It should be noted that because the step is the operation that server is carried out before ballot service is provided to client,
Therefore, this step when providing ballot service every time for client without being performed both by.If packet changes or needed more
When new, this step can be performed again.
402:Server one ballot processing node of selection from default multiple ballot processing nodes is used as main voting booth
Node is managed, the main ballot processing node is used to regularly count the ballot configuration information of other ballot processing nodes to obtain comprehensive throwing
Ticket configuration information, synthesis ballot configuration information includes ballot status information, current poll information and polling option information.
In order that other ballots processing node in client or ballot system can obtain the progress feelings of ballot in real time
Condition, server can be used as main ballot processing section by one ballot processing node of selection from default multiple ballot processing nodes
Point, and the main ballot processing node is globally unique, for regularly counting the ballot configuration information of other ballot processing nodes to obtain
Ballot configuration information must be integrated.In addition, main ballot processing node can throw the synthesis after comprehensive ballot configuration information is obtained
Ticket configuration information is broadcast to each client and other ballots processing node, so that client updates UI(User
Interface, user interface)Show or other ballot processing nodes is obtained current ballot progress in real time.
Wherein, comprehensive ballot configuration information includes ballot status information, current poll information and polling option information.Throw
Ticket status information is used for the state for showing ballot, and during such as ballot is carried out, ballot does not start or voted to have terminated.Current poll
Information is used to show relation between the poll that each ballot object is currently obtained and the poll that each ballot object is obtained etc..
When polling option information is used for when voting status information in carrying out, polling option is provided the user with, so that user selects to carry out
Ballot.
On server, one ballot processing node of selection is used as main voting booth from default multiple ballot processing nodes
The mode of node is managed, there can be many kinds.For example, server can limit some throwing in default multiple ballot processing nodes
Ticket processing node is fixed main ballot processing node;Also the ballot disposition of node can be handled according to default multiple ballots
Main ballot processing node is determined, for example, server can handle the ballot quantity of the client of node processing according to multiple ballots
How much determinations it is main ballot processing node;Also some ballot processing nodes can be preselected, and each selected voting booth is set
Manage the time that node handles node as main ballot so that node is handled by different ballots respectively at the time of different and thrown as main
Ticket processing node etc..
Further, the ballot configuration information that main ballot processing node timing counts other ballot processing nodes is comprehensive to obtain
The mode of ballot configuration information is closed, is specially:The ballot configuration information of each ballot processing node Timing Synchronization itself is thrown to main
Ticket handles node;Main ballot processing node timing counts the synchronous ballot configuration information of each ballot processing node and obtains integrating throwing
Ticket configuration information.Wherein, the ballot configuration information of each ballot processing node includes the local ballot of each ballot processing node
Status information, local current poll information and local polling option information.Wherein, local ballot status information is used to show this
The ballot state on ground is in carrying out, has completed or do not started.Local current poll information is used to show what is locally currently obtained
The poll of each ballot object.When local polling option information is used for when voting status information in carrying out, throwing is provided the user with
Item is voted for, now the corresponding user of client can be voted by polling option.United on main ballot processing node timing
The time interval of meter, the embodiment of the present invention is not especially limited, for example, can be 5min(Minute), 10min etc..Certainly, in order to
Each client and other ballots is set to handle the progress that node obtains ballot in real time, the time interval of the timing statistics
It is more short better.
It should be noted that the step is required for what is carried out nor providing ballot service every time, can be according to server
The mode of the main ballot processing node of selection is performed.If for example, server selects throwing based on the ballot processing node that some is fixed
Ticket handles node, then the step need to be performed once;If server timing selects ballot based on some ballot processing nodes
Node is handled, then the step needs timing execution, etc..
403:Server receives the ballot configuration information acquisition request that client is sent, and the ballot configuration information is obtained
Request is transmitted to target ballot processing node.
Client is voted before ballot is participated in order to obtain current ballot development situation, it is necessary to be sent to server
Configuration information obtains request.Now, server receives the ballot configuration information acquisition request that client is sent, and the ballot is matched somebody with somebody
Put information acquisition request and be transmitted to target ballot processing node.The ballot configuration information for receiving client transmission on server is obtained
Take request and the ballot configuration information is obtained into request and be transmitted to the mode that target ballot handles node, the embodiment of the present invention is not
Make specific limit.
It should be noted that server by the ballot configuration information acquisition request be transmitted to target ballot processing node it
Before, target ballot processing node can be used as by one ballot processing node of selection from default multiple ballot processing nodes.Its
In, server one ballot processing node of selection from default multiple ballot processing nodes is voted as target handles node
Mode, can there is many kinds, for example, server can be corresponding according to the client for sending ballot configuration information acquisition request
The selection one from default multiple ballot processing nodes of user's mark identifies the ballot matched with the user and handles node conduct
Target ballot processing node.If for example, user mark carries the regional information of user, server can be according to user's
One ballot processing node of selection is used as target ballot processing node in area where regional information from the user.In addition, by
In main ballot processing node after comprehensive ballot configuration information is obtained, synthesis ballot configuration information can be synchronized to the ballot system
Each other ballot processing node in system, therefore, server obtains request in the ballot configuration information that forwarding client is sent
Before, after a ballot processing node can also be randomly choosed as target ballot processing node, the ballot configuration information is obtained
Request is taken to be transmitted to target ballot processing node.Certainly, in order that client quickly obtains comprehensive ballot configuration information, in this hair
In bright embodiment, the ballot processing node that prioritizing selection is in areal or same ISP with client is voted as target
Handle node.
404:The ballot configuration information of target ballot processing node the reception server forwarding obtains request, is configured according to ballot
Information acquisition request obtains comprehensive ballot configuration information.
Wherein, the embodiment of the present invention, which is not voted target, handles the ballot configuration information acquisition of node the reception server forwarding
The mode of request is specifically limited.
Voted on target and handle the side that node integrates configuration information of voting according to ballot configuration information acquisition acquisition request
Formula, can there is many kinds.Work as example, target ballot processing node can handle the main ballot processing node of node request to main ballot
The comprehensive ballot configuration information of preceding statistics integrates ballot configuration information to obtain;The reception ballot configuration information can also first be detected
Obtain at the time of request between the time integrated between the ballot configuration information moment of statistics synchronous with main ballot processing node last
Every.When the time interval very little, main ballot directly can be handled node last synchronization statistics by target ballot processing node
Comprehensive ballot configuration information integrates ballot configuration information as acquisition.
In addition, in embodiments of the present invention, server in order to grasp the development situation of ballot in real time, it is also desirable to according to ballot
Configuration information obtains ballot configuration information in real time.Wherein, server obtains acquisition request according to ballot configuration information and integrates ballot
The mode of configuration information, includes but is not limited to be obtained according to ballot configuration information and asks to obtain comprehensive throwing from main ballot processing node
Ticket configuration information, or, comprehensive ballot configuration information is broadcasted to each ballot processing node in main ballot processing node, from
Any one ballot processing node obtains comprehensive ballot configuration information.
405:The comprehensive ballot configuration information got is sent to server by target ballot processing node, and server will be comprehensive
Close ballot configuration information to be transmitted to after client, client determines whether to be voted according to polling option information, and if enters
Row ballot, then send ballot request to server.
Wherein, the comprehensive ballot configuration information got is not sent to by the embodiment of the present invention to target ballot processing node
Server and server are specifically limited the mode that comprehensive ballot configuration information is transmitted to client.
After comprehensive ballot configuration information is transmitted to client by server, client obtains comprehensive ballot configuration information.
Because comprehensive ballot configuration information includes ballot status information, current poll information and polling option information.Therefore, ballot is worked as
When the current ballot state that status information is shown is in ballot progress, the throwing that client can be provided according to polling option information
Item is voted for be voted, and, it is necessary to send ballot request to server after client determines to vote.On client to clothes
Business device sends the mode of ballot request, and the embodiment of the present invention is not especially limited.When it is implemented, ballot system can be in correspondence
Ballot webpage on polling option is set, client is after display polling option, by detecting the operation that polling option is clicked
Ballot request is sent to trigger to server.
406:Server receive client send ballot request, and from it is default it is multiple ballot processing nodes in selection with
The target ballot processing node of user's mark matching, and ballot request is transmitted to target ballot processing node, wherein, ballot please
Seek carrying user's mark.
The mode for the ballot request that client is sent is received on server, the embodiment of the present invention is not especially limited.
It should be noted that due to being grouped before server to default multiple ballot processing nodes, and set
Put the corresponding relation between every group of ballot processing node and user's mark.Therefore, service after the ballot request of client is received,
From default multiple ballot processing nodes selection the ballot matched processing node can be identified as target voting booth with user
Reason node to provide ballot service for the client of the request.Wherein, server is selected from default multiple ballot processing nodes
Select and the mode that the ballot processing node matched handles node as target ballot is identified with user, including but not limited to by following
Mode is realized:
The corresponding relation that server is handled between node and user's mark according to every group of ballot of setting determines that user identifies
It is corresponding ballot processing node where be grouped, and it is determined that packet in selection one with user identify match ballot processing section
Point is used as target ballot processing node.
Certainly, server can also selection be identified with user from default multiple ballot processing nodes using other modes
The ballot processing node of matching is not especially limited as target ballot processing node, the embodiment of the present invention to this.
407:The ballot request of target ballot processing node the reception server forwarding, is carried according to ballot request for client
For ballot service.
Ballot request is transmitted to after target ballot processing node by server, target ballot processing node the reception server turn
The ballot request of hair.On server will vote request be transmitted to target ballot processing node and target ballot processing node connect
The mode of the ballot request of server forwarding is received, the embodiment of the present invention is not especially limited.
Wherein, target ballot processing node provides ballot service according to ballot request for client, including:
Target ballot processing node provides polling option information according to ballot status information for client;Obtained in client
The ballot object selected to user from polling option information is obtained after ballot paper information, and the ballot paper information is sent into target
Ballot processing node.The ballot paper information that target ballot processing node is received and cache client is sent;Target ballot processing node
It polymerize the ballot paper information of the identical ballot object of the different clients selection of caching in preset time, and handles the ballot paper after polymerization
Information, obtains configuration information of voting.
It should be noted that in embodiments of the present invention, target ballot processing node is received and cache client is from ballot
After the ballot paper information that selection ballot object concurrency is sent in option information, the ballot paper information directly not selected client is added to
In local current poll information, but the ballot paper information cache of this acquisition is first handled into intra-node, Ran Houding in ballot
When check recently a period of time in whether have other similar operations.If within the period, there is one or more clients again
End have selected the ballot object, now, the ballot paper for the same ballot object that target ballot processing node selects multiple client
After information is polymerize, the corresponding poll of ballot paper information after polymerization is added in local current poll information.On mesh
Mark ballot processing node realizes the mode of converging operation, can there is many kinds.For example, can be set in ballot processing intra-node
Timer, and the ballot paper information cached using the timer timing scan, when timer reaches timing time, automatically by the section
The time ballot paper information of caching is polymerize, and by the ballot paper information write into Databasce after polymerization.
For the ease of the identical ballot of different clients selection in processing node aggregation preset time of voting above-mentioned target
The process of the ballot paper information of object is explained, and below illustrates citing.
For example, user A and user B, 1 ticket has been thrown in the same timing of timer to same ballot object, that
Increased 1 ticket individually will not be respectively written into database by target ballot processing node, but operation that this is voted twice is poly-
Once-through operation is synthesized, the ballot paper information write into Databasce of the operation of voting twice after polymerization now records in database
The ballot paper of ballot object adds 2 tickets.
By converging operation, ballot number of users is more, request amount it is big in the case of, target ballot processing node will be numerous
Ballot request aggregates into operation once of equal value, so that the ballot system supports the situation of high concurrent, it is to avoid participate in ballot
Client it is numerous when, ballot processing node because reach bottleneck cause ballot system break down risk.
In addition, the ballot paper information after target ballot processing node processing polymerization, obtains after ballot configuration information, also wraps
Include:Obtained ballot configuration information is synchronized to main ballot processing node, allows main ballot processing node timing according to each
The synchronous ballot configuration information update of ballot processing node integrates ballot configuration information.
By above-mentioned steps, client can be voted by target handles the ballot service progress ballot behaviour that node is provided
Make.If however, the target ballot processing node for providing ballot service for client in current ballot system breaks down
Afterwards, target ballot processing node then normally can not provide ballot service for client.In order to ensure target ballot processing node
After failure, the ballot of user is not influenceed to operate, the embodiment of the present invention is additionally provided to be occurred for target ballot processing node
Solution during failure, specific step 408 as described below.
408:If target ballot processing node breaks down, server shielding target ballot processing node, and distribute
One or more ballots processing node processing target ballot in multiple ballot processing nodes in addition to target votes processing node
Handle the currently processed polled data of node.
In order to ensure that ballot system remains able to handle the ballot of client when target ballot processing node breaks down
Request, in embodiments of the present invention, if target ballot processing node breaks down, server shielding target ballot processing section
Point, and the one or more ballots distributed in multiple ballot processing nodes in addition to target votes processing node handle node processing
The currently processed polled data of target ballot processing node.The mode of target ballot processing node, this hair are shielded on server
Bright embodiment is not especially limited.In addition, handling node on being voted in the multiple ballot processing nodes of server-assignment except target
Outside the currently processed polled data of one or more ballots processing node processing target ballot processing node mode, can be with
There are many kinds.For example, server can select one or many in the packet where the target ballot of failure handles node
Individual ballot processing node;Certainly, server can also select one or more ballot processing nodes, the present invention from other packets
Embodiment is not especially limited to this.
By the step, after target ballot processing node breaks down, located by distributing other ballot processing nodes
The polled data that reason target ballot processing node is presently processing so that polled data will not be because of some ballot processing node
Failure and he malfunctions, while adding the disaster tolerance performance of ballot system, do not influence the ballot of user to operate.
409:The switching command that target ballot processing node the reception server is sent, and according to switching command switch based on throw
Ticket handles node.
The step is optional step.In embodiments of the present invention, any one ballot processing node in ballot system is equal
It can switch and manage node for main voting booth, it is ensured that in current main ballot handle node failures, can be handled by other ballots
Node continues executing with the function of main ballot processing node.Because main ballot processing node is globally unique ballot processing node,
Therefore, server mandate is needed in order to switch the operation for managing node for main voting booth, it is ensured that the main ballot processing node of mandate
Global uniqueness.Therefore, target ballot processing node is, it is necessary to what the reception server was sent when main voting booth manages node in switching
Switching command, and node is managed for main voting booth according to switching command switching.
Further, target ballot processing node continues executing with main ballot processing after switching is main voting booth reason node
The function that node is performed, i.e., the ballot configuration information for regularly counting multiple ballot processing nodes obtains comprehensive ballot configuration information,
And the other ballots handled comprehensive ballot configuration information real-time broadcast to each client and multiple ballots in node are handled
Node.
Method provided in an embodiment of the present invention, passes through selection and user's mark from default multiple ballot processing nodes
The target ballot processing node matched somebody with somebody to provide ballot service for client, it is ensured that when realizing internet ballot, work as synchronization
When the client of participation ballot is numerous, it can be serviced by multiple ballots handle nodes to provide ballot for client, improve system
While processing ballot efficiency, good operating experience can be brought to user.
Embodiment three
The embodiments of the invention provide a kind of server, the server is used to perform in above-described embodiment one and embodiment two
The function that server is performed.Referring to Fig. 5, the server includes:
First receiving module 501, the ballot request for receiving client transmission, ballot request carries user's mark;
Selecting module 502, for the target throwing that selection is matched with user's mark from default multiple ballot processing nodes
Ticket handles node;
Forwarding module 503, node is handled for ballot request to be transmitted into target ballot, target ballot is handled node and is
Client provides ballot service.
Preferably, referring to Fig. 6, server, in addition to:
Second receiving module 504, the ballot configuration information for receiving client transmission obtains request;
Acquisition module 505, ballot configuration information, comprehensive ballot are integrated for obtaining acquisition request according to ballot configuration information
Configuration information includes ballot status information, current poll information and polling option information;
Sending module 506, for the comprehensive ballot configuration information got to be sent into client, makes client according to throwing
Ticket option information determines whether to be voted, and if it is determined that being voted, then transmission ballot is asked.
Preferably, referring to Fig. 7, server, in addition to:
Grouping module 507, is grouped, and set every group of voting booth for multiple ballots processing node to pre-setting
Manage the corresponding relation between node and user's mark;
Selecting module 502, it is true for handling the corresponding relation between node and user's mark according to every group of ballot of setting
Determine to be grouped where the corresponding ballot processing node of user's mark, and it is determined that packet in selection one matched with user's mark
Ballot processing node is used as target ballot processing node.
Preferably, selecting module 502, are additionally operable to one ballot processing node conduct of selection from multiple ballot processing nodes
Main ballot processing node, main ballot processing node is used to regularly count the ballot configuration information of other ballot processing nodes to obtain
After comprehensive ballot configuration information, comprehensive ballot configuration information is broadcast to each client and other ballots handle node, is thrown
Ticket configuration information includes the local ballot status information, local current poll information and local ballot of each ballot processing node
Option information;
Acquisition module 505, asks to obtain comprehensive vote from main ballot processing node for being obtained according to ballot configuration information
Configuration information, or, comprehensive ballot configuration information is broadcasted to each ballot processing node in main ballot processing node, from appointing
One ballot processing node of meaning obtains comprehensive ballot configuration information.
Preferably, referring to Fig. 8, server, in addition to:
Shroud module 508, for when target processing node breaks down, shielding target ballot to handle node;
Distribute module 509, for distribute it is multiple ballot processing nodes in except target vote processing node in addition to one or
The currently processed polled data of multiple ballot processing node processing target ballot processing nodes.
Server provided in an embodiment of the present invention, passes through selection and user's mark from default multiple ballot processing nodes
The target ballot processing node of matching to provide ballot service for client, it is ensured that when realizing internet ballot, when with for the moment
When the client of quarter participation ballot is numerous, it can be serviced by multiple ballots handle nodes to provide to vote for client, improve system
While system processing ballot efficiency, good operating experience can be brought to user.
Example IV
The embodiments of the invention provide one kind ballot processing node, ballot processing node is used to perform above-described embodiment one
With the function of target ballot processing node in embodiment two.Referring to Fig. 9, ballot processing node includes:
First receiving module 901, the ballot request forwarded for the reception server, ballot request is sent to clothes for client
The request of business device, and ballot asks the user for carrying matching to identify;
Ballot service module 902, for providing ballot service according to ballot request for client.
Preferably, referring to Figure 10, ballot processing node, in addition to:
Second receiving module 903, request is obtained for the ballot configuration information that the reception server is forwarded, configuration information of voting
Request is obtained to be sent to server by client;
Acquisition module 904, ballot configuration information, comprehensive ballot are integrated for obtaining acquisition request according to ballot configuration information
Configuration information includes ballot status information, current poll information and polling option information;
Sending module 905, for the comprehensive ballot configuration information got to be sent into server, makes server comprehensive
Ballot configuration information is transmitted to after client, makes client determine whether to be voted according to polling option information, and if enter
Row ballot, then send ballot request.
Preferably, referring to Figure 11, service module 902 of voting, including:
Polling option unit 9021 is provided, for providing polling option information according to ballot status information for client;
Receiving unit 9022, for receiving the ballot paper letter that client selects ballot object concurrency to send from polling option information
Breath;
Buffer unit 9023, the ballot paper letter that ballot object concurrency is sent is selected for cache client from polling option information
Breath;
Polymerized unit 9024, the choosing of the identical ballot object of the different clients selection cached for polymerizeing in preset time
Ticket information;
Processing unit 9025, for handling the ballot paper information after polymerization, obtains configuration information of voting, configuration information bag of voting
Include local ballot status information, local current poll information and local polling option information.
Preferably, referring to Figure 12, ballot processing node, in addition to:
Synchronization module 906, for synchronous configuration information of voting to main ballot processing node, makes main ballot processing node timing
The ballot configuration information of each ballot processing node of statistics obtains comprehensive ballot configuration information, and main ballot processing node is server
The ballot processing node for being used to regularly count the ballot configuration information of multiple ballot processing nodes authorized.
Preferably, referring to Figure 13, ballot processing node, in addition to:
3rd receiving module 907, the switching command sent for the reception server;
Handover module 908, for managing node according to switching command switching for main voting booth;
Statistical module 909, after in switching for main voting booth reason node, regularly counts the throwing of multiple ballot processing nodes
Ticket configuration information obtains comprehensive ballot configuration information;
Broadcast module 910, for the comprehensive ballot configuration information of acquisition to be broadcast into each client and multiple ballots
Handle other ballots processing node in node.
Ballot processing node provided in an embodiment of the present invention, by being selected from default multiple ballot processing nodes with using
The target ballot processing node of family mark matching to provide ballot service for client, it is ensured that when realizing internet ballot, when
When the client of synchronization participation ballot is numerous, it can be serviced by multiple ballots handle nodes to provide ballot for client,
While raising system processing ballot efficiency, good operating experience can be brought to user.
Embodiment five
The embodiments of the invention provide a kind of system for realizing internet ballot, referring to Figure 14, the system includes server
1401 and it is multiple ballot processing node 1402;
Wherein, the server that such as above-mentioned embodiment three is provided of server 1401, specifically refers to the content of above-described embodiment three,
It will not be repeated here;
Each ballot processing node 1402 ballot processing that such as above-mentioned example IV is provided in multiple ballot processing nodes
Node, specifically refers to the content of above-described embodiment four, will not be repeated here;
Wherein, server one ballot processing node of selection can be handled from multiple ballot processing nodes as main ballot
Node 1403, the main ballot processing node is used to regularly count the ballot configuration information of other ballot processing nodes to obtain synthesis
Vote after configuration information, the comprehensive configuration information of voting is broadcast to each client and other ballots handle node.
System provided in an embodiment of the present invention, is selected and user by server from default multiple ballot processing nodes
The target ballot processing node of mark matching to provide ballot service for client, it is ensured that when realizing internet ballot, when same
When the client of one moment participation ballot is numerous, it can be serviced, carried to provide ballot for client by multiple ballots handle nodes
While high system processing ballot efficiency, good operating experience can be brought to user.
It should be noted that:The server of above-described embodiment offer, ballot handle node when realizing internet ballot, only
With the division progress of above-mentioned each functional module for example, in practical application, can as needed and by above-mentioned functions distribution by
Different functional modules is completed, i.e., the internal structure of equipment is divided into different functional modules, described above complete to complete
Portion or partial function.In addition, above-described embodiment server provided, processing node of voting, the system for realizing internet ballot
With realizing that the embodiment of the method for internet ballot belongs to same design, it implements process and refers to embodiment of the method, here not
Repeat again.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware
To complete, the hardware of correlation can also be instructed to complete by program, described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent substitution and improvements made etc. should be included in the scope of the protection.