Center monitoring real time data analytics engine and script debugging tool based on lua script
Technical field
The invention belongs to script analytical engine debugging tool, specifically a kind of center monitoring real time data based on lua script
Analytics engine and script debugging tool.
Background technique
Lua is a kind of language of lightweight, and small in size, speed is fast, can be embedded into any program.Much apply journey
Sequence, game use Embedded Script Language of the Lua as oneself, realize configurability, scalability with this.Exactly because
Lua's is easy to learn easy-to-use, so its application surface is very wide.Occur the script debugging tool of many Lua so far, but
But the parsing of none center monitoring data is applied.
Although not providing special debugger in the prior art, some interface functions are provided, to realize you
The debugger of oneself.Present existing editing machine have Notepad++, Editplus, luaforwindows, Script.Net,
Decoda, LuaCoding, SciTE, BabeLua, LuaStudio etc., main function are exactly that can mainly debug, and jump to
At function definition.Current Lua script debugging tool is debugged using injection host program mode, can not have to modification host
Program code or Lua code can be debugged.The tool (such as ZeroBrane) debugged is communicated different from the use of socket, this
The debugging of long-range and prototype may be implemented in a little tools.It not can connect to iOS, Android, WP8 prototype is debugged.In a word in Lua
There are many tool developed under the technical support of this language itself, but all there is certain limitations.And prior art performance
It is low;Data analyzing efficiency is low;The memory and cpu resource of consuming are higher;It is complicated to parse script edit, it is not integrated common
Api function.
Therefore, it is further improved.
Summary of the invention
The purpose of the present invention is: it is intended to provide a kind of center monitoring real time data analytics engine and foot based on lua script
This debugging tool, superior performance, data analyzing efficiency is high, and the memory and cpu resource of consuming are lower, and parsing script edit is simple,
It is integrated with common api function.
To realize the above-mentioned technical purpose, The technical solution adopted by the invention is as follows:
A kind of center monitoring real time data analytics engine and script debugging tool based on lua script, including monitor supervision platform
Data the acquisition target Collector, port object (po) ComuPort and script engine of interior interaction acquisition device protocol
ScriptEngine further includes Lua script analytics engine, script debugger and script compiler;The script debugger connects
The real time data of monitored platform, and Lua script analytics engine is sent to by data acquisition module and communication interface and is loaded as
Data parse script;The script compiler generates data and parses script;The data parsing script is sent to database
It is interior.
The script compiler also passes through data acquisition module and communication interface and is connected with Lua script analytics engine.
The monitor supervision platform uses LJD-IMS and LJD-DAU integrated monitoring platform.
Several api interfaces are provided in data acquisition program to use for script.
Step 1 loads for device resource or creates script;Device resource is chosen after into wscript.exe to start pair
The creation script answered;
Step 2 enters the editing interface of script-editor to script addition order;Script can be given by clicking addition order
Addition order, can add multiple orders, right button can delete command;
The messaging parameter of equipment is arranged in step 3;In the communications parameter of the settable needs in top at scripting editing interface;
Step 4, according to script command and device address generating device order;It completes script command and some necessary sets
Outside setting, transmission order can be clicked, return value can be shown by generating in command boxe;
Step 5 writes script according to script command and specific device resource;Have on the right side of scripting editing tool
There are also Lua function, double-click can need to be used encapsulated good each function;After writing script, and pass through syntax check,
Solution is clicked in the case where return value is not sky, can parse script, rear side will appear parsing result;
Step 6 saves script;The preservation script of the top can be clicked after completing script, and after successfully passing parsing
The script editted can be saved in database by button.
The present invention is based on the prior arts, and Lua script more convenient can be researched and developed by us and is applied.The invention is base
In lua engine, script error can be positioned, multiple platforms can be run on, practical debugging can be carried out with edit script.This hair
Bright modification for convenience, debugging, have embedded Lua script resolver.User can be by writing and modifying script, to develop oneself
Interested product.The support of LUA editing machine is cancelled, grammer is highlighted etc., is used very convenient.
Detailed description of the invention
The present invention can be further illustrated by the nonlimiting examples that attached drawing provides;
Fig. 1 is the principle of the present invention schematic diagram.
Fig. 2 is operation interface schematic diagram of the invention.
Fig. 3 is the flow diagram of monitor supervision platform data acquisition.
Specific embodiment
In order to make those skilled in the art that the present invention may be better understood, with reference to the accompanying drawings and examples to this hair
Bright technical solution further illustrates.
As shown in Figure 1-Figure 3, a kind of center monitoring real time data analytics engine and script debugging work based on lua script
Tool, data acquisition target Collector, port object (po) ComuPort and foot including interaction acquisition device protocol in monitor supervision platform
This engine ScriptEngine further includes Lua script analytics engine, script debugger and script compiler;Script debugger connects
The real time data of monitored platform, and Lua script analytics engine is sent to by data acquisition module and communication interface and is loaded as
Data parse script;Script compiler generates data and parses script;Data parsing script is sent in database.
In the present invention, Lua parses the entire program kernel of script engine, provides for DinoUI engine and is able to use Lua language
It says to handle the function of logic.
Data acquisition target Collector is by calling port object (po) ComuPort, and port object (po) ComuPort is adjusted
With script engine ScriptEngine, and then by calling a series of method to complete entire calling process, function is realized.
Preferably, script compiler also passes through data acquisition module and communication interface and is connected with Lua script analytics engine.
Preferably, monitor supervision platform uses LJD-IMS and LJD-DAU integrated monitoring platform.
Preferably, several api interfaces are provided in data acquisition program to use for script
Step 1 loads for device resource or creates script;Device resource is chosen after into wscript.exe to start pair
The creation script answered;
Step 2 enters the editing interface of script-editor to script addition order;Script can be given by clicking addition order
Addition order, can add multiple orders, right button can delete command;
The messaging parameter of equipment is arranged in step 3;In the communications parameter of the settable needs in top at scripting editing interface;
Step 4, according to script command and device address generating device order;It completes script command and some necessary sets
Outside setting, transmission order can be clicked, return value can be shown by generating in command boxe;
Step 5 writes script according to script command and specific device resource;Have on the right side of scripting editing tool
There are also Lua function, double-click can need to be used encapsulated good each function;After writing script, and pass through syntax check,
Solution is clicked in the case where return value is not sky, can parse script, rear side will appear parsing result;
Step 6 saves script;The preservation script of the top can be clicked after completing script, and after successfully passing parsing
The script editted can be saved in database by button.
Working principle: the core of entire software systems is Lua parsing script engine, provides and is able to use for DinoUI engine
Lua language handles the function of logic.Data acquisition module is contacted by communication interface with script engine, and is handled by it.Most
The script data editted in compiler afterwards generates data parsing script and is stored in database.
Above-described embodiment is merely exemplary to illustrate the principle of the present invention and its effect, and is not intended to limit the present invention.It is any ripe
The personage for knowing this technology all without departing from the spirit and scope of the present invention, carries out modifications and changes to above-described embodiment.Cause
This, all those of ordinary skill in the art are completed without departing from the spirit and technical ideas disclosed in the present invention
All equivalent modifications or change, should be covered by the claims of the present invention.