CN112506520A - System and method for judging grammar error of physical programming language - Google Patents

System and method for judging grammar error of physical programming language Download PDF

Info

Publication number
CN112506520A
CN112506520A CN202011495912.2A CN202011495912A CN112506520A CN 112506520 A CN112506520 A CN 112506520A CN 202011495912 A CN202011495912 A CN 202011495912A CN 112506520 A CN112506520 A CN 112506520A
Authority
CN
China
Prior art keywords
programming
output
module
physical
building block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011495912.2A
Other languages
Chinese (zh)
Inventor
张炜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Youbixue Technology Co ltd
Original Assignee
Hangzhou Youbixue Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Youbixue Technology Co ltd filed Critical Hangzhou Youbixue Technology Co ltd
Priority to CN202011495912.2A priority Critical patent/CN112506520A/en
Publication of CN112506520A publication Critical patent/CN112506520A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Electrically Operated Instructional Devices (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a system and a method for judging grammatical errors of a physical programming language, which comprise a main control module, and a display module, an alarm module and a communication module which are respectively connected with the main control module, wherein the main control module is connected with the physical programming module, and the communication module is connected with a monitoring management cloud platform. The method comprises the following steps: acquiring a real object programming content; judging whether an output class statement exists or not; judging whether the statement has an output physical quantity; judging whether the output physical quantity has necessary parameters and meets the sequence requirement; judging whether the paired grammar in the sentence is complete; and if all judgment is successful, the physical programming is successful and an instruction is output. The technical scheme is based on three types of generalized physical programming grammar problems, adopts the forms of indicator lights, electromagnetic displacement and the like to mark error steps and inform error reasons, realizes quick and effective error correction when a user carries out physical programming, and achieves the purpose of high-efficiency and clear learning.

Description

System and method for judging grammar error of physical programming language
Technical Field
The invention relates to the technical field of man-machine interaction, in particular to a system and a method for judging grammatical errors of a physical programming language.
Background
Nowadays, with the rapid development and more practical application of artificial intelligence technology, software algorithms as the important basis of artificial intelligence have attracted extensive attention to the importance of programming education, and particularly, programming education is gradually listed in the primary and middle school education synopsis of all countries in the world.
However, the traditional programming education method has a high threshold, has certain requirements on the age and the logic abstraction capability of students, and needs to be performed by depending on a computer programming language environment or a hardware method such as a tablet computer. The conventional programming environment requires text input through a keyboard, is inconvenient for children to understand and use, and requires understanding and memorizing of grammars and complex instructions in a programming language. It is often difficult for them to remember and understand the expertise of program syntax, logical relationships, and program structure.
There are data showing that physical programming has become one of the main forms of programming learning for children. For high-level programming languages, it is necessary to check and compile the syntax of the code language before the code runs. At present, the use of the physical programming lacks the function of syntax check on the physical programming language, so that a user can not know whether the generated effect is correct or not, and the user can not learn correct operation clearly, even with half the effort.
Chinese patent document CN108806405A discloses a "materialized children programming building block and its using method". The building block comprises a circulation type main building block, a selection type main building block, a branch type main building block and a plurality of digital building blocks; the circulation type main building block, the selection type main building block and the branch type main building block respectively comprise a first microprocessor, an output module, a power interface module and a data communication interface module which are electrically connected; the digital building block comprises a second microprocessor, and the circulating type main building block, the selecting type main building block and the branch type main building block are spliced with the digital building block through a power interface module and a data communication interface module respectively. The technical scheme lacks clear error feedback, and a user cannot clearly learn correct operation.
Disclosure of Invention
The invention mainly solves the technical problem that the original technical scheme lacks clear error feedback, and provides a system and a method for judging grammar errors of a physical programming language.
The technical problem of the invention is mainly solved by the following technical scheme:
a system for judging grammar errors of a physical programming language comprises a main control module, and a display module, an alarm module and a communication module which are respectively connected with the main control module, wherein the main control module is connected with the physical programming module, and the communication module is connected with a monitoring management cloud platform.
Preferably, the object programming module comprises a programming building block and a programming board, wherein the center of the bottom surface of the programming building block is provided with a magnetic suction block, the upper surface of the programming building block is provided with programming symbols, a microprocessor is arranged in the programming building block, the programming board is provided with a plurality of programming building block placing positions which are arranged in sequence, the center of each programming building block placing position is provided with an electromagnetic structure, the display module comprises a display, and the display is arranged at the upper edge of the programming board.
Preferably, the alarm module comprises an indicator light, an electromagnetic displacement structure and a voice player, wherein the indicator light comprises an LED light arranged below each programming building block placement position.
Preferably, the electromagnetic displacement structure comprises a magnetic attraction structure arranged at the upper edge of the programming building block placement position. When the programming is wrong, the electromagnetic structure at the center of the programming building block placing position at the wrong position fails, the electromagnetic displacement structure takes effect, and the programming building block moves upwards.
A working method of a system for judging grammar errors of a physical programming language comprises the following steps:
a. acquiring a real object programming content;
b. judging whether an output class statement exists or not;
c. judging whether the statement has an output physical quantity;
d. judging whether the output physical quantity has necessary parameters and meets the sequence requirement;
e. judging whether the paired grammar in the sentence is complete;
f. and if all judgment is successful, the physical programming is successful and an instruction is output.
Preferably, if there is an output class statement in step b, the step c is continued, and if there is no output class statement, the programming fails and an alarm is given. Because an expression of the output class is required, it is also listed as a syntax error in the absence of execution of the output class statement.
Preferably, the step c performs the step d if the feature class sentence is output, and performs the step e if the feature class sentence is not output. In the material object programming scene, besides the output characteristic class statements containing the relevant parameters, there are also programming statements of non-output class, such as numerical characters, sensor for condition judgment, etc.
Preferably, the output physical quantity in step d includes necessary parameters and unnecessary parameters, and the order of the parameters of some output physical quantities is required. Physical programming typically involves parameterizing adjustments to output physical quantities such as rotation, sound, light, etc., such as size, orientation, etc. The designer can decide whether the relation between the parameters and the output physical quantity is bound necessarily or optionally, and the precedence relation, thereby determining the basis of syntax errors.
Preferably, the syntax in step e includes a loop and a bracket, and corresponds to each other, otherwise, it is determined as a syntax error.
Preferably, the warning when the programming fails specifically includes: the red light is lighted to the pilot lamp, and the electromagnetic structure that the position center was placed to the programming building blocks of wrong position department is invalid, and electromagnetic displacement structure takes effect, makes the programming building blocks shift up, and the display shows the error reason simultaneously and reports through the voice player.
The invention has the beneficial effects that: based on three types of generalized physical programming grammar problems, the main control module is used for collecting the contents of physical programming, the error marking steps are carried out by adopting the forms of indicating lamps, electromagnetic displacement and the like through judgment, the error reasons are informed to a user in a display and voice form, and meanwhile, the error reasons are recorded to the cloud platform, so that the targeted exercise is facilitated, the quick and effective error correction during the physical programming of the user is realized, and the purpose of high-efficiency and clear learning is achieved.
Drawings
Fig. 1 is a schematic circuit diagram of the present invention.
FIG. 2 is a flow chart of the present invention
In the figure, a main control module 1, a physical programming module 2, a display module 3, an alarm module 4, a communication module 5 and a monitoring management cloud platform 6 are arranged.
Detailed Description
The technical scheme of the invention is further specifically described by the following embodiments and the accompanying drawings.
Example (b): the system for judging syntax errors of the physical programming language in the embodiment is shown in fig. 1, and comprises a main control module 1, and a display module 3, an alarm module 4 and a communication module 5 which are respectively connected with the main control module 1, wherein the main control module 1 is connected with a physical programming module 2, and the communication module 5 is connected with a monitoring management cloud platform 6. The communication module 5 is connected with the monitoring management cloud platform 6, so that the error reasons of the physical programming are collected and analyzed, and a user is facilitated to carry out targeted exercise.
The object programming module 2 comprises a programming building block and a programming board, wherein the center of the bottom surface of the programming building block is provided with a magnetic attraction block, the upper surface of the programming building block is provided with programming symbols, a microprocessor is arranged inside the programming building block, a plurality of programming building block placing positions which are arranged in sequence are arranged on the programming board, the center of each programming building block placing position is provided with an electromagnetic structure, the display module 3 comprises a display, and the upper edge of the programming board is arranged on the display. The display is used for displaying the error reason.
The alarm module 4 comprises an indicator light, an electromagnetic displacement structure and a voice player, wherein the indicator light comprises an LED lamp arranged below each programming building block placing position. The electromagnetic displacement structure comprises a magnetic attraction structure arranged at the upper edge of the programming building block placing position.
A working method of a system for judging grammar errors of a physical programming language comprises the following steps:
a. and acquiring the real object programming content.
b. And c, judging whether an output statement exists or not, if so, continuing the step c, and if not, failing the programming and giving an alarm. Because an expression of the output class is required, it is also listed as a syntax error in the absence of execution of the output class statement.
c. And d, judging whether the output physical quantity exists in the sentence, if the output physical quantity is the output characteristic sentence, performing the step d, and if the output physical quantity is not the output characteristic sentence, performing the step e. In the material object programming scene, besides the output characteristic class statements containing the relevant parameters, there are also programming statements of non-output class, such as numerical characters, sensor for condition judgment, etc.
d. And judging whether the output physical quantity has necessary parameters and meets the sequence requirement. The output physical quantity includes necessary parameters and unnecessary parameters, and there is a parameter order requirement for part of the output physical quantity.
For example: motor output + binding of rotation direction + binding of rotation speed + binding of rotation time
In the above example, the rotation direction and the speed are bound and may have a precedence relationship, so that when the rotation direction and the speed are absent or not in proper sequence, the syntax is determined to be an error; if the rotation time parameter is missing, it is not determined as a syntax error.
e. And judging whether the paired grammars in the sentence are complete or not, wherein the paired grammars comprise circulation and brackets and are in one-to-one correspondence, and otherwise, judging that the grammars are wrong.
f. And if all judgment is successful, the physical programming is successful and an instruction is output.
If the programming fails, the alarm specifically comprises: the red light is lighted to the pilot lamp, and the electromagnetic structure that the position center was placed to the programming building blocks of wrong position department is invalid, and electromagnetic displacement structure takes effect, makes the programming building blocks shift up, and the display shows the error reason simultaneously and reports through the voice player.
The specific embodiments described herein are merely illustrative of the spirit of the invention. Various modifications or additions may be made to the described embodiments or alternatives may be employed by those skilled in the art without departing from the spirit or ambit of the invention as defined in the appended claims.
Although terms like master control module, electromagnetic displacement structure, output class statement are used more often herein, the possibility of using other terms is not excluded. These terms are used merely to more conveniently describe and explain the nature of the present invention; they are to be construed as being without limitation to any additional limitations that may be imposed by the spirit of the present invention.

Claims (10)

1. The utility model provides a system for judge grammar mistake of material object programming language which characterized in that, includes host system (1) and display module (3), alarm module (4), communication module (5) that link to each other with host system (1) respectively, host system (1) links to each other with material object programming module (2), communication module (5) link to each other with control management cloud platform (6).
2. The system and the method for determining the grammar error of the physical programming language according to claim 1, wherein the physical programming module (2) comprises a programming building block and a programming board, the center of the bottom surface of the programming building block is provided with a magnetic block, the upper surface of the programming building block is provided with programming symbols, a microprocessor is arranged in the programming building block, the programming board is provided with a plurality of programming building block placing positions arranged in sequence, the center of each programming building block placing position is provided with an electromagnetic structure, the display module (3) comprises a display, and the display is arranged at the upper edge of the programming board.
3. The system and the method for determining the grammatical errors of the physical programming language according to claim 2, wherein the warning module (4) comprises an indicator light, an electromagnetic displacement structure and a voice player, and the indicator light comprises an LED light arranged below each programming block placement position.
4. The system and method of claim 3, wherein the electromagnetic displacement structure comprises a magnetic attraction structure disposed on an upper edge of the placement position of the programming blocks.
5. A working method of a system for judging grammar errors of a physical programming language is characterized by comprising the following steps:
a. acquiring a real object programming content;
b. judging whether an output class statement exists or not;
c. judging whether the statement has an output physical quantity;
d. judging whether the output physical quantity has necessary parameters and meets the sequence requirement;
e. judging whether the paired grammar in the sentence is complete;
f. and if all judgment is successful, the physical programming is successful and an instruction is output.
6. The method of claim 5, wherein if there is an output class statement in step b, continuing step c, and if there is no output class statement in step b, failing to program and warning.
7. The method as claimed in claim 5, wherein the step c is performed in step d if the output feature sentence is output, and the step e is performed if the output feature sentence is not output.
8. The method as claimed in claim 5, wherein the output physical quantities in step d include necessary parameters and unnecessary parameters, and the parameter order requirement exists in some of the output physical quantities.
9. The method as claimed in claim 5, wherein the syntax in step e includes a loop and a bracket, and corresponds to each other, otherwise, the syntax is determined to be a syntax error.
10. The method of claim 6, wherein the warning when the programming fails specifically includes: the red light is lighted to the pilot lamp, and the electromagnetic structure that the position center was placed to the programming building blocks of wrong position department is invalid, and electromagnetic displacement structure takes effect, makes the programming building blocks shift up, and the display shows the error reason simultaneously and reports through the voice player.
CN202011495912.2A 2020-12-17 2020-12-17 System and method for judging grammar error of physical programming language Pending CN112506520A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011495912.2A CN112506520A (en) 2020-12-17 2020-12-17 System and method for judging grammar error of physical programming language

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011495912.2A CN112506520A (en) 2020-12-17 2020-12-17 System and method for judging grammar error of physical programming language

Publications (1)

Publication Number Publication Date
CN112506520A true CN112506520A (en) 2021-03-16

Family

ID=74922151

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011495912.2A Pending CN112506520A (en) 2020-12-17 2020-12-17 System and method for judging grammar error of physical programming language

Country Status (1)

Country Link
CN (1) CN112506520A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114020260A (en) * 2021-11-17 2022-02-08 上海布鲁可积木科技有限公司 Instruction array analysis method and system suitable for entity building block programming and toy

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140297035A1 (en) * 2013-04-01 2014-10-02 Tufts University Educational robotic systems and methods
CN108806405A (en) * 2018-06-28 2018-11-13 山东师范大学 A kind of material objectization children program building blocks and its application method
CN110134382A (en) * 2019-04-12 2019-08-16 乐芒(广州)信息技术有限公司 A kind of material objectization programmed method
CN111240242A (en) * 2020-01-14 2020-06-05 山东师范大学 Materialized programming system and method
CN111722838A (en) * 2020-06-14 2020-09-29 杭州优必学科技有限公司 Programming device for controlling robot movement based on color recognition
CN111897256A (en) * 2020-07-16 2020-11-06 深圳市科科萌科技有限公司 Children programming control system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140297035A1 (en) * 2013-04-01 2014-10-02 Tufts University Educational robotic systems and methods
CN108806405A (en) * 2018-06-28 2018-11-13 山东师范大学 A kind of material objectization children program building blocks and its application method
CN110134382A (en) * 2019-04-12 2019-08-16 乐芒(广州)信息技术有限公司 A kind of material objectization programmed method
CN111240242A (en) * 2020-01-14 2020-06-05 山东师范大学 Materialized programming system and method
CN111722838A (en) * 2020-06-14 2020-09-29 杭州优必学科技有限公司 Programming device for controlling robot movement based on color recognition
CN111897256A (en) * 2020-07-16 2020-11-06 深圳市科科萌科技有限公司 Children programming control system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114020260A (en) * 2021-11-17 2022-02-08 上海布鲁可积木科技有限公司 Instruction array analysis method and system suitable for entity building block programming and toy

Similar Documents

Publication Publication Date Title
CN109634592A (en) Graphical Python programming exchange method, system and electronic equipment
US11113439B2 (en) Trigger-action-circuits: leveraging generative design to enable novices to design and build circuitry
CN103456203A (en) Portable physical programming method and system
CN108563433A (en) A kind of device based on LSTM auto-complete codes
CN101634940A (en) Method for developing computer games through scripts
CN106648662A (en) Engineering cost calculation description language BCL-based report generation device and generation method
KR100679634B1 (en) Educational system for drawing up icon-based robot control program and its method
CN112506520A (en) System and method for judging grammar error of physical programming language
CN107168696B (en) Automatic optimization method for graphical programming control layout
Arakliotis et al. Lawris: A rule-based Arduino programming system for young students
TW202111610A (en) Techniques for defining and executing program code specifying neural network architectures
CN118131919A (en) Keyboard control method, device, system and storage medium
US20160062738A1 (en) Methods and Apparatuses for Interactive Computer Programming
CN102521011A (en) Simulator generation method and simulator generation device
Homer et al. A tile-based editor for a textual programming language
CN110874215B (en) Drive control method and system for electric appliance or electric equipment
CN103631228A (en) Control system virtualization method
CN102254469A (en) Experimental device based on embedded development platform
CN115248570A (en) Development environment and management development operation method of compiling programmable logic controller
CN110026983B (en) Robot programming system
Wolfberg An interactive graph theory system
CN112527283A (en) Quantum computation simulation tool set
Saini et al. Arduino Solutions Handbook: Design interesting DIY projects using Arduino Uno, C and C++ (English Edition)
KR101979122B1 (en) Identifing block and apparatus comprising identifing block
CN201751923U (en) Experimental apparatus based on embedded development platform

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