CN103024050A - Distributor and distributing method for multiple servers - Google Patents

Distributor and distributing method for multiple servers Download PDF

Info

Publication number
CN103024050A
CN103024050A CN2012105493720A CN201210549372A CN103024050A CN 103024050 A CN103024050 A CN 103024050A CN 2012105493720 A CN2012105493720 A CN 2012105493720A CN 201210549372 A CN201210549372 A CN 201210549372A CN 103024050 A CN103024050 A CN 103024050A
Authority
CN
China
Prior art keywords
server
cid
information
connection identifier
distributor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012105493720A
Other languages
Chinese (zh)
Other versions
CN103024050B (en
Inventor
吴浩
任寰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201210549372.0A priority Critical patent/CN103024050B/en
Publication of CN103024050A publication Critical patent/CN103024050A/en
Application granted granted Critical
Publication of CN103024050B publication Critical patent/CN103024050B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a distributor and a distributing method for multiple servers. The distributing method includes that: user identification information is received; a globally unique connecting identifier is generated according to the user identification information; a connection indicated by the connecting identifier is distributed to one of the multiple servers according to the connecting identifier and the number of the servers; a cloud storage server side issues condition information and command information to a push server when data is updated; the push server determines a target client side among multiple browser client sides according to the condition information, and sends the command information to a socket server corresponding to the target client side; socket connections are respectively established on the socket server and the corresponding browser client side, and the command information is sent to the target client side; and the target client side achieves data synchronization with the cloud storage server side according to the command information. According to the distributor and the distributing method for the multiple servers, load balance of the servers is achieved, and a system has high adaptability when the number of the servers is increased or decreased.

Description

Distributor and the method that a plurality of servers are distributed
Technical field
The present invention relates to the information technology data field of synchronization, the method that is specifically related to a kind of distributor and a plurality of servers are distributed.
Background technology
At present, along with the development of network technology, the Internet is as huge information resources, becomes the most convenient of people's obtaining information, approach efficiently.At present, the user uses personal computer access internet (Internet) usually, and browser (Browser) accessed web page by installing in the personal computer, obtains the information that needs.Along with the development of mobile communication technology, the user can also access internet by the portable terminal of supporting browser function, for example mobile phone, personal digital assistant (Personal Digital Assistant is called for short PDA).
Yet, no matter be browser on the personal computer or the browser on the portable terminal, Push Service generally is not provided, server end depends on being connected of client initiation with the information interaction of client, server end can't send to client with information on one's own initiative, thereby can't realize the real-time synchronization of the information between server end and the browser client.
In the prior art, the synchronous mode of the most frequently used realization browser client and server end browser data is that browser client sends request with certain frequency to server end, as once in a week or per month once, if having the renewal of relevant information, service end obtains these information.Yet the applicant finds that there is following technological deficiency in this kind data method of synchronization: efficient is lower, take resource real real-time synchronizations many, that can not accomplish content upgrades.
In a kind of concrete implementation, it is synchronous that browser client carries out data by socket server and server end, and browser client need to keep being connected with socket server thus.Yet for the particular browser client, also need to be optimized to the process of socket server corresponding to its distribution or addressing.
Summary of the invention
In view of the above problems, the present invention has been proposed in order to a kind of method that overcomes the problems referred to above or the distributor that addresses the above problem at least in part and a plurality of servers are distributed is provided.
According to one aspect of the present invention, a kind of distributor is provided, it comprises: receiving element, connection identifier (CID generation unit and Dispatching Unit, wherein:
Described receiving element is suitable for receiving user totem information;
Described connection identifier (CID generation unit is suitable for generating the unique connection identifier (CID of the overall situation according to described user totem information;
Described Dispatching Unit is suitable for the number according to connection identifier (CID and server, and the connection of described connection identifier (CID indication is distributed in described a plurality of server one;
Wherein, described user totem information is contained in browser client in the connection request of described distributor transmission, and described distributor also comprises transmitting element, and the server identification and the connection identifier (CID that are suitable for distributing send to described browser client.
Alternatively, described user totem information comprises: the user name of login user and/or the machine hardware of non-login user sign.
Alternatively, described connection identifier (CID is a specific numerical value in the certain numerical value scope.
Alternatively, described connection identifier (CID generation unit adopts the cyclic redundancy check (CRC) algorithm.
Alternatively, described cyclic redundancy check (CRC) algorithm is 32.
Alternatively, described Dispatching Unit further comprises equal molecular cell, related subelement and distribution subelement, wherein:
Described equal molecular cell is suitable for according to the number of server the number range at connection identifier (CID place being equally divided into a plurality of numerical value interval;
Described related subelement is suitable for one in each server and the described a plurality of numerical value interval is associated;
Described distribution subelement is suitable for the numerical value interval according to described connection identifier (CID place, and the server that is associated with its numerical value interval is distributed in the connection of described connection identifier (CID indication.
Alternatively, when the number of server changed, described Dispatching Unit re-started distribution to server.
Alternatively, described server is socket server.
According to a further aspect in the invention, provide a kind of method that a plurality of servers are distributed, the method comprises:
Receive user totem information;
Generate the unique connection identifier (CID of the overall situation according to described user totem information;
According to the number of connection identifier (CID and server, the connection of described connection identifier (CID indication is distributed in described a plurality of server one;
Cloud storage server end issues conditional information and command information to push server when Data Update is arranged;
Described push server is determined the destination client according to this conditional information in a plurality of browser clients, and described command information is sent to the socket server corresponding with described destination client;
Described socket server is set up respectively socket with corresponding browser client and is connected, and command information is sent to the destination client;
Described destination client realizes that according to described command information the data of itself and cloud storage server end are synchronous.
Alternatively, described user totem information comprises: the user name of login user and/or the machine hardware of non-login user sign.
Alternatively, described connection identifier (CID is a specific numerical value in the certain numerical value scope.
Alternatively, adopt the cyclic redundancy check (CRC) algorithm to generate described connection identifier (CID according to described user totem information.
Alternatively, described cyclic redundancy check (CRC) algorithm is 32.
Alternatively, described number according to connection identifier (CID and server, one the step that the connection that described connection identifier (CID is indicated is distributed in described a plurality of server further comprises following substep:
According to the number of server the number range at connection identifier (CID place is equally divided into a plurality of numerical value interval;
One in each server and the described a plurality of numerical value interval is associated;
Numerical value according to described connection identifier (CID place is interval, and the server that is associated with its numerical value interval is distributed in the connection of described connection identifier (CID indication.
Alternatively, when the number of server changes, server is re-started distribution.
Alternatively, described server is socket server.
Alternatively, described method comprises that also browser client sends the step of the connection request that includes described user totem information to distributor, and after server is distributed, also comprise the step that described distributor sends to described browser client with the server identification distributed and connection identifier (CID.
Alternatively, described method comprises that also cloud storage server end sends the step of the conditional information that includes described user totem information to push server, and after server is distributed, also comprise the step that command information that described push server will be corresponding with described conditional information and connection identifier (CID send to the server of distributing.
Can in the browser real-time synchronization, carry out automatic distributing to server according to a kind of distributor of the present invention with to the method that a plurality of servers are distributed, solved thus prior art and can not guarantee that the long quantity that connects of every station server carrying is roughly the same, namely can not realize the problem of the load balance of server, load balance, the Distribution Results of having obtained server have uniqueness, the beneficial effect repeatable, that system has high suitability when increasing and decreasing server.
Above-mentioned explanation only is the general introduction of technical solution of the present invention, for can clearer understanding technological means of the present invention, and can be implemented according to the content of specification, and for above and other objects of the present invention, feature and advantage can be become apparent, below especially exemplified by the specific embodiment of the present invention.
Description of drawings
By reading hereinafter detailed description of the preferred embodiment, various other advantage and benefits will become cheer and bright for those of ordinary skills.Accompanying drawing only is used for the purpose of preferred implementation is shown, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts with identical reference symbol.In the accompanying drawings:
Fig. 1 shows the structural representation of the system that realizes that according to an embodiment of the invention browser data is synchronous;
Fig. 2 shows the structural representation of the system that realizes that according to an embodiment of the invention browser data is synchronous;
Fig. 3 is the schematic diagram of the process that browser client and socket server connect in the synchronous system of realization browser data shown in Figure 2;
Fig. 4 is the schematic diagram that carries out the process of information pushing in the synchronous system of realization browser data shown in Figure 2 under first kind scene to the destination client;
Fig. 5 is the schematic diagram that carries out the process of information pushing in the synchronous system of realization browser data shown in Figure 2 under the Equations of The Second Kind scene to the destination client;
Fig. 6 is the schematic diagram that carries out the process of information pushing in the synchronous system of realization browser data shown in Figure 2 under the 3rd class scene to the destination client;
Fig. 7 is the flow chart according to the synchronous method of the realization browser data of the embodiment of the invention;
Fig. 8 is the structural representation according to the synchronous browser client of the realization browser data of the embodiment of the invention;
Fig. 9 is the structure drawing of device that server is distributed according to the embodiment of the invention;
Figure 10 is the method flow diagram that server is distributed according to the embodiment of the invention; And
Figure 11 is server distribution schematic diagram of the present invention.
Embodiment
Exemplary embodiment of the present disclosure is described below with reference to accompanying drawings in more detail.Although shown exemplary embodiment of the present disclosure in the accompanying drawing, yet should be appreciated that and to realize the disclosure and the embodiment that should do not set forth limits here with various forms.On the contrary, it is in order to understand the disclosure more thoroughly that these embodiment are provided, and can with the scope of the present disclosure complete convey to those skilled in the art.
In one exemplary embodiment of the present invention, provide a kind of system that realizes that browser data is synchronous.As shown in Figure 1, the synchronous system of this realization browser data comprises: cloud storage server end 1, push server 2 and a plurality of browser client 3,4.Wherein, cloud storage server end 1 is used for issuing conditional information and command information to push server when Data Update is arranged; Push server 2 is used for determining the destination client according to conditional information at a plurality of browser clients, and this command information is pushed to destination client 3; Destination client 3 is used for synchronous according to the data of this command information realize target client and cloud storage server end.
In the embodiment shown in fig. 1, by independent push server 2 is set, under news occurs more in the data content of cloud storage server end storage, in time command information is sent to the destination client by push server, thereby has realized simply, efficiently service end information and client real-time synchronization.
As shown in Figure 1, include starting client 4 and destination client 3 in a plurality of browser clients.Wherein, starting client 4 is used for the data that are stored in cloud storage server end 1 are upgraded.This starting client 4 and destination client 3 can belong to same user, also can belong to different users.This starting client 4 is with the main application scenarios of situation that destination client 3 belongs to same user: same user uses different equipment (for example mobile phone and PC) login browser, one of them (for example PC) changes collection, needs so this renewal is synchronized to another equipment (mobile phone) of same user.The application scenarios that this starting client 4 and destination client 3 do not belong to same user's situation for example is the information communication between the different browsers client.
Certainly, the present invention also can be by the renewal of cloud storage server end self initiation to the data content, and in this case, 4 of the initiation browser clients among Fig. 1 can not exist.The scene of this situation for example is: system pushes news messages or weather forecast to all browser clients; Or system initiates to upgrade indication to the browser client of all certain versions.
Because the dotted line frame is existing in the existing browser with interior cloud storage server end 1, destination client 3 and starting client 4 among Fig. 1, therefore adding on this basis push server can effectively utilize original system architecture, reduces and realizes cost of the present invention.
For the connection that realizes that cloud storage server end 1, push server 2 are connected with the destination client, as shown in Figure 2, the synchronous system of browser client and cloud storage server end data that realizes can also comprise a plurality of socket servers, distributor.
Distributor is used for after receiving the connection request of client, for it distributes corresponding socket server and connection identifier (CID, and user totem information and connection identifier (CID is stored to the distribution information database.Detailed connection is set up process as shown in Figure 3, comprising:
Step S301, browser client is submitted connection request to distributor, at least comprise user totem information in this connection request, for login user, its user totem information can comprise user name, and for non-login user, its user totem information can comprise user's machine hardware sign.
For login user, this user totem information can be a character string.Wherein, this character string also comprises the information such as login time and checking character except the user name of login user.The user is called user's unique identifying number, and namely a numeral is used for representing a user.The checking character generates according to user name, can judge whether user totem information is modified by the checking character.
For non-login user, this user totem information can comprise the machine hardware sign of non-login user, and wherein machine hardware is designated the machine unique identification, for client generates by Hash such as subscriber set hardware, system configuration.
In addition, for the screening of follow-up destination client, this connection request can also comprise user's characteristic information, for example: IP address information, browser version information, or the user's characteristic information such as user's classified information.Wherein, browser version number, user's classified information, or the user's characteristic information such as IP address information can be used for follow-up client Select to use.
Step S302, distributor uses preset algorithm to calculate a numerical value based on this user totem information, distributes socket server according to this numerical value for the browser client of submitting connection request to; This numerical value is that the overall situation is unique, i.e. connection identifier (CID; Distributor is sent to the browser client of submitting request to the link information such as the IP address of this socket server, port and connection identifier (CID;
In this step, use default algorithm to calculate above-mentioned numerical value according to the user name of login user.For non-login user, directly adopt the machine hardware sign of non-login user to calculate above-mentioned numerical value, this algorithm can be cyclic redundancy check (CRC) (CRC) 32 algorithms.
Step S303, browser client connects with corresponding socket server according to the IP address of the socket server that receives and port numbers, and this connection can be transmission control protocol TCP (Transmission Control Protocol) connection.When browser client and socket server connected, this socket server obtained identifying the resource identifier of this socket server and browser client annexation.The connection that the browser client utilization has been set up transmits the connection identifier (CID that it receives to this socket server.
Step S304 after socket server receives connection identifier (CID, verifies this connection identifier (CID to distributor, if be proved to be successful, then keep with browser client between set up be connected, if verify unsuccessfully, then disconnect the connection of having set up.
Step S305, distributor is stored in user totem information (user name of login user or the machine hardware of non-login user sign), user's characteristic information (if any) and connection identifier (CID in the distribution information database, and socket server also is stored in resulting resource identifier in this distribution information database.
Need to prove, chaotic in order to prevent that server end from changing the distribution cause, browser client need to connect re-executing step S301-step S304 after a period of time.
In addition, for each socket server, in the distribution information database, all there is corresponding independent tables of data, to reduce the scale of tables of data, accelerates to push stage, the inquiry velocity of socket server at follow-up.
By increasing distributor and socket server, and the distribution information database is set in distributor, make it possible to user totem information, resource identifier and user's characteristic information etc. are stored in the distribution information database in the stage of connecting, thereby realized the propelling movement of push server to the data content of goal-selling client.
In the information pushing stage: push server is used for conditional information and command information are sent to socket server; Socket server is used for the information that push server pushes is forwarded to corresponding destination client.The following minute three class scenes of detailed information pushing process are elaborated.
(1) initiated by starting client when this real-time synchronization, and starting client and when receiving client and belonging to same user, comprise user totem information in the conditional information.By way of example, as shown in Figure 4, this information pushing process comprises:
Step S401, starting client initiate the data that are stored in the storage of cloud storage server end are upgraded;
In this step, it is one of following that the data of cloud storage server end storage comprise: other possible information of collection information, history information, browser configuration information, note information, login house keeper information, prompting message information, key information etc.
Step S402, cloud storage server end sends conditional information and command information to push server, this conditional information comprises user totem information, the for example user name of login user or not the machine hardware sign of login user, and also comprise the resource identifier of the connection of the socket server that this starting client of sign is corresponding with it in this conditional information;
Step S403, push server by with distributor in same algorithm calculate a numerical value according to user totem information, thereby obtain the socket server into the destination client distribution, this numerical value is that the overall situation is unique, be connection identifier (CID, and conditional information and command information are sent to the socket server that this distributes for the destination client;
Step S404, socket server is according to the distribution information database in the inquiry of the user totem information in the conditional information distributor, determine the resource identifier corresponding with the destination client, wherein got rid of the resource identifier of the connection that identifies the starting client socket server corresponding with it;
Step S405, socket server according to this resource identifier with being connected of this destination client (one or more) in send this command information to this client.
(2) initiated by starting client when this real-time synchronization, and starting client namely comprises user totem information in the conditional information when receiving client and belong to different login user, as shown in Figure 5, this information pushing process comprises:
Step S501, starting client initiate the data that are stored in the storage of cloud storage server end are upgraded;
In this step, it is one of following that the data of cloud storage server end storage comprise: information that collection information, history information, browser configuration information, note information, login house keeper information, prompting message information, key information, news information and/or user generate etc.
Step S502, cloud storage server end sends conditional information and command information to push server, and wherein this conditional information can comprise user totem information, for example user name of login user or not the machine hardware sign of login user;
Step S503, push server by with distributor in same algorithm calculate a numerical value according to user totem information, thereby obtain the socket server into the destination client distribution, this numerical value is that the overall situation is unique, be connection identifier (CID, and conditional information and command information are sent to the socket server that this distributes for the destination client;
Step S504, socket server determine the resource identifier of destination client according to the distribution information database in the inquiry of the user totem information in the conditional information distributor;
Step S505, corresponding socket server be according to this resource identifier, with being connected of destination client (one or more) in send this notification message to this client, so far, the information pushing process finishes.
(3) initiatively initiated by cloud storage server end when this real-time synchronization, and comprise the Feature Selection information of destination client in the conditional information, and do not comprise user totem information, wherein Feature Selection information also can be sky,
In this case, connecting establishment stage, submitted in the connection request to distributor by browser client also to comprise Feature Selection information, it is with corresponding such as the front user's characteristic information of preserving in the distribution information database.
As shown in Figure 6, this information pushing process comprises:
Step S601, cloud storage server end issues in conditional information and the command information to push server, the Feature Selection information (for example version number of certain browser) that comprises the destination client in the conditional information, this command information for example are the instructions of notice customer upgrade;
Step S602, push server is pushed to all socket servers with conditional information and command information;
Step S603, each socket server submit query requests to the distribution information database of distributor respectively, comprise Feature Selection information in this query requests; The distribution information database is according to the user's characteristic information of each browser client in the Feature Selection condition query distribution information database, determine to satisfy the resource identifier of the destination client of this Feature Selection condition, and this resource identifier is back to each socket server of initiating inquiry;
Step S604, each socket server sends command information according to the resource identifier that receives to corresponding client, and so far, the information pushing process finishes.
For further conserve system resources, the command information that is pushed to browser client 3 by push server 2 is notification message.In this case, browser client also is used for connecting with cloud storage server end behind the notification message that receives the push server propelling movement, download the data content that renewal occurs from cloud storage server end, carry out the synchronous of local data content according to the data content of downloading.Can reduce the transmission data volume by transmitting notification message, reduce system resource and take.
Certainly, the command information that is pushed to the destination client by push server also can be content-message, namely comprise the data content that renewal occurs in this content-message, in this case, the destination client is behind the content-message that receives the push server propelling movement, from this content-message, extract the data content that renewal occurs, carry out the synchronous of local data content according to the data content that extracts.Can directly content-message be pushed to client by transmitting content-message, the information transmission is quick, and step is simple.
In order to realize calling to multilingual support, easily text, adopt the HTTP interface between push server and the cloud storage server end.
Based on the synchronous system of the realization browser data of Figure 1 and Figure 2, the present invention provides again a kind of method that realizes that browser data is synchronous.As shown in Figure 7, the synchronous method of this realization browser data comprises:
Step S710, cloud storage server end issues conditional information and command information to push server when Data Update is arranged;
Step S720, push server is determined the destination client according to this conditional information in a plurality of browser clients, and this command information is sent to the destination client;
Step S730, the destination client realizes that according to command information the data of itself and cloud storage server end are synchronous.
Further, also comprise that setting up socket between browser client and the socket server is connected before the step S710, this establishment of connection process just repeats no more as shown in Figure 3 here.
Further, step S710 cloud storage server end issues in the step of conditional information and command information to push server when Data Update is arranged, if comprise the login user user name of destination client or the machine hardware sign of login user not in the conditional information, comprise following two kinds of situations:
Situation one: starting client and reception client belong to same user, this user uses different equipment (for example mobile phone and PC) login browser, one of them (for example PC) changes collection, needs so this renewal is synchronized to another equipment (mobile phone) of same user;
In this situation, starting client is at first initiated being stored in relevant configuration, function or the information of collection or the modification of other information in the cloud storage server end.Then cloud storage server end sends conditional information and command information to push server, this command information comprises content-message and notification message, push server will send to the destination client with this command information according to conditional information by socket server, and wherein starting client has been got rid of in this destination client.Information pushing process in this kind situation also repeats no more as shown in Figure 4 here.
Situation two: starting client and receive client and do not belong to same user, thus realize between the different user information interaction by client.
Specifically, a user's client is sent to cloud storage server end with conditional information and content-message, it is sent to pusher to cloud storage server end with conditional information and related notification message, pusher is sent to the purpose client according to conditional information with notification message, and then the purpose client can be accessed cloud storage server end to obtain content.Information pushing process in this case also repeats no more as shown in Figure 5 here.
In addition, if do not comprise the user totem information of destination client in the conditional information, and can comprise Feature Selection information, then also comprise following situation:
Situation three: cloud storage server end self has Data Update, needs browser client and cloud storage server end to carry out data synchronous, and cloud storage server end initiatively issues conditional information and command information to push server, for example:
1, cloud storage server end initiates to upgrade indication to all browser clients of certain version, so that all browser clients of this version upgrade to redaction, wherein, command information is the notification message that upgrades to redaction, condition is the client of certain version browser, and namely wherein Feature Selection information is the version number of browser client.Then push server comprises the destination client that this command information sends in a plurality of browser clients according to this conditional information: the notification message that push server will upgrade to redaction sends to all browser clients of certain version.
2, cloud storage server end pushes news messages to all browser clients, and its conditional is all browser clients, and namely Feature Selection information is empty, and command information is the content-message that comprises news messages; Then push server comprises the destination client that this command information sends in a plurality of browser clients according to this conditional information: the content-message that push server will comprise news messages sends to all browser clients.Should be appreciated that, transmission also can be notification message.
3, cloud storage server end pushes weather forecast to the browser client of different regions, and its conditional is the browser client in a certain area, and namely Feature Selection information is this IP section corresponding to a certain area, and command information is the content-message that comprises weather forecast; Then push server comprises the destination client that this command information sends in a plurality of browser clients according to this conditional information: the content-message that push server will comprise weather forecast sends to the browser client in a certain area.Should be appreciated that, transmission also can be notification message.
Information pushing process in this case also repeats no more as shown in Figure 6 here.
Based on the synchronous system of the realization browser data of Figure 1 and Figure 2, the present invention provides again a kind of browser client of realizing that browser data is synchronous.As shown in Figure 8, this browser client comprises: link block is used for establishing a connection by distributor and socket server, and receives command information from corresponding socket server; Application module is used for according to this command information, carries out its corresponding application operating.Wherein, described command information is notification message or content-message.
As shown in Figure 8, link block comprises again: distributor connexon module, be used for submitting connection request to described distributor, comprise at least user totem information in this connection request, and receive link information and the connection identifier (CID of the socket server that is assigned with that is returned by distributor; Socket connexon module is used for setting up the socket connection according to link information and the described connection identifier (CID of the socket server that receives with corresponding socket server, and receives command information by this socket connection from corresponding socket server.Wherein, described user totem information is the user name of login user or the machine hardware sign of non-login user.
As shown in Figure 8, can also comprise in the above-mentioned browser client: cloud storing communication module, the application operating for the response application module communicates with cloud storage server end.
In above-described browser data synchro system, when carrying out the socket server distribution, need to meet the following conditions:
1, realizes to a certain extent load balancing, realize that namely every long quantity that connects of socket server carrying is roughly the same;
2, Distribution Results has uniqueness, repeatability; Being distributor is allocated in a certain socket server according to the user name of login user and/or the machine hardware sign of non-login user with request, and pusher can to go out present connection according to the machine hardware mark location of the user name of login user and/or non-login user be to be connected in which socket server;
3, when system's increase and decrease socket server, the distribution of socket server should have suitability, namely when system increases and decreases the quantity of socket server, should just can finish redistributing of request by simple change.
In order to satisfy above-mentioned distribution conditions, the present invention has further proposed a kind of device that server is distributed.This device may reside in the equipment and system that above-mentioned distributor and pusher and any other need to distribute server.
As shown in Figure 9, this device comprises, receiving element 910, connection identifier (CID generation unit 920 and Dispatching Unit 930, wherein:
Described receiving element 910 is suitable for receiving user totem information;
Described connection identifier (CID generation unit 920 is suitable for generating the unique connection identifier (CID of the overall situation according to described user totem information;
Described Dispatching Unit 930 is suitable for the number according to connection identifier (CID and server, and the connection of described connection identifier (CID indication is distributed in described a plurality of server one.
Wherein, described user totem information comprises: the user name of login user and/or the machine hardware of non-login user sign; Described connection identifier (CID is used for the connection of each client of identification, and it is a specific numerical value in the certain numerical value scope.
Wherein, described connection identifier (CID generation unit 920 adopts the cyclic redundancy check (CRC) algorithm, such as 32 cyclic redundancy check (CRC) algorithm.
In one embodiment of this invention, described Dispatching Unit 930 further comprises equal molecular cell, related subelement and distribution subelement, wherein:
Described equal molecular cell is suitable for according to the number of server the number range at connection identifier (CID place being equally divided into a plurality of numerical value interval;
Described related subelement is suitable for one in each server and the described a plurality of numerical value interval is associated;
Described distribution subelement is suitable for the numerical value interval according to described connection identifier (CID place, described connection identifier (CID is distributed to the server that is associated with its numerical value interval.
When the number of server changed, described Dispatching Unit 930 can re-start distribution to server.
Alternatively, described server is socket server.
The present invention also provides a kind of distributor, comprises the above-mentioned device that a plurality of servers are distributed.
Wherein, described user totem information is contained in browser client in the connection request of described distributor transmission, and described distributor also comprises transmitting element, and the server identification and the connection identifier (CID that are suitable for distributing send to described browser client.
The present invention also provides a kind of push server, comprises the above-mentioned device that a plurality of servers are distributed.
Wherein, described user totem information is contained in cloud storage server end in the conditional information of described push server transmission, described push server also comprises transmitting element, is suitable for the command information corresponding with described conditional information and connection identifier (CID are sent to the server of distributing.
The present invention also provides a kind of dissemination system, comprises the above-mentioned device that a plurality of servers are distributed.
Described system is used for realizing that browser data is synchronous, and it comprises: cloud storage server end, push server, socket server, a plurality of browser client and distributor, wherein:
Described cloud storage server end is used for issuing conditional information and command information to described push server when Data Update is arranged;
Described push server is used for determining the destination client according to this conditional information at described a plurality of browser clients, and described command information is sent to the socket server corresponding with described destination client;
Described socket server is used for setting up respectively socket with corresponding browser client and is connected, and command information is sent to the destination client; And
Described destination client is used for realizing that according to described command information the data of itself and cloud storage server end are synchronous;
Distributor is used for setting up the socket server that socket is connected to the browser client distribution with it;
Wherein, comprise the above-mentioned device that a plurality of servers are distributed in described push server and the described distributor.
The present invention also provides the method for in a kind of browser real-time synchronization a plurality of servers being distributed, and as shown in figure 10, the method may further comprise the steps:
Step S1010 receives user totem information;
Step S1020 generates the unique connection identifier (CID of the overall situation according to described user totem information;
Step S1030 according to the number of connection identifier (CID and server, is distributed in described a plurality of server one with the connection of described connection identifier (CID indication.
Wherein, described user totem information comprises: the user name of login user and/or the machine hardware of non-login user sign; Described connection identifier (CID is a specific numerical value in the certain numerical value scope.
Wherein, in described step S1020, can adopt the cyclic redundancy check (CRC) algorithm, such as 32 cyclic redundancy check (CRC) (CRC32) algorithm, generate the unique connection identifier (CID of the overall situation according to described user totem information.Described CRC32 algorithm is a kind of consistency hash algorithm, can realize a kind of comparatively dynamic, balanced and addressable server ways of distribution according to this consistency hash algorithm.In one embodiment of the invention, according to the CRC32 algorithm, the user name of login user and/or the machine hardware of non-login user can be identified balanced, the stable 0-2 that is converted to uniquely 32Special value in-1 scope.
In one embodiment of this invention, described number according to connection identifier (CID and server, one the step that the connection that described connection identifier (CID is indicated is distributed in described a plurality of server further comprises following substep:
According to the number of server the number range at connection identifier (CID place is equally divided into a plurality of numerical value interval;
One in each server and the described a plurality of numerical value interval is associated;
Numerical value according to described connection identifier (CID place is interval, described connection identifier (CID is distributed to the server that is associated with its numerical value interval.
Wherein, described server is socket server.
In another embodiment of the present invention, described method comprises that also browser client at first sends the step of the connection request that includes described user totem information to distributor, and after server is distributed, also comprise the step that described distributor sends to described browser client with the server identification distributed and connection identifier (CID.
In another embodiment of the present invention, described method comprises that also cloud storage server end at first sends the step of the conditional information that includes described user totem information to push server, and after server is distributed, also comprise the step that command information that described push server will be corresponding with described conditional information and connection identifier (CID send to the server of distributing.
In another embodiment of the present invention, described method is further comprising the steps of:
Cloud storage server end issues conditional information and command information to push server when Data Update is arranged;
Described push server is determined the destination client according to this conditional information in a plurality of browser clients, and described command information is sent to the socket server corresponding with described destination client;
Described socket server is set up respectively socket with corresponding browser client and is connected, and command information is sent to the destination client;
Described destination client realizes that according to described command information the data of itself and cloud storage server end are synchronous.
Above-mentioned distribution policy can be better understood by server distribution schematic diagram shown in Figure 11, and as shown in figure 11, each connection identifier (CID is hashed into a 0-2 32Special value in-1 scope, and be distributed on as shown in FIG. the annulus.The starting point of this annulus is 0, and terminal point is 2 32-1.
When the number of server is three, the number range at connection identifier (CID place is equally divided into three numerical value intervals, and composes respectively a value for this three station server, if be 0 and 2 with First server assignment for example 32The-1, second station server then assignment is (2 32-1)/3, the three station servers then assignment be 2* (2 32-1)/3.Interval according to the numerical value that the special value of described connection identifier (CID falls into, it is distributed to specific server process.For example fall into 0 to (2 32-1) numerical value/3 can be distributed to first server, falls into (2 32-1)/3 to 2* (2 32-1) numerical value/3 can be distributed to second server, falls into 2* (2 32-1)/3 to 2 32Numerical value between-1 can be distributed to the 3rd server.
In addition, when the number of server changes, according to described substep server is re-started distribution.
Such as, when server is adjusted into 4, can with this 4 station server respectively assignment be 0 and 2 32-1, (2 32-1)/4, (2 32-1)/2,3* (2 32-1)/4.So, fall into 0 to (2 32-1) numerical value/4 can be distributed to first server, falls into (2 32-1)/4 to (2 32-1) numerical value/2 can be distributed to second server, falls into (2 32-1)/2 to 3* (2 32-1) numerical value/4 can be distributed to the 3rd server, falls into 3* (2 32-1)/4 to 2 32Numerical value between-1 can be distributed to the 4th server.
In the browser real-time synchronization system that the above-mentioned method that server is distributed can be applied to above introduce and in other systems that need to distribute server.
To sum up, the present invention realized dynamically, balanced and addressable server distribution.Intrinsic not relevant with any certain computer, virtual system or miscellaneous equipment with demonstration at this algorithm that provides.Various general-purpose systems also can be with using based on the teaching at this.According to top description, it is apparent constructing the desired structure of this type systematic.In addition, the present invention is not also for any certain programmed language.Should be understood that and to utilize various programming languages to realize content of the present invention described here, and the top description that language-specific is done is in order to disclose preferred forms of the present invention.
In the specification that provides herein, a large amount of details have been described.Yet, can understand, embodiments of the invention can be in the situation that there be these details to put into practice.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand one or more in each inventive aspect, in the description to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes in the above.Yet the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires the more feature of feature clearly put down in writing than institute in each claim.Or rather, as following claims reflected, inventive aspect was to be less than all features of the disclosed single embodiment in front.Therefore, follow claims of embodiment and incorporate clearly thus this embodiment into, wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and can adaptively change and they are arranged in one or more equipment different from this embodiment the module in the equipment among the embodiment.Can be combined into a module or unit or assembly to the module among the embodiment or unit or assembly, and can be divided into a plurality of submodules or subelement or sub-component to them in addition.In such feature and/or process or unit at least some are mutually repelling, and can adopt any combination to disclosed all features in this specification (comprising claim, summary and the accompanying drawing followed) and so all processes or the unit of disclosed any method or equipment make up.Unless in addition clearly statement, disclosed each feature can be by providing identical, being equal to or the alternative features of similar purpose replaces in this specification (comprising claim, summary and the accompanying drawing followed).
In addition, those skilled in the art can understand, although embodiment more described herein comprise some feature rather than further feature included among other embodiment, the combination of the feature of different embodiment means and is within the scope of the present invention and forms different embodiment.For example, in the following claims, the one of any of embodiment required for protection can be used with compound mode arbitrarily.
All parts embodiment of the present invention can realize with hardware, perhaps realizes with the software module of moving at one or more processor, and perhaps the combination with them realizes.It will be understood by those of skill in the art that and to use in practice microprocessor or digital signal processor (DSP) to realize according to some or all some or repertoire of parts in the relevant device of the embodiment of the invention.The present invention can also be embodied as be used to part or all equipment or the device program (for example, computer program and computer program) of carrying out method as described herein.Such realization program of the present invention can be stored on the computer-readable medium, perhaps can have the form of one or more signal.Such signal can be downloaded from internet website and obtain, and perhaps provides at carrier signal, perhaps provides with any other form.
It should be noted above-described embodiment the present invention will be described rather than limit the invention, and those skilled in the art can design alternative embodiment in the situation of the scope that does not break away from claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and is not listed in element or step in the claim.Being positioned at word " " before the element or " one " does not get rid of and has a plurality of such elements.The present invention can realize by means of the hardware that includes some different elements and by means of the computer of suitably programming.In having enumerated the unit claim of some devices, several in these devices can be to come imbody by same hardware branch.The use of word first, second and C grade does not represent any order.Can be title with these word explanations.

Claims (18)

1. distributor comprises: receiving element, connection identifier (CID generation unit and Dispatching Unit, wherein:
Described receiving element is suitable for receiving user totem information;
Described connection identifier (CID generation unit is suitable for generating the unique connection identifier (CID of the overall situation according to described user totem information;
Described Dispatching Unit is suitable for the number according to connection identifier (CID and server, and the connection of described connection identifier (CID indication is distributed in described a plurality of server one;
Wherein, described user totem information is contained in browser client in the connection request of described distributor transmission, and described distributor also comprises transmitting element, and the server identification and the connection identifier (CID that are suitable for distributing send to described browser client.
2. distributor as claimed in claim 1, wherein, described user totem information comprises: the user name of login user and/or the machine hardware of non-login user sign.
3. distributor as claimed in claim 1, wherein, described connection identifier (CID is a specific numerical value in the certain numerical value scope.
4. distributor as claimed in claim 1, wherein, described connection identifier (CID generation unit adopts the cyclic redundancy check (CRC) algorithm.
5. distributor as claimed in claim 4, wherein, described cyclic redundancy check (CRC) algorithm is 32.
6. distributor as claimed in claim 1, wherein, described Dispatching Unit further comprises equal molecular cell, related subelement and distributes subelement, wherein:
Described equal molecular cell is suitable for according to the number of server the number range at connection identifier (CID place being equally divided into a plurality of numerical value interval;
Described related subelement is suitable for one in each server and the described a plurality of numerical value interval is associated;
Described distribution subelement is suitable for the numerical value interval according to described connection identifier (CID place, and the server that is associated with its numerical value interval is distributed in the connection of described connection identifier (CID indication.
7. distributor as claimed in claim 1, wherein, when the number of server changed, described Dispatching Unit re-started distribution to server.
8. distributor as claimed in claim 1, wherein, described server is socket server.
9. method that a plurality of servers are distributed, the method comprises:
Receive user totem information;
Generate the unique connection identifier (CID of the overall situation according to described user totem information;
According to the number of connection identifier (CID and server, the connection of described connection identifier (CID indication is distributed in described a plurality of server one;
Cloud storage server end issues conditional information and command information to push server when Data Update is arranged;
Described push server is determined the destination client according to this conditional information in a plurality of browser clients, and described command information is sent to the socket server corresponding with described destination client;
Described socket server is set up respectively socket with corresponding browser client and is connected, and command information is sent to the destination client;
Described destination client realizes that according to described command information the data of itself and cloud storage server end are synchronous.
10. method as claimed in claim 9, wherein, described user totem information comprises: the user name of login user and/or the machine hardware of non-login user sign.
11. method as claimed in claim 9, wherein, described connection identifier (CID is a specific numerical value in the certain numerical value scope.
12. method as claimed in claim 9 wherein, adopts the cyclic redundancy check (CRC) algorithm to generate described connection identifier (CID according to described user totem information.
13. method as claimed in claim 12, wherein, described cyclic redundancy check (CRC) algorithm is 32.
14. method as claimed in claim 9, wherein, described number according to connection identifier (CID and server, one the step that the connection that described connection identifier (CID is indicated is distributed in described a plurality of server further comprises following substep:
According to the number of server the number range at connection identifier (CID place is equally divided into a plurality of numerical value interval;
One in each server and the described a plurality of numerical value interval is associated;
Numerical value according to described connection identifier (CID place is interval, and the server that is associated with its numerical value interval is distributed in the connection of described connection identifier (CID indication.
15. method as claimed in claim 14 wherein, when the number of server changes, re-starts distribution to server.
16. method as claimed in claim 9, wherein, described server is socket server.
17. such as each described method among the claim 9-16, wherein, described method comprises that also browser client sends the step of the connection request that includes described user totem information to distributor, and after server is distributed, also comprise the step that described distributor sends to described browser client with the server identification distributed and connection identifier (CID.
18. such as each described method among the claim 9-16, wherein, described method comprises that also cloud storage server end sends the step of the conditional information that includes described user totem information to push server, and after server is distributed, also comprise the step that command information that described push server will be corresponding with described conditional information and connection identifier (CID send to the server of distributing.
CN201210549372.0A 2012-12-17 2012-12-17 Distributor and the method that multiple server is distributed Active CN103024050B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210549372.0A CN103024050B (en) 2012-12-17 2012-12-17 Distributor and the method that multiple server is distributed

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210549372.0A CN103024050B (en) 2012-12-17 2012-12-17 Distributor and the method that multiple server is distributed

Publications (2)

Publication Number Publication Date
CN103024050A true CN103024050A (en) 2013-04-03
CN103024050B CN103024050B (en) 2015-11-25

Family

ID=47972174

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210549372.0A Active CN103024050B (en) 2012-12-17 2012-12-17 Distributor and the method that multiple server is distributed

Country Status (1)

Country Link
CN (1) CN103024050B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104244201A (en) * 2013-06-07 2014-12-24 三竹资讯股份有限公司 Apparatus and method for delivering movement notifications via dual routes
CN104796495A (en) * 2015-05-08 2015-07-22 集怡嘉数码科技(深圳)有限公司 Message pushing method and system
CN106790629A (en) * 2017-01-03 2017-05-31 努比亚技术有限公司 Data synchronization unit and its realize the method for data syn-chronization, client access system
CN106850852A (en) * 2017-03-20 2017-06-13 南京大学 A kind of private clound is based on the locally coherence Hash load-balancing method of dynamical feedback
CN109426559A (en) * 2017-08-21 2019-03-05 北京国双科技有限公司 Order delivery method and device, storage medium, processor
CN111970315A (en) * 2019-05-20 2020-11-20 北京车和家信息技术有限公司 Method, device and system for pushing message
CN112054985A (en) * 2019-06-06 2020-12-08 全球能源互联网研究院有限公司 Data interaction method and system for mobile terminal and field detection test equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1305160A (en) * 1999-11-17 2001-07-25 国际商业机器公司 System and method of proceeding communication using 'mobile software agency' and mobile data processing equipment
US6421781B1 (en) * 1998-04-30 2002-07-16 Openwave Systems Inc. Method and apparatus for maintaining security in a push server
CN1464414A (en) * 2002-06-28 2003-12-31 杨俊群 Process for increasing computer network system capacity
CN1620012A (en) * 2003-11-19 2005-05-25 国际商业机器公司 Method and system for updating/reloading the content of pages browsed over a network
CN101199231A (en) * 2005-06-23 2008-06-11 诺基亚公司 Fixed access point for a terminal device
CN101551821A (en) * 2009-05-19 2009-10-07 周佺喜 Method of real-time information broadcasting in web
CN101690314A (en) * 2008-03-18 2010-03-31 日本电气株式会社 Load distribution system, load distribution method, and authentication server
US20110093523A1 (en) * 1998-02-27 2011-04-21 Jaye Daniel J System and method for associating a client identity between servers
CN102388632A (en) * 2011-08-26 2012-03-21 华为技术有限公司 Application information push method, system and network element

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110093523A1 (en) * 1998-02-27 2011-04-21 Jaye Daniel J System and method for associating a client identity between servers
US6421781B1 (en) * 1998-04-30 2002-07-16 Openwave Systems Inc. Method and apparatus for maintaining security in a push server
CN1305160A (en) * 1999-11-17 2001-07-25 国际商业机器公司 System and method of proceeding communication using 'mobile software agency' and mobile data processing equipment
CN1464414A (en) * 2002-06-28 2003-12-31 杨俊群 Process for increasing computer network system capacity
CN1620012A (en) * 2003-11-19 2005-05-25 国际商业机器公司 Method and system for updating/reloading the content of pages browsed over a network
CN101199231A (en) * 2005-06-23 2008-06-11 诺基亚公司 Fixed access point for a terminal device
CN101690314A (en) * 2008-03-18 2010-03-31 日本电气株式会社 Load distribution system, load distribution method, and authentication server
CN101551821A (en) * 2009-05-19 2009-10-07 周佺喜 Method of real-time information broadcasting in web
CN102388632A (en) * 2011-08-26 2012-03-21 华为技术有限公司 Application information push method, system and network element

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104244201A (en) * 2013-06-07 2014-12-24 三竹资讯股份有限公司 Apparatus and method for delivering movement notifications via dual routes
CN104244201B (en) * 2013-06-07 2017-11-10 三竹资讯股份有限公司 Apparatus and method for delivering movement notifications via dual routes
CN104796495A (en) * 2015-05-08 2015-07-22 集怡嘉数码科技(深圳)有限公司 Message pushing method and system
CN106790629A (en) * 2017-01-03 2017-05-31 努比亚技术有限公司 Data synchronization unit and its realize the method for data syn-chronization, client access system
CN106850852A (en) * 2017-03-20 2017-06-13 南京大学 A kind of private clound is based on the locally coherence Hash load-balancing method of dynamical feedback
CN106850852B (en) * 2017-03-20 2019-09-20 南京大学 A kind of locally coherence Hash load-balancing method of the private clound based on dynamical feedback
CN109426559A (en) * 2017-08-21 2019-03-05 北京国双科技有限公司 Order delivery method and device, storage medium, processor
CN109426559B (en) * 2017-08-21 2022-10-04 北京国双科技有限公司 Command issuing method and device, storage medium and processor
CN111970315A (en) * 2019-05-20 2020-11-20 北京车和家信息技术有限公司 Method, device and system for pushing message
CN112054985A (en) * 2019-06-06 2020-12-08 全球能源互联网研究院有限公司 Data interaction method and system for mobile terminal and field detection test equipment
CN112054985B (en) * 2019-06-06 2024-01-19 全球能源互联网研究院有限公司 Data interaction method and system for mobile terminal and field detection test equipment

Also Published As

Publication number Publication date
CN103024050B (en) 2015-11-25

Similar Documents

Publication Publication Date Title
CN103024052A (en) System and method for achieving browser data synchronization
CN103024050B (en) Distributor and the method that multiple server is distributed
CN102984278B (en) Realize the system and method that browser data synchronizes
US10187445B2 (en) System, method and browser client for enabling browser data synchronization
CN102984277B (en) Prevent the system and method that malice connects
CN102855152B (en) The method and system of resource file in upgrade applications
CN103973461A (en) Notification message pushing method and message server
CN109168054B (en) Display screen playing system and control method
CN104092792A (en) Method, system and client-side for achieving flow optimization based on domain name resolution request
CN103051740A (en) Domain name resolution method, domain name system (DNS) server and domain name resolution system
CN104506643A (en) Server of distributed storage system and data synchronizing method between servers
CN103841134A (en) API-based method for sending and receiving information, API-based apparatus, and API-based system
CN110727738B (en) Global routing system based on data fragmentation, electronic equipment and storage medium
CN103024049B (en) Realize the system that browser data is synchronous
CN109635039B (en) Multi-data center data synchronization method and system
CN103139761A (en) Information real-time show method and mobile communication terminal
CN103024051B (en) A kind of device, method and corresponding system carrying out server distribution
CN102984276B (en) For the distributor distributed multiple socket server and distribution method
CN109729116B (en) Plug-in information transmission method and device, storage medium and electronic device
CN101820431A (en) Communication client side and communication service initiation method
CN103064899B (en) A kind of distribution information database system
CN103036989B (en) Socket server and sockets services method
CN110798495A (en) Method and server for end-to-end message push in cluster architecture mode
CN110321252B (en) Skill service resource scheduling method and device
CN102663882B (en) Method and system for remotely controlling external screen through mobile terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220719

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.