CN106445523A - Remote control method and system based on script languages - Google Patents

Remote control method and system based on script languages Download PDF

Info

Publication number
CN106445523A
CN106445523A CN201610849694.5A CN201610849694A CN106445523A CN 106445523 A CN106445523 A CN 106445523A CN 201610849694 A CN201610849694 A CN 201610849694A CN 106445523 A CN106445523 A CN 106445523A
Authority
CN
China
Prior art keywords
script
control
controlled terminal
explanatory
language code
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.)
Pending
Application number
CN201610849694.5A
Other languages
Chinese (zh)
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN201610849694.5A priority Critical patent/CN106445523A/en
Publication of CN106445523A publication Critical patent/CN106445523A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications

Abstract

The invention provides a remote control method and system based on script languages. The method includes the steps that S1, a control side generates explanatory script language codes and adds the explanatory script language codes into a control message to be sent to a controlled side; S2, the controlled end receives the control message, and the explanatory script language codes in the control message are analyzed; S3, the controlled end executes the explanatory script language codes. The system comprises the control end and the controlled end. The control end comprises a control instruction generating module and a first receiving and transmitting module. The controlled end comprises a second receiving and transmitting module and a script language analyzer. Statements of the script languages are used for replacing control instructions of the control message, no complex string matching is needed, the code quantity is optimized, modification and upgrading are convenient, and flexible control can be achieved.

Description

