CN103701692A - Message forwarding method, system and server - Google Patents
Message forwarding method, system and server Download PDFInfo
- Publication number
- CN103701692A CN103701692A CN201310737858.1A CN201310737858A CN103701692A CN 103701692 A CN103701692 A CN 103701692A CN 201310737858 A CN201310737858 A CN 201310737858A CN 103701692 A CN103701692 A CN 103701692A
- Authority
- CN
- China
- Prior art keywords
- client
- message
- server
- pulls
- pull
- 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.)
- Pending
Links
Images
Abstract
The invention is applicable to the technical field of communication and provides a message forwarding method, a system and a server. The method comprises the steps that the server receives a message transmitted by a client; the server judges whether the message is required to be forwarded to real-time clients or pulling clients according to the message; if the message is required to be forwarded to the real-time clients, the server transmits the message to the real-time clients in real time; if the message is required to be forwarded to the pulling clients, the server temporarily stores the message and then forwards the message to the pulling clients when the pulling clients go to the server to pull the message. The message forwarding method, the system and the server have the advantages that the server not only can support a real-time pushing method, but also can support a periodic pulling method, and the effect of realizing not only real-time communication, but also non-real-time communication between clients and between clients and the server is achieved.
Description
Technical field
The invention belongs to communication technical field, relate in particular to a kind of method, system and server of forwarding messages.
Background technology
At present, when client and server communicates, mainly adopt in two ways and communicate, a kind of is real time propelling movement mode, and another kind is the mode that regularly pulls.
Real time propelling movement mode is between client and server, to carry out the real-time, interactive of message; Regularly pulling mode is that client regularly pulls message from server.
Along with the development of the communication technology, the mankind's communication requirement is more and more higher.Can only support now a kind of server of communication mode wherein to can not meet user's demand, in the urgent need to a kind of, can support real time propelling movement mode, can support regularly to pull again the server of mode.
Summary of the invention
The embodiment of the present invention provides a kind of method, system and server of forwarding messages, and the server that being intended to solve prior art provides cannot be supported real time propelling movement mode simultaneously and regularly pull the problem of these two kinds of communication modes of mode.
On the one hand, provide a kind of method of forwarding messages, described method comprises:
Server receives the message that client sends;
Server need to forward described message to real time client according to described message judgement and still pull client;
If need to forward described message to real time client, server sends described message in real time to real time client;
If need to forward described message to pulling client, the first temporary described message of server, when pulling client and pull message to server, then forwards described message to pulling client.
Further, described client is real time client or pulls client.
Further, described server is temporary described message first, when pulling client and pull message to server, then forwards described message and comprise to pulling client:
Server is kept in the first queue described message;
When pulling client and pull message to server, server deposits the described message of storing in described the first queue in the second queue in, makes described first team classify sky as simultaneously, pulls client and pull described message from described the second queue.
Further, described pull client pull described message from described the second queue in, if server receives new needs and is transmitted to the message that pulls client, temporary described new needs are transmitted in message to the first queue that pulls client, wait for that pulled client pulls next time.
On the other hand, provide a kind of server, described server comprises:
Connect and set up unit, for connecting with client;
Message sink unit, the message sending for receiving client;
Client recognition unit, still pulls client for forwarding described message to real time client according to described message judgement;
The real-time transmitting element of message, if for forwarding described message to real time client, sends described message in real time to real time client;
Message pulls unit, if for forwarding described message to pulling client, first temporary described message, when pulling client and pull message to server, then forwards described message to pulling client.
Further, described client is real time client or pulls client.
Further, described message pulls unit and comprises:
Message is kept in subelement, for described message is kept in to the first queue;
Message pulls subelement, for when pulling client and pull message to server, the described message of storing in described the first queue is deposited in the second queue, makes described first team classify sky as simultaneously, pulls client and pull described message from described the second queue.
Further, described message pull subelement also for, described pull client pull described message from described the second queue in, if receive new needs, be transmitted to the message that pulls client, temporary described new needs are transmitted in message to the first queue that pulls client, wait for that pulled client pulls next time.
Again on the one hand, provide a kind of system of forwarding messages, described system comprises at least two clients, the server as above being connected with described client.
In the embodiment of the present invention, server receives after the message of client transmission, message directly can be transmitted to real time client, also the message receiving first can be temporarily stored in to this locality, by the time pull client and bring in while pulling message, then the message receiving is transmitted to and pulls client.Server both can be supported real time propelling movement mode, also can support regularly to pull mode.Realized between client, both can carry out real time communication between client and server, also can carry out non-realtime traffic.
Accompanying drawing explanation
Fig. 1 is the realization flow figure of the method for the forwarding messages that provides of the embodiment of the present invention one;
Fig. 2 is the structured flowchart of the server that provides of the embodiment of the present invention two;
Fig. 3 is the structured flowchart of the system of the forwarding messages that provides of the embodiment of the present invention one.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
In embodiments of the present invention, server receives after the message of client transmission, message directly can be transmitted to real time client, also the message receiving first can be temporarily stored in to this locality, by the time pull client and bring in while pulling message, then the message receiving is transmitted to and pulls client.Server both can be supported real time propelling movement mode, also can support regularly to pull mode.
Below in conjunction with specific embodiment, realization of the present invention is described in detail:
Embodiment mono-
Fig. 1 shows the realization flow of the method for the forwarding messages that the embodiment of the present invention one provides, and the server side of take describes as example, and details are as follows:
In step S101, server receives the message that client sends.
In the present embodiment, client and server connect, and the user name password legitimacy of server authentication client, if legal, connects successfully, if illegal, disconnect.
Wherein, client is real time client or pulls client.Real time client comprises linux embedded device, smart mobile phone, pc client; Pulling client is the client based on pull mode, such as the client of browser is installed.
The interface-client agency of client call service device, the message format that need to send to the message of server to be packaged into server regulation client sends to server.
In step S102, server need to forward described message to real time client according to described message judgement and still pull client.
In the present embodiment, server receives after message, and message is resolved, and extracts the information of the destination client that message comprises, according to the information judgement of this destination client, needs forwarding messages to real time client still to pull client.
In step S103, if need to forward described message to real time client, server sends described message in real time to real time client.
In the present embodiment, if from client to message be to be transmitted to real time client, server directly calls the callback interface agency of real time client, and the message format that described message is packaged into real time client regulation by described callback interface agency sends to real time client.
In step S104, if need to forward described message to pulling client, the first temporary described message of server, when pulling client and pull message to server, then forwards described message to pulling client.
In the present embodiment, if from client to message be will be transmitted to pull client, server is first kept in this message in the first queue, waits for that pulling client regularly pulls to server.When pulling client and pull message from server, server deposits this message being temporarily stored in described the first queue in the second queue in, makes described first team classify sky as simultaneously, pulls client and from the second queue, pulls this temporary message.When pulling client pull described message from this second queue, if server receives new needs and is transmitted to the message that pulls client, temporary described new needs are transmitted in message to the first queue that pulls client, wait for that pulled client pulls next time.It should be noted that, when the content in the first queue and the second queue exchanges, server can lock synchronously to the first queue and the second queue, makes the content of the second queue and the first queue realize synchronous renewal.
The present embodiment, server receives after the message of client transmission, message directly can be transmitted to real time client, also the message receiving first can be temporarily stored in to this locality, by the time pull client and bring in while pulling message, then the message receiving is transmitted to and pulls client.Server both can be supported real time propelling movement mode, also can support regularly to pull mode.Realized between client, both can carry out real time communication between client and server, also can carry out non-realtime traffic.
One of ordinary skill in the art will appreciate that all or part of step realizing in the various embodiments described above method is to come the hardware that instruction is relevant to complete by program, corresponding program can be stored in a computer read/write memory medium, described storage medium, as ROM/RAM, disk or CD etc.
Embodiment bis-
Fig. 2 shows the concrete structure block diagram of the server that the embodiment of the present invention two provides, and for convenience of explanation, only shows the part relevant to the embodiment of the present invention.This server 2 comprises: message sink unit 21, client recognition unit 22, the real-time transmitting element 23 of message and message pull unit 24.
Wherein, message sink unit 21, the message sending for receiving client;
The real-time transmitting element 23 of message, if for forwarding described message to real time client, sends described message in real time to real time client;
Message pulls unit 24, if for forwarding described message to pulling client, first temporary described message, when pulling client and pull message to server, then forwards described message to pulling client.
Further, described client is real time client or pulls client.
Concrete, described message pulls unit 24 and comprises:
Message is kept in subelement, for described message is kept in to the first queue;
Message pulls subelement, for when pulling client and pull message to server, the described message of storing in described the first queue is deposited in the second queue, makes described first team classify sky as simultaneously, pulls client and pull described message from described the second queue.
Further, described message pull subelement also for, described pull client pull described message from described the second queue in, if receive new needs, be transmitted to the message that pulls client, temporary described new needs are transmitted in message to the first queue that pulls client, wait for that pulled client pulls next time.
The server that the embodiment of the present invention provides can be applied in the embodiment of the method one of aforementioned correspondence, and details, referring to the description of above-described embodiment one, do not repeat them here.
Embodiment tri-
Fig. 3 shows the concrete structure block diagram of the system of the forwarding messages that the embodiment of the present invention three provides, and for convenience of explanation, only shows the part relevant to the embodiment of the present invention.This system 3 comprises server 31 and at least two clients, and two clients of take in the present embodiment describe as example, and client 32 is as message receiver, and another client 33 is as message sender.Server is connected respectively with message receiver with message sender, the message receiving can be transmitted to message receiver from message sender.When message receiver is real time client, the server message that transmission receives is in real time to real time client; When message receiver is while pulling client, server is the temporary message receiving first, when pulling client and pull message to server, then forwards described message to pulling client.
The system of the forwarding messages that the embodiment of the present invention provides can be applied in the embodiment of the method one of aforementioned correspondence, and details, referring to the description of above-described embodiment one, do not repeat them here.
It should be noted that in said system embodiment, included unit is just divided according to function logic, but is not limited to above-mentioned division, as long as can realize corresponding function; In addition, the concrete title of each functional unit also, just for the ease of mutual differentiation, is not limited to protection scope of the present invention.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any modifications of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.
Claims (9)
1. a method for forwarding messages, is characterized in that, described method comprises:
Server receives the message that client sends;
Server need to forward described message to real time client according to described message judgement and still pull client;
If need to forward described message to real time client, server sends described message in real time to real time client;
If need to forward described message to pulling client, the first temporary described message of server, when pulling client and pull message to server, then forwards described message to pulling client.
2. the method for claim 1, is characterized in that, described client is real time client or pulls client.
3. method as claimed in claim 2, is characterized in that, described server is temporary described message first, when pulling client and pull message to server, then forwards described message and comprises to pulling client:
Server is kept in the first queue described message;
When pulling client and pull message to server, server deposits the described message of storing in described the first queue in the second queue in, makes described first team classify sky as simultaneously, pulls client and pull described message from described the second queue.
4. method as claimed in claim 3, it is characterized in that, described pull client pull described message from described the second queue in, if server receives new needs and is transmitted to the message that pulls client, temporary described new needs are transmitted in message to the first queue that pulls client, wait for that pulled client pulls next time.
5. a server, is characterized in that, described server comprises:
Message sink unit, the message sending for receiving client;
Client recognition unit, still pulls client for forwarding described message to real time client according to described message judgement;
The real-time transmitting element of message, if for forwarding described message to real time client, sends described message in real time to real time client;
Message pulls unit, if for forwarding described message to pulling client, first temporary described message, when pulling client and pull message to server, then forwards described message to pulling client.
6. server as claimed in claim 5, is characterized in that, described client is real time client or pulls client.
7. server as claimed in claim 6, is characterized in that, described message pulls unit and comprises:
Message is kept in subelement, for described message is kept in to the first queue;
Message pulls subelement, for when pulling client and pull message to server, the described message of storing in described the first queue is deposited in the second queue, makes described first team classify sky as simultaneously, pulls client and pull described message from described the second queue.
8. server as claimed in claim 7, it is characterized in that, described message pull subelement also for, described pull client pull described message from described the second queue in, if receive new needs, be transmitted to the message that pulls client, temporary described new needs are transmitted in message to the first queue that pulls client, wait for that pulled client pulls next time.
9. a system for forwarding messages, is characterized in that, described system comprises at least two clients, the server as described in claim 5 to 8 any one being connected with described client.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310737858.1A CN103701692A (en) | 2013-12-25 | 2013-12-25 | Message forwarding method, system and server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310737858.1A CN103701692A (en) | 2013-12-25 | 2013-12-25 | Message forwarding method, system and server |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103701692A true CN103701692A (en) | 2014-04-02 |
Family
ID=50363094
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310737858.1A Pending CN103701692A (en) | 2013-12-25 | 2013-12-25 | Message forwarding method, system and server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103701692A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105049327A (en) * | 2015-06-23 | 2015-11-11 | 惠州Tcl移动通信有限公司 | Touch vibration instant messaging method and system |
CN107633372A (en) * | 2017-08-23 | 2018-01-26 | 浙江大学城市学院 | A kind of logistics center's training platform and its construction method based on simulation supply chain |
CN111211973A (en) * | 2020-01-15 | 2020-05-29 | 百望股份有限公司 | Information processing method and device in invoice field and storage medium |
CN114244901A (en) * | 2021-11-22 | 2022-03-25 | 中国建设银行股份有限公司 | Data processing method and device and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080040441A1 (en) * | 2006-07-05 | 2008-02-14 | Oracle International Corporation | Push e-mail inferred network presence |
US20100250670A1 (en) * | 2003-11-19 | 2010-09-30 | Nexaweb Technologies, Inc. | System and method for stateful web-based computing |
US7895273B1 (en) * | 2003-01-23 | 2011-02-22 | Sprint Spectrum L.P. | System and method for sorting instant messages |
CN103428076A (en) * | 2013-08-22 | 2013-12-04 | 北京奇虎科技有限公司 | Method and device for transmitting information to multi-type terminals or applications |
CN103440241A (en) * | 2013-06-24 | 2013-12-11 | 杭州朗和科技有限公司 | Method and equipment for transmitting dynamic information, and method and equipment for querying dynamic information |
-
2013
- 2013-12-25 CN CN201310737858.1A patent/CN103701692A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7895273B1 (en) * | 2003-01-23 | 2011-02-22 | Sprint Spectrum L.P. | System and method for sorting instant messages |
US20100250670A1 (en) * | 2003-11-19 | 2010-09-30 | Nexaweb Technologies, Inc. | System and method for stateful web-based computing |
US20080040441A1 (en) * | 2006-07-05 | 2008-02-14 | Oracle International Corporation | Push e-mail inferred network presence |
CN103440241A (en) * | 2013-06-24 | 2013-12-11 | 杭州朗和科技有限公司 | Method and equipment for transmitting dynamic information, and method and equipment for querying dynamic information |
CN103428076A (en) * | 2013-08-22 | 2013-12-04 | 北京奇虎科技有限公司 | Method and device for transmitting information to multi-type terminals or applications |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105049327A (en) * | 2015-06-23 | 2015-11-11 | 惠州Tcl移动通信有限公司 | Touch vibration instant messaging method and system |
CN107633372A (en) * | 2017-08-23 | 2018-01-26 | 浙江大学城市学院 | A kind of logistics center's training platform and its construction method based on simulation supply chain |
CN111211973A (en) * | 2020-01-15 | 2020-05-29 | 百望股份有限公司 | Information processing method and device in invoice field and storage medium |
CN114244901A (en) * | 2021-11-22 | 2022-03-25 | 中国建设银行股份有限公司 | Data processing method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102546779B (en) | Synchronized method and device of application data across devices | |
CN102665114B (en) | Method, apparatus and system for intelligent device interaction | |
CN101883436B (en) | Concurrent processing method and system for resources and mobile terminal | |
CN102984393A (en) | Method for file transmission between mobile terminals and mobile terminal | |
CN103281237A (en) | Group processing method and device | |
CN103701692A (en) | Message forwarding method, system and server | |
CN106254468B (en) | A kind of control system and method for intelligent back vision mirror | |
CN114615096B (en) | Event-driven architecture-based telecommunication charging method, system and related equipment | |
CN103209392A (en) | Cross-process and multi-application massage pushing method and device | |
CN109118076A (en) | Parking stall dispatching method, device, equipment and storage medium | |
CN102012812A (en) | Device, terminal and method for implementing application resource sharing | |
CN102833408B (en) | Method and device for displaying messages | |
CN104168559A (en) | Method, device and system for updating address book | |
CN102045654A (en) | Asynchronous socket communication method and mobile phone positioning system using same | |
CN106162313A (en) | A kind of multi-screen interaction method and system | |
CN107592639A (en) | A kind of terminal device adds the method and system of router white list | |
CN102523236B (en) | Method and equipment for establishing dynamic connection | |
CN101840421A (en) | Update warning method, system and server of personal web page content | |
CN102065389B (en) | Method for receiving and transmitting short messages by mobile terminal and software for implementing same | |
CN101442524A (en) | Method for data communication with national electric network marketing system server | |
CN105187504A (en) | Remote vehicle monitoring method and system based on fusion communication technology | |
CN103944806A (en) | Data transmission method and system based on Wechat platform | |
CN102118854B (en) | The method and system of a kind of mobile phone tracking and shared information | |
CN108111575B (en) | Extensible client and virtual machine data interaction system | |
CN103929720A (en) | Method and system for information push and information sending end |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140402 |
|
RJ01 | Rejection of invention patent application after publication |