CN111026381A - Hardware effect simulation method and device based on software programming platform - Google Patents

Hardware effect simulation method and device based on software programming platform Download PDF

Info

Publication number
CN111026381A
CN111026381A CN201911291992.7A CN201911291992A CN111026381A CN 111026381 A CN111026381 A CN 111026381A CN 201911291992 A CN201911291992 A CN 201911291992A CN 111026381 A CN111026381 A CN 111026381A
Authority
CN
China
Prior art keywords
hardware
code
module
software programming
graphical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911291992.7A
Other languages
Chinese (zh)
Inventor
黄汉川
李家荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Sitianjichuang Education Technology Co Ltd
Original Assignee
Shenzhen Sitianjichuang Education Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Sitianjichuang Education Technology Co Ltd filed Critical Shenzhen Sitianjichuang Education Technology Co Ltd
Priority to CN201911291992.7A priority Critical patent/CN111026381A/en
Publication of CN111026381A publication Critical patent/CN111026381A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a hardware effect simulation method and a hardware effect simulation device based on a software programming platform, wherein the method comprises the following steps: connecting functional modules on a software simulation page on an Ezblock studio software programming platform; automatically generating graphical programming codes corresponding to the functional modules and compiling programs; converting the written graphical code into an executable JavaScript code, and executing the code; when executing the code, simulating a hardware phenomenon according to the actual parameters of the configuration of the dragged hardware module and a method for simulating hardware internal data circulation of the program configuration; when the simulated hardware phenomenon has errors, the Ezblock studio software programming platform prompts the errors, and the hardware simulator is restarted after the codes are debugged according to the prompts of the errors. The invention enables a user to directly write the program and know the phenomenon on the hardware without the hardware, thereby facilitating the debugging of the program and having extremely high convenience.

Description

