CN106326020B - Applied to the distributed communication system and method on static cluster - Google Patents

Applied to the distributed communication system and method on static cluster Download PDF

Info

Publication number
CN106326020B
CN106326020B CN201610713201.5A CN201610713201A CN106326020B CN 106326020 B CN106326020 B CN 106326020B CN 201610713201 A CN201610713201 A CN 201610713201A CN 106326020 B CN106326020 B CN 106326020B
Authority
CN
China
Prior art keywords
angel
application service
service process
service processes
service
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.)
Active
Application number
CN201610713201.5A
Other languages
Chinese (zh)
Other versions
CN106326020A (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.)
Zhejiang Supcon Information Industry Co Ltd
Original Assignee
ZHEJIANG SUPCON INFORMATION 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 ZHEJIANG SUPCON INFORMATION CO Ltd filed Critical ZHEJIANG SUPCON INFORMATION CO Ltd
Priority to CN201610713201.5A priority Critical patent/CN106326020B/en
Publication of CN106326020A publication Critical patent/CN106326020A/en
Application granted granted Critical
Publication of CN106326020B publication Critical patent/CN106326020B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • 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

Abstract

The invention discloses a kind of distributed communication systems and method applied on static cluster, it is including N platform host, on the static cluster of m application service process, the distributed communication system for serving the static state cluster includes angel's service processes on every host, very fast repository and m angel's client library;Each application service process adjusts corresponding angel's client library, and angel's service processes and each application service process are connect with very fast repository, and angel's service processes are connect with each application service process respectively, N >=1, m >=2;The present invention has the characteristics that simple, high-efficient in face of static cluster environment, realization.

Description

Applied to the distributed communication system and method on static cluster
Technical field
The present invention relates to a kind of distributed communication middleware Technologies, can be in more larger masters more particularly, to one kind On machine, it is multiple should have the distributed communication system being applied on static cluster being in communication with each other in program using Service name and Method.
Background technique
In traditional information system, as information-based gos deep into, the scale of information system is constantly expanding.For example, Software towards transportation industry, because of the reasons such as the continuous construction of route, information-based demand go deep into, to interconnect, system Scale constantly expands, and the host scale for needing to be in communication with each other has been even up to thousand ranks.In order to solve the logical of large-scale cluster Letter problem produces Distributed Message Queue technology.But the realization of Distributed Message Queue technology is largely towards interconnection The open source of net industry realizes, be applied to traditional industries software can functional, performance, O&M, authorized agreement a series of problems, such as.
With the development of business, system scale constantly expands, the features such as showing distributed and cluster.It is a part of in system Business module needs to form a cluster using multiple host could finishing service.Another part business module needs are distributed in more It works on platform host or even on more ground multiple host, host not only needs to be in communication with each other, but also cannot be because of local or big It goes wrong and influences other parts in part.Under such technical need background, if continuing to use traditional client, service Traffic model is held to carry out software development, design, exploitation, the difficulty of maintenance are all very huge.
Summary of the invention
Goal of the invention of the invention is to be distributed in certain scale master under existing business demand in the prior art to overcome Multiple application programs on machine can not carry out the deficiency of high performance communication, and providing one kind can be in larger multiple host On, the distributed communication system on static cluster being in communication with each other in multiple application processes using Service name and side Method.
To achieve the goals above, the invention adopts the following technical scheme:
A kind of distributed communication system applied on static cluster is including N platform host, m application service process On static cluster, the distributed communication system for serving the static state cluster includes angel's service processes on every host, Very fast repository and m angel's client library;Each application service process adjusts corresponding angel's client library, angel's service Process and each application service process are connect with very fast repository, and angel's service processes connect with each application service process respectively It connects, N >=1, m >=2;
Application service process information table and angel's service processes information table are equipped in very fast repository;
Application service process information table is made of 4 fields, and 4 fields are respectively application service process Service name, application Service processes number, the corresponding angel's service processes number of application service process and application service process presence;Wherein, it answers It is the major key of application service process information table with service processes Service name;Application service process presence field is dynamic word Section, application service process are updated according to the connection status between application service process and angel's service processes, other fields It is static fields;
Angel's service processes information table is made of 5 fields, and 5 fields are respectively angel's service processes address information, day Service processes are numbered, the attached application service process Base Serial Number of angel's service processes, the attached application service of angel's service processes Process number and angel's service processes presence;Angel's service processes address information is the master of angel's service processes information table Key, angel's service processes are dynamic field, and angel's service processes presence is according to local angel's service processes and other angels Connection status between service processes is updated, while what is updated includes that the attached application service process of angel's service processes exists Linear state.
What the present invention solved that multiple application programs for being distributed on certain scale host carry out that high-performance is in communication with each other asks Topic, provide it is a kind of on larger multiple host, it is multiple to there is program to can be used during Service name is in communication with each other Between part system.The present invention uses simply, to user friendly.
When an application service process needs are communicated with multiple application service process, if using client End, server-side model, application service process needs to manage multiple connections, complicated for operation, and the application being in communication with each other with needs Service processes quantity increases, and develops complexity rapid increase;If this application clothes for needing to be in communication with each other in entire cluster Number of processes of being engaged in is especially more, will consume more system resource.
Relative to client, server-side traffic model, the present invention can be communicated according to Service name.
Existing open source message technology only supports the cluster of three hosts or more substantially;Message queue technology of increasing income is in cluster Middle N/2+1 platform machine just not can be carried out communication when there is network failure or hostdown;Message queue technology of increasing income is in cluster When scale is increasing, decline is presented in communication efficiency;Message queue technology of increasing income is when cluster divides, in minority Host cannot use message queue;The problem of open source message queue is faced in accordance with open source protocol, needs in face of dynamic cluster skill Art, implementation complexity height, low efficiency,
Relative to open source message queue technology, the present invention is adapted to one, two cluster for arriving multiple host, in cluster When scale becomes larger, communication efficiency keeps stablizing;It can still be communicated between a small number of hosts;The present invention faces static set group rings Border is realized simply, high-efficient.
A method of applied to the distributed communication system on static cluster, the insertion process including relation table: relationship Table is application service process information table or angel's service processes information table;
Step 1: major key content is taken out from the row content for want inserting line;
Step 2: Hash calculation being carried out to major key, obtains cryptographic Hash;
Step 3: being found in Hash area and be transferred to step if the node is not used with the position of cryptographic Hash corresponding node Rapid 4, if the node is used, it is transferred to step 6;
Step 4: nodal information being written in node, nodal information includes major key, line number and the offset of next node;Wherein, Line number is to be inserted into line number in the gauge outfit of relation table, and gauge outfit includes number of lines;
Step 5: the write-in of row content being inserted into the row of line number, line number is inserted into and adds 1;
Step 6: according to next node offset information in nodal information, next node is successively found, until next Node offset is -1, is changed to the offset of zipper domain enabled node for -1, on the position of zipper domain available offsets, write-in node letter Breath, by zipper domain available offsets number plus 1;
Step 7: the write-in of row content being inserted into the row of line number, line number is inserted into and adds 1;
Wherein, Hash calculation includes the following steps:
Step 1: Hash being carried out to major key using common hash algorithm, obtains an integer;
Step 2: by integer to number of lines remainder, obtaining a cryptographic Hash.
Preferably, further including the process of inquiry:
Step 1: Hash calculation being carried out to inquiry major key, obtains cryptographic Hash;
Step 2: finding the position with cryptographic Hash corresponding node, the major key content and inquiry major key of comparison node in Hash area Whether content is identical, and the row number information recorded in node is taken when identical;When not identical, the offset of next node is taken;
Step 3: according to the offset of next node, successively whether the major key of comparison node and inquiry major key are identical, until Identical node is found, the row number information recorded in the node is taken;
Step 4: if not finding row number information, inquiry failure;
Wherein, Hash calculation includes the following steps:
Step 1: Hash being carried out to major key using common hash algorithm, obtains an integer;
Step 2: by integer to number of lines remainder, obtaining a cryptographic Hash.
Preferably, further including the synchronous triggering step of presence:
Step 1: taking present system time, present system time is subtracted to last system time, obtains the time difference;
If time difference > 1 second, being transferred to step 2;
If time difference≤1 second, sleep 100 milliseconds, circulation executes step 1;
Whether step 2: whether detecting event trigger flag is 1, or to synchronizing cycle;If so, being transferred to step 3; Otherwise, step 2 is continued to execute;
Step 3: event trigger flag being revised as 0, executes presence synchronizing process;
Step 4: by last system time be assigned a value of obtain present system time, will be assigned a value of cycle time be currently The system time adds periodic quantity, continues to execute step 1.
Preferably, further including presence synchronizing process:
Step 1: angel's service processes read from very fast repository the application service process for being attached to oneself in threadiness State;
Step 2: angel's service processes compress the presence for being attached to the application service process of oneself, constitute one A presence updates packet;
Step 3: sending the online of oneself attached application service process to angel's service processes of other All hosts State updates packet;
Step 4: receiving presence and update the angel's service processes wrapped, decompression presence updates packet, and modification is originally The very fast repository on ground.
Preferably, further including application service process login process:
Step 1: on host i, application service process j is logged on angel's service processes i, and application service process j is called The login interface of angel's client library is passed to the Service name jX of oneself;I=1,2 ..., N;J=1,2 ..., m;
Step 2: angel's service processes i is connected to application service process j logging request, and it is local to inquire inquiry according to Service name j Very fast repository;
If found inside very fast repository, there are the configurations of the service, return to the number and login of application service process j Successful information, the logging state for modifying application service process j in very fast repository are to have logged on, and are transferred to step 3;
If do not found inside very fast repository, there are the configurations of the service, return to the information of -1 and login failure;
Step 3: the logging state of application service process j is broadcast to angel's service processes 2 by angel's service processes i To N;
Angel's service processes 2 receive the logging state of application service process j to angel's service processes N, are transferred to step respectively Rapid 4;
Step 4: angel's service processes 2 to angel's service processes N the logging state of application service process j are written local Very fast repository.
Preferably, further including communication process between application service process:
Application service process j sends a message to application service process k;K=1,2 ..., m;k≠j;
Step 1: application service process j is by local very fast repository, according to the Service name of application service process k, inquiry The number and presence of application service process k;If inquiring the online of the number of application service process and application service process State be it is online, be transferred to step 2;Conversely, returning to failure information, sign off;
Step 2: application service process j constructs message package, sends the message package to angel's service processes i;
Step 3: angel's service processes i receives the message package, according to the message package packet header content, inquires very fast repository, The target angel process N that forward is found, and inquires the presence of target angel's process N;
Step 4: message package is sent to angel's service processes N by angel's service processes i;
Step 5: angel's service processes N receives the message package, according to the message package packet header content, inquires very fast repository, Find application service process k;
Step 6: message package is sent to application service process k by angel's service processes N.
Therefore, the invention has the following beneficial effects: one, two cluster for arriving multiple host is adapted to, in cluster When scale becomes larger, communication efficiency keeps stablizing;When static cluster breaks down, even if fault coverage relates to most of master Machine can still communicate between the hosts that are not involved of minority;The present invention faces static cluster environment, realizes simply, high-efficient.
Detailed description of the invention
Fig. 1 is a kind of structural schematic diagram of the invention;
Fig. 2 is a kind of structure chart of very fast repository of the invention;
Fig. 3 is a kind of structure chart of the gauge outfit of very fast repository of the invention;
A kind of schematic diagram of the index structure of table and indexing means in very fast repository Fig. 4 of the invention;
A kind of distribution mode figure of table data in very fast repository Fig. 5 of the invention;
Fig. 6 is a kind of structure chart of reciprocity radial network of the invention;
Fig. 7 is a kind of cycle synchronisation procedure chart of application service process presence of the invention;
A kind of clearly demarcated fail-safe analysis figure under network fragmentation condition of Fig. 8 sheet;
Fig. 9 is a kind of figure of angel's client library interface of the invention.
In figure: host 2, angel's service processes 21, very fast repository 22, application service process 23, angel's client library 24.
Specific embodiment
The present invention will be further described with reference to the accompanying drawings and detailed description.
Embodiment as shown in Figure 1 is a kind of distributed communication system applied on static cluster, is including N platform host On the static cluster of 2,20 application service process 23, the distributed communication system for serving the static state cluster includes being set to every Angel's service processes 21 on host, very fast repository 22 and 20 angel client library 24;20 application service process difference 20 angel's client libraries are called, angel's service processes and each application service process call very fast repository, angel's service Process is connect with each application service process respectively;
As shown in Fig. 2, being equipped with application service process information table and angel's service processes information table in very fast repository;
Application service process information table is made of 4 fields, and 4 fields are respectively application service process Service name, application Service processes number, the corresponding angel's service processes number of application service process and application service process presence;Wherein, it answers It is the major key of application service process information table with service processes Service name;Application service process presence field is dynamic word Section can be updated according to the connection status between application service process and angel's service processes;
Other fields are static fields;Static fields are when a static cluster determines just it has been determined that will not In runtime dynamic change.Application service process Service name can carry out quick search according to Service name.Application service process Number uses continuous number serial number, corresponds to line number of the application service process in application service process information table, and will be same Application service process serial number on one host.Only application service process presence be according to the actual situation dynamic more New field.
Angel's service processes information table is made of 5 fields, and 5 fields are respectively angel's service processes address information, day Service processes are numbered, the attached application service process Base Serial Number of angel's service processes, the attached application service of angel's service processes Process number and angel's service processes presence;Angel's service processes address information is the master of angel's service processes information table Key, can be according to address quick search.Angel's service processes number uses continuous number serial number, corresponding angel's service processes The line number of information table.Angel's service processes address information is major key,
The attached application service process of angel's service processes be with angel's service processes on same host, use angel Client library is connected directly between the application service process on angel's service processes.Angel's service processes are dynamic field, angel's clothes Business process presence is updated according to the connection status between local angel's service processes and other angel's service processes , while what is updated includes the attached application service process presence of angel's service processes.
Presence field in two tables is dynamic change, but is changed infrequently, and a table of bytes is used in table To show presence, while indicating online using 0, other any values indicate offline, so variation field is not necessarily to lock, entire pole Fast repository change can be used to be designed without lock.Very fast repository is realized using shared drive, and use is designed without lock, according to These characteristics, very fast repository can provide the access speed of memory hierarchy.
As shown in figs. 3 and 5, further include the insertion process of relation table:
Step 1: major key content is taken out from the row content for want inserting line;
Step 2: Hash calculation being carried out to major key, obtains cryptographic Hash;
Step 3: being found in Hash area and be transferred to step if the node is not used with the position of cryptographic Hash corresponding node Rapid 4, if the node is used, it is transferred to step 6;
Step 4: nodal information being written in node, nodal information includes major key, line number and the offset of next node;Wherein, Line number is to be inserted into line number in the gauge outfit of relation table, and gauge outfit includes number of lines;
Step 5: the write-in of row content being inserted into the row of line number, line number is inserted into and adds 1;
Step 6: according to next node offset information in nodal information, next node is successively found, until next Node offset is -1, is changed to the offset of zipper domain enabled node for -1, on the position of zipper domain available offsets, write-in node letter Breath, by zipper domain available offsets number plus 1;
Step 7: the write-in of row content being inserted into the row of line number, line number is inserted into and adds 1;
Wherein, Hash calculation includes the following steps:
Step 1: Hash being carried out to major key using common hash algorithm, obtains an integer;
Step 2: by integer to number of lines remainder, obtaining a cryptographic Hash.
As shown in Figure 4, Figure 5, further include the process of inquiry:
Step 1: Hash calculation being carried out to inquiry major key, obtains cryptographic Hash;
Step 2: finding the position with cryptographic Hash corresponding node, the major key content and inquiry major key of comparison node in Hash area Whether content is identical, and the row number information recorded in node is taken when identical;When not identical, the offset of next node is taken;
Step 3: according to the offset of next node, successively whether the major key of comparison node and inquiry major key are identical, until Identical node is found, the row number information recorded in the node is taken;
Step 4: if not finding row number information, inquiry failure;
Wherein, Hash calculation includes the following steps:
Step 1: Hash being carried out to major key using common hash algorithm, obtains an integer;
Step 2: by integer to number of lines remainder, obtaining a cryptographic Hash.
As shown in fig. 6, the angel's service processes being distributed on each machine in the cluster are all connected on other All hosts Angel's service processes, constitute the network structure of radiation shapes all reciprocity on an each host.1st angel's service processes While connecting the 2nd angel's service processes to N angel's service processes, the 2nd angel's service processes are received to N angel service The connection of process.
The linking number of each angel's service processes management is 2* (N-1) on reciprocity radial network;Any two masters Machine is all directly connected to using angel's service processes;Any two are distributed in the communication between the application service process on different hosts It is all to be forwarded communication using angel's service processes between two hosts.In the network structure of reciprocity radial network, do not have There is any one angel's service processes node that can become performance bottleneck, also none angel's service processes can become main section Point, and influence the communication between incoherent application service process.Due to the speed with network communication communicated between local process Compared to being very quick, so local angel's service processes will not become the bottleneck of application service process communication, because more First reach bottleneck is network communication speed.If reach the speed bottle-neck of network communication, even if using client, server-side Conventional communication mode can not improve speed.
The synchronous triggering mode of presence is divided into two kinds:
It is synchronous that period triggers presence;
It is synchronous that event triggers presence.The period presence of triggering is synchronous, is the appearance to prevent abnormal conditions, and one Kind can be from selfreparing strategy under any error situation.Regardless of occur it is any it is not expected that exception, as long as by a week Phase, system can be restored from mistake, and returning to normally can operating status.It being executed once every a cycle, the period is configurable, Most short cycle one second.The presence of event triggering is synchronous, is to call login interface, calling to publish and connect in application service process Mouth, exception exit in the case of three kinds, and modification is 1 (note that not being that the direct presence that triggers synchronizes) in event trigger flag.Two Kind triggering mode is combined together, and obtains the synchronous triggering step of following presences.
As shown in fig. 7, further including the synchronous triggering step of presence:
Step 1: taking present system time, present system time is subtracted to last system time, obtains the time difference;
If time difference > 1 second, being transferred to step 2;
If time difference≤1 second, sleep 100 milliseconds, circulation executes step 1;
Whether step 2: whether detecting event trigger flag is 1, or to synchronizing cycle;If so, being transferred to step 3; Otherwise, step 2 is continued to execute;
Step 3: event trigger flag being revised as 0, executes presence synchronizing process;
Step 4: by last system time be assigned a value of obtain present system time, will be assigned a value of cycle time be currently The system time adds periodic quantity, continues to execute step 1.
It is handled as can be seen that event triggered fashion is merged into period triggering mode, event triggering occurs When, only modify event trigger flag.The advantage of doing so is that calling the events such as login interface application service process occurs When, after most 1 seconds, the presence of application service process will be synchronized, and maintain the sensitivity of system.And it avoids If certain application service process be abnormal or other situations caused by frequently log in, publish calling, lead to presence Synchronization is too frequent, to impact whole system.Because trigger event frequently occurs anyway, presence synchronizing process is most Triggering mostly per second is primary.
Further include presence synchronizing process:
Step 1: angel's service processes read from very fast repository the application service process for being attached to oneself in threadiness State;
Step 2: angel's service processes compress the presence for being attached to the application service process of oneself, constitute one A presence updates packet;
Step 3: sending the online of oneself attached application service process to angel's service processes of other All hosts State updates packet;
Step 4: receiving presence and update the angel's service processes wrapped, decompression presence updates packet, and modification is originally The very fast repository on ground.
The method of compression is as follows: because being attached to multiple applications of same angel's service processes the characteristics of static cluster Service processes are that continuously, a character array, which can be used, indicates presence, and character array is every in sequence in number Each of one byte corresponds to the presence of an application service process.Due to having had angel's service in very fast repository The Base Serial Number and number of the corresponding application service process of process both can be into so do not need to transmit additional other information Row decompression.Such as 1 attached 5 application service process of angel's service processes, a byte have 8 bits, use a word Section can indicate the presence of 5 application service process.Using above-mentioned compression method, few byte, table can be used Show more information.
Using the synchronous method of application service process presence of the invention, in 1000 hosts, every host On the static cluster of upper 80 application service process, use 10 seconds for a cycle.During system stable operation, each master Synchronizing consumed network bandwidth on machine for holding application service process presence is 1000 byte per second (calculation methods (80/8*1000)/10), the system-computed for being 100,000,000 according to bandwidth, the resource of loss only has insufficient a ten thousandth.Even if being For system thoroughly during upheaval, consumed maximum bandwidth also only has 10000 byte per seconds, also divides less than thousand according to 100,000,000 system-computeds One of, moreover such case hardly occurs.So using this synchronous method, it is very small for the loss of resource, it is synchronous Velocity-stabilization, and have self-reparing capability, can restore from mistake.
Further include application service process login process:
Step 1: on host i, application service process j is logged on angel's service processes i, and application service process j is called The login interface of angel's client library is passed to the Service name jX of oneself;I=1,2 ..., N;J=1,2 ..., m;
Step 2: angel's service processes i is connected to application service process j logging request, and it is local to inquire inquiry according to Service name j Very fast repository;
If found inside very fast repository, there are the configurations of the service, return to the number and login of application service process j Successful information, the logging state for modifying application service process j in very fast repository are to have logged on, and are transferred to step 3;
If do not found inside very fast repository, there are the configurations of the service, return to the information of -1 and login failure;
Step 3: the logging state of application service process j is broadcast to angel's service processes 2 by angel's service processes i To N;
Angel's service processes 2 receive the logging state of application service process j to angel's service processes N, are transferred to step respectively Rapid 4;
Step 4: angel's service processes 2 to angel's service processes N the logging state of application service process j are written local Very fast repository.
Further include communication process between application service process:
Application service process j sends a message to application service process k;K=1,2 ..., m;k≠j;
Step 1: application service process j is by local very fast repository, according to the Service name of application service process k, inquiry The number and presence of application service process k;If inquiring the online of the number of application service process and application service process State be it is online, be transferred to step 2;Conversely, returning to failure information, sign off;
Step 2: application service process j constructs message package, sends the message package to angel's service processes i;
Step 3: angel's service processes i receives the message package, according to the message package packet header content, inquires very fast repository, The target angel process N that forward is found, and inquires the presence of target angel's process N;
Step 4: message package is sent to angel's service processes N by angel's service processes i;
Step 5: angel's service processes N receives the message package, according to the message package packet header content, inquires very fast repository, Find application service process k;
Step 6: message package is sent to application service process k by angel's service processes N.
As shown in figure 8, causing to divide into group, 2 and 3 two parts being split into, in such case because of network failure Under, this communication middleware still can be used.
When there is division as shown in Figure 8, if using open source message queue technology, below half number of host Be 2, it is impossible to communicated, above number of host be 3, can communicate.If there is a host event again in top half Barrier, top half can not be communicated.
If upper left application service process is X, the application service process in upper right side is Y, the application service of lower left into Journey is F, and the application service process of lower right is G;
This problem is not present in the present invention, can communicate, answers between application service process X and application service process Y It also can communicate with service processes F and application service process G.Application service process X not can be carried out with application service process F The reason of communication is that do not have connectivity physically because of network or hardware fault, and unrelated with communication middleware, communication is intermediate Part provides the reliability of maximum possible.This example is to enumerate the reliability of this communication middleware under one of fault condition, Other similar situation will not enumerate with failure.
As shown in figure 9, angel's client library provides service login, publishes, message transmission, message sink is adjusted back four and is connect Mouthful, and only there are four interfaces, provide simple usage mode to application service process.
It should be understood that this embodiment is only used to illustrate the invention but not to limit the scope of the invention.In addition, it should also be understood that, After having read the content of the invention lectured, those skilled in the art can make various modifications or changes to the present invention, these etc. Valence form is also fallen within the scope of the appended claims of the present application.

Claims (4)

1. a kind of method applied to the distributed communication system on static cluster, characterized in that applied on static cluster Distributed communication system includes N platform host (2), on the static cluster of m application service process (23), serves the static state cluster Distributed communication system include angel's service processes (21) on every host, very fast repository (22) and m angel Client library (24);Each application service process calls corresponding angel's client library, angel's service processes and each application Service processes are connect with very fast repository, and angel's service processes are connect with each application service process respectively, N >=1, m >=2;
Application service process information table and angel's service processes information table are equipped in very fast repository;
Application service process information table is made of 4 fields, and 4 fields are respectively application service process Service name, application service Process number, the corresponding angel's service processes number of application service process and application service process presence;Wherein, using clothes Business process Service name is the major key of application service process information table;Application service process presence field is dynamic field, is answered It is updated with service processes according to the connection status between application service process and angel's service processes, other fields are quiet State field;
Angel's service processes information table is made of 5 fields, and 5 fields are respectively angel's service processes address information, angel's clothes Business process number, the attached application service process Base Serial Number of angel's service processes, the attached application service process of angel's service processes Number and angel's service processes presence;Angel's service processes address information is the major key of angel's service processes information table, day Make service processes dynamic field, angel's service processes presence according to local angel's service processes and other angels service into Connection status between journey is updated, while what is updated includes the attached application service process of angel's service processes in threadiness State;
Insertion process including relation table:
Step 1: major key content is taken out from the row content for want inserting line;
Step 2: Hash calculation being carried out to major key, obtains cryptographic Hash;
Step 3: it is found in Hash area and is transferred to step 4 if the node is not used with the position of cryptographic Hash corresponding node, If the node is used, it is transferred to step 6;
Step 4: nodal information being written in node, nodal information includes major key, line number and the offset of next node;Wherein, line number For the line number that is inserted into the gauge outfit of relation table, gauge outfit includes number of lines;
Step 5: the write-in of row content being inserted into the row of line number, line number is inserted into and adds 1;
Step 6: according to next node offset information in nodal information, next node is successively found, until next node Offset is -1, is changed to the offset of zipper domain enabled node for -1, on the position of zipper domain available offsets, nodal information is written, will Zipper domain available offsets number plus 1;
Step 7: the write-in of row content being inserted into the row of line number, line number is inserted into and adds 1;
Wherein, Hash calculation includes the following steps:
Step 1: Hash being carried out to major key using common hash algorithm, obtains an integer;
Step 2: by integer to number of lines remainder, obtaining a cryptographic Hash;
Further include application service process login process:
Step 1: on host i, application service process j is logged on angel's service processes i, and application service process j calls angel The login interface of client library is passed to the Service name jX of oneself;i=1,2,…,N;j=1,2,…,m;
Step 2: angel's service processes i is connected to application service process j logging request, and it is local very fast to inquire inquiry according to Service name j Repository;
If found inside very fast repository, there are the configurations of the service, return to the number of application service process j and login successfully Information, modify application service process j in very fast repository logging state be have logged on, be transferred to step 3;
If do not found inside very fast repository, there are the configurations of the service, return to the information of -1 and login failure;
Step 3: the logging state of application service process j is broadcast to angel's service processes 2 to N by angel's service processes i;
Angel's service processes 2 receive the logging state of application service process j to angel's service processes N, are transferred to step 4 respectively;
Step 4: angel's service processes 2 to angel's service processes N are local very fast by the write-in of logging state of application service process j Repository;
Further include communication process between application service process:
Application service process j sends a message to application service process k;k=1,2,…,m;k≠j;
Step 1: application service process j is by local very fast repository, according to the Service name of application service process k, inquiry application The number and presence of service processes k;If inquiring the number of application service process and the presence of application service process Be it is online, be transferred to step 2;Conversely, returning to failure information, sign off;
Step 2: application service process j constructs message package, sends the message package to angel's service processes i;
Step 3: angel's service processes i receives the message package, according to the message package packet header content, inquires very fast repository, finds The target angel process N that should be forwarded, and inquire the presence of target angel's process N;
Step 4: message package is sent to angel's service processes N by angel's service processes i;
Step 5: angel's service processes N receives the message package, according to the message package packet header content, inquires very fast repository, finds Application service process k;
Step 6: message package is sent to application service process k by angel's service processes N.
2. the method for the distributed communication system according to claim 1 being applied on static cluster, characterized in that also wrap Include the process of inquiry:
Step 1: Hash calculation being carried out to inquiry major key, obtains cryptographic Hash;
Step 2: finding the position with cryptographic Hash corresponding node, the major key content and inquiry major key content of comparison node in Hash area It is whether identical, the row number information recorded in node is taken when identical;When not identical, the offset of next node is taken;
Step 3: according to the offset of next node, successively whether the major key of comparison node and inquiry major key are identical, until finding Identical node takes the row number information recorded in the node;
Step 4: if not finding row number information, inquiry failure;
Wherein, Hash calculation includes the following steps:
Step 1: Hash being carried out to major key using common hash algorithm, obtains an integer;
Step 2: by integer to number of lines remainder, obtaining a cryptographic Hash.
3. the method for the distributed communication system according to claim 1 being applied on static cluster, characterized in that also wrap Include the synchronous triggering step of presence:
Step 1: taking present system time, present system time is subtracted to last system time, obtains the time difference;
If time difference > 1 second is transferred to step 2;
If time difference≤1 second, sleep 100 milliseconds, circulation executes step 1;
Whether step 2: whether detecting event trigger flag is 1, or to synchronizing cycle;If so, being transferred to step 3;Otherwise, Continue to execute step 2;
Step 3: event trigger flag being revised as 0, executes presence synchronizing process;
Step 4: last system time being assigned a value of to the present system time obtained, when cycle time will be assigned a value of current system Between plus periodic quantity, continue to execute step 1.
4. the method for the distributed communication system according to claim 1 being applied on static cluster, characterized in that also wrap Include presence synchronizing process:
Step 1: angel's service processes read the presence for being attached to the application service process of oneself from very fast repository;
Step 2: angel's service processes compress the presence for being attached to the application service process of oneself, constitute one Linear state updates packet;
Step 3: the presence of oneself attached application service process is sent to angel's service processes of other All hosts Update packet;
Step 4: receiving angel's service processes that presence updates packet, decompression presence updates packet, modifies local Very fast repository.
CN201610713201.5A 2016-08-24 2016-08-24 Applied to the distributed communication system and method on static cluster Active CN106326020B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610713201.5A CN106326020B (en) 2016-08-24 2016-08-24 Applied to the distributed communication system and method on static cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610713201.5A CN106326020B (en) 2016-08-24 2016-08-24 Applied to the distributed communication system and method on static cluster

