CN103729189B - Broadcasting method for converting protocol based on LUA, system, terminal - Google Patents
Broadcasting method for converting protocol based on LUA, system, terminal Download PDFInfo
- Publication number
- CN103729189B CN103729189B CN201310754961.7A CN201310754961A CN103729189B CN 103729189 B CN103729189 B CN 103729189B CN 201310754961 A CN201310754961 A CN 201310754961A CN 103729189 B CN103729189 B CN 103729189B
- Authority
- CN
- China
- Prior art keywords
- messaging protocol
- lua
- broadcasting
- control
- agreement
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 230000000875 corresponding effect Effects 0.000 claims abstract description 44
- 239000000463 material Substances 0.000 claims abstract description 42
- 238000006243 chemical reaction Methods 0.000 claims abstract description 36
- 230000005540 biological transmission Effects 0.000 claims abstract description 26
- 238000004891 communication Methods 0.000 claims abstract description 22
- 238000000605 extraction Methods 0.000 claims abstract description 11
- 230000001276 controlling effect Effects 0.000 claims description 15
- 238000001816 cooling Methods 0.000 claims description 5
- 230000008676 import Effects 0.000 claims description 5
- 238000013075 data extraction Methods 0.000 claims description 4
- 239000000203 mixture Substances 0.000 claims description 3
- 230000008859 change Effects 0.000 abstract description 2
- 230000006870 function Effects 0.000 description 20
- 238000003032 molecular docking Methods 0.000 description 13
- 230000008569 process Effects 0.000 description 11
- 238000011161 development Methods 0.000 description 10
- 230000000694 effects Effects 0.000 description 8
- 238000004458 analytical method Methods 0.000 description 4
- 238000012360 testing method Methods 0.000 description 4
- 238000013024 troubleshooting Methods 0.000 description 4
- 230000007812 deficiency Effects 0.000 description 3
- 238000007726 management method Methods 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 238000011835 investigation Methods 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 241000208340 Araliaceae Species 0.000 description 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 1
- 235000003140 Panax quinquefolius Nutrition 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000006837 decompression Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 235000008434 ginseng Nutrition 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000001502 supplementing effect Effects 0.000 description 1
Landscapes
- Computer And Data Communications (AREA)
Abstract
The present invention discloses a kind of broadcasting method for converting protocol based on LUA, including: S101, calls M2M module and enables the LUA plug-in unit bag of importing;S102, realization and Third party system or the communication connection of equipment in LUA plug-in unit bag;S103, parsing are play messaging protocol or control messaging protocol, and the server being described to specify according to agreement downloads material file;S104, call LUA template engine data and corresponding template extraction and be passed to the entrance function of LUA template engine as parameter, output change after broadcasting messaging protocol or control messaging protocol;S105, the broadcasting messaging protocol after conversion is controlled messaging protocol and play by transmission or control message interface transmission to terminal applies layer;S106, terminal applies layer describe loading material file according to the agreement playing messaging protocol or control messaging protocol after the conversion received and carry out corresponding action.The present invention discloses a kind of broadcasting messaging protocol switch endpoint based on LUA and system.
Description
Technical field
The present invention relates to a kind of broadcasting method for converting protocol based on LUA, system, terminal.
Background technology
Existing networking version terminal, when docking Third party system or equipment, exists following two with c program exploitation
Individual problem:
1. test and BUG troubleshooting procedure are loaded down with trivial details:
The chip used due to embedded device is usually ARM, MIPSE framework, so embedded development
Process is to be compiled c program by cross compile chain in LINUX system, the most again the generation after compiling
Each library file be articulated in embedded device run, will be to program verification, step one after having revised BUG
As be: run cross complier, perform carry development environment, run three steps of principal function, repair every time
Change a minor issue, all must repeat above-mentioned several step, be suitable expense for test, BUG investigation
Time.
2. realize the highest to the compatibility often development efficiency of multiple API protocol at embedded device:
Multiple API protocol are docked by embedded device in realization, it is necessary to lead in embedded device program
Cross c program and realize the realization to multiple API protocol, say from program maintenance angle, embed docking in program each
Planting API function, program module coupling is high, gives post code and safeguards, the difficulty that software upgrading increases.From
From the point of view of development efficiency, the realization in service logic often uses dynamic language (lua) can use process type language by ratio
Speech (c) development efficiency is high, utilizes the characteristic such as Memory recycle feature of dynamic language that C language internal memory can be avoided to let out
Dew problem, brings the complexity that problem is investigated.
Summary of the invention
For solution prior art terminal when docking Third party system or equipment, the survey produced with c program exploitation
Examination inconvenience, bug troubleshooting procedure is loaded down with trivial details, realize the compatible exploitation to multiple API protocol at embedded device
Inefficient technological deficiency, the present invention provides a kind of broadcasting method for converting protocol based on LUA and system,
The LUA plug-in unit bag using exploitation realizes the conversion of agreement, can support the effect of multiple broadcasting messaging protocol.
The technical scheme that the present invention uses is:
There is provided a kind of broadcasting method for converting protocol based on LUA, including step: import LUA plug-in unit bag,
And set up communication connection with Third party system or equipment, plug-in unit bag comprises broadcast message class template and controls class template,
Broadcast message class template and control class template are by playing messaging protocol and the data pick-up controlled in messaging protocol
Out replace with corresponding name variable and generate;According to broadcasting that resolution rules parsing Third party system or equipment send
Put messaging protocol or control messaging protocol, extracted data in the broadcast information analytically gone out or control information;Will
The data of extraction are filled in template the relevant position of corresponding variable name, generate the broadcasting messaging protocol after conversion
Or control messaging protocol and send it to terminal applies layer.
This kind of broadcasting method for converting protocol based on LUA, including: S101, calls M2M module and enables
The LUA plug-in unit bag imported, comprises broadcast message class template and controls class template, broadcast message class template and control in plug-in unit bag
Class template processed is out with to dependent variable by the data pick-up that will play in messaging protocol and control messaging protocol
Title is replaced and is generated;S102, realization and Third party system or the communication connection of equipment in LUA plug-in unit bag;
S103, when LUA plug-in unit bag receives broadcasting messaging protocol that Third party system or equipment sends or controls message
During agreement, describing decision message type according to agreement is to play type or Control Cooling, according to resolution rules
Resolve and play messaging protocol or control messaging protocol, and the server being described to specify according to agreement downloads material
File;Extracted data in S104, the broadcast information analytically gone out or control information, then according to type of message
Find corresponding model agreement, recall the LUA template engine data extraction with corresponding template as ginseng
Number is passed to the entrance function of LUA template engine, by the broadcasting messaging protocol after entrance function output conversion
Or control messaging protocol;S105, the transmission broadcasting calling M2M module or control message interface, after conversion
Broadcasting messaging protocol or control messaging protocol play by transmission or control message interface transmission to terminal applies
Layer;S106, terminal applies layer are according to playing messaging protocol or controlling messaging protocol after the conversion received
Agreement describes loading material file and carries out corresponding action.
Another technical solution used in the present invention is:
A kind of broadcasting messaging protocol based on LUA is provided or controls messaging protocol switch endpoint, including M2M
Module, also includes: enable module, enables the LUA plug-in unit bag of importing, plug-in unit for calling M2M module
Comprising broadcast message class template in bag and control class template, broadcast message class template and control class template are by broadcasting being disappeared
Breath agreement and the data pick-up controlled in messaging protocol are out replaced with corresponding name variable and are generated;Communication module,
For realizing and Third party system or the communication connection of equipment in LUA plug-in unit bag;Resolve and download module,
For when LUA plug-in unit bag receives Third party system or the broadcasting messaging protocol of equipment transmission or controls message association
During view, describing decision message type according to agreement is to play type or Control Cooling, according to resolution rules solution
Analysis is play messaging protocol or controls messaging protocol, and the server being described to specify according to agreement downloads material literary composition
Part;Protocol conversion module, extracted data, then root in the broadcast information analytically gone out or control information
Find corresponding model agreement according to type of message, recall the LUA template engine data extraction with corresponding
Template is passed to the entrance function of LUA template engine as parameter, by broadcasting after entrance function output conversion
Put messaging protocol or control messaging protocol;Agreement sending module, for call M2M module transmission play or
Control message interface, the broadcasting messaging protocol after conversion or control messaging protocol and play by transmission or control
Message interface sends to terminal applies layer;Play and perform module, be used for controlling terminal applies layer according to receiving
Conversion after play messaging protocol or control messaging protocol agreement describe load material file carry out accordingly
Action.
Another technical solution used in the present invention is:
A kind of broadcasting messaging protocol based on LUA is provided or controls messaging protocol converting system, including third party
System and at least one terminal with Third party system communication connection, described terminal is described based on LUA
Broadcasting messaging protocol or control messaging protocol switch endpoint, described Third party system is used for sending broadcasting message
Agreement or control messaging protocol are to described terminal.
The invention has the beneficial effects as follows: be different from prior art, terminal is at docking Third party system or equipment
Time, the test produced with c program exploitation is inconvenient, and bug troubleshooting procedure is loaded down with trivial details, it is right to realize at embedded device
The technological deficiency that the compatible development efficiency of multiple API protocol is the highest, the present invention provides a kind of based on LUA
Play method for converting protocol, system, terminal, use the LUA plug-in unit bag of exploitation to realize the conversion of agreement, will
All kinds of protocols abstract are template, by controlling the protocol analysis of third party device or system or broadcast information
Inserting the agreement after template is changed, then terminal is play according to the protocol realization after conversion, passes through plug-in unit
Form import to terminal, the effect of multiple broadcasting messaging protocol can be supported.
Accompanying drawing explanation
Fig. 1 is a kind of execution flow process playing method for converting protocol based on LUA in an embodiment of the present invention
Figure;
Fig. 2 is the system frame playing messaging protocol converting system of a kind of LUA in an embodiment of the present invention
Figure.
Detailed description of the invention
By describing the technology contents of the present invention, structural feature in detail, being realized purpose and effect, below in conjunction with
Embodiment also coordinates accompanying drawing to be explained in detail.
LUA is a small and exquisite script, and the purpose of design of this language is to embed in application program,
Thus provide for application program and extend flexibly and customize function.LUA script can be easily by C/C++
Code call, it is also possible to call the function of C/C++ in turn, this makes the LUA in the application can be by
Extensively application.Agreement not only describes loading material file and carries out corresponding action extension script, it is also possible to
Agreement describe and load material file and carry out the configuration file that corresponding action is common, replace the literary compositions such as XML, Ini
Part form, and be easier to understand and safeguard.
LUA is write by standard C and forms, code precision and elegance, almost in all operations system and platform all
Can compile, run.One complete LUA interpreter only 200k, in current all script engines,
The speed of LUA is the fastest.Everything all determines the agreement that LUA is and describes and load material file and carry out phase
The optimum selection of the embedded script of action answered.
The present invention provides a kind of broadcasting method for converting protocol based on LUA, and the method mainly comprises the steps:
(1), import LUA plug-in unit bag, and set up communication connection, in plug-in unit bag with Third party system or equipment
Comprising broadcast message class template and control class template, broadcast message class template and control class template are by assisting playing message
The data pick-up controlled in messaging protocol of negotiating peace out is replaced with corresponding name variable and is generated;
(2), resolve Third party system or the broadcasting messaging protocol of equipment transmission according to resolution rules or control disappears
Breath agreement, extracted data in the broadcast information analytically gone out and control information;
(3) relevant position of corresponding variable name, by the data of extraction it is filled in template, after generating conversion
Play messaging protocol or control messaging protocol and send it to terminal applies layer.
Below the detailed description of the invention of said method is described in detail by example.
One, first, to LUA plug-in unit pack arrangement of the present invention and M2M structure, LUA development process and end
End is illustrated with the example that docks of Third party system or equipment,
(1), LUA plug-in unit pack arrangement and M2M structure:
Terminal docks realization with Third party system or miscellaneous equipment, is to be gone to load terminal LUA by the M2M of terminal
Plug-in unit bag, the service logic of docking realizes all putting into LUA plug-in unit bag.
Illustrate below for LUA plug-in unit pack arrangement:
1, the form of LUA plug-in unit bag: DMB_plugin_name-version.plugin
As: DMB_plugin_his-1.0.plugin
2, plug-in unit APMB package bibliographic structure
plugin
Lua deposits lua script
Lib deposits the storehouse quoted
LUA mastery routine script file title: init.lua
Function start () //m2m calls LUA script, for enabling the entrance of LUA plug-in unit
Function close () //m2m is for stopping the operation of LUA script
Function realtimeComplete () //m2m notice real-time form of lua plug-in unit has been downloaded
3, the mode of M2M loading and unloading LUA plug-in unit bag:
LUA plug-in unit bag can be regarded as the increase to termination function, and management platform issues LUA plug-in unit bag to eventually
End is by terminal staging agreement,
When terminal staging module receives upgrading message, download file and according to filename rule from FTP,
For example whether DMB_PLUGIN beginning judges whether it is LUA plug-in unit bag, if then notice M2M mould
Block processes, and wherein, management platform is the software system for managing with control terminal, and management platform can
To be terminal said system, it is also possible to be Third party system.M2M handling process is as follows:
(1) decompression LUA plug-in unit bag is to/root/dmb/temp/
(2) file name of compressed package is intercepted according to filename rule, as intercepted DMB_plugin_his-1.0.
Plugin takes out the part before "-" character, i.e. takes out DMB_plugin_his, according to the character string intercepted,
Look for whether to exist the filename of the character string beginning to intercept to/tmp/dmb/plugin catalogue, if so, stop
Stop the corresponding plug-in unit name thread of structure and delete old LUA plug-in unit bag, if it is not, then LUA plug-in unit
Bag copy to/tmp/dmb/plugin/ catalogue under.
(3) M2M has enclosed structure body array, structure:
Terminal on startup, is opened M2M and is scanned thread, and M2M scanning thread is asked and gone scanning every 5 seconds
/ tmp/dmb/plugin catalogue, M2M often loads LUA plug-in unit bag and just enables a new thread, and updates
dmb_lua_config_item;The value of structure.
Scan thread traverses plugin directory listing name and by list name and M2M plug-in unit pack arrangement body
The value of dmb_lua_name contrasts, and loads plug-in unit bag and unloading makes structure dmb_lua_name
Value equal to plugin directory listing name;
Such as:
A) having dmb_lua_A_1.0 and dmb_lua_B_1.0 under plugin catalogue, Array for structural body is only
Dmb_lua_A_1.0, then M2M loads dmb_lua_B_1.0 plug-in unit bag.
B) dmb_lua_A_1.0, Array for structural body is had to have two element dmb_lua_A_1.0 under plugin catalogue,
Dmb_lua_B_1.0 then M2M unloads dmb_lua_B_1.0 plug-in unit bag
(2), LUA development process
1, play messaging protocol what terminal related to and control messaging protocol respectively in the way of model agreement
It is placed under the file of LUA plug-in unit bag;
2, in the init.lua script entrance function of LUA plug-in unit bag, open listening port or open equipment, and
Open a LUA thread, always scanning listening port or equipment;
3, when listening port or equipment have data to transmit, receive data and the data received are passed to
LUA message resolution module;
4, when LUA message resolution module receives message, the type describing decision message according to agreement is to play
Type or Control Cooling, resolve message association by the resolution rules of the implication comprising message format of agreement in advance
View, the data in extraction message, such as reproduction time, playing material file name etc., then according to message class
Corresponding model agreement found by type, recalls LUA template engine, and the data of extraction are done with corresponding template
Be passed to the entrance function of LUA template engine for parameter, entrance function output is concrete broadcasting messaging protocol
Or control messaging protocol, this agreement is XML format;
5, the transmission calling M2M is play or controls message interface sendplaylist, and template engine is generated
The agreement of messaging protocol describes and loads material file and carry out corresponding action parameter to sendplaylist, now eventually
End application layer is play messaging protocol according to receive or controls the agreement description loading material file of messaging protocol
Carry out corresponding action.
(3), the example of docking
Below by docking terminal by realizing explanation as a example by Zero queuing display function with the system docking of HIS
LUA plug-in unit bag realizes the process of protocol conversion:
LUA plug-in unit bag realizes interface protocol and uses http+xml, LUA plug-in unit bag can enable httpServer and do
For service end, HIS system transmits data to httpServer end by http protocol.HIS section office call out the numbers
Agreement:
When LUA plug-in unit bag receives the Zero queuing agreement of HIS system, LUA parsing module resolves message header,
Whether inquiry XML root node is<quueu>element, when being queue according to the root node of both sides' agreement, then
Expression is that section office's queue number plays messaging protocol, then LUA plug-in unit bag reads and plays messaging protocol template,
<params>look for whether queue, if searching out the template that just expression is section office's Zero queuing.LUA
Parsing module resolves section office and calls out the numbers agreement, takes out information about doctor, goes to a doctor patient information, the patient that waits to see the doctor letter
Breath, calls the attribute that LUA template engine is corresponding with template with the data of extraction playing messaging protocol template
Variable name mates, then by position corresponding with corresponding variable name in the data filling template of extraction,
Rear generation comprises the broadcast information agreement of the data of extraction.
Two, based on principles above and example, the broadcasting method for converting protocol based on LUA to the present invention below
And system is described in detail.
Refer to Fig. 1, be a kind of broadcasting method for converting protocol based on LUA in an embodiment of the present invention
Perform flow chart.Should comprise the following steps by broadcasting method for converting protocol based on LUA:
Step S101, call M2M module and enable the LUA plug-in unit bag of importing, plug-in unit bag comprises broadcast message class
Template and control class template, broadcast message class template and control class template are by broadcasting messaging protocol and control being disappeared
Data pick-up in breath agreement out replaces generation with corresponding name variable.
The broadcasting messaging protocol comprising concrete played data is abstracted into play template, and template is to retouch with XML
State, control class template and be used for playing control, as controlled volume, working time, switching on and shutting down etc..Broadcast
Put class template for controlling broadcasting content and play area.Such as, certain advertising pictures reproduction time 10 is play
Minute, just all it is abstracted into time variable relating to reproduction time, when generating and playing messaging protocol, the time is become
Amount replaces to concrete reproduction time, i.e. all extracts relating to concrete played data in broadcasting messaging protocol
Out replace with corresponding name variable.
Step S102, realization and Third party system or the communication connection of equipment in LUA plug-in unit bag.
Step S103, when LUA plug-in unit bag receive broadcasting messaging protocol that Third party system or equipment sends or
When controlling messaging protocol, describing decision message type according to agreement is to play type or Control Cooling, according to
Resolution rules resolves to be play messaging protocol or controls messaging protocol, and is described to the server specified according to agreement
Download material file.
Resolution rules is data to be included in service logic, is terminal and Third party system or the equipment of docking
That arranges plays messaging protocol or controls the resolution rules of messaging protocol third party, and the structure of agreement is general the most all
Organizing in xml form, description information belongs to the some of agreement, and description information includes to be play
Material (text, picture, video), reproduction time, broadcasting speed, broadcast mode, whether play specially good effect.
How long describing a pictures broadcasting the most in xml, use what specially good effect, program is taken out when resolving
Corresponding data.
Extracted data in step S104, the broadcast information analytically gone out and control information, then according to message class
Corresponding model agreement found by type, recall LUA template engine the data of extraction and corresponding template as
Parameter is passed to the entrance function of LUA template engine, is assisted by the broadcasting message after entrance function output conversion
View or control messaging protocol, this agreement is XML format.
Broadcast information includes broadcast start time, plays end time, playing duration, playing material file
Title, the source (FTP download or HTTP download) of material file, the pattern play (loop play, are inserted
Broadcast), material file play area coordinate.Control information includes volume, cut-in time, beginning
Knocking-off time, download time, switching on and shutting down, instruction of restarting.Decimation rule is third party producer and dock
In side's broadcast information of consulting in advance of terminal or control information, the business datum represented by each node of XML contains
Justice, docking side's terminal, according to data required in play template, obtains from broadcast information or control information
Corresponding data.
Step S105, the transmission broadcasting calling M2M module or control message interface, the broadcasting after conversion
Messaging protocol is controlled messaging protocol and is play by transmission or control message interface transmission to terminal.
Step S106, terminal applies layer are according to the broadcasting messaging protocol after the conversion received or control message association
The agreement of view describes loading material file and carries out corresponding action.
In the present embodiment, in LUA plug-in unit bag, realize the communication connection with Third party system specifically include
Step:
Step S1021, when LUA plug-in unit bag starts, call as HTTP or SOCKET adapter
LUA script, is connected to Third party system according to the IP port of configuration;
Step S1022, every one predetermined interval duration receive Third party system send heartbeat packet and to heartbeat packet
Carry out parsing and check heartbeat packet information describes whether there is playing task more new information;
If step S1023 has found task more new information, terminal send Query Information to Third party system,
Query Information updates agreement for query task;
The playing task that step S1024, reception Third party system send updates agreement, and described playing task updates
Agreement is for playing messaging protocol or controlling messaging protocol.
In the present embodiment, further comprise the steps of: after described step S107
Step S108, send after finishing playing and reply message to Third party system.
Be described separately below by embodiment how to realize terminal and Third party system play the right of messaging protocol
Connect with terminal and third party device play docking of messaging protocol.
Such as, Third party system is had an agreement a set of own broadcasting messaging protocol, when terminal by HTTP or
When the mode of SOCKET is docked with Third party system, need third-party broadcasting messaging protocol to be converted into end
The broadcasting messaging protocol of end, transformation process particularly as follows: play out layout the handle of task at Third party system
Task after layout is handed down to terminal, by describing the message having playing task to update in heartbeat packet information.Eventually
When end often receives the message of heartbeat packet, all carry out heartbeat packet parsing, and check whether heartbeat packet XML has and appoint
It is engaged in the description of more new information;If having found task to update message semantic definition, terminal sends for query task more
The Query Information of new agreement is to Third party system;Third party system plays the description letter of XML relevant task
Breath is pushed to terminal by the way of HTTP.Terminal is by calling LUA protocol analysis script, receiving
The XML message that task is play is passed to LUA as parameter and is resolved script, resolves the script rule by both sides' agreement
Then carry out that task is play message to resolve, extract play start time, play the end time, during broadcasting
Long, download playing material picture, text, video to the server specified by HTTP.Then extraction
Data be filled into the task of terminal and play in messaging protocol template, template engine go raw specific corresponding to
Task plays messaging protocol, and then LUA calls the sendPlaylist interface of M2M, and generating of task is broadcast
Put XML message and pass to sendPlaylist interface as parameter, thus reach need not again develop a set of broadcasting
Put messaging protocol, just Third party system is play messaging protocol by realization and be converted into the broadcasting that terminal is supported
The effect of messaging protocol.
Such as, third party device by network or serial ports directly carry out with terminal data dock time, third party sets
Standby needs is directly displayed at business datum on the screen of terminal, and transformation process is particularly as follows: terminal is to material database
Download material template;Terminal, starting when, is responsible for enabling LUA plug-in unit bag by the M2M module of terminal;
When LUA plug-in unit bag starts, open serial communication or open network connection service;LUA plug-in unit bag actively passes through
Network or serial ports obtain data or third party device actively sends data to LUA plug-in unit bag;LUA plug-in unit bag root
Analyze the corresponding material stereotype to be shown of these data according to the data content received, take out material template;
The data got are inserted material template after treatment, generates the material content of broadcasting to be shown;By LUA
Script calls the broadcasting of M2M and controls interface, and material content is sent to terminal, terminal realize playing content.
The present invention also provides for a kind of broadcasting messaging protocol converting system based on LUA, should based on LUA broadcast
Put messaging protocol converting system and include Third party system and at least one end with Third party system communication connection
End, described terminal is broadcasting messaging protocol switch endpoint based on LUA, the broadcasting message association of above-mentioned LUA
View conversion method is applied in this system.
Refer to Fig. 2, be the broadcasting messaging protocol converting system of a kind of LUA in an embodiment of the present invention
System block diagram.Described broadcasting messaging protocol switch endpoint based on LUA include enabling module, communication module,
Resolve and download module, protocol conversion module, agreement sending module, broadcasting perform module.
Enable module and enable the LUA plug-in unit bag of importing for calling M2M module, plug-in unit bag comprises broadcasting
Class template and control class template, broadcast message class template and control class template are by playing messaging protocol and control
Data pick-up in messaging protocol is out replaced with corresponding name variable and is generated.
Communication module is for realizing and Third party system or the communication connection of equipment in LUA plug-in unit bag.
Resolve and download module disappears for the broadcasting receiving Third party system or equipment transmission when LUA plug-in unit bag
When breath agreement or control messaging protocol, describing decision message type according to agreement is to play type or control class
Type, resolves according to resolution rules and plays messaging protocol or control messaging protocol, and be described to specify according to agreement
Server download material file.
Protocol conversion module is extracted data, then basis in the broadcast information analytically gone out and control information
Type of message finds corresponding model agreement, recalls LUA template engine the data extracted and corresponding mould
Plate is passed to the entrance function of LUA template engine as parameter, by the broadcasting after entrance function output conversion
Messaging protocol or control messaging protocol.
Agreement sending module is play for the transmission calling M2M module or controls message interface, after conversion
Play messaging protocol control messaging protocol play by transmission or control message interface transmission to terminal applies layer.
Play perform module for control terminal applies layer according to the broadcasting messaging protocol after the conversion received or
The agreement description loading material file controlling messaging protocol carries out corresponding action.
In the present embodiment, described broadcast information includes broadcast start time, plays end time, broadcasting
Duration, the title of playing material file, the source of material file, the pattern of broadcasting, material file are play
Area coordinate;Described control information include volume, cut-in time, the end time of starting working,
Download time, switching on and shutting down, instruction of restarting.
In the present embodiment, described communication module specifically includes the first connexon module, the second connection submodule
Block, inquiry submodule and reception submodule.First connexon module is used for when LUA plug-in unit bag starts,
Call the LUA script as HTTP or SOCKET adapter, be connected to the according to the IP port of configuration
Three method, systems.Second connexon module is used for sending heartbeat packet every a predetermined interval duration to Third party system,
And heartbeat packet is carried out parsing check heartbeat packet information describe whether have playing task more new information;Inquiry submodule
Block is for when inquiring about submodule and having found task more new information, and transmission Query Information, to Third party system, is looked into
Inquiry information updates agreement for query task.Receive submodule to appoint for the broadcasting receiving Third party system transmission
Business updates agreement, and described playing task updates agreement for playing messaging protocol or controlling messaging protocol.
In the present embodiment, described a kind of based on LUA broadcasting messaging protocol switch endpoint also includes back
Multiple module, for replying message to Third party system when described broadcasting execution module sends after finishing playing.
The invention has the beneficial effects as follows: be different from prior art, terminal is at docking Third party system or equipment
Time, the test produced with c program exploitation is inconvenient, and bug troubleshooting procedure is loaded down with trivial details, it is right to realize at embedded device
The technological deficiency that the compatible development efficiency of multiple API protocol is the highest, the present invention provides a kind of based on LUA
Play method for converting protocol, system, terminal, use the LUA plug-in unit bag of exploitation to realize the conversion of agreement, will
All kinds of protocols abstract are template, by controlling the protocol analysis of third party device or system or broadcast information
Inserting the agreement after template is changed, then terminal is play according to the protocol realization after conversion, passes through plug-in unit
Form import to terminal, the effect of multiple broadcasting messaging protocol can be supported.Specifically, the present invention's has
Benefit effect is as follows:
1, technical threshold is first reduced, it is not necessary to understand the various development technique on embedded, it is only necessary to write
LUA script, interface protocol.
2, importing to terminal by the form of plug-in unit, service logic level is logically separate, for asking
The investigation of topic, location becomes easy.By the way of LUA plug-in unit bag, will not destroy from the angle of software should
By the logic of layer, it is well extending and supplementing application layer on the contrary, with multiple on quickly response market
The docking requirement of system or equipment.
3, realizing hot plug, the importing of LUA plug-in unit bag restarts terminal with deleting without opening.
4, the opening of terminal is realized, it is only necessary to tell the interface of the LUA plug-in unit bag of third party producer, can
Being realized exploitation by third party producer and meet the feature card bag required, the M2M required by LUA plug-in unit bag carries
The interface of confession, can promote again the friendly of the interface of built-in terminal bottom.
The foregoing is only embodiments of the invention, not thereby limit the scope of the claims of the present invention, every profit
The equivalent structure made by description of the invention and accompanying drawing content or equivalence flow process conversion, or directly or indirectly transport
It is used in other relevant technical fields, is the most in like manner included in the scope of patent protection of the present invention.
Claims (10)
1. a broadcasting method for converting protocol based on LUA, it is characterised in that including:
Import LUA plug-in unit bag, and set up communication connection with Third party system or equipment, plug-in unit bag comprises and broadcasts
Putting class template and control class template, broadcast message class template and control class template are by playing messaging protocol and control
Data pick-up in messaging protocol processed is out replaced with corresponding name variable and is generated;
Resolve Third party system or the broadcasting messaging protocol of equipment transmission according to resolution rules or control message association
View, extracted data in the broadcast information analytically gone out or control information;
The data of extraction are filled in template the relevant position of corresponding variable name, generate the broadcasting after conversion and disappear
Cease agreement or control messaging protocol and send it to terminal applies layer.
A kind of broadcasting method for converting protocol based on LUA the most according to claim 1, its feature exists
In, it specifically includes:
S101, call M2M module and enable the LUA plug-in unit bag of importing;
S102, realization and Third party system or the communication connection of equipment in LUA plug-in unit bag;
S103, receive broadcasting messaging protocol or the control that Third party system or equipment send when LUA plug-in unit bag
During messaging protocol, describing decision message type according to agreement is to play type or Control Cooling, according to parsing
Rule parsing is play messaging protocol or controls messaging protocol, and the server being described to specify according to agreement is downloaded
Material file;
Extracted data in S104, the broadcast information analytically gone out or control information, then seeks according to type of message
Look for the model agreement of correspondence, recall the LUA template engine data extraction with corresponding template as parameter
Be passed to the entrance function of LUA template engine, by entrance function output conversion after broadcasting messaging protocol or
Control messaging protocol;
S105, the transmission broadcasting calling M2M module or control message interface, the broadcasting message association after conversion
View or control messaging protocol are play by transmission or are controlled message interface and send to terminal applies layer;
S106, terminal applies layer are according to playing messaging protocol or controlling messaging protocol after the conversion received
Agreement describes loading material file and carries out corresponding action.
A kind of broadcasting method for converting protocol based on LUA the most according to claim 2, its feature exists
In, realize specifically including step with the communication connection of Third party system in LUA plug-in unit bag:
When LUA plug-in unit bag starts, call the LUA script as HTTP or SOCKET adapter,
IP port according to configuration is connected to Third party system;
Receive, every a predetermined interval duration, the heartbeat packet that Third party system sends, and heartbeat packet is resolved
Check heartbeat packet information describes whether there is playing task more new information;
When having found task more new information, terminal sends Query Information and uses to Third party system, Query Information
Agreement is updated in query task;
Receiving the playing task renewal agreement that Third party system sends, described playing task updates agreement for playing
Messaging protocol or control messaging protocol.
A kind of broadcasting method for converting protocol based on LUA the most according to claim 2, its feature exists
In, it is described that " terminal applies layer is according to playing messaging protocol or controlling messaging protocol after the conversion received
Agreement describes and loads material file and carry out corresponding action " after further comprise the steps of: and send back after finishing playing
Multiple message is to Third party system.
A kind of broadcasting method for converting protocol based on LUA the most according to claim 2, its feature exists
In, described broadcast information includes broadcast start time, plays end time, playing duration, playing material literary composition
The area coordinate that the title of part, the source of material file, the pattern of broadcasting, material file are play;Described control
Information processed include volume, cut-in time, the end time of starting working, download time, switching on and shutting down,
Instruction of restarting.
6. broadcasting messaging protocol based on LUA or a control messaging protocol switch endpoint, including M2M mould
Block, it is characterised in that also include:
Enable module, enable the LUA plug-in unit bag of importing for calling M2M module, plug-in unit bag comprises and broadcasts
Putting class template and control class template, broadcast message class template and control class template are by playing messaging protocol and control
Data pick-up in messaging protocol processed is out replaced with corresponding name variable and is generated;
Communication module, for realizing and Third party system or the communication connection of equipment in LUA plug-in unit bag;
Resolve and download module, for receiving Third party system or the broadcasting of equipment transmission when LUA plug-in unit bag
When messaging protocol or control messaging protocol, describing decision message type according to agreement is to play type or control
Type, resolves according to resolution rules and plays messaging protocol or control messaging protocol, and be described to refer to according to agreement
Fixed server downloads material file;
Protocol conversion module, extracted data, then root in the broadcast information analytically gone out or control information
Find corresponding model agreement according to type of message, recall the LUA template engine data extraction with corresponding
Template is passed to the entrance function of LUA template engine as parameter, by broadcasting after entrance function output conversion
Put messaging protocol or control messaging protocol;
Agreement sending module, plays or controls message interface for calling the transmission of M2M module, after conversion
Broadcasting messaging protocol or control messaging protocol play by transmission or control message interface transmission to terminal applies
Layer;
Play and perform module, for controlling terminal applies layer according to the broadcasting messaging protocol after the conversion received
Or the agreement controlling messaging protocol describes loading material file and carries out corresponding action.
A kind of broadcasting messaging protocol based on LUA the most according to claim 6 or control messaging protocol
Switch endpoint, it is characterised in that described communication module specifically includes:
First connexon module, for when LUA plug-in unit bag starts, calls as HTTP or SOCKET
The LUA script of adapter, is connected to Third party system according to the IP port of configuration;
Second connexon module, for receiving, every a predetermined interval duration, the heartbeat packet that Third party system sends,
And heartbeat packet is carried out parsing check heartbeat packet information describe whether have playing task more new information;
Inquiry submodule, for when inquire about submodule found task more new information time, send Query Information to
Third party system, Query Information updates agreement for query task;
Receiving submodule, the playing task sent for receiving Third party system updates agreement, and described broadcasting is appointed
Business updates agreement for playing messaging protocol or controlling messaging protocol.
A kind of broadcasting messaging protocol based on LUA the most according to claim 6 or control messaging protocol
Switch endpoint, it is characterised in that also include replying module, for playing when described execution module of playing
Send after one-tenth and reply message to Third party system.
A kind of broadcasting messaging protocol based on LUA the most according to claim 6 or control messaging protocol
Switch endpoint, it is characterised in that described broadcast information includes broadcast start time, broadcasting end time, broadcasts
Put duration, the title of playing material file, the source of material file, the pattern of broadcasting, material file broadcasting
Area coordinate;Described control information include volume, cut-in time, the end time of starting working,
Download time, switching on and shutting down, instruction of restarting.
10. a broadcasting messaging protocol based on LUA or control messaging protocol converting system, it is characterised in that
Including Third party system and with Third party system communication connection at least one terminal, described terminal is right
Require the broadcasting messaging protocol based on LUA described in 6-9 any one or control messaging protocol switch endpoint,
Described Third party system is used for sending broadcasting messaging protocol or controlling messaging protocol to described terminal.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310754961.7A CN103729189B (en) | 2013-12-31 | 2013-12-31 | Broadcasting method for converting protocol based on LUA, system, terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310754961.7A CN103729189B (en) | 2013-12-31 | 2013-12-31 | Broadcasting method for converting protocol based on LUA, system, terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103729189A CN103729189A (en) | 2014-04-16 |
CN103729189B true CN103729189B (en) | 2017-01-04 |
Family
ID=50453275
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310754961.7A Active CN103729189B (en) | 2013-12-31 | 2013-12-31 | Broadcasting method for converting protocol based on LUA, system, terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103729189B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107423079A (en) * | 2017-03-10 | 2017-12-01 | 武汉斗鱼网络科技有限公司 | A kind of method of synchronous script, the method and apparatus for parsing message |
CN107678944B (en) * | 2017-09-04 | 2020-12-29 | 中国航空工业集团公司西安飞行自动控制研究所 | Automatic testing method based on embedded script |
CN107704606B (en) * | 2017-10-17 | 2021-01-08 | 南京茂毓通软件科技有限公司 | Universal extraction method for instant chat protocol elements based on custom tag language |
CN108460002A (en) * | 2017-12-29 | 2018-08-28 | 中国平安财产保险股份有限公司 | Affiliate's automatic butt method, apparatus, equipment and storage medium |
CN109358839B (en) * | 2017-12-29 | 2022-09-02 | 深圳Tcl新技术有限公司 | Method for developing embedded single-chip microcomputer software and storage medium |
CN108769132A (en) * | 2018-05-04 | 2018-11-06 | 武汉灵动在线科技有限公司 | A kind of Game Protocol parsing and hot update method and system based on LUA |
CN113067997B (en) * | 2020-01-02 | 2024-08-16 | 北京沃东天骏信息技术有限公司 | Method and device for real-time video call |
CN112153471B (en) * | 2020-09-25 | 2023-01-24 | 四川封面传媒有限责任公司 | Video playing control method and device and storage medium |
CN113364890B (en) * | 2021-06-30 | 2022-10-28 | 北京奇艺世纪科技有限公司 | Data processing method, device, network equipment and medium |
CN114374603B (en) * | 2022-01-12 | 2024-09-13 | 上海商米科技集团股份有限公司 | Data processing method based on API gateway and API gateway |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1485997A (en) * | 2002-09-28 | 2004-03-31 | 华为技术有限公司 | Transmission method of control message in monitoring system |
CN1642092A (en) * | 2004-01-12 | 2005-07-20 | 财团法人资讯工业策进会 | Interactive multimedia data processing system and method |
CN1968320A (en) * | 2006-04-27 | 2007-05-23 | 华为技术有限公司 | Method for implementing voice play service |
CN101695032A (en) * | 2009-11-02 | 2010-04-14 | 中国电信股份有限公司 | Unified web client, service configuration method and system thereof |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100559023B1 (en) * | 2003-05-30 | 2006-03-10 | 엘지전자 주식회사 | Home network system and its configuration system |
-
2013
- 2013-12-31 CN CN201310754961.7A patent/CN103729189B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1485997A (en) * | 2002-09-28 | 2004-03-31 | 华为技术有限公司 | Transmission method of control message in monitoring system |
CN1642092A (en) * | 2004-01-12 | 2005-07-20 | 财团法人资讯工业策进会 | Interactive multimedia data processing system and method |
CN1968320A (en) * | 2006-04-27 | 2007-05-23 | 华为技术有限公司 | Method for implementing voice play service |
CN101695032A (en) * | 2009-11-02 | 2010-04-14 | 中国电信股份有限公司 | Unified web client, service configuration method and system thereof |
Also Published As
Publication number | Publication date |
---|---|
CN103729189A (en) | 2014-04-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103729189B (en) | Broadcasting method for converting protocol based on LUA, system, terminal | |
CN108769165B (en) | Data processing method in Internet of things and Internet of things access system | |
US6286033B1 (en) | Method and apparatus for distributing computer integrated telephony (CTI) scripts using extensible mark-up language (XML) for mixed platform distribution and third party manipulation | |
CN110324169B (en) | Interface management method and device | |
US20230308504A9 (en) | Method and system of application development for multiple device client platforms | |
CN102752369B (en) | The supplying method of TV applications service and virtual content service platform | |
CN115113850B (en) | Cross-platform application construction and operation method, server, terminal and system | |
CN113641700B (en) | A data processing method and device based on Spring boot framework | |
CN106897153A (en) | Call the method and system of API | |
CN108196764A (en) | Application architecture dispositions method, device, system and cloud platform | |
CN109508211A (en) | A kind of multilingual configuration method, device, system and electronic equipment | |
CN114385382B (en) | Light application access method, device, computer equipment and storage medium | |
CN111488286B (en) | Method and device for independently developing Android modules | |
CN111680288B (en) | Container command execution method, device, equipment and storage medium | |
CN113535221A (en) | Method and device for managing application version | |
CN106648805A (en) | Intelligent device, intelligent system, and method for intelligently installing application | |
US20080104524A1 (en) | System and Method for Facilitating Ip Telephony Applications | |
CN111045928A (en) | Interface data testing method, device, terminal and storage medium | |
CN110765610A (en) | PDM (product data management) integration method and device, computer equipment and storage medium | |
US20060080447A1 (en) | Operation definition information producing method, operation definition information producing apparatus, operation definition information producing program, recording medium and data structure | |
CN112422566A (en) | Remote call processing method and device, storage medium and electronic device | |
CN114116049B (en) | Data processing method, device, electronic device and computer readable storage medium | |
Palli | Monolithic vs. Microservices Architectures for AI-Integrated Applications | |
CN112365320B (en) | Product information processing method, device, electronic equipment and storage medium | |
US8904372B2 (en) | Dialog to service conversion method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C41 | Transfer of patent application or patent right or utility model | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20160927 Address after: Cangshan District of Fuzhou City, Fujian province 350028 Jinshan Road No. 618 juyuanzhou Ruijie Science Park building 19-22 Applicant after: Fujian Star-net Communication Co., Ltd. Address before: Fuzhou City, Fujian Province, Jinshan Road 350002 No. 618 No. 20 Ruijie orangery Chau Science Park 4 Applicant before: Fujian Starnet e-Video Information System Co., Ltd. |
|
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |