CN110795086B - Control method and device and electronic equipment - Google Patents

Control method and device and electronic equipment Download PDF

Info

Publication number
CN110795086B
CN110795086B CN201911100618.4A CN201911100618A CN110795086B CN 110795086 B CN110795086 B CN 110795086B CN 201911100618 A CN201911100618 A CN 201911100618A CN 110795086 B CN110795086 B CN 110795086B
Authority
CN
China
Prior art keywords
hardware
programming
controlled
controlled hardware
interface
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
CN201911100618.4A
Other languages
Chinese (zh)
Other versions
CN110795086A (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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201911100618.4A priority Critical patent/CN110795086B/en
Publication of CN110795086A publication Critical patent/CN110795086A/en
Application granted granted Critical
Publication of CN110795086B publication Critical patent/CN110795086B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a control method, a control device and electronic equipment, wherein the method comprises the following steps: the method comprises the steps of obtaining user input operation on a webpage programming interface, wherein the webpage programming interface is an editing interface of a programming teaching tool, at least one hardware graph is displayed on the webpage programming interface, and the user input operation at least comprises the following steps: at least one edited hardware graphic; obtaining programming input data according to the edited hardware graph, wherein the programming input data at least comprises: the control code corresponds to at least one piece of controlled hardware; code conversion is carried out on the control codes to obtain the control codes which can be executed by the controlled hardware; and transmitting the converted control codes to the controlled hardware, so that the controlled hardware executes the control codes to realize corresponding programming teaching display operation.

Description

Control method and device and electronic equipment
Technical Field
The present disclosure relates to the field of programming control technologies, and in particular, to a control method and apparatus, and an electronic device.
Background
At present, various programming teaching activities for teenagers are more and more, and programming teaching tools for teenagers are also more and more.
In the existing programming teaching tool, when the related hardware needs to be programmed and controlled, the development environment of the programming teaching tool is generally required to be integrated into the programming teaching tool, so that the control program of the hardware can be written into the hardware, so as to control the hardware.
However, the integration of the development environment into the programming teaching tool inevitably causes the development code of the programming teaching tool to be huge.
Disclosure of Invention
In view of this, the present application provides a control method, an apparatus and an electronic device, so as to solve the technical problem that development codes are huge due to the need of integrating a development environment into a programming teaching tool when hardware is controlled in the prior art, as follows:
a method of controlling, the method comprising:
the method comprises the steps of obtaining user input operation on a webpage programming interface, wherein the webpage programming interface is an editing interface of a programming teaching tool, at least one hardware graph is displayed on the webpage programming interface, and the user input operation at least comprises the following steps: at least one edited hardware graphic;
obtaining programming input data according to the edited hardware graph, wherein the programming input data at least comprises: the control code corresponds to at least one piece of controlled hardware;
code conversion is carried out on the control codes to obtain the control codes which can be executed by the controlled hardware;
and transmitting the converted control codes to the controlled hardware, so that the controlled hardware executes the control codes to realize corresponding programming teaching display operation.
The method preferably obtains the user input operation on the web page programming interface, and includes:
and acquiring user input operation on the webpage programming interface in the programming teaching tool by using the websocket interface corresponding to the webpage programming interface.
Preferably, the method further includes, in the programming input data: a hardware identifier of at least one piece of the controlled hardware; the method further comprises the following steps:
establishing a communication interface corresponding to the controlled hardware at least based on the hardware identifier;
the communication interface transmits the control codes between the programming teaching tool and the controlled hardware, so that the controlled hardware executes the control codes to realize corresponding programming teaching display operation.
Preferably, the method for obtaining the communication interface corresponding to the controlled hardware at least based on the hardware identifier includes:
determining a hardware driver of the controlled hardware corresponding to the hardware identifier;
and establishing a communication interface with the hardware driver by using a preset communication protocol.
Preferably, the method for transcoding the control code to obtain the control code executable by the controlled hardware includes:
and compiling the control code to obtain an executable control code, wherein the executable control code can be executed by the controlled hardware.
In the above method, preferably, the control code is transmitted in the form of a queue in the communication interface.
Preferably, the method for transmitting the converted control code to the controlled hardware includes:
determining a serial port number corresponding to the controlled hardware according to the hardware identifier;
and transmitting the converted control code to a transmission port of the controlled hardware by using the serial port number, so that the control code is transmitted to the controlled hardware.
A control device, comprising:
an operation obtaining unit, configured to obtain a user input operation on a web page programming interface, where the web page programming interface is an editing interface of a programming teaching tool, and at least one hardware graphic is displayed on the web page programming interface, and the user input operation at least includes: at least one edited hardware graphic;
a data obtaining unit, configured to obtain programming input data according to the edited hardware graph, where the programming input data at least includes: the control code corresponds to at least one piece of controlled hardware;
the code conversion unit is used for carrying out code conversion on the control codes to obtain the control codes which can be executed by the controlled hardware;
and the code transmission unit is used for transmitting the converted control codes to the controlled hardware so that the controlled hardware executes the control codes to realize corresponding programming teaching display operation.
An electronic device, comprising: a display and a processor;
the display is used for outputting a webpage programming interface of a programming teaching tool, the webpage programming interface is an editing interface of the programming teaching tool, and at least one hardware graph is displayed on the webpage programming interface;
the processor is configured to obtain a user input operation on the web page programming interface, where the user input operation at least includes: at least one edited hardware graphic; obtaining programming input data according to the edited hardware graph, wherein the programming input data at least comprises: the control code corresponds to at least one piece of controlled hardware; code conversion is carried out on the control codes to obtain the control codes which can be executed by the controlled hardware; and transmitting the converted control codes to the controlled hardware, so that the controlled hardware executes the control codes and realizes corresponding programming teaching display operation.
According to the technical scheme, in the control method, the control device and the electronic equipment disclosed by the application, the hardware graph representing the controlled hardware is displayed through the webpage programming interface in the programming teaching tool, and then after the user input operation aiming at the edited hardware image is obtained, the programming input data at least comprising the control code corresponding to the controlled hardware can be obtained according to the edited hardware image, so that after the control code is subjected to code conversion to obtain the executable control code of the controlled hardware, the control code can be transmitted to the controlled hardware, and then the controlled hardware can execute the control code to realize the corresponding programming teaching display operation. Therefore, in the application, a programming interface is provided for a user through a webpage, conversion and transmission of control codes can be realized through the form of the webpage, and control over hardware is realized, so that the development environment of a programming teaching tool does not need to be integrated into the tool, and the code amount in the programming teaching tool is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a flowchart of a control method according to an embodiment of the present application;
FIG. 2 is a diagram illustrating an example of an application of an embodiment of the present application;
fig. 3 is another flowchart of a control method according to an embodiment of the present application;
FIG. 4 is a diagram illustrating another exemplary application of an embodiment of the present application;
fig. 5 is a schematic structural diagram of a control device according to a second embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to a third embodiment of the present application;
FIG. 7 is a diagram illustrating another embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
As shown in fig. 1, a flowchart of an implementation of a control method provided in an embodiment of the present application is provided, and the method is suitable for an electronic device capable of performing data processing, such as a local or cloud computer or a server. The method in the embodiment mainly provides a webpage programming interface for a user in a webpage form, so that the programming control of hardware is realized.
Specifically, the method in this embodiment may include the following steps:
step 101: user input operations on a web page programming interface are obtained.
The web page programming interface is an editing interface of the programming teaching tool, as shown in fig. 2, the programming teaching tool starts the editing interface of the programming teaching tool through a browser on the computer, and the editing interface is displayed in a web page form started in the browser. At least one hardware graph is displayed on the web page programming interface, and each hardware graph corresponds to corresponding controlled hardware, such as a trolley graph in fig. 2, and corresponds to physical hardware of a trolley.
It should be noted that the user input operation at least includes one or more edited hardware graphics, that is, the user may perform the hardware graphics editing operation, such as dragging, double-clicking, splicing, and the like, on the web page programming interface, so as to generate a corresponding user input operation, where the user input operation at least includes the edited hardware graphics, and may also include data such as layout or connection relationship between the edited hardware graphics.
Step 102: and obtaining programming input data according to the edited hardware graph.
Wherein the programming input data at least comprises: and the control codes correspond to one or more pieces of controlled hardware. It should be noted that, in this embodiment, the controlled hardware that needs to be controlled in a linkage manner may be determined based on the edited hardware graph, for example, a hardware identifier of the controlled hardware is obtained, and then the control code corresponding to the hardware identifier is obtained in the code library, that is, the control code corresponding to the controlled hardware may be obtained.
Specifically, the code library in this embodiment may be a local code library, or may also be a code library on the cloud server, so that after the user input operation is obtained through the web page programming interface in the browser, the corresponding control code of the controlled hardware may be obtained in the local code library, or the user input data may be transmitted to the cloud server, and the cloud server obtains the corresponding control code of the controlled hardware.
It should be noted that the control code of the controlled hardware is used to implement the programming teaching demonstration operation of the corresponding function, for example, the cart mold of the entity hardware in fig. 2 can move forward and backward or turn around under the execution of the corresponding control code, so as to implement the programming teaching between the teacher and the student.
Step 103: and code conversion is carried out on the control code to obtain the control code which can be executed by controlled hardware.
In this embodiment, a format of a code that can be executed by the controlled hardware may be determined according to a hardware type or other parameters of the controlled hardware, and then the control code is code-converted according to the format, so as to obtain the control code that can be executed by the controlled hardware.
Alternatively, in this embodiment, the control code may be compiled to obtain an executable code, that is, the control code that can be executed by the controlled hardware.
Step 104: and transmitting the converted control codes to controlled hardware, so that the controlled hardware executes the control codes to realize corresponding programming teaching display operation.
It should be noted that, the programming teaching tool in this embodiment may be loaded in a local terminal, and a web page programming interface capable of performing programming operation is provided for a user through a browser in the terminal, and the electronic device in this embodiment may be a local or cloud electronic device, and the user input operation on the web page programming interface on the local terminal is acquired and the corresponding control code is converted, and then the control code is transmitted to the controlled hardware, so that the controlled hardware executes the control code to implement the corresponding programming teaching display operation, thereby implementing the linkage control on the controlled hardware.
It can be seen from the foregoing technical solutions that, in the control method provided in the first embodiment of the present application, a hardware graph representing controlled hardware is displayed in a programming teaching tool through a web page programming interface, and then after a user input operation for an edited hardware image is obtained, programming input data at least including a control code corresponding to the controlled hardware can be obtained according to the edited hardware image, so that after code conversion is performed on the control code to obtain an executable control code of the controlled hardware, the control code can be transmitted to the controlled hardware, and then the controlled hardware can execute the control code to implement a corresponding programming teaching display operation. Therefore, in the embodiment, a programming interface is provided for the user through the webpage, and further, the conversion and transmission of the control codes can be realized through the form of the webpage, so that the control on the hardware is realized, the development environment of the programming teaching tool is not required to be integrated into the tool, and the code amount in the programming teaching tool is reduced.
In an implementation manner, when the user operation on the web page programming interface is obtained in step 101, a websocket interface corresponding to the web page programming interface may be specifically used to obtain the user input operation on the web page programming interface in the programming teaching tool, that is, a websocket interface is established between the electronic device and the programming teaching tool in this embodiment, and then the user input operation on the web page programming interface may be obtained by using the interface.
In an implementation manner, the programming input data may further include at least one hiccup hardware identifier of the controlled hardware, and accordingly, the method in this embodiment may further include the following steps, as shown in fig. 3:
step 105: and establishing a communication interface corresponding to the controlled hardware at least based on the hardware identifier.
The communication interface transmits the control codes between the programming teaching tool and the controlled hardware, so that the controlled hardware executes the control codes to realize corresponding programming teaching display operation.
Specifically, in this embodiment, a hardware driver of the controlled hardware corresponding to the hardware identifier may be first determined, and then a communication interface between the hardware driver of the controlled hardware and the hardware driver of the controlled hardware is established by using a communication protocol, so that the control code of the controlled hardware may be transmitted to the controlled hardware.
It should be noted that, in this embodiment, the user input data obtained on the web page programming interface may include a plurality of edited hardware graphics, and the corresponding converted control code may be a control code of a plurality of different controlled hardware, and in order to implement stable hardware control, in this embodiment, the control code may be transmitted in the communication interface by running in a queue, that is, the control code is sequentially transmitted to the corresponding controlled hardware according to the operation sequence corresponding to the control code, for example, the front and rear sequence edited by the user.
In one implementation manner, when the control code is transmitted to the controlled hardware in step 104, the following specific implementation manner may be used:
firstly, according to the hardware identifier, determining a serial port number corresponding to the controlled hardware.
When hardware is connected to the electronic equipment, the electronic equipment can detect a transmission port between the electronic equipment and the hardware, such as a Bluetooth port, a WiFi port or a USB port, and distributes a corresponding serial port number to the hardware on a serial port. The electronic equipment comprises one or more serial ports for connecting peripheral hardware, wherein each serial port can be allocated to one or more peripheral hardware for use, namely one or more hardware can be connected to the electronic equipment through one serial port.
And then, transmitting the converted control codes to a transmission port of the controlled hardware by using the serial port number, so that the control codes are transmitted to the controlled hardware.
As shown in fig. 4, on the hardware level, there are corresponding hardware transmission ports between the electronic device and the hardware, different hardware can be connected to the electronic device through different transmission ports, and different serial numbers are allocated to different hardware in the electronic device to implement data transmission. On the software level, the electronic device transmits the control code to the hardware through a communication interface between the electronic device and a hardware driver of the hardware.
Referring to fig. 5, a schematic structural diagram of a control device according to a second embodiment of the present disclosure is provided, where the device in this embodiment may be disposed in an electronic device capable of performing data processing, such as a local or cloud computer or a server. The device in the embodiment mainly provides a webpage programming interface for a user in a webpage form, so that the hardware programming control is realized.
Specifically, the apparatus in this embodiment may include the following structure:
an operation obtaining unit 501, configured to obtain a user input operation on a web programming interface, where the web programming interface is an editing interface of a programming teaching tool, and at least one hardware graph is displayed on the web programming interface, and the user input operation at least includes: at least one edited hardware graphic;
a data obtaining unit 502, configured to obtain programming input data according to the edited hardware graph, where the programming input data at least includes: the control code corresponds to at least one piece of controlled hardware;
a code conversion unit 503, configured to perform code conversion on the control code to obtain a control code that can be executed by the controlled hardware;
a code transmission unit 504, configured to transmit the converted control code to the controlled hardware, so that the controlled hardware executes the control code to implement a corresponding program teaching display operation.
It can be seen from the foregoing solution that, in the control device provided in the second embodiment of the present application, the hardware graph representing the controlled hardware is displayed through the web page programming interface in the programming teaching tool, and then after the user input operation for the edited hardware image is obtained, the programming input data at least including the control code corresponding to the controlled hardware can be obtained according to the edited hardware image, so that after the control code is code-converted to obtain the executable control code of the controlled hardware, the control code can be transmitted to the controlled hardware, and then the controlled hardware can execute the control code to implement the corresponding programming teaching display operation. Therefore, in the embodiment, a programming interface is provided for the user through the webpage, and further, the conversion and transmission of the control codes can be realized through the form of the webpage, so that the control on the hardware is realized, the development environment of the programming teaching tool is not required to be integrated into the tool, and the code amount in the programming teaching tool is reduced.
In one implementation, the operation obtaining unit 501, when obtaining a user input operation on the web page programming interface, may be implemented by:
and acquiring user input operation on the webpage programming interface in the programming teaching tool by using the websocket interface corresponding to the webpage programming interface.
In one implementation, the programming input data further includes: a hardware identifier of at least one piece of the controlled hardware; the code transmission unit 504 in this embodiment is further configured to:
establishing a communication interface corresponding to the controlled hardware at least based on the hardware identifier; for example, first determining a hardware driver of the controlled hardware corresponding to the hardware identifier; and then, establishing a communication interface between the hardware driver and the hardware driver by using a preset communication protocol.
The communication interface transmits the control codes between the programming teaching tool and the controlled hardware, so that the controlled hardware executes the control codes to realize corresponding programming teaching display operation.
Optionally, the control code is transmitted in the form of a queue in the communication interface.
Optionally, when the code transmission unit 504 transmits the converted control code to the controlled hardware, the following method may be implemented:
determining a serial port number corresponding to the controlled hardware according to the hardware identifier;
and transmitting the converted control code to a transmission port of the controlled hardware by using the serial port number, so that the control code is transmitted to the controlled hardware.
In one implementation, when transcoding the control code to obtain the control code that can be executed by the controlled hardware, the transcoding unit 502 may implement:
and compiling the control code to obtain an executable control code, wherein the executable control code can be executed by the controlled hardware.
It should be noted that, for the specific implementation of each unit in the apparatus of the present embodiment, reference may be made to the corresponding content in the foregoing, and details are not described here.
Referring to fig. 6, a schematic structural diagram of an electronic device according to a third embodiment of the present disclosure is provided, where the electronic device may be an electronic device capable of performing data processing, such as a local or cloud computer or a server. The electronic device in this embodiment is mainly used for providing a web page programming interface for a user in the form of a web page, thereby realizing programming control over hardware.
Specifically, the electronic device in this embodiment may include the following structure:
a display 601 and a processor 602;
the display 601 is configured to output a web page programming interface of a programming teaching tool, where the web page programming interface is an editing interface of the programming teaching tool, and at least one hardware graph is displayed on the web page programming interface;
the processor 602 is configured to obtain a user input operation on the web page programming interface, where the user input operation at least includes: at least one edited hardware graphic; obtaining programming input data according to the edited hardware graph, wherein the programming input data at least comprises: the control code corresponds to at least one piece of controlled hardware; code conversion is carried out on the control codes to obtain the control codes which can be executed by the controlled hardware; and transmitting the converted control codes to the controlled hardware, so that the controlled hardware executes the control codes and realizes corresponding programming teaching display operation.
Specifically, the processor 602 transmits the control code through a transmission port with the controlled hardware.
According to the scheme, the electronic device provided by the third embodiment of the application displays the hardware graph representing the controlled hardware through the webpage programming interface in the programming teaching tool, so that after the user input operation aiming at the edited hardware image is obtained, the programming input data at least comprising the control code corresponding to the controlled hardware can be obtained according to the edited hardware image, therefore, after the control code is subjected to code conversion to obtain the executable control code of the controlled hardware, the control code can be transmitted to the controlled hardware, and then the controlled hardware can execute the control code to realize the corresponding programming teaching display operation. Therefore, in the embodiment, a programming interface is provided for the user through the webpage, and further, the conversion and transmission of the control codes can be realized through the form of the webpage, so that the control on the hardware is realized, the development environment of the programming teaching tool is not required to be integrated into the tool, and the code amount in the programming teaching tool is reduced.
It should be noted that, for the specific implementation of the processor in the electronic device of the present embodiment, reference may be made to the corresponding contents in the foregoing, and details are not described here.
The following describes the technical solution in the present application by taking the programming control of the programming tool for teenagers on the physical hardware as an example:
firstly, the application aims to provide graphical programming operation of a web end and storage based on a cloud platform based on development of education informatization and support of a cloud computing platform for education, and establishes a message communication mechanism of local service, so that online and offline interaction of graphical programming and hardware programming can be realized, schools, teachers and students can get rid of constraint of time and space, and students can learn STEAM anytime and anywhere.
Specifically, the graphical programming and the hardware programming online and offline interactive programming in the application have various modes, namely an online state and an offline state, when the hardware is in the online state, the hardware control can be realized through a network, when the hardware is in the offline state, the graphical codes can be firstly converted into the codes of the hardware programming, meanwhile, the code compiling process is completed, and the codes are 'filled' into the hardware through communication modes such as 'serial port' or 'Bluetooth' or 'wifi' of a local machine, so that the control of the whole interactive programming is completed.
In order to realize the functions, the method constructs Le Link, namely local service based on a message communication mechanism on a local machine, informs the information of a web programming interface to the Le Link (Link server) in a websocket communication protocol mode, establishes communication connection with a hardware driver according to the communication protocol, undertakes the work of serial port management function, hardware code compiling and the like, and finally injects the code into hardware in a communication mode of a local port (serial port/Bluetooth/2.4G) and the like. The following were used:
starting a webpage programming interface of a graphical programming teaching tool, namely a graphical programming interface of a web end, in a browser on a local machine, when any hardware of hardware 1, hardware 2 or hardware 3 needs to be programmed and controlled, transmitting various data between the web end and the hardware through the established websocket interface, and realizing interaction between the web end and the hardware, such as a message that hardware connection is successful, a message that the web end detects hardware equipment, equipment information uploaded by the hardware, a message that the web end is connected with the hardware, a message that the hardware connection is successful, a message that the web end reads data from the hardware, a message that the hardware reports to the web end, a message that the web end is disconnected from the hardware, and a message that the hardware and the web end close the websocket interface.
Based on the websocket interface, the web side sends a control code (control program) to the hardware direction through the websocket interface, specifically, the user input operation in the web programming interface is sent to the application, namely the link server through the websocket interface, the application establishes communication connection with the hardware driver according to a communication protocol, and then after code compiling is carried out on the control code, a serial port number corresponding to the hardware is determined based on the communication connection, a corresponding transmission port (hardware communication interface) is determined according to the serial port number, and then the control code is transmitted to the corresponding hardware, for example, the hardware 1.
It should be noted that, in the present application, a message queue mechanism is used to sequentially transmit a plurality of messages to be transmitted, such as control codes.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (7)

1. A method of controlling, the method comprising:
the method comprises the steps of obtaining user input operation on a webpage programming interface, wherein the webpage programming interface is an editing interface of a programming teaching tool, at least one hardware graph is displayed on the webpage programming interface, and the user input operation at least comprises the following steps: at least one edited hardware graphic; wherein, the programming teaching tool is loaded in the local terminal;
obtaining programming input data according to the edited hardware graph, wherein the programming input data at least comprises: the control code corresponds to at least one piece of controlled hardware;
code conversion is carried out on the control codes to obtain the control codes which can be executed by the controlled hardware; determining a format which can be executed by the controlled hardware according to the hardware type of the controlled hardware, and performing code conversion on the control code according to the format to obtain the control code which can be executed by the controlled hardware;
transmitting the converted control codes to the controlled hardware, so that the controlled hardware executes the control codes to realize corresponding programming teaching display operation;
obtaining a user input operation on a web page programming interface, comprising:
acquiring user input operation on the webpage programming interface in the programming teaching tool by using a websocket interface corresponding to the webpage programming interface;
the programming input data further comprises: a hardware identifier of at least one piece of the controlled hardware; the method further comprises the following steps:
establishing a communication interface corresponding to the controlled hardware at least based on the hardware identifier;
the communication interface transmits the control codes between the programming teaching tool and the controlled hardware, so that the controlled hardware executes the control codes to realize corresponding programming teaching display operation.
2. The method of claim 1, obtaining a communication interface corresponding to the controlled hardware based on at least the hardware identifier, comprising:
determining a hardware driver of the controlled hardware corresponding to the hardware identifier;
and establishing a communication interface with the hardware driver by using a preset communication protocol.
3. The method of claim 1, transcoding the control code to obtain control code that can be executed by the controlled hardware, comprising:
and compiling the control code to obtain an executable control code, wherein the executable control code can be executed by the controlled hardware.
4. The method of claim 1, the control code being transmitted in the form of a queue in the communication interface.
5. The method of claim 1, transmitting the translated control code to the controlled hardware, comprising:
determining a serial port number corresponding to the controlled hardware according to the hardware identifier;
and transmitting the converted control code to a transmission port of the controlled hardware by using the serial port number, so that the control code is transmitted to the controlled hardware.
6. A control device, comprising:
an operation obtaining unit, configured to obtain a user input operation on a web page programming interface, where the web page programming interface is an editing interface of a programming teaching tool, and at least one hardware graphic is displayed on the web page programming interface, and the user input operation at least includes: at least one edited hardware graphic; wherein, the programming teaching tool is loaded in the local terminal;
a data obtaining unit, configured to obtain programming input data according to the edited hardware graph, where the programming input data at least includes: the control code corresponds to at least one piece of controlled hardware;
the code conversion unit is used for carrying out code conversion on the control codes to obtain the control codes which can be executed by the controlled hardware; determining a format which can be executed by the controlled hardware according to the hardware type of the controlled hardware, and performing code conversion on the control code according to the format to obtain the control code which can be executed by the controlled hardware;
the code transmission unit is used for transmitting the converted control codes to the controlled hardware so that the controlled hardware executes the control codes to realize corresponding programming teaching display operation;
the method for obtaining the user input operation on the webpage programming interface comprises the following steps: acquiring user input operation on the webpage programming interface in the programming teaching tool by using a websocket interface corresponding to the webpage programming interface; the programming input data further comprises: a hardware identifier of at least one piece of the controlled hardware; the device further comprises: establishing a communication interface corresponding to the controlled hardware at least based on the hardware identifier; the communication interface transmits the control codes between the programming teaching tool and the controlled hardware, so that the controlled hardware executes the control codes to realize corresponding programming teaching display operation.
7. An electronic device, comprising: a display and a processor;
the display is used for outputting a webpage programming interface of a programming teaching tool, the webpage programming interface is an editing interface of the programming teaching tool, and at least one hardware graph is displayed on the webpage programming interface; wherein, the programming teaching tool is loaded in the local terminal;
the processor is configured to obtain a user input operation on the web page programming interface, where the user input operation at least includes: at least one edited hardware graphic; obtaining programming input data according to the edited hardware graph, wherein the programming input data at least comprises: the control code corresponds to at least one piece of controlled hardware; code conversion is carried out on the control codes to obtain the control codes which can be executed by the controlled hardware; transmitting the converted control codes to the controlled hardware, so that the controlled hardware executes the control codes and realizes corresponding programming teaching display operation; determining a format which can be executed by the controlled hardware according to the hardware type of the controlled hardware, and performing code conversion on the control code according to the format to obtain the control code which can be executed by the controlled hardware; the method for obtaining the user input operation on the webpage programming interface comprises the following steps: acquiring user input operation on the webpage programming interface in the programming teaching tool by using a websocket interface corresponding to the webpage programming interface; the programming input data further comprises: a hardware identifier of at least one piece of the controlled hardware; the apparatus further comprises: establishing a communication interface corresponding to the controlled hardware at least based on the hardware identifier; the communication interface transmits the control codes between the programming teaching tool and the controlled hardware, so that the controlled hardware executes the control codes to realize corresponding programming teaching display operation.
CN201911100618.4A 2019-11-12 2019-11-12 Control method and device and electronic equipment Active CN110795086B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911100618.4A CN110795086B (en) 2019-11-12 2019-11-12 Control method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911100618.4A CN110795086B (en) 2019-11-12 2019-11-12 Control method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN110795086A CN110795086A (en) 2020-02-14
CN110795086B true CN110795086B (en) 2021-08-17

Family

ID=69444340

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911100618.4A Active CN110795086B (en) 2019-11-12 2019-11-12 Control method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110795086B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117908873A (en) * 2024-01-25 2024-04-19 广东邦宝益智玩具有限公司 Method for running graphic building block programming platform in embedded system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103150694A (en) * 2013-02-05 2013-06-12 北京优才创智科技有限公司 Processing method and device for remote teaching data
CN104111888A (en) * 2014-07-03 2014-10-22 曹建楠 Code evaluation method, device and system for teaching
CN104881396A (en) * 2015-06-05 2015-09-02 南京南瑞继保电气有限公司 Graphical-program compile file forming method
CN107657172A (en) * 2016-07-25 2018-02-02 腾讯科技(深圳)有限公司 Code process method, apparatus and system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11249725A (en) * 1998-02-26 1999-09-17 Fanuc Ltd Robot controller
HK1204748A2 (en) * 2015-08-20 2015-11-27 Smart Kiddo Education Ltd An education system using connected toys
DE102016208382B4 (en) * 2016-05-17 2024-05-29 BSH Hausgeräte GmbH System for implementing a procedural process on a household appliance
CN106325876B (en) * 2016-08-29 2019-07-26 中山市天启智能科技有限公司 Method, the system of a kind of programming of inline graphicsization and control embedded device
CN109240675A (en) * 2017-05-10 2019-01-18 兰州大学 Portable visual hardware programming system and method based on WIFI
CN109885293B (en) * 2019-02-27 2022-04-29 重庆电子工程职业学院 Method and device for automatically creating application development of Internet of things and server
CN110347388A (en) * 2019-07-10 2019-10-18 潍坊科技学院 A kind of graphical mode programming platform generating means

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103150694A (en) * 2013-02-05 2013-06-12 北京优才创智科技有限公司 Processing method and device for remote teaching data
CN104111888A (en) * 2014-07-03 2014-10-22 曹建楠 Code evaluation method, device and system for teaching
CN104881396A (en) * 2015-06-05 2015-09-02 南京南瑞继保电气有限公司 Graphical-program compile file forming method
CN107657172A (en) * 2016-07-25 2018-02-02 腾讯科技(深圳)有限公司 Code process method, apparatus and system

Also Published As

Publication number Publication date
CN110795086A (en) 2020-02-14

Similar Documents

Publication Publication Date Title
KR100988597B1 (en) Robot content authoring system having user Friendly form in web environments
CN105120006A (en) Live commenting control method, live commenting server and live commenting control device for electronic readings
CN110404256A (en) Data processing method and device, equipment, server, system and storage medium
US20200134260A1 (en) System and method for implementing a proficiency-driven feedback and improvement platform
CN110795086B (en) Control method and device and electronic equipment
CN112230818A (en) Method and device for editing quantum logic gate on terminal interface
CN105955593A (en) Method and device for presenting discussion information
CN111142824B (en) Interactive control method, storage medium and electronic equipment
KR101994899B1 (en) Based on web, e-training control station system
CN113536094A (en) NFT-based non-physical mapping method and device
CN113158114A (en) Online interaction method and device, storage medium and server
CN112001827A (en) Teaching aid control method and device, teaching equipment and storage medium
CN109979262B (en) Personal safety VR education system
CN111556156A (en) Interaction control method, system, electronic device and computer-readable storage medium
CN110288862B (en) Three-dimensional teaching model control method, electronic device and readable storage medium
KR20120018475A (en) System and method for servicing remote help using virtual device simulation and tutorial service apparatus and method
CN113760776A (en) Method and system for collaborative simulation test of automatic driving simulation software
CN113535316A (en) Work creation method and device by means of NFT technology
US20120004895A1 (en) Method and apparatus for testing on-line services
KR20220051664A (en) Server providing collaboration tool for integrated managing team project and method for integrated managing team project using collaboration tool provided by thereof
CN110516028A (en) A kind of method and device for realizing complicated editing machine based on react
CN113515300B (en) Code viewing method, device, electronic equipment and storage medium
CN117707496B (en) Software construction teaching method, device, terminal equipment and storage medium
CN103777929A (en) Simulative development system for program development and achieving method thereof
CN110827059B (en) Sharing method, sharing system and computer readable 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