CN109302496A - A kind of novel real time information stream exchange method - Google Patents
A kind of novel real time information stream exchange method Download PDFInfo
- Publication number
- CN109302496A CN109302496A CN201811429767.0A CN201811429767A CN109302496A CN 109302496 A CN109302496 A CN 109302496A CN 201811429767 A CN201811429767 A CN 201811429767A CN 109302496 A CN109302496 A CN 109302496A
- Authority
- CN
- China
- Prior art keywords
- server
- real time
- client
- link
- time information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 230000006854 communication Effects 0.000 claims abstract description 16
- 238000004891 communication Methods 0.000 claims abstract description 15
- 238000003860 storage Methods 0.000 claims description 8
- 230000003993 interaction Effects 0.000 claims description 5
- 230000006641 stabilisation Effects 0.000 claims 1
- 238000011105 stabilization Methods 0.000 claims 1
- 230000008569 process Effects 0.000 abstract description 20
- 230000004044 response Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 230000002452 interceptive effect Effects 0.000 description 3
- 238000013500 data storage Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 235000014510 cooky Nutrition 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000004321 preservation Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
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
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- 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/14—Session management
- H04L67/141—Setup of application sessions
Abstract
The present invention provides a kind of novel real time information stream exchange methods, originating end A sends request network address, label is identified comprising A in network address, server is handled after receiving network address, it is established by the link that the virtual server that WebSockets agreement is formed carries out receiving end, transmitting terminal is tentatively established with receiving end B, realize that WebSockets is established again between each communication, it is completed until establishing, form an effective long link, agreement carries out heartbeat by other processes and port and examines work simultaneously, so that user can mutually not between pushed data in real time, it is excessively frequent server access has been well solved, primary communication consumes the problem of a large amount of servers money.
Description
Technical field
The present invention relates to Internet technical fields, specifically, realizing that real time information stream is handed over about in the instant communications field
Mutual method.
Background technique
Internet web page end realizes that information flow interactive process is needed by following steps at present:
The first step, originating end check that process, current process state are the free time, then response server connects, and otherwise waits for;
Second step, the unique identification label of the information of transmission and recipient is sent server by originating end, after server response
Carry out data storage;
Third step, receiving end Refresh Servers need to confirm the information responded either with or without needs, relevant information are read if having;
4th step, after the completion of receiving end is read, label has been read in storage;
5th step, originating end are also required to constantly Refresh Servers, to obtain information relevant to originating end, read recipient
Success has been read, has indicated that the information completes a sending function.
Communication is achieved, and to will lead to server access excessively frequent, and primary communication needs to consume vast resources, to service
Device increases a large amount of pressure, in terms of process, will lead to exclusive process, session once establish, can occupy entire browser into
Journey, if interaction can be clearly felt that Caton phenomenon when more.
Summary of the invention
To solve the above-mentioned problems, the present invention provides a kind of novel real time information stream exchange methods, which is characterized in that packet
Include originating end, server end, WebSockets agreement or MQTT agreement, receiving end.
1, originating end: the dialog box that can send information write as by H5 code.
2, server end: erection has got well PHP running environment and has been mounted with the server of database.
3, WebSockets agreement: it is a kind of network communication protocol, is open source protocol.
4, receiving end: by H5 written in code at reception message box.
Firstly, originating end A sends request network address, it include that A identifies label in network address, after server receives network address
Reason is established by the link that the virtual server that WebSockets agreement is formed carries out receiving end, and transmitting terminal and receiving end B are carried out just
Step is established, and is realized that WebSockets is established again between each communication, is completed until establishing, effective long material is thus formed one
Link, while agreement carries out heartbeat by other processes and port and examines work, such user can mutually not between real-time push
Data.
The present invention in this way has well solved that server access is excessively frequent, and primary communication consumes asking for a large amount of servers moneys
Topic, is thus shared the operating pressure of server, simultaneously because multithreading operation combination heartbeat by WebSockets agreement
Packet, it is more smooth in information flow communication process, without may feel that delay phenomenon.
Secondly, originating end A sends request network address, server is given WebSocket agreement, is established by WebSocket agreement
Long link, in process of data communication, is stored data by client in the way of data group, without continually accessing clothes
Be engaged in device, and use heartbeat packet function, realize scheduled store, etc. the processes free time when stored, the invention is also in relation with user
Response action carries out corresponding inter-work, such as all realization data storages such as user closes window, user's selection is kept records of
To library.
The invention has well solved the excessively frequent access server or database of data, be greatly reduced server and
The operation such as access, storage, reading of database.
Finally, after the completion of long link is established, agreement prison is realized on backstage for the invention in order to ensure that real time information is more smooth
It listens process, avoids the exclusive of process, can there is multichannel to carry out data transmission, i.e., when user loads other objects, Bu Huiying
Ring data communication, in multitask, realize carry out Cheng Jinhang load balance process, well solved that amount of access is big to block
Or delay phenomenon.
The embodiment of the invention provides the solutions of real time information stream exchange method, and information flow is allowed to pass through from customer end A
Server is crossed to real-time, the smooth solution of customer end B, increases substantially user experience.
Other features and advantages of the present invention will illustrate in the following description, also, part becomes from specification
It is clear that understand through the implementation of the invention.The purpose of the present invention and other in specification, claims and attached
Though the special structure pointed out is achieved and obtained in figure.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, it is cited below particularly and preferably applies example, and cooperate institute
Attached drawing is described in detail below.
Detailed description of the invention
It, below will be to attached drawing needed in the embodiment in order to illustrate more clearly of the technical solution of present example
It is briefly described, it should work as understanding, the following drawings only illustrates certain examples of the invention, therefore is not construed as pair
The restriction of range for those of ordinary skill in the art, can also be according to this under the premise of not paying creative labor function
A little attached drawings obtain other accompanying drawings.
Fig. 1 illustrates a kind of Theoretical Framework schematic diagram of real time information stream exchange method provided by the embodiment of the present invention.
Fig. 2 illustrates the practical application schematic diagram of the interaction method of another kind real time information stream provided by the embodiment of the present invention.
Specific embodiment
To better understand the objects, features and advantages of the present invention, with reference to the accompanying drawing with implementation case
Technical solution of the present invention will be clearly and completely described in example, it is clear that described embodiment is a part of the invention
Embodiment, instead of all the embodiments, based on the embodiments of the present invention, ability those of ordinary skill is not making creation
Property labour under the premise of every other embodiment obtained, belong to the scope of the present invention.
[embodiment one]
Realize that customer end A sends website address request to server based on Web as shown in figure, server is given after receiving address
WebSockets agreement is handled, and can send return information in processes in treatment process to client, at the same client with
WebSockets agreement in service creates link, completes once link is established, so that it may the interaction of real-time implementation information flow.
As shown in Figure 2, step S110, the agreement in server always all can be in listening port information, if there is response will
Processing in time, without waiting users to have information stream to come, adding process queue is lined up etc., then carries out corresponding position
Reason.Information delay can be generated in this way, to influence user experience.The present invention realizes management of process by port snoop, very well
Ground solves such problems.
Step S120, all online numbers of server statistics, and unique identification ID number is distributed, and it can be numeric type, it can also
To be letter, it is also possible to the combination or mixed type of character and digit, but to ensure being unique.
Step S130, server determine after each unique ID number according to send and receive request be transmitted through come identification id
Number, carry out data communication.Data type is unlimited, can be picture and text, is also possible to audio etc..In order to ensure during realization
The stability of system needs to carry out escape to additional character, for example, the single quotation marks in English, in the code that even numbers draws etc often
Use symbol.
Step S140, in message transmitting procedure, for the fixed type in preferably identification information inside, we will usually determine
Information labels msg, label allocation cog, whether transmit successfully label Issuccee, error label error etc., such operation
It is convenient that client storage deduction is carried out to data after being also convenient for.Step S160 can introduce the storage of data.
Step S150, creates WebSocket connection, and the unique ID number of server communication two party as needed carries out creation length
Link, so-called long link is exactly to allow both sides by a certain channel, exclusively enjoys resource and uninterruptedly communicates, this is also us to allow
Continual necessary implementation is linked up between user.
Wherein WebSocket is a kind of evolution agreement, is similar to Transmission Control Protocol, http protocol.
It further illustrates, after the completion of long link is established, uninterrupted communication can be realized between user, is also achieved that
Our real time information stream exchange methods.
Step S160, in information flow interactive process, in order to mitigate or save server resource, we will be deposited by local
Storage, establishes msg array of data, the information exchanged every time is existed in local client.
In order to avoid information loss, data buffer storage is carried out using cookies, while creating heartbeat packet, setting time carries out
Data sync storage.Here it is described in two S160 of figure, timing is synchronous to store.
[embodiment two]
It is realized based on APP, introduce two big mainstream applications ends herein, other application end solution is the same.
At the end android/IOS, such as two institute of figure is passed through with the user terminal A of android/IOS platform development by step S110
The port android/IOS Socket sends so-and-so network address, while delivery port information, unique ID of user terminal A to server
Number.
In server end, by step S120 into the collection of online demographics and ID number, identification is operated.Step is pressed again
S130 carries out the interactive operation of information flow according to recognition result, and server end is to user, and data are all processed, then are passed through
Distribution processor.
In android/IOS, the exploitation of client, while fixed common information labels are completed using JAVA or swift
Msg, label allocation cog, label Issuccee, error label error whether are transmitted successfully etc., wherein msg is that S160 does data
Caching prepares.
Android/IOS is carried out the creation of long link by step S150 by the port Socket in JAVA or swift
And complete to establish, it prepares for the frequent communication in later period.
The caching work of data is finally carried out in the client of android/IOS, while heartbeat packet is initiated by server
Function realizes that timing is stored, and free data is lost, and state judgement can also be done with client when closed, carries out preservation behaviour to data
Make.
In addition, each functional block in each embodiment of the present invention may gather together to form an independent part,
It can be each functional module individualism, an independent portion can also be integrated to form with two or more functional modules
Point.
It should be noted that, in this document, the terms "include", "comprise" or other any other variants be intended to it is non-
It is exclusive to include, so that the process, method, article or equipment for including a series of elements not only includes those elements,
But also other elements including being not explicitly listed, or further include solid by this process, method, article or equipment
Some elements.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including
There is also other identical elements in the process, method, article or equipment of the element.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, and
Without departing from the spirit or essential characteristics of the present invention, the present invention can be realized in other specific forms.Therefore, nothing
By from the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended
Claim rather than above description limit, it is intended that the institute that will be fallen within the meaning and scope of the equivalent elements of the claims
It changes and is included within the present invention.Appended drawing reference any in claim should not be construed as limiting the claims involved.
Claims (5)
1. a kind of novel real time information stream exchange method, client cooperates WebSocket agreement to establish length simultaneously by server
Link realizes that multi-process carries out the realization of information flow interaction simultaneously, it is characterised in that: length links between client and server
It establishes, information flow is locally stored and the combination of heartbeat packet realizes that timing stores, comprising the following steps:
The first step, customer end A initiate website address request to server, include port in network address;
Second step, server are given network address to WebSocket and are handled;
Third step, creation WebSocket link, and carry out link creation whether successful redundancy determination, it is ensured that the stabilization of system;
4th step realizes the multi-course concurrency communication of multichannel;
5th step carries out local data cache, reuses heartbeat packet function and realizes data timing storage.
2. a kind of novel real time information stream exchange method according to claim 1, it is characterised in that: client is long with server
The foundation of link and the function of multichannel realize multi-process while carrying out information flow interaction.
3. a kind of novel real time information stream exchange method according to claim 1, it is characterised in that: the creation of local label,
It using client cache function, carries out array mode and data is temporarily stored, while cooperating heartbeat packet function, realize information flow
Timing store function.
4. according to claim 1, it is characterised in that: basic WebSocket server disposition method, including client, clothes
Business device, WebSocket agreement.
5. according to claim 2, it is characterised in that: the Multi-channel multi-line and mode of client are established and applied.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811429767.0A CN109302496A (en) | 2018-11-28 | 2018-11-28 | A kind of novel real time information stream exchange method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811429767.0A CN109302496A (en) | 2018-11-28 | 2018-11-28 | A kind of novel real time information stream exchange method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109302496A true CN109302496A (en) | 2019-02-01 |
Family
ID=65144844
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811429767.0A Pending CN109302496A (en) | 2018-11-28 | 2018-11-28 | A kind of novel real time information stream exchange method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109302496A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111949914A (en) * | 2020-08-14 | 2020-11-17 | 杭州电子科技大学 | Remote FPGA (field programmable Gate array) experimental system and method based on Web end and combined with MOOC (field programmable Gate array) platform |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103067292A (en) * | 2012-12-26 | 2013-04-24 | 华为技术有限公司 | Websocket-transmission-based load balancing method and device |
CN105337973A (en) * | 2015-10-27 | 2016-02-17 | 上海钢富电子商务有限公司 | Message exchange method and system |
US20170054766A1 (en) * | 2009-05-01 | 2017-02-23 | Kaazing Corporation | Enterprise client-server system and methods of providing web application support through distributed emulation of websocket communications |
CN106850745A (en) * | 2016-12-23 | 2017-06-13 | 北京五八信息技术有限公司 | A kind of real-time synchronization method and device |
CN107342934A (en) * | 2017-06-19 | 2017-11-10 | 浪潮金融信息技术有限公司 | A kind of mixed mode Mobile solution real-time messages method for pushing and system based on WebSocket |
-
2018
- 2018-11-28 CN CN201811429767.0A patent/CN109302496A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170054766A1 (en) * | 2009-05-01 | 2017-02-23 | Kaazing Corporation | Enterprise client-server system and methods of providing web application support through distributed emulation of websocket communications |
CN103067292A (en) * | 2012-12-26 | 2013-04-24 | 华为技术有限公司 | Websocket-transmission-based load balancing method and device |
CN105337973A (en) * | 2015-10-27 | 2016-02-17 | 上海钢富电子商务有限公司 | Message exchange method and system |
CN106850745A (en) * | 2016-12-23 | 2017-06-13 | 北京五八信息技术有限公司 | A kind of real-time synchronization method and device |
CN107342934A (en) * | 2017-06-19 | 2017-11-10 | 浪潮金融信息技术有限公司 | A kind of mixed mode Mobile solution real-time messages method for pushing and system based on WebSocket |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111949914A (en) * | 2020-08-14 | 2020-11-17 | 杭州电子科技大学 | Remote FPGA (field programmable Gate array) experimental system and method based on Web end and combined with MOOC (field programmable Gate array) platform |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102710748B (en) | Data capture method, system and equipment | |
US9929984B2 (en) | Method and computer program product for establishing real-time communications between networked computers | |
US8671145B2 (en) | Method and computer program product for establishing real-time communications between networked computers | |
CN110300050A (en) | Information push method, device, computer equipment and storage medium | |
CN109995801B (en) | Message transmission method and device | |
CN102523207A (en) | VNC (Virtual Network Computer)-based remote resource access method and proxy device | |
CN108390950A (en) | A kind of information push method, device and equipment | |
CN103139051A (en) | Instant messaging communication method based on Websocket protocol | |
CN101917394B (en) | Middleware system for sharing data in mobile phone equipment and working method | |
CN108712457A (en) | Back-end server dynamic load method of adjustment and device based on Nginx reverse proxys | |
CN109274747A (en) | Market gateway system and its processing method | |
CN107919971A (en) | Method, apparatus and system for audio/video communication connection disaster tolerance | |
CN107438084A (en) | Multi-client data synchronization method and apparatus | |
CN108124007A (en) | The method and apparatus of message data real-time Transmission | |
CN110049134A (en) | Customer service chat method, device, customer side, server and storage medium | |
CN113938516A (en) | Method and system for synchronously realizing transaction processing of heterogeneous system | |
CN109302496A (en) | A kind of novel real time information stream exchange method | |
CN102891851A (en) | Access control method, equipment and system of virtual desktop | |
CN103595611B (en) | The realization method and system and equipment of instant messaging application | |
CN112187887A (en) | Webpage real-time communication method and device for multiple pages and electronic equipment | |
CN201854301U (en) | Middleware system for sharing data on mobile phones | |
CN105188087A (en) | Business communication method and system based on short message gateway | |
CN115277649A (en) | Method and device for collaboratively editing document in multimedia conference scene | |
CN102165484A (en) | Role-independent context exchange | |
CN101581984A (en) | Equipment and method with virtual mouse guide based on remote cross-network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20190201 |
|
WD01 | Invention patent application deemed withdrawn after publication |