CN111045667A - Graphical programming system based on Lua script - Google Patents

Graphical programming system based on Lua script Download PDF

Info

Publication number
CN111045667A
CN111045667A CN201911238277.7A CN201911238277A CN111045667A CN 111045667 A CN111045667 A CN 111045667A CN 201911238277 A CN201911238277 A CN 201911238277A CN 111045667 A CN111045667 A CN 111045667A
Authority
CN
China
Prior art keywords
lua script
graphical
programming
lua
graphical programming
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.)
Granted
Application number
CN201911238277.7A
Other languages
Chinese (zh)
Other versions
CN111045667B (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.)
Institute of Automation of Chinese Academy of Science
Original Assignee
Institute of Automation of Chinese Academy of Science
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 Institute of Automation of Chinese Academy of Science filed Critical Institute of Automation of Chinese Academy of Science
Priority to CN201911238277.7A priority Critical patent/CN111045667B/en
Publication of CN111045667A publication Critical patent/CN111045667A/en
Application granted granted Critical
Publication of CN111045667B publication Critical patent/CN111045667B/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/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Abstract

The invention relates to the technical field of programming, in particular to a graphical programming system based on a Lua script. In order to solve the problems that the existing programming system is high in entry difficulty and not friendly to users, the invention provides a graphical programming system based on a Lua script, and the graphical programming system based on the Lua script comprises a first system, a second system and a third system; the first system is used for acquiring user programming codes and compiling the user programming codes into Lua scripts; the second system is used for reading the Lua script compiled by the first system and sending the read Lua script to the third system; and the third system is used for analyzing the Lua script and running the result obtained by analyzing the Lua script. The graphical programming system based on the Lua script is low in entry difficulty and suitable for advanced learning of students familiar with graphical programming.

Description

Graphical programming system based on Lua script
Technical Field
The invention relates to the technical field of programming, in particular to a graphical programming system based on a Lua script.
Background
The State Council issues ' New Generation Artificial Intelligence development planning ', wherein it is clearly pointed out that artificial intelligence becomes the new focus of international competition, people's intelligent education projects and artificial intelligence competitions should be developed step by step, and in the middle and primary schools, artificial intelligence related courses are set, programming education is popularized step by step, artificial intelligence disciplines are built, and composite talents are cultivated to form the high lands of artificial intelligence talents in China.
Aiming at the low-age primary and secondary school students, the graphical programming technology is more favorable for exciting the interest of learning programming and cultivating the thinking and skill of programming, and is suitable for large-scale programming education popularization in the primary and secondary schools. The artificial intelligence education for primary and secondary schools usually needs to adopt a means of combining intelligent hardware and software programming to guide students to make intelligent hardware products, so that the achievement feeling of feeling is obtained, and therefore, the artificial intelligence education for the primary and secondary schools is more facilitated by taking an embedded hardware platform as a carrier.
However, the programming language adopted by the existing artificial intelligence education has higher difficulty and higher entrance difficulty, and is not friendly to primary and secondary school students.
Therefore, how to provide a programming system with low access difficulty and capable of effectively arousing learning interest is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
In order to solve the above problems in the prior art, namely to solve the problems that the existing programming system is high in access difficulty and not friendly to users, the invention provides a graphical programming system based on a Lua script, wherein the graphical programming system based on the Lua script comprises a first system, a second system and a third system;
the first system carries graphical programming software and is used for acquiring user programming codes and compiling the user programming codes into Lua scripts;
the second system is used for reading the Lua script compiled by the first system and sending the read Lua script to the third system;
and the third system is used for analyzing the Lua script and running a result obtained by analyzing the Lua script.
Preferably, the first system comprises a graphical interaction unit and a graphical compiling unit;
the graphical programming interaction unit is used for acquiring a programming code edited by a user based on the graphical library and the algorithm library;
the graphical compiling unit is used for compiling the programming codes into Lua scripts;
the graphic library is used for displaying a graphical programming interface, and the algorithm library is used for supporting a user to call codes in the algorithm library as graphic elements.
Preferably, the second system includes a storage unit and a transmission unit;
the storage unit is used for storing the Lua script so that the second system can read the Lua script stored in the storage unit conveniently;
the transmission unit is used for transmitting the Lua script stored in the storage unit to the third system.
Preferably, the storage unit comprises an SD card and/or a USB storage device; the transmission unit comprises a Bluetooth device and/or a WIFI device.
Preferably, the third system includes a processing unit, the processing unit loads an execution program, and the execution program parses the Lua script and runs a result obtained by parsing the Lua script.
Preferably, the third system further comprises a communication unit, and the communication unit comprises a communication interface so that the communication unit can communicate with the transmission unit.
Preferably, the communication interface includes an SD card interface, and/or a USB interface, and/or a bluetooth interface, and/or a WIFI interface.
Preferably, the third system further comprises a CAN bus interface, so that the graphical programming system extends peripheral devices.
The graphical programming system based on the Lua script, provided by the invention, is provided with graphical programming software, and can acquire user programming codes and compile the user programming codes into the Lua script; the second system can read the Lua script compiled by the first system and transmit the Lua script to the third system; the third system can parse the Lua script and run the results of parsing the Lua script.
The Lua scripting language is simple and efficient, is suitable for being used as the scripting language of the embedded platform, does not need to rely on special downloader equipment to update executable files on the embedded platform, and improves the cross-platform characteristics of the system. The graphical programming system based on the Lua script does not need to install an independent driving program, and only needs to meet simple basic communication convention. In addition, the Lua script language is simple in grammar and low in entry difficulty, is suitable for advanced learning of students familiar with graphical programming, is easy to be embedded into an embedded microprocessor to run, and is beneficial to cooperative work with an intelligent hardware platform.
Drawings
FIG. 1 is a schematic structural diagram of a graphical programming system based on Lua script according to the present invention;
FIG. 2 is a flow chart of the graphical programming of the present invention.
Detailed Description
In order to make the embodiments, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the embodiments are some, but not all embodiments of the present invention. It should be understood by those skilled in the art that these embodiments are only for explaining the technical principle of the present invention, and are not intended to limit the scope of the present invention.
Referring to fig. 1 and 2, fig. 1 schematically illustrates a flow chart of the graphical programming of the present invention; FIG. 2 is a schematic structural diagram of a graphical programming system based on Lua script.
As shown in FIG. 1, a user writes program logic by dragging a building block programming interface by using a graphical programming interactive system based on the program logic to obtain a graphical code or a programming code with a logic structure. And finally, the embedded Lua analysis system analyzes the Lua script and runs a result obtained after analyzing the Lua script.
As shown in FIG. 2, the graphical programming system based on Lua script of the present invention includes a first system 1, a second system 2 and a third system 3.
Specifically, the first system 1 is loaded with graphical programming software, and the first system 1 is used for acquiring user programming codes and compiling the user programming codes into Lua scripts. The first system 1 may include a graphical programming system and a program graph compiling system.
The graphical programming of the application is realized by adopting a dragging type building block type module. The graphical programming software of the application comprises necessary programming elements in the traditional programming language, such as: the system comprises a conditional statement module, a loop statement module, a mathematical operation statement module, a logic operation statement module and the like, and also develops a new functional module corresponding to the embedded intelligent hardware aiming at the embedded intelligent hardware platform, for example: the device comprises a general input/output module, a serial pass module, a square wave generation module, a timer module, an encoder counting module, an analog-to-digital conversion module, a digital-to-analog conversion module and the like. The user can directly and conveniently call the corresponding peripheral equipment on the embedded intelligent hardware through the graphic components, the user does not need to pay attention to the implementation of the bottom layer, and only needs to concentrate on the logic of the upper application layer, so that the quick entry and the quick development are facilitated.
The graphical programming software includes a plurality of graphic element libraries, such as: a Lua script basic grammar library, an embedded platform peripheral library, an extended sensor interface library, an algorithm library and the like. The algorithm library is used for supporting a user to call codes in the algorithm library as graphic elements. The user can save the graphical code segments into the algorithm library by himself so as to support the reuse of the code segments which are developed subsequently. In addition, the user can upload the saved graphical coding segments to the cloud end to be shared with other users.
After the user finishes coding the graphic elements, the graphical programming software compiles the graphical codes of the user to generate a Lua script, and the user can edit the generated Lua script again or directly load the generated script into a target embedded platform to run.
The graphical programming system of the application uses a Lua scripting language, and on the basis of a standard Lua scripting language, corresponding functions and attributes of the on-chip peripherals of the embedded intelligent hardware platform are packaged and added into a Lua parser for calling the Lua script to form a Lua extension library matched with the Lua script, so that the embedded intelligent hardware platform can parse and run the extended Lua script. The Lua language is friendly to embedded application, and can conveniently transplant the Lua analysis environment to an embedded platform.
The second system 2 comprises a storage unit and a transmission unit, wherein the storage unit is used for storing the Lua script, so that the second system 2 can read the Lua script stored in the storage unit; the transmission unit is used for transmitting the Lua script stored in the storage unit to the third system 3.
Alternatively, the second system 2 may be a Lua script updating system. The storage unit may include an SD card and/or a USB storage device. The transmission unit may include a bluetooth device and/or a WIFI device.
For convenience of description, the second system 2 will be described as a Lua script updating system in the following. The Lua script updating system can use an SD card as a carrier, a user can copy and store the Lua script into the SD card and then insert the SD card into a reserved SD interface, and the Lua script updating system reads the Lua script from the SD card to update the script.
Optionally, the Lua script updating system may further use a USB storage device as a carrier, and the user may copy and store the Lua script that needs to be loaded into the system into the USB device, insert the USB device into the reserved USB interface, and read and load the Lua script through the Lua script updating system, so that the script updating may be implemented.
As a preferred embodiment, the Lua script updating system may use a USB interface as a transmission carrier, the third system 3 may be connected to the desktop computer through the USB interface, and the user transmits the Lua script file to be loaded into the system to the third system 3 through the USB interface, so as to implement loading and updating of the script.
In addition, the Lua script updating system can use a bluetooth device as a transmission device, and the user can send the Lua script file to the third system 3 through the bluetooth device to realize script loading and updating.
Optionally, the Lua script updating system may use a WIFI device as a transmission device, and the user may send the Lua script file to the third system 3 through the WIFI device, so as to load and update the script.
The Lua language does not need compiling, and the characteristic greatly facilitates the updating of executable codes in the embedded platform. Compared with the traditional programming language, such as C language, C language codes need to be compiled after being compiled, and then the executable file is burnt into the storage space of the embedded microprocessor by using special burning equipment or a downloader; the Lua language is an interpreted language, compiling is not needed, the script file is directly transmitted to the embedded platform only by using any communication mode in the program updating process, the limitation that a matched downloader needs to be used is removed, and cost is saved. In addition, the Lua language has inherent cross-platform advantages because the Lua language does not need compiling.
The third system 3 is used for analyzing the Lua script and running the result obtained by analyzing the Lua script.
Specifically, the third system 3 includes a processing unit, which loads an execution program, and the execution program can parse the Lua script and run the result of parsing the Lua script.
Alternatively, the third system 3 may be an embedded Lua parsing system and the processing unit may be a processor. The processor may be loaded with an execution program, and the execution program may analyze the Lua script. All on-chip hardware resource modules of the processor universal input/output port, the serial communication and the like are packaged into function interfaces which can be called by the Lua parser. Besides a complete Lua grammar interpreter, the firmware burned on the target embedded platform also comprises peripheral function libraries such as a universal IO (input/output), a serial communication port, an analog-to-digital conversion and the like of the platform and a Lua calling interface thereof, so that various peripheral functions on the platform can be operated in a Lua script.
Optionally, the embedded Lua parsing system further comprises a CAN bus interface so as to graphically program the system expansion peripheral equipment.
The graphical programming system reserves real-time communication ports such as a serial communication port, a Bluetooth module, a WIFI module and a USB communication interface, directly sends script files to be updated to a target embedded intelligent hardware platform through the communication ports, and loading and updating of scripts are achieved. The method is completely different from the traditional updating method of the executable file of the embedded platform, the traditional executable file of the embedded platform mostly depends on special downloader equipment for burning, and the downloader equipment usually requires that a special corresponding driver is installed on a corresponding host desktop computer host to be normally used, so the cross-platform characteristic is poor; the updating mode of the executable file of the embedded intelligent hardware platform can be realized only by sending text data according to the corresponding communication protocol, and the host can be a desktop computer and a tablet personal computer, and also can be other optional equipment with communication capacity (such as an FPGA (field programmable gate array), an embedded microprocessor and the like), and has inherent cross-platform advantages.
It will be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In the several embodiments provided in the present application, it should be understood that the disclosed system may be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In summary, the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (8)

1. A graphical programming system based on Lua script is characterized in that the graphical programming system comprises a first system, a second system and a third system;
the first system carries graphical programming software and is used for acquiring user programming codes and compiling the user programming codes into Lua scripts;
the second system is used for reading the Lua script compiled by the first system and sending the read Lua script to the third system;
and the third system is used for analyzing the Lua script and running a result obtained by analyzing the Lua script.
2. The graphical programming system according to claim 1, wherein the first system comprises a graphical interaction unit and a graphical compilation unit;
the graphical programming interaction unit is used for acquiring a programming code edited by a user based on the graphical library and the algorithm library;
the graphical compiling unit is used for compiling the programming codes into Lua scripts;
the graphic library is used for displaying a graphical programming interface, and the algorithm library is used for supporting a user to call codes in the algorithm library as graphic elements.
3. The graphical programming system according to claim 1, wherein the second system comprises a storage unit and a transmission unit;
the storage unit is used for storing the Lua script so that the second system can read the Lua script stored in the storage unit conveniently;
the transmission unit is used for transmitting the Lua script stored in the storage unit to the third system.
4. The graphical programming system according to claim 3, wherein the storage unit comprises an SD card and/or a USB storage device; the transmission unit comprises a Bluetooth device and/or a WIFI device.
5. The graphical programming system according to claim 1, wherein the third system comprises a processing unit, the processing unit is loaded with an execution program, the execution program parses the Lua script, and runs a result of parsing the Lua script.
6. The graphical programming system of claim 5, wherein the third system further comprises a communication unit, the communication unit comprising a communication interface for the communication unit to communicate with the transmission unit.
7. The graphical programming system according to claim 6, wherein the communication interface comprises an SD card interface, and/or a USB interface, and/or a Bluetooth interface, and/or a WIFI interface.
8. The graphical programming system of claim 7, wherein the third system further comprises a CAN bus interface to facilitate the graphical programming system to extend peripheral devices.
CN201911238277.7A 2019-12-06 2019-12-06 Graphical programming system based on Lua script Active CN111045667B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911238277.7A CN111045667B (en) 2019-12-06 2019-12-06 Graphical programming system based on Lua script

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911238277.7A CN111045667B (en) 2019-12-06 2019-12-06 Graphical programming system based on Lua script

Publications (2)

Publication Number Publication Date
CN111045667A true CN111045667A (en) 2020-04-21
CN111045667B CN111045667B (en) 2022-01-25

Family

ID=70234762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911238277.7A Active CN111045667B (en) 2019-12-06 2019-12-06 Graphical programming system based on Lua script

Country Status (1)

Country Link
CN (1) CN111045667B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111596904A (en) * 2020-04-29 2020-08-28 赵新伟 Embedded C language script programming method
CN112506503A (en) * 2020-12-18 2021-03-16 深圳市优必选科技股份有限公司 Programming method, device, terminal equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107678746A (en) * 2017-09-30 2018-02-09 江西洪都航空工业集团有限责任公司 A kind of pattern development platform based on ROS
US20190022520A1 (en) * 2017-07-21 2019-01-24 Unruly Studios, Inc. System of distributed interactive objects
CN110362299A (en) * 2019-06-14 2019-10-22 杭州古德微机器人有限公司 A kind of inline graphics programing system and its application method based on blockly and raspberry pie

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190022520A1 (en) * 2017-07-21 2019-01-24 Unruly Studios, Inc. System of distributed interactive objects
CN107678746A (en) * 2017-09-30 2018-02-09 江西洪都航空工业集团有限责任公司 A kind of pattern development platform based on ROS
CN110362299A (en) * 2019-06-14 2019-10-22 杭州古德微机器人有限公司 A kind of inline graphics programing system and its application method based on blockly and raspberry pie

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈冉: "机器人图形化开发环境设计", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111596904A (en) * 2020-04-29 2020-08-28 赵新伟 Embedded C language script programming method
CN112506503A (en) * 2020-12-18 2021-03-16 深圳市优必选科技股份有限公司 Programming method, device, terminal equipment and storage medium
CN112506503B (en) * 2020-12-18 2024-01-12 深圳市优必选科技股份有限公司 Programming method, device, terminal equipment and storage medium

Also Published As

Publication number Publication date
CN111045667B (en) 2022-01-25

Similar Documents

Publication Publication Date Title
CN110362299B (en) Online graphical programming system based on block and raspberry pie and using method thereof
US10809981B2 (en) Code generation and simulation for graphical programming
CN111045667B (en) Graphical programming system based on Lua script
CN104598240A (en) Platform-spanning simulation model development method and system
CN102696012A (en) Creating inferred symbols from code usage
CN102609243B (en) Emulating pointers
KR100988597B1 (en) Robot content authoring system having user Friendly form in web environments
CN113032963A (en) Simulink model simulation acceleration method and device
CN108563579A (en) White-box testing method, apparatus, system and storage medium
CN114780100B (en) Compiling method, electronic device and storage medium
CN111123737A (en) Digital hardware virtual simulation system
CN111111201B (en) Skill creation method, device, server and medium based on game
CN103176894A (en) Test data automatic derivative method and automatic derivative device facing database
CN110471654A (en) The cloud development system and computer software program product of communication protocol
Konur et al. kPWorkbench: A software suit for membrane systems
CN105573763B (en) A kind of Embedded System Modeling method for supporting RTOS
KR20130053714A (en) Method of program development using visual programming language and computer readable medium thereof
Palazzetti Getting started with UDOO
CN113934429A (en) Design draft conversion method and device, computer equipment and storage medium
CN111880793A (en) HMI configuration system and method based on binary file
Buchmann Towards tool support for agile modeling: sketching equals modeling
CN111930398A (en) Application program updating method, device, system, medium and equipment
CN113220561A (en) Test case management method, device, equipment and medium
CN110413318A (en) Transplantation method, device and the relevant device of graphical user interface
CN117215661A (en) Event processing method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant