CN106899605A - Communication means and device based on STOMP agreements - Google Patents
Communication means and device based on STOMP agreements Download PDFInfo
- Publication number
- CN106899605A CN106899605A CN201710153074.2A CN201710153074A CN106899605A CN 106899605 A CN106899605 A CN 106899605A CN 201710153074 A CN201710153074 A CN 201710153074A CN 106899605 A CN106899605 A CN 106899605A
- Authority
- CN
- China
- Prior art keywords
- message
- forwarded
- queue
- stomp
- agreements
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/26—Special purpose or proprietary protocols or architectures
Abstract
The present invention proposes a kind of communication means and device based on STOMP agreements, the method includes determining according to message to be forwarded the mark of purpose client, obtain the number of cluster interior joint server, when number is less than or equal to predetermined threshold value, message to be forwarded is sent in the node server of whole in cluster based on first queue, wherein, first queue is the queue for broadcasting the message based on STOMP agreements;When number is more than predetermined threshold value, the numbering with the corresponding node server of mark is determined according to the mapping table for prestoring;Based on the corresponding second queue of numbering by message to be forwarded send to the corresponding node server of numbering, wherein, second queue is the queue of the message that STOMP agreements are based on for unicast, so that message to be forwarded is forwarded to purpose client by node server according to the mark of purpose client.Internal memory and CPU shared by communication link can be reduced by the present invention, reduce call duration time complexity, lift the stability of communication system.
Description
Technical field
The present invention relates to communication technical field, more particularly to a kind of communication means and device based on STOMP agreements.
Background technology
STOMP (Simple Text Orientated Messaging Protocol, simple (stream) text directed message
Agreement) agreement is a kind of a kind of communication protocol in connection full-duplex communication field long, the agreement is succinct, easily realize, but, the association
View is being realized individually creating queue to each subscription, for example, user is after client is logged in, can set up link company
Connect, 10 times have been carried out in the link connection and has subscribed to (for example, topic, queue can be included), then in corresponding STOMP associations
View realizes side, the i.e. Message Agent based on STOMP agreements, then need to create 10 queues.
Under this mode, each grows connection need to create more queue, but most of queue is in the states such as sky, and communicate
System is still monitored and processed to these queues, and the internal memory and CPU shared by communication link are more, and communication system is not steady enough
It is fixed.
The content of the invention
It is contemplated that at least solving one of technical problem in correlation technique to a certain extent.
Therefore, it is an object of the present invention to propose a kind of communication means based on STOMP agreements, communication can be reduced
Internal memory and CPU shared by link, reduce call duration time complexity, lift the stability of communication system.
It is another object of the present invention to propose a kind of communicator based on STOMP agreements.
To reach above-mentioned purpose, the communication means based on STOMP agreements that first aspect present invention embodiment is proposed, bag
Include:When the message to be forwarded of client transmission is received, the mark of purpose client is determined according to the message to be forwarded, and
The number of server cluster interior joint server is obtained, and judges the number whether less than or equal to predetermined threshold value;
When the number is less than or equal to the predetermined threshold value, the message to be forwarded is sent to by the service based on first queue
In device cluster in whole node servers, wherein, the first queue is the team for broadcasting the message based on STOMP agreements
Row, so that the message to be forwarded is forwarded to the purpose visitor by the node server according to the mark of the purpose client
Family end;When the number is more than the predetermined threshold value, determined and the corresponding section of the mark according to the mapping table for prestoring
The numbering of point server;Based on the corresponding second queue of the numbering by the message to be forwarded send to it is described numbering it is right
The node server answered, wherein, the second queue is the queue of the message that STOMP agreements are based on for unicast, so that described
The message to be forwarded is forwarded to the purpose client by node server according to the mark of the purpose client.
In one embodiment of the invention, before the message to be forwarded for receiving client transmission, also include:
Link connection between multiple node servers and the multiple client set up in the cluster server;
The numbering of each node server in multiple node servers that record is connected with each client.
In one embodiment of the invention, also include:
Obtain the mark of the purpose client, and by the mark of the purpose client and with the purpose client institute
In multiple node servers of connection, the numbering generation mapping table of each node server;
The mapping table is preserved.
In one embodiment of the invention, before the message to be forwarded for receiving client transmission, also include:
Set up the link connection between each node server and the Message Agent based on STOMP agreements;
After the link connection is set up, the first queue is generated based on the link connection, and based on the chain
Road connection generation and each corresponding second queue of numbering.
In one embodiment of the invention, the link connection is connected for long.
The communication means based on STOMP agreements that first aspect present invention embodiment is proposed, by according to message to be forwarded
Determine the mark of purpose client, and whether judge the number of cluster interior joint server less than or equal to predetermined threshold value, if
It is then to be sent in server cluster all message to be forwarded based on the queue for broadcasting the message based on STOMP agreements
Node server in, if it is not, then determining the numbering with the corresponding node server of mark, base according to the mapping table that prestores
Message to be forwarded is sent to corresponding with numbering in the queue of the message that STOMP agreements are based on for unicast corresponding with numbering
In node server, due to when node server number is more than predetermined threshold value, it is not necessary to broadcast disappearing based on STOMP agreements
Breath, therefore, it is possible to reduce the internal memory and CPU shared by communication link, reduces call duration time complexity, lifts the steady of communication system
It is qualitative.
To reach above-mentioned purpose, the communicator based on STOMP agreements that second aspect present invention embodiment is proposed, bag
Include:First acquisition module, for when the message to be forwarded of client transmission is received, mesh being determined according to the message to be forwarded
Client mark, and obtain the number of server cluster interior joint server;Judge module, for judging that the number is
It is no less than or equal to predetermined threshold value;First sending module, for the number be less than or equal to the predetermined threshold value when,
The message to be forwarded is sent in the node server of whole in the server cluster based on first queue, wherein, institute
It is the queue for broadcasting the message based on STOMP agreements to state first queue, so that the node server is according to the purpose
The message to be forwarded is forwarded to the purpose client by the mark of client;Determining module, for being more than in the number
During the predetermined threshold value, the numbering with the corresponding node server of the mark is determined according to the mapping table for prestoring;Second
Sending module, for based on sending to corresponding with the numbering message to be forwarded with the corresponding second queue of the numbering
Node server, wherein, the second queue be for unicast be based on STOMP agreements message queue so that the section
The message to be forwarded is forwarded to the purpose client by point server according to the mark of the purpose client.
In one embodiment of the invention, also include:
First sets up module, between multiple node servers and the multiple client set up in the cluster server
Link connection;
Logging modle, each node server in the multiple node servers being connected with each client for record
Numbering.
In one embodiment of the invention, also include:
Second acquisition module, the mark for obtaining the purpose client;
First generation module, for the multiple being connected by the mark of the purpose client and with the purpose client
In node server, the numbering generation mapping table of each node server;
Preserving module, for being preserved to the mapping table.
In one embodiment of the invention, also include:
Second sets up module, between setting up described each node server and Message Agent based on STOMP agreements
Link connection;
Second generation module, for setting up after the link connection, based on link connection generation described first
Queue, and based on link connection generation and each corresponding second queue of numbering.
In one embodiment of the invention, the link connection is connected for long.
The communicator based on STOMP agreements that second aspect present invention embodiment is proposed, by according to message to be forwarded
Determine the mark of purpose client, and whether judge the number of cluster interior joint server less than or equal to predetermined threshold value, if
It is then to be sent in server cluster all message to be forwarded based on the queue for broadcasting the message based on STOMP agreements
Node server in, if it is not, then determining the numbering with the corresponding node server of mark, base according to the mapping table that prestores
Message to be forwarded is sent to corresponding with numbering in the queue of the message that STOMP agreements are based on for unicast corresponding with numbering
In node server, due to when node server number is more than predetermined threshold value, it is not necessary to broadcast disappearing based on STOMP agreements
Breath, therefore, it is possible to reduce the internal memory and CPU shared by communication link, reduces call duration time complexity, lifts the steady of communication system
It is qualitative.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partly become from the following description
Obtain substantially, or recognized by practice of the invention.
Brief description of the drawings
The above-mentioned and/or additional aspect of the present invention and advantage will become from the following description of the accompanying drawings of embodiments
Substantially and be readily appreciated that, wherein:
Fig. 1 is the schematic flow sheet of the communication means based on STOMP agreements that one embodiment of the invention is proposed;
Fig. 2 is the block schematic illustration of Message Agent forwarding message in correlation technique;
Fig. 3 is the block schematic illustration of Message Agent forwarding message in the embodiment of the present invention;
Fig. 4 is the schematic flow sheet of the communication means based on STOMP agreements that another embodiment of the present invention is proposed;
Fig. 5 is the structural representation of the communicator based on STOMP agreements that one embodiment of the invention is proposed;
Fig. 6 is the structural representation of the communicator based on STOMP agreements that another embodiment of the present invention is proposed.
Specific embodiment
Embodiments of the invention are described below in detail, the example of the embodiment is shown in the drawings, wherein from start to finish
Same or similar label represents same or similar element or the element with same or like function.Below with reference to attached
It is exemplary to scheme the embodiment of description, is only used for explaining the present invention, and is not considered as limiting the invention.Conversely, this
Inventive embodiment includes all changes fallen into the range of the spiritual and intension of attached claims, modification and is equal to
Thing.
Fig. 1 is the schematic flow sheet of the communication means based on STOMP agreements that one embodiment of the invention is proposed.
The present embodiment is based on the communication means of STOMP agreements and is configured as in the communicator based on STOMP agreements with this
To illustrate.
The communicator for being based on STOMP agreements can be with for example, be arranged in the Message Agent based on STOMP agreements, example
Such as, RabbitMQ, it is the Message Queuing system that increases income, or, ActiveMQ, it is a messaging bus of increasing income, to this
It is not restricted.
The communication means based on STOMP agreements in the embodiment of the present invention, can apply and be offseted based on server cluster
During breath is forwarded, for example, user is after client is logged in, the chain that can be set up between client and cluster server
Road is connected, and communication is triggered in the link connection, and this is not restricted.
The executive agent of the present embodiment can be, for example, based on the Message Agent of STOMP agreements, this not to be restricted.
Referring to Fig. 1, the communication means that should be based on STOMP agreements includes:
S11:When the message to be forwarded of client transmission is received, the mark of purpose client is determined according to message to be forwarded
Know, and obtain the number of server cluster interior joint server, and judge number whether less than or equal to predetermined threshold value.
In an embodiment of the present invention, the message to be forwarded can be, for example, user after client is logged in, based on to public affairs
What the subscription of many numbers was triggered, the message to be forwarded can be based on STMOP agreements, and the Message Agent based on STOMP agreements can be with
The message to be forwarded is forwarded based on server cluster, this is not restricted.
For example, when the message to be forwarded of client transmission is received, can be parsed to message to be forwarded, therefrom really
Determine the mark of purpose client.
In an embodiment of the present invention, the number of server cluster interior joint server and predetermined threshold value can be made to compare
It is right, different queues are chosen according to comparison result triggering following message to be forwarded is forwarded, this is not restricted.
In an embodiment of the present invention, predetermined threshold value can be pre-configured with, for example, can be according to external command to pre-
If threshold value is configured, for example, predetermined threshold value can be configured to 10, wherein, external command can be assisted by based on STOMP
The project development personnel of the Message Agent of view are generated according to the performance of server cluster, and this is not restricted.
In correlation technique, referring to Fig. 2, Fig. 2 is the block schematic illustration of Message Agent forwarding message in correlation technique, wherein,
Including, multiple client 21, server cluster 22, Message Agent 23, and communication link 24, server cluster 22 includes many
Individual node server, Message Agent 23 during being forwarded to message, based in advance with each node server set up
Communication link broadcast based on STOMP agreements message, accordingly, it would be desirable to the queue on each communication link is monitored and located
Reason, the internal memory and CPU shared by communication link is more, and communication system is not sufficiently stable.
And in embodiments of the invention, referring to Fig. 3, Fig. 3 is the framework of Message Agent forwarding message in the embodiment of the present invention
Schematic diagram, wherein, including multiple client 31, server cluster 32, Message Agent 33, and communication link 34, server set
Group 32 include multiple node servers, Message Agent 33 during being forwarded to message, based on node server
Number determines whether message of the broadcast based on STOMP agreements, therefore, when the number of node server is larger, it is not necessary to every
Queue on individual communication link is monitored and processed, and can reduce internal memory and CPU shared by communication link, when reducing communication
Between complexity, lifted communication system stability.
Further, for example, with reference to Fig. 2 and Fig. 3, Message Agent during being forwarded to message, server set
The queue number on communication link between group and Message Agent, by N:N:(N*X) it is transformed to N:1:1, i.e. will it is original each
Subscribe to and all correspond to a structure for queue, be transformed to the corresponding informance of Message Agent internal record subscription information and communication link,
The subscription information based on STOMP agreements need not be broadcasted so that originally to be reduced to each node server corresponding for M*X queue
Two queues:For broadcasting the first queue of the message based on STOMP agreements, for message of the unicast based on STOMP agreements
Second queue, greatly reduces time complexity and space complexity.
Some embodiments, referring to Fig. 4, can also include before step S11:
S41:Starter node server, and numbering is configured to each node server.
Alternatively, in an embodiment of the present invention, can be after the node server in starting cluster, to each node
Server configuration numbering, or, it is also possible to the exclusive identification code based on each node server is marked, and this is not limited
System.
After to each node server configuration numbering, in message forwarding process, message to be forwarded can be based on
Determine the corresponding node server of the numbering, call duration time complexity, the precision of effective guarantee communication can be reduced.
For example, it is assumed that the number of server cluster interior joint server is N, and after starter node server, can be to every
Individual node server configuration numbering, for example, nodeNumberi, wherein, i=1,2 ..., N, N are positive integer.
S42:The link connection set up between each node server and the Message Agent based on STOMP agreements, and building
After vertical link connection, first queue is generated based on link connection, and based on link connection generation corresponding with each numbering the
Two queues.
In an embodiment of the present invention, first queue is the queue for broadcasting the message based on STOMP agreements, for example,
Can mark and be, second queue is the queue of the message that STOMP agreements are based on for unicast, for example, can
With labeled as Ai_ queue, wherein, i=1,2 ..., N, N are the number of node server.
Preferably, the link connection is to grow connection.Link connection is divided into connection long and short connection, and short connection refers to double communication
When there is data interaction side every time, just sets up and once connect, after the completion of this data is activation, then disconnect this connection, have again when next time
Connection and data interaction are re-established during data interaction;Connection long refer to communicating pair after the completion of this data is activation, also protect
Connection is held, directly data can be transmitted without re-establishing connection with the connection next time.
In embodiments of the invention, one length with Message Agent based on STOMP agreements of each node server correspondence
Connection, can greatly reduce the usage quantity of filec descriptor in communication system, further reduce interior shared by communication link
Deposit and CPU.
For example, can be given birth in the link connection in each node server and between the Message Agent based on STOMP agreements
Broadcast queue broadcast_queue is the same from into all node servers, for broadcasting disappearing based on STOMP agreements
Breath, and based on link connection generation and each corresponding second queue of numbering, for example, can be generated in the link connection every
The all different unicast queue A of individual node serveri_ queue, wherein, i=1,2 ..., N are based on STOMP agreements for unicast
Message.
S43:Link connection between the multiple node servers and multiple client set up in cluster server, record with
The numbering of each node server in multiple node servers that each client is connected.
Without sequential qualified relation between S42 and S43-S45.
Wherein it is possible between the multiple node servers set up in cluster server using correlation technique and multiple client
Link connection, this is not restricted.
It is possible to further record each node server in the multiple node servers being currently connected with client
Numbering nodeNumberi, so as to subsequently the corresponding node server of the numbering can be determined based on message to be forwarded, can reduce
Call duration time complexity, the precision of effective guarantee communication.
S44:Obtain the mark of purpose client, and by the mark of purpose client and many with what purpose client was connected
In individual node server, the numbering generation mapping table of each node server.
In an embodiment of the present invention, the mark of purpose client can be used for the unique mark purpose client.
Alternatively, by generating the corresponding relation between the mark of purpose client and the numbering of each node server
Table, because the mapping table pre-builds, it is thus possible to effectively reduce call duration time complexity, and lifting communication system
Stability.
S45:Mapping table is preserved.
It is alternatively possible to the mapping table is preserved into database, so that the mark for being based on purpose client determines
The numbering of corresponding node server, the applicability of method for improving.
In the present embodiment, after to each node server configuration numbering, in message forwarding process, can be based on
Message to be forwarded determines the corresponding node server of the numbering, can reduce call duration time complexity, the essence of effective guarantee communication
Accuracy.Each node server correspondence one is based on STOMP agreements to be connected with Message Agent length, can greatly reduce communication
The usage quantity of filec descriptor in system, further reduces the internal memory and CPU shared by communication link.By record and each
The numbering of each node server in multiple node servers that client is connected, so as to can subsequently be based on message to be forwarded
Determine the corresponding node server of the numbering, call duration time complexity, the precision of effective guarantee communication can be reduced.By life
Mapping table between the mark and the numbering of each node server of purpose client, because the mapping table is pre-
First set up, it is thus possible to effectively reduce call duration time complexity, and lift the stability of communication system.Closed by by the correspondence
It is that table is preserved into database, the numbering of corresponding node server, lifting side is determined so as to the mark for being based on purpose client
The applicability of method.
S12:When number is less than or equal to predetermined threshold value, message to be forwarded is sent to by server based on first queue
In cluster in whole node servers, wherein, first queue is the queue for broadcasting the message based on STOMP agreements, with
Make node server that message to be forwarded are forwarded into purpose client according to the mark of purpose client.
In an embodiment of the present invention, predetermined threshold value can be pre-configured with, for example, can be according to external command to pre-
If threshold value is configured, for example, predetermined threshold value can be configured to 10, wherein, external command can be assisted by based on STOMP
The project development personnel of the Message Agent of view are generated according to the performance of server cluster, and this is not restricted.
For example, when the number N of node server is less than or equal to 10, it is possible to use first queue broadcast_
Queue is broadcasted into server cluster the node server nodeNumber of whole by message to be forwardediIn, now, due to clothes
The node scale of the scale of business device cluster is smaller, therefore, when message to be forwarded is broadcasted, the stabilization of communication system can be ensured
Property.
S13:When number is more than predetermined threshold value, determined and the corresponding node serve of mark according to the mapping table for prestoring
The numbering of device.
Alternatively, when the number of server cluster interior joint server is more than or equal to predetermined threshold value, can basis
The mapping table for prestoring determines the numbering with the corresponding node server of mark, for example, nodeNumberi, now, due to
The node of the scale of server cluster is larger, when therefore, there is no need to broadcast message to be forwarded, can reduce communication link institute
The internal memory and CPU of occupancy, reduce call duration time complexity.
S14:Based on the corresponding second queue of numbering by message to be forwarded send to the corresponding node server of numbering,
Wherein, second queue is the queue of the message that STOMP agreements are based on for unicast, so that node server is according to purpose client
Mark message to be forwarded is forwarded to purpose client.
In the present embodiment, by determining the mark of purpose client according to message to be forwarded, and judge that cluster interior joint takes
Whether the number of business device is less than or equal to predetermined threshold value, if so, then based on the team for broadcasting the message for being based on STOMP agreements
Arrange and be sent to message to be forwarded in the node server of whole in server cluster, if it is not, then according to the corresponding relation for prestoring
Table determines the numbering with the corresponding node server of mark, and disappearing for STOMP agreements is based on for unicast based on corresponding with numbering
The queue of breath by message to be forwarded send to in the corresponding node server of numbering, due in node server number more than pre-
If during threshold value, it is not necessary to message of the broadcast based on STOMP agreements, therefore, it is possible to reduce internal memory shared by communication link and
CPU, reduces call duration time complexity, lifts the stability of communication system.
Fig. 5 is the structural representation of the communicator based on STOMP agreements that one embodiment of the invention is proposed.This is based on
The communicator 500 of STOMP agreements being implemented in combination with by software, hardware or both.
Referring to Fig. 5, the communicator 500 that should be based on STOMP agreements can include:First acquisition module 501, judge module
502nd, the first sending module 503, determining module 504, the second sending module 505.Wherein,
First acquisition module 501, it is true according to message to be forwarded for when the message to be forwarded of client transmission is received
Determine the mark of purpose client, and obtain the number of server cluster interior joint server.
Judge module 502, for judging number whether less than or equal to predetermined threshold value.
First sending module 503, for number be less than or equal to predetermined threshold value when, will be to be forwarded based on first queue
Message is sent in the node server of whole in server cluster, wherein, first queue is for broadcasting based on STOMP agreements
Message queue so that message to be forwarded is forwarded to purpose client by node server according to the mark of purpose client.
Determining module 504, for when number is more than predetermined threshold value, it to be right with mark to be determined according to the mapping table for prestoring
The numbering of the node server answered.
Second sending module 505, for based on the corresponding second queue of numbering by message to be forwarded send to numbering
Corresponding node server, wherein, second queue is the queue of the message that STOMP agreements are based on for unicast, so that node takes
Message to be forwarded is forwarded to purpose client by business device according to the mark of purpose client
In some embodiments, referring to Fig. 6, the communicator 500 that should be based on STOMP agreements can also include:
First sets up module 506, between the multiple node servers and multiple client set up in cluster server
Link connection.
Alternatively, link connection is connected for long.
Logging modle 507, each node serve in the multiple node servers being connected with each client for record
The numbering of device.
Second acquisition module 508, the mark for obtaining purpose client.
First generation module 509, for the multiple nodes being connected by the mark of purpose client and with purpose client
In server, the numbering generation mapping table of each node server.
Preserving module 510, for being preserved to mapping table.
Second sets up module 511, between setting up each node server and Message Agent based on STOMP agreements
Link connection.
Second generation module 512, for setting up after link connection, first queue, and base being generated based on link connection
In link connection generation and each corresponding second queue of numbering.
It should be noted that the explanation in earlier figures 1- Fig. 4 embodiments to the communication means embodiment based on STOMP agreements
Illustrate to be also applied for the communicator 500 for being based on STOMP agreements, its realization principle is similar to, and here is omitted.
In the present embodiment, by determining the mark of purpose client according to message to be forwarded, and judge that cluster interior joint takes
Whether the number of business device is less than or equal to predetermined threshold value, if so, then based on the team for broadcasting the message for being based on STOMP agreements
Arrange and be sent to message to be forwarded in the node server of whole in server cluster, if it is not, then according to the corresponding relation for prestoring
Table determines the numbering with the corresponding node server of mark, and disappearing for STOMP agreements is based on for unicast based on corresponding with numbering
The queue of breath by message to be forwarded send to in the corresponding node server of numbering, due in node server number more than pre-
If during threshold value, it is not necessary to message of the broadcast based on STOMP agreements, therefore, it is possible to reduce internal memory shared by communication link and
CPU, reduces call duration time complexity, lifts the stability of communication system.
It should be noted that in the description of the invention, term " first ", " second " etc. are only used for describing purpose, without
It is understood that to indicate or implying relative importance.Additionally, in the description of the invention, unless otherwise indicated, the implication of " multiple "
It is two or more.
Any process described otherwise above or method description in flow chart or herein is construed as, and expression includes
It is one or more for realizing specific logical function or process the step of the module of code of executable instruction, fragment or portion
Point, and the scope of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discussion suitable
Sequence, including function involved by basis by it is basic simultaneously in the way of or in the opposite order, carry out perform function, this should be of the invention
Embodiment person of ordinary skill in the field understood.
It should be appreciated that each several part of the invention can be realized with hardware, software, firmware or combinations thereof.Above-mentioned
In implementation method, the software that multiple steps or method can in memory and by suitable instruction execution system be performed with storage
Or firmware is realized.If for example, realized with hardware, and in another embodiment, can be with well known in the art
Any one of row technology or their combination are realized:With the logic gates for realizing logic function to data-signal
Discrete logic, the application specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA), scene
Programmable gate array (FPGA) etc..
Those skilled in the art are appreciated that to realize all or part of step that above-described embodiment method is carried
The rapid hardware that can be by program to instruct correlation is completed, and described program can be stored in a kind of computer-readable storage medium
In matter, the program upon execution, including one or a combination set of the step of embodiment of the method.
Additionally, during each functional unit in each embodiment of the invention can be integrated in a processing module, it is also possible to
It is that unit is individually physically present, it is also possible to which two or more units are integrated in a module.Above-mentioned integrated mould
Block can both be realized in the form of hardware, it would however also be possible to employ the form of software function module is realized.The integrated module is such as
Fruit is to realize in the form of software function module and as independent production marketing or when using, it is also possible to which storage is in a computer
In read/write memory medium.
Storage medium mentioned above can be read-only storage, disk or CD etc..
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show
The description of example " or " some examples " etc. means to combine specific features, structure, material or spy that the embodiment or example are described
Point is contained at least one embodiment of the invention or example.In this manual, to the schematic representation of above-mentioned term not
Necessarily refer to identical embodiment or example.And, the specific features of description, structure, material or feature can be any
One or more embodiments or example in combine in an appropriate manner.
Although embodiments of the invention have been shown and described above, it is to be understood that above-described embodiment is example
Property, it is impossible to limitation of the present invention is interpreted as, one of ordinary skill in the art within the scope of the invention can be to above-mentioned
Embodiment is changed, changes, replacing and modification.
Claims (10)
1. a kind of communication means based on STOMP agreements, it is characterised in that comprise the following steps:
When the message to be forwarded of client transmission is received, the mark of purpose client is determined according to the message to be forwarded,
And the number of server cluster interior joint server is obtained, and judge the number whether less than or equal to predetermined threshold value;
When the number is less than or equal to the predetermined threshold value, the message to be forwarded is sent to by institute based on first queue
In stating whole node servers in server cluster, wherein, the first queue is for broadcasting disappearing based on STOMP agreements
The queue of breath, so that the node server is according to be forwarded to for the message to be forwarded by the mark of the purpose client
Purpose client;
When the number is more than the predetermined threshold value, determined and the corresponding node of the mark according to the mapping table for prestoring
The numbering of server;
Taken based on the message to be forwarded is sent to node corresponding with the numbering with the corresponding second queue of the numbering
Business device, wherein, the second queue is the queue of the message that STOMP agreements are based on for unicast, so that the node server
The message to be forwarded is forwarded to the purpose client by the mark according to the purpose client.
2. the communication means of STOMP agreements is based on as claimed in claim 1, it is characterised in that receive client described
Before the message to be forwarded for sending, also include:
Link connection between multiple node servers and the multiple client set up in the cluster server;
The numbering of each node server in multiple node servers that record is connected with each client.
3. the communication means of STOMP agreements is based on as claimed in claim 2, it is characterised in that also included:
The mark of the purpose client is obtained, and is connected by the mark of the purpose client and with the purpose client
Multiple node servers in, the numbering of each node server generation mapping table;
The mapping table is preserved.
4. the communication means of STOMP agreements is based on as claimed in claim 1, it is characterised in that receive client described
Before the message to be forwarded for sending, also include:
Set up the link connection between each node server and the Message Agent based on STOMP agreements;
After the link connection is set up, the first queue is generated based on the link connection, and connect based on the link
Deliver a child into and each corresponding second queue of numbering.
5. the communication means based on STOMP agreements as described in claim 2 or 4, it is characterised in that the link connection is length
Connection.
6. a kind of communicator based on STOMP agreements, it is characterised in that including:
First acquisition module, for when the message to be forwarded of client transmission is received, being determined according to the message to be forwarded
The mark of purpose client, and obtain the number of server cluster interior joint server;
Judge module, for judging the number whether less than or equal to predetermined threshold value;
First sending module, for when the number is less than or equal to the predetermined threshold value, based on first queue by described in
Message to be forwarded is sent in the node server of whole in the server cluster, wherein, the first queue is for wide
The queue of the message based on STOMP agreements is broadcast, so that the node server is according to the mark of the purpose client is incited somebody to action
Message to be forwarded is forwarded to the purpose client;
Determining module, for when the number is more than the predetermined threshold value, according to the mapping table that prestores determine with it is described
Identify the numbering of corresponding node server;
Second sending module, for based on the corresponding second queue of the numbering by the message to be forwarded send to it is described
Corresponding node server is numbered, wherein, the second queue is the queue of the message that STOMP agreements are based on for unicast, with
Make the node server that the message to be forwarded are forwarded into the purpose client according to the mark of the purpose client.
7. the communicator of STOMP agreements is based on as claimed in claim 6, it is characterised in that also included:
First sets up module, for the chain between multiple node servers and the multiple client set up in the cluster server
Road connects;
Logging modle, the volume for recording each node server in the multiple node servers being connected with each client
Number.
8. the communicator of STOMP agreements is based on as claimed in claim 7, it is characterised in that also included:
Second acquisition module, the mark for obtaining the purpose client;
First generation module, for the multiple nodes being connected by the mark of the purpose client and with the purpose client
In server, the numbering generation mapping table of each node server;
Preserving module, for being preserved to the mapping table.
9. the communicator of STOMP agreements is based on as claimed in claim 6, it is characterised in that also included:
Second sets up module, for setting up described each node server and Message Agent based on STOMP agreements between chain
Road connects;
Second generation module, for setting up after the link connection, the first queue being generated based on the link connection,
And based on link connection generation and each corresponding second queue of numbering.
10. the communicator based on STOMP agreements as described in claim 7 or 9, it is characterised in that the link connection is
Connection long.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710153074.2A CN106899605B (en) | 2017-03-15 | 2017-03-15 | Communication method and device based on STOMP protocol |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710153074.2A CN106899605B (en) | 2017-03-15 | 2017-03-15 | Communication method and device based on STOMP protocol |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106899605A true CN106899605A (en) | 2017-06-27 |
CN106899605B CN106899605B (en) | 2020-03-20 |
Family
ID=59192299
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710153074.2A Active CN106899605B (en) | 2017-03-15 | 2017-03-15 | Communication method and device based on STOMP protocol |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106899605B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111083193A (en) * | 2019-11-11 | 2020-04-28 | 厦门网宿有限公司 | Long connection message sending method, server and storage medium |
CN111212100A (en) * | 2018-11-22 | 2020-05-29 | 财团法人工业技术研究院 | Synchronization method and system for publishing and subscribing message queue |
CN111580993A (en) * | 2020-05-11 | 2020-08-25 | 广州虎牙信息科技有限公司 | Data processing method and device, electronic equipment and storage medium |
CN111917562A (en) * | 2020-07-31 | 2020-11-10 | 广州市百果园信息技术有限公司 | Broadcast message forwarding method, device, equipment and storage medium |
CN111580993B (en) * | 2020-05-11 | 2024-05-17 | 广州虎牙信息科技有限公司 | Data processing method and device, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1065857A2 (en) * | 1999-05-26 | 2001-01-03 | Hewlett-Packard Company | Method for quick identification of special data packets |
EP1414186A2 (en) * | 2000-01-17 | 2004-04-28 | EGC & C Co., Ltd | System and method for providing internet broadcasting data based on hierarchical structure |
CN101753534A (en) * | 2008-12-10 | 2010-06-23 | 徐文祥 | Zoning adaptive network system based on cluster server and building method |
CN102215174A (en) * | 2011-07-14 | 2011-10-12 | 丁泉龙 | Adaptive multimedia stream link transmission method |
CN104079389A (en) * | 2013-03-25 | 2014-10-01 | 株式会社Ntt都科摩 | Retransmission method of mobile broadcasting services |
-
2017
- 2017-03-15 CN CN201710153074.2A patent/CN106899605B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1065857A2 (en) * | 1999-05-26 | 2001-01-03 | Hewlett-Packard Company | Method for quick identification of special data packets |
EP1414186A2 (en) * | 2000-01-17 | 2004-04-28 | EGC & C Co., Ltd | System and method for providing internet broadcasting data based on hierarchical structure |
CN101753534A (en) * | 2008-12-10 | 2010-06-23 | 徐文祥 | Zoning adaptive network system based on cluster server and building method |
CN102215174A (en) * | 2011-07-14 | 2011-10-12 | 丁泉龙 | Adaptive multimedia stream link transmission method |
CN104079389A (en) * | 2013-03-25 | 2014-10-01 | 株式会社Ntt都科摩 | Retransmission method of mobile broadcasting services |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111212100A (en) * | 2018-11-22 | 2020-05-29 | 财团法人工业技术研究院 | Synchronization method and system for publishing and subscribing message queue |
CN111212100B (en) * | 2018-11-22 | 2022-07-19 | 财团法人工业技术研究院 | Synchronization method and system for publishing and subscribing message queue |
CN111083193A (en) * | 2019-11-11 | 2020-04-28 | 厦门网宿有限公司 | Long connection message sending method, server and storage medium |
CN111580993A (en) * | 2020-05-11 | 2020-08-25 | 广州虎牙信息科技有限公司 | Data processing method and device, electronic equipment and storage medium |
CN111580993B (en) * | 2020-05-11 | 2024-05-17 | 广州虎牙信息科技有限公司 | Data processing method and device, electronic equipment and storage medium |
CN111917562A (en) * | 2020-07-31 | 2020-11-10 | 广州市百果园信息技术有限公司 | Broadcast message forwarding method, device, equipment and storage medium |
CN111917562B (en) * | 2020-07-31 | 2022-09-02 | 广州市百果园信息技术有限公司 | Broadcast message forwarding method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN106899605B (en) | 2020-03-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8463304B2 (en) | Short code provisioning and threading techniques for bidirectional text messaging | |
US8233399B2 (en) | Generic packet generator and method | |
CN101317370B (en) | Method and management agent for event notifications correlation | |
EP1655915B1 (en) | Method for managing duplicated arrival notification messages in multimedia messaging services | |
CN109672560B (en) | Flexible Ethernet management channel expansion method and device | |
US9442925B2 (en) | Regulated texting solution for mobile devices | |
US9098341B2 (en) | Service manager for adaptive load shedding | |
CN106899605A (en) | Communication means and device based on STOMP agreements | |
JP2009517930A (en) | Data retransmission method, data transmission apparatus, and data transmission system | |
CN101969398A (en) | Aging method and system of MAC (Media Access Control) address | |
US20130191484A1 (en) | Mail transfer system, mail gateway and data store server | |
US20190140859A1 (en) | Method and Apparatus for Processing Signals from Messages on at Least Two Data Buses, Particularly Can Buses; Preferably in a Vehicle; And System | |
CN111726414A (en) | Vehicle reported data processing method and vehicle data reporting system | |
CN109379764A (en) | File transmitting method and device | |
CN112866435A (en) | MAC address aging processing method and equipment | |
US9503485B1 (en) | Connecting communicating devices in a multi-server communication system | |
CN1918879B (en) | Method and arrangement for state memory management | |
CN1557085A (en) | Terminals adapted to act as relay servers for distributing packets in a client-server network | |
US11196792B2 (en) | Method, device and system for transmitting data | |
US20080212505A1 (en) | Method and receiving apparatus for processing arq block in wibro system | |
CN112953953B (en) | Communication protocol design method, terminal and computer storage medium | |
CN114897532A (en) | Operation log processing method, system, device, equipment and storage medium | |
CN114070801A (en) | Message processing method, message transmission method, device and electronic equipment | |
CN114070784A (en) | Message processing method and device, electronic equipment and storage medium | |
CN111082957B (en) | Port configuration detection method, terminal and computer-readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |