A command control method and device for micro-device used in teaching

Through pre-customized command protocols and communication connections, control commands are generated and sent, which solves the problem of cumbersome and incompatible control methods of existing teaching equipment, realizes unified control of multiple devices, and improves the ease of use and ease of use of teaching equipment. Management efficiency.

CN118277302BActive Publication Date: 2024-09-17DMAI (GUANGZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410676141.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-09-17
Estimated Expiration
2044-05-29

AI Technical Summary

Technical Problem

The control methods of existing teaching equipment are cumbersome and incompatible with multiple devices, making it difficult to achieve unified and effective control.

Method used

Using a pre-customized instruction protocol, including instruction format type, instruction format and encoding method, control instructions for the teaching micro-master control device are generated and sent to the device through the communication connection. The device parses and executes the instruction operation.

Benefits of technology

It achieves flexible and unified control of a variety of teaching equipment, improving the ease of use and management efficiency of teaching equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118277302B
    Figure CN118277302B
Patent Text Reader

Abstract

The present invention discloses a method and device for controlling a micro-device for teaching, comprising: a control end first obtains a pre-customized command protocol, which specifies the command format type, command format and encoding method. Based on the protocol, the control end generates a control command for a teaching micro-master control device, and sends the command to the master control device through a communication connection. After receiving the command, the teaching micro-master control device parses and executes the corresponding operation. The present invention provides a universal and flexible control scheme that is compatible with and effectively controls a variety of teaching micro-devices, thereby significantly improving the usability and management efficiency of teaching equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of hardware programming, and in particular to an instruction control method and device for a micro device used for teaching. Background Art

[0002] With the rapid development of modern educational technology, micro-teaching devices are increasingly used in teaching. These devices, such as smart projectors and interactive whiteboards, have greatly improved the quality and efficiency of teaching. However, with the increase in the types of devices and the complexity of their functions, how to achieve effective and unified control of these devices has become an important issue. Traditional control methods often rely on the device's proprietary remote control or specific control software, which is not only cumbersome to operate, but also incompatible with multiple devices. Summary of the invention

[0003] The object of the present invention is to provide a method and device for controlling instructions of a micro device used in teaching.

[0004] In a first aspect, an embodiment of the present invention provides a command control method for a micro device applied to teaching, which is applied to a command control system, wherein the command control system includes a control terminal and a teaching micro main control device, wherein the control terminal is communicatively connected with the teaching micro main control device, and the method includes:

[0005] The control end obtains a pre-customized instruction protocol, wherein the instruction protocol includes an instruction format type, an instruction format, and an instruction encoding method;

[0006] The control end generates a control instruction for the teaching micro main control device based on the instruction protocol;

[0007] The control terminal sends the control instruction to the teaching micro main control device;

[0008] The teaching micro main control device parses the control instruction and executes the instruction operation corresponding to the control instruction.

[0009] In an embodiment of the present invention, the instruction protocol instruction format type is a mixed format type; the instruction format includes hardware type, firmware version, operation code and operation data; the instruction encoding method is extended encoding; the hardware type, the firmware version and the operation code are located in the standard encoding part, and the operation data is located in the extended encoding part.

[0010] In the embodiment of the present invention, the control end generates a control instruction for the teaching micro main control device based on the instruction protocol, including:

[0011] Establishing an operation instruction mapping table according to the instruction protocol, wherein the operation instruction mapping table includes a mapping of the teaching micro-master device type, firmware version and operation code corresponding to the control instruction;

[0012] Acquire input parameters for the operation instruction, and obtain operation data in the instruction format according to the input parameters;

[0013] According to the operation instruction mapping table and the operation data in the instruction format, a control instruction for the teaching micro main control device is assembled.

[0014] In the embodiment of the present invention, the acquiring of input parameters for the operation instruction and obtaining the operation data in the instruction format according to the input parameters includes:

[0015] Obtaining input parameters for the operation instruction;

[0016] Compressing the input parameter using a string compression algorithm to generate a byte array;

[0017] The byte array is used as operation data of the instruction format.

[0018] In the embodiment of the present invention, the control end sends the control instruction to the teaching micro main control device, including:

[0019] The control terminal sends the control instruction to the teaching micro main control device via Bluetooth or universal serial bus.

[0020] In an embodiment of the present invention, the teaching micro-master control device is configured with a firmware main program and an instruction parsing and execution service. The teaching micro-master control device parses the control instruction and executes the instruction operation corresponding to the control instruction, including:

[0021] When the teaching micro-master control device is in a powered-on state, running the firmware main program;

[0022] Calling the firmware main program to start the instruction parsing and execution service;

[0023] Calling the instruction parsing and execution service to parse the control instruction, obtaining the hardware type, firmware version and operation code, and decoding using a preset encoding format to obtain the operation data;

[0024] Calling the instruction parsing and execution service to verify the control instruction according to the hardware type and the firmware version;

[0025] In the case of passing the verification, the service calls the hardware driver based on the instruction parsing to execute the instruction operation corresponding to the control instruction according to the operation code and the operation data.

[0026] In an embodiment of the present invention, the calling of the instruction parsing and execution service to verify the control instruction according to the hardware type and the firmware version includes:

[0027] Verifying the hardware type and the firmware version;

[0028] If the hardware type is an executable instruction and the firmware version is consistent with its own version, it is determined that the verification is passed;

[0029] Otherwise, an error code is returned.

[0030] In a second aspect, an embodiment of the present invention provides a command control device for a micro device used for teaching, which is used in a command control system, wherein the command control system includes a control terminal and a teaching micro main control device, wherein the control terminal is communicatively connected with the teaching micro main control device, and the device includes:

[0031] A control module is used to obtain a pre-customized instruction protocol, wherein the instruction protocol includes an instruction format type, an instruction format, and an instruction encoding method; based on the instruction protocol, generate a control instruction for the teaching micro-master device; and send the control instruction to the teaching micro-master device;

[0032] The controlled module is used to parse the control instruction and execute the instruction operation corresponding to the control instruction.

[0033] In a third aspect, an embodiment of the present invention provides a computer device, comprising a processor and a non-volatile memory storing computer instructions, wherein when the computer instructions are executed by the processor, the computer device executes the instruction control method for a microdevice applied to teaching as described in at least one possible implementation of the first aspect.

[0034] In a fourth aspect, an embodiment of the present invention provides a readable storage medium, wherein the readable storage medium includes a computer program, and when the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the instruction control method for a micro device applied to teaching as described in at least one possible implementation manner of the first aspect.

[0035] Compared with the prior art, the beneficial effects provided by the present invention include: using the instruction control method and device for a micro-device applied to teaching disclosed by the present invention, the control end first obtains a pre-customized instruction protocol, which specifies the instruction format type, instruction format and encoding method. Based on the protocol, the control end generates a control instruction for the teaching micro-master device, and sends the instruction to the master device through a communication connection. After receiving the instruction, the teaching micro-master device parses and executes the corresponding operation. The present invention provides a universal and flexible control scheme that is compatible with and effectively controls a variety of teaching micro-devices, thereby significantly improving the usability and management efficiency of teaching equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can also be obtained based on these drawings without creative work.

[0037] Figure 1 A schematic flow chart of the steps of a method for controlling a micro-device for teaching provided by an embodiment of the present invention;

[0038] Figure 2 A schematic block diagram of a command control system for a micro-device used for teaching provided by an embodiment of the present invention;

[0039] Figure 3 An interactive schematic diagram of command control of a micro device for teaching provided by an embodiment of the present invention;

[0040] Figure 4 A schematic diagram of an encoding method provided by an embodiment of the present invention;

[0041] Figure 5 A schematic diagram of a graphical programming interface provided by an embodiment of the present invention;

[0042] Figure 6 A schematic block diagram of the structure of a command control device for a micro-device used for teaching provided by an embodiment of the present invention;

[0043] Figure 7 A schematic block diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0045] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings.

[0046] In order to solve the technical problems in the aforementioned background technology, Figure 1 A flow chart of a command control method for a micro device applied to teaching is provided in an embodiment of the present disclosure. The method is applied to a command control system, wherein the command control system includes a control terminal and a teaching micro main control device, and the control terminal is communicatively connected with the teaching micro main control device. The command control method for a micro device applied to teaching is introduced in detail below.

[0047] Step S201, the control end obtains a pre-customized instruction protocol, the instruction protocol includes an instruction format type, an instruction format, and an instruction encoding method;

[0048] Step S202, the control end generates a control instruction for the teaching micro-master device based on the instruction protocol;

[0049] Step S203, the control terminal sends the control instruction to the teaching micro main control device;

[0050] Step S204: the teaching micro main control device parses the control instruction and executes the instruction operation corresponding to the control instruction.

[0051] In an embodiment of the present invention, for example, in a classroom equipped with advanced teaching equipment, a teacher is preparing to control a teaching micro-master device (such as an intelligent projector) through a control terminal (such as a computer). First, the teacher needs to download a pre-customized instruction protocol from the website of the manufacturer of the teaching micro-master device. This instruction protocol details the instruction format type (such as serial communication, network communication, etc.), specific instruction format (such as power on / off instruction, volume adjustment instruction, etc.) required to control the teaching micro-master device, and the encoding method of the instruction (such as ASCII code, binary encoding, etc.). After understanding the instruction protocol, the teacher selects a power-on instruction through the control terminal software. The control terminal software automatically generates a string of control instruction codes according to the format and encoding method in the instruction protocol. For example, if the instruction protocol stipulates that the power-on instruction is a specific binary code, the control terminal software will generate this binary code. After generating the control instruction, the teacher sends this instruction to the intelligent projector in the classroom through the control terminal. This process may be completed through a wireless network, Bluetooth or other communication methods. After the transmission is successful, the control terminal will display a confirmation message that the instruction has been sent. After the intelligent projector receives the control instruction, its internal processor will immediately parse the instruction. After confirming that the command is a power-on command, the projector will automatically perform the power-on operation. As the projector starts, a clear picture begins to appear on the classroom screen, indicating that the command has been successfully executed. During the entire process, the server, as the core of the control end, is responsible for processing the acquisition of the command protocol, the generation and sending of control commands, and the communication with the teaching micro-master device. This command control method greatly improves the flexibility and efficiency of teaching, allowing teachers to easily control various teaching equipment, thereby improving the quality of teaching.

[0052] In an embodiment of the present invention, the instruction protocol instruction format type is a mixed format type; the instruction format includes hardware type, firmware version, operation code and operation data; the instruction encoding method is extended encoding; the hardware type, the firmware version and the operation code are located in the standard encoding part, and the operation data is located in the extended encoding part.

[0053] In an embodiment of the present invention, exemplarily, in the technical configuration of the classroom, the server, as a control terminal, needs to communicate with a variety of different teaching micro-master devices, including smart projectors, interactive whiteboards, and audio devices. In order to be compatible with these different hardware devices, the command protocol used by the server adopts a mixed format type. This mixed format can flexibly adapt to the command requirements of different hardware, ensuring that the server can accurately control each device. When the teacher needs to adjust the brightness of the projector, the server will generate a specific control instruction. The format of this instruction includes the hardware type (such as projector), firmware version (such as V3.2.1), operation code (representing the specific operation of adjusting the brightness) and operation data (specific value of brightness, such as adjusting to 80% brightness). In this way, the server can accurately control specific hardware to perform specific operations. Due to the increasing complexity of the functions of teaching equipment, traditional instruction encoding methods may not meet all requirements. Therefore, in this scenario, the server adopts an extended encoding method, which allows additional operation data to be added on the basis of standard encoding. For example, in the instruction to adjust the brightness of the projector, in addition to the standard encoding part containing the hardware type, firmware version and operation code, a specific brightness value needs to be added to the extended encoding part to meet more sophisticated control requirements. In a classroom teaching, the teacher needs to adjust the brightness of the projector to 50% through the server. The server generates control instructions according to the instruction protocol, in which the hardware type (projector), firmware version (firmware version information of the current projector) and operation code (representing the operation of adjusting the brightness) are encoded in the standard coding part. The specific brightness value of 50% is encoded in the extended coding part. In this way, when the projector receives this instruction, it can accurately parse the operation to be performed and the related operation data, so as to accurately adjust the brightness to the specified value. Through the above scenario examples, we can see the practical application of mixed format type instruction protocols and extended coding methods in the control of teaching micro-devices, and how they ensure that the server can accurately and flexibly control various teaching equipment to meet complex and changing teaching needs.

[0054] In the embodiment of the present invention, the aforementioned step S202 may be implemented through the following example execution.

[0055] Establishing an operation instruction mapping table according to the instruction protocol, wherein the operation instruction mapping table includes a mapping of the teaching micro-master device type, firmware version and operation code corresponding to the control instruction;

[0056] Acquire input parameters for the operation instruction, and obtain operation data in the instruction format according to the input parameters;

[0057] According to the operation instruction mapping table and the operation data in the instruction format, a control instruction for the teaching micro main control device is assembled.

[0058] In an embodiment of the present invention, exemplarily, in a classroom equipped with a variety of teaching micro-master devices, the server will first establish an operation instruction mapping table according to a known instruction protocol. This mapping table is a database that lists in detail each type of teaching micro-master device (such as smart projectors, interactive whiteboards, etc.), their firmware versions and corresponding operation codes. For example, for a certain model of smart projector, its firmware version is V3.0, the operation code corresponding to the power-on operation may be "0x01", the operation code corresponding to the power-off operation may be "0x02", and the operation code for adjusting the brightness may be "0x03", etc. These mapping relationships are clearly recorded in the operation instruction mapping table so that the server can quickly search and match when needed. When teachers need to adjust the brightness of the projector, they will enter a specific brightness value, such as "70%", on the control end (such as a teaching management software interface). This brightness value is the input parameter for the brightness adjustment operation instruction. After receiving this input parameter, the server will convert it into the operation data required by the instruction format. In this example, the operation data is a binary or hexadecimal value representing 70% brightness. With the operation instruction mapping table and operation data, the server can start assembling control instructions. First, the server will find the brightness adjustment operation code "0x03" corresponding to the smart projector and firmware version V3.0 according to the mapping table. Then, this operation code is combined with the operation data representing 70% brightness to form a complete control instruction. This control instruction contains all the necessary information to ensure that the teaching micro-master device (in this case, the smart projector) can accurately understand and execute the brightness adjustment operation. Through the above scenario examples, we can see how the server generates specific control instructions based on the instruction protocol and the operation instruction mapping table, thereby achieving precise control of the teaching micro-master device. This mechanism ensures the accuracy and compatibility of the instructions, allowing the teaching equipment to work according to the teacher's intentions.

[0059] In the embodiment of the present invention, the aforementioned step of acquiring input parameters for the operation instruction and obtaining the operation data in the instruction format according to the input parameters can be implemented through the following example.

[0060] Obtaining input parameters for the operation instruction;

[0061] Compressing the input parameter using a string compression algorithm to generate a byte array;

[0062] The byte array is used as operation data of the instruction format.

[0063] In an embodiment of the present invention, exemplarily, in an online teaching environment, a teacher needs to control a remote multimedia teaching device, such as an electronic blackboard with interactive functions, through a server. The teacher hopes to display a long text content on this electronic blackboard. They enter this text as an input parameter of the operation instruction on the control terminal (which may be a Web interface or dedicated software). Since the text content that the teacher needs to display is long, direct transmission will occupy more communication bandwidth and storage space. In order to optimize the transmission efficiency, after receiving this text, the server will use an efficient string compression algorithm (such as GZIP or Snappy) to compress it. The compression process removes redundant information in the text and converts it into a compact byte array. In this way, the originally long text content is compressed into a relatively small byte array, which is convenient for fast transmission and processing. After the compression is completed, the server uses this byte array as the operation data part in the instruction format. Next, the server will match the corresponding device type, firmware version and operation code for this operation data according to the previously established operation instruction mapping table. Finally, the server combines these elements into a complete control instruction and sends it to the remote multimedia teaching device through the network. Through the above scenario examples, we can see how the server processes and optimizes the input parameters of the operation instructions, and how to integrate them into operation data that meets the instruction format requirements. This method not only improves the efficiency of instruction transmission, but also ensures that the teaching equipment can accurately and quickly respond to the teacher's control needs.

[0064] In the embodiment of the present invention, the aforementioned step S203 can be implemented through the following example execution.

[0065] The control terminal sends the control instruction to the teaching micro main control device via Bluetooth or universal serial bus.

[0066] In an embodiment of the present invention, illustratively, in a modern classroom environment, a teacher is preparing a presentation activity and needs to remotely control the smart projector in the classroom. The server, as a control terminal, has generated control instructions for the projector according to the previous steps. At this time, the smart projector in the classroom is equipped with a Bluetooth receiving function. First, the server starts its built-in Bluetooth module and searches for nearby Bluetooth devices. After searching for the smart projector in the classroom, the server tries to establish a Bluetooth connection with it. Once the Bluetooth connection is successfully established, the server sends the pre-generated control instructions to the smart projector through this connection. For example, if the control instruction is to require the projector to start playing a video, then this instruction will be transmitted to the projector via Bluetooth. After receiving the control instruction, the smart projector will immediately parse and execute the instruction and start playing the specified video content.

[0067] In another scenario, suppose the server needs to be directly connected to an interactive whiteboard for teaching, and the whiteboard is connected to the computer via a USB interface. The server will be directly connected to the interactive whiteboard via a USB cable. This connection method is more stable and high-speed, and is suitable for scenarios that require large data transmission or high real-time requirements. When the USB connection is established, the server will send control instructions to the interactive whiteboard through this connection. For example, the instruction may be to require the whiteboard to load a specific teaching software or open a pre-prepared teaching file. After receiving the control instruction, the interactive whiteboard will immediately respond and perform the corresponding operation, such as opening the specified software or file. Through the above scenario examples, we can see how the server can flexibly send control instructions to teaching micro-master devices through different communication methods such as Bluetooth or USB, thereby realizing remote control of these devices. This diverse communication method ensures that teaching equipment can stably and efficiently receive and execute control instructions in various environments.

[0068] In the embodiment of the present invention, the teaching micro-master device is configured with a firmware main program and an instruction parsing and execution service, and the aforementioned step S204 can be implemented through the following example execution.

[0069] When the teaching micro-master control device is in a powered-on state, running the firmware main program;

[0070] Calling the firmware main program to start the instruction parsing and execution service;

[0071] Calling the instruction parsing and execution service to parse the control instruction, obtaining the hardware type, firmware version and operation code, and decoding using a preset encoding format to obtain the operation data;

[0072] Calling the instruction parsing and execution service to verify the control instruction according to the hardware type and the firmware version;

[0073] In the case of passing the verification, the service calls the hardware driver based on the instruction parsing to execute the instruction operation corresponding to the control instruction according to the operation code and the operation data.

[0074] In an embodiment of the present invention, exemplarily, when a smart projector is turned on, its internal microprocessor will automatically load and run the firmware main program. This program is the basic software of the teaching micro-master device, which is responsible for managing the hardware resources of the device, providing basic functional interfaces, and supporting the operation of other services. After the firmware main program is loaded, a service called instruction parsing and execution will be further started. This service is specifically responsible for receiving, parsing and executing control instructions sent from the server. When the smart projector receives a control instruction from the server, the instruction parsing and execution service will be called to start parsing the instruction. The service will first identify the hardware type (for example, projector), firmware version and operation code in the instruction. Then, the operation data in the instruction is decoded using a preset encoding format. After parsing the control instruction, the instruction parsing and execution service will further verify the instruction according to the hardware type and firmware version. This is to ensure that the instruction is for the current device model and firmware version, thereby preventing erroneous or malicious instructions from being executed. For example, if the firmware version of the projector is V2.0, and the received instruction is for version V1.0, then the instruction will be deemed invalid. Once the instruction passes verification, the instruction parsing and execution service will call the corresponding hardware driver to perform the specific operation based on the opcode and operation data. For example, if the opcode represents "increase brightness" and the operation data is "20%", the service will call the brightness control driver of the projector to increase the brightness of the projector by 20%. Through the above scenario examples, we can see how the teaching micro-master device receives, parses and executes control instructions from the server step by step. This process ensures the accuracy and security of the instructions, and also enables the device to perform corresponding operations according to the requirements of the server.

[0075] In the embodiment of the present invention, the aforementioned step of calling the instruction parsing and execution service to verify the control instruction according to the hardware type and the firmware version can be implemented through the following example execution.

[0076] Verifying the hardware type and the firmware version;

[0077] If the hardware type is an executable instruction and the firmware version is consistent with its own version, it is determined that the verification is passed;

[0078] Otherwise, an error code is returned.

[0079] When the smart projector's instruction parsing and execution service receives a control instruction, it first checks the hardware type field in the instruction. For example, the instruction may explicitly specify the target hardware type as "smart projector". At the same time, the service also checks the firmware version field in the instruction, such as "V3.0", to confirm whether the instruction is applicable to the firmware version of the current device. If the hardware type in the instruction matches the device type of the projector, that is, both are "smart projector", this means that the instruction is designed for this type of device and is therefore executable. Next, the service compares the firmware version "V3.0" in the instruction with the firmware version currently running on the projector. If the two are consistent, it means that the instruction is written for the current firmware version and is therefore compatible. If both of the above conditions are met - the hardware type matches and the firmware version is consistent, then the instruction parsing and execution service will determine that the verification has passed. This means that the control instruction is valid and safe and can be executed. If the hardware type does not match or the firmware version is inconsistent, the instruction parsing and execution service will return an error code. For example, if the server mistakenly sends a command for the "electronic blackboard" to the smart projector, or the firmware version in the command does not match the actual firmware version of the projector, the service will return the corresponding error code, indicating that the command cannot be executed. Through the above scenario examples, we can see how the command parsing and execution service ensures the accuracy and compatibility of control commands by verifying the hardware type and firmware version. This step is crucial to maintaining the safety and stable operation of teaching micro-control devices.

[0080] In order to more clearly describe the solution provided by the embodiment of the present invention, a relatively complete description of the implementation method is provided below. Figure 2 and Figure 3 .

[0081] Step 1: Formulate the instruction protocol, which mainly includes the design of instruction format type, format, encoding and field bit number. The scalability and flexibility of the instruction should be considered during the design process. The design process is as follows:

[0082] 1) Instruction format type: Based on the expansibility and flexibility of instructions, the instruction format type adopted by this method is a hybrid format type. It combines the characteristics of long instruction word structure and variable length instruction word structure. Fixed length instruction word structure means that the format is fixed and the length of all instructions is equal, while the length of various instructions in the variable length instruction word structure instruction system is different.

[0083] 2) Instruction format: The instruction format of this method includes four parts: hardware type, firmware version (firmware refers to a fixed program embedded in a computer or electronic device), operation code and operation data. The hardware type specifies which type of micro-master control device the operation object is; the firmware version refers to the firmware version number of the controlled device. The design of the firmware version is mainly to solve the firmware upgrade problem and ensure the consistency of the communication protocol between the control end and the controlled end; the operation code specifies the type or method of operation to be performed; the operation data serves as the input of the operation to be performed, that is, the input parameter of the operation code. As described in 1), the instruction format type of the present invention adopts a mixed format type, which includes fixed-length and variable-length parts. In the instruction format of this method, the hardware type and operation code are designed as fixed-length, while the operation data is designed as a variable-length part.

[0084] 3) Instruction encoding: The byte encoding method of the instructions of this method adopts extended encoding. The extended encoding is based on multi-byte encoding. Each instruction has a fixed standard part, which is common to all instructions. In addition, there is an optional extended part. This encoding method can represent more instructions while retaining the fixed standard part, making the instruction design simpler and more extensible. According to 2), the instruction format of this method includes three parts: hardware type, operation code and operation data. Among them, the hardware type and operation code are standard parts: the hardware type is represented by 1 byte. In addition to representing a single micro-master device, the hardware type can also be used to represent a combined device assembled from a micro-master device and other expansion board devices. One byte can represent 255 devices, which is enough for use in educational scenarios; the firmware version is represented by 1 byte; the operation code is also represented by 1 byte, that is, each device can support 255 operation instructions, which is enough for use in basic teaching. The operation data is an extended part of the multi-byte encoding, and the byte encoding method used for the corresponding character conversion is UTF-8. Please refer to Figure 4 .

[0085] Step 2: The control end assembles and generates instructions according to the instruction protocol described in step 1, and then sends them to the controlled end via Bluetooth or USB.

[0086] 1) The instruction generation module of the control end establishes an operation instruction mapping table according to the instruction protocol described in step 1, and the operation instruction mapping table includes a mapping of the micro-master device type, firmware version and operation code required to be supported corresponding to the operation event;

[0087] 2) The control end instruction generation module uses the operation instruction mapping table in 1) above to retrieve the type, firmware version and operation code of the micro-master device to be operated corresponding to the operation event;

[0088] 3) The control-side instruction generation module compresses the input parameters of the operation event using a string compression algorithm and generates a byte array as the operation data in the instruction format described in step 1. The operation instructions uniformly use UTF-8 character encoding. Data compression is to reduce the amount of data transmitted, thereby increasing the speed of data transmission.

[0089] 4) The control end instruction generation module assembles the micro-master device type, firmware version, operation code and operation data obtained in 2) and 3) above according to the instruction format described in step 1 to generate an instruction that complies with the format;

[0090] 5) The control end sends the command generated in 4) above to the controlled end via Bluetooth or USB.

[0091] Step 3: The controlled end receives the instruction sent by the control end via Bluetooth or USB in step 2, parses the instruction and executes the corresponding hardware instruction to control the hardware to operate. The controlled end refers to a micro-control device, which includes firmware and hardware devices. The instruction processing is handled by the instruction parsing execution service (DMIPES) in the firmware. The instruction parsed and executed by DMIPES is the instruction described in step 1.

[0092] 1) After the micro-control device is turned on, the firmware main program runs, and the firmware main program starts DMIPES. DMIPES continuously monitors Bluetooth or USB events (wifi or other IoT communication protocols can also be used, as long as the monitoring mechanism that responds to the communication protocol is set in DMIPES), including communication channel establishment, disconnection, message and other events. Message events refer to the control end sending instructions to the controlled end, and the received message here is the instruction;

[0093] 2) DMIPES parses the instruction according to the instruction format of step 1, intercepts the first 3 bytes, and uses them as the hardware type, firmware version, and operation code respectively. The remaining bytes are encoded using UTF-8 and then decompressed to obtain the operation data as the input parameter of the operation event;

[0094] 3) DMIPES verifies the instructions;

[0095] 3.1) DMIPES first checks the hardware type of the instruction obtained in 2) above to determine whether it is an instruction executable by the hardware device. If it is incompatible, a response error code is returned;

[0096] 3.2) DMIPES verifies the command firmware version obtained in 2) above to determine whether it matches its own version number. If not, it returns a response error code to allow it to perform a firmware upgrade operation;

[0097] 4) DMIPES completes the control of its own hardware or extended devices by directly calling the hardware driver or indirectly calling the driver through the hardware API based on the instruction opcode and operation data obtained in 2) above.

[0098] In addition, the embodiment of the present invention also provides an instruction control system for a micro-master device used for teaching. The system uses a graphical programming method to teach hardware programming. The program runs in a distributed running mode, that is, the program code logic runs in the graphical programming system, and the hardware instruction processing runs in the micro-master device. Please refer to Figure 5 . This system mainly includes a graphical programming system, connection equipment and micro main control equipment.

[0099] 1) The graphical programming system includes a graphical programming module, a device management module and an instruction processing module;

[0100] 1.1) The graphical programming module is a visual programming tool based on the visual programming tool Scratch. It is a visual programming tool that allows programming by dragging and dropping visual building blocks. The basic elements of the graphical programming module are building blocks (Scratch blocks), which are the smallest units for running graphical programs. The control of the micro-controller is also achieved through building blocks. The building blocks that control the micro-controller are referred to as hardware building blocks. The hardware building blocks are pre-set with the hardware type, firmware version, and operation code supported by the operation control instructions, and the operation data of the instructions are reflected in the parameter options of the hardware building blocks. The figure below shows the hardware building blocks for the Microbit expansion board related operations. For example, the hardware building blocks related to the motor speed have the motor drive interface (M1, M2) and speed value (0-100) as the operation parameters. When the hardware building block is executed, it will send the instruction sending event to the instruction processing module in 1.2) below for processing. The instruction sending event contains the hardware type, firmware version, operation code, and operation data of the hardware building block;

[0101] 1.2) The instruction processing module is the middle processing layer between the device management module and the instruction processing module. The instruction processing module will compress the operation data of the instruction issuing event transmitted by the hardware building blocks of the graphical programming module according to the method described in the above 1, and then combine the hardware type, firmware version and operation code in the event to assemble it into a byte array that complies with the instruction protocol described in the above 1 method. The resulting byte array is sent to the micro-master device through the device management module. After receiving the response data of the micro-master device, the device management module will send a response event to the instruction processing module. The instruction processing module will encode and parse the data of the response event and pass it to the graphical programming module for response processing;

[0102] 1.3) The main function of the device management module is to manage the micro-master device, including device pairing, disconnection, connection heartbeat management, message writing and reading, etc.

[0103] 2) The connection devices of this system mainly use Bluetooth (built-in or external) or USB data cable.

[0104] 3) The micro-control device includes firmware and hardware. The firmware part mainly implements the DMIPES described in the above method 1. DMIPES receives the graphical programming system instructions in the above 1) for verification and analysis. The obtained instruction opcodes and operation data are completed by directly calling the hardware driver or indirectly calling the driver through the hardware API to complete the instructions to control its own hardware or expansion devices. For example, the hardware building blocks related to motor speed mentioned in 1.1) above use the micro-control device Microbit, an external Wukong expansion board (a highly integrated multi-functional expansion board based on micro:bit) and a motor. DMIPES calls the MicroBit firmware to provide an API to operate the motor driver of the Wukong expansion board through I2C communication to achieve control of the motor.

[0105] With this design, the command protocol adopts a hybrid format with strong scalability and flexibility. The command is compressed to reduce the amount of data transmitted, thereby increasing the speed of data transmission. The program is distributed and run in a distributed manner, which also reduces the memory consumption of the micro-control device. The program execution and operation threshold for hardware programming for beginners in the early stage of entry is reduced, achieving a step-by-step learning effect, and getting started with hardware programming in an orderly and gradual manner, thereby reducing the burden on teaching practitioners.

[0106] Please refer to Figure 6 , Figure 6 The present invention provides a command control device 110 for a micro device used for teaching, which is applied to a command control system. The command control system includes a control terminal and a teaching micro main control device. The control terminal is connected to the teaching micro main control device for communication. The device includes:

[0107] The control module 1101 is used to obtain a pre-customized instruction protocol, wherein the instruction protocol includes an instruction format type, an instruction format, and an instruction encoding method; based on the instruction protocol, generate a control instruction for the teaching micro-master device; and send the control instruction to the teaching micro-master device;

[0108] The controlled module 1102 is used to parse the control instruction and execute the instruction operation corresponding to the control instruction.

[0109] It should be noted that the implementation principle of the instruction control device 110 for the aforementioned micro-device applied to teaching can refer to the implementation principle of the instruction control method for the aforementioned micro-device applied to teaching, and will not be repeated here. It should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into a physical entity, or physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the instruction control device 110 for the micro-device applied to teaching can be a separately established processing element, or it can be integrated in a chip of the above-mentioned device. In addition, it can also be stored in the memory of the above-mentioned device in the form of program code, and a processing element of the above-mentioned device can call and execute the functions of the instruction control device 110 for the micro-device applied to teaching. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in a processor element or an instruction in software form.

[0110] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processors, DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0111] The embodiment of the present invention provides a computer device 100, which includes a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the computer device 100 executes the instruction control device 110 of the aforementioned micro-device applied to teaching. Figure 7 As shown, Figure 7The computer device 100 provided in the embodiment of the present invention is a structural block diagram. The computer device 100 includes an instruction control device 110 of a micro device applied to teaching, a memory 111, a processor 112 and a communication unit 113.

[0112] In order to realize data transmission or interaction, the memory 111, the processor 112 and the communication unit 113 are electrically connected to each other directly or indirectly. For example, the electrical connection between these elements can be realized through one or more communication buses or signal lines. The instruction control device 110 of the micro device applied to teaching includes at least one software function module that can be stored in the memory 111 in the form of software or firmware or solidified in the operating system (OS) of the computer device 100. The processor 112 is used to execute the instruction control device 110 of the micro device applied to teaching stored in the memory 111, such as the software function module and computer program included in the instruction control device 110 of the micro device applied to teaching.

[0113] An embodiment of the present invention provides a readable storage medium, which includes a computer program. When the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the aforementioned instruction control method for a micro device applied to teaching.

[0114] For illustrative purposes, the foregoing description is made with reference to specific embodiments. However, the above illustrative discussion is not intended to be exhaustive or to limit the present disclosure to the precise form disclosed. Numerous modifications and variations are possible in accordance with the above teachings. These embodiments are selected and described in order to best illustrate the principles of the present disclosure and its practical application, so that those skilled in the art can best utilize the present disclosure and utilize various embodiments with different modifications to suit the intended specific application.

Claims

1. A command control method for a micro device used in teaching, characterized in that: Applied in a command control system, the command control system includes a control terminal and a teaching micro main control device, the control terminal is communicatively connected with the teaching micro main control device, and the method includes: The control end obtains a pre-customized instruction protocol, wherein the instruction protocol includes an instruction format type, an instruction format, and an instruction encoding method; The control end generates a control instruction for the teaching micro main control device based on the instruction protocol; The control terminal sends the control instruction to the teaching micro main control device; The teaching micro main control device parses the control instruction and executes the instruction operation corresponding to the control instruction; The control end generates a control instruction for the teaching micro main control device based on the instruction protocol, including: Establishing an operation instruction mapping table according to the instruction protocol, wherein the operation instruction mapping table includes a mapping of the teaching micro-master device type, firmware version and operation code corresponding to the control instruction; Acquire input parameters for the operation instruction, and obtain operation data in the instruction format according to the input parameters; Assembling and obtaining control instructions for the teaching micro-master device according to the operation instruction mapping table and the operation data in the instruction format; The acquiring of input parameters for the operation instruction and obtaining the operation data in the instruction format according to the input parameters includes: Obtaining input parameters for the operation instruction; Compressing the input parameter using a string compression algorithm to generate a byte array; The byte array is used as operation data of the instruction format.

2. The method according to claim 1, characterized in that The instruction protocol instruction format type is a mixed format type; the instruction format includes hardware type, firmware version, operation code and operation data; the instruction encoding method is extended encoding; the hardware type, the firmware version and the operation code are located in the standard encoding part, and the operation data is located in the extended encoding part.

3. The method according to claim 1, characterized in that The control terminal sends the control instruction to the teaching micro main control device, including: The control terminal sends the control instruction to the teaching micro main control device via Bluetooth or universal serial bus.

4. The method according to claim 2, characterized in that: The teaching micro main control device is configured with a firmware main program and an instruction parsing and executing service. The teaching micro main control device parses the control instruction and executes the instruction operation corresponding to the control instruction, including: When the teaching micro-master control device is in a powered-on state, running the firmware main program; Calling the firmware main program to start the instruction parsing and execution service; Calling the instruction parsing and execution service to parse the control instruction, obtaining the hardware type, firmware version and operation code, and decoding using a preset encoding format to obtain the operation data; Calling the instruction parsing and execution service to verify the control instruction according to the hardware type and the firmware version; In the case of passing the verification, the service calls the hardware driver based on the instruction parsing to execute the instruction operation corresponding to the control instruction according to the operation code and the operation data.

5. The method according to claim 4, characterized in that The calling of the instruction parsing and execution service to verify the control instruction according to the hardware type and the firmware version includes: Verifying the hardware type and the firmware version; If the hardware type is an executable instruction and the firmware version is consistent with its own version, it is determined that the verification is passed; Otherwise, an error code is returned.

6. A command control device for a micro device used in teaching, characterized in that: Applied in a command control system, the command control system includes a control terminal and a teaching micro main control device, the control terminal is communicatively connected with the teaching micro main control device, and the device includes: A control module is used to obtain a pre-customized instruction protocol, wherein the instruction protocol includes an instruction format type, an instruction format, and an instruction encoding method; based on the instruction protocol, generate a control instruction for the teaching micro-master device; and send the control instruction to the teaching micro-master device; A controlled module, used to parse the control instruction and execute the instruction operation corresponding to the control instruction; The control module is specifically used for: Establishing an operation instruction mapping table according to the instruction protocol, the operation instruction mapping table includes a mapping of the teaching micro-master device type, firmware version and operation code corresponding to the control instruction; acquiring input parameters for the operation instruction, and obtaining operation data in the instruction format according to the input parameters; assembling the control instruction for the teaching micro-master device according to the operation instruction mapping table and the operation data in the instruction format; The control module is also specifically used for: Obtaining input parameters for the operation instruction; Compressing the input parameter using a string compression algorithm to generate a byte array; The byte array is used as operation data of the instruction format.

7. A computer device, characterized in that: The computer device includes a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the computer device executes the instruction control method for a micro device applied to teaching as described in any one of claims 1-6.

8. A readable storage medium, characterized in that: The readable storage medium includes a computer program, and when the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the instruction control method for a micro-device used for teaching as described in any one of claims 1 to 6.