CN112463139B - 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 PDF

Info

Publication number
CN112463139B
CN112463139B CN202011324864.0A CN202011324864A CN112463139B CN 112463139 B CN112463139 B CN 112463139B CN 202011324864 A CN202011324864 A CN 202011324864A CN 112463139 B CN112463139 B CN 112463139B
Authority
CN
China
Prior art keywords
building block
target
mark
assembly
electronic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011324864.0A
Other languages
Chinese (zh)
Other versions
CN112463139A (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.)
Leju Shenzhen Robotics Co Ltd
Original Assignee
Leju Shenzhen Robotics 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 Leju Shenzhen Robotics Co Ltd filed Critical Leju Shenzhen Robotics Co Ltd
Priority to CN202011324864.0A priority Critical patent/CN112463139B/en
Publication of CN112463139A publication Critical patent/CN112463139A/en
Application granted granted Critical
Publication of CN112463139B publication Critical patent/CN112463139B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Programmable Controllers (AREA)

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, and a graphical user interface is displayed through the terminal equipment, wherein the graphical user interface comprises a building block programming interface, and the method comprises the following steps: obtaining a target building block combination, wherein the target building block combination comprises at least one electronic building block, and partial program codes are integrated in the electronic building block; according to the target building block combination, compiling and generating assembly codes, and displaying the assembly codes on a building block programming interface.

Description

Programming method and device based on electronic building blocks, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a programming method and apparatus based on electronic building blocks, an electronic device, and a storage medium.
Background
The electronic building blocks are used for representing programming in the form of virtual building blocks, so that the content of the program can be packaged. During practical application, specific functions can be realized by combining the electronic building blocks, and the electronic building blocks have the characteristics of simplicity in realization and easiness in hand lifting.
In the prior art, 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 execute corresponding actions so as to realize corresponding functions.
However, in the existing programming mode, the generated machine instruction has the problem of poor reading performance for users, and the operability of the users is poor.
Disclosure of Invention
The invention aims to overcome the defects in the prior art, and provides a programming method, a programming device, electronic equipment and a storage medium based on electronic building blocks, which can compile and generate assembly codes according to program codes integrated by the target building blocks, display the assembly codes on a building block programming interface, improve the readability, facilitate users to better understand the working principle of hardware equipment based on the assembly codes, and improve the programming experience of users.
In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
in a first aspect, an embodiment of the present invention provides a programming method based on electronic building blocks, applied to a terminal device, where a graphical user interface is displayed through the terminal device, where the graphical user interface includes a building block programming interface, and the method includes:
obtaining a target building block combination, wherein the target building block combination comprises at least one electronic building block, and the electronic building block is integrated with partial program codes;
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 compiling generates assembly code according to the target building block combination, and after the building block programming interface displays the assembly code, the method further includes:
generating a machine instruction code according to the assembly code, wherein the machine instruction code is a target equipment identifiable code;
and sending the machine instruction code to the target equipment so that the target equipment executes target actions according to the machine instruction code.
In an optional embodiment, the compiling to generate the assembly code according to the target building block combination includes:
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;
and determining an assembly jump mark according to the target building block combination, 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 the jump address of target equipment.
In an alternative embodiment, the generating machine instruction code according to the assembly code includes:
determining a machine jump mark according to the assembly jump mark;
and generating machine instruction codes according to the assembly codes and the machine jump marks.
In an alternative embodiment, the target building block combination includes building blocks of at least one of the following categories: sequential building blocks, branched building blocks, and cyclic building blocks.
In an optional embodiment, when the target building block combination includes a circulating building block, the obtaining, 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 includes:
acquiring the circulation times of the circulating building blocks, and the upstream building block marks and the downstream building block marks of the circulating building blocks according to the circulating building blocks;
correspondingly, the determining the assembly jump mark according to the target building block combination, the upstream building block mark and the downstream building block mark of each electronic building block in the target building block combination, and generating the assembly code comprises the following steps:
increasing a counting mark according to the cycle times of the circulating building blocks;
determining an assembly jump mark according to the upstream building block mark and the downstream building block mark of the circulating building block;
and compiling and generating assembly codes according to the circulating building blocks, the counting marks and the assembly jump marks.
In a second aspect, an embodiment of the present invention provides an electronic building block-based programming apparatus, applied to a terminal device, where a graphical user interface is displayed through the terminal device, where the graphical user interface includes a building block programming interface, and the apparatus includes: an acquisition module and a display module;
the acquisition module is used for acquiring a target building block combination, wherein the target building block combination comprises at least one electronic building block, and partial 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 identifiable code; and sending the machine instruction code to the target equipment so that the target equipment executes target actions according to the machine instruction code.
In an optional implementation manner, the display module is specifically configured to obtain, 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, where the upstream building block mark is used to indicate a start position of a program code of the electronic building block, and the downstream building block mark is used to indicate an end position of the program code of the electronic building block;
and determining an assembly jump mark according to the target building block combination, 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 the jump address of target equipment.
In an alternative embodiment, the sending module is specifically configured to determine a machine jump flag according to the assembly jump flag;
and generating machine instruction codes according to the assembly codes and the machine jump marks.
In an alternative embodiment, the target building block combination includes building blocks of at least one of the following categories: sequential building blocks, branched building blocks, and cyclic building blocks.
In an alternative embodiment, when the target building block combination includes a circulating building block, the display module is specifically configured to obtain, according to the circulating building block, a circulation number of the circulating building block, and an upstream building block mark and a downstream building block mark of the circulating building block;
increasing a counting mark according to the cycle times of the circulating building blocks;
determining an assembly jump mark according to the upstream building block mark and the downstream building block mark of the circulating building block;
and compiling and generating assembly codes according to the circulating 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, the storage medium storing machine-readable instructions executable by the processor, the processor in communication with the storage medium via the bus when the electronic device is running, the processor executing the machine-readable instructions to perform the steps of the electronic brick based programming method as described in any of the previous embodiments.
In a fourth aspect, embodiments of the present invention provide a storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the electronic building block based programming method according to any of the previous embodiments.
The beneficial effects of this application are:
the programming method, device, electronic equipment and storage medium based on the electronic building blocks, which are provided by the embodiment of the application, can be applied to terminal equipment, and a graphical user interface is displayed through the terminal equipment, wherein the graphical user interface comprises a building block programming interface, and the method comprises the following steps: obtaining a target building block combination, wherein the target building block combination comprises at least one electronic building block, and partial program codes are integrated in the electronic building block; according to the target building block combination, compiling and generating assembly codes, and displaying the assembly codes on a 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 needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered limiting the scope, and that other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a programming method based on electronic building blocks according to an embodiment of the present application;
fig. 2 is a schematic flow chart of another programming method based on electronic building blocks according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of another programming method based on electronic building blocks according to an embodiment of the present application;
fig. 4 is a flow chart of another programming method based on electronic building blocks according to an embodiment of the present application;
fig. 5 is a schematic flow chart of another programming method based on electronic building blocks according to an embodiment of the present application;
fig. 6 is a schematic functional block diagram of a programming device based on electronic building blocks according to an embodiment of the present application;
fig. 7 is a schematic functional block diagram of another programming device based on electronic building blocks according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of 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 apparent that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
Aiming at the problems that when the programming is carried out based on the electronic building blocks, the generated machine instruction has poor reading performance and poor user operability for users, the embodiment of the application provides the programming method based on the electronic building blocks, and the method can display assembly codes corresponding to the electronic building blocks on a building block programming interface, so that the reading performance of the users can be improved, the users can understand the working principle of hardware equipment better, and the operability of the users is improved.
Fig. 1 is a flow chart of a programming method based on electronic building blocks according to an embodiment of the present application, where the programming method may be applied to a terminal device, where the terminal device may be a computer, a mobile phone, a tablet computer, etc., and a graphical user interface (Graphical User Interface, GUI) may be displayed through the terminal device, and the graphical user interface may include a building block programming interface. As shown in fig. 1, the method may include:
s101, acquiring a target building block combination, wherein the target building block combination comprises at least one electronic building block, and the electronic building block is integrated with partial program codes.
The target building block combination may include at least one electronic building block, in some embodiments, the user may obtain at least one electronic building block based on the touch screen of the terminal device through clicking, long pressing, dragging, and the like, and use the at least one electronic building block as the target building block combination, where the electronic building block may be integrated with a part of program codes. 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 herein, and may include 3, 5, 10, etc. according to actual application scenarios.
S102, compiling and generating 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, compiling and generating assembly codes according to the program codes integrated by the target building block combination, and displaying the assembly codes on a building block programming interface, wherein it is understood that the assembly codes have better readability and flexibility compared with machine codes, so that a user can better understand the working principle of hardware equipment and programming experience of the user through displaying the assembly codes on the building block programming interface. It will be appreciated that based on the displayed assembly code, a user may update (e.g., add, delete, etc.) the target building block combination to implement different functions, thereby improving user operability.
Alternatively, the building block programming interface may include an assembly control that the user may apply by clicking, long pressing, etc. on the basis of the touch screen after the target building block combination is obtained, so as to compile and generate assembly code. In some embodiments, the assembly control may instruct a programming language Compiler, such as a GNU C language Compiler (GCC), to act on the assembly control, i.e., invoke the programming language Compiler instructed by the assembly control to program the target building block combination to generate assembly code. Of course, the present application is not limited to a particular implementation.
Alternatively, the hardware device may include a single chip microcomputer, a field programmable gate array (Field Programmable Gate Array, FPGA), a microprocessor (Digital Signal Processor, DSP), and other data processing units, which are not limited herein. It will be appreciated that the assembler instructions in the assembler code may be different depending on the data processing unit. The assembler instructions may include, but are not limited to, input output instructions, transfer instructions, shift instructions, control transfer instructions, bit manipulation instructions, logic operation instructions, and the like.
In some embodiments, according to the functional partitioning, the building block programming interface may include an electronic building block area, a programming area, and an assembly code display area, wherein the electronic building block area may display at least one electronic building block, the programming area may be used to display a target building block combination, and the assembly code display area may be used to display assembly code for the target building block combination. Optionally, the user can select a plurality of electronic bricks in the electronic brick area through clicking, long pressing, dragging and other modes based on the touch screen of the terminal equipment, the plurality of electronic bricks are combined in the programming area to generate a target brick combination, the target brick combination is obtained, the generated assembly codes are compiled and generated according to the target brick combination, and the generated assembly codes are displayed in the assembly code display area.
In summary, the method for programming based on electronic building blocks provided in the embodiments of the present application may be applied to a terminal device, and the terminal device displays a graphical user interface, where the graphical user interface includes a building block programming interface, and the method includes: obtaining a target building block combination, wherein the target building block combination comprises at least one electronic building block, and partial program codes are integrated in the electronic building block; according to the target building block combination, compiling and generating assembly codes, and displaying the assembly codes on a building block programming interface.
Fig. 2 is a flow chart of another programming method based on electronic building blocks according to an embodiment of the present application. Optionally, as shown in fig. 2, according to the target building block combination, compiling to generate assembly code, and after the building block programming interface displays the assembly code, the method further includes:
s201, generating a machine instruction code according to the assembly code, wherein the machine instruction code is a target equipment identifiable code.
S202, sending the machine instruction code to the target equipment so that the target equipment executes the target action according to the machine instruction code.
The target device may include the foregoing data processing units such as a single chip microcomputer, an FPGA, a DSP, and the like, and according to an actual application scenario, the target device may further include other external units, for example, an LED lamp, a buzzer, a voice module, a wireless module, a video module, a sensor unit, and the like, which are not limited herein. Alternatively, the target device may be applied to an industrial field, an educational field, or the like 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 dance robot, etc.
The obtained assembly code may be further compiled to generate a machine instruction code according to different target devices, where the machine instruction code may be a target device identifiable code, and may be a set of binary numbers, hexadecimal numbers, or the like, and is not limited herein, so that when the target device obtains the machine instruction code, the target device may execute a target action according to the machine instruction code. In some embodiments, the terminal device may send the machine instruction code to the target device by wireless, wired, etc., without limitation. For example, when the target device is a voice robot, in some embodiments, the voice robot may play a certain piece of music according to the acquired machine instruction code, but not limited to this.
Of course, it should be noted that, according to the actual application scenario, the machine instruction code may also be displayed on the building block programming interface. Optionally, when in display, each row of assembly codes can correspondingly display corresponding machine instruction codes, so that a user can correlate the assembly codes, the machine instruction codes and the realized target actions, and the working principle of the hardware equipment can be better understood. 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 flow chart of another programming method based on electronic building blocks according to an embodiment of the present application. Optionally, as shown in fig. 3, the compiling generating assembly code according to the target building block combination includes:
s301, according to the target building block combination, acquiring an upstream building block mark and a downstream building block mark of each electronic building block in 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.
The target building block combination comprises at least one electronic building block, when compiling and generating assembly codes, 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 the starting position and the ending position of the program codes of the integration of each electronic building block are obtained through the upstream building block mark and the downstream building block mark.
S302, 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.
The assembly jump mark is used for indicating the jump address of the target device, and can correspond to different assembly jump marks according to different target devices, and it can be understood that a user can better understand how the target device stores data according to the assembly jump mark. When generating the assembly code, 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, where 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 flow chart of another programming method based on electronic building blocks according to an embodiment of the present application. Optionally, as shown in fig. 4, the generating machine instruction code according to the assembly code includes:
s401, determining a machine jump mark according to the assembly jump mark.
S402, generating machine instruction codes according to the assembly codes and the machine jump marks.
The machine instruction code is a target equipment identifiable code, 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 identifiable by the target equipment. It will be appreciated that, further, according to the machine jump flag and the assembly code, a machine instruction code may be compiled to generate, where the machine instruction code may be a set of binary numbers, hexadecimal numbers, etc., and may be different according to the category of the code that the target device may identify, 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 building blocks of at least one of the following categories: sequential building blocks, branched building blocks, and cyclic building blocks.
The target building block combination can comprise one or a plurality of combinations of a sequential building block, a branch building block and a circulating building block according to different application scenes, and each building block can comprise at least one electronic building block.
For sequential building blocks, the program code for sequential building block integration may be executed sequentially in the order of the code; for the branch building block, the program code integrated by the branch building block may be judged according to specific logic operation, and different codes are executed according to the judging result, for example, the program code integrated by the branch building block may include if statement, switch statement, etc., but not limited thereto; for a loop building block, the program code integrated by the loop building block may repeatedly execute a certain piece of program code in the case where the loop condition is satisfied, and the piece of repeatedly executed code may be referred to as a loop body sentence, and when the loop condition is not satisfied, the loop may be ended.
For example, the target building block combination may include a first sequential building block including 3 electronic building blocks, a cyclic 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 for the first sequential building block integration may be executed first, the program code for the cyclic building block integration may be executed second, and the program code for the second sequential building block integration may be executed last. Of course, the number of electronic blocks included in each block is not limited herein, and may be different according to actual application scenarios.
Optionally, when the target building block combination includes a circulating building block, the obtaining, 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 includes:
and obtaining the circulation times of the circulating building blocks, and the upstream building block marks and the downstream building block marks of the circulating building blocks according to the circulating building blocks.
Wherein for a circulating block, an upstream block tag and a downstream block tag of the circulating block may be obtained, wherein the upstream block tag of the circulating block may indicate a start position of a circulating body program code of the circulating block and the downstream block tag of the circulating block may indicate an end position of the circulating body program code of the circulating block. It will be appreciated that the circulating building block may include circulating conditions, and thus, the number of cycles (e.g., 3 cycles, 5 cycles, etc.) may be determined based on the circulating conditions.
Fig. 5 is a schematic flow chart of another programming method based on electronic building blocks according to an embodiment of the present application. As shown in fig. 5, the above-mentioned determining the assembly jump flag according to the target building block combination, the upstream building block flag and the downstream building block flag of each electronic building block in the target building block combination, and generating the assembly code includes:
s501, increasing a counting mark according to the number of times of circulating the building blocks.
S502, determining an assembly jump mark according to the upstream building block mark and the downstream building block mark of the circulating building block.
When the cycle times of the circulating building blocks are obtained, counting marks of the assembly codes can be increased to indicate the cycle times of the assembly codes corresponding to the circulating building blocks; accordingly, from the upstream and downstream block flags of the loop block, an assembly jump flag may be determined by which the jump address of the target device is indicated.
S503, compiling and generating assembly codes according to the circulating 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 circulating 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 appreciated that, since the assembly code can be compiled according to the target building block combination, the assembly code is generated and displayed on the building block programming interface; the machine instruction code can be generated according to the assembly code, and is the target equipment identifiable code, so that the reading performance of a user can be improved by displaying the assembly code on a building block programming interface based on the programming method based on the electronic building blocks, and the user can fully understand the working principle of hardware equipment according to the corresponding relation between the assembly code and the machine instruction code, so that the user can conveniently debug and further learn to realize other functions and the like.
Fig. 6 is a schematic diagram of a functional module of a programming device based on an electronic toy according to an embodiment of the present application, and the basic principle and the technical effects of the device are the same as those of the foregoing corresponding method embodiment, and for brevity, reference may be made to corresponding contents in the method embodiment for parts not mentioned in the present embodiment. The programming apparatus may be applied to a terminal device through which a graphical user interface is displayed, the graphical user interface including a building block programming interface, as shown in fig. 6, the programming apparatus 100 includes: an acquisition module 110 and a display module 120.
An obtaining module 110, configured to obtain a target building block combination, where the target building block combination includes at least one electronic building block, and the electronic building block is integrated with a part of program codes;
the display module 120 is configured to compile and generate assembly codes according to the target building block combination, and display the assembly codes on the building block programming interface.
Fig. 7 is a schematic diagram of a functional module of another programming device based on electronic building blocks 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 identifiable 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 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, where the upstream building block mark is used to indicate a start position of a program code of the electronic building block, and the downstream building block mark is used to indicate an end position of the program code of the electronic building block; and determining an assembly jump mark according to the target building block combination, 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 the jump address of the target equipment.
In an alternative embodiment, the sending module 130 is specifically configured to determine a machine jump flag according to the assembly jump flag; and generating machine instruction codes according to the assembly codes and the machine jump marks.
In an alternative embodiment, the target building block combination includes building blocks of at least one of the following categories: sequential building blocks, branched building blocks, and cyclic building blocks.
In an alternative embodiment, when the target building block combination includes a circulating building block, the display module 120 is specifically configured to obtain, according to the circulating building block, a circulation number of the circulating building block, and an upstream building block mark and a downstream building block mark of the circulating building block; increasing a counting mark according to the cycle times of the circulating building blocks; determining an assembly jump mark according to the upstream building block mark and the downstream building block mark of the circulating building block; compiling to generate assembly code according to the circulating building blocks, the counting marks and the assembly jump marks.
The foregoing apparatus is used for executing the method provided in the foregoing embodiment, and its implementation principle and technical effects are similar, and are not described herein again.
The above modules may be one or more integrated circuits configured to implement the above methods, for example: one or more application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as ASIC), or one or more microprocessors (Digital Signal Processor, abbreviated as DSP), or one or more field programmable gate arrays (Field Programmable Gate Array, abbreviated as FPGA), or the like. For another example, when a module above 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 (Central Processing Unit, CPU) or other processor that may invoke the program code. For another example, the 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: processor 210, storage medium 220, and bus 230, storage medium 220 storing machine-readable instructions executable by processor 210, processor 210 executing machine-readable instructions to perform steps of the method embodiments described above when the electronic device is operating, processor 210 communicating with storage medium 220 via bus 230. The specific implementation manner and the technical effect are similar, and are not repeated here.
Optionally, the present application further provides a storage medium, on which a computer program is stored, which when being executed by a processor performs the steps of the above-mentioned method embodiments. The specific implementation manner and the technical effect are similar, and are not repeated here.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (english: processor) to perform part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: u disk, mobile hard disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
It should be noted that in this document, relational terms such as "first" and "second" and the like are 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The foregoing is merely a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and variations may be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. The foregoing is merely a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and variations may be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (5)

1. The programming method based on the electronic building blocks is applied to terminal equipment, and a graphical user interface is displayed through the terminal equipment, wherein the graphical user interface comprises a building block programming interface, and is characterized by comprising the following steps:
obtaining a target building block combination, wherein the target building block combination comprises at least one electronic building block, and the electronic building block is integrated with partial program codes;
compiling and generating assembly codes according to the target building block combination, and displaying the assembly codes on the building block programming interface;
the method further comprises the steps of compiling and generating assembly codes according to the target building block combination, and displaying the assembly codes on the building block programming interface:
generating a machine instruction code according to the assembly code, wherein the machine instruction code is a target equipment identifiable code;
sending the machine instruction code to the target equipment so that the target equipment executes a target action according to the machine instruction code;
compiling and generating assembly codes according to the target building block combination, wherein the compiling and generating assembly codes comprises the following steps:
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;
determining an assembly jump mark 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, and generating an assembly code, wherein the assembly jump mark is used for indicating a jump address of target equipment;
the target building block combination comprises building blocks of at least one of the following categories: sequential building blocks, branched building blocks, and cyclic building blocks;
when the target building block combination comprises a circulating building block, the method for obtaining the upstream building block mark and the downstream building block mark of each electronic building block in the target building block combination according to the target building block combination comprises the following steps:
acquiring the circulation times of the circulating building blocks, and the upstream building block marks and the downstream building block marks of the circulating building blocks according to the circulating building blocks;
correspondingly, the determining the assembly jump mark according to the target building block combination, 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 comprises the following steps:
increasing a counting mark according to the cycle times of the circulating building blocks;
determining an assembly jump mark according to the upstream building block mark and the downstream building block mark of the circulating building block;
and compiling and generating assembly codes according to the circulating building blocks, the counting marks and the assembly jump marks.
2. The method of claim 1, wherein the generating machine instruction code from the assembly code comprises:
determining a machine jump mark according to the assembly jump mark;
and generating machine instruction codes according to the assembly codes and the machine jump marks.
3. An electronic building block based programming device applied to a terminal device, wherein a graphical user interface is displayed through the terminal device, and the graphical user interface comprises a building block programming interface, and the device is characterized by comprising: an acquisition module and a display module;
the acquisition module is used for acquiring a target building block combination, wherein the target building block combination comprises at least one electronic building block, and partial program codes are integrated in the electronic building block;
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;
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 identifiable code; sending the machine instruction code to the target equipment so that the target equipment executes a target action according to the machine instruction code;
the display module is further used for 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; determining an assembly jump mark 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, and generating an assembly code, wherein the assembly jump mark is used for indicating a jump address of target equipment;
wherein the target building block combination comprises building blocks of at least one of the following categories: sequential building blocks, branched building blocks, and cyclic building blocks;
when the target building block combination comprises a circulating building block, the display module is specifically used for: acquiring the circulation times of the circulating building blocks, and the upstream building block marks and the downstream building block marks of the circulating building blocks according to the circulating building blocks; increasing a counting mark according to the cycle times of the circulating building blocks; determining an assembly jump mark according to the upstream building block mark and the downstream building block mark of the circulating building block; and compiling and generating assembly codes according to the circulating building blocks, the counting marks and the assembly jump marks.
4. 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 over the bus when the electronic device is running, the processor executing the machine-readable instructions to perform the steps of the electronic toy-based programming method of any one of claims 1-2.
5. A storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the electronic building block based programming method of any of claims 1-2.
CN202011324864.0A 2020-11-23 2020-11-23 Programming method and device based on electronic building blocks, electronic equipment and storage medium Active CN112463139B (en)

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 CN112463139A (en) 2021-03-09
CN112463139B true 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
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
CN113570944B (en) * 2021-05-17 2023-03-17 海南师范大学 Intelligent teaching aid control system and method for building block programming learning
CN116841564B (en) * 2023-08-29 2023-11-14 腾讯科技(深圳)有限公司 Data processing method, device, equipment and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7120905B2 (en) * 2003-01-29 2006-10-10 Wind River Systems, Inc. System and method for transformation of assembly code for conditional execution
WO2018150388A2 (en) * 2017-02-19 2018-08-23 Mehrdad Ghasemizadeh A system and method for graphical programming
CN110494843B (en) * 2017-04-03 2023-10-10 创首公司 Mixed mode programming

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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

Also Published As

Publication number Publication date
CN112463139A (en) 2021-03-09

Similar Documents

Publication Publication Date Title
CN112463139B (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
JP3612294B2 (en) Debugging method and debugging device
CN109847359B (en) Level editing method, level editing device, terminal and storage medium
CN111324396B (en) Block chain intelligent contract execution method, device and equipment
JP2015043198A (en) Analysis system, analysis method and analysis program
CN110825386B (en) Code compiling method and device and storage medium
CN111158756B (en) Method and apparatus for processing information
CN107608737B (en) Animation playing method and device
JP5481571B2 (en) How to improve understanding of time complexity and flow in code
JP2011170749A (en) Simulation device and simulation method
TWI525606B (en) Information supply method and system and word string supply system
JP2008250838A (en) Software generation device, method and program
CN113391813A (en) Program compiling method and device, storage medium and electronic equipment
JP4860564B2 (en) Program profiling apparatus, program profiling method, and program
JP2009258796A (en) Program development device and program development method
CN112541188B (en) Method and device for preventing application program code from being statically analyzed
CN117313595B (en) Random instruction generation method, equipment and system for function verification
CN112685095B (en) Virtual device loading method, device, equipment and storage medium
CN112994707B (en) SAS scrambling code circuit
JP2018026067A (en) Simulation device and method of generating connection information in simulation device
Etheredge JavaScript: Optimizing Native JavaScript: Designing, Programming, and Debugging Native JavaScript Applications
Thi Game Boy emulator written in Rust
Donzellini et al. Programming the DMC8
CN106445487A (en) Processing unit, software and method for controlling interactive components

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