CN106911739A - A kind of information dispensing method and device - Google Patents

A kind of information dispensing method and device Download PDF

Info

Publication number
CN106911739A
CN106911739A CN201510977373.9A CN201510977373A CN106911739A CN 106911739 A CN106911739 A CN 106911739A CN 201510977373 A CN201510977373 A CN 201510977373A CN 106911739 A CN106911739 A CN 106911739A
Authority
CN
China
Prior art keywords
predetermined quantity
communication connection
zookeeper
distributed
information
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
CN201510977373.9A
Other languages
Chinese (zh)
Other versions
CN106911739B (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.)
3600 Technology Group 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 CN201510977373.9A priority Critical patent/CN106911739B/en
Publication of CN106911739A publication Critical patent/CN106911739A/en
Application granted granted Critical
Publication of CN106911739B publication Critical patent/CN106911739B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1083In-session procedures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/45Exploiting coarse grain parallelism in compilation, i.e. parallelism between groups of instructions
    • G06F8/457Communication

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Multimedia (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of information dispensing method and device, larger load is brought to zookeeper for solving information ways of distribution of the prior art, have a strong impact on the problem of the process performance of zookeeper.The method includes:The communication connection foundation request that each process of service sends is provided in zookeeper the reception servers;Request is set up according to the communication connection for receiving, communication connection is set up with the process of predetermined quantity in each process, predetermined quantity is less than the process total quantity that service is provided on server;The incidence relation set up on server between the process and the process of predetermined quantity in each process of the service that provides beyond the process of predetermined quantity;By the communication connection set up, information to be distributed and the incidence relation set up are distributed to the process of predetermined quantity, so that the process of predetermined quantity is according to incidence relation, the process to the process context of predetermined quantity distributes information to be distributed.

Description

A kind of information dispensing method and device
Technical field
The present invention relates to areas of information technology, more particularly to a kind of information dispensing method and device.
Background technology
As the application on internet is using popularizing, the number of users of application is also greatly increased, single server It is remote not enough for large-scale user provides service, therefore, for any application on internet, generally can be with Using distributed system, service is provided together using multiple servers.There can be multiple on each server The process of service is provided, the process of each server is required for obtaining some customizing messages in the process of running, Customizing messages can include executable instruction information, configuration information, task schedule information, Service Source letter Breath etc., customizing messages can be changeless, or dynamic change.
In the prior art, generally customizing messages is managed collectively and is distributed using zookeeper, Zookeeper is a reliable coordination system for large-scale distributed system, there is provided function include:Letter Breath distribution, configuring maintenance, name Service, distributed synchronization, group service etc..Each enters in each server Journey sets up a communication connection to zookeeper requests, and after communication connection foundation, zookeeper then can be by The customizing messages (information referred to as to be distributed) preserved with is distributed to each process of each server.
But, due to being typically up to a hundred server common services in actual applications, each server is usual Up to a hundred processes that service is provided of operation, such as:If there is 100 servers to provide service together, each clothes When running 128 processes on business device, each process in each server sets up one with zookeeper Communication connection, needs to set up 12800 communication connections altogether, is treated to the distribution of each process for zookeeper Distribution information.As can be seen here, the mode of this information distribution brings larger load to zookeeper, sternly Ghost image rings the process performance of zookeeper.
The content of the invention
In view of the above problems, it is proposed that the present invention overcomes above mentioned problem or at least in part to provide one kind The information dispensing method and device for solving the above problems.
According to an aspect of the present invention, a kind of information dispensing method, server and zookeeper phases are proposed Connect, there are multiple processes that service is provided on the server, there is letter to be distributed on the zookeeper Breath, methods described includes:
The zookeeper receives the communication connection foundation request that each process sends;
The zookeeper sets up request according to the communication connection for receiving, with predetermined quantity in each process Process set up communication connection, the predetermined quantity is less than the process sum that service is provided on the server Amount;
The zookeeper sets up on the server entering for predetermined quantity described in each process of the service that provides Process beyond journey and the incidence relation between the process of the predetermined quantity;
The zookeeper is closed the information to be distributed and the association set up by the communication connection set up System is distributed to the process of the predetermined quantity, so that the process of the predetermined quantity is according to the incidence relation, Process to the process context of the predetermined quantity distributes the information to be distributed.
Alternatively, the zookeeper sets up request according to the communication connection for receiving, in each process After the process of predetermined quantity sets up communication connection, methods described also includes:
Predetermined quantity described in each process of service is provided on zookeeper refusal and the server Process beyond process sets up communication connection.
Alternatively, the zookeeper sets up on the server and make a reservation for described in each process of the service that provides Process beyond the process of quantity and the incidence relation between the process of the predetermined quantity, specifically include:
The zookeeper sets up request and the communication connection set up according to the communication connection for receiving, and determines institute State and process described in each process of service beyond the process of predetermined quantity is provided on server;
The zookeeper is performed for each process for determining:According to predetermined selection rule, from described At least one process is selected in the process of predetermined quantity, as the process with this process context for determining, and Set up incidence relation.
Alternatively, the communication connection that the zookeeper passes through foundation, by the information to be distributed and foundation Incidence relation be distributed to the process of the predetermined quantity so that the process of the predetermined quantity is according to the pass Connection relation, the process to the process context of the predetermined quantity distributes the information to be distributed, specifically includes:
The zookeeper is performed for each process in the process of the predetermined quantity:What is set up In incidence relation, it is determined that the incidence relation comprising this process, by the communication set up between this process Connection, is sent to this process, so that this process root by the incidence relation of determination and the information to be distributed According to the incidence relation of the determination, the information to be distributed is distributed to the process of this process context.
Alternatively, the communication connection is connected for long.
According to another aspect of the present invention, a kind of information distribution device, server and zookeeper are proposed It is connected with each other, there are multiple processes that service is provided on the server, has to be distributed on the zookeeper Information, described device is located on the zookeeper, and described device includes:
Receiver module, request is set up for receiving the communication connection that each process sends;
Link block, for setting up request according to the communication connection for receiving, with predetermined quantity in each process Process set up communication connection, the predetermined quantity is less than the process sum that service is provided on the server Amount;
Relating module, for setting up on the server entering for predetermined quantity described in each process of the service that provides Process beyond journey and the incidence relation between the process of the predetermined quantity;
Distribution module, for the communication connection by setting up, the information to be distributed and the association set up is closed System is distributed to the process of the predetermined quantity, so that the process of the predetermined quantity is according to the incidence relation, Process to the process context of the predetermined quantity distributes the information to be distributed.
Alternatively, the link block is additionally operable to:
Request is being set up according to the communication connection for receiving, is setting up logical with the process of predetermined quantity in each process After letter connection, provided on refusal and the server described in each process of service beyond the process of predetermined quantity Process set up communication connection.
Alternatively, the relating module specifically for:
Request and the communication connection set up are set up in communication connection according to receiving, determine to be provided on the server Process described in each process of service beyond the process of predetermined quantity;For each process for determining, perform: According to it is predetermined selection rule, at least one process is selected from the process of the predetermined quantity, as with determination This process context process, and set up incidence relation.
Alternatively, the distribution module specifically for:
For each process in the process of the predetermined quantity, perform:In the incidence relation set up, really Surely the incidence relation of this process is included, by the communication connection set up between this process, by what is determined Incidence relation and the information to be distributed are sent to this process, so that pass of this process according to the determination Connection relation, the information to be distributed is distributed to the process of this process context.
Alternatively, the communication connection is connected for long.
Scheme of the invention, provide that each process of service sends in zookeeper the reception servers is logical Request is set up in letter connection;The zookeeper according to receive communication connection set up request, with it is each it is described enter The process of predetermined quantity sets up communication connection in journey, and the predetermined quantity is less than on the server and provides service Process total quantity;The zookeeper sets up on the server pre- described in each process of the service that provides Process beyond the process of fixed number amount and the incidence relation between the process of the predetermined quantity;It is described Be distributed to for the information to be distributed and the incidence relation set up by the communication connection set up by zookeeper The process of the predetermined quantity, so that the process of the predetermined quantity is according to the incidence relation, to described pre- The process of the process context of fixed number amount distributes the information to be distributed.Zookeeper can only allow server On a part of process of offer service set up with zookeeper communicate to connect respectively, and by setting up communication link After this Partial Process for connecing receives the information to be distributed of zookeeper distributions, then zookeeper is helped to it He distributes information to be distributed at process, rather than whole processes of the offer service on picture in the prior art server Set up with zookeeper respectively and communicated to connect.Therefore, it can effectively mitigate the load of zookeeper, with And influence of the reduction to the process performance of zookeeper.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit are for ability Domain those of ordinary skill will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and simultaneously It is not considered as limitation of the present invention.And in whole accompanying drawing, identical is denoted by the same reference numerals Part.In the accompanying drawings:
Fig. 1 is the process according to the information dispensing method of one embodiment of the invention;
Fig. 2 is that based on a kind of practical application scene, zookeeper distributes to each fpm processes in the prior art The communication connection schematic diagram set up during information;
Fig. 3 is that, based on a kind of practical application scene, zookeeper is to each fpm processes in the solution of the present invention The communication connection schematic diagram set up during distribution information;
Fig. 4 is according to the information distribution device structural representation of one embodiment of the invention.
Specific embodiment
Exemplary embodiment disclosed by the invention is more fully described below with reference to accompanying drawings.Although showing in accompanying drawing Exemplary embodiment disclosed by the invention is shown, it being understood, however, that may be realized in various forms the present invention Without that should be limited by embodiments set forth here.Conversely, there is provided these embodiments are able to more thorough Ground understand the present invention, and can by scope disclosed by the invention it is complete convey to those skilled in the art Member.
Below in conjunction with accompanying drawing, the technical scheme that various embodiments of the present invention are provided is described in detail.
Fig. 1 is the process according to the information dispensing method of the embodiment of the present invention, and the executive agent of the process can be with It is zookeeper, zookeeper can (connection herein refers to thing with the interconnection of one or more servers Reason connection).The server can be Web server, application server etc., have multiple to carry on server For the process for servicing, by taking Web server as an example, its process for providing service can be fast page mode (fast Page mode, fpm) process etc..The present invention is not limited the type of server.
The upper customizing messages that can need to be distributed to each process for providing service on server of zookeeper (claims For:Information to be distributed), wherein, the information to be distributed can be with dynamic change, and this change can refer to increasing Amount changes, or in the change for directly being carried out to existing information.It should be noted that due to The server that zookeeper is connected with each other can with more than one, therefore, zookeeper can respectively for every Individual server performs the process in Fig. 1.The process in Fig. 1 is illustrated below.
Process in Fig. 1 may comprise steps of:
S101:The zookeeper receives the communication connection foundation request that each process sends.
In embodiments of the present invention, the information to be distributed on zookeeper need based on server with Communication connection distribution between zookeeper, these communication connections can be by providing service on server Each process sets up request by sending communication connection to zookeeper, what request was set up.
S102:The zookeeper sets up request according to the communication connection for receiving, pre- with each process The process of fixed number amount sets up communication connection, and the predetermined quantity is less than the process that service is provided on the server Total quantity.
In embodiments of the present invention, in order to mitigate the burden of zookeeper, zookeeper is receiving respectively to enter After request is set up in the communication connection that journey sends, request is set up in response to these communication connections, zookeeper can Selectively to distinguish with a part of process (that is, process of the predetermined quantity described in step S102) Communication connection is set up, communication connection is set up respectively rather than with whole processes.
In embodiments of the present invention, the mode of the process of pair determination predetermined quantity is not limited, and is below illustrated Several feasible modes are illustrated.
Zookeeper can be randomly chosen predetermined quantity in request is set up in each communication connection for receiving Communication connection set up request, and then set up the corresponding process of request with the communication connection selected and set up and communicate Connection;Or, zookeeper can also set up the reception time asked according to each communication connection, it is determined that Request is set up in the communication connection for going out startup time forward predetermined quantity, and then is built with the communication connection determined It is vertical to ask corresponding process to set up communication connection;Zookeeper can preset logical between server Believe the maximum quantity of connection, the maximum quantity is above-mentioned predetermined quantity, and then, at any time, clothes Can have up to be set up between the process of predetermined quantity and zookeeper on business device and have communication connection, and exceed When the process of predetermined quantity sets up communication connection to zookeeper requests, zookeeper can refuse the request.
In embodiments of the present invention, predetermined quantity minimum value is 1, and maximum is each for server providing services The total quantity of process subtracts 1.It is fewer with the process that zookeeper sets up communication connection when predetermined quantity is fewer, Beneficial effect is the burden that can more mitigate zookeeper, when predetermined quantity is more, is set up with zookeeper The process of communication connection is more, and beneficial effect is that the real-time of information distribution is better.Therefore, it can according to right The actual demand of this two classes benefit effect, determines predetermined quantity.
S103:The zookeeper sets up on the server predetermined number described in each process of the service that provides Process beyond the process of amount and the incidence relation between the process of the predetermined quantity.
In example in real time of the invention, zookeeper does not provide whole processes of service and sets up with server Communication connection, for this two classes process of the process for establishing communication connection and the process for not setting up communication connection, Zookeeper can take different modes to distribute information to be distributed to process.Wherein, communication link is established The process for connecing is:The process of predetermined quantity in each process of service is provided on server;Communication connection is not set up Process be:Process beyond the process of predetermined quantity in each process of service is provided on server.
For the process for establishing communication connection, zookeeper can directly be distributed by communication connection Information to be distributed.
For the process for not setting up communication connection, zookeeper can by the process for establishing communication connection, Distribute information to be distributed indirectly.In this case, zookeeper can be specified and be established communication connection Process distribute information to be distributed to one or more processes for not setting up communication connection, and then, establish logical Believe that after acquisition is distributed to the information to be distributed of oneself, can also be distributed to for information to be distributed by the process of connection The process of communication connection is not set up.Specifically, it is possible to use the incidence relation set up in step S103, it is real Existing this indirectly distribution procedure.
In embodiments of the present invention, the process context that zookeeper can not set up communication connection for each is extremely A few process for establishing communication connection, such that it is able to ensure that it is follow-up that each does not set up the process of communication connection Will be distributed and obtain information to be distributed;Zookeeper can be closed for each process for establishing communication connection Join one or more processes for not setting up communication connection, or, the process of communication connection is established for some, Zookeeper can not also be the process that its association does not set up communication connection.
S104:The communication connection that the zookeeper passes through foundation, by the information to be distributed and foundation Incidence relation is distributed to the process of the predetermined quantity, so that the process of the predetermined quantity is according to the association Relation, the process to the process context of the predetermined quantity distributes the information to be distributed.
By the above method, a part of process of the offer service on server is only allowed due to zookeeper Set up with zookeeper respectively and communicated to connect, and received by this Partial Process for setting up communication connection After the information to be distributed of zookeeper distributions, then zookeeper is helped to distribute information to be distributed to other processes, Whole processes rather than the offer service on picture in the prior art server set up logical with zookeeper respectively Letter connection.Therefore, it can effectively mitigate the load of zookeeper, and reduce the place to zookeeper The influence of rationality energy.
In order to make it easy to understand, further being illustrated to the step in Fig. 1 below.
According to one embodiment of the present of invention, for step S102, the zookeeper is logical according to what is received Request is set up in letter connection, after setting up communication connection with the process of predetermined quantity in each process, can also be held Row following steps:There is provided pre- described in each process of service on zookeeper refusal and the server Process beyond the process of fixed number amount sets up communication connection.After the step is performed, each process being rejected can be with The process that wait establishes communication connection distributes information to be distributed, rather than periodically to zookeeper weights Request is set up in hair communication connection, it is thus possible to prevent increase zookeeper treatment communication connections from setting up request Burden.
According to one embodiment of the present of invention, for step S103, the zookeeper sets up the service Process and the predetermined quantity described in each process of service beyond the process of predetermined quantity is provided on device Incidence relation between process, can specifically include:The zookeeper builds according to the communication connection for receiving Vertical request and the communication connection set up, determine to be provided on the server predetermined number described in each process of service Process beyond the process of amount;The zookeeper is performed for each process for determining:According to predetermined Selection rule, at least one process is selected from the process of the predetermined quantity, as with determine this enter The process of Cheng Guanlian, and set up incidence relation.
For example, when half of the predetermined quantity for process total quantity, communication connection can be established for each Process is respectively associated one and does not set up the process of communication connection, that is, making to provide respectively entering for service on server Process in journey beyond the process of predetermined quantity is associated correspondingly with the process of predetermined quantity.
Again for example, as predetermined quantity for process total quantity 1/3rd, communication can be established for each The process of connection is respectively associated two and does not set up the process of communication connection, that is, making to provide service on server Each process in predetermined quantity process beyond the process of process and predetermined quantity correspond.
It can be seen that, it is that each establishes entering for communication connection in each example in both the above example The quantity of the process for not setting up communication connection of Cheng Guanlian is identical, like this, subsequently establishes communication When the process of connection distributes information to be distributed to the process for not setting up communication connection associated with it, each foundation The burden of the process of communication connection is all to compare in a balanced way, is conducive to improving and does not set up respectively entering for communication connection Journey obtains the speed of information to be distributed.
According to one embodiment of the present of invention, for step S104, the zookeeper is logical by what is set up Letter connection, the information to be distributed and the incidence relation set up are distributed to the process of the predetermined quantity, with Make the process of the predetermined quantity according to the incidence relation, to the process of the process context of the predetermined quantity Distribute the information to be distributed, can specifically include:The zookeeper enters for the predetermined quantity Each process in journey, performs:In the incidence relation set up, it is determined that the incidence relation comprising this process, By the communication connection set up between this process, the incidence relation that will be determined and the information to be distributed are sent out This process is given, so that incidence relation of this process according to the determination, to entering for this process context Journey distributes the information to be distributed.
Further, establishing the process of communication connection can be based on the mode of interprocess communication, be associated to it The process for not setting up communication connection distribute information to be distributed.
The mode of interprocess communication can be specifically pipeline, message queue, semaphore, socket.Different The mode of interprocess communication goes for different application scene.Illustrate separately below.
For pipeline, Anonymous Pipes (Anonymous Pipe) and name pipeline (Named Pipe) can be divided into Two classes.Anonymous Pipes are a kind of semiduplex communication modes, data in Anonymous Pipes can only one-way flow, And, Anonymous Pipes can only have akin process (such as parent process and subprocess or same father Two subprocess of process) between use;Name pipeline is also semiduplex communication modes, but name pipeline Can be used between the process of affinity-less relation.Because each process major part of server providing services is all phase It is mutually independent, and without affiliation, therefore, compared to Anonymous Pipes, name pipeline is more suitable for this The scheme of invention.
For message queue, message queue is the chained list being made up of message, is stored in kernel and has message team Column identifier is identified, and message queue can dynamically expand, and advantage is big relativity of information, Er Qieke So that original form of the information of carrying is fully retained.Two side's processes are carrying out interprocess communication based on message queue When, information can be write in message queue by side's process, correspondingly, the opposing party's process can be from message The information of other side's process write-in is read in queue.
For semaphore, semaphore is a counter, and it can be used to control multiple processes to shared resource Access, shared resource can be the resource in multiple processes shared, local disk or shared drive.Letter Number amount can be as a kind of lock mechanism, by controlling multiple process operations (including reading and/or write operation) Shared resource realizes the communication between process, and a process operation shared resource is only allowed in the same time.
For socket, socket is based on Internet Protocol (Internet Protocol) address and application layer A kind of communication modes of port numbers.Socket had both gone between the different processes on same server Communication, be also applied for the communication between the different processes on different server.The advantage of socket is to enter What can be transmitted between journey is contained much information, and the machine of integrality and confidentiality can be provided for message transmitting procedure System.
The mode of the several interprocess communication suitable for the solution of the present invention is enumerated above.The side of semaphore Formula is generally required based on local disk or Sharing Memory Realization, the requirement of the mode of socket to server compared with Height, and pipeline and message queue are then limited without these, therefore, from from the point of view of implementation cost, can be with It is preferential that the solution of the present invention is implemented using pipeline or message queue.
According to one embodiment of the present of invention, each process that service is provided on server is finished in information distribution Afterwards, corresponding operation can be performed according to the type of the information of distribution.Such as, it is executable for distribution Command information (such as batch processing script), each process can perform the instruction included in executable instruction information; For configuration information, each process can load the configuration information and according to the configuration information operation of loading;Etc..
In the solution of the present invention, described communication connection can both be connected for long, or short connection.
Be the scene of connection long for communication connection, zookeeper after execution of step S101 and S102, Connection duration long (connection long needs connection creator actively to close, typically can be with last longer) It is interior, whenever renewal is had in be distributed on zookeeper, step a S103 and S104 can be performed, And without performing step S101 and S102 again again.
For communication connection for short connection scene, whenever it is to be distributed it is interior have renewal when, zookeeper is Need to re-execute a step S101~S104, because short connection is only effective in a distribution procedure, should At the end of secondary distribution procedure, short connection is automatically switched off.
As can be seen here, when the content update frequency to be distributed on zookeeper is higher, connection long is than short company Connect and be more suitable for the solution of the present invention, when the content update frequency to be distributed is higher relatively low, short connection is than company long Connect and be more suitable for the solution of the present invention.In actual applications, can be determined in step S102 according to concrete scene It is middle to set up connection long or short connection.
Fig. 1 has been described in detail above.In order to make it easy to understand, the present invention is also based on a kind of practical application Scene, is contrasted, as shown in Figure 2 and Figure 3 to the solution of the present invention with the scheme of prior art.
The practical application scene is illustrated first.In the practical application scene, Web server (can be with Have one or more, one be shown in which in this embodiment) it is connected with each other with zookeeper, Web service There are multiple fpm processes, the upper information to be distributed for being distributed to fpm processes in need of zookeeper on device.
Fig. 2 is that the communication connection set up when zookeeper distributes information to each fpm processes in the prior art is shown It is intended to.
In figure 2 it can be seen that zookeeper sets up with each the fpm process on Web server respectively One communicates to connect for distributing information.Therefore, zookeeper servers and each Web server it Between will for a long time maintain mass communication to connect, heavy load, influence process performance.
Fig. 3 is the communication link set up when zookeeper distributes information to each fpm processes in the solution of the present invention Connect schematic diagram.It is assumed that setting up the fpm processes of communication connection and the quantity of the fpm processes for not setting up communication connection It is identical, and set up each fpm processes of communication connection and do not set up each fpm processes one-to-one corresponding of communication connection Ground association.
Compared to Fig. 2, in figure 3, zookeeper only enters with the fpm of half quantity on Web server Journey (process of as heretofore described predetermined quantity) establishes communication connection.In depositing for communication connection In in the continuous time, can be responsible for obtaining information to be distributed from zookeeper by these fpm processes always, and The information to be distributed that will be obtained is distributed to the communication connection that do not set up of association by way of interprocess communication Fpm processes, zookeeper can complete the information distribution procedure of each process to providing service on server. As can be seen here, in compared to the prior art in Fig. 2, the solution of the present invention is effectively alleviated in Fig. 3 The burden of zookeeper, reduces the influence to the process performance of zookeeper.
It is above a kind of information dispensing method provided in an embodiment of the present invention, based on same invention thinking, this Inventive embodiments also provide a kind of information distribution device, as shown in Figure 4.
Fig. 4 is the information distribution device structural representation according to one embodiment of the invention, server with Zookeeper is connected with each other, and has multiple processes for providing service on the server, on the zookeeper There is information to be distributed, described device is located on the zookeeper, and described device includes:
Receiver module 401, request is set up for receiving the communication connection that each process sends;
Link block 402, it is predetermined with each process for setting up request according to the communication connection for receiving The process of quantity sets up communication connection, and the predetermined quantity is total less than the process that service is provided on the server Quantity;
Relating module 403, for setting up on the server predetermined quantity described in each process of the service that provides Process beyond process and the process of the predetermined quantity between incidence relation;
Distribution module 404, for the communication connection by setting up, by the information to be distributed and the pass set up Connection relation is distributed to the process of the predetermined quantity, so that the process of the predetermined quantity is closed according to the association System, the process to the process context of the predetermined quantity distributes the information to be distributed.
Alternatively, the link block 402 is additionally operable to:
Request is being set up according to the communication connection for receiving, is setting up logical with the process of predetermined quantity in each process After letter connection, provided on refusal and the server described in each process of service beyond the process of predetermined quantity Process set up communication connection.
Alternatively, the relating module 403 specifically for:
Request and the communication connection set up are set up in communication connection according to receiving, determine to be provided on the server Process described in each process of service beyond the process of predetermined quantity;For each process for determining, perform: According to it is predetermined selection rule, at least one process is selected from the process of the predetermined quantity, as with determination This process context process, and set up incidence relation.
Alternatively, the distribution module specifically for:
For each process in the process of the predetermined quantity, perform:In the incidence relation set up, really Surely the incidence relation of this process is included, by the communication connection set up between this process, by what is determined Incidence relation and the information to be distributed are sent to this process, so that pass of this process according to the determination Connection relation, the information to be distributed is distributed to the process of this process context.
Alternatively, the communication connection is connected for long.
By said apparatus, zookeeper can only allow a part of process of the offer service on server Set up with zookeeper respectively and communicated to connect, and received by this Partial Process for setting up communication connection After the information to be distributed of zookeeper distributions, then zookeeper is helped to distribute information to be distributed to other processes, Whole processes rather than the offer service on picture in the prior art server set up logical with zookeeper respectively Letter connection.Therefore, it can effectively mitigate the load of zookeeper, and reduce the place to zookeeper The influence of rationality energy.
Algorithm and display be not intrinsic with any certain computer, virtual system or miscellaneous equipment provided herein It is related.Various general-purpose systems can also be used together with based on teaching in this.As described above, structure It is obvious to make the structure required by this kind of system.Additionally, the present invention is not also directed to any certain programmed Language.It is understood that, it is possible to use various programming languages realize the content of invention described herein, and The description done to language-specific above is to disclose preferred forms of the invention.
In specification mentioned herein, numerous specific details are set forth.It is to be appreciated, however, that this hair Bright embodiment can be put into practice in the case of without these details.In some instances, not in detail Known method, structure and technology are shown, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help understand one in each inventive aspect or Multiple, in above to the description of exemplary embodiment of the invention, each feature of the invention is sometimes by one Rise and be grouped into single embodiment, figure or descriptions thereof.However, should not be by the method for the disclosure It is construed to reflect following intention:I.e. the present invention for required protection requirement ratio institute in each claim is clear and definite The more features of feature of record.More precisely, as the following claims reflect, hair Bright aspect is all features less than single embodiment disclosed above.Therefore, it then follows specific embodiment Claims be thus expressly incorporated in the specific embodiment, wherein each claim conduct in itself Separate embodiments of the invention.
Those skilled in the art be appreciated that the module in the equipment in embodiment can be carried out it is adaptive Change to answering property and they are arranged in one or more equipment different from the embodiment.Can be reality Apply module or unit or component in example and be combined into a module or unit or component, and in addition can be it Be divided into multiple submodule or subelement or sub-component.Except in such feature and/or process or unit It is at least some exclude each other outside, can using any combinations to this specification (including adjoint right will Ask, make a summary and accompanying drawing) disclosed in all features and so disclosed any method or equipment it is all Process or unit are combined.Unless expressly stated otherwise, this specification (including adjoint claim, Summary and accompanying drawing) disclosed in each feature can or similar purpose identical, equivalent by offer alternative features To replace.
Although additionally, it will be appreciated by those of skill in the art that some embodiments described herein include other Some included features are rather than further feature, but the combination meaning of the feature of different embodiments in embodiment Taste and is within the scope of the present invention and is formed different embodiments.For example, in following claim In book, the one of any of embodiment required for protection mode can use in any combination.
All parts embodiment of the invention can realize with hardware, or with one or more processor The software module of upper operation is realized, or is realized with combinations thereof.It will be understood by those of skill in the art that Can be realized using microprocessor or digital signal processor (DSP) in practice according to of the invention real Apply some or all parts in the equipment of the implantation information in the interception application program of example some or Repertoire.The present invention is also implemented as performing some or all of method as described herein Equipment or program of device (for example, computer program and computer program product).It is such to realize this The program of invention can be stored on a computer-readable medium, or can have one or more signal Form.Such signal can be downloaded from internet website and obtained, or be provided on carrier signal, or Person provides in any other form.
It should be noted that above-described embodiment the present invention will be described rather than limiting the invention, and And those skilled in the art can design replacement implementation without departing from the scope of the appended claims Example.In the claims, any reference symbol being located between bracket should not be configured to claim Limitation.Word "comprising" or " including " do not exclude the presence of element or step not listed in the claims. Word "a" or "an" before element does not exclude the presence of element as multiple.The present invention can To be realized by means of the hardware for including some different elements and by means of properly programmed computer. If in listing the unit claim of equipment for drying, several in these devices can be by same hard Part is embodied.The use of word first, second, and third does not indicate that any order.Can be by These words are construed to title.
The application can apply to computer system/server, and it can be with numerous other universal or special calculating System environment or configuration are operated together.It is suitable to the well-known calculating being used together with computer system/server The example of system, environment and/or configuration is included but is not limited to:Personal computer system, server computer system System, thin client, thick client computer, hand-held or laptop devices, the system based on microprocessor, Set Top Box, Programmable consumer electronics, NetPC Network PC, little types Ji calculate machine Xi Tong ﹑ large computer systems and bag Include distributed cloud computing technology environment of any of the above described system, etc..
Computer system/server can be (all in the computer system executable instruction performed by computer system Such as program module) describe under linguistic context.Generally, program module can include routine, program, target Program, component, logic, data structure etc., they perform specific task or realize specific abstract Data type.Computer system/server can be implemented in distributed cloud computing environment, distributed cloud computing In environment, task is performed by the remote processing devices by communication network links.In distributed cloud computing In environment, program module may be located on the Local or Remote computing system storage medium including storage device.

Claims (10)

1. a kind of information dispensing method, it is characterised in that server is connected with each other with zookeeper, described There are multiple processes that service is provided on server, there is information to be distributed, methods described on the zookeeper Including:
The zookeeper receives the communication connection foundation request that each process sends;
The zookeeper sets up request according to the communication connection for receiving, with predetermined quantity in each process Process set up communication connection, the predetermined quantity is less than the process sum that service is provided on the server Amount;
The zookeeper sets up on the server entering for predetermined quantity described in each process of the service that provides Process beyond journey and the incidence relation between the process of the predetermined quantity;
The zookeeper is closed the information to be distributed and the association set up by the communication connection set up System is distributed to the process of the predetermined quantity, so that the process of the predetermined quantity is according to the incidence relation, Process to the process context of the predetermined quantity distributes the information to be distributed.
2. method according to claim 1, it is characterised in that the zookeeper is according to receiving Request is set up in communication connection, after setting up communication connection with the process of predetermined quantity in each process, the side Method also includes:
Predetermined quantity described in each process of service is provided on zookeeper refusal and the server Process beyond process sets up communication connection.
3. method according to claim 1, it is characterised in that the zookeeper sets up the clothes Process and the predetermined quantity beyond the process of predetermined quantity described in each process of service are provided on business device Process between incidence relation, specifically include:
The zookeeper sets up request and the communication connection set up according to the communication connection for receiving, and determines institute State and process described in each process of service beyond the process of predetermined quantity is provided on server;
The zookeeper is performed for each process for determining:According to predetermined selection rule, from described At least one process is selected in the process of predetermined quantity, as the process with this process context for determining, and Set up incidence relation.
4. method according to claim 3, it is characterised in that the zookeeper is by setting up Communication connection, the information to be distributed and the incidence relation set up are distributed to the process of the predetermined quantity, So that the process of the predetermined quantity is according to the incidence relation, enter to the process context of the predetermined quantity Journey distributes the information to be distributed, specifically includes:
The zookeeper is performed for each process in the process of the predetermined quantity:What is set up In incidence relation, it is determined that the incidence relation comprising this process, by the communication set up between this process Connection, is sent to this process, so that this process root by the incidence relation of determination and the information to be distributed According to the incidence relation of the determination, the information to be distributed is distributed to the process of this process context.
5. the method according to any one of Claims 1 to 4, it is characterised in that the communication connection is Connection long.
6. a kind of information distribution device, it is characterised in that server is connected with each other with zookeeper, described There are multiple processes that service is provided on server, there is information to be distributed, described device on the zookeeper On the zookeeper, described device includes:
Receiver module, request is set up for receiving the communication connection that each process sends;
Link block, for setting up request according to the communication connection for receiving, with predetermined quantity in each process Process set up communication connection, the predetermined quantity is less than the process sum that service is provided on the server Amount;
Relating module, for setting up on the server entering for predetermined quantity described in each process of the service that provides Process beyond journey and the incidence relation between the process of the predetermined quantity;
Distribution module, for the communication connection by setting up, the information to be distributed and the association set up is closed System is distributed to the process of the predetermined quantity, so that the process of the predetermined quantity is according to the incidence relation, Process to the process context of the predetermined quantity distributes the information to be distributed.
7. device according to claim 6, it is characterised in that the link block is additionally operable to:
Request is being set up according to the communication connection for receiving, is setting up logical with the process of predetermined quantity in each process After letter connection, provided on refusal and the server described in each process of service beyond the process of predetermined quantity Process set up communication connection.
8. device according to claim 6, it is characterised in that the relating module specifically for:
Request and the communication connection set up are set up in communication connection according to receiving, determine to be provided on the server Process described in each process of service beyond the process of predetermined quantity;For each process for determining, perform: According to it is predetermined selection rule, at least one process is selected from the process of the predetermined quantity, as with determination This process context process, and set up incidence relation.
9. device according to claim 8, it is characterised in that the distribution module specifically for:
For each process in the process of the predetermined quantity, perform:In the incidence relation set up, really Surely the incidence relation of this process is included, by the communication connection set up between this process, by what is determined Incidence relation and the information to be distributed are sent to this process, so that pass of this process according to the determination Connection relation, the information to be distributed is distributed to the process of this process context.
10. the device according to any one of claim 6~9, it is characterised in that the communication connection is Connection long.
CN201510977373.9A 2015-12-23 2015-12-23 Information distribution method and device Active CN106911739B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510977373.9A CN106911739B (en) 2015-12-23 2015-12-23 Information distribution method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510977373.9A CN106911739B (en) 2015-12-23 2015-12-23 Information distribution method and device

Publications (2)

Publication Number Publication Date
CN106911739A true CN106911739A (en) 2017-06-30
CN106911739B CN106911739B (en) 2020-02-07

Family

ID=59199444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510977373.9A Active CN106911739B (en) 2015-12-23 2015-12-23 Information distribution method and device

Country Status (1)

Country Link
CN (1) CN106911739B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108363619A (en) * 2018-03-07 2018-08-03 深圳市酷开网络科技有限公司 Service procedure control method, server and computer readable storage medium
CN111131515A (en) * 2019-12-31 2020-05-08 武汉市烽视威科技有限公司 CDN edge injection distribution method and system
CN112769900A (en) * 2020-12-22 2021-05-07 中冶赛迪重庆信息技术有限公司 Data distribution method, system, medium and electronic terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103034541A (en) * 2012-11-16 2013-04-10 北京奇虎科技有限公司 Distributing type information system and equipment and method thereof
CN104090886A (en) * 2013-12-09 2014-10-08 深圳市腾讯计算机系统有限公司 Method and device for constructing real-time portrayal of user
US20150081625A1 (en) * 2012-09-19 2015-03-19 Tencent Technology (Shenzhen) Company Limited Service polling method and system, and computer storage medium
CN104618466A (en) * 2015-01-20 2015-05-13 上海交通大学 System for balancing load and controlling overload based on message transfer and control method of system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150081625A1 (en) * 2012-09-19 2015-03-19 Tencent Technology (Shenzhen) Company Limited Service polling method and system, and computer storage medium
CN103034541A (en) * 2012-11-16 2013-04-10 北京奇虎科技有限公司 Distributing type information system and equipment and method thereof
CN104090886A (en) * 2013-12-09 2014-10-08 深圳市腾讯计算机系统有限公司 Method and device for constructing real-time portrayal of user
CN104618466A (en) * 2015-01-20 2015-05-13 上海交通大学 System for balancing load and controlling overload based on message transfer and control method of system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108363619A (en) * 2018-03-07 2018-08-03 深圳市酷开网络科技有限公司 Service procedure control method, server and computer readable storage medium
CN111131515A (en) * 2019-12-31 2020-05-08 武汉市烽视威科技有限公司 CDN edge injection distribution method and system
CN111131515B (en) * 2019-12-31 2022-07-15 武汉市烽视威科技有限公司 CDN edge injection distribution method and system
CN112769900A (en) * 2020-12-22 2021-05-07 中冶赛迪重庆信息技术有限公司 Data distribution method, system, medium and electronic terminal

Also Published As

Publication number Publication date
CN106911739B (en) 2020-02-07

Similar Documents

Publication Publication Date Title
CN105378659B (en) Client device is set to be able to access that the method and system of remote desktop
Sehgal et al. Cloud computing
US9088622B2 (en) Dynamic client registration for server push events in long polling scenarios
CN103942087B (en) Live migration of virtual machine method and relevant apparatus and group system
CN102638475A (en) Multi-dimensional intelligent service point virtual desktop method and infrastructure
Murah Teaching and learning cloud computing
CN108718337B (en) Website account login, verification and verification information processing method, device and system
US10135763B2 (en) System and method for secure and efficient communication within an organization
CN103377402A (en) Multi-user analysis system and corresponding apparatus and method
CN108156232A (en) Data sharing method and device
WO2015167587A1 (en) Determining application deployment recommendations
Mohammed et al. Drivers of cloud computing adoption for E-government services implementation
CN109525592A (en) Data sharing method, device, equipment and computer readable storage medium
CN106911739A (en) A kind of information dispensing method and device
CN110166541A (en) Rendering method, relevant device and system based on block chain
KR20200093089A (en) System and method for transaction of work requests and products based on blockchain
US20210019158A1 (en) Systems and methods to convert mobile applications to distributed platforms
CN106202074A (en) A kind of method and device processing shared file
CN110083341A (en) A kind of front end development platform, front end development approach and page display method
US10015086B2 (en) Multi GTM based routing to avoid latencies
Orduña et al. Exploring students collaboration in remote laboratory infrastructures
CN104951238A (en) Method and device for managing data storage in distributed virtual environment
US20140189134A1 (en) System and Method for NAS Server Test Load Generation
EP3276914A1 (en) Data sharing method and device for virtual desktop
CN106909464A (en) A kind of information synchronization method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220818

Address after: No. 9-3-401, No. 39, Gaoxin 6th Road, Binhai Science and Technology Park, High-tech Zone, Binhai New District, Tianjin 300000

Patentee after: 3600 Technology Group 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.

TR01 Transfer of patent right