CN111258844A - Dynamic complex alarm implementation method based on Lua script - Google Patents

Dynamic complex alarm implementation method based on Lua script Download PDF

Info

Publication number
CN111258844A
CN111258844A CN201911197053.6A CN201911197053A CN111258844A CN 111258844 A CN111258844 A CN 111258844A CN 201911197053 A CN201911197053 A CN 201911197053A CN 111258844 A CN111258844 A CN 111258844A
Authority
CN
China
Prior art keywords
alarm
data
script
equipment
real
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
CN201911197053.6A
Other languages
Chinese (zh)
Other versions
CN111258844B (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.)
Zhejiang Supcon Information Technology Co ltd
Original Assignee
Zhejiang Supcon Information 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 Zhejiang Supcon Information Technology Co ltd filed Critical Zhejiang Supcon Information Technology Co ltd
Priority to CN201911197053.6A priority Critical patent/CN111258844B/en
Publication of CN111258844A publication Critical patent/CN111258844A/en
Application granted granted Critical
Publication of CN111258844B publication Critical patent/CN111258844B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/327Alarm or error message display
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The invention discloses a dynamic complex alarm implementation method based on Lua scripts, which comprises a computer and a detection AREA AREA1, wherein an equipment A and an equipment B are arranged in the AREA1, and the equipment A and the equipment B are both provided with an attribute point atteude 1 and an attribute point atteude 2; setting a time interval [ T1-T2 ]; the computer is provided with an alarm configuration module, a rule conversion module, an engine loading module, a calculation processing module and an application processing module; the method comprises the following steps: the alarm configuration module converts the content of the alarm configuration of the user on the platform configuration page of the Internet of things into data in a JSON format; the rule conversion module converts the data content in the JSON format into a Lua script, and after the conversion is completed, the data content in the JSON format is sent to the engine loading module; the invention has the characteristics of providing flexible expansion and customization functions and reducing secondary development cost and maintenance cost.

Description

Dynamic complex alarm implementation method based on Lua script
Technical Field
The invention relates to the technical field of monitoring of the Internet of things, in particular to a dynamic complex alarm implementation method based on a Lua script.
Background
JSON: JavaScript Object notification is a lightweight data exchange format that stores and represents data in a text format that is completely independent of the programming language.
JavaScript: the script language is an transliterated script language used on the web page to add logic function to the web page.
Js: the JavaScript environment is an event-driven I/O server side JavaScript environment, and based on a V8 engine of Google, the V8 engine has very high Javascript execution speed and very good performance.
HTML: hypertext Markup Language (HyperText Markup Language) is a standard Markup Language for creating web pages.
Lua: the script language is light and small, is written in a standard C language and is opened in a source code form, and is designed to be embedded in an application program, so that flexible extension and customized functions are provided for the application program.
C + +: the inheritance of the C language can be used for carrying out the procedural programming of the C language, the object-based programming with abstract data types as characteristics and the object-oriented programming with the inheritance and polymorphism as characteristics.
Dynamic state: the alarm configuration is changed, and the rule conversion module can be informed in time.
And (3) complex alarming: the alarm configuration comprises time, historical data, multi-attribute point data of the same equipment, multi-attribute point data of a plurality of pieces of equipment and various combination relations.
The alarm of the traditional industrial monitoring system mainly utilizes a threshold alarm mechanism of an SCADA (Supervisory Control And data acquisition monitoring) system to realize early warning alarm analysis. In the SCADA system, four limit values of a high value, a low value and a low value are set for each monitoring parameter: if the monitoring parameter value is between the low value and the high value, the monitoring parameter value is normal, if the monitoring parameter value is between the low value and the low value, and between the high value and the high value, early warning is needed, and if the monitoring parameter value is larger than the high value, or the monitoring parameter value is smaller than the low value, warning is needed.
The monitoring alarm technology can only carry out threshold alarm, cannot realize alarm application with time period, multiple devices and different attribute point threshold correlation, meets basic application requirements at the initial stage of application, and cannot meet application requirements along with improvement of intelligentization and fine management requirements and increase of correlation between devices when the devices are connected to a cloud platform.
In addition, the alarm of the independently developed monitoring system increases a slow value and a change rate, but cannot meet the alarm application of a certain device in a time period, and needs to be uniformly issued by software, so that the alarm rule can be dynamically changed during configuration change, and the rule conversion template is inconvenient to expand and needs to change the original application program.
The solution of the internet of things which is raised in internet enterprises provides event alarm and threshold alarm rules, but an alarm object only aims at certain attribute of certain equipment within certain time, and cannot meet the complex alarm application of different time periods, different attribute points of different equipment and various combination relations.
Disclosure of Invention
The invention aims to overcome the defect that the solution of the Internet of things in the prior art cannot meet the requirement of complex alarm application of different time periods, different attribute points of different devices and various combination relations, and provides a dynamic complex alarm implementation method based on a Lua script.
A dynamic complex alarm implementation method based on Lua scripts comprises a computer and a detection AREA AREA1, wherein an equipment A and an equipment B are arranged in an AREA1, and both the equipment A and the equipment B are provided with an attribute point atteude 1 and an attribute point atteude 2; setting a time interval [ T1-T2 ]; the computer is provided with an alarm configuration module, a rule conversion module, an engine loading module, a calculation processing module and an application processing module;
the method comprises the following steps:
(1-1) converting the content of the alarm configuration of the user on the platform configuration page of the Internet of things into data in a JSON format by an alarm configuration module;
(1-2) converting the data content in the JSON format into a Lua script by the rule conversion module, and sending the data content in the JSON format to the engine loading module after the conversion is finished;
(1-3) reading the Lua script by the engine loading module according to the received data content in the JSON format to obtain the content of the Lua script, and sending the content of the Lua script to the calculation processing module;
(1-4) after receiving the content of the Lua script, the calculation processing module stores the content of the Lua script into a memory of a computer, obtains a real-time value of the equipment by using a real-time value obtaining function calcore.get _ devicelist _ data ({ 'A', 'B') }), calls an on _ data (devs) function, performs logic calculation processing on the real-time value, and sends the obtained real-time value of the equipment, the current time, alarm description, alarm name and an operation list after alarm generation to the application processing module;
and (1-5) the application processing module performs processing of updating data, issuing control, equipment linkage, and shooting an alarm scene picture or sending a short message to inform a user according to the operation list.
The invention uses the Lua script language to convert the alarm configuration into the corresponding Lua script, only the correspondingly generated Lua script is changed when the alarm requirement is changed, the original alarm processing module is not required to be modified, flexible expansion and customization functions are provided, and the secondary development cost and the maintenance cost are reduced.
According to the method, the device alarm configuration in the Internet of things platform is dynamically converted into the corresponding Lua script, then the Lua script is loaded, the relevant internal library functions are called, the real-time data are processed and analyzed, and when the data meet the alarm condition, the alarm information is immediately pushed to the alarm application module. The configuration of the device alarm is not only simple threshold configuration of one device, but also alarm configuration of time, historical data, multi-attribute point data of the same device, multi-attribute point data of multiple devices, multiple combination relations and the like.
The invention not only keeps the simple alarm function realization of the original threshold configuration, but also increases the complex alarm function realization of time, historical data, multi-attribute point data of the same equipment, multi-attribute point data of a plurality of pieces of equipment, various combination relations and the like, and meets the realization of various different alarm requirement functions of the monitoring system of the Internet of things.
Preferably, (1-1) comprises the steps of:
the alarm configuration module displays configuration content by using an HTML page, converts user alarm configuration into JSON format data by using JavaScript, and uploads the JSON format user alarm configuration data to the background configuration center; the user alarm configuration comprises time, historical data, multi-attribute point data of the same equipment, multi-attribute point data of each equipment, a combination relation and a user-defined script;
the user configures a page on the platform of the Internet of things to perform alarm configuration:
adding an ALARM, setting an ALARM name AREA1_ ALARM1, selecting an ALARM monitoring time period T1-T2, setting an ALARM condition 1, selecting equipment A, displaying an attribute point of the current equipment on a page, selecting a single selection box for filling an algorithm expression, and filling an expression attribute 1 > Yesterday average (attribute 1) × k; setting an alarm condition 2, selecting equipment B, displaying an attribute point of the current equipment on a page, selecting a threshold setting radio box, setting an upper limit value C1 and a lower limit value C2 of attribute 2, generating alarm processing, selecting a short message notification, and clicking a determination button by a user to complete configuration.
Preferably, (1-2) comprises the steps of:
the method comprises the steps of converting JSON format alarm configuration into a Lua script, writing a corresponding Lua script template for arithmetic operation, logic operation, time calculation and equipment attribute point data type processing in the Lua script, caching each script template in a memory, and adding the script template into a generated Lua script file when data in read configuration conforms to the corresponding script template.
Preferably, (1-3) comprises the steps of:
after receiving the data content in the JSON format, the engine loading module obtains a script folder directory and a script file name, and if the content of the script file name is empty, the script file name is not processed; if the script file name exists, reading the corresponding Lua script files in sequence, and caching the file contents into a script file array until the reading is finished; and after the reading of the script file is completed, sending script file data to the calculation processing module.
Preferably, (1-4) comprises the steps of:
after receiving the content of the Lua script, the calculation processing module obtains the Lua script of AREA1_ ALARM1, and executes the Lua script through the calculation processing module:
get _ devicelist _ data ({ 'a', 'B') to obtain a real-time value of the device using a real-time value acquisition function; calling an on _ data (devs) function, calculating the seconds of the current time in the on _ data (devs) function, comparing the seconds of the current time with a time period interval [ T1-T2], and ending the on _ data (devs) function call if the seconds of the current time are not in the time period interval [ T1-T2 ]; if the seconds of the current time are in a time period [ T1-T2], calculating the value of the average value of the attribute point attude 1 of the device A yesterday multiplied by k, comparing the value with the current real-time value, and if the real-time value is less than or equal to the value obtained by multiplying the average value of the attribute point attude 1 of the device A yesterday multiplied by k, ending the on _ data devs function call; if the real-time value is larger than a value obtained by multiplying the average value of the attribute points 1 of the device A by k in yesterday, continuously judging the size relation between the real-time value of the attribute points 2 of the device B and an upper limit value C1 and a lower limit value C2; if the real-time value of the device B attribute point 2 is less than or equal to C1 and greater than or equal to C2, ending the on _ data (devs) function call; if the real-time value of device B attribute point 2 is greater than C1, or the real-time value of device B attribute point 2 is less than C2, then calculate the current timestamp and perform the alarm information extraction function mqtt _ pub (devs, timestamp); a Lua table variable json is defined in an mqtt _ pub (devs, timeframe) function, ALARM information and a device real-time value are assigned to the variable json, and data information is issued to an application processing module by sending an ALARM information function mqtt _ publish ("NOTE _ ALARM", json).
In order to achieve the purpose, the invention adopts the following technical scheme:
therefore, the invention has the following beneficial effects: by adopting the Lua-based alarm script, the logic of complex alarm can be converted into an executable Lua script; through a module message mechanism, the rule conversion module can be dynamically notified to configure a change state, a complex alarm script is generated by compiling node.js, and the Web service can be perfectly supported; the alarm Lua script generated by mixed calling of C + + and Lua can call the packaged library function, can be repeatedly used, provides flexible extension and customization functions, and reduces secondary development cost and maintenance cost.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a flow chart of the generation of an alarm configuration message to Lua script according to the present invention.
Detailed Description
The invention is further described with reference to the following figures and detailed description.
The embodiment shown in fig. 1 is a dynamic complex alarm implementation method based on Lua scripts, and includes a computer and a detection AREA1, where an AREA1 is provided with an apparatus a and an apparatus B, and both the apparatus a and the apparatus B are provided with an attribute point atteude 1 and an attribute point atteude 2; setting a time interval [ T1-T2 ]; the computer is provided with an alarm configuration module, a rule conversion module, an engine loading module, a calculation processing module and an application processing module; the alarm configuration can be diversified, and the user can configure the alarm according to actual needs, and the following example is taken as an example to illustrate specific implementation steps.
For example, in the time period of 00:00-08:00 each day, if the value of the attribute point attribute 1 of device a is greater than its yesterday average value multiplied by 1.2, and the value of the attribute point attribute 2 of device B is greater than 28 ℃ or the value of the attribute point attribute 2 of device B is less than 6 ℃, an alarm is generated, and if an alarm is generated, a short message is sent to notify the detection AREA1 to generate an alarm. The device A is a flow pressure detection device, the attribute point 1 of the device A is pressure, the attribute point 2 of the device A is flow, the device B is a liquid level meter, the attribute point 1 of the device B is water level height, and the attribute point 2 of the device B is ambient temperature.
Specifically, step 1 is implemented, an alarm configuration module converts the content of the alarm configuration of the user on the platform configuration page of the internet of things into data in a JSON format:
and (3) converting user alarm configuration (the configuration can comprise time, historical data, multi-attribute point data of the same equipment, multi-attribute point data of multiple pieces of equipment, multiple combination relations, user-defined scripts and the like) into JSON format data by using JavaScript, and uploading the data to the background configuration center.
And the user configures a page on the platform of the Internet of things to perform alarm configuration. Adding an ALARM, setting an ALARM name AREA1_ ALARM1, selecting an ALARM monitoring time period of 00:00-08:00, setting an ALARM condition 1, selecting equipment A, selecting a filling algorithm expression radio box (a page displays attribute points of the current equipment), and filling an expression attribute 1 > Yesterday average (attribute 1) × 1.2; setting an alarm condition 2, selecting a device B, selecting a threshold setting radio box (a page displays an attribute point of the current device), setting the upper limit value of attude 2 to be 28 ℃ and the lower limit value of attude 2 to be 6 ℃, generating alarm processing, selecting a short message notification, and clicking a determination button by a user to complete configuration. Determining a button clicking trigger event, processing configuration content at the front end, converting the configuration content into data corresponding to a JSON format, wherein the content comprises an alarm name, an alarm description, an alarm time period setting list, an alarm calculation expression setting list and an operation list generated after alarm generation, and uploading the data in the JSON format to a background configuration center.
The data for a particular JSON format is as follows, "//" is followed by the annotation for that line, which is used here as an illustration only, regardless of the format syntax.
Figure BDA0002293643390000091
And 2, specifically, converting the data content in the JSON format into a Lua script by the rule conversion module, and sending the data content in the JSON format to the engine loading module after the conversion is finished.
As shown in FIG. 2, to implement the alarm configuration change described in the present invention, a flowchart of immediately converting a new alarm configuration into a latest Lua script is provided. And reading the configuration information through the configuration change message issued by the configuration center, analyzing the alarm configuration if the configuration information contains the alarm configuration information, and converting the alarm configuration into a corresponding Lua script according to rules.
The alarm configuration module displays configuration content by using an HTML page, converts user alarm configuration into a JSON format by using JavaScript, and uploads data of the user alarm configuration in the JSON format to a background configuration center; the user alarm configuration comprises time, historical data, multi-attribute point data of the same equipment, multi-attribute point data of each equipment, a combination relation and a user-defined script.
The Lua script comprises a loading computer library module, subscribing the real-time value of the equipment, calculating an expression and logic processing according to the real-time value of the equipment and issuing an alarm message to a channel through the mqtt. Analyzing the alarm configuration data in the JSON format, firstly, analyzing an alarm time period setting list, selecting a time calculation template according to the type, generating a script of time calculation conditions, analyzing an alarm calculation expression setting list, generating a script for acquiring a device real-time value function (calcore. get _ devicelist _ data ({ 'A', 'B')) according to the name in the alarm calculation expression setting list, determining a unique corresponding real-time value according to the device name and the corresponding attribute point, analyzing the function name in the expression, e.g., yesterday average, to obtain the function interface calcore. yesterday average ({ 'a', 'atteude 1' }), generating a script of real-time value calculation conditions according to 2 calculation expressions in the codes, finally analyzing an operation list generated after alarm generation, and according to the operation type after the alarm is generated, selecting an alarm processing template mqtt _ pub (devs, timestamp) and generating an alarm processing message content script. And after the script is generated, storing the script under the specified directory folder, and sending a message to the engine loading module.
The specific Lua script follows, and the "//" is followed by a comment on the line, which is used here as an illustration only, regardless of the script syntax.
Figure BDA0002293643390000101
Figure BDA0002293643390000111
The specific message includes a script folder directory and a script file name, if there are multiple script files, the corresponding value of the name content has multiple script file names, the corresponding data in the JSON format is as follows, and the notation of the line is followed by "/", which is used only as an illustration here and is not related to the format syntax.
Figure BDA0002293643390000112
Figure BDA0002293643390000121
Step 3 is specifically implemented, the engine loading module reads the Lua script according to the received data content in the JSON format to obtain the content of the Lua script, and the content of the Lua script is sent to the calculation processing module;
after receiving the data content in the JSON format, the engine loading module obtains a script folder directory and a script file name, and if the content of the script file name is empty, the script file name is not processed; if the script file name exists, reading the corresponding Lua script files in sequence, and caching the file contents into a script file array until the reading is finished; and after the reading of the script file is completed, sending script file data to the calculation processing module.
Specifically, step 4 is implemented, after receiving the content of the Lua script, the computing processing module stores the content of the Lua script into a memory of the computer, and obtains a real-time value of the device by using a real-time value obtaining function calcore.get _ devicelist _ data ({ 'a', 'B'); calling an on _ data (devs) function, carrying out logic calculation processing on the real-time value, and sending the obtained real-time value, the current time, the alarm description, the alarm name and the operation list after alarm generation to the application processing module;
the calculation processing module is a C + + executable program, wherein a Lua script is embedded and executed, related library functions are processed and called according to the Lua script, for example, data of corresponding attribute points are subscribed, related alarm expressions are calculated, and messages (control, update and the like) are sent to the application processing module according to the Lua script content and meeting alarm conditions.
After receiving the content of the Lua script, the calculation processing module obtains the Lua script of AREA1_ ALARM1, and executes the Lua script through the calculation processing module:
get _ devicelist _ data ({ 'a', 'B') to obtain a real-time value of the device using a real-time value acquisition function; calling an on _ data (devs) function, calculating the seconds of the current time in the on _ data (devs) function, comparing the seconds of the current time with a time period interval [0-28800], and if the seconds of the current time are not in the time period interval [0-28800], finishing the calling of the on _ data (devs) function; if the seconds of the current time are in a time period interval [0-28800], calculating the average value of the attribute point attude 1 of the device A by the value of 1.2 yesterday, comparing the average value with the current real-time value, and if the real-time value is less than or equal to the value obtained by multiplying the average value of the attribute point attude 1 of the device A by k, ending the on _ data (devs) function call; if the real-time value is larger than a value obtained by multiplying the average value of the attribute points 1 of the device A by k in yesterday, continuously judging the size relationship between the real-time value of the attribute points 2 of the device B and the upper limit value 28 and the lower limit value 6; if the real-time value of the device B attribute point 2 is less than or equal to 28 and greater than or equal to 6, ending the on _ data (devs) function call; if the real-time value of device B attribute point 2 is greater than 28 or the real-time value of device B attribute point 2 is less than 6, then calculate the current timestamp and perform the alarm information extraction function mqtt _ pub (devs, timestamp); a Lua table variable json is defined in an mqtt _ pub (devs, timeframe) function, ALARM information and a device real-time value are assigned to the variable json, and data information is issued to an application processing module by sending an ALARM information function mqtt _ publish ("NOTE _ ALARM", json).
And 5, specifically implementing the processing of updating data, issuing control, equipment linkage, shooting an alarm scene picture or sending a short message to inform a user by the application processing module according to the operation list.
The application processing module does not limit the technology, can subscribe NOTE _ ALARM through mqtt, receives ALARM data information, analyzes data content, obtains ALARM information, calls a specified interface function according to the mobile phone number and the ALARM description in the ALARM information, and similarly fills the mobile phone number to obtain the verification short message.
It should be understood that this example is for illustrative purposes only and is not intended to limit the scope of the present invention. Further, it should be understood that various changes or modifications of the present invention may be made by those skilled in the art after reading the teaching of the present invention, and such equivalents may fall within the scope of the present invention as defined in the appended claims.

Claims (5)

1. A dynamic complex alarm implementation method based on Lua scripts is characterized by comprising a computer and a detection AREA AREA1, wherein an equipment A and an equipment B are arranged in the AREA1, and the equipment A and the equipment B are both provided with an attribute point atteude 1 and an attribute point atteude 2; setting a time interval [ T1-T2 ]; the computer is provided with an alarm configuration module, a rule conversion module, an engine loading module, a calculation processing module and an application processing module;
the method comprises the following steps:
(1-1) converting the content of the alarm configuration of the user on the platform configuration page of the Internet of things into data in a JSON format by an alarm configuration module;
(1-2) converting the data content in the JSON format into a Lua script by the rule conversion module, and sending the data content in the JSON format to the engine loading module after the conversion is finished;
(1-3) reading the Lua script by the engine loading module according to the received data content in the JSON format to obtain the content of the Lua script, and sending the content of the Lua script to the calculation processing module;
(1-4) after receiving the content of the Lua script, the calculation processing module stores the content of the Lua script into a memory of a computer, obtains a real-time value of the equipment by using a real-time value obtaining function calcore.get _ devicelist _ data ({ 'A', 'B') }), calls an on _ data (devs) function, performs logic calculation processing on the real-time value, and sends the obtained real-time value of the equipment, the current time, alarm description, alarm name and an operation list after alarm generation to the application processing module;
and (1-5) the application processing module performs processing of updating data, issuing control, equipment linkage, and shooting an alarm scene picture or sending a short message to inform a user according to the operation list.
2. The Lua script-based dynamic complex alarm implementation method as claimed in claim 1, wherein (1-1) comprises the steps of:
the alarm configuration module displays configuration content by using an HTML page, converts user alarm configuration into a JSON format by using JavaScript, and uploads data of the user alarm configuration in the JSON format to a background configuration center; the user alarm configuration comprises time, historical data, multi-attribute point data of the same equipment, multi-attribute point data of each equipment, a combination relation and a user-defined script;
the user configures a page on the platform of the Internet of things to perform alarm configuration:
adding an ALARM, setting an ALARM name AREA1_ ALARM1, selecting an ALARM monitoring time period T1-T2, setting an ALARM condition 1, selecting equipment A, displaying an attribute point of the current equipment on a page, selecting a single selection box for filling an algorithm expression, and filling an expression attribute 1 > Yesterday average (attribute 1) × k; setting an alarm condition 2, selecting equipment B, displaying an attribute point of the current equipment on a page, selecting a threshold setting radio box, setting an upper limit value C1 and a lower limit value C2 of attribute 2, generating alarm processing, selecting a short message notification, and clicking a determination button by a user to complete configuration.
3. The Lua script-based dynamic complex alarm implementation method as claimed in claim 2, wherein (1-2) comprises the steps of:
the method comprises the steps of converting JSON format alarm configuration into a Lua script, writing a corresponding Lua script template for arithmetic operation, logic operation, time calculation and equipment attribute point data type processing in the Lua script, caching each script template in a memory, and adding the script template into a generated Lua script file when data in read configuration conforms to the corresponding script template.
4. The Lua script-based dynamic complex alarm implementation method as claimed in claim 3, wherein (1-3) comprises the steps of:
after receiving the data content in the JSON format, the engine loading module obtains a script folder directory and a script file name, and if the content of the script file name is empty, the script file name is not processed; if the script file name exists, reading the corresponding Lua script files in sequence, and caching the file contents into a script file array until the reading is finished; and after the reading of the script file is completed, sending script file data to the calculation processing module.
5. The Lua script-based dynamic complex alarm implementation method as claimed in claim 4, wherein (1-4) comprises the steps of:
after receiving the content of the Lua script, the calculation processing module obtains the Lua script of AREA1_ ALARM1, and executes the Lua script through the calculation processing module:
get _ devicelist _ data ({ 'a', 'B') to obtain a real-time value of the device using a real-time value acquisition function; calling an on _ data (devs) function, calculating the seconds of the current time in the on _ data (devs) function, comparing the seconds of the current time with a time period interval [ T1-T2], and ending the on _ data (devs) function call if the seconds of the current time are not in the time period interval [ T1-T2 ]; if the seconds of the current time are in a time period [ T1-T2], calculating the value of the average value of the attribute point attude 1 of the device A yesterday multiplied by k, comparing the value with the current real-time value, and if the real-time value is less than or equal to the value obtained by multiplying the average value of the attribute point attude 1 of the device A yesterday multiplied by k, ending the on _ data devs function call; if the real-time value is larger than a value obtained by multiplying the average value of the attribute points 1 of the device A by k in yesterday, continuously judging the size relation between the real-time value of the attribute points 2 of the device B and an upper limit value C1 and a lower limit value C2; if the real-time value of the device B attribute point 2 is less than or equal to C1 and greater than or equal to C2, ending the on _ data (devs) function call; if the real-time value of device B attribute point 2 is greater than C1, or the real-time value of device B attribute point 2 is less than C2, then calculate the current timestamp and perform the alarm information extraction function mqtt _ pub (devs, timestamp); a Lua table variable json is defined in an mqtt _ pub (devs, timeframe) function, ALARM information and a device real-time value are assigned to the variable json, and data information is issued to an application processing module by sending an ALARM information function mqtt _ publish ("NOTE _ ALARM", json).
CN201911197053.6A 2019-11-28 2019-11-28 Dynamic complex alarm realization method based on Lua script Active CN111258844B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911197053.6A CN111258844B (en) 2019-11-28 2019-11-28 Dynamic complex alarm realization method based on Lua script

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911197053.6A CN111258844B (en) 2019-11-28 2019-11-28 Dynamic complex alarm realization method based on Lua script

Publications (2)

Publication Number Publication Date
CN111258844A true CN111258844A (en) 2020-06-09
CN111258844B CN111258844B (en) 2023-08-01

Family

ID=70953829

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911197053.6A Active CN111258844B (en) 2019-11-28 2019-11-28 Dynamic complex alarm realization method based on Lua script

Country Status (1)

Country Link
CN (1) CN111258844B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104022903A (en) * 2014-06-13 2014-09-03 中国民航信息网络股份有限公司 One-stop automatic operation and maintaining system
US20170102693A1 (en) * 2013-03-04 2017-04-13 Fisher-Rosemount Systems, Inc. Data analytic services for distributed industrial performance monitoring
CN108279902A (en) * 2018-02-08 2018-07-13 合肥盈云信息科技有限公司 Share bottom frame generation, application process in multiple terminals based on Lua script technologies
CN109408340A (en) * 2018-11-06 2019-03-01 云宏信息科技股份有限公司 Store monitoring method, the storage medium of equipment
US10324951B1 (en) * 2017-12-29 2019-06-18 Apptio, Inc. Tracking and viewing model changes based on time

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170102693A1 (en) * 2013-03-04 2017-04-13 Fisher-Rosemount Systems, Inc. Data analytic services for distributed industrial performance monitoring
CN104022903A (en) * 2014-06-13 2014-09-03 中国民航信息网络股份有限公司 One-stop automatic operation and maintaining system
US10324951B1 (en) * 2017-12-29 2019-06-18 Apptio, Inc. Tracking and viewing model changes based on time
CN108279902A (en) * 2018-02-08 2018-07-13 合肥盈云信息科技有限公司 Share bottom frame generation, application process in multiple terminals based on Lua script technologies
CN109408340A (en) * 2018-11-06 2019-03-01 云宏信息科技股份有限公司 Store monitoring method, the storage medium of equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李明建;: "基于OpenLayers的突出事故报警系统设计与实现" *

Also Published As

Publication number Publication date
CN111258844B (en) 2023-08-01

Similar Documents

Publication Publication Date Title
CN109460513B (en) Method and apparatus for generating click rate prediction model
CN107491488B (en) Page data acquisition method and device
US8005878B2 (en) Providing processing instructions for updating schema
US10908928B2 (en) Rules-based workflow messaging
CN108733532B (en) Health degree control method and device for big data platform, medium and electronic equipment
CN110347399B (en) Data processing method, real-time computing system and information system
CN111581920A (en) Document conversion method, device, equipment and computer storage medium
CN109582317B (en) Method and apparatus for debugging hosted applications
WO2023082654A1 (en) Method, apparatus and device for generating service interaction diagram, and storage medium
CN109086147B (en) Service interface calling method and device of application program and storage medium
CN114490268A (en) Full link monitoring method, device, equipment, storage medium and program product
CN112486789A (en) Log analysis system, method and device
CN110321283A (en) Interface testing case generation method, device, computer installation and storage medium
JP2023036681A (en) Task processing method, processing device, electronic equipment, storage medium, and computer program
Trilles et al. Real-time anomaly detection from environmental data streams
Bielefeld Online performance anomaly detection for large-scale software systems
CN113495730A (en) Resource package generation and analysis method and device
CN113190517B (en) Data integration method and device, electronic equipment and computer readable medium
CN113535587A (en) Target application detection method and device and computer equipment
CN110941655A (en) Data format conversion method and device
CN111258844B (en) Dynamic complex alarm realization method based on Lua script
CN112947900A (en) Web application development method and device, server and development terminal
CN115809056A (en) Component multiplexing implementation method and device, terminal equipment and readable storage medium
CN108572900B (en) Blank pit position monitoring method, system, electronic equipment and storage medium
CN115437628A (en) apk application program development method, terminal, server and 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
CB02 Change of applicant information

Address after: 310053 23-25, 2 building, 352 BINKANG Road, Binjiang District, Hangzhou, Zhejiang.

Applicant after: Zhejiang zhongkong Information Industry Co.,Ltd.

Address before: 310053 23-25, 2 building, 352 BINKANG Road, Binjiang District, Hangzhou, Zhejiang.

Applicant before: ZHEJIANG SUPCON INFORMATION TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant