CN107450899B - Method and device for generating terminal control script - Google Patents

Method and device for generating terminal control script Download PDF

Info

Publication number
CN107450899B
CN107450899B CN201610388246.XA CN201610388246A CN107450899B CN 107450899 B CN107450899 B CN 107450899B CN 201610388246 A CN201610388246 A CN 201610388246A CN 107450899 B CN107450899 B CN 107450899B
Authority
CN
China
Prior art keywords
control
script
terminal
interface
generating
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
Application number
CN201610388246.XA
Other languages
Chinese (zh)
Other versions
CN107450899A (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.)
Shenzhen Sundray Technologies Co ltd
Original Assignee
Shenzhen Sundray Technologies 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 Shenzhen Sundray Technologies Co ltd filed Critical Shenzhen Sundray Technologies Co ltd
Priority to CN201610388246.XA priority Critical patent/CN107450899B/en
Publication of CN107450899A publication Critical patent/CN107450899A/en
Application granted granted Critical
Publication of CN107450899B publication Critical patent/CN107450899B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Telephone Function (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a method for generating a terminal control script, which comprises the following steps: when a configuration request of a control strategy sent by a terminal is received, feeding back a control parameter configuration interface to the terminal so that a user can input control parameters based on the control parameter configuration interface displayed by the terminal, wherein the control parameters comprise trigger conditions, control commands and trigger actions; and when receiving control parameters input based on the strategy information configuration interface, filling the control parameters into a preset basic script according to the attribute information of the control parameters so as to generate a terminal control script. The invention also discloses a device for generating the terminal control script. According to the invention, a user can generate the terminal control script to realize the development of the control strategy only by inputting the control parameters in the control parameter configuration interface without knowing the coding principle, and professional personnel are not required to compile codes, so that the cost is low, and the development efficiency is high.

Description

Method and device for generating terminal control script
Technical Field
The invention relates to the technical field of Internet of things, in particular to a method and a device for generating a terminal control script.
Background
With the rapid development of network technology, the idea of internet of everything is gradually implemented. People have realized connecting sensors, controllers, machines, equipment, personnel and objects together in a new way by means of communication technologies such as local area networks or the internet, so as to form the connection between people and objects and between objects and perform information interaction, and realize the information, remote and intelligent management of equipment. The internet of things is in rapid development, and applications based on the internet of things are more and more concerned, such as current products of the internet of things like smart homes, car networking, intelligent transportation, intelligent monitoring, intelligent power and the like. The appearance of the internet of things fundamentally aims to improve the quality of life, improve the quality of life of people and improve the working efficiency of enterprises. The core framework of the Internet of things is composed of a sensing layer, a network layer and an application layer. A complete Internet of things system relates to the technologies of equipment discovery and configuration, equipment connection network, access management platform, equipment remote control, equipment data acquisition and storage, equipment data intelligent analysis and the like. The management platform based on cloud computing is the core of the Internet of things and is responsible for equipment access, message forwarding, equipment control strategy configuration, equipment state monitoring, equipment data collection, data storage analysis and the like.
In the whole mode, the Internet of things platform provides an API for equipment access to the outside, after the intelligent equipment is connected with a network, the API provided by the calling platform is connected to the Internet of things management platform, and then remote control and data management are realized through an intelligent APP or WEB page. Most of internet of things platforms only provide equipment access service externally, do not provide specific application service of the equipment, and need a third party to develop specific services. The method comprises the steps that a small number of Internet of things platforms support access to different types of intelligent equipment, a preset control strategy is provided and used for controlling the intelligent equipment, actual user scenes are complex and many, and are strange, the preset control strategy can only meet part of popular scenes, for special scenes needing to be realized by part of users, the control strategy can only be developed through user definition, and professional developers are required to compile operation codes corresponding to the user-defined control strategy during user-defined development, so that the development cost is high.
Disclosure of Invention
The invention mainly aims to provide a method and a device for generating a terminal control script, and aims to solve the technical problem that the development cost of an Internet of things control strategy is high in the prior art.
In order to achieve the above object, the present invention provides a method for generating a terminal control script, wherein the method for generating the terminal control script comprises the following steps:
when a configuration request of a control strategy sent by a terminal is received, feeding back a control parameter configuration interface to the terminal so that a user can input control parameters based on the control parameter configuration interface displayed by the terminal, wherein the control parameters comprise trigger conditions, control commands and trigger actions;
and when receiving control parameters input based on the strategy information configuration interface, filling the control parameters into a preset basic script according to the attribute information of the control parameters so as to generate a terminal control script.
Optionally, when receiving a configuration request of a control policy sent by a terminal, the step of feeding back a control parameter configuration interface to the terminal includes:
when a configuration request of a control strategy sent by a terminal is received, feeding back a control mode selection interface to the terminal so that a user can select a control mode based on the selection interface displayed by the terminal;
when a timing control mode selection instruction triggered based on the control mode selection interface is received, feeding back a time parameter input interface to the terminal so that a user can input time parameters based on the time parameter input interface and feed back a control parameter configuration interface to the terminal;
and feeding back a control parameter configuration interface to the terminal when receiving an instant control mode selection instruction triggered based on the control mode selection interface.
Optionally, the method for generating the terminal control script further includes the steps of:
when a terminal control script running instruction is received, a preset script interpreter is called to analyze the terminal control script to generate an execution code;
and executing the generated execution code.
Optionally, before the step of feeding back a control parameter configuration interface to the terminal, the method for generating the terminal control script further includes the steps of:
when a configuration request of a control strategy sent by a terminal is received, feeding back an operation scene selection interface to the terminal, wherein the application scene comprises a platform operation scene and an equipment operation scene;
when receiving a selection operation triggered based on the application scene selection interface, executing a step of feeding back a control parameter configuration interface to the terminal;
after the step of filling each control parameter into a preset basic script according to the attribute information of each control parameter to generate a terminal control script, the method for generating the terminal control script further includes the steps of:
when the generated operation scene corresponding to the terminal control script is a platform operation scene, storing the generated terminal control script;
and when the generated operation scene corresponding to the terminal control script is an equipment operation scene, the terminal control script is issued to the equipment corresponding to the terminal control script so that the equipment can store the terminal control script.
Optionally, after the step of filling each control parameter into a preset basic script according to the attribute information of each control parameter, the method for generating the terminal control script further includes:
feeding back a script display interface on which the terminal control script is displayed to the terminal so that a user can modify the terminal control script based on the script display interface;
and when a script modification request triggered based on the script display interface is received, modifying the currently displayed terminal control script based on the script modification request.
In order to achieve the above object, the present invention further provides a terminal control script generating device, including:
the terminal comprises a sending module, a receiving module and a processing module, wherein the sending module is used for feeding back a control parameter configuration interface to the terminal when receiving a configuration request of a control strategy sent by the terminal so that a user can input control parameters based on the control parameter configuration interface displayed by the terminal, and the control parameters comprise trigger conditions, control commands and trigger actions;
and the generating module is used for filling each control parameter into a preset basic script according to the attribute information of each control parameter when receiving the control parameter input based on the strategy information configuration interface so as to generate a terminal control script.
Optionally, the sending module is further configured to:
when a configuration request of a control strategy sent by a terminal is received, feeding back a control mode selection interface to the terminal so that a user can select a control mode based on the selection interface displayed by the terminal;
when a timing control mode selection instruction triggered based on the control mode selection interface is received, feeding back a time parameter input interface to the terminal so that a user can input time parameters based on the time parameter input interface and feed back a control parameter configuration interface to the terminal;
and feeding back a control parameter configuration interface to the terminal when receiving an instant control mode selection instruction triggered based on the control mode selection interface.
Optionally, the apparatus for generating a terminal control script further includes:
the analysis module is used for calling a preset script interpreter to analyze the terminal control script to generate an execution code when receiving a terminal control script operation instruction;
and the running module is used for running the generated execution code.
Optionally, the sending module is further configured to feed back an operation scene selection interface to the terminal when receiving a configuration request of a control policy sent by the terminal, where the application scene includes a platform operation scene and an equipment operation scene, and feed back a control parameter configuration interface to the terminal when receiving a selection operation triggered based on the application scene selection interface;
the device for generating the terminal control script further comprises a storage module, wherein the storage module is used for storing the generated terminal control script when the generated running scene corresponding to the terminal control script is a platform running scene;
the sending module is further configured to, when the generated operation scene corresponding to the terminal control script is an equipment operation scene, issue the terminal control script to the equipment corresponding to the terminal control script, so that the equipment stores the terminal control script.
Optionally, the apparatus for generating a terminal control script further includes:
the sending module is further configured to feed back a script display interface on which the terminal control script is displayed to the terminal, so that a user can modify the terminal control script based on the script display interface;
and the modification module is used for modifying the currently displayed terminal control script based on the script modification request when receiving the script modification request triggered based on the script display interface.
The invention provides a method and a device for generating a terminal control script, which feeds back a control parameter configuration interface to a terminal when receiving a configuration request of a control strategy sent by the terminal, inputs control parameters such as equipment attribute information, a communication mode, a trigger condition, a control command, a trigger action and the like based on the control parameter configuration interface displayed by the terminal by a user, fills each control parameter into a preset basic script according to the attribute information of each control parameter when receiving the control parameter input based on the strategy information configuration interface to generate the terminal control script, and the user can generate the terminal control script to realize the development of the control strategy only by inputting the control parameter in the control parameter configuration interface without knowing the coding principle without writing codes by professional personnel, thereby having lower cost, and the development efficiency is higher.
Drawings
FIG. 1 is a flowchart illustrating a method for generating a terminal control script according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for generating a terminal control script according to a third embodiment of the present invention;
FIG. 3 is a flowchart illustrating a fourth embodiment of a method for generating a terminal control script according to the present invention;
FIG. 4 is a functional block diagram of a device for generating a terminal control script according to a first embodiment of the present invention;
FIG. 5 is a functional block diagram of a device for generating a terminal control script according to a third embodiment of the present invention;
fig. 6 is a functional block diagram of a terminal control script generating apparatus according to a fourth embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a method for generating a terminal control script.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for generating a terminal control script according to an embodiment of the present invention.
The embodiment provides a method for generating a terminal control script, which includes:
step S10, when a configuration request of a control strategy sent by a terminal is received, feeding back a control parameter configuration interface to the terminal so that a user can input control parameters based on the control parameter configuration interface displayed by the terminal, wherein the control parameters comprise trigger conditions, control commands and trigger actions;
in this embodiment, the triggering condition may include a variable (e.g., temperature and current) corresponding to the triggering condition, a condition that the variable needs to satisfy, e.g., the temperature is greater than 20 degrees, and a variable detecting device, e.g., the detecting device corresponding to the variable when the variable is the temperature, is a temperature sensor, so as to realize linkage control between devices, where the variable is the temperature, for example, the triggering condition may be that the temperature detected by the temperature sensor is greater than 20 degrees; the control command may be a command of the control device, and the control command may include a controlled device and a command corresponding to the controlled device, such as turning on, turning off or operating according to a preset parameter, for example, when the triggering condition is that the temperature detected by the temperature sensor is greater than 26 degrees, the corresponding control command is to control the air conditioner to perform cooling operation, that is, the controlled device is an air conditioner, and the command corresponding to the air conditioner is to perform cooling operation, information of the controlled device needs to be selected when the control command is selected, so as to implement linkage between the devices; and triggering and starting actions executed as the local end of the equipment, for example, triggering and starting actions to reduce the rotating speed of a fan when the controlled equipment is an air conditioner. It is understood that the trigger condition, the control command and the trigger action constitute a control parameter group, and the execution condition of the control command or the trigger action needs to satisfy the corresponding trigger condition.
Because the trigger condition, the control command, and the trigger action all include the controlled device, when the controlled device is selected, the attribute information of the controlled device needs to be set, and the communication mode corresponding to each device is set, that is, each control parameter set, such as a control command set, a trigger action set, a device variable set, a device type set, and a communication mode set, may be configured in advance. It is to be understood that the sets of the respective control parameters may also be displayed in other manners besides the drop-down box, for example, a sub-interface is set for each control parameter, that is, the control parameter configuration interface includes an input sub-interface corresponding to each control parameter, and the input sub-interface includes all the control parameters in the sets of the control parameters, for example, the triggering conditions include various variable conditions such as temperature, acceleration, current, voltage, and the like, and then the various triggering variable conditions may be displayed in the input sub-interface of the triggering conditions. This combination of control parameters can be set and updated by the developer as needed.
In this embodiment, the device attribute information may include information that may determine the identity of the device, such as the type of the device, the name of the device, the device ID, and the physical address of the device, and the user may select the device ID or the device name and other information on a sub-interface corresponding to the device attribute information in the control parameter configuration interface, and when the selected device is a device already connected to the internet of things cloud platform, the device name, the physical address and other information associated with the ID may be directly displayed by inputting the ID of the device; the communication mode may include mobile communication (such as a short message mode) or internet communication (HTTP), and the user may configure the communication mode to implement communication control between each device and the internet of things platform.
And step S20, when the control parameters input based on the strategy information configuration interface are received, filling the control parameters into a preset basic script according to the attribute information of the control parameters to generate a terminal control script.
The preset basic script comprises a basic logic structure script required by executing actions, the basic script supports three logic structures of sequence, condition and circulation and supports variable assignment and comparison operation, if the trigger condition is met in the conditional logic structure of the basic script, a corresponding control command is triggered or a corresponding action is executed, a predefined function can be called in the execution process of the basic script, and the predefined function can be a command function or an action function and the like. The attribute information of the control parameter is the type corresponding to the control parameter, for example, when the control parameter is a trigger condition, the control parameter condition is filled in the field corresponding to the trigger condition, and when the control parameter is a control command, the control parameter is filled in the field corresponding to the control command.
The generated terminal control script is executed in the equipment and also in the Internet of things platform, and a script interpreter can be built in the Internet of things platform and the equipment to realize the execution of the script. Namely, the method for generating the terminal control script further comprises the following steps: when a terminal control script running instruction is received, a preset script interpreter is called to analyze the terminal control script so as to generate an execution code; and executing the generated execution code.
It can be understood that both the device and the platform of the internet of things can execute the terminal control script and can also execute program codes compiled by other developers, so that the functions of the device and the platform of the internet of things are richer.
In the method for generating the terminal control script provided by this embodiment, when a configuration request of a control policy sent by a terminal is received, a control parameter configuration interface is fed back to the terminal, a user inputs control parameters such as device attribute information, a communication mode, a trigger condition, a control command, and a trigger action based on the control parameter configuration interface displayed by the terminal, and when the control parameters input based on the policy information configuration interface are received, the control parameters are filled into a preset basic script according to the attribute information of the control parameters to generate the terminal control script.
Further, a second embodiment of the method for generating a terminal control script according to the present invention is proposed based on the first embodiment, and in this embodiment, step S10 includes:
when a configuration request of a control strategy sent by a terminal is received, feeding back a control mode selection interface to the terminal so that a user can select a control mode based on the selection interface displayed by the terminal;
when a timing control mode selection instruction triggered based on a control mode selection interface is received, feeding back a time parameter input interface to the terminal so that a user can input time parameters based on the time parameter input interface and feed back a control parameter configuration interface to the terminal;
when an instant control mode selection instruction triggered based on a control mode selection interface is received, feeding back a control parameter configuration interface to a terminal;
and when the command triggered on the basis of the control mode selection interface is a timing control mode selection command, filling each control parameter into a preset basic script according to the attribute information of each control parameter, and simultaneously filling a time parameter into the basic script.
In this embodiment, a user may select and configure a control mode before configuring a control parameter, where the control mode may include a timing mode and an immediate mode, the timing mode is a determination of a timing execution condition and an execution of an action, a time parameter of the timing mode may include a repetition period and a rereading type, and the time parameter may further include a start time, an end time, and a trigger time to improve accuracy of control, so as to control an execution time period of the timing mode; the instant mode is real-time execution, and after the terminal control script is started to be executed, corresponding actions can be executed as long as conditions are met.
In the scheme disclosed by the embodiment, a user can configure timing execution and instant execution according to needs, so that the configuration of the control strategy is more flexible.
Further, referring to fig. 2, a third embodiment of the method for generating a terminal control script according to the present invention is proposed based on the first or second embodiment, and in this embodiment, before step S10, the method further includes:
step S30, when a configuration request of a control strategy sent by a terminal is received, feeding back an operation scene selection interface to the terminal, wherein an application scene comprises a platform operation scene and an equipment operation scene;
step S40, when receiving a selection operation triggered based on the application scene selection interface, acquiring an operation scene corresponding to the selection operation;
after step S20, the method for generating a terminal control script further includes the steps of:
step S50, when the operation scene corresponding to the generated terminal control script is a platform operation scene, the generated terminal control script is stored;
and step S60, when the operation scene corresponding to the generated terminal control script is the device operation scene, issuing the terminal control script to the device corresponding to the terminal control script for the device to store the terminal control script.
In this embodiment, before configuring the control parameters, an operation scenario of the terminal control script may be configured, where the operation scenario may include device operation and platform operation, and when the operation scenario is device operation, the operation scenario may be directly issued to a corresponding device, and when the operation scenario is platform operation, the operation scenario may be directly stored so as to facilitate subsequent operation.
Further, referring to fig. 3, a fourth embodiment of the method for generating a terminal control script according to the present invention is provided based on any one of the first to third embodiments, where in this embodiment, after step S20, the method further includes:
step S70, feeding back a script display interface with a terminal control script to the terminal, so that a user can modify the terminal control script based on the script display interface;
and step S80, when receiving a script modification request triggered based on the script display interface, modifying the currently displayed terminal control script based on the script modification request.
In the solution disclosed in this embodiment, for a user who knows the script knowledge, the automatically generated terminal control script may be modified, so that the terminal control script is generated more flexibly, and when the modified script does not conform to the script language or obviously has a syntax error, a prompt message is output, for example, a script field with an error is marked.
The invention further provides a device for generating the terminal control script.
Referring to fig. 4, fig. 4 is a functional module diagram of a terminal control script generating device according to a preferred embodiment of the present invention.
It should be emphasized that the functional block diagram shown in fig. 4 is merely an exemplary diagram of a preferred embodiment, and those skilled in the art can easily add new functional blocks around the functional blocks of the terminal control script generating apparatus shown in fig. 4; the names of the functional modules are self-defined names which are only used for assisting in understanding the program functional blocks of the terminal control script generation device and are not used for limiting the technical scheme of the invention, and the core of the technical scheme of the invention is that the functions to be achieved by the functional modules with the names are respectively defined.
The present embodiment provides a terminal control script generating apparatus, which includes:
the sending module 10 is configured to, when receiving a configuration request of a control policy sent by a terminal, feed back a control parameter configuration interface to the terminal, so that a user inputs a control parameter based on the control parameter configuration interface displayed by the terminal, where the control parameter includes a trigger condition, a control command, and a trigger action;
in this embodiment, the triggering condition may include a variable (e.g., temperature and current) corresponding to the triggering condition, a condition that the variable needs to satisfy, e.g., the temperature is greater than 20 degrees, and a variable detecting device, e.g., the detecting device corresponding to the variable when the variable is the temperature, is a temperature sensor, so as to realize linkage control between devices, where the variable is the temperature, for example, the triggering condition may be that the temperature detected by the temperature sensor is greater than 20 degrees; the control command may be a command of the control device, and the control command may include a controlled device and a command corresponding to the controlled device, such as turning on, turning off or operating according to a preset parameter, for example, when the triggering condition is that the temperature detected by the temperature sensor is greater than 26 degrees, the corresponding control command is to control the air conditioner to perform cooling operation, that is, the controlled device is an air conditioner, and the command corresponding to the air conditioner is to perform cooling operation, information of the controlled device needs to be selected when the control command is selected, so as to implement linkage between the devices; and triggering and starting actions executed as the local end of the equipment, for example, triggering and starting actions to reduce the rotating speed of a fan when the controlled equipment is an air conditioner. It is understood that the trigger condition, the control command and the trigger action constitute a control parameter group, and the execution condition of the control command or the trigger action needs to satisfy the corresponding trigger condition.
Because the trigger condition, the control command, and the trigger action all include the controlled device, when the controlled device is selected, the attribute information of the controlled device needs to be set, and the communication mode corresponding to each device is set, that is, each control parameter set, such as a control command set, a trigger action set, a device variable set, a device type set, and a communication mode set, may be configured in advance. It is to be understood that the sets of the respective control parameters may also be displayed in other manners besides the drop-down box, for example, a sub-interface is set for each control parameter, that is, the control parameter configuration interface includes an input sub-interface corresponding to each control parameter, and the input sub-interface includes all the control parameters in the sets of the control parameters, for example, the triggering conditions include various variable conditions such as temperature, acceleration, current, voltage, and the like, and then the various triggering variable conditions may be displayed in the input sub-interface of the triggering conditions. This combination of control parameters can be set and updated by the developer as needed.
In this embodiment, the device attribute information may include information that may determine the identity of the device, such as the type of the device, the name of the device, the device ID, and the physical address of the device, and the user may select the device ID or the device name and other information on a sub-interface corresponding to the device attribute information in the control parameter configuration interface, and when the selected device is a device already connected to the internet of things cloud platform, the device name, the physical address and other information associated with the ID may be directly displayed by inputting the ID of the device; the communication mode may include mobile communication (such as a short message mode) or internet communication (HTTP), and the user may configure the communication mode to implement communication control between each device and the internet of things platform.
And the generating module 20 is configured to, when receiving the control parameter input based on the policy information configuration interface, fill each control parameter into a preset basic script according to the attribute information of each control parameter, so as to generate a terminal control script.
The preset basic script comprises a basic logic structure script required by executing actions, the basic script supports three logic structures of sequence, condition and circulation and supports variable assignment and comparison operation, if the trigger condition is met in the conditional logic structure of the basic script, a corresponding control command is triggered or a corresponding action is executed, a predefined function can be called in the execution process of the basic script, and the predefined function can be a command function or an action function and the like. The attribute information of the control parameter is the type corresponding to the control parameter, for example, when the control parameter is a trigger condition, the control parameter condition is filled in the field corresponding to the trigger condition, and when the control parameter is a control command, the control parameter is filled in the field corresponding to the control command.
The generated terminal control script is executed in the equipment and also in the Internet of things platform, and a script interpreter can be built in the Internet of things platform and the equipment to realize the execution of the script. Namely, the apparatus for generating a terminal control script further comprises: the analysis module is used for calling a preset script interpreter to analyze the terminal control script to generate an execution code when receiving a terminal control script operation instruction; and the running module is used for running the generated execution code.
It can be understood that both the device and the platform of the internet of things can execute the terminal control script and can also execute program codes compiled by other developers, so that the functions of the device and the platform of the internet of things are richer.
The generation device of the terminal control script provided in this embodiment feeds back a control parameter configuration interface to the terminal when receiving a configuration request of a control policy sent by the terminal, and a user inputs control parameters such as device attribute information, a communication mode, a trigger condition, a control command, and a trigger action based on the control parameter configuration interface displayed by the terminal, and when receiving the control parameters input based on the policy information configuration interface, fills each control parameter into a preset basic script according to the attribute information of each control parameter to generate the terminal control script.
Further, a second embodiment of the apparatus for generating a terminal control script according to the present invention is provided based on the first embodiment, and in this embodiment, the sending module 10 is further configured to:
when a configuration request of a control strategy sent by a terminal is received, feeding back a control mode selection interface to the terminal so that a user can select a control mode based on the selection interface displayed by the terminal;
when a timing control mode selection instruction triggered based on a control mode selection interface is received, feeding back a time parameter input interface to the terminal so that a user can input time parameters based on the time parameter input interface and feed back a control parameter configuration interface to the terminal;
when an instant control mode selection instruction triggered based on a control mode selection interface is received, feeding back a control parameter configuration interface to a terminal;
the generating module 20 is further configured to, when the instruction triggered based on the control mode selection interface is a timing control mode selection instruction, fill the time parameter into the basic script.
In this embodiment, a user may select and configure a control mode before configuring a control parameter, where the control mode may include a timing mode and an immediate mode, the timing mode is a determination of a timing execution condition and an execution of an action, a time parameter of the timing mode may include a repetition period and a rereading type, and the time parameter may further include a start time, an end time, and a trigger time to improve accuracy of control, so as to control an execution time period of the timing mode; the instant mode is real-time execution, and after the terminal control script is started to be executed, corresponding actions can be executed as long as conditions are met.
In the scheme disclosed by the embodiment, a user can configure timing execution and instant execution according to needs, so that the configuration of the control strategy is more flexible.
Further, referring to fig. 5, a third embodiment of the method for generating a terminal control script according to the present invention is proposed based on the first or second embodiment, and in this embodiment, the apparatus for generating a terminal control script further includes:
the sending module 10 is further configured to feed back an operation scene selection interface to the terminal when receiving a configuration request of a control policy sent by the terminal, where an application scene includes a platform operation scene and an equipment operation scene;
the obtaining module 30 is configured to obtain an operation scene corresponding to a selection operation when the selection operation triggered based on the application scene selection interface is received;
the storage module 40 is configured to store the generated terminal control script when the operation scene corresponding to the generated terminal control script is the platform operation scene;
the sending module 10 is further configured to, when the generated operation scene corresponding to the terminal control script is an equipment operation scene, issue the terminal control script to the equipment corresponding to the terminal control script, so that the equipment stores the terminal control script.
In this embodiment, before configuring the control parameters, an operation scenario of the terminal control script may be configured, where the operation scenario may include device operation and platform operation, and when the operation scenario is device operation, the operation scenario may be directly issued to a corresponding device, and when the operation scenario is platform operation, the operation scenario may be directly stored so as to facilitate subsequent operation.
Further, referring to fig. 5, a fourth embodiment of the method for generating a terminal control script according to the present invention is provided based on any one of the first to third embodiments, and in this embodiment, the apparatus for generating a terminal control script further includes:
the sending module 10 is further configured to feed back a script display interface on which the terminal control script is displayed to the terminal, so that a user can modify the terminal control script based on the script display interface;
and the modification module 50 is used for modifying the currently displayed terminal control script based on the script modification request when receiving the script modification request triggered based on the script display interface.
In the solution disclosed in this embodiment, for a user who knows the script knowledge, the automatically generated terminal control script may be modified, so that the terminal control script is generated more flexibly, and when the modified script does not conform to the script language or obviously has a syntax error, a prompt message is output, for example, a script field with an error is marked.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be substantially or partially embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk), and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a cloud server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. A method for generating a terminal control script is characterized by comprising the following steps:
when a configuration request of a control strategy sent by a terminal is received, feeding back a control parameter configuration interface to the terminal so that a user can input control parameters based on the control parameter configuration interface displayed by the terminal, wherein the control parameters comprise a trigger condition, a control command, a trigger action and a communication mode corresponding to a controlled device, the trigger condition comprises a variable corresponding to the trigger condition and a variable detection device, the control command comprises a command corresponding to the controlled device, and the trigger action is an action executed by the local terminal of the controlled device;
when control parameters input based on a strategy information configuration interface are received, filling the control parameters into a preset basic script according to the attribute information of the control parameters to generate a terminal control script, wherein the attribute information of the control parameters is the type corresponding to the control parameters, the basic script comprises a basic logic structure script required by executing actions, the basic script supports three logic structures of sequence, condition and circulation, variable assignment and comparison operation are supported, a predefined function can be called in the execution process of the basic script, and the predefined function is a command function or an action function;
and when the operation scene fed back by the terminal is received as the equipment operation scene, the terminal control script is issued to the equipment corresponding to the terminal control script so that the equipment can store the terminal control script, and the control script is converted into an execution code through a script interpreter and then operates.
2. The method for generating a terminal control script according to claim 1, wherein the step of feeding back a control parameter configuration interface to the terminal upon receiving a configuration request of a control policy sent by the terminal comprises:
when a configuration request of a control strategy sent by a terminal is received, feeding back a control mode selection interface to the terminal so that a user can select a control mode based on the selection interface displayed by the terminal;
when a timing control mode selection instruction triggered based on the control mode selection interface is received, feeding back a time parameter input interface to the terminal so that a user can input time parameters based on the time parameter input interface and feed back a control parameter configuration interface to the terminal;
when an instant control mode selection instruction triggered based on the control mode selection interface is received, feeding back a control parameter configuration interface to the terminal;
and when the command triggered on the basis of the control mode selection interface is a timing control mode selection command, filling the time parameter into a preset basic script while executing the step of filling each control parameter into the basic script according to the attribute information of each control parameter.
3. The method for generating a terminal control script according to claim 1, wherein the method for generating a terminal control script further comprises the steps of:
when a terminal control script running instruction is received, a preset script interpreter is called to analyze the terminal control script to generate an execution code;
and executing the generated execution code.
4. The method for generating a terminal control script according to any one of claims 1 to 3, wherein after the step of populating each of the control parameters into a preset basic script according to the attribute information of each of the control parameters, the method for generating a terminal control script further comprises:
feeding back a script display interface on which the terminal control script is displayed to the terminal so that a user can modify the terminal control script based on the script display interface;
and when a script modification request triggered based on the script display interface is received, modifying the currently displayed terminal control script based on the script modification request.
5. A terminal control script generating apparatus, comprising:
the control strategy configuration method comprises the steps that a sending module is used for feeding back a control parameter configuration interface to a terminal when a configuration request of a control strategy sent by the terminal is received, so that a user can input control parameters based on the control parameter configuration interface displayed by the terminal, wherein the control parameters comprise a trigger condition, a control command, a trigger action and a communication mode corresponding to a controlled device, the trigger condition comprises a variable corresponding to the trigger condition and a variable detection device, the control command comprises a command corresponding to the controlled device, and the trigger action is an action executed by the local terminal of the controlled device;
the generating module is used for filling each control parameter into a preset basic script according to the attribute information of each control parameter when the control parameter input based on the strategy information configuration interface is received so as to generate a terminal control script, the attribute information of the control parameter is the type corresponding to the control parameter, the basic script comprises a basic logic structure script required by executing an action, the basic script supports three logic structures of sequence, condition and circulation, variable assignment and comparison operation are supported, a predefined function can be called in the executing process of the basic script, and the predefined function is a command function or an action function;
the sending module is further configured to, when the operation scene fed back by the terminal is an equipment operation scene, send the terminal control script to the equipment corresponding to the terminal control script, so that the equipment stores the terminal control script, and the control script is converted into an execution code by the script interpreter and then operates.
6. The apparatus for generating a terminal control script according to claim 5, wherein the sending module is further configured to:
when a configuration request of a control strategy sent by a terminal is received, feeding back a control mode selection interface to the terminal so that a user can select a control mode based on the selection interface displayed by the terminal;
when a timing control mode selection instruction triggered based on the control mode selection interface is received, feeding back a time parameter input interface to the terminal so that a user can input time parameters based on the time parameter input interface and feed back a control parameter configuration interface to the terminal;
when an instant control mode selection instruction triggered based on the control mode selection interface is received, feeding back a control parameter configuration interface to the terminal;
the generating module is further configured to fill the time parameter into the basic script when the instruction triggered based on the control mode selection interface is a timing control mode selection instruction.
7. The apparatus for generating a terminal control script according to claim 5, wherein the apparatus for generating a terminal control script further comprises:
the analysis module is used for calling a preset script interpreter to analyze the terminal control script to generate an execution code when receiving a terminal control script operation instruction;
and the running module is used for running the generated execution code.
8. The apparatus for generating a terminal control script according to any one of claims 5 to 7, wherein the apparatus for generating a terminal control script further comprises:
the sending module is further configured to feed back a script display interface on which the terminal control script is displayed to the terminal, so that a user can modify the terminal control script based on the script display interface;
and the modification module is used for modifying the currently displayed terminal control script based on the script modification request when receiving the script modification request triggered based on the script display interface.
CN201610388246.XA 2016-06-01 2016-06-01 Method and device for generating terminal control script Active CN107450899B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610388246.XA CN107450899B (en) 2016-06-01 2016-06-01 Method and device for generating terminal control script

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610388246.XA CN107450899B (en) 2016-06-01 2016-06-01 Method and device for generating terminal control script

Publications (2)

Publication Number Publication Date
CN107450899A CN107450899A (en) 2017-12-08
CN107450899B true CN107450899B (en) 2022-04-26

Family

ID=60484833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610388246.XA Active CN107450899B (en) 2016-06-01 2016-06-01 Method and device for generating terminal control script

Country Status (1)

Country Link
CN (1) CN107450899B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109407534B (en) * 2018-12-04 2022-05-13 深圳绿米联创科技有限公司 Equipment control method and device, configuration equipment and control device
CN109683715B (en) * 2018-12-29 2020-12-18 北京诺亦腾科技有限公司 VR equipment control method and device and computer readable storage medium
CN109839842A (en) * 2019-01-29 2019-06-04 深圳市眼界科技有限公司 Control method, apparatus and system based on visual programming
CN110061861B (en) * 2019-03-21 2022-08-12 广东瑞恩科技有限公司 Internet protocol configuration method, device, equipment and computer readable storage medium
KR102385381B1 (en) * 2019-12-11 2022-04-11 스노우 주식회사 Method and system for generating script forcamera effect
CN113407162B (en) * 2020-03-17 2023-05-30 桂林优利特医疗电子有限公司 Liquid path control language system with script analysis and construction method
CN111817930A (en) * 2020-06-09 2020-10-23 四川虹美智能科技有限公司 Equipment control method, intelligent household appliance, intelligent terminal and intelligent electronic equipment
CN112269566B (en) * 2020-11-03 2022-09-02 支付宝(杭州)信息技术有限公司 Script generation processing method, device, equipment and system
CN114528064A (en) * 2020-11-23 2022-05-24 深圳Tcl新技术有限公司 Scene configuration method, storage medium and terminal equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103135976A (en) * 2011-11-30 2013-06-05 阿里巴巴集团控股有限公司 Code automatic generation method and device
CN103428294A (en) * 2013-08-23 2013-12-04 广州唯创电子有限公司 System for realizing intellectualization of electric rice cooker by utilizing intelligent terminal
CN103970939A (en) * 2014-04-22 2014-08-06 南京航空航天大学 Layering and reconfigurable on-chip network modeling and simulation system
CN105913316A (en) * 2016-04-15 2016-08-31 中国银行股份有限公司 Rule configuration method and apparatus

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101876908A (en) * 2010-06-30 2010-11-03 中兴通讯股份有限公司 User customizing method and system
CN103136669A (en) * 2011-11-23 2013-06-05 腾讯科技(深圳)有限公司 Product display method and product display system based on product model base
EP2872669A4 (en) * 2012-07-13 2016-03-23 Omniprobe Inc Gas injection system for energetic-beam instruments
CN104007727B (en) * 2014-05-21 2016-06-08 珠海格力电器股份有限公司 Household appliance control method and system
US10170123B2 (en) * 2014-05-30 2019-01-01 Apple Inc. Intelligent assistant for home automation
US20150370272A1 (en) * 2014-06-23 2015-12-24 Google Inc. Intelligent configuration of a smart environment based on arrival time
CN104866250B (en) * 2014-06-27 2018-11-27 广东美的环境电器制造有限公司 Household electrical appliance and its control system and method, mobile terminal, Cloud Server
CN104202187B (en) * 2014-08-28 2017-11-14 新华三技术有限公司 A kind of method and apparatus that the virtual bridged function in edge is disposed for interchanger
CN104317205B (en) * 2014-09-18 2017-09-22 广东美的集团芜湖制冷设备有限公司 terminal control method and system
CN104898472B (en) * 2015-03-31 2018-03-13 广东美的制冷设备有限公司 terminal control method and device
CN105137780A (en) * 2015-07-31 2015-12-09 郝居杰 Customizable control method and system for smart home equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103135976A (en) * 2011-11-30 2013-06-05 阿里巴巴集团控股有限公司 Code automatic generation method and device
CN103428294A (en) * 2013-08-23 2013-12-04 广州唯创电子有限公司 System for realizing intellectualization of electric rice cooker by utilizing intelligent terminal
CN103970939A (en) * 2014-04-22 2014-08-06 南京航空航天大学 Layering and reconfigurable on-chip network modeling and simulation system
CN105913316A (en) * 2016-04-15 2016-08-31 中国银行股份有限公司 Rule configuration method and apparatus

Also Published As

Publication number Publication date
CN107450899A (en) 2017-12-08

Similar Documents

Publication Publication Date Title
CN107450899B (en) Method and device for generating terminal control script
CN107276864B (en) Method, device and system for controlling household appliances by intelligent voice equipment
WO2020181599A1 (en) Model application method and system, and model management method and server
CN114115852A (en) Visual service arranging method, device, equipment and medium
CN111026982A (en) Intelligent contract processing method, computer equipment and storage medium
CN107729014B (en) Page jump method and structure based on Android
CN106230977B (en) A kind of client functionality loading method, system, client and server-side
CN111182065A (en) Message processing method and device based on MQTT protocol and computer equipment
CN105577721A (en) Remote terminal control method and system thereof
CN109788029A (en) Gray scale call method, device, terminal and the readable storage medium storing program for executing of micro services
CN114115866A (en) Cross-domain-based vehicle-mounted scene self-defining method, device, equipment and storage medium
CN103488696A (en) Business query method, device and system of CPE (customer premises equipment), ACS (auto-configuration server) and CPE
CN111413876A (en) Method for configuring control page of APP, cloud platform and terminal equipment
CN109117127A (en) Program code generation method, device and computer readable storage medium
CN115248692A (en) Device and method for supporting cloud deployment of multiple deep learning framework models
CN107102798B (en) Method, system and related module for dynamically modifying user interface
CN110109684A (en) Block chain node administration agent services installation method, electronic device and storage medium
CN106445479A (en) Information pushing method and apparatus
CN112667251A (en) Service deployment method, device, computer equipment and storage medium
CN106095886B (en) Data processing method and device
CN112558968A (en) Resource tree view generation method, device, equipment and storage medium
CN113268232A (en) Page skin generation method and device and computer readable storage medium
CN113467776B (en) Method and device for accessing equipment, storage medium and electronic device
CN113645131B (en) Data processing method, device, electronic equipment and storage medium
CN112765038B (en) Distributed cluster software testing method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant