Method for realizing real-time alarm pop-up and voice broadcast based on MQTT push protocol
Through the method based on the MQTT push protocol, real-time alarm data in the field of smart security is dynamically processed, real-time alarm pop-up frames and voice broadcasts are effectively conveyed, solving the problem of redundant alarm communication and insufficient visualization in the existing technology, and improving user alertness and response efficiency.
Patent Information
- Application Number
- CN202411861905.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-17
AI Technical Summary
In the field of smart security, the real-time alarm data is communicated redundantly and does not have sufficient visualization, resulting in a decrease in user alertness and affecting response efficiency.
The method based on the MQTT push protocol is adopted to dynamically process real-time alarm data from visual and auditory perspectives. By configuring the display location, method and closing method of real-time alarm box and voice broadcast, and managing the trigger conditions of alarm box and voice broadcast based on device type and alarm level.
Real-time and eye-catching real-time alarm transmission is realized, which improves user alertness and response efficiency, reduces user operation burden, and provides a convenient operating experience.
Smart Images

Figure CN119728662A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automated monitoring technology, and in particular to a method for implementing real-time alarm pop-up boxes and voice broadcasting based on the MQTT push protocol. Background Art
[0002] In the field of smart security, material flow and temperature vibration monitoring are extremely common needs. When alarm data is generated after the alarm threshold is set for the device, it needs to be communicated in an intuitive way. Specifically: 1) The alarm pop-up box in the system will display relevant information of the alarm device, covering alarm data such as alarm area, alarm device, recognition result, alarm level, alarm threshold, and collection resources; 2) Through the Web voice alarm broadcast, the content of [area][alarm level][alarm device][recognition result] will be broadcast. For viewing and analyzing historical data, a very intuitive viewing page is required. The current mainstream solution is the following steps: 1) Use Echarts to display historical real-time data; 2) Set the corresponding alarm threshold range directly in Echarts according to needs; 3) Update data in the Echarts container. In the above solution, the Web voice alarm broadcast and the pop-up prompt may convey the same alarm information at the same time. This redundant alarm communication method may reduce the user's vigilance, especially in high-frequency alarms, thereby affecting the response efficiency. In addition, the information display is single and lacks sufficient visualization, which can easily cause users to ignore or fail to quickly distinguish the urgency of multiple alarms. Summary of the invention
[0003] Purpose of the invention: The purpose of the present invention is to address the deficiencies in the prior art and provide a method for dynamically processing real-time alarm data visually / audibly to realize real-time alarm pop-up boxes and voice broadcasts based on the MQTT push protocol.
[0004] The technical solution provided by the present invention is a method for realizing real-time alarm pop-up box and voice broadcast based on MQTT push protocol, comprising the following steps: S1. Create an MQTT connection. In the system dictionary, configure the display position, display mode, and closing mode of the pop-up box on the screen, configure the enable / disable function, broadcast frequency, and broadcast interval of the Web voice broadcast, and configure the subscription type of the alarm subscription. The subscription type of the alarm subscription includes subscription by device type and subscription by alarm level. S2. When subscribing to the alarm topic, define two arrays, dialogTrueList and voiceTrueList, to manage the triggering conditions of the alarm pop-up box and Web voice broadcast: If the subscription by device type is activated, the array dialogTrueList stores the device type and its corresponding alert pop-up box mode, the alert pop-up box mode includes on and off; the array voiceTrueList stores the device type and its corresponding Web voice broadcast mode, the Web voice broadcast mode includes on and off; If subscription by alarm level is activated, the array dialogTrueList stores the alarm level and its corresponding alarm pop-up box mode, the alarm pop-up box mode includes open and not open; the array voiceTrueList stores the alarm level and its corresponding Web voice broadcast mode, the Web voice broadcast mode includes open and not open; S3. If you subscribe by device type, after receiving the MQTT message of the alarm, determine whether the device type typeId in the received push message is in the dialogTrueList list. If it is, determine whether to call the pop-up box configuration in the system dictionary according to the pop-up box mode in the list; at the same time, determine whether it is in the voiceTrueList list according to the typeId in the message. If it is, determine whether to call the Web voice broadcast configuration in the system dictionary according to the Web voice broadcast mode in the list; If you subscribe by alarm level, after receiving the alarm MQTT message, determine whether it is in the dialogTrueList list according to the alarm level alarmLevel in the message. If it is, determine whether to call the pop-up box configuration in the system dictionary according to the pop-up box mode in the list; at the same time, determine whether it is in the voiceTrueList list according to the alarm level in the message. If it is, determine whether to call the Web voice broadcast configuration in the system dictionary according to the Web voice broadcast mode in the list.
[0005] The technical solution of the present invention is further limited as follows: in the system dictionary, the pop-up box display position is configured, including the center pop-up box, the upper right corner pop-up box and the lower right corner pop-up box; the pop-up box display mode is configured: including an overlay pop-up box and an overlay pop-up box; the pop-up box closing mode includes manual closing and automatic closing, wherein the automatic closing function sets the display duration.
[0006] Furthermore, the data format of the configuration pop-up box is: {dictModel": "alarm-dialog-dict","dictLabel":"Alarm pop-up box configuration","dictValue": [{"enable":"true","closeSeconds":5,"dialogPosition":0,"multipShow":"0","closeType":"0"}],"dictId":**,"remark":"Alarm pop-up box configuration: enable: true to display, false to hide, dialogPosition: display position, 0 center, 1 upper right corner, 2 lower right corner; multpShow: multiple displays, 0: overlay, 1: superposition; closeType: closing method; 0: manual; 1: automatic; closeSeconds: closing seconds"}.
[0007] Furthermore, the data format for configuring the Web voice broadcast in step S1 is: {"dictModel": "alarm-speek-broadcast","dictLabel":"Web voice alarm broadcast configuration item","dictValue": [{"times":"1","enable": "true","interval": "3"}],"dictId": 120,"remark": "Web voice alarm broadcast: times: number of broadcasts, default is 5 times; interval: broadcast interval, default is 3 seconds"}.
[0008] Further, the data format for configuring the alarm subscription in step S1 is: {"dictModel": "alarm-subscrip-sys","dictLabel": "Alarm subscription type & level","dictValue": [{"typeSub": "true","levelSub":"false"}],"dictId": 121,"remark": "Alarm subscription: typeSub: by type type; true is false no, levelSub: subscribe by level, true is false no}.
[0009] The present invention proposes a method for realizing real-time alarm pop-up box and voice broadcast based on MQTT push protocol. The beneficial effects of this technical solution are as follows: 1. Instant alarm: When the system detects an abnormal situation, it can trigger an alarm in a very short time and quickly push the alarm information to the subscribed client through the MQTT protocol.
[0010] 2. Eye-catching pop-up box: The real-time alarm pop-up box is very eye-catching on the client screen and can immediately attract the user's attention. The detailed alarm information in the pop-up box (areaName to which the alarm device belongs, device name devName, alarm level alarmLevel, alarm resource resourceUrl, alarm time updateTime, etc.) allows users to quickly understand the nature, severity and related location of the problem, so that users can quickly make judgments and take corresponding actions.
[0011] 3. Voice assistance: The voice broadcast function further enhances the real-time nature of the alarm. Even if the user cannot stare at the screen all the time, he can still learn about the alarm situation in time through voice prompts.
[0012] 4. Convenient operation experience: Users do not need to check the system status frequently, but only need to process when receiving an alarm. This passive notification method reduces the user's operation burden and improves the user experience. At the same time, the clear alarm pop-up box content and voice broadcast allow users to quickly locate the problem without spending a lot of time to find the root cause of the problem. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is a flow chart of a method for realizing real-time alarm pop-up box and voice broadcast based on MQTT push protocol provided by the present invention. DETAILED DESCRIPTION
[0014] The technical solution of the present invention is described in detail below with reference to the accompanying drawings, but the protection scope of the present invention is not limited to the embodiments.
[0015] Example 1 The overall idea of this embodiment is: first, push data in real time through MQTT. Then, configure the relevant alarm prompts, such as the display position of the alarm pop-up box (you can choose the center pop-up box, the upper right corner pop-up box, and the lower right corner pop-up box), the display mode (can be configured as overlay or superposition, the overlay only displays the latest data, and the superposition displays the latest data on the top) and the closing method (can be set to close manually one by one or automatically, if you choose to close automatically, you can also set the closing seconds); at the same time, configure the number of broadcasts and the broadcast interval of the alarm Web voice broadcast. Subsequently, process the data subscribed to the alarm and store it. Finally, parse the received MQTT message in the global entry file. If the message is within the subscription data range, the pop-up box and the Web voice broadcast are processed accordingly.
[0016] A method for implementing real-time alarm pop-up boxes and voice broadcasts based on the MQTT push protocol is specifically disclosed, comprising the following steps: S1. Create an MQTT connection. In the system dictionary, configure the display position, display mode, and closing mode of the pop-up box on the screen, configure the enable / disable function, broadcast number, and broadcast interval of the Web voice broadcast, and configure the subscription type of the alarm subscription. The subscription type of the alarm subscription includes subscription by device type and subscription by alarm level.
[0017] S1.1. Create an MQTT connection. Set the IP address and port number used to create the MQTT connection on the system configuration page, and perform connection-related configuration. Use pina to store the connection configuration in useUserStore to ensure that the global MQTT connection is automatically created when the system is loaded.
[0018] S1.2 Alarm pop-up box configuration: Pop-up window position configuration: configure the display position of the pop-up window on the screen, supporting center pop-up window, upper right corner pop-up window and lower right corner pop-up window; Pop-up window display mode configuration: provides two display modes: overlay and superposition, and supports users to choose the pop-up window display style; Closing method configuration: supports manual closing and automatic closing. The automatic closing function can set the closing seconds, that is, the pop-up window will be automatically closed after the specified seconds are reached.
[0019] The data format of configuring the pop-up box is: {dictModel": "alarm-dialog-dict","dictLabel":"Alarm pop-up box configuration","dictValue": [{"enable":"true","closeSeconds":5,"dialogPosition":0,"multipShow":"0","closeType":"0"}],"dictId":**,"remark":"Alarm pop-up box configuration: enable: true to display, false to hide, dialogPosition: display position, 0 center, 1 upper right corner, 2 lower right corner; multpShow: multiple displays, 0: overlay, 1: superposition; closeType: closing method; 0: manual; 1: automatic; closeSeconds: closing seconds"}.
[0020] The alarm pop-up box is displayed according to the configuration. If it is not enabled, there will be no pop-up box prompt after the whole system receives an alarm. You can choose the display position of the pop-up box (center pop-up box, upper right corner pop-up box, lower right corner pop-up box), display mode (overlay <only show the latest one>, superposition <existing alarms at the bottom, new alarms at the top>), and closing mode (manual closing, automatic closing). When the closing mode is automatic closing, you can set the number of seconds after closing, and it can be closed manually during this period.
[0021] S1.3, Web voice broadcast configuration: Enable / disable voice broadcast function: Provide a setting in the configuration to determine whether to enable voice broadcast. If disabled, no voice broadcast will be performed.
[0022] Configuration of broadcast times: You can set the number of voice broadcasts. When an alarm occurs, a voice broadcast will be made according to the set number of times.
[0023] Broadcast interval configuration: Set the interval time for alarm voice broadcast, that is, the time interval between two broadcasts.
[0024] The data format for configuring Web voice broadcast is: {"dictModel": "alarm-speek-broadcast","dictLabel":"Web voice alarm broadcast configuration item","dictValue": [{"times":"1","enable": "true","interval": "3"}],"dictId": 120,"remark": "Web voice alarm broadcast: times: broadcast times, default is 5 times; interval: broadcast interval, default is 3 seconds"}.
[0025] S1.4. Alarm subscription configuration: Subscribe by device type: Enable or disable the alarm pop-up box and voice broadcast by device type. When the device turns on the relevant function, the alarm pop-up box or voice broadcast is triggered. Device types can include real-time devices, system devices, and servers.
[0026] Subscribe by alarm level: Enable or disable the alarm pop-up box and voice broadcast according to the alarm level, support four levels: early warning, general alarm, severe alarm, and critical alarm, and configure the corresponding processing method according to the alarm level. The alarm level can be divided into early warning, general alarm, severe alarm, and critical alarm.
[0027] The data format for configuring alarm subscription is: {"dictModel": "alarm-subscrip-sys","dictLabel": "Alarm subscription type & level","dictValue": [{"typeSub": "true","levelSub":"false"}],"dictId": 121,"remark": "Alarm subscription: typeSub: by type type; true is false no, levelSub: by level subscription, true is false no}.
[0028] S2. When subscribing to the alarm topic, define two arrays, dialogTrueList and voiceTrueList, to manage the triggering conditions of the alarm pop-up box and Web voice broadcast: If subscription by device type is activated, the array dialogTrueList stores the device type and its corresponding alert pop-up box mode, including on and off; the array voiceTrueList stores the device type and its corresponding Web voice broadcast mode, including on and off.
[0029] If subscription by alarm level is activated, the array dialogTrueList stores the alarm level and its corresponding alarm pop-up box mode, the alarm pop-up box mode includes open and not open; the array voiceTrueList stores the alarm level and its corresponding Web voice broadcast mode, the Web voice broadcast mode includes open and not open.
[0030] S3. The alarm steps after receiving the alarm MQTT message are: S3.1 If you subscribe by device type, after receiving the MQTT message of the alarm, determine whether the device type typeId in the received push message is in the dialogTrueList list. If it is, determine whether to call the pop-up box configuration in the system dictionary according to the pop-up box mode in the list; at the same time, determine whether it is in the voiceTrueList list according to the typeId in the message. If it is, determine whether to call the Web voice broadcast configuration in the system dictionary according to the Web voice broadcast mode in the list.
[0031] In this embodiment, the data format of the MQTT message received for the alarm is: {"alarmId": 4198,"alarmLevel": 2,confirmState":"WAIT","devId": 58,"areaName":"Area 1","devName":"Device No. 7","deviceId": 5,"deviceType": 5,"execId": 1183,"typeName":"Belt Tear","pointId": 6039,"time":1719388977000,"typeId":48,"updateTime":1731304349000,"resourceUrl":" / home / resource / belt / 2024-11-1 / BELT-1721304760406.jpg"}.
[0032] Determine whether the typeId in the message is in the dialogTrueList list. If so, display a pop-up window according to the pop-up window configuration. Also determine whether the typeId is in the voiceTrueList list. If so, broadcast the voice according to the configuration.
[0033] S3.2 If you subscribe by alarm level, after receiving the MQTT message of the alarm, determine whether it is in the dialogTrueList list according to the alarm level alarmLevel in the message. If it is, determine whether to call the pop-up box configuration in the system dictionary according to the pop-up box mode in the list; at the same time, determine whether it is in the voiceTrueList list according to the alarm level in the message. If it is, determine whether to call the Web voice broadcast configuration in the system dictionary according to the Web voice broadcast mode in the list.
[0034] In this embodiment, the data format of the MQTT message received for the alarm is: {"alarmId": 4198,"alarmLevel": 2,confirmState":"WAIT","devId": 58,"areaName":"Area 1","devName":"Device No. 7","deviceId": 5,"deviceType": 5,"execId": 1183,"typeName":"Belt Tear","pointId": 6039,"time":1719388977000,"typeId":48,"updateTime":1731304349000,"resourceUrl":" / home / resource / belt / 2024-11-1 / BELT-1721304760406.jpg"}.
[0035] Determine whether the alarmLevel in the message is in the dialogTrueList list. If so, display a pop-up box prompt according to the pop-up box configuration. At the same time, determine whether the alarmLevel is in the voiceTrueList list. If so, broadcast the voice according to the configuration.
[0036] As described above, although the present invention has been shown and described with reference to specific preferred embodiments, it should not be construed as limiting the present invention itself. Various changes in form and details may be made without departing from the spirit and scope of the present invention as defined in the appended claims.
Claims
1. A method for implementing real-time alarm pop-up box and voice broadcast based on MQTT push protocol, characterized in that: The following steps are involved: S1. Create an MQTT connection. In the system dictionary, configure the display position, display mode, and closing mode of the pop-up box on the screen, configure the enable / disable function, broadcast frequency, and broadcast interval of the Web voice broadcast, and configure the subscription type of the alarm subscription. The subscription type of the alarm subscription includes subscription by device type and subscription by alarm level. S2. When subscribing to the alarm topic, define two arrays, dialogTrueList and voiceTrueList, to manage the triggering conditions of the alarm pop-up box and Web voice broadcast: If the subscription by device type is activated, the array dialogTrueList stores the device type and its corresponding alert pop-up box mode, the alert pop-up box mode includes on and off; the array voiceTrueList stores the device type and its corresponding Web voice broadcast mode, the Web voice broadcast mode includes on and off; If subscription by alarm level is activated, the array dialogTrueList stores the alarm level and its corresponding alarm pop-up box mode, the alarm pop-up box mode includes open and not open; the array voiceTrueList stores the alarm level and its corresponding Web voice broadcast mode, the Web voice broadcast mode includes open and not open; S3. If you subscribe by device type, after receiving the MQTT message of the alarm, determine whether the device type typeId in the received push message is in the dialogTrueList list. If it is, determine whether to call the pop-up box configuration in the system dictionary according to the pop-up box mode in the list; at the same time, determine whether it is in the voiceTrueList list according to the typeId in the message. If it is, determine whether to call the Web voice broadcast configuration in the system dictionary according to the Web voice broadcast mode in the list; If you subscribe by alarm level, after receiving the alarm MQTT message, determine whether it is in the dialogTrueList list according to the alarm level alarmLevel in the message. If it is, determine whether to call the pop-up box configuration in the system dictionary according to the pop-up box mode in the list; at the same time, determine whether it is in the voiceTrueList list according to the alarm level in the message. If it is, determine whether to call the Web voice broadcast configuration in the system dictionary according to the Web voice broadcast mode in the list.
2. According to a method for implementing real-time alarm pop-up box and voice broadcast based on MQTT push protocol according to claim 1, it is characterized in that: In the system dictionary, configure the pop-up display position, including the center pop-up, upper right corner pop-up, and lower right corner pop-up; configure the pop-up display mode: including overlay pop-up and superimposed pop-up; pop-up closing method: including manual closing and automatic closing, where the automatic closing function sets the display duration.
3. According to claim 2, a method for implementing real-time alarm pop-up box and voice broadcast based on MQTT push protocol is characterized in that: The data format of configuring the pop-up box is: {dictModel": "alarm-dialog-dict","dictLabel":"Alarm pop-up box configuration","dictValue": [{"enable":"true","closeSeconds":5,"dialogPosition":0,"multipShow":"0","closeType":"0"}],"dictId":**,"remark":"Alarm pop-up box configuration: enable: true to display, false to hide, dialogPosition: display position, 0 center, 1 upper right corner, 2 lower right corner; multipShow: multiple display, 0: overlay, 1: superposition; closeType: closing method; 0: manual; 1: automatic; closeSeconds: closing seconds"}.
4. According to a method for implementing real-time alarm pop-up box and voice broadcast based on MQTT push protocol according to claim 1, it is characterized in that: The data format for configuring the Web voice broadcast in step S1 is: {"dictModel": "alarm-speek-broadcast","dictLabel":"Web voice alarm broadcast configuration item","dictValue": [{"times":"1","enable": "true","interval": "3"}],"dictId": 120,"remark": "Web voice alarm broadcast: times: broadcast times, default is 5 times; interval: broadcast interval, default is 3 seconds"}.
5. According to a method for implementing real-time alarm pop-up box and voice broadcast based on MQTT push protocol according to claim 1, it is characterized in that: The data format for configuring alarm subscription in step S1 is: {"dictModel": "alarm-subscrip-sys","dictLabel": "Alarm subscription type & level","dictValue": [{"typeSub": "true","levelSub": "false"}],"dictId": 121,"remark": "Alarm subscription: typeSub: by type type; true yes false no, levelSub: Subscribe by level, true yes false no}.
Citation Information
Patent Citations
Transformer substation power and environment monitoring alarm processing system and method
CN115208059A
Voice alarm method and device and computer equipment
CN118015764A
Alarm sounding system and method and terminal equipment
CN118506504A
Message pushing method and apparatus, and device, medium and vehicle
WO2024160048A1