Hardware effect simulation method and device based on software programming platform
Technical Field
The invention relates to the field of hardware simulation, in particular to a hardware effect simulation method and device based on a software programming platform.
Background
The existing hardware simulation technology only tells the functions of the hardware equipment to a user through the display of some images and the change of colors, and cannot achieve the effect expected by the user. When the hardware preparation of the user is insufficient or not in place, the user cannot simulate the real phenomenon which can be shown by the intelligent equipment under the code in the written program, cannot respond to data sent by the program code, cannot check whether a problem exists or not, and cannot verify whether the written program is feasible or not.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method and an apparatus for simulating hardware effect based on a software programming platform, which enable a user to directly write a program and know the phenomenon occurring on the hardware without the hardware, facilitate program debugging, and have high convenience.
The technical scheme adopted by the invention for solving the technical problems is as follows: a simulation method of hardware effect based on a software programming platform is constructed, and comprises the following steps:
A) performing required functional module connection on a software simulation page on an Ezblock studio software programming platform;
B) after the functional modules are connected, the Ezblock studio software programming platform automatically generates graphical programming codes corresponding to the functional modules, and writes programs by using the generated graphical programming codes;
C) converting the written graphical code into an executable JavaScript code, and executing the JavaScript code;
D) when the JavaScript code is executed, simulating a hardware phenomenon according to actual parameters configured by the dragged hardware module and a method for simulating hardware internal data circulation configured by a program;
E) and when the simulated hardware phenomenon has errors, prompting the errors by the Ezblock studio software programming platform, and restarting the hardware simulator after debugging the codes according to the prompts of the errors.
In the method for simulating hardware effect based on software programming platform according to the present invention, the step a) further includes:
A1) clicking the connecting line functional module of the Ezblock studio software programming platform;
A2) dragging the functional module to be connected on the side bar of the page of the connecting functional module;
A3) and connecting the functional module which is required to be connected according to the page prompt.
In the method for simulating hardware effect based on software programming platform according to the present invention, the step B) further includes:
B1) generating an XML code according to the connected functional module;
B2) converting the generated XML codes into graphical code blocks;
B3) and programming according to the graphical code block.
In the method for simulating hardware effect based on software programming platform according to the present invention, the step C) further includes:
C1) converting the graphical code block into a JavaScript code character string;
C2) executing the JavaScript code character string by using the JavaScript code executor;
C3) and outputting an execution result.
The invention also relates to a device for realizing the hardware effect simulation method based on the software programming platform, which comprises the following steps:
functional module connecting unit: the software simulation page is used for performing required functional module connection on a software simulation page on an Ezblock studio software programming platform;
writing a program unit: after the functional modules are connected, the Ezblock studio software programming platform automatically generates graphical programming codes corresponding to the functional modules, and writes programs by using the generated graphical programming codes;
a code conversion unit: converting the written graphical code into an executable JavaScript code, and executing the JavaScript code;
a hardware phenomenon simulation unit: when the JavaScript code is executed, simulating a hardware phenomenon according to the actual parameters of the dragged hardware module configuration and a method for simulating hardware internal data circulation configured by a program;
a code debugging unit: and when the simulated hardware phenomenon has errors, the Ezblock studio software programming platform prompts the errors, and the hardware simulator is restarted after the codes are debugged according to the prompts of the errors.
In the apparatus of the present invention, the function module connection unit further includes:
a wiring module: the connecting function module is used for clicking the Ezblock studio software programming platform;
a dragging module: the function module is used for dragging a function module to be connected on a side bar of a page of the connection function module;
a connecting module: and the function module is used for connecting the function module which is required to be connected according to the page prompt.
In the apparatus of the present invention, the program writing unit further includes:
an XML code generation module: the XML code is generated according to the connected functional modules;
a graphical code block module: the XML code is used for converting the generated XML code into a graphical code block;
the graphical programming module: for programming according to the block of graphical code.
In the apparatus of the present invention, the transcoding unit further includes:
the JavaScript code string conversion module: the system is used for converting the graphical code block into a JavaScript code character string;
the JavaScript code string execution module: for executing the JavaScript code string using the JavaScript code executor;
an execution result output module: for outputting the execution result.
The method and the device for simulating the hardware effect based on the software programming platform have the following beneficial effects: because the hardware effect is simulated through the Ezblock studio software programming platform, the program written on the Ezblock studio software programming platform can directly realize the effect on the Ezblock studio software programming platform, can respond to the data sent by the program, change the hardware simulation effect in real time, and help a user to test the problem of the program and verify whether the program is feasible or not when the hardware preparation is insufficient or not in place to the greatest extent.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method in one embodiment of a method and apparatus for software programming platform based hardware effect simulation of the present invention;
FIG. 2 is a specific flowchart of the functional module connection required for the software simulation page on the Ezblock studio software programming platform in the embodiment;
fig. 3 is a specific flowchart in the embodiment, after the functional modules are connected, the Ezblock studio software programming platform automatically generates graphical programming codes corresponding to the functional modules, and writes programs using the generated graphical programming codes;
fig. 4 is a specific flowchart of converting the written graphical code into an executable JavaScript code and executing the JavaScript code in the embodiment;
fig. 5 is a schematic structural diagram of the device in the embodiment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. 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 invention.
In the embodiment of the hardware effect simulation method and device based on the software programming platform, a flow chart of the hardware effect simulation method based on the software programming platform is shown in fig. 1. In fig. 1, the simulation method of hardware effect based on software programming platform includes the following steps:
step S01 is to perform the required functional module connection on the software simulation page on the Ezblock studio software programming platform: in the step, the required functional module connection is carried out on a software simulation page on an Ezblock studio software programming platform.
After the functional modules are connected in step S02, the Ezblock studio software programming platform automatically generates the graphical programming codes corresponding to the functional modules, and uses the generated graphical programming codes to write programs: in this step, after the functional modules are connected, the Ezblock studio software programming platform automatically generates graphical programming codes corresponding to the functional modules, and writes programs by using the generated graphical programming codes.
Step S03 converts the written graphical code into an executable JavaScript code, and executes the JavaScript code: in this step, the written graphical code is converted into an executable JavaScript code, and the JavaScript code is executed.
When executing the JavaScript code in step S04, simulating a hardware phenomenon according to the actual parameters of the dragged hardware module configuration and the method for simulating hardware internal data flow configured by the program: in this step, when the JavaScript code is generated and executed, a hardware phenomenon is actually simulated according to the actual parameters of the configuration of the dragged hardware module and the method for simulating the data circulation inside the hardware configured by the program, so as to help a user to better troubleshoot problems.
Step S05, when the simulated hardware phenomenon has an error, the Ezblock studio software programming platform prompts the error, and after debugging the code according to the prompt of the error, the hardware simulator is restarted: in this step, if the simulated hardware phenomenon has errors, the Ezblock studio software programming platform prompts the errors, and the hardware simulator is restarted after the codes are debugged according to the prompts of the errors.
The method is convenient for a user to simulate the real phenomenon which can be shown by the intelligent equipment under the written program codes by using the hardware simulator when developing, responds to the data sent by the program codes, and helps the user to find out whether the program has problems when the hardware is not developed in place at an early stage. The method of the invention enables the user to directly write the program and know the phenomenon on the hardware without the hardware, thereby being convenient for debugging the program and having extremely high convenience.
For the present embodiment, the step S01 can be further refined, and the detailed flowchart is shown in fig. 2. In fig. 2, the step S01 further includes the following steps:
step S11, clicking the Ezblock studio software programming platform connecting line function module: in the step, a user clicks the connecting function module of the Ezblock studio software programming platform.
Step S12 drags the function module to be connected to the link function module page sidebar: in this step, the functional module to be connected is dragged at the side column position of the page of the connected functional module.
Step S13 connects the function module to be connected according to the page prompt: in this step, the functional module to be connected is connected according to the prompt of the current page.
For the present embodiment, the step S02 can be further refined, and the detailed flowchart is shown in fig. 3. In fig. 3, the step S02 further includes the following steps:
step S21 generates an XML code according to the connected function module: in this step, a corresponding XML code is generated according to the connected functional module.
Step S22 converts the generated XML code into a patterned code block: in this step, the XML code generated in step S01 is converted into a graphical code block.
Step S23 is programmed according to the graphical code block: in this step, programming is performed based on the patterned code block generated in step S22.
For the present embodiment, the step S03 can be further refined, and the detailed flowchart is shown in fig. 4. In fig. 4, the step S03 further includes the following steps:
step S31 converts the graphical code block into a JavaScript code string: in this step, the graphical code block is converted into a JavaScript code string.
Step S32 executes the JavaScript code string using the JavaScript code executor: in this step, the JavaScript code string is executed using a JavaScript code executor.
Step S33 outputs the execution result: in this step, the execution result of the JavaScript code string is output.
The embodiment also relates to a device for implementing the simulation method of the hardware effect based on the software programming platform, and a schematic structural diagram of the device is shown in fig. 5. In fig. 5, the apparatus includes a functional module connection unit 1, a program writing unit 2, a code conversion unit 3, a hardware phenomenon simulation unit 4, and a code debugging unit 5; the functional module connecting unit 1 is used for connecting the required functional modules on a software simulation page on an Ezblock studio software programming platform; the compiling program unit 2 is used for automatically generating graphical programming codes corresponding to the functional modules by the Ezblock studio software programming platform after the functional modules are connected, and compiling programs by using the generated graphical programming codes; the code conversion unit 3 converts the written graphical code into an executable JavaScript code and executes the JavaScript code; when the hardware phenomenon simulation unit 4 is used for executing the JavaScript code, according to the actual parameters of the configuration of the dragged hardware module and the method for simulating the data circulation inside the hardware configured by the program, a hardware phenomenon is simulated and is fit with the actual simulated hardware phenomenon, so that a user is helped to better troubleshoot the problem. The code debugging unit 5 is used for prompting an error by an Ezblock studio software programming platform when the simulated hardware phenomenon has an error, and restarting the hardware simulator after debugging the code according to the error prompt.
The device provided by the invention is convenient for a user to simulate the real phenomenon which can be shown by the intelligent equipment under the written program code by using the hardware simulator when developing, responds to the data sent by the program code, helps the user to find out whether the program has a problem when the hardware is not developed in place at an early stage, and can verify the correctness of the program by using the device provided by the invention. The device of the invention enables a user to directly write a program and know the phenomenon on the hardware without the hardware, thereby facilitating the debugging of the program and having extremely high convenience.
In this embodiment, the functional module connection unit 1 further includes a connection module 11, a dragging module 12, and a connection module 13; the connecting module 11 is used for enabling a user to click the connecting function module of the Ezblock studio software programming platform; the dragging module 12 is used for dragging a function module to be connected on a side bar of a page of the connected function module; the connection module 13 is used for connecting the functional module which is desired to be connected according to the prompt of the page.
In this embodiment, the writer unit 2 further includes an XML code generation module 21, a graphical code block module 22, and a graphical programming module 23; the XML code generating module 21 is configured to generate an XML code according to the connected functional module; the graphical code block module 22 is used for converting the generated XML codes into graphical code blocks; the graphical programming module 23 is used for programming according to the graphical code blocks.
In this embodiment, the code conversion unit 3 further includes a JavaScript code string conversion module 31, a JavaScript code string execution module 32, and an execution result output module 33; the JavaScript code string conversion module 31 is configured to convert the graphical code block into a JavaScript code string; the JavaScript code string execution module 32 is configured to execute the JavaScript code string by using a JavaScript code executor; the execution result output module 33 is used for outputting the execution result.
In short, in this embodiment, since the hardware effect is simulated by the Ezblock studio software programming platform, the program written on the Ezblock studio software programming platform can directly realize the effect on the Ezblock studio software programming platform, and the hardware simulation effect can be changed in real time in response to data sent by the program, so as to help a user to test the problem of the program and verify whether the program is feasible or not when the hardware preparation is insufficient or not in place to the maximum extent.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (8)

1. A hardware effect simulation method based on a software programming platform is characterized by comprising the following steps:
A) performing required functional module connection on a software simulation page on an Ezblock studio software programming platform;
B) after the functional modules are connected, the Ezblock studio software programming platform automatically generates graphical programming codes corresponding to the functional modules, and writes programs by using the generated graphical programming codes;
C) converting the written graphical code into an executable JavaScript code, and executing the JavaScript code;
D) when the JavaScript code is executed, simulating a hardware phenomenon according to actual parameters configured by the dragged hardware module and a method for simulating hardware internal data circulation configured by a program;
E) and when the simulated hardware phenomenon has errors, prompting the errors by the Ezblock studio software programming platform, and restarting the hardware simulator after debugging the codes according to the prompts of the errors.
2. The software programming platform-based hardware effect simulation method according to claim 1, wherein the step a) further comprises:
A1) clicking the connecting line functional module of the Ezblock studio software programming platform;
A2) dragging the functional module to be connected on the side bar of the page of the connecting functional module;
A3) and connecting the functional module which is required to be connected according to the page prompt.
3. The software programming platform-based hardware effect simulation method according to claim 2, wherein the step B) further comprises:
B1) generating an XML code according to the connected functional module;
B2) converting the generated XML codes into graphical code blocks;
B3) and programming according to the graphical code block.
4. The software programming platform-based hardware effect simulation method according to claim 3, wherein the step C) further comprises:
C1) converting the graphical code block into a JavaScript code character string;
C2) executing the JavaScript code character string by using the JavaScript code executor;
C3) and outputting an execution result.
5. An apparatus for implementing the software programming platform-based hardware effect simulation method according to claim 1, comprising:
functional module connecting unit: the software simulation page is used for performing required functional module connection on a software simulation page on an Ezblock studio software programming platform;
writing a program unit: after the functional modules are connected, the Ezblock studio software programming platform automatically generates graphical programming codes corresponding to the functional modules, and writes programs by using the generated graphical programming codes;
a code conversion unit: converting the written graphical code into an executable JavaScript code, and executing the JavaScript code;
a hardware phenomenon simulation unit: when the JavaScript code is executed, simulating a hardware phenomenon according to the actual parameters of the dragged hardware module configuration and a method for simulating hardware internal data circulation configured by a program;
a code debugging unit: and when the simulated hardware phenomenon has errors, the Ezblock studio software programming platform prompts the errors, and the hardware simulator is restarted after the codes are debugged according to the prompts of the errors.
6. The apparatus of claim 5, wherein the function module connection unit further comprises:
a wiring module: the connecting function module is used for clicking the Ezblock studio software programming platform;
a dragging module: the function module is used for dragging a function module to be connected on a side bar of a page of the connection function module;
a connecting module: and the function module is used for connecting the function module which is required to be connected according to the page prompt.
7. The apparatus of claim 6, wherein the writer unit further comprises:
an XML code generation module: the XML code is generated according to the connected functional modules;
a graphical code block module: the XML code is used for converting the generated XML code into a graphical code block;
the graphical programming module: for programming according to the block of graphical code.
8. The apparatus of claim 7, wherein the transcoding unit further comprises:
the JavaScript code string conversion module: the system is used for converting the graphical code block into a JavaScript code character string;
the JavaScript code string execution module: for executing the JavaScript code string using the JavaScript code executor;
an execution result output module: for outputting the execution result.
CN201911291992.7A 2019-12-16 2019-12-16 Hardware effect simulation method and device based on software programming platform Pending CN111026381A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911291992.7A CN111026381A (en) 2019-12-16 2019-12-16 Hardware effect simulation method and device based on software programming platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911291992.7A CN111026381A (en) 2019-12-16 2019-12-16 Hardware effect simulation method and device based on software programming platform