Publications (2)

Publication Number Publication Date
CN106326020A CN106326020A (en) 2017-01-11
CN106326020B true CN106326020B (en) 2019-06-18

Family

ID=57742687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610713201.5A Active CN106326020B (en) 2016-08-24 2016-08-24 Applied to the distributed communication system and method on static cluster

Country Status (1)

Country Link
CN (1) CN106326020B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102147751A (en) * 2011-04-26 2011-08-10 北京新媒传信科技有限公司 Communication method among multiple processes
CN102694866A (en) * 2012-06-01 2012-09-26 北京首钢自动化信息技术有限公司 Service request broker system in distributed network environment
CN104915246A (en) * 2014-03-12 2015-09-16 浙江浙大中控信息技术有限公司 High-configurable distributed real-time calculation engine based on workflow and control method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100175060A1 (en) * 2009-01-06 2010-07-08 International Business Machines Corporation Simplifying Selection of Targets for Installation of Composite Applications

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102147751A (en) * 2011-04-26 2011-08-10 北京新媒传信科技有限公司 Communication method among multiple processes
CN102694866A (en) * 2012-06-01 2012-09-26 北京首钢自动化信息技术有限公司 Service request broker system in distributed network environment
CN104915246A (en) * 2014-03-12 2015-09-16 浙江浙大中控信息技术有限公司 High-configurable distributed real-time calculation engine based on workflow and control method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Linux集群的分布式进程通信系统的实现;肖鹏 等;《仪器仪表学报》;20161205;第27卷(第6期);第678-680页

Also Published As

Publication number Publication date
CN106326020A (en) 2017-01-11

Similar Documents

Publication Publication Date Title
US11632441B2 (en) Methods, systems, and devices for electronic note identifier allocation and electronic note generation
CN109542865A (en) Distributed cluster system configuration file synchronous method, device, system and medium
US8671151B2 (en) Maintaining item-to-node mapping information in a distributed system
CN112968967A (en) Block synchronization method and device
US11068499B2 (en) Method, device, and system for peer-to-peer data replication and method, device, and system for master node switching
CN103345502B (en) Transaction processing method and system of distributed type database
KR20160147909A (en) System and method for supporting common transaction identifier (xid) optimization and transaction affinity based on resource manager (rm) instance awareness in a transactional environment
CN109639773B (en) Dynamically constructed distributed data cluster control system and method thereof
CN102333029A (en) Routing method in server cluster system
EP4213038A1 (en) Data processing method and apparatus based on distributed storage, device, and medium
EP3817338B1 (en) Method and apparatus for acquiring rpc member information, electronic device and storage medium
CN111858033A (en) Load balancing method based on cluster and multiple processes
WO2016082594A1 (en) Data update processing method and apparatus
CN104468299A (en) Enterprise service bus system based on user rule
US20230370285A1 (en) Block-chain-based data processing method, computer device, computer-readable storage medium
US10091288B2 (en) Ordered execution of tasks
CN112804332A (en) Message processing system, method, device, equipment and computer readable storage medium
US20030154202A1 (en) Distributed data system with process co-location and out -of -process communication
US11463376B2 (en) Resource distribution method and apparatus in Internet of Things, device, and storage medium
CN111737226B (en) Method for optimizing HBase cluster performance based on Redis cluster
CN112202862B (en) Method and device for synchronizing cluster data and files based on kafka
EP2025133B1 (en) Repository synchronization in a ranked repository cluster
CN110912979B (en) Method for solving multi-server resource synchronization conflict
CN106326020B (en) Applied to the distributed communication system and method on static cluster
CN110935168B (en) Distributed ID generation method, device and equipment for global uniform architecture

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 310053 block a, central control information building, No. 352, BINKANG Road, Binjiang District, Hangzhou, Zhejiang Province

Patentee after: Zhejiang zhongkong Information Industry Co.,Ltd.

Address before: 310053 block a, central control information building, No. 352, BINKANG Road, Binjiang District, Hangzhou, Zhejiang Province

Patentee before: ZHEJIANG SUPCON INFORMATION TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder
CP02 Change in the address of a patent holder

Address after: 310000 floors 23-25, building 2, No. 352, BINKANG Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Zhejiang zhongkong Information Industry Co.,Ltd.

Address before: 310053 block a, central control information building, No. 352, BINKANG Road, Binjiang District, Hangzhou, Zhejiang Province

Patentee before: Zhejiang zhongkong Information Industry Co.,Ltd.

CP02 Change in the address of a patent holder