CN102420861B - Message monitoring method, device and system of server - Google Patents

Message monitoring method, device and system of server Download PDF

Info

Publication number
CN102420861B
CN102420861B CN201110387148.1A CN201110387148A CN102420861B CN 102420861 B CN102420861 B CN 102420861B CN 201110387148 A CN201110387148 A CN 201110387148A CN 102420861 B CN102420861 B CN 102420861B
Authority
CN
China
Prior art keywords
server
message
monitoring
web services
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201110387148.1A
Other languages
Chinese (zh)
Other versions
CN102420861A (en
Inventor
欧阳辉
王少华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
GCI Science and Technology Co Ltd
Original Assignee
GCI Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by GCI Science and Technology Co Ltd filed Critical GCI Science and Technology Co Ltd
Priority to CN201110387148.1A priority Critical patent/CN102420861B/en
Publication of CN102420861A publication Critical patent/CN102420861A/en
Application granted granted Critical
Publication of CN102420861B publication Critical patent/CN102420861B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a message monitoring method, device and system of a server. The message monitoring method comprises the steps of: setting a monitoring service progress with same progress level as a web service, wherein the monitoring service progress and the web service operate in parallel; and when the monitoring service progress obtains a preset message, sending a warning message to the client end through a conversion connection established with the client end. By adopting the invention, after preset alarm information is obtained through the monitoring progress with same level as the web service progress, the alarm information can be actively sent to the client end in real time, and can be informed to a manager immediately on a browser of the client end. Because the web level monitoring service thread relatively independent to the web service is set, other functions of the original web service are not blocked by monitoring. In addition, a server active message pushing mechanism is created without a request of the client end, therefore, instantaneity and effectiveness of a B/S (Browser/Server) cross-platform information communication and active message pushing of the server to the browser are enhanced.

Description

The message monitoring method of server, Apparatus and system
Technical field
The present invention relates to real-time communication technology, particularly relate to the message monitoring method of server, Apparatus and system.
Background technology
The actualizing technology scheme of current cross-platform real-time communication has two kinds, one starts socket (socket) monitoring service thread at web server end, such as web socket communication technology can realize this function, but also do not become W3C (World Wide Web Consortium, World Wide Web Consortium) standard, only have partial view device to support; Another kind mainly realizes based on poll refresh technique at browser client.Be confined to the request-response mechanism of the network platform, after server end gets warning message, need at server end buffer memory, initiatively cannot notify client browser in time.Client browser only has each separated in time to inquire warning message to server request, and the request of server ability passive response browser, sends to warning message the client browser of request.
Socket communication, in B/S structure, can block the use of browser client to other functions after web terminal enables this watcher thread; Current web socket technology does not become W3C standard, so the compatibility existing problems of browser.
For browser polling technique, its maximum defect is that the warning message that server sends can not notify browser client in real time because browser goes request server to obtain the response of server at regular intervals.And no matter whether server has warning message, browser client all can automatic regular polling, and the wasting of resources is large, and efficiency is poor.Further, the browser client of a server response request, other browser clients must oneself ask just can meet with a response again.
Summary of the invention
In order to solve the problems of the technologies described above, the invention provides the message monitoring method of server, Apparatus and system, the real-time listening of process at the same level can be realized, monitoring information is sent to client in time.
The invention provides a kind of message monitoring method of server, comprising:
Arrange the monitoring service process with web services process peer, described monitoring service process and described web services task parallelism run, the information of monitoring web services process and state;
When described monitoring service process gets presetting message, send alert messages by the session connection of setting up with client to described client, wherein, described session connection be web services end set up with the direct session connection of browser foreground script.
Correspondingly, present invention also offers a kind of message monitoring device of server, comprising:
The monitoring service unit be connected with host process service unit, for arranging the monitoring service process with web services process peer, described monitoring service process and described web services task parallelism run, the information of monitoring web services process and state;
The message capturing unit be connected with described monitoring service unit, for obtaining presetting message;
The message sending unit be connected with described message capturing unit, alert messages is sent to described client for the session connection by setting up with client, wherein, described session connection be web services end set up with the direct session connection of browser foreground script.
Correspondingly, present invention also offers a kind of message monitoring system of server, the server comprising at least one client and be connected with described client, and the external information system be connected with this server,
Described server comprises the message monitoring device of server as previously mentioned, and the host process service unit be connected with described message monitoring device; Described host process service unit, for performing web services process, managing web Service Source;
Described external information system, for sending warning message;
Described client comprises foregoing message reception units and front end display unit.
Implement the present invention, there is following beneficial effect:
The present invention, by after getting default warning message with the monitor process of web services process peer, sends to client on one's own initiative in real time, can notify keeper in time on the browser of client.Owing to being provided with the web rank monitoring service thread relatively independent with web services, make the obstruction that other functions of original web services are not monitored.In addition, a kind of server active push message mechanism has been started, without the need to the request by client.When server socket listens to warning message, be directly sent to one or more browser clients displays of specifying of having logged in, client based on extjs technology, without the need to refreshing interface.Invention enhances B/S (browser/server) cross-platform information communication and server active push message to the real-time of browser and efficiency.
Accompanying drawing explanation
Fig. 1 is the flow chart of the message monitoring method of a kind of server of the present invention;
Fig. 2 is the embodiment flow chart of the message monitoring method of a kind of server of the present invention;
Fig. 3 is the schematic diagram of the message monitoring device of a kind of server of the present invention;
Fig. 4 is the embodiment schematic diagram of the message monitoring device of a kind of server of the present invention;
Fig. 5 is the schematic diagram of the message monitoring system of a kind of server of the present invention.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, the present invention is described in further detail.
Fig. 1 is the flow chart of the message monitoring method of a kind of server of the present invention, comprising:
S101: arrange monitoring service process, starts described monitoring service process when application server starts web services process simultaneously;
S102: when described monitoring service process gets presetting message, by sending alert messages with the session connection of client to described client.
In prior art, the monitor process of warning message is created at web services end, usually we can create the functional module of monitor process as web of a socket service, then trigger in certain button or other events of web and start socket monitor process.It, it is emphasised that monitor the Action Events of web page, then makes corresponding response according to the type servers of Action Events.This request response modes, by foregrounding person as action promoter, backstage provides corresponding service.Do like this and need to use web services main thread to create the new process of socket monitoring service, and usually can enter in the socket monitoring service process created the connection that an Infinite Cyclic waits for socket client, so can not main thread be returned.This time, web services will get clogged, and caused user cannot use other function services of web.
For above-mentioned existing technical problem, the present invention carries out creationary design to monitor process.Monitoring service process is not as a subfunction of web services, no longer triggered by web services and create, arrange monitoring service process as the monitoring finger daemon with web services process, namely a process is with the parallel running of service host process, the information of monitoring web services process and state.So, avoid the drawback of blocking web services to occur.Monitoring service process is as the process with web services host process same level, avoid the circulatory blockage web services of monitoring service process, and reach monitoring service process and share web services resource (request, the monitoring service processes such as session and web services are in same Engineering Service, therefore can share all web resources by servelet framework) object.
In addition, in existing B/S (browser/server) structure, web services is all realize based on request-response mechanism.Only have browser client to send request, web server just can respond and send information to browser, and web server initiatively can't send information to browser.So traditional message communication mechanism have employed the technology of browser poll, and namely browser sends request and inquires whether client has information to return at regular intervals.This method, resource overhead is large, and no matter whether server has information client side all to want polling, waste resource.When there is information delay, after server obtaining information, initiatively can not be sent to browser immediately, wait until that browser inquiry request arrives and could respond, being unfavorable for real-time communication.There is a kind of new technology web socket based on socket at present, can create on script and the connecting communication of server.But same exist problems such as blocking web services, and web socket does not become the compatibling problem that W3C standard exists browser.
In order to settlement server initiatively realizes real-time communication problem to browser pushed information.We set up the direct session connection with browser foreground script at web services end, make it possible to directly to arrange browser script function parameter at web server end and directly call, even can directly directly create script function at web server end and perform at foreground browser.These functions all realize based on scriptsession technology.Scriptsession is similar to one of session and the connection of client, but granularity is thinner, the concrete connection having pointed to certain page, and the relevant information remaining this page comprises script, therefore parameter direct invoking page script in backstage can be used to perform by sscriptsession, even directly perform at the page after background service creates function.Thus reach backstage web services directly to foreground browser pushed information and display object.When described monitoring service process gets presetting message, send alert messages by the session connection of setting up with client to described client.
Fig. 2 is the embodiment flow chart of the message monitoring method of a kind of server of the present invention, comprising:
S201: simultaneously start described monitoring service process when application server starts web services process.
S202: the monitoring service process with web services process peer is set, described monitoring service process and described web services task parallelism run;
S203: described monitoring service process receives the communication information of external information system and described server, and this communication information is transmitted to described web services process.
S204: when described monitoring service process gets presetting message, sends alert messages by the session connection of setting up with client to described client.
S205: create front-end user interface in described client, show described alert messages.
At application server (as: tomcat, weblogic etc.) start web services time start described monitoring service process simultaneously, like this, monitoring service process just becomes the process with web services host process same level, avoid the circulatory blockage web services of monitoring service process, and reach monitoring service process and share web services resource.Be conducive to monitoring web services process in time.
Arrange the monitoring service process with web services process peer, described monitoring service process and described web services task parallelism run, and be conducive to monitoring service process and share web services resource, described web services resource mainly comprises request, session.Monitoring service process and web services are in same Engineering Service, can also share all web resources by servelet framework.
Concrete Software implementations comprises: first, writes monitoring service process functional module.Functional module main classes inherits ServletContextListener, and (this interface is the base interface class that Servlet framework provides, be used for realizing other monitor process of server level as an entrance) interface, and realize the contextInitialized method (the method is an abstract method in ServletContextListener class, is realized the concrete logic function of monitoring service process by this method) of interface.Realize the establishment of monitoring service process in this method.Then, in the web.xml file of web services engineering, the main classes that listener parameter is monitoring service process is monitored in configuration.And context-param parameter (this parameter needs for providing ServletContextListener some the technical parameter desired values used: such as port numbers etc.) can be set for main classes.Like this, when application server (such as tomcat) starts, web services process and monitoring service process will start simultaneously, and can mutual communication shared resource.Above-mentioned software realization mode is an instantiation, can not be used for limiting protection scope of the present invention, and all similar conversion of making based on thinking of the present invention and equivalent replacement all should within protection scope of the present invention.
Described monitoring service process is except monitoring information and the state of Web service process.Described information comprises the communication information receiving external information system and described server, and this communication information is transmitted to described web services process.Described state comprises, and whether web services process blocks.
When described web services process generation information occlusion, there is the reason of this obstruction in described monitoring service process detection, postpones the information forwarding described external message system.
Create front-end user interface in described client, show described alert messages.
Concrete Software implementations comprises: first, when browser client logs in, (described Scriptsession is beautiful for the session of javascript script level to get the Scriptsession of the system main frame page, be mainly used in indicating in web services navigating to the concrete page) and the relevant information such as user name, safeguard that (described hashmap is equivalent to the bivariate table that have recorded attribute-name key and property value value to a hashmap, there is the advantage of fast access), using the key value of user name as hashmap, Scriptsession object is kept in system variable as the value value of hashmap, send for message and use.Secondly, after monitoring service process gets the warning message of cloud platform, obtain the information in hashmap, and utilize scriptsession to send warning message to the browser client of user.Finally, because scriptsession is calling of script level, foreground adopts the technology such as extjs to want to combine, and reaches without refreshing display, the expression effects such as lower left corner Pop-up message frame.Described ExtJS is one and writes with javascript, is mainly used in creating front-end user interface, and it is a front end ajax framework irrelevant with backstage technology.Above-mentioned software realization mode is an instantiation, can not be used for limiting protection scope of the present invention, and all similar conversion of making based on thinking of the present invention and equivalent replacement all should within protection scope of the present invention.
Fig. 3 is the schematic diagram of the message monitoring device of a kind of server of the present invention, comprising:
The monitoring service unit be connected with host process service unit, for arranging the monitoring service process with web services process peer, described monitoring service process and described web services task parallelism run;
The message capturing unit be connected with described monitoring service unit, for obtaining presetting message;
The message sending unit be connected with described message capturing unit, sends alert messages for the session connection by setting up with client to described client.
Fig. 3 and Fig. 1 is corresponding, the above-mentioned operational mode of each unit and identical in method.
Fig. 4 is the embodiment schematic diagram of the message monitoring device of a kind of server of the present invention;
As shown in Figure 4, described monitoring service unit specifically comprises:
The monitoring start unit be connected with application server, starts described monitoring service process in starting web services process at application server simultaneously;
Being connected to the information retransmission unit between external information system and described host process service unit, for receiving the communication information of external information system and described server, and this communication information being transmitted to described web services process.
As shown in Figure 4, described monitoring service unit, also comprises:
The obstruction processing unit be connected with described information retransmission unit, for detecting the reason that described web services process occurs to block, postpones forwarding described communication information to described web services process.
Fig. 4 and Fig. 2 is corresponding, the above-mentioned operational mode of each unit and identical in method.
Fig. 5 is the schematic diagram of the message monitoring system of a kind of server of the present invention, the server comprising at least one client and be connected with described client, and the external information system be connected with this server,
Described server comprises the message monitoring device of server as described in any one of claim 5 to 7, and the host process service unit be connected with described message monitoring device; Described host process service unit, for performing web services process, managing web Service Source;
Described external information system, for sending warning message;
Described client comprises: the message reception units corresponding with described message sending unit, for receiving described alert messages; The front end display unit be connected with described message reception units, for creating front-end user interface in described client, shows described alert messages.
Described server can as cloud control desk; Described external information system can as cloud platform, and this system can have unix or Linux system to be achieved; Described client can as browser end.By above-mentioned solution, the clog-free of the warning message cross platform system of cloud platform, cloud control desk and browser end can be achieved, real-time transmission effect.The validity of system communication, real-time and stability are improved.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add required hardware platform by software and realize, and can certainly all be implemented by hardware.Based on such understanding, what technical scheme of the present invention contributed to background technology can embody with the form of software product in whole or in part, this computer software product can be stored in storage medium, as ROM/RAM, magnetic disc, CD etc., comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform the method described in some part of each embodiment of the present invention or embodiment.
Above-described embodiment of the present invention, does not form limiting the scope of the present invention.Any amendment done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within claims of the present invention.

Claims (7)

1. a message monitoring method for server, is characterized in that, comprising:
Start monitoring service process when application server starts web services process simultaneously, monitoring service process with web services process peer is set, described monitoring service process and described web services task parallelism run, the information of monitoring web services process and state; Described monitoring service process receives the communication information of external information system and server, and this communication information is transmitted to described web services process;
When described monitoring service process gets default warning message, alert messages is sent to described client by the session connection of setting up with client, wherein, described session connection be web server end set up with the direct session connection of browser foreground script.
2. the message monitoring method of server according to claim 1, is characterized in that:
When described web services process generation information occlusion, there is the reason of this obstruction in described monitoring service process detection, postpones forwarding described communication information to described web services process.
3. message monitoring method according to claim 1, is characterized in that, described by with the session connection of client to after described client sends the step of alert messages, comprising:
Create front-end user interface in described client, show described alert messages.
4. a message monitoring device for server, is characterized in that, comprising:
The monitoring service unit be connected with host process service unit, for arranging the monitoring service process with web services process peer, described monitoring service process and described web services task parallelism run, the information of monitoring web services process and state; Wherein, web services process is performed by described host process service unit;
The message capturing unit be connected with described monitoring service unit, for obtaining default warning message;
The message sending unit be connected with described message capturing unit, alert messages is sent to described client for the session connection by setting up with client, wherein, described session connection be web server end set up with the direct session connection of browser foreground script;
Wherein, described monitoring service unit also comprises:
The monitoring start unit be connected with application server, starts monitoring service process in starting web services process at application server simultaneously;
Being connected to the information retransmission unit between external information system and described host process service unit, for receiving the communication information of external information system and described server, and this communication information being transmitted to described web services process.
5. the message monitoring device of server according to claim 4, is characterized in that, described monitoring service unit, also comprises:
The obstruction processing unit be connected with described information retransmission unit, for detecting the reason that described web services process occurs to block, postpones forwarding described communication information to described web services process.
6. the message monitoring device of server according to claim 4, is characterized in that, described client comprises:
The message reception units corresponding with described message sending unit, for receiving described alert messages;
The front end display unit be connected with described message reception units, for creating front-end user interface in described client, shows described alert messages.
7. a message monitoring system for server, the server comprising at least one client and be connected with described client, and the external information system be connected with this server, is characterized in that:
Described server comprises the message monitoring device of server as described in any one of claim 4 or 5, and the host process service unit be connected with described message monitoring device; Described host process service unit, for performing web services process, managing web Service Source;
Described external information system, for sending described default warning message;
Described client comprises message reception units as claimed in claim 6 and front end display unit.
CN201110387148.1A 2011-11-29 2011-11-29 Message monitoring method, device and system of server Active CN102420861B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110387148.1A CN102420861B (en) 2011-11-29 2011-11-29 Message monitoring method, device and system of server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110387148.1A CN102420861B (en) 2011-11-29 2011-11-29 Message monitoring method, device and system of server

Publications (2)

Publication Number Publication Date
CN102420861A CN102420861A (en) 2012-04-18
CN102420861B true CN102420861B (en) 2015-04-29

Family

ID=45945093

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110387148.1A Active CN102420861B (en) 2011-11-29 2011-11-29 Message monitoring method, device and system of server

Country Status (1)

Country Link
CN (1) CN102420861B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102868759B (en) * 2012-09-28 2016-07-06 方正国际软件有限公司 The system of server controls browser interface Refresh Data and method thereof
CN102938783A (en) 2012-10-30 2013-02-20 中兴通讯股份有限公司 Socket processing method and device and Web server
CN103995751B (en) * 2014-05-30 2019-06-07 上海斐讯数据通信技术有限公司 A kind of Overpassing Platform by Using system and method
CN105944378B (en) * 2016-05-12 2019-08-23 武汉斗鱼网络科技有限公司 The task of a kind of page of trip configures system and method
CN113378006B (en) * 2021-07-04 2024-02-09 芯河半导体科技(无锡)有限公司 Configuration management framework based on xml storage

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1521663A (en) * 2003-02-14 2004-08-18 ���ǵ�����ʽ���� Database table modeling and event handling method for real time alarm management
CN1870508A (en) * 2005-05-25 2006-11-29 中兴通讯股份有限公司 Method for displaying real-time data in web network management system
CN102123295A (en) * 2010-12-16 2011-07-13 广州杰赛科技股份有限公司 Method and system for safety monitoring of geographical informatization of HFC (hybrid fiber coax) network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1521663A (en) * 2003-02-14 2004-08-18 ���ǵ�����ʽ���� Database table modeling and event handling method for real time alarm management
CN1870508A (en) * 2005-05-25 2006-11-29 中兴通讯股份有限公司 Method for displaying real-time data in web network management system
CN102123295A (en) * 2010-12-16 2011-07-13 广州杰赛科技股份有限公司 Method and system for safety monitoring of geographical informatization of HFC (hybrid fiber coax) network

Also Published As

Publication number Publication date
CN102420861A (en) 2012-04-18

Similar Documents

Publication Publication Date Title
CN102420861B (en) Message monitoring method, device and system of server
US7130899B1 (en) Robust indication processing
CN102710554B (en) The service state detection method of distributed information system and distributed information system
CN107645529B (en) Heartbeat packet sending method and device
CN102255935B (en) Cloud service consuming method, cloud service intermediary and cloud system
CN105635180B (en) Information push method and device
CN103746897B (en) Devices, method and system for notifying user state
TW201526654A (en) System and method for implementing video calls
CN105874773B (en) Task processing device, intelligent equipment, task processing method and baseband processor
CN110691398B (en) Network interaction method, system, equipment and storage medium of intelligent equipment
CN109151056B (en) Method and system for pushing messages based on Canal
US20190238352A1 (en) Communication Method and Apparatus
CN111988386A (en) Cloud management platform real-time message pushing method and device and computer readable medium
CN111314416B (en) Data synchronization method, device, system, equipment and storage medium
RU2580438C2 (en) Method (versions) of processing incoming electronic message and the server (versions)
RU2580437C2 (en) Method of handling incoming electronic message and server
CN106789913B (en) User account management method and device
CN109302435B (en) Message publishing method, device, system, server and computer readable storage medium
CN106230939B (en) A kind of application operation and monitoring method and system
CN103581300B (en) The interactive online security method of conference system information material
WO2016197851A1 (en) Method and apparatus for managing notification information
US10063648B2 (en) Relaying mobile communications
CN106464728A (en) Method of handling notification channel disconnection
TWI513236B (en) Method, device and system for conversational notifications in instant messaging application
CN114900526B (en) Load balancing method and system, computer storage medium and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant