WO2018196345A1 - 图形化编程的自动编译方法 - Google Patents
图形化编程的自动编译方法 Download PDFInfo
- Publication number
- WO2018196345A1 WO2018196345A1 PCT/CN2017/111231 CN2017111231W WO2018196345A1 WO 2018196345 A1 WO2018196345 A1 WO 2018196345A1 CN 2017111231 W CN2017111231 W CN 2017111231W WO 2018196345 A1 WO2018196345 A1 WO 2018196345A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- graphical
- program
- module
- graphical program
- node
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/35—Creation or generation of source code model driven
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/34—Graphical or visual programming
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/447—Target code generation
Definitions
- the invention mainly relates to the field of graphical programming, and in particular to a graphical programming compilation method.
- Graphical programming maximizes the imagination and creativity of children and develops their basic programming logic and thinking.
- the software for graphical programming on the market today is basically that each graphic object is a block of code, which can be stitched together to create simple functions, then combine the simple functions and then convert them into a high-level language.
- high-level languages such as Python and JavaScript
- the compiler in the controller parses the object code, including preprocessing, compiling, and assembling to finally generate an executable machine language.
- the compilation process is too complicated, too professional, high learning cost, and high requirements on the controller, which inevitably increases the software development cost.
- the invention is directed to the complexity of the current programming technology in the field of graphical programming, and the requirement is too high, and provides an easy-to-implement automatic compilation method for graphical programming. It is an object of the present invention to provide an efficient and simple compilation method, The compiling method automatically generates the executable file of the program in the controller, thereby achieving the running effect of the program, and the specific technical solutions are as follows:
- An automatic compilation method based on a graphical programming comprising the following steps:
- the graphical program parsing module analyzes the position of each graphical module in the graphical program according to the storage structure of the graphical program, and obtains additional instructions that may be required by the graphical module, such as a thread start command and a conditional jump. Transfer instruction
- the graphical program executable file generation module is a key part of the entire compilation method. On the basis of steps (b), (c), and (d), the corresponding byte of each module in the graphical program is generated. An array, and then concatenating the byte array of the graphical module into a complete executable file in the order of the graphical program traversal;
- step (f) transmitting the executable file generated by the step (e) to the controller through HID or Bluetooth data communication, and the controller performs corresponding actions according to the instruction to achieve the expected action effect of the graphical program.
- step (b) comprises the following steps:
- step (c) comprises the following steps:
- (c-2) deeply traversing the tree structure in the forest, if the node is the root node, creating a thread, and the thread is the main thread of the graphical program, and recording thread information, including the thread ID and the thread start module ID;
- node is a non-root node, the number of child nodes of the parent node is determined. If the node is the first child of the parent node, no operation is performed and the traversal is continued; if the node is not the parent node The first child, then assign a new thread, record thread information;
- node If the node is a leaf node, it indicates that the node is the termination node of the thread, and the node ID is used as the thread end ID. Note that the leaf node included in the graphics program is equal to the number of threads included in the graphics program;
- the graphical program memory allocation table and the graphical program thread allocation table of the graphical program are obtained, and in the subsequent steps (d) and (e), the graphics are based on the graphics.
- the memory allocation table and the graphical program thread allocation table process the graphical program, and finally generate an executable file corresponding to the graphical program.
- step (e) comprises the following steps:
- the functions mainly include the overall downlink of the graphical program, the partial transfer of the graphical program and the downlink of the graphical tree, and then traversing the tree in the forest according to the specific requirements:
- the graphical module mode contains an instruction set for parsing and replacing to generate a graphical module byte array that satisfies specific functions
- step (e-7) according to the ROM address default table of the graphical program and the graphical program ROM address allocation table, the blank ROM address in the semi-complete graphical module byte array is filled in step (c) to form a complete Graphical module byte array;
- step (c-3) comprises the following steps:
- Each operand in the instruction has a different addressing mode. According to the above, the operand addressing mode is obtained, and then the real value of the operand is obtained, and then the operand in the instruction is replaced by the real value.
- step (f) the main function of step (f) is to connect the software and the controller for data exchange, which mainly comprises two communication modes of HID and Bluetooth, and the final generated program through the data communication module.
- the program machine language is transmitted to the controller for operation, and the controller connection module monitors the status of the controller and the program running status in real time to ensure the normal operation of the program;
- the present invention has the following advantages and technical effects:
- the existing graphical programming compilation methods are mostly compiled according to the specific compilation framework.
- the compilation process is too complicated, too professional, high learning cost, high requirements on the controller, micro-operating system support, and the compilation system itself is not efficient. ,not effectively.
- the domestic programming method of graphical programming is rare, very lacking.
- the present invention allows a software developer to perform graphics through the automatic compilation method proposed by the present invention on the basis of complex knowledge points such as the incomprehensible compilation principle, the runtime structure, and the inherent relationship of the compilation system principle.
- the programming program written into the controller can directly execute the file, which is simple and efficient, and greatly simplifies the compilation and implementation of the graphical programming.
- 1 is a flow chart of an automatic compiling method for graphical programming in an embodiment.
- the main process includes the following steps:
- the graphical program parsing module analyzes the position of each graphical module in the graphical program according to the storage structure of the graphical program, and obtains additional instructions that may be required by the graphical module, such as a thread start command and a conditional jump. Transfer instruction
- the graphical program executable file generation module is a key part of the entire compilation method. On the basis of steps (b), (c), and (d), the corresponding byte of each module in the graphical program is generated. An array, and then concatenating the byte array of the graphical module into a complete executable file in the order of the graphical program traversal;
- step (f) transmitting the executable file generated by the step (e) to the controller through HID or Bluetooth data communication, and the controller performs corresponding actions according to the instruction to achieve the expected action effect of the graphical program.
- Step (b) includes the following steps:
- Step (c) includes the following steps:
- (c-2) deeply traversing the tree structure in the forest, if the node is the root node, creating a thread, and the thread is the main thread of the graphical program, and recording thread information, including the thread ID and the thread start module ID;
- node is a non-root node, the number of child nodes of the parent node is determined. If the node is the first child of the parent node, no operation is performed and the traversal is continued; if the node is not the parent node The first child, then assign a new thread, record thread information;
- node If the node is a leaf node, it indicates that the node is the termination node of the thread, and the node ID is used as the thread end ID. Note that the leaf node included in the graphics program is equal to the number of threads included in the graphics program;
- the graphical program memory allocation table and the graphical program thread allocation table of the graphical program are obtained, as shown in Table 1 and Table 2, after (d), In the step (e), the graphical program is processed based on the graphical memory allocation table and the graphical program thread allocation table, and finally the executable file corresponding to the graphical program is generated.
- step (e) comprises the following steps:
- the functions mainly include the overall downlink of the graphical program, the partial transfer of the graphical program and the downlink of the graphical tree, and then traversing the tree in the forest according to the specific requirements:
- the graphical module mode contains an instruction set for parsing and replacing to generate a graphical module byte array that satisfies specific functions
- step (c) according to the ROM address default table of the graphical program and the ROM address allocation table of the graphical program, the step (c) generates a fill ROM address in the semi-complete graphical module byte array to fill a complete graphical module byte array;
- step (e) After the graphical program is processed in step (e), a semi-complete executable file of the graphical program is generated, and some additional operations and processing are required to finally generate a complete executable file.
- step (c-3) comprises the following steps:
- Order_Operandmode(x1,x2...,xn) Get_OrderType(Order_Code)(7-1)
- Each operand in the instruction has a different addressing mode. According to the above expression, the operand addressing mode is obtained, and then the real value of the operand is obtained, and then the operation in the instruction is replaced by the real value. Number to complete the parsing of the instruction:
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
一种图形化编程的自动编译方法,其主要包括以下步骤:图形化程序内存分配、图形化程序线程分配、图形化程序存储结构解析和图形化程序可执行文件生成。基于图形化编程的自动编译生成图形化程序对应可执行文件,用户根据功能要求自由组合图形化模块而形成程序,采用基于图形化编程的自动编译方法对图形化程序进行编译,生成可在控制器直接运行的文件。该方法不需要复杂的编译器和编译环境,就可以自动生成图形化程序对应晦涩难懂的可执行文件,然后通过数据交换将生成的可执行文件传至控制器运行进而达到图形化程序相应的动作效果。
Description
本发明主要涉及图形化编程领域,具体涉及图形化编程编译方法。
着互联网技术和社会不断的发展,互联网已经与我们的生活息息相关,深入到我们生活的各个方面。与此同时人们开始重视针对少年儿童的编程教育.在乔布斯生前接受的一次采访中,他曾经说过这样一句话:这个国家的每一个人都应该学习编程,因为它教你如何思考.同时比尔·盖茨、马克·扎克伯格、杰克·多西在内的众多名人,都来呼吁让少年儿童参与到计算机编程中去.也许正是因为这种观念的深入人心,科技巨头们也都参与到针对少年儿童的编程教育中去。于是图形化编程语言应运而生,其要求简单,不需要复杂的语法知识,小朋友只需要拖到模块进行自由组合,从而达到某种特定效果。图形化编程它能够最大程度地让儿童发挥想象力和创造力,培养他们的基本编程逻辑和思维。目前市场上的图形化编程的软件基本都是每个图形对象都是代码块,可以将它们拼接起来,创造出简单功能,然后将一个个简单功能组合起来,然后将其转化成某种高级语言,比如Python、JavaScript等高级语言,之后将代码传输至控制器,由控制器中编译器对目标代码进行解析,其中包括预处理、编译、汇编最终生成可执行的机器语言。其编译过程过于复杂,过于专业,学习成本高,且对控制器要求高,无形中增加了软件开发成本。且在某些具体环境下并不需要构建复杂的编译器来实现编译工作,针对这种现状进而提出了一种简单容易实现的图形化编程的自动编译方法。
发明内容
本发明针对当前图形化编程领域中的编译技术过于复杂,要求过高,提供了一种简单易实现的图形化编程的自动编译方法。本发明的目的在于提供一种高效且简单的编译方法,
通过该编译方法自动生成程序的在控制器可执行文件,从而达到程序的运行效果,具体技术方案如下:
基于一种图形化编程的自动编译方法,包括以下步骤:
(a)用户自由组合图形化模块生成图形化程序;
(b)图形化程序内存分配,生成图形化程序内存分配表,以实现对控制器的内存管理和操作;
(c)图形化程序线程分配,对图形化程序的存储结构进行分析,得到图形化程序的线程分配表,以达到图形化程序多线程执行,以实现线程管理;
(d)图形化程序解析模块,根据图形化程序的存储结构,对图形化程序中每个图形化模块所处位置进行分析,得到图形化模块可能需要的额外指令,比如线程启动指令、条件跳转指令;
(e)图形化程序可执行文件生成模块是整个编译方法中关键的一环,在(b)、(c)、(d)步骤的基础上,生成图形化程序中每个模块对应的字节数组,然后按照图形化程序遍历的顺序将图形化模块的字节数组串接成一个完整可执行文件;
(f)通过HID或者蓝牙数据通信,将(e)步骤生成的可执行文件传输至控制器,控制器按照指令执行相应的动作,以达到图形化程序的预期动作效果。
上述的一种图形化编程的自动编译方法中,步骤(b)包括以下步骤:
(b-1)获取图形化程序的储存结构-森林;
(b-2)遍历图形化程序对应的树结构,根据树节点ID获取图形化模块实体;
(b-3)根据图形化模块模式获取对应的参数内存分配列表,其包含参数初始化的顺序,以保证相关动作能正确执行;
(b-4)根据参数类型,分配指定大小的内存空间,然后记录参数分配的内存基址;
(b-5)对特殊参数,比如用户自定义参数和资源型参数进行额外处理,以保证满足图形化模块的内存要求和程序的健壮性;
(b-6)最终生成图形化程序内存分配表,以实现对控制器内存进行管理和操作
上述的一种图形化编程的自动编译方法中,步骤(c)包括以下步骤:
(c-1)获取图形化程序的储存结构-森林;
(c-2)深度遍历森林中的树结构,如果节点是根节点则创建线程,且该线程为图形化程序的主线程,并记录线程信息,其包括线程ID和线程起始模块ID;
(c-3)若节点是非根节点,则判断父节点的子节点的个数,如果该节点是父节点的第一个孩子,则不进行任何操作,继续遍历;如果该节点不是父节点的第一孩子,则分配新线程,记录线程信息;
(c-4)若节点是叶子节点,则表示该节点是线程的终止节点,将该节点ID作为线程结束ID,注意图形化程序包含的叶子节点等于图形化程序包含的线程数;
(c-5)最终构造出图形化程序的线程分配表,以满足对图形化程序的多线程管理和操作。
图形化程序经过(b)、(c)步骤处理后,得到图形化程序的图形化程序内存分配表和图形化程序线程分配表,在之后的(d)、(e)步骤中,会基于图形化内存分配表和图形化程序线程分配表对图形化程序进行处理,最终生成图形化程序对应的可执行文件。
上述的一种图形化编程的自动编译方法,步骤(e)包括以下步骤:
(e-1)获取图形化程序存储结构-森林;
(e-2)根据不同功能需求遍历森林,功能主要包括图形化程序整体下传、图形化程序部分下传和图形化树下传,然后根据具体要求深度遍历森林中的树:
(e-3)根据树节点ID获取对应的图形化模块实体,根据图形化模块类型和模式调用其对应的XML文件,在解析图形化模块模式对应XML指令集中,需要借助指令解析XML文件来对图形化模块模式包含的指令集进行解析和替换,以生成满足具体功能的图形化模块字节数组;
(e-4)在解析和替换图形化模块模式XML文件时,并不能生成完整的图形化模块模式字节数组,可能会产生程序地址空缺,资源地址欠缺,一般先用零来填充程序地址,以形成半完整的图形化模块模式字节数组并记录图形化模块的缺省信息,最终形成图形化程序的ROM(程序)地址缺省表;
(e-5)根据遍历顺序,依次分配图形化模块的程序地址,根据生成的图形化模块字节数组的大小来决定图形化模块占据的ROM存储空间,最终生成图形化程序的ROM(程序)地址分配表
(e-6)分配完图形化模块的程序地址之后,对图形化程序需要的额外资源进行分配,以满足图形化程序中图形化模块的资源需求,比如图片、声音和文本;
(e-7)根据图形化程序的ROM地址缺省表和图形化程序ROM地址分配表,对步骤(c)生成半完整的图形化模块字节数组中的空缺ROM地址进行填充,以形成完整的图形化模块字节数组;
(e-8)将生成的图形化模块字节数组和资源字节数组按照规则连接起来形成图形化程序最终可执行的字节数组,然后通过通信模块将数据传至控制器运行。
上述一种图形化编程的自动编译方法,其特征在于,步骤(c-3)包括如下步骤:
(e-3-1)根据树节点ID获取对应的图形化模块实体,进而获取图形化模块类型和模式;
(e-3-2)根据图形化模块类型和模式值获取相应参数初始化列表,对有初始化值的参数进行初始化操作,即对参数对应的内存地址赋予初值,以满足模块的功能需求;
(e-3-3)根据图形化模块类型和模式值中获取相应的指令集,通过表达式对指令进行解析和替换,首先根据指令码获取指令中每个操作数的含义,即获取操作数的寻址方式;
(e-3-4)指令中每个操作数都有不同的寻址方式,根据上述获取操作数寻址方式,进而得到操作数的真实数值,然后使用真实值来替换指令中的操作数,以完成对指令的解析;
(e-3-5)指令集经过步骤(c)、(d)处理,形成满足图形化程序中的图形化模块的功能要求,在处理过程中可能存在空缺值,需要后续操作进行填补,最后形成完整的图形化模块对应的字节数组。
上述一种图形化编程的自动编译方法,步骤(f)的主要作用是将软件与控制器连接起来进行数据交换,其主要包括HID和蓝牙两种通信方式,通过数据通信模块将最终生成的程序程序机器语言传至控制器进行运行,同时也通过控制器连接模块实时监控控制器的状态以及程序运行状况,以保证程序正常运行;
与现有技术相比,本发明具有如下优点和技术效果:
现有的图形化编程编译方法,大都在遵循特定的编译框架进行编译,编译过程过于复杂,过于专业,学习成本高,对控制器要求高,需要微型操作系统支持,且编译系统本身效率不高,效果不佳。而且国内的图形化编程的编译方法更是凤毛麟角,十分缺乏。针对上述问题,本发明允许软件开发人员在不需要了解晦涩难懂编译原理、运行时结构、编译系统原理的内在关系等复杂知识点基础上,就可以通过本发明提出的自动编译方法来将图形化编程编写的程序转化成控制器可直接执行文件,简单高效,很大程度简化了图形化编程的编译实现。
图1为实施方式中一种图形化编程的自动编译方法的流程图。
以下结合附图对本发明的实施方式作进一步说明,但本发明的实施不限于此。
如图1,基于一种图形化编程的自动编译方法,主要流程包括以下步骤:
(a)用户自由组合图形化模块生成图形化程序;
(b)图形化程序内存分配,生成图形化程序内存分配表,以实现对控制器的内存管理和操作;
(c)图形化程序线程分配,对图形化程序的存储结构进行分析,得到图形化程序的线程分配表,以达到图形化程序多线程执行,以实现对线程管理;
(d)图形化程序解析模块,根据图形化程序的存储结构,对图形化程序中每个图形化模块所处位置进行分析,得到图形化模块可能需要的额外指令,比如线程启动指令、条件跳转指令;
(e)图形化程序可执行文件生成模块是整个编译方法中关键的一环,在(b)、(c)、(d)步骤的基础上,生成图形化程序中每个模块对应的字节数组,然后按照图形化程序遍历的顺序将图形化模块的字节数组串接成一个完整可执行文件;
(f)通过HID或者蓝牙数据通信,将(e)步骤生成的可执行文件传输至控制器,控制器按照指令执行相应的动作,以达到图形化程序的预期动作效果。
步骤(b)包括以下步骤:
(b-1)获取图形化程序的储存结构-森林;
(b-2)遍历图形化程序对应的树结构,根据树节点ID获取图形化模块实体;
(b-3)根据图形化模块模式获取对应的参数内存分配列表,其包含参数初始化的顺序,以保证相关动作能正确执行;
(b-4)根据参数类型,分配指定大小的内存空间,然后记录参数分配的内存基址;
(b-5)对特殊参数,比如用户自定义参数和资源型参数进行额外处理,以保证满足图形化模块的内存要求和程序的健壮性;
(b-6)最终生成图形化程序内存分配表,以实现对控制器内存进行管理和操作
步骤(c)包括以下步骤:
(c-1)获取图形化程序的储存结构-森林;
(c-2)深度遍历森林中的树结构,如果节点是根节点则创建线程,且该线程为图形化程序的主线程,并记录线程信息,其包括线程ID和线程起始模块ID;
(c-3)若节点是非根节点,则判断父节点的子节点的个数,如果该节点是父节点的第一个孩子,则不进行任何操作,继续遍历;如果该节点不是父节点的第一孩子,则分配新线程,记录线程信息;
(c-4)若节点是叶子节点,则表示该节点是线程的终止节点,将该节点ID作为线程结束ID,注意图形化程序包含的叶子节点等于图形化程序包含的线程数;
(c-5)最终构造出图形化程序的线程分配表,以满足对图形化程序的多线程管理和操作。
图形化程序经过(b)、(c)步骤处理后,得到图形化程序的图形化程序内存分配表和图形化程序线程分配表,如表1和表2所示,在之后的(d)、(e)步骤中,会基于图形化内存分配表和图形化程序线程分配表对图形化程序进行处理,最终生成图形化程序对应的可执行文件。
表1 图形化程序内存分配表格式
| 模块ID | 参数ID | 参数基址 |
表2 图形化程序线程分配表格式
| 线程ID | 起始模块ID | 结束模块ID |
上述的一种图形化编程的自动编译方法,步骤(e)包括以下步骤:
(e-1)获取图形化程序存储结构-森林;
(e-2)根据不同功能需求遍历森林,功能主要包括图形化程序整体下传、图形化程序部分下传和图形化树下传,然后根据具体要求深度遍历森林中的树:
(e-3)根据树节点ID获取对应的图形化模块实体,根据图形化模块类型和模式调用其对应的XML文件,在解析图形化模块模式对应XML指令集中,需要借助指令解析XML文件来对图形化模块模式包含的指令集进行解析和替换,以生成满足具体功能的图形化模块字节数组;
(e-4)在解析和替换图形化模块模式XML文件时,并不能生成完整的图形化模块模式字节数组,可能会产生程序地址空缺,资源地址欠缺,一般先用零来填充程序地址,以形成半完整的图形化模块模式字节数组并记录图形化模块的缺省信息,最终形成图形化程序的ROM(程序)地址缺省表;
(e-5)根据遍历顺序,依次分配图形化模块的程序地址,根据生成的图形化模块字节数组的大小来决定图形化模块占据的ROM存储空间,最终生成图形化程序的ROM(程序)地址分配表
(e-6)分配完图形化模块的程序地址之后,对图形化程序需要的额外资源进行分配,以满足图形化程序中图形化模块的资源需求,比如图片、声音和文本;
(e-7)根据图形化程序的ROM地址缺省表和图形化程序的ROM地址分配表,对步骤(c)生成半完整的图形化模块字节数组中的空缺ROM地址进行填充,以形成完整的图形化模块字节数组;
(e-8)将生成的图形化模块字节数组和资源字节数组按照规则连接起来形成图形化程序最终可执行的字节数组,然后通过通信模块将数据传至控制器运行;
图形化程序经过步骤(e)处理之后,生成图形化程序半完整的可执行文件,需要经过一些额外的操作和处理,最终生成完整的可执行文件。
上述一种图形化编程的自动编译方法,其特征在于,步骤(c-3)包括如下步骤:
(e-3-1)根据树节点ID获取对应的图形化模块实体,进而获取图形化模块类型和模式;
(e-3-2)根据图形化模块类型和模式值获取相应参数初始化列表,对有初始化值的参数进行初始化操作,即对参数对应的内存地址赋予初值,以满足模块的功能需求;
(e-3-3)根据图形化模块类型和模式值中获取相应的指令集,按照如下表达式对指令进行解析和替换,首先根据指令码(Order_Code)获取指令中每个操作数(Operand)的含义(Order_Oprandmode(x1,x2…,xn)),即获取操作数的寻址方式Addressing_Mode,以下作为实例,仅供编程人员参考,无需赘述具体含义:
Order_Operandmode(x1,x2…,xn)=Get_OrderType(Order_Code)(7-1)
(e-3-4)指令中每个操作数都有不同的寻址方式,根据上述表达式获取操作数寻址方式,进而得到操作数的真实数值,然后使用真实值来替换指令中的操作数,以完成对指令的解析:
(e-3-5)指令集经过步骤(c)、(d)处理,形成满足图形化程序中的图形化模块的功能要求,在处理过程中可能存在空缺值,需要后续操作进行填补,最后形成完整的图形化模块对应的字节数组。
Claims (6)
- 图形化编程的自动编译方法,其特征在于,包括以下步骤:(a)用户自由组合图形化模块生成图形化程序;(b)图形化程序内存分配,生成图形化程序内存分配表,以实现对控制器的内存管理和操作;(c)图形化程序线程分配,对图形化程序的存储结构进行分析,得到图形化程序线程分配表,以达到图形化程序多线程执行,实现线程管理;(d)图形化程序解析模块,根据图形化程序的存储结构,对图形化程序中每个图形化模块在图形化程序中的位置进行分析,得到图形化模块可能需要的额外指令;(e)图形化程序的可执行文件生成模块是整个编译方法中关键的一环,在(b)、(c)、(d)步骤的基础上,生成图形化程序中每个图形化模块对应的字节数组,然后按照图形化程序遍历的顺序将图形化模块的字节数组串接一个完整的可执行文件;(f)通过HID或者蓝牙数据通信,将(e)步骤生成的可执行文件传输至控制器,控制器按照指令执行相应的动作,以达到图形化程序的预期动作效果。
- 根据权利要求1所述的图形化编程的自动编译方法,其特征在于,步骤(b)包括以下步骤:(b-1)获取图形化程序的储存结构即森林结构;(b-2)遍历图形化程序对应的树结构,根据树节点ID获取图形化模块实体;(b-3)根据图形化模块模式获取对应的参数内存分配列表,其包含参数初始化的顺序,以保证相关动作能正确执行;(b-4)根据参数类型,分配指定大小的内存空间,然后记录参数分配的内存基址;(b-5)对特殊参数,包括用户自定义参数和资源型参数,进行额外处理,以保证满足图形化模块的内存要求和程序的健壮性;(b-6)最终生成图形化程序内存分配表,以实现对控制器内存进行管理和操作。
- 根据权利要求1所述的图形化编程的自动编译方法,其特征在于,步骤(c)包括以下步骤:(c-1)获取图形化程序的储存结构-森林;(c-2)深度遍历森林中的树结构,如果节点是根节点则创建线程,且该线程为图形化程序的主线程,并记录线程信息,其包括线程ID和线程起始模块ID;(c-3)若节点是非根节点,则判断父节点的子节点的个数,如果该节点是父节点的第一个孩子,则不进行任何操作,继续遍历;如果该节点不是父节点的第一孩子,则分配新线程,记录线程信息;(c-4)若节点是叶子节点,则表示该节点是线程的终止节点,将该节点ID作为线程结束ID,注意图形化程序包含的叶子节点等于图形化程序包含的线程数;(c-5)最终构造出图形化程序的线程分配表,以满足对图形化程序的多线程管理和操作。
- 根据权利要求1所述的一种图形化编程的自动编译方法,其特征在于,步骤(e)包括以下步骤:(e-1)获取图形化程序存储结构-森林;(e-2)根据不同功能需求遍历森林,功能主要包括图形化程序整体下传、图形化程序部分下传和图形化树下传,然后根据具体要求深度遍历森林中的树:(e-3)根据树节点ID获取对应的图形化模块实体,根据图形化模块类型和模式调用其对应的XML文件,在解析图形化模块模式对应XML指令集中,需要借助指令解析XML文件来对图形化模块模式包含的指令集进行解析和替换,以生成具有具体功能的图形化模块字节数组;(e-4)在解析和替换图形化模块模式XML文件时,并不能生成完整的图形化模块模式字节数组,可能会产生程序地址空缺,资源地址欠缺,先用零来填充程序地址,以形成半完整的图形化模块模式字节数组并记录图形化模块的缺省信息,最终形成图形化程序的程序地址缺省表即ROM地址缺省表;(e-5)根据遍历顺序,依次分配图形化模块的程序地址,根据生成的图形化模块字节数组的大小来决定图形化模块占据的ROM存储空间,最终生成图形化程序的程序地址分配表即ROM地址分配表;(e-6)分配完图形化模块的程序地址之后,对图形化程序需要的额外资源进行分配,以满足图形化程序中图形化模块的资源需求;(e-7)根据图形化程序的ROM地址缺省表和图形化程序ROM地址分配表,对步骤(c)生成半完整的图形化模块字节数组中的空缺ROM地址进行填充,以形成完整的图形化模块字节数组;(e-8)将生成的图形化模块字节数组和资源字节数组按照规则连接起来形成图形化程序最终可执行的字节数组,然后通过通信模块将数据传至控制器运行。
- 根据权利要求4一种图形化编程的自动编译方法,其特征在于,步骤(c-3)包括如下步骤:(e-3-1)根据树节点ID获取对应的图形化模块实体,进而获取图形化模块类型和模式;(e-3-2)根据图形化模块类型和模式值获取相应参数初始化列表,对有初始化值的参数进行初始化操作,即对参数相应的内存地址赋予初值,以满足模块的功能需求;(e-3-3)根据图形化模块类型和模式值中获取相应的指令集,通过表达式对指令进行解析和替换,首先根据指令码获取指令中每个操作数的含义,即获取操作数的寻址方式;(e-3-4)指令中每个操作数都有不同的寻址方式,根据上述获取操作数寻址方式,进而得到操作数的真实数值,然后使用真实值来替换指令中的操作数,以完成对指令的解析;(e-3-5)指令集经过步骤(c)、(d)处理,形成满足图形化程序中图形化模块的功能要求,在处理过程中可能存在空缺值,则需要后续操作进行填补,最后形成完整的图形化模块对应字节数组。
- 根据权利要求1一种图形化编程的自动编译方法,其特征在于,步骤(f)将软件与控制器连接起来进行数据交换,其主要包括HID和蓝牙两种通信方式,通过数据通信模块将最终生成的程序机器语言传至控制器进行运行,同时也通过控制器连接模块实时监控控制器的状态以及程序运行状况,以保证程序正常运行。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US16/607,360 US11074052B2 (en) | 2017-04-24 | 2017-11-16 | Automatic compiling method for use in graphical programming |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710269436.4 | 2017-04-24 | ||
| CN201710269436.4A CN107168698B (zh) | 2017-04-24 | 2017-04-24 | 图形化编程的自动编译方法 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018196345A1 true WO2018196345A1 (zh) | 2018-11-01 |
Family
ID=59812913
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2017/111231 Ceased WO2018196345A1 (zh) | 2017-04-24 | 2017-11-16 | 图形化编程的自动编译方法 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US11074052B2 (zh) |
| CN (1) | CN107168698B (zh) |
| WO (1) | WO2018196345A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112015400A (zh) * | 2019-05-29 | 2020-12-01 | 厦门牙牙信息科技有限公司 | 一种将图形化代码块转换成可执行程序的解析方法 |
| US11074052B2 (en) | 2017-04-24 | 2021-07-27 | South China University Of Technology | Automatic compiling method for use in graphical programming |
Families Citing this family (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108595731B (zh) * | 2018-01-23 | 2022-02-08 | 苏州盛科通信股份有限公司 | 一种以太网芯片中动态表项的设计方法及装置 |
| CN108874395B (zh) * | 2018-05-22 | 2022-03-18 | 四川创意信息技术股份有限公司 | 一种组件化流处理过程中的硬编译方法及装置 |
| CN109634572A (zh) * | 2018-12-17 | 2019-04-16 | 王相军 | 一种流程图编程方法及系统 |
| CN109634592A (zh) * | 2018-12-29 | 2019-04-16 | 深圳点猫科技有限公司 | 图形化Python编程交互方法、系统及电子设备 |
| CN110488738B (zh) * | 2019-07-23 | 2021-04-09 | 中车青岛四方机车车辆股份有限公司 | 一种代码生成方法及装置 |
| CN110908667B (zh) * | 2019-11-18 | 2021-11-16 | 北京迈格威科技有限公司 | 神经网络联合编译的方法、装置和电子设备 |
| CN111708529B (zh) * | 2020-06-23 | 2023-06-16 | 浪潮云信息技术股份公司 | 一种基于angular通过拖拽生成表单的实现方法 |
| CN111831294B (zh) * | 2020-07-10 | 2024-03-22 | 广州市挖米科技有限责任公司 | 一种医疗系统免安装方法及装置 |
| CN113590106B (zh) * | 2021-06-25 | 2022-04-08 | 许继电气股份有限公司 | 工业控制图形化编程环境运行态数据监测系统及方法 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20040088666A1 (en) * | 2002-10-31 | 2004-05-06 | Daniel Poznanovic | System and method for partitioning control-dataflow graph representations |
| CN102915242A (zh) * | 2012-09-26 | 2013-02-06 | 北京广利核系统工程有限公司 | 一种利用图形化操作实现代码编程的方法 |
| CN105739974A (zh) * | 2016-01-25 | 2016-07-06 | 杭州电子科技大学 | 一种图形化编程控制电子积木的方法 |
| CN107168698A (zh) * | 2017-04-24 | 2017-09-15 | 华南理工大学 | 图形化编程的自动编译方法 |
Family Cites Families (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US4914568A (en) * | 1986-10-24 | 1990-04-03 | National Instruments, Inc. | Graphical system for modelling a process and associated method |
| US6437805B1 (en) * | 1996-09-23 | 2002-08-20 | National Instruments Corporation | System and method for accessing object capabilities in a graphical program |
| US6173438B1 (en) * | 1997-08-18 | 2001-01-09 | National Instruments Corporation | Embedded graphical programming system |
| JP3707727B2 (ja) * | 2000-10-30 | 2005-10-19 | インターナショナル・ビジネス・マシーンズ・コーポレーション | プログラムの最適化方法及びこれを用いたコンパイラ |
| US7272820B2 (en) * | 2002-12-12 | 2007-09-18 | Extrapoles Pty Limited | Graphical development of fully executable transactional workflow applications with adaptive high-performance capacity |
| CN101369234A (zh) * | 2008-06-24 | 2009-02-18 | 杭州电子科技大学 | 按照iec 61131-3标准的将梯形图语言编译成指令表语言的方法 |
| US8327316B2 (en) * | 2008-09-30 | 2012-12-04 | Ics Triplex Isagraf Inc. | Compilation model |
| US8423981B2 (en) * | 2009-06-18 | 2013-04-16 | National Instruments Corporation | Compiling a graphical program having a textual language program portion for a real time target |
| CN101587445A (zh) * | 2009-06-19 | 2009-11-25 | 国网电力科学研究院 | 一种plc编译执行方法 |
| CN101630285A (zh) * | 2009-08-07 | 2010-01-20 | 华南理工大学 | 一种应用于嵌入式系统的软件性能测试方法 |
| CN102073589B (zh) * | 2010-12-29 | 2013-07-03 | 北京邮电大学 | 一种基于代码静态分析的数据竞争检测方法及系统 |
| CN104239115A (zh) * | 2014-07-24 | 2014-12-24 | 汕头大学 | 一种plc编程语言的编译方法 |
| CN105653344A (zh) * | 2014-11-13 | 2016-06-08 | 镇江华扬信息科技有限公司 | 一种图形化编程系统的编译器的方法 |
| CN104572233B (zh) * | 2014-12-30 | 2019-02-22 | 北京纵横机电技术开发公司 | 一种连续功能图编程方法 |
| CN104793954B (zh) * | 2015-04-29 | 2017-12-08 | 南京南瑞继保电气有限公司 | 一种免编译的图形化组合元件封装重用方法 |
| CN105843630B (zh) * | 2016-06-08 | 2019-04-19 | 江西洪都航空工业集团有限责任公司 | 一种基于机器人图形化编程开发的方法 |
-
2017
- 2017-04-24 CN CN201710269436.4A patent/CN107168698B/zh active Active
- 2017-11-16 WO PCT/CN2017/111231 patent/WO2018196345A1/zh not_active Ceased
- 2017-11-16 US US16/607,360 patent/US11074052B2/en not_active Expired - Fee Related
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20040088666A1 (en) * | 2002-10-31 | 2004-05-06 | Daniel Poznanovic | System and method for partitioning control-dataflow graph representations |
| CN102915242A (zh) * | 2012-09-26 | 2013-02-06 | 北京广利核系统工程有限公司 | 一种利用图形化操作实现代码编程的方法 |
| CN105739974A (zh) * | 2016-01-25 | 2016-07-06 | 杭州电子科技大学 | 一种图形化编程控制电子积木的方法 |
| CN107168698A (zh) * | 2017-04-24 | 2017-09-15 | 华南理工大学 | 图形化编程的自动编译方法 |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US11074052B2 (en) | 2017-04-24 | 2021-07-27 | South China University Of Technology | Automatic compiling method for use in graphical programming |
| CN112015400A (zh) * | 2019-05-29 | 2020-12-01 | 厦门牙牙信息科技有限公司 | 一种将图形化代码块转换成可执行程序的解析方法 |
| CN112015400B (zh) * | 2019-05-29 | 2022-08-02 | 厦门牙牙信息科技有限公司 | 一种将图形化代码块转换成可执行程序的解析方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| US20200125337A1 (en) | 2020-04-23 |
| US11074052B2 (en) | 2021-07-27 |
| CN107168698B (zh) | 2020-11-24 |
| CN107168698A (zh) | 2017-09-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2018196345A1 (zh) | 图形化编程的自动编译方法 | |
| US11823053B2 (en) | Method of neural network model computation-oriented intermediate representation by constructing physical computation graph, inferring information of input and output tensor edges of each node therein, performing memory optimization on tensor edges, and optimizing physical computation graph | |
| US20190087164A1 (en) | Technique for inter-procedural memory address space optimization in gpu computing compiler | |
| US8418155B2 (en) | Generating parallel SIMD code for an arbitrary target architecture | |
| DE102020115581A1 (de) | Lenkung von planungsabhängigkeiten durch einen compiler für neuronale netze | |
| US10963229B2 (en) | Joint compilation method and system for heterogeneous hardware architecture | |
| CN112328226B (zh) | 一种嵌入式系统自动化测试代码生成方法及装置 | |
| CN113204412B (zh) | 用于任务调度的方法、电子设备和计算机存储介质 | |
| US8893144B2 (en) | Systems and methods for parallel execution of a portion of a script by interpreting comments in the script as parallel control statements | |
| CN104932905A (zh) | 一种aadl到c语言的代码自动生成方法 | |
| CN106970802A (zh) | 在领域特定语言中集成编程脚本语言的方法及装置 | |
| CN108874438A (zh) | 补丁生成方法、装置、电子设备及计算机程序产品 | |
| CN113132371A (zh) | 报文转换的方法、装置、计算机可读存储介质与处理器 | |
| CN108595171B (zh) | 对象的模型生成方法、装置、设备及存储介质 | |
| CN113138755A (zh) | 一种json序列化和反序列化的优化方法及系统 | |
| CN116661804A (zh) | 代码编译方法、代码编译装置、电子设备和存储介质 | |
| CN106844369A (zh) | 对象化sql语句构造方法及装置 | |
| KR20130053714A (ko) | Vpl을 이용한 프로그램 개발 방법과 그 방법을 구현한 프로그램이 기록된 컴퓨터로 읽을 수 있는 기록매체 | |
| CN114549277A (zh) | 一种基于编译的核函数自动多流调度方法 | |
| JP2014211864A (ja) | 未完成ソフトウェアの分析 | |
| CN107967213A (zh) | 一种航天软件临界资源访问冲突检测方法 | |
| CN116700729B (zh) | 代码编译方法及相关装置 | |
| CN1310446C (zh) | 镜像测试方法 | |
| US20180139306A1 (en) | Software optimization for multicore systems | |
| Leite et al. | Designing and executing software architectures models using SysADL Studio |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17907572 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22.01.2020) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 17907572 Country of ref document: EP Kind code of ref document: A1 |
