CN111124703A - Method and system for automatically reminding processing work in cluster environment - Google Patents

Method and system for automatically reminding processing work in cluster environment Download PDF

Info

Publication number
CN111124703A
CN111124703A CN201911168550.3A CN201911168550A CN111124703A CN 111124703 A CN111124703 A CN 111124703A CN 201911168550 A CN201911168550 A CN 201911168550A CN 111124703 A CN111124703 A CN 111124703A
Authority
CN
China
Prior art keywords
message
client
data
activemq
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911168550.3A
Other languages
Chinese (zh)
Other versions
CN111124703B (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.)
State Grid Shandong Electric Power Co Ltd
Shandong Luneng Software Technology Co Ltd
Original Assignee
State Grid Shandong Electric Power Co Ltd
Shandong Luneng Software 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 State Grid Shandong Electric Power Co Ltd, Shandong Luneng Software Technology Co Ltd filed Critical State Grid Shandong Electric Power Co Ltd
Priority to CN201911168550.3A priority Critical patent/CN111124703B/en
Publication of CN111124703A publication Critical patent/CN111124703A/en
Application granted granted Critical
Publication of CN111124703B publication Critical patent/CN111124703B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Abstract

The invention discloses a method and a system for automatically reminding processing work in a cluster environment, wherein the method comprises the following steps: logging in a system through a client, and realizing event-driven communication between the client and a server by using a long-term http connection; and the server receives the subscription added by the client user as required, and displays the push data after the push data is sent to the specified client browser. The patent ensures one hundred percent validity of data based on exact requirements when sending messages to users.

Description

Method and system for automatically reminding processing work in cluster environment
Technical Field
The invention belongs to the technical field of server side message pushing, and particularly relates to a method and a system for realizing a server message pushing mechanism in a cluster mode.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
In Web applications, when a client, such as a browser, needs to obtain latest background data immediately and display the latest background data to a user, a polling mode is usually adopted, and such polling requests are mostly invalid (possibly, background data does not change) and are relatively weak in instantaneity, and pressure on foreground and background is relatively large.
In the prior art, no matter whether background data changes or not, polling is performed on the data from the background all the time, for example, the data is taken once every 5 seconds, when the background data changes within 5 seconds, the data cannot be displayed immediately due to the need of waiting for 5 seconds, and the data can be displayed after being taken by polling processing after 5 seconds. In addition, if the polling is performed 12 times without changing the background data within 1 minute, the 12 times of data fetching are the same, so the 12 times of data fetching are invalid.
With the continuous development of the information-based society, timely and accurate information acquisition plays a very important role in the correct decision of people, and also provides new requirements for various technologies.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a method for realizing a server message pushing mechanism in a cluster mode, which not only can realize the communication among cluster nodes, but also can meet the requirement that a server actively pushes messages to a client under a cluster environment, meet the requirement of instantaneity and reduce the pressure on foreground and background caused by polling.
In order to achieve the above object, one or more embodiments of the present invention provide the following technical solutions:
a method for automatically reminding processing work in cluster environment comprises the following steps:
logging in a web application system through a client browser, and realizing event-driven communication between a client and a server by using a long-term http connection;
the client sends the information request to the server by adding various subject message types needing to be subscribed, and the client browser receives the data actively sent by the server and displays the data.
The technical scheme is that a client logs in an application system, an activemq configuration item is loaded after a project is started, two message destinations are generated in spring and used for pushing messages to the activemq when the messages are sent, one is a queue destination, and the other is a theme destination; and loading a listener for monitoring the queue and the theme in the message middleware at the same time, and immediately receiving and processing the message when a new message exists.
According to the further technical scheme, after the server side generates data needing to be pushed, the server side analyzes the data to obtain a receiving object and pushes an appointed client side, a set destination and a message body are pushed to activemq through a public method, and the activemq stores the data in a table after receiving the message and waits for a listener to read the data.
In a further technical scheme, after finding the message to be processed, the client monitor reads the message from the activemq, and the activemq automatically determines whether to empty the message according to the type of the message, namely the queue or the theme.
According to the further technical scheme, after a monitor obtains a message, a message body is analyzed to obtain message content and receiver information, an online user list is obtained through a pushlet, a message receiver in the online user list is found out, the message is pushed to a client browser in real time, if a user corresponding to the client browser is not online, the message is persisted to a database, and after the message is online, a message to be processed is searched and displayed to the user.
According to the further technical scheme, after the client side has the message to be processed, the system sets the message to be in a read state after the message is processed by clicking, and the read message is not displayed after logging in again.
In the further technical scheme, the client logs out of the system to cancel the subscription, logs out the session and does not receive the message any more.
A system for automatically alerting processing jobs in a clustered environment, comprising: a client and a server;
logging in a system through a client, and realizing event-driven communication between the client and a server by using a long-term http connection;
and the server receives a subscription request added by a client user as required, and displays the push data to a specified client browser.
The above one or more technical solutions have the following beneficial effects:
the client user is free from installing any software, and only a browser is needed: pushlet is a Servlet-based mechanism for realizing a comet architecture, and data is directly pushed (push) from a Java object at a server end to a (dynamic) HTML page of a browser at a client end without any Java applet or plug-in, so that a user is free from installing any software.
The client side displays multiple styles of effects. The display of the messages on the browser is in seamless connection with the javascript, the received and displayed messages are completely composed of js and html elements, and the browser can form various display effects according to needs after receiving the messages.
And meets the requirement of instantaneity. The pushlet message is sent by using an http protocol, and under the condition of good network state, the online user hardly perceives the time consumed in the data circulation process. Activemq is also on the order of milliseconds, with almost negligible time from sending a message to receiving it.
The effectiveness of the message is improved. The ordinary polling method is most of the cases where the acquired message data is invalid. When the patent is used for sending a message to a user, the message is triggered when new data are generated or changed based on the exact requirement, so that the one-hundred-percent validity of the data is ensured.
The technical scheme of the application can solve the problem that the latest data cannot be obtained in the polling interval in the background technology, and can be immediately pushed and displayed without waiting as long as data change exists.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the invention and together with the description serve to explain the invention and not to limit the invention.
FIG. 1 is a schematic diagram of a user login system according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating boot loading according to an embodiment of the present invention;
fig. 3 is a schematic diagram of message pushing according to an embodiment of the present invention.
Detailed Description
It is to be understood that the following detailed description is exemplary and is intended to provide further explanation of the invention as claimed. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the invention. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
The embodiments and features of the embodiments of the present invention may be combined with each other without conflict.
Example one
The embodiment discloses a method for automatically reminding processing work in a cluster environment, which not only can realize communication among cluster service nodes, but also can meet the requirement that a server actively pushes a message to a client in the cluster environment, and reduce the pressure on foreground and background caused by polling while meeting the requirement on instantaneity.
In an embodiment, referring to fig. 1, a user logs in an application system, and uses a jsp/servlet technology to implement event-driven communication between a client and a server by using a long-term http connection. The user is identified by adding a unique TOKEN in the cookie, and the user adds a pushlet in the client through the TOKEN identity and listens to various subject messages. Background service defines multiple types of theme message types, a user joins in and subscribes different types of themes according to needs to receive different types of messages, a server side sends messages to a specified client side according to TOKEN, and the client side can display the messages instantly when monitoring new messages.
Referring to fig. 2, after the background server is started, an activemq configuration item is loaded to generate two message destinations in spring for pushing a message to the activemq when sending the message, one is that only one person can receive the message at the queue destination, and the other is that multiple persons at the subject destination can receive the message; and meanwhile, loading a listener for monitoring the queue and the theme in the message middleware, and immediately receiving and processing the message when a new message exists.
After the background generates data to be pushed, people needing to be pushed find the corresponding TOKEN, a destination, a message body and a receiver are set in a json format, the data are pushed to activemq through a public method, the activemq analyzes the data after receiving the message, and the data are stored in a table and wait for a listener in the background cluster node to read.
Referring to fig. 3, after finding the message to be processed, the listener reads the message from activemq, and the activemq automatically determines whether to empty the message according to the type of the message, i.e., whether the message is a queue or a topic. After a listener acquires a message, a message body is analyzed to acquire message content and receiver information, an online user list is acquired through TOKEN, a message receiver in the online user list is found out, the message is instantly pushed to a user, if the user is not found in pushlet monitoring, namely the user is not online, the message is persisted to a database, and after the user is online, a message to be processed is searched and displayed to the user.
After finding the message to be processed, the user clicks the message processing system to set the message to be in a read state, and the read message is not displayed after logging in again.
The user logs out of the system to cancel the subscription, logs out the session and does not accept the message any more.
Example two
The present embodiment aims to provide a system for automatically reminding processing work in a cluster environment, including: a client and a server;
logging in a system through a client, and realizing event-driven communication between the client and a server by using a long-term http connection;
and the server receives the subscription added by the client user as required, and displays the push data after the push data is sent to the specified client browser.
After the server side generates data needing to be pushed, according to the received client side needing to be pushed, a destination and a message body are set to be pushed to activemq through a public method, and after the activemq receives the message, the data are stored in a table to wait for a listener to read.
After finding the message to be processed, the client monitor reads the message from the activemq, and the activemq automatically determines whether to empty the message according to the type of the message, namely the queue or the theme;
after a listener acquires a message, a message body is analyzed to acquire message content and receiver information, an online user list is acquired through a pushlet, a message receiver in the online user list is found out, the message is instantly pushed to a client browser, if a user corresponding to the client browser is not online, the message is duralized to a database, and after the message is online, a message to be processed is searched and displayed to the user.
For the specific information processing procedure of the client and the server, refer to the detailed description of the first embodiment.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Although the embodiments of the present invention have been described with reference to the accompanying drawings, it is not intended to limit the scope of the present invention, and it should be understood by those skilled in the art that various modifications and variations can be made without inventive efforts by those skilled in the art based on the technical solution of the present invention.

Claims (10)

1. A method for automatically reminding processing work in cluster environment is characterized by comprising the following steps:
logging in a web application system through a client browser, and realizing event-driven communication between a client and a server by using a long-term http connection;
the client sends the information request to the server by adding various subject message types needing to be subscribed, and the client browser receives the data actively sent by the server and displays the data.
2. The method as claimed in claim 1, wherein the client logs in the system project and loads activemq configuration project after starting, and two message destinations are generated in the spring for pushing the message to activemq when sending the message, one is a queue destination and the other is a subject destination; and loading a listener for monitoring the queue and the theme in the message middleware at the same time, and immediately receiving and processing the message when a new message exists.
3. The method as claimed in claim 1, wherein the method for automatically reminding processing in a cluster environment comprises the steps of generating data to be pushed by a server, analyzing the data to obtain a receiving object, pushing the receiving object to a specified client, setting a destination and a message body to be pushed to activemq by a public method, and storing the data in a table by the activemq after receiving the message to be read by a listener.
4. The method as claimed in claim 1, wherein the client listener reads the message from the activemq after finding the message to be processed, and the activemq automatically determines whether to empty the message according to whether the message type is a queue or a topic.
5. The method as claimed in claim 1, wherein a listener parses a message body to obtain message content and recipient information after obtaining the message, obtains an online user list through a pushlet and finds out a message recipient therein to push the message to a client browser in real time, persists the message to a database if a user corresponding to the client browser is not online, and searches for a message to be processed after online and displays the message to the user.
6. The method as claimed in claim 1, wherein after the message to be processed is received at the client, the system sets the message to be read by clicking the message processing system, and after logging in again, the read message is not displayed.
7. The method of claim 1, wherein the client logs out of the system to unsubscribe, logs out of the session, and no longer accepts messages.
8. A system for automatically reminding processing work in cluster environment is characterized by comprising: a client and a server;
logging in a system through a client, and realizing event-driven communication between the client and a server by using a long-term http connection;
and the server receives a subscription request added by a client user as required, and displays the push data to a specified client browser.
9. The system according to claim 8, wherein the server generates data to be pushed, parses the data to obtain the data, pushes the data to the client specified by the receiving object, sets the destination and the message body to be pushed to the activemq by a public method, and the activemq stores the data in the table after receiving the message to be read by the listener.
10. The system according to claim 8, wherein a client listener reads a message from an activemq after finding a message to be processed, and the activemq automatically determines whether to empty the message according to whether the message is a queue or a topic;
according to the further technical scheme, after a monitor obtains a message, a message body is analyzed to obtain message content and receiver information, an online user list is obtained through a pushlet, a message receiver in the online user list is found out, the message is pushed to a client browser in real time, if a user corresponding to the client browser is not online, the message is persisted to a database, and after the message is online, a message to be processed is searched and displayed to the user.
CN201911168550.3A 2019-11-25 2019-11-25 Method and system for automatically reminding processing work in cluster environment Active CN111124703B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911168550.3A CN111124703B (en) 2019-11-25 2019-11-25 Method and system for automatically reminding processing work in cluster environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911168550.3A CN111124703B (en) 2019-11-25 2019-11-25 Method and system for automatically reminding processing work in cluster environment

Publications (2)

Publication Number Publication Date
CN111124703A true CN111124703A (en) 2020-05-08
CN111124703B CN111124703B (en) 2024-03-22

Family

ID=70496566

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911168550.3A Active CN111124703B (en) 2019-11-25 2019-11-25 Method and system for automatically reminding processing work in cluster environment

Country Status (1)

Country Link
CN (1) CN111124703B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114513500A (en) * 2022-01-19 2022-05-17 统信软件技术有限公司 Method, device and system for batch installation of browser plug-ins and computing device
CN115174296A (en) * 2022-05-30 2022-10-11 青岛海尔科技有限公司 Equipment function access method, device, storage medium and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103442072A (en) * 2013-09-02 2013-12-11 百度在线网络技术(北京)有限公司 Method and device for pushing traffic information related to user schedules
CN104092767A (en) * 2014-07-21 2014-10-08 北京邮电大学 Posting/subscribing system for adding message queue models and working method thereof
CN105162687A (en) * 2015-08-11 2015-12-16 甘肃万维信息技术有限责任公司 WEB-based real-time message push method
CN110019240A (en) * 2017-12-29 2019-07-16 中国移动通信集团北京有限公司 A kind of service data interaction method, apparatus and system
CN110113420A (en) * 2019-05-08 2019-08-09 重庆大学 Distributed Message Queue management system based on NVM

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103442072A (en) * 2013-09-02 2013-12-11 百度在线网络技术(北京)有限公司 Method and device for pushing traffic information related to user schedules
CN104092767A (en) * 2014-07-21 2014-10-08 北京邮电大学 Posting/subscribing system for adding message queue models and working method thereof
CN105162687A (en) * 2015-08-11 2015-12-16 甘肃万维信息技术有限责任公司 WEB-based real-time message push method
CN110019240A (en) * 2017-12-29 2019-07-16 中国移动通信集团北京有限公司 A kind of service data interaction method, apparatus and system
CN110113420A (en) * 2019-05-08 2019-08-09 重庆大学 Distributed Message Queue management system based on NVM

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114513500A (en) * 2022-01-19 2022-05-17 统信软件技术有限公司 Method, device and system for batch installation of browser plug-ins and computing device
CN115174296A (en) * 2022-05-30 2022-10-11 青岛海尔科技有限公司 Equipment function access method, device, storage medium and electronic device
CN115174296B (en) * 2022-05-30 2024-03-22 青岛海尔科技有限公司 Equipment function access method and device, storage medium and electronic device

Also Published As

Publication number Publication date
CN111124703B (en) 2024-03-22

Similar Documents

Publication Publication Date Title
US9578081B2 (en) System and method for providing an actively invalidated client-side network resource cache
EP2115976B1 (en) Method and system for resource-based synchronization between endpoints in a web-based real time collaboration
EP2013764B1 (en) Managing rich presence collections
CN103139048B (en) Group's message prompt method and system
EP2485443A1 (en) System and method for managing multiple queues of non-persistent messages in a networked environment
US8234559B2 (en) Managing rich presence collections
CN111711663A (en) Processing method and device for publishing and subscribing services and electronic equipment
CN109547511B (en) WEB message real-time pushing method, server, client and system
US20200213403A1 (en) Information transmission method and device
US20070088790A1 (en) System and method for providing asynchronous notifications using synchronous data sources
US10958735B2 (en) Client connection method and system
US8665311B2 (en) Methods and apparatus for collaboration
WO2021237433A1 (en) Message pushing method and apparatus, and electronic device and computer-readable medium
WO2012054422A1 (en) Local polling method and system for real time updating of web-based services
US20090240829A1 (en) Translating between implicit and explicit publish-subscribe protocols
CN110753129A (en) Message transmission method, system, device, equipment and computer readable storage medium
CN111124703B (en) Method and system for automatically reminding processing work in cluster environment
EP2555478A1 (en) Method, system, resource list server and presence server for subscribing presence information
US8755397B2 (en) Asynchronous communication in an unstable network
EP2678993B1 (en) Method and apparatus for notifications in a communication network
KR100385146B1 (en) A web messenger service system and a service method on the network
CN113132745B (en) Live broadcast service system, method and server
CN112653747A (en) Communication method, system and storage medium based on B/S architecture
JP2008176483A (en) Information providing system
CN105391784B (en) Peer-to-peer communications method based on Eclipse

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 185 Jingsi Road, Shizhong District, Jinan City, Shandong Province

Applicant after: Shandong luruan Digital Technology Co.,Ltd.

Applicant after: STATE GRID SHANDONG ELECTRIC POWER Co.

Address before: 185 Jingsi Road, Shizhong District, Jinan City, Shandong Province

Applicant before: SHANDONG LUNENG SOFTWARE TECHNOLOGY Co.,Ltd.

Applicant before: STATE GRID SHANDONG ELECTRIC POWER Co.

GR01 Patent grant
GR01 Patent grant