Long-range control method based on script and system
Technical field
The present invention relates to remote control technology field, be specifically related to a kind of long-range control method and system based on script.
Background technology
The Long-distance Control of existing controlled terminal is generally to send one by control end to controlled terminal to control message, controls The form of message is generally a character string with beginning flag position and end mark position; Controlled terminal receives control message Afterwards, start to resolve controlling message, peel off flag bit, the control instruction character string obtaining is mated, be matched to Read in the additional input parameter of control instruction character string after merit, then according to control instruction and the additional parameter of controlling thereof to controlled System end is controlled.
Existing Long-distance Control mode there is following shortcoming:
1, the canonical coupling of control message is very difficult; Because the outer relay part of the controlled terminal of controlled terminal is different, nothing Method is transmitted instruction and the subsidiary parameter of instruction by unified character string, can only carry out string matching; Such as controlling motor, control The parameter that system end sends should be MOTOR(rotating speed, positive and negative, distance), the parameter of controlling steering wheel is the Servo(number of degrees); Parameter Number, form, kind all different, cause the parsing coupling to controlling the control instruction in message very difficult;
2, controlled terminal size of code is very large; For each outer relay part of controlled terminal, control end all can have corresponding control Message processed, controlled terminal has corresponding parsing and run time version, has how many outer relay parts, will write how many parsing generations Code, size of code can be very large;
3, amendment and upgrading difficulty; In embedded system, because the code in controlled terminal ROM is that programming has been fixed, as Fruit wants the control mode of external relay part to be optimized, or newly increases outer relay part, just need to revise the whole of controlled terminal ROM, and programming again, upgrade very inconvenient.
Summary of the invention
The object of the invention is to for the deficiencies in the prior art, a kind of long-range control method and system based on script be provided, can solve well controlled terminal size of code large, revise and the difficult problem of upgrading.
For reaching above-mentioned requirements, the technical scheme that the present invention takes is: a kind of long-range control method based on script is provided, comprises the following steps:
S1, control end generate explanatory script language code, and explanatory script language code is joined in control message and sent out Give controlled terminal;
S2, controlled terminal receive described control message, parse the explanatory script language code in described control message;
S3, controlled terminal are carried out described explanatory script language code.
A kind of tele-control system based on script is provided, comprises control end and controlled terminal, control end comprises:
Control instruction generation module, for generating explanatory script language code, and joins explanatory script language code Control in message;
The first transceiver module, for described control message is sent to controlled terminal, and receives the communication report that controlled terminal sends Literary composition;
Controlled terminal comprises:
The second transceiver module, for receiving control message, and will encapsulate the communication of explanatory script language code execution result Message sends to control end;
Script resolver, for carrying out described explanatory script language code.
The advantage that this long-range control method based on script has is as follows:
(1) without carrying out complicated string matching, control end is no matter send the control instruction of what form and control the grammer that parameter only need to meet script to controlled terminal, finally can carry out by the script resolver resolves of controlled terminal, write extra string matching code without developer.
(2) size of code is optimized, use script and script resolver, only need to realize at controlled terminal code and the hardware api interface of script resolver, write separately analysis program without the control instruction of each the outer relay part to controlled terminal, reduce greatly size of code.
(3) amendment is convenient, different with traditional mode, if newly-increased or Optimized code, what revise is the script language code that controlled terminal sends, instead of the script analytic language environment of controlled terminal, so without the ROM on programming controlled terminal again, amendment is convenient.
(4) control flexibly, owing to can transmit the code snippet of script arbitrarily in control message, therefore can Use a code, in code, contain abundant parameter, or use the code combination of multiple statements to realize complicated merit Can; No matter in control message, comprise a statement, or multiple statements, say for controlled terminal, be all that use is same Script resolver is carried out, and the code of controlled terminal, without any amendment, is controlled flexibility ratio considerably beyond traditional control The mode of character string.
Brief description of the drawings
Accompanying drawing described herein is used to provide further understanding of the present application, form the application's a part, in these accompanying drawings, represent same or analogous part with identical reference number, the application's schematic description and description is used for explaining the application, does not form the improper restriction to the application. in the accompanying drawings:
Fig. 1 is the schematic flow sheet of the application's method.
Fig. 2 is the framework schematic diagram of the application's method.
Detailed description of the invention
For making the application's object, technical scheme and advantage clearer, below in conjunction with drawings and the specific embodiments, the application is described in further detail.
Script refers to explains the language of carrying out, and for example Python, PHP, JavaScript are typical scripts, and C language also has explains the version of carrying out.
The application substitutes the control instruction of controlling message with the statement of script. because script resolver self is with morphology, syntax parsing, as long as therefore meet the statement of script specification, can put into control message and pass to controlled terminal as control instruction, and controlled terminal is also without complicated analysis program, the statement that only need to take out script from control message, is then directly submitted to script resolver resolves and carries out.
According to above thinking, a kind of long-range control method based on script is provided, as shown in Figure 1, comprise the following steps:
The control instruction generation module of S1, control end generates explanatory script language code, and by explanatory script language code Join and control in message, send to controlled terminal by the first transceiver module;
S2, controlled terminal were connected the second transceiver module and were received control message, parsed the explanatory script language of controlling in message Speech code;
The script resolver of S3, controlled terminal is carried out described explanatory script language code.
In the process of implementation, if need to control the hardware of controlled terminal, the api interface that calls hardware is carried out to hardware controls.
Explanatory script language code in the control message that control end and controlled terminal directly transmit can be encrypted, and is then first decrypted at controlled terminal, then resolves and carry out.
According to the application embodiment, only need to meet the specification of script owing to controlling control instruction in message, therefore above-mentioned explanatory script language code can be write a statement, also can be one section of statement, and one section of statement can at random combine, realize any function, flexibility is very high.
According to the application embodiment, after step S3, also comprise: the execution result of explanatory script language code is returned to control end by controlled terminal.
According to the application embodiment, a kind of tele-control system based on script is provided, as shown in Figure 2, comprise control end and controlled terminal, control end and controlled terminal have a communication interface, and control end comprises:
Control instruction generation module, for generating explanatory script language code, and joins explanatory script language code Control in message;
The first transceiver module, for described control message is sent to controlled terminal, and receives the communication report that controlled terminal sends Literary composition;
Controlled terminal comprises:
The second transceiver module, for receiving control message, and will encapsulate the communication of explanatory script language code execution result In message, send to control end;
Script resolver, for carrying out described explanatory script language code;
Api interface, has and the interpretative code function one to one of script resolver, for realizing the hard of controlled terminal Part control. for example, local api interface: int local_forward (int distance); This api interface is responsible controlled The local function that system end advances, in the interpretative code of script resolver, just has int forward (int so Distance) function in this interpretative code. the int forward (int comprising when the script language code in control instruction Distance) in function is carried out in the script resolver of controlled terminal, it is right that script resolver will call The local api interface function of answering: int local_forward (int distance); Realize the control to hardware.
According to the application embodiment, control end is at least provided with 1 script resolver and 1 corresponding api interface with it. and the present embodiment is provided with 2 script resolvers and 2 api interfaces, thereby controls when realizing multiple control ends to a controlled terminal.
According to the application embodiment, control end and controlled terminal adopt wireless communication, wired network communication or serial communication, can be also other communication modes.
Control end in the application and controlled terminal are abstract concepts, can be any equipment, and for example control end is computer, and controlled terminal is robot.
The above embodiment only represents several embodiment of the present invention; it describes comparatively concrete and detailed; but can not be interpreted as limitation of the scope of the invention. it should be noted that; for the person of ordinary skill of the art; without departing from the inventive concept of the premise; can also make some distortion and improvement, these all belong to protection domain of the present invention. and therefore protection scope of the present invention should be as the criterion with described claim.

Claims (7)

1. the long-range control method based on script, is characterized in that, comprises the following steps:
S1, control end generate explanatory script language code, and explanatory script language code is joined in control message and sent out Give controlled terminal;
S2, controlled terminal receive described control message, parse the explanatory script language code in described control message;
S3, controlled terminal are carried out described explanatory script language code.
2. the long-range control method based on script according to claim 1, is characterized in that: the statement that described explanatory script language code is explanatory script or the combination of statement.
3. the long-range control method based on script according to claim 1, is characterized in that: after described step S3, also comprise: the execution result of explanatory script language code is returned to control end by controlled terminal.
4. the tele-control system based on script, is characterized in that, comprises control end and controlled terminal, and described control end comprises:
Control instruction generation module, for generating explanatory script language code, and joins explanatory script language code Control in message;
The first transceiver module, for described control message is sent to controlled terminal, and receives the communication report that controlled terminal sends Literary composition;
Described controlled terminal comprises:
The second transceiver module, for receiving described control message, and will encapsulate explanatory script language code execution result Communication message sends to control end;
Script resolver, for carrying out described explanatory script language code.
5. the tele-control system based on script according to claim 4, it is characterized in that: described controlled terminal also comprises api interface, described api interface has the interpretative code function one to one with script resolver, for realizing the hardware controls of controlled terminal.
6. the tele-control system based on script according to claim 4, is characterized in that: described controlled terminal is at least provided with 1 script resolver and 1 api interface.
7. the tele-control system based on script according to claim 4, is characterized in that: described control end and controlled terminal adopt wireless communication, wired network communication or serial communication.
CN201610849694.5A 2016-09-26 2016-09-26 Remote control method and system based on script languages Pending CN106445523A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610849694.5A CN106445523A (en) 2016-09-26 2016-09-26 Remote control method and system based on script languages

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610849694.5A CN106445523A (en) 2016-09-26 2016-09-26 Remote control method and system based on script languages

Publications (1)

Publication Number Publication Date
CN106445523A true CN106445523A (en) 2017-02-22

Family

ID=58169390

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610849694.5A Pending CN106445523A (en) 2016-09-26 2016-09-26 Remote control method and system based on script languages

Country Status (1)

Country Link
CN (1) CN106445523A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107765612A (en) * 2017-12-07 2018-03-06 南京诚思机器人科技有限公司 A kind of motion control method of robot, robot and system
CN108055298A (en) * 2017-12-04 2018-05-18 泰康保险集团股份有限公司 For the method and device of control message queue
CN109839842A (en) * 2019-01-29 2019-06-04 深圳市眼界科技有限公司 Control method, apparatus and system based on visual programming

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103984247A (en) * 2014-04-14 2014-08-13 美的集团股份有限公司 Method and device for controlling household appliance with executable script
CN103984539A (en) * 2014-04-14 2014-08-13 美的集团股份有限公司 Operation method and operation system for household appliance

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103984247A (en) * 2014-04-14 2014-08-13 美的集团股份有限公司 Method and device for controlling household appliance with executable script
CN103984539A (en) * 2014-04-14 2014-08-13 美的集团股份有限公司 Operation method and operation system for household appliance

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108055298A (en) * 2017-12-04 2018-05-18 泰康保险集团股份有限公司 For the method and device of control message queue
CN107765612A (en) * 2017-12-07 2018-03-06 南京诚思机器人科技有限公司 A kind of motion control method of robot, robot and system
CN109839842A (en) * 2019-01-29 2019-06-04 深圳市眼界科技有限公司 Control method, apparatus and system based on visual programming

Similar Documents

Publication Publication Date Title
CN106445523A (en) Remote control method and system based on script languages
CN107621987B (en) Unmanned aerial vehicle general ground station software architecture system based on message
TW201639379A (en) Set-top box remote multi-screen interaction control method and system based on XMPP (Extensible Messaging and Presence Protocol) communication
CN104394191A (en) Method, control terminal, and system for remotely controlling mobile terminal
CN103856376A (en) Intelligent interaction method and intelligent interaction system
CN106528184A (en) App development method based on cordova platform
CN104376711A (en) Method and device for rapidly configuring infrared remote control at mobile terminal
US20190114183A1 (en) Terminal Configuration Method and Terminal Based on Provision Protocol for Transmission
CN104090768A (en) Automatic intelligent smart phone form generating system and method
CN104066203A (en) Method and system for generating identifier of mobile device, method for remotely controlling mobile device, and communication terminal
CN110096380A (en) Android corresponding internal communication method, system, device and storage medium
CN112929331B (en) Universal communication protocol implementation method
CN111988417A (en) Communication control method of physical network terminal
CN103600350A (en) Robot steering gear control system and method based on imaging
CN107911157B (en) Universal satellite command automation technology data processing system and method
CN104469657B (en) Audio communication system and equipment based on WINDOWS operating systems
CN104866404B (en) A kind of general data monitoring method
CN104714634B (en) A kind of remote input method and system
CN104993906A (en) Message transmission method and system
CN110224740A (en) Link terminal IF process machine
CN204925778U (en) Stage multimode cooperative control system
CN114363121A (en) Gateway framework supporting custom protocol and implementation method
CN111176657B (en) C language codec implementation method and system based on TTCN-3 test platform
CN104035422A (en) Data calculation method based on smart mobile terminal
CN110071928A (en) A kind of method for converting protocol actively adapting to power grid communication agreement 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170222