CN112463139A - Programming method and device based on electronic building blocks, electronic equipment and storage medium - Google Patents
Programming method and device based on electronic building blocks, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN112463139A CN112463139A CN202011324864.0A CN202011324864A CN112463139A CN 112463139 A CN112463139 A CN 112463139A CN 202011324864 A CN202011324864 A CN 202011324864A CN 112463139 A CN112463139 A CN 112463139A
- Authority
- CN
- China
- Prior art keywords
- building block
- target
- assembly
- electronic
- mark
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000011144 upstream manufacturing Methods 0.000 claims description 37
- 239000011449 brick Substances 0.000 claims description 19
- 230000009471 action Effects 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 6
- 230000000875 corresponding effect Effects 0.000 description 10
- 238000012545 processing Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 235000019800 disodium phosphate Nutrition 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/34—Graphical or visual programming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/35—Creation or generation of source code model driven
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
Abstract
The application provides a programming method and device based on electronic building blocks, electronic equipment and a storage medium, and relates to the technical field of computers. The method can be applied to terminal equipment, a graphical user interface is displayed through the terminal equipment, the graphical user interface comprises a building block programming interface, and the method comprises the following steps: acquiring a target building block combination, wherein the target building block combination comprises at least one electronic building block, and a part of program codes are integrated in the electronic building block; according to the target building block combination, compiling is carried out to generate the assembly code, and the assembly code is displayed on the building block programming interface.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a programming method and apparatus based on electronic bricks, an electronic device, and a storage medium.
Background
The electronic building block expresses the programming in the form of a virtual building block, and realizes the packaging processing of the content of the program. In practical application, specific functions can be realized by combining the electronic building blocks, and the electronic building block has the characteristics of simplicity in realization and easiness in operation.
Machine instructions can be generated by performing combined programming on the electronic building blocks, and the machine instructions can be used for instructing hardware devices to perform corresponding actions to realize corresponding functions.
However, in the existing programming mode, the generated machine instruction has the problem of poor readability for users, and the operability of the users is poor.
Disclosure of Invention
An object of the present application is to provide a programming method, an apparatus, an electronic device and a storage medium based on electronic building blocks, which can compile and generate an assembly code according to a program code integrated by the target building block combination, and display the assembly code on a building block programming interface, thereby improving readability, facilitating a user to better understand a working principle of a hardware device based on the assembly code, and improving programming experience of the user.
In order to achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
in a first aspect, an embodiment of the present invention provides a programming method based on electronic building blocks, which is applied to a terminal device, and displays a graphical user interface through the terminal device, where the graphical user interface includes a building block programming interface, and the method includes:
acquiring a target building block combination, wherein the target building block combination comprises at least one electronic building block, and a part of program codes are integrated in the electronic building block;
compiling and generating assembly codes according to the target building block combination, and displaying the assembly codes on the building block programming interface.
In an optional embodiment, after the compiling generates assembly code according to the target block combination and the assembly code is displayed on the block programming interface, the method further includes:
generating a machine instruction code according to the assembly code, wherein the machine instruction code is a target device recognizable code;
and sending the machine instruction code to the target equipment so as to enable the target equipment to execute a target action according to the machine instruction code.
In an optional embodiment, the compiling to generate assembly code according to the target block combination includes:
acquiring an upstream building block mark and a downstream building block mark of each electronic building block in the target building block combination according to the target building block combination, wherein the upstream building block mark is used for indicating the starting position of the program code of the electronic building block, and the downstream building block mark is used for indicating the ending position of the program code of the electronic building block;
and determining an assembly jump mark according to the target building block combination and the upstream building block mark and the downstream building block mark of each electronic building block in the target building block combination, and generating an assembly code, wherein the assembly jump mark is used for indicating a jump address of a target device.
In an alternative embodiment, the generating machine instruction code from the assembly code includes:
determining a machine skip mark according to the assembly skip mark;
and generating a machine instruction code according to the assembly code and the machine jump mark.
In an alternative embodiment, the target building block set comprises at least one of the following categories of building blocks: sequential building blocks, branch building blocks and loop building blocks.
In an alternative embodiment, when the target block set includes a loop block, the obtaining an upstream block flag and a downstream block flag of each electronic block in the target block set according to the target block set includes:
acquiring the cycle times of the circulating building blocks and the marks of the upstream building blocks and the downstream building blocks of the circulating building blocks according to the circulating building blocks;
accordingly, determining an assembly jump flag according to a target block combination, an upstream block flag and a downstream block flag of each electronic block in the target block combination, and generating an assembly code, includes:
increasing a counting mark according to the circulation times of the circulation building blocks;
determining an assembly jump mark according to an upstream building block mark and a downstream building block mark of the loop building block;
and compiling to generate assembly codes according to the loop building blocks, the counting marks and the assembly jump marks.
In a second aspect, an embodiment of the present invention provides a programming device based on electronic building blocks, which is applied to a terminal device, and displays a graphical user interface through the terminal device, where the graphical user interface includes a building block programming interface, and the device includes: the device comprises an acquisition module and a display module;
the acquisition module is used for acquiring a target building block combination, the target building block combination comprises at least one electronic building block, and a part of program codes are integrated in the electronic building block;
and the display module is used for compiling and generating assembly codes according to the target building block combination and displaying the assembly codes on the building block programming interface.
In an alternative embodiment, the apparatus further comprises: the sending module is used for generating a machine instruction code according to the assembly code, wherein the machine instruction code is a target equipment recognizable code; and sending the machine instruction code to the target equipment so as to enable the target equipment to execute a target action according to the machine instruction code.
In an alternative embodiment, the display module is specifically configured to obtain, according to the target block combination, an upstream block mark and a downstream block mark of each electronic block in the target block combination, where the upstream block mark is used to indicate a start position of a program code of the electronic block, and the downstream block mark is used to indicate an end position of the program code of the electronic block;
and determining an assembly jump mark according to the target building block combination and the upstream building block mark and the downstream building block mark of each electronic building block in the target building block combination, and generating an assembly code, wherein the assembly jump mark is used for indicating a jump address of a target device.
In an optional embodiment, the sending module is specifically configured to determine a machine skip flag according to the assembly skip flag;
and generating a machine instruction code according to the assembly code and the machine jump mark.
In an alternative embodiment, the target building block set comprises at least one of the following categories of building blocks: sequential building blocks, branch building blocks and loop building blocks.
In an alternative embodiment, when the target building block combination comprises a loop building block, the display module is specifically configured to obtain the loop times of the loop building block, and an upstream building block mark and a downstream building block mark of the loop building block according to the loop building block;
increasing a counting mark according to the circulation times of the circulation building blocks;
determining an assembly jump mark according to an upstream building block mark and a downstream building block mark of the loop building block;
and compiling to generate assembly codes according to the loop building blocks, the counting marks and the assembly jump marks.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, when the electronic device runs, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to execute the steps of the electronic building block-based programming method according to any one of the preceding embodiments.
In a fourth aspect, an embodiment of the present invention provides a storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the electronic building block-based programming method according to any one of the foregoing embodiments.
The beneficial effect of this application is:
the programming method, the programming device, the electronic equipment and the storage medium based on the electronic building blocks, which are provided by the embodiment of the application, can be applied to terminal equipment, and the graphical user interface is displayed through the terminal equipment and comprises a building block programming interface, and the method comprises the following steps: acquiring a target building block combination, wherein the target building block combination comprises at least one electronic building block, and a part of program codes are integrated in the electronic building block; according to the target building block combination, compiling is carried out to generate the assembly code, and the assembly code is displayed on the building block programming interface.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flowchart of a programming method based on electronic bricks according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of another programming method based on electronic bricks according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another programming method based on electronic bricks according to an embodiment of the present disclosure;
FIG. 4 is a schematic flow chart of another programming method based on electronic bricks according to an embodiment of the present disclosure;
fig. 5 is a schematic flowchart of another programming method based on electronic bricks according to an embodiment of the present disclosure;
fig. 6 is a schematic functional block diagram of a programming device based on electronic bricks according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of functional blocks of another programming device based on electronic bricks according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Aiming at the problems that the generated machine instruction has poor readability and poor user operability for a user when the existing electronic building block-based programming is carried out, the embodiment of the application provides a programming method based on the electronic building block, and the method can display assembly codes corresponding to the electronic building block on a building block programming interface, so that the readability of the user can be improved, the user can understand the working principle of hardware equipment better, and the operability of the user is improved.
Fig. 1 is a schematic flowchart of a programming method based on electronic building blocks, which may be applied to a terminal device, where the terminal device may be a computer, a mobile phone, a tablet computer, or the like, and a Graphical User Interface (GUI) may be displayed by the terminal device, where the GUI may include a building block programming Interface. As shown in fig. 1, the method may include:
s101, obtaining a target building block combination, wherein the target building block combination comprises at least one electronic building block, and a part of program codes are integrated in the electronic building block.
In some embodiments, a user may obtain at least one electronic building block through clicking, long-pressing, dragging and the like on a building block programming interface based on a touch screen of a terminal device, and use the at least one electronic building block as a target building block combination, where the electronic building block may be integrated with a part of program code. It will be appreciated that when a plurality of electronic bricks are obtained, the plurality of electronic bricks may be combined to generate a target brick combination. Of course, the number of electronic blocks in the target block combination is not limited in this application, and may include 3, 5, or 10, etc. according to the actual application scenario.
And S102, compiling to generate assembly codes according to the target building block combination, and displaying the assembly codes on a building block programming interface.
After the target building block combination is obtained, the assembly code can be compiled according to the program code integrated by the target building block combination to generate the assembly code, and the assembly code is displayed on a building block programming interface. It can be understood that, based on the displayed assembly code, the user may update (e.g., add, delete, etc.) the target block combination to implement different functions, so that the user operability may be improved.
Optionally, the building block programming interface may include an assembly control, and after the target building block combination is obtained, the user may act on the assembly control by clicking, long pressing, or the like based on the touch screen, so as to compile and generate an assembly code. In some embodiments, the assembly control may instruct a programming language Compiler, such as GNU C Compiler (GCC), to act on the assembly control, that is, to invoke the programming language Compiler instructed by the assembly control to program the target block assembly to generate assembly code. Of course, the present application is not limited to the specific implementation.
Alternatively, the hardware device may include a single chip, a Field Programmable Gate Array (FPGA), a microprocessor (DSP), and other data processing units, which are not limited herein. It will be appreciated that the assembly instructions in the assembly code may differ from data processing unit to data processing unit. Assembly instructions may include, but are not limited to, input output instructions, transfer instructions, shift instructions, control transfer instructions, bit manipulation instructions, logical operation instructions, and the like.
In some embodiments, the block programming interface may include an electronic block area, which may display at least one electronic block, a programming area, which may be used to display a target block combination, and an assembly code display area, which may be used to display an assembly code for the target block combination, according to the functional partitioning. Optionally, a user may select a plurality of electronic building blocks in an electronic building block area by clicking, long-pressing, dragging and the like based on a touch screen of the terminal device, combine the plurality of electronic building blocks in a programming area to generate a target building block combination, obtain the target building block combination, compile to generate an assembly code according to the target building block combination, and display the generated assembly code in an assembly code display area.
To sum up, the programming method based on electronic building blocks provided by the embodiment of the present application may be applied to a terminal device, and a graphical user interface is displayed by the terminal device, where the graphical user interface includes a building block programming interface, and the method includes: acquiring a target building block combination, wherein the target building block combination comprises at least one electronic building block, and a part of program codes are integrated in the electronic building block; according to the target building block combination, compiling is carried out to generate the assembly code, and the assembly code is displayed on the building block programming interface.
Fig. 2 is a schematic flowchart of another programming method based on electronic bricks according to an embodiment of the present disclosure. Optionally, as shown in fig. 2, after compiling the generated assembly code according to the target block combination and displaying the assembly code on the block programming interface, the method further includes:
s201, generating a machine instruction code according to the assembly code, wherein the machine instruction code is a target device recognizable code.
S202, sending the machine instruction code to the target device so that the target device executes the target action according to the machine instruction code.
The target device may include the foregoing data processing units such as the single chip, the FPGA, and the DSP, and according to an actual application scenario, the target device may further include other external units, such as an LED lamp, a buzzer, a voice module, a wireless module, a video module, and a sensor unit, which are not limited herein. Alternatively, the target device may be applied to an industrial field, an educational field, etc., according to an application scenario of the target device, which is not limited herein. In some embodiments, the target device may be applied as a robot in different scenarios, such as, but not limited to, a handling robot, a loading and unloading robot, a voice robot, a dancing robot, and the like.
The obtained assembly code may be further compiled to generate a machine instruction code according to different target devices, where the machine instruction code is a target device recognizable code, and may be a set of binary numbers, hexadecimal numbers, and the like, which is not limited herein, so that when the target device acquires the machine instruction code, a target action may be executed according to the machine instruction code. In some embodiments, the terminal device may send the machine instruction code to the target device wirelessly, by wire, and the like, which is not limited herein. For example, when the target device is a voice robot, in some embodiments, the voice robot may play a piece of music or the like according to the obtained machine instruction code, but not limited thereto.
Of course, it should be noted that the machine instruction codes may also be displayed on the building block programming interface according to the actual application scenario. Optionally, during displaying, each line of assembly codes may correspondingly display a corresponding machine instruction code, so that a user can associate the assembly codes, the machine instruction codes and the realized target actions, and better understand the working principle of the hardware device. Of course, the display mode is not limited to this, and the user can set the display mode according to the actual application scenario.
Fig. 3 is a schematic flowchart of another programming method based on electronic bricks according to an embodiment of the present application. Optionally, as shown in fig. 3, the compiling to generate assembly code according to the target building block combination includes:
s301, according to the target building block combination, an upstream building block mark and a downstream building block mark of each electronic building block in the target building block combination are obtained, wherein the upstream building block mark is used for indicating the starting position of the program code of the electronic building block, and the downstream building block mark is used for indicating the ending position of the program code of the electronic building block.
When the target building block combination comprises at least one electronic building block, when the target building block combination is compiled to generate an assembly code, an upstream building block mark and a downstream building block mark of each electronic building block in the target building block combination can be obtained, and a starting position and an ending position of a program code integrated by each electronic building block are obtained through the upstream building block mark and the downstream building block mark.
S302, according to the target building block combination and the upstream building block mark and the downstream building block mark of each electronic building block in the target building block combination, determining an assembly jump mark and generating an assembly code.
The assembly jump mark is used for indicating a jump address of the target device, and can correspond to different assembly jump marks according to different target devices. When the assembly code is generated, the corresponding assembly code may be generated according to the program code integrated by each electronic building block in the target building block combination, and the upstream building block mark and the downstream building block mark of each electronic building block, wherein the assembly code may include one or more assembly jump marks, and the number of the assembly jump marks is not limited herein.
Fig. 4 is a schematic flowchart of another programming method based on electronic bricks according to an embodiment of the present disclosure. Optionally, as shown in fig. 4, the generating the machine instruction code according to the assembly code includes:
s401, determining a machine jump mark according to the assembly jump mark.
And S402, generating a machine instruction code according to the assembly code and the machine jump mark.
The machine instruction code is a code which can be identified by the target equipment, and when the machine instruction code is generated, the corresponding machine jump mark can be determined according to the assembly jump mark, namely the assembly jump mark is converted into the machine jump mark which can be identified by the target equipment. It is understood that, further, according to the machine jump flag and the assembly code, a machine instruction code may be compiled, the machine instruction code may be a set of binary numbers, hexadecimal numbers, etc., and the category of the code may be different according to the target device, which is not limited herein, so that the target device may perform the target action according to the machine instruction code.
Optionally, the target building block combination may include at least one of the following types of building blocks: sequential building blocks, branch building blocks and loop building blocks.
The target building block combination can comprise one or more of sequential building blocks, branch building blocks and circulation building blocks, and each building block can comprise at least one electronic building block.
For the sequential building blocks, the program codes integrated by the sequential building blocks can be sequentially executed according to the sequence of the codes; for a branch building block, the program code integrated by the branch building block may be judged according to specific logical operations, and different codes are executed according to the judgment result, for example, the program code integrated by the branch building block may include if statements and switch statements, but is not limited thereto; for the loop building block, the program code integrated by the loop building block can repeatedly execute a certain section of program code under the condition that the loop condition is met, the repeatedly executed code can be called a loop body statement, and the loop can be ended under the condition that the loop condition is not met.
For example, the target building block set may include a first sequential building block including 3 electronic building blocks, a loop building block including 5 electronic building blocks, and a second sequential building block including 2 electronic building blocks, and in some embodiments, the program code integrated with the first sequential building block may be executed first, then the program code integrated with the loop building block, and finally the program code integrated with the second sequential building block may be executed during execution. Of course, the number of electronic blocks included in each block is not limited in this application, and may be different according to the actual application scenario.
Optionally, when the target block combination includes a loop block, the obtaining an upstream block mark and a downstream block mark of each electronic block in the target block combination according to the target block combination includes:
according to the loop building block, the loop times of the loop building block, and the upstream building block mark and the downstream building block mark of the loop building block are obtained.
Wherein, for the loop building block, an upstream building block mark and a downstream building block mark of the loop building block can be obtained, wherein the upstream building block mark of the loop building block can indicate the starting position of the loop body program code of the loop building block, and the downstream building block mark of the loop building block can indicate the ending position of the loop body program code of the loop building block. It is to be appreciated that the loop building blocks can include loop conditions, and thus, the number of loops (e.g., 3, 5, etc. loops) can be determined based on the loop conditions.
Fig. 5 is a schematic flowchart of another programming method based on electronic bricks according to an embodiment of the present application. As shown in fig. 5, determining the assembly jump flag and generating the assembly code according to the target block combination, the upstream block flag and the downstream block flag of each electronic block in the target block combination, includes:
and S501, increasing a counting mark according to the circulation times of the circulation building blocks.
S502, according to the upstream building block mark and the downstream building block mark of the loop building block, determining an assembly jump mark.
When the cycle times of the loop building blocks are acquired, the counting marks of the assembly codes can be increased to indicate the cycle times of the assembly codes corresponding to the loop building blocks; accordingly, from the upstream building block tags and the downstream building block tags of the loop building blocks, a compiled jump tag can be determined, by which the jump address of the target device is indicated.
And S503, compiling to generate assembly codes according to the loop building blocks, the counting marks and the assembly jump marks.
Based on the counting mark and the assembly jump mark, when the assembly code is generated according to the loop building block, the counting mark and the assembly jump mark, the counting mark and the machine jump mark of the machine instruction code can be determined according to the counting mark and the assembly jump mark, and then the machine instruction code can be determined according to the assembly code, the counting mark and the machine jump mark of the machine instruction code.
Based on the above embodiments, it can be understood that assembly codes can be generated by compiling according to target building block combinations, and the assembly codes can be displayed on a building block programming interface; therefore, based on the programming method based on the electronic building block provided by the embodiment of the application, the readability of a user can be improved by displaying the assembly codes on the building block programming interface, and the user can fully understand the working principle of the hardware device according to the corresponding relation between the assembly codes and the machine instruction codes, so that the user can conveniently debug and further learn to realize other functions and the like.
Fig. 6 is a functional block diagram of a programming device based on electronic bricks according to an embodiment of the present application, the basic principle and the technical effect of the device are the same as those of the corresponding method embodiment, and for a brief description, the corresponding contents in the method embodiment may be referred to for the parts not mentioned in this embodiment. The programming apparatus may be applied to a terminal device through which a graphical user interface including a building block programming interface is displayed, as shown in fig. 6, and the programming apparatus 100 includes: an acquisition module 110 and a display module 120.
An obtaining module 110, configured to obtain a target block combination, where the target block combination includes at least one electronic block, and the electronic block is integrated with a part of program codes;
and the display module 120 is used for compiling and generating assembly codes according to the target building block combination and displaying the assembly codes on the building block programming interface.
Fig. 7 is a schematic functional block diagram of another programming device based on electronic bricks according to an embodiment of the present application. In an alternative embodiment, as shown in fig. 7, the programming apparatus 100 further includes: a sending module 130, configured to generate a machine instruction code according to the assembly code, where the machine instruction code is a target device recognizable code; and sending the machine instruction code to the target equipment so that the target equipment executes the target action according to the machine instruction code.
In an alternative embodiment, the display module 120 is specifically configured to obtain, according to a target block combination, an upstream block mark and a downstream block mark of each electronic block in the target block combination, where the upstream block mark is used to indicate a start position of a program code of the electronic block, and the downstream block mark is used to indicate an end position of the program code of the electronic block; and determining an assembly jump mark according to the target building block combination and the upstream building block mark and the downstream building block mark of each electronic building block in the target building block combination, and generating an assembly code, wherein the assembly jump mark is used for indicating a jump address of the target device.
In an alternative embodiment, the sending module 130 is specifically configured to determine the machine jump flag according to the assembly jump flag; and generating a machine instruction code according to the assembly code and the machine jump mark.
In an alternative embodiment, the target building block set comprises at least one of the following categories of building blocks: sequential building blocks, branch building blocks and loop building blocks.
In an alternative embodiment, when the target building block combination includes a loop building block, the display module 120 is specifically configured to obtain the loop number of the loop building block, and an upstream building block flag and a downstream building block flag of the loop building block according to the loop building block; increasing a counting mark according to the circulation times of the circulation building blocks; determining an assembly jump mark according to an upstream building block mark and a downstream building block mark of the loop building block; and compiling to generate assembly codes according to the loop building blocks, the counting marks and the assembly jump marks.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 8, the electronic device may include: a processor 210, a storage medium 220, and a bus 230, wherein the storage medium 220 stores machine-readable instructions executable by the processor 210, and when the electronic device is operated, the processor 210 communicates with the storage medium 220 via the bus 230, and the processor 210 executes the machine-readable instructions to perform the steps of the above-mentioned method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program performs the steps of the above method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or 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.
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, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods 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.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims (10)
1. A programming method based on electronic building blocks is applied to terminal equipment, a graphical user interface is displayed through the terminal equipment, the graphical user interface comprises a building block programming interface, and the method is characterized by comprising the following steps:
acquiring a target building block combination, wherein the target building block combination comprises at least one electronic building block, and a part of program codes are integrated in the electronic building block;
compiling and generating assembly codes according to the target building block combination, and displaying the assembly codes on the building block programming interface.
2. The method of claim 1, wherein compiling generates assembly code based on the target building block combination, and after the assembly code is displayed by the building block programming interface, the method further comprises:
generating a machine instruction code according to the assembly code, wherein the machine instruction code is a target device recognizable code;
and sending the machine instruction code to the target equipment so as to enable the target equipment to execute a target action according to the machine instruction code.
3. The method of claim 2, wherein compiling to generate assembly code based on the target building block combination comprises:
acquiring an upstream building block mark and a downstream building block mark of each electronic building block in the target building block combination according to the target building block combination, wherein the upstream building block mark is used for indicating the starting position of the program code of the electronic building block, and the downstream building block mark is used for indicating the ending position of the program code of the electronic building block;
and determining an assembly jump mark according to the target building block combination and the upstream building block mark and the downstream building block mark of each electronic building block in the target building block combination, and generating an assembly code, wherein the assembly jump mark is used for indicating a jump address of a target device.
4. The method of claim 3, wherein generating machine instruction code from the assembly code comprises:
determining a machine skip mark according to the assembly skip mark;
and generating a machine instruction code according to the assembly code and the machine jump mark.
5. The method of claim 3, wherein the target building block set comprises at least one of the following categories of building blocks: sequential building blocks, branch building blocks and loop building blocks.
6. The method of claim 5, wherein when the target block set includes a loop block, the obtaining an upstream block flag and a downstream block flag for each of the electronic blocks in the target block set based on the target block set comprises:
acquiring the cycle times of the circulating building blocks and the marks of the upstream building blocks and the downstream building blocks of the circulating building blocks according to the circulating building blocks;
accordingly, determining an assembly jump flag based on the target block combination, the upstream block flag and the downstream block flag of each of the electronic blocks in the target block combination, and generating an assembly code, comprises:
increasing a counting mark according to the circulation times of the circulation building blocks;
determining an assembly jump mark according to an upstream building block mark and a downstream building block mark of the loop building block;
and compiling to generate assembly codes according to the loop building blocks, the counting marks and the assembly jump marks.
7. A programming device based on electronic building blocks is applied to terminal equipment, a graphical user interface is displayed through the terminal equipment, the graphical user interface comprises a building block programming interface, and the device is characterized by comprising: the device comprises an acquisition module and a display module;
the acquisition module is used for acquiring a target building block combination, the target building block combination comprises at least one electronic building block, and a part of program codes are integrated in the electronic building block;
and the display module is used for compiling and generating assembly codes according to the target building block combination and displaying the assembly codes on the building block programming interface.
8. The apparatus of claim 7, further comprising: the sending module is used for generating a machine instruction code according to the assembly code, wherein the machine instruction code is a target equipment recognizable code; and sending the machine instruction code to the target equipment so as to enable the target equipment to execute a target action according to the machine instruction code.
9. An electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating via the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the steps of the electronic brick-based programming method according to any of claims 1-6.
10. A storage medium, characterized in that it has stored thereon a computer program which, when being executed by a processor, carries out the steps of the method for programming based on electronic bricks according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011324864.0A CN112463139B (en) | 2020-11-23 | 2020-11-23 | Programming method and device based on electronic building blocks, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011324864.0A CN112463139B (en) | 2020-11-23 | 2020-11-23 | Programming method and device based on electronic building blocks, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112463139A true CN112463139A (en) | 2021-03-09 |
CN112463139B CN112463139B (en) | 2024-04-02 |
Family
ID=74798533
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011324864.0A Active CN112463139B (en) | 2020-11-23 | 2020-11-23 | Programming method and device based on electronic building blocks, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112463139B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112965709A (en) * | 2021-04-06 | 2021-06-15 | 乐聚(深圳)机器人技术有限公司 | Building block generation method, building block generation device, building block generation equipment and storage medium |
CN113570944A (en) * | 2021-05-17 | 2021-10-29 | 海南师范大学 | Intelligent teaching aid control system and method for building block programming learning |
CN116841564A (en) * | 2023-08-29 | 2023-10-03 | 腾讯科技(深圳)有限公司 | Data processing method, device, equipment and computer readable storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040148595A1 (en) * | 2003-01-29 | 2004-07-29 | Sandeep Dutta | System and method for transformation of assembly code for conditional execution |
CN202650333U (en) * | 2012-04-05 | 2013-01-02 | 李卫红 | Cordwood system type programming language device |
CN103197929A (en) * | 2013-03-25 | 2013-07-10 | 中国科学院软件研究所 | System and method for graphical programming facing children |
KR101724230B1 (en) * | 2016-03-03 | 2017-04-06 | 전석주 | An electronic block kit system for scratch programming |
CN107278290A (en) * | 2017-05-16 | 2017-10-20 | 深圳市创客工场科技有限公司 | Building block system programs the method and device for being converted into program code |
US20180173503A1 (en) * | 2017-02-19 | 2018-06-21 | Mehrdad Ghasmizadeh | System and method for graphical programming |
CN108525325A (en) * | 2018-04-24 | 2018-09-14 | 深圳小西科技有限公司 | A kind of building block system instruction module, host apparatus and modular system |
US20180285084A1 (en) * | 2017-04-03 | 2018-10-04 | Innovation First, Inc. | Mixed mode programming |
CN110825378A (en) * | 2019-09-17 | 2020-02-21 | 秦皇岛米格教育科技有限公司 | Programming system and control system based on program building blocks |
-
2020
- 2020-11-23 CN CN202011324864.0A patent/CN112463139B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040148595A1 (en) * | 2003-01-29 | 2004-07-29 | Sandeep Dutta | System and method for transformation of assembly code for conditional execution |
CN202650333U (en) * | 2012-04-05 | 2013-01-02 | 李卫红 | Cordwood system type programming language device |
CN103197929A (en) * | 2013-03-25 | 2013-07-10 | 中国科学院软件研究所 | System and method for graphical programming facing children |
KR101724230B1 (en) * | 2016-03-03 | 2017-04-06 | 전석주 | An electronic block kit system for scratch programming |
US20180173503A1 (en) * | 2017-02-19 | 2018-06-21 | Mehrdad Ghasmizadeh | System and method for graphical programming |
US20180285084A1 (en) * | 2017-04-03 | 2018-10-04 | Innovation First, Inc. | Mixed mode programming |
CN107278290A (en) * | 2017-05-16 | 2017-10-20 | 深圳市创客工场科技有限公司 | Building block system programs the method and device for being converted into program code |
WO2018209558A1 (en) * | 2017-05-16 | 2018-11-22 | 深圳市创客工场科技有限公司 | Method and apparatus for use in converting building block programming into program code |
CN108525325A (en) * | 2018-04-24 | 2018-09-14 | 深圳小西科技有限公司 | A kind of building block system instruction module, host apparatus and modular system |
CN110825378A (en) * | 2019-09-17 | 2020-02-21 | 秦皇岛米格教育科技有限公司 | Programming system and control system based on program building blocks |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112965709A (en) * | 2021-04-06 | 2021-06-15 | 乐聚(深圳)机器人技术有限公司 | Building block generation method, building block generation device, building block generation equipment and storage medium |
CN113570944A (en) * | 2021-05-17 | 2021-10-29 | 海南师范大学 | Intelligent teaching aid control system and method for building block programming learning |
CN116841564A (en) * | 2023-08-29 | 2023-10-03 | 腾讯科技(深圳)有限公司 | Data processing method, device, equipment and computer readable storage medium |
CN116841564B (en) * | 2023-08-29 | 2023-11-14 | 腾讯科技(深圳)有限公司 | Data processing method, device, equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112463139B (en) | 2024-04-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112463139A (en) | Programming method and device based on electronic building blocks, electronic equipment and storage medium | |
US7266809B2 (en) | Software debugger and software development support system for microcomputer operable to execute conditional execution instruction | |
CN109847359B (en) | Level editing method, level editing device, terminal and storage medium | |
CN108376073A (en) | A kind of test software packet generation method and terminal | |
JP2015043198A (en) | Analysis system, analysis method and analysis program | |
CN108345451B (en) | Continuous function diagram programming method | |
CN103472743A (en) | Visualized step programming method | |
CN107203465A (en) | System interface method of testing and device | |
JP2008293138A (en) | Software development support program and software development support method | |
CN101120321A (en) | Debug device, debug method, and program | |
CN113407255A (en) | Component calling method and device and computer readable storage medium | |
CN109074336A (en) | For transmitting the system and method being programmed to the data in microcontroller | |
CN106952426B (en) | Data processing method and device | |
JP5800135B2 (en) | Programmable controller | |
JP5849592B2 (en) | Programmable controller system, programming device thereof, programmable controller, program, and debugging method | |
JP2012027639A (en) | Programmable controller and debug method of programmable controller | |
KR20130020135A (en) | System and method of providing the developer list of developing code simultaneously in an integrated development environment | |
TWI525606B (en) | Information supply method and system and word string supply system | |
CN111625221B (en) | Version control method, device, equipment and medium applied to integrated development environment | |
JP5422963B2 (en) | Software development support system, development support method and program | |
CN105117243B (en) | A kind of method and apparatus for the startup time obtaining application program | |
CN114237557A (en) | Method for debugging logic system design, electronic device and storage medium | |
CN113419483A (en) | Method and device for displaying equipment state, terminal and storage medium | |
JP2017130084A (en) | Electronic device and display program | |
JP5589670B2 (en) | How to debug |
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 |