CN108156223A - A kind of accurate supplying system of message based on websocket and method - Google Patents

A kind of accurate supplying system of message based on websocket and method Download PDF

Info

Publication number
CN108156223A
CN108156223A CN201711277327.3A CN201711277327A CN108156223A CN 108156223 A CN108156223 A CN 108156223A CN 201711277327 A CN201711277327 A CN 201711277327A CN 108156223 A CN108156223 A CN 108156223A
Authority
CN
China
Prior art keywords
message
websocket
data
push service
web interface
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
Application number
CN201711277327.3A
Other languages
Chinese (zh)
Inventor
谭智勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen City Cat Mdt Infotech Ltd Eagle
Original Assignee
Shenzhen City Cat Mdt Infotech Ltd Eagle
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen City Cat Mdt Infotech Ltd Eagle filed Critical Shenzhen City Cat Mdt Infotech Ltd Eagle
Priority to CN201711277327.3A priority Critical patent/CN108156223A/en
Publication of CN108156223A publication Critical patent/CN108156223A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of accurate supplying systems of the message based on websocket, include:Web interface, Push Service thread, Internet of Things platform and terminal process equipment, the terminal process equipment is used to provide message data, the Push Service thread includes message queue, the web interface is used to send request data to Internet of Things platform, the message data that the Internet of Things platform is used to call Push Service thread and provide terminal process equipment is stored in message queue, the Push Service thread is used to read the message data in message queue, and message data is pushed to web interface.The present invention can effectively avoid waste bandwidth and server resource.

Description

A kind of accurate supplying system of message based on websocket and method
Technical field
The present invention relates to information push method more particularly to a kind of accurate supplying system of message based on websocket and Method.
Background technology
In the prior art, timely mechanics of communication is if the multi-platform application based on web terminal, if more browsers are supported, Can windows, mac system be supported with a project simultaneously.Before Websocket technologies come out not yet, most common of which Be exactly Long-polling technologies and Comet technologies (ajax), this is a feasible mode, but it cannot optimize transmission Message.Ajax polls:Client timing sends ajax requests to server, and server receives horse back returning response after request Information simultaneously closes connection.Advantage is that back-end code is write and is easy to, shortcoming it is big be that have in request most of be useless, waste Bandwidth and server resource, user experience are also excessively poor.
Invention content
The technical problem to be solved in the present invention is, in view of the deficiencies of the prior art, provides one kind and is avoided that waste bandwidth With the accurate supplying system of the message based on websocket and method of server resource.
In order to solve the above technical problems, the present invention adopts the following technical scheme that.
A kind of accurate supplying system of message based on websocket, includes:Web interface, Push Service thread, object Join platform and terminal process equipment, for providing message data, the Push Service thread includes the terminal process equipment Message queue, for sending request data to Internet of Things platform, the Internet of Things platform is used to call Push Service line the web interface Journey and the message data for providing terminal process equipment are stored in message queue, and the Push Service thread is used to read message queue In message data, and message data is pushed into web interface.
Preferably, the web interface is based on html5 websocket protocols and realizes communication.
Preferably, the web interface includes login interface, and login interface carries out password authentification using ajax requests.
Preferably, the form of the message data is text, rich text, file or expands message.
A kind of accurate method for pushing of message based on websocket, this method based on a system realize, the system comprises There are web interface, Push Service thread, Internet of Things platform and terminal process equipment, the terminal process equipment is used to provide message count According to, the Push Service thread includes message queue, the method includes:The web interface sends request data to Internet of Things Platform, the Internet of Things platform calls Push Service thread, and the message data that terminal process equipment is provided is stored in message queue, The Push Service thread reads the message data in message queue, and message data is pushed to web interface.
Preferably, login authentication step is further included:The web interface includes login interface, and login interface uses ajax Request carries out password authentification.
In the accurate supplying system of message disclosed by the invention based on websocket, Push Service is transported in a manner of thread Row.Web interface uses websocket api, an action shaken hands is sent to server, wherein the js introduced can obtain local Computer IP, then designated port to server end create a websocket connection, connection foundation after, client and service Device can carry out data interaction by similar Transmission Control Protocol.Compared to existing technologies, the present invention efficiently solves waste bandwidth And the problem of server resource, and realize the accurate Push Service of timely message based on websocket protocol.
Description of the drawings
Fig. 1 is the composition frame chart of the accurate supplying system of message the present invention is based on websocket.
Specific embodiment
The present invention is described in more detail with reference to the accompanying drawings and examples.
The invention discloses a kind of accurate supplying systems of the message based on websocket, please refer to Fig. 1, include: Web interface 1, Push Service thread 2, Internet of Things platform 3 and terminal process equipment 4, the terminal process equipment 4 are used to provide message Data, the Push Service thread 2 include message queue, the web interface 1 for sending request data to Internet of Things platform 3, The Internet of Things platform 3 is used for the message data deposit message team called Push Service thread 2 and provide terminal process equipment 4 Row, the Push Service thread 2 are used to read the message data in message queue, and message data is pushed to web interface 1.
In above system, websocket is a persistence agreement, and the real-time interaction realized with it is very true real-time Effect as long as the mechanism that developer is shaken hands by one, is set up between client (browser) and server (webserver) The connection of one similar tcp, from this communication between facilitating C-S.In the period connected, client and server end with When mutual PUSH message.So client can actively be transferred data to by saving bandwidth and server.This module application is being taken the photograph Camera is captured to after face, face picture and the data information analyzed is transmitted in the WEB interface of browser shows in real time Show.Web has used at end the websocket of HTML5, also uses spring boot.Spring boot are a kind of micro services Framework, it is whole to be serviced with him to build one based on micro services based on spring websocket.
In the accurate supplying system of message disclosed by the invention based on websocket, Push Service is transported in a manner of thread Row.Web interface uses websocket api, an action shaken hands is sent to server, wherein the js introduced can obtain local Computer IP, then designated port to server end create a websocket connection, connection foundation after, client and service Device can carry out data interaction by similar Transmission Control Protocol.Compared to existing technologies, the present invention efficiently solves waste bandwidth And the problem of server resource, and realize the accurate Push Service of timely message based on websocket protocol.
Further, the web interface 1 is based on html5 websocket protocols and realizes communication.
In the present embodiment, the web interface 1 includes login interface, and login interface asks progress password to be tested using ajax Card.
In practical application, when the request that client transmission is once shaken hands, the websocket operation classes on backstage can be according to access Domain, a Handler is registered according to request path, then collects data, carries out task distribution.Before Handler is registered, According to registered user's information, WebsocketSession is bound, later once there are data that can precisely be pushed to designated user's Client.
In the present embodiment, the form of the message data is text, rich text, file or expands message.
In order to preferably describe technical scheme of the present invention, the invention also discloses a kind of message based on websocket Accurate method for pushing, this method is realized based on a system, is put down the system comprises having web interface 1, Push Service thread 2, Internet of Things Platform 3 and terminal process equipment 4, for providing message data, the Push Service thread 2 includes the terminal process equipment 4 Message queue, the method includes:The web interface 1 sends request data to Internet of Things platform 3, and the calling of Internet of Things platform 3 pushes away Service thread 2 is sent, and the message data that terminal process equipment 4 is provided is stored in message queue, the Push Service thread 2 is read Message data in message queue, and message data is pushed into web interface 1.
Further, the present embodiment further includes login authentication step:The web interface 1 includes login interface, logs in boundary Face carries out password authentification using ajax requests.
In practical application, the above method further includes the process of being implemented as described below:
A, push micro services are run with thread;
B, user logs in, and unique user information is selected to establish connection:Login authentication, login interface using ajax ask into Row password authentification carries out main interface after logining successfully, chooses the video camera in shops, if having been set up connecting, prompts Existing subscriber establishes connection, and it's not true then establishes the websocket connections of video camera unique designation;
C, data are received:The form for receiving data can be text, rich text, file, expand a variety of lattice such as message Formula, the data received here are mainly text, when terminal device processing system send personnel essential information give Internet of Things platform, often Internet of Things platform of secondary transmission will call push micro services, and data, there are in queue;
D, transmission data:The form of transmission data can be text, rich text, file, expand a variety of lattice such as message Formula, the data mainly sent here are texts;Push micro services are run in a manner of thread, and queue is using first in first out class Type can constantly read the data in queue, precisely client is pushed to according to the websocket of foundation connections;
E, data processing:Data are received, transmission data stores data;PC ends can be can come from by receiving data, after other End;Internet of Things platform receives the data that terminal device system is sent, and can assemble data according to critical message searching data library Output model;Corresponding online user will receive corresponding model data;
The above is preferred embodiments of the present invention, is not intended to restrict the invention, all technology models in the present invention Interior done modification, equivalent replacement or improvement etc. are enclosed, should be included in the range of of the invention protect.

Claims (6)

1. the accurate supplying system of a kind of message based on websocket, which is characterized in that include:Web interface (1), push clothes Business thread (2), Internet of Things platform (3) and terminal process equipment (4), the terminal process equipment (4) is for providing message data, institute State Push Service thread (2) and include message queue, the web interface (1) for sending request data to Internet of Things platform (3), The Internet of Things platform (3) disappears for calling Push Service thread (2) and being stored in the message data that terminal process equipment (4) provides Queue is ceased, message data is pushed to Web by the Push Service thread (2) for reading the message data in message queue Interface (1).
2. the accurate supplying system of message as described in claim 1 based on websocket, which is characterized in that the web interface (1) it is communicated based on html5websocket protocol realizations.
3. the accurate supplying system of message as described in claim 1 based on websocket, which is characterized in that the web interface (1) include login interface, login interface carries out password authentification using ajax requests.
4. the accurate supplying system of message as described in claim 1 based on websocket, which is characterized in that the message count According to form be text, rich text, file or expand message.
5. the accurate method for pushing of a kind of message based on websocket, which is characterized in that this method is based on system realization, institute The system of stating includes web interface (1), Push Service thread (2), Internet of Things platform (3) and terminal process equipment (4), the terminal For processing equipment (4) for providing message data, the Push Service thread (2) includes message queue, the method includes:Institute It states web interface (1) and sends request data to Internet of Things platform (3), the Internet of Things platform (3) calls Push Service thread (2), and will The message data deposit message queue that terminal process equipment (4) provides, the Push Service thread (2) are read in message queue Message data, and message data is pushed into web interface (1).
6. the accurate method for pushing of message as claimed in claim 5 based on websocket, which is characterized in that further include login Verification step:The web interface (1) includes login interface, and login interface carries out password authentification using ajax requests.
CN201711277327.3A 2017-12-06 2017-12-06 A kind of accurate supplying system of message based on websocket and method Pending CN108156223A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711277327.3A CN108156223A (en) 2017-12-06 2017-12-06 A kind of accurate supplying system of message based on websocket and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711277327.3A CN108156223A (en) 2017-12-06 2017-12-06 A kind of accurate supplying system of message based on websocket and method

Publications (1)

Publication Number Publication Date
CN108156223A true CN108156223A (en) 2018-06-12

Family

ID=62466516

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711277327.3A Pending CN108156223A (en) 2017-12-06 2017-12-06 A kind of accurate supplying system of message based on websocket and method

Country Status (1)

Country Link
CN (1) CN108156223A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109587210A (en) * 2018-10-22 2019-04-05 太原市高远时代科技有限公司 A kind of implementation method of the information push of more browser-safes
CN109710435A (en) * 2019-01-03 2019-05-03 山东浪潮通软信息科技有限公司 A kind of message delivery method based on the more message queues of support
CN109889454A (en) * 2019-02-26 2019-06-14 浪潮软件集团有限公司 A kind of the message driving means and method of micro services framework
CN111222074A (en) * 2020-01-09 2020-06-02 山东汇贸电子口岸有限公司 Message pushing method and system based on Websocket protocol
CN111711689A (en) * 2020-06-16 2020-09-25 深圳市思迪信息技术股份有限公司 System for live broadcasting image and text in casting and watching system, equipment and storage medium
CN112788128A (en) * 2020-12-31 2021-05-11 青岛海尔科技有限公司 Business information pushing method and device, storage medium and electronic device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103259683A (en) * 2013-05-16 2013-08-21 烽火通信科技股份有限公司 Web network management system second level cache pushing method based on HTML5
CN104010039A (en) * 2014-06-05 2014-08-27 北京航空航天大学 Multi-radar remote monitoring system and method based on WebSocket
CN104811459A (en) * 2014-01-23 2015-07-29 阿里巴巴集团控股有限公司 Processing method, processing device and system for message services and message service system
US20160028780A1 (en) * 2014-07-22 2016-01-28 Nemrude Verzano Managed Device-to-Device Communication in Business Computing Systems
CN106201846A (en) * 2016-06-30 2016-12-07 微梦创科网络科技(中国)有限公司 Method for monitoring performance in automatic test and device
CN107317788A (en) * 2016-04-26 2017-11-03 北京京东尚科信息技术有限公司 Real time data method for pushing and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103259683A (en) * 2013-05-16 2013-08-21 烽火通信科技股份有限公司 Web network management system second level cache pushing method based on HTML5
CN104811459A (en) * 2014-01-23 2015-07-29 阿里巴巴集团控股有限公司 Processing method, processing device and system for message services and message service system
CN104010039A (en) * 2014-06-05 2014-08-27 北京航空航天大学 Multi-radar remote monitoring system and method based on WebSocket
US20160028780A1 (en) * 2014-07-22 2016-01-28 Nemrude Verzano Managed Device-to-Device Communication in Business Computing Systems
CN107317788A (en) * 2016-04-26 2017-11-03 北京京东尚科信息技术有限公司 Real time data method for pushing and device
CN106201846A (en) * 2016-06-30 2016-12-07 微梦创科网络科技(中国)有限公司 Method for monitoring performance in automatic test and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
丁磊: ""基于WebSocket的消息推送***设计与事件匹配技术研究"", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109587210A (en) * 2018-10-22 2019-04-05 太原市高远时代科技有限公司 A kind of implementation method of the information push of more browser-safes
CN109587210B (en) * 2018-10-22 2021-04-20 太原市高远时代科技有限公司 Method for realizing information push compatible with multiple browsers
CN109710435A (en) * 2019-01-03 2019-05-03 山东浪潮通软信息科技有限公司 A kind of message delivery method based on the more message queues of support
CN109889454A (en) * 2019-02-26 2019-06-14 浪潮软件集团有限公司 A kind of the message driving means and method of micro services framework
CN111222074A (en) * 2020-01-09 2020-06-02 山东汇贸电子口岸有限公司 Message pushing method and system based on Websocket protocol
CN111711689A (en) * 2020-06-16 2020-09-25 深圳市思迪信息技术股份有限公司 System for live broadcasting image and text in casting and watching system, equipment and storage medium
CN112788128A (en) * 2020-12-31 2021-05-11 青岛海尔科技有限公司 Business information pushing method and device, storage medium and electronic device

Similar Documents

Publication Publication Date Title
CN108156223A (en) A kind of accurate supplying system of message based on websocket and method
CN110300056B (en) Real-time response type API gateway and request processing method thereof
CN108306877B (en) NODE JS-based user identity information verification method and device and storage medium
CN105847988B (en) Video sharing method and apparatus
WO2016127793A1 (en) Message sending method, apparatus, system, and server
CN109547511B (en) WEB message real-time pushing method, server, client and system
US7987098B2 (en) Interactive computerized communication apparatus and method
CN109327493A (en) A kind of remote medical monitoring system based on cloud and monitoring method
WO2017000572A1 (en) Internet content adaptation protocol-based communication method, client and server
CN114465867B (en) Maintenance method and device of server, storage medium and processor
Rahmatulloh et al. Performance analysis of data transmission on WebSocket for real-time communication
US9582561B2 (en) Size-based data synchronization
CN107809681B (en) It is sliced the method and device of transmission of video
CN103997437A (en) Cloud server registration function testing method
CN111773661B (en) System, method and device for team formation game based on live broadcast interface
CN108632136A (en) Patrol river data processing method and device
WO2017049971A1 (en) Packet transmission method and gateway
CN115348333B (en) Data transmission method, system and equipment based on UDP double-end communication interaction
CN110471776A (en) Applied data communications method, apparatus and system
CN111935316B (en) Method and device for acquiring front-end equipment catalog
JP2007035053A (en) Method for maintaining session between different-terminals
JP2015528260A (en) Method and device for providing communication connections for multiple candidate applications within a mobile device
CN106412138B (en) A kind of method and apparatus that no label precisely pushes
CN111193621A (en) Method for guaranteeing data communication between RTOS (real time operating System) equipment side and server side of Internet of things
CN107911481A (en) Data transfer mode between a kind of application system

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20180612

RJ01 Rejection of invention patent application after publication