Publications (1)

Publication Number Publication Date
CN111026381A true CN111026381A (en) 2020-04-17

Family

ID=70209377

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911291992.7A Pending CN111026381A (en) 2019-12-16 2019-12-16 Hardware effect simulation method and device based on software programming platform

Country Status (1)

Country Link
CN (1) CN111026381A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7634762B1 (en) * 2005-04-19 2009-12-15 Paravirtual Corp. Selective post-compile conversion
US20120005693A1 (en) * 2010-01-08 2012-01-05 Cypress Semiconductor Corporation Development, Programming, and Debugging Environment
CN107644563A (en) * 2017-04-28 2018-01-30 天津职业技术师范大学 Automotive electronics combined training platform based on graphic programming
CN109271144A (en) * 2018-08-24 2019-01-25 深圳市创客星空科技有限公司 A kind of cloud the integration environment development approach for study
CN110376959A (en) * 2019-07-25 2019-10-25 大连理工大学 A kind of Soft- PLC configuration software generation system based on FPGA platform
CN110554863A (en) * 2018-05-31 2019-12-10 宁波科安网信通讯科技有限公司 Graphical programming method of quasi-integrated circuit

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7634762B1 (en) * 2005-04-19 2009-12-15 Paravirtual Corp. Selective post-compile conversion
US20120005693A1 (en) * 2010-01-08 2012-01-05 Cypress Semiconductor Corporation Development, Programming, and Debugging Environment
CN107644563A (en) * 2017-04-28 2018-01-30 天津职业技术师范大学 Automotive electronics combined training platform based on graphic programming
CN110554863A (en) * 2018-05-31 2019-12-10 宁波科安网信通讯科技有限公司 Graphical programming method of quasi-integrated circuit
CN109271144A (en) * 2018-08-24 2019-01-25 深圳市创客星空科技有限公司 A kind of cloud the integration environment development approach for study
CN110376959A (en) * 2019-07-25 2019-10-25 大连理工大学 A kind of Soft- PLC configuration software generation system based on FPGA platform

Similar Documents

Publication Publication Date Title
WO2020140820A1 (en) Software testing method, system, apparatus, device, medium, and computer program product
US20080209405A1 (en) Distributed debugging for a visual programming language
US7895575B2 (en) Apparatus and method for generating test driver
WO2018151277A1 (en) Software testing device, software testing system, software testing method, and program
KR20130122853A (en) System and method for simulating realtime severe accident phenomena for training simulator of the nuclear power plant
CN112133146A (en) Algorithm practice code execution visualization system
CN106155903A (en) Apparatus and method for system design validation
CN111382055A (en) Automatic unit testing method and device based on unified description language
CN115562982A (en) Reference model debugging method and device, electronic equipment and storage medium
CN111930398A (en) Application program updating method, device, system, medium and equipment
CN103092747A (en) Controlling program verifying and testing method and system thereof
CN107844486B (en) Method and system for analyzing webpage problems for client
de Cleva Farto et al. Reuse of model-based tests in mobile apps
Maicus et al. Autograding interactive computer graphics applications
CN104317580A (en) Integrated development environment for virtual test application (APP)
CN113064618B (en) System and method for simulating new energy vehicle conformance detection
Wienke et al. Model-based performance testing for robotics software components
Zeng et al. Graphical model debugger framework for embedded systems
CN111026381A (en) Hardware effect simulation method and device based on software programming platform
CN111159032A (en) Signal-driven universal automatic test development system and system establishment method
CN110955605A (en) Method for verifying single step dynamic execution by CPU
CN114327416A (en) Interface synchronization method and device applied to development branch and electronic equipment
CN113986263A (en) Code automation test method, device, electronic equipment and storage medium
Wehrmeister et al. Early verification of embedded systems: Testing automation for UML models
Coulter Graybox software testing methodology: embedded software testing technique

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200417