WO2018218908A1 - 一种图形化编程多线程同步方法 - Google Patents

一种图形化编程多线程同步方法 Download PDF

Info

Publication number
WO2018218908A1
WO2018218908A1 PCT/CN2017/113873 CN2017113873W WO2018218908A1 WO 2018218908 A1 WO2018218908 A1 WO 2018218908A1 CN 2017113873 W CN2017113873 W CN 2017113873W WO 2018218908 A1 WO2018218908 A1 WO 2018218908A1
Authority
WO
WIPO (PCT)
Prior art keywords
thread
programming
graphical
graphical programming
synchronization
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
Application number
PCT/CN2017/113873
Other languages
English (en)
French (fr)
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.)
South China University of Technology SCUT
Original Assignee
South China University of Technology SCUT
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 South China University of Technology SCUT filed Critical South China University of Technology SCUT
Publication of WO2018218908A1 publication Critical patent/WO2018218908A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming

Definitions

  • the present invention generally relates to the field of graphical programming, and more particularly to a graphical programming multi-thread synchronization method.
  • the graphical programming language is a programming language that can encapsulate the underlying implementation, and the user only needs to simply drag and drop the programming component to complete the corresponding programming task with complex logic. For most non-computer professional users, a simple and intuitive graphical programming language can bring them great convenience.
  • the existing graphical programming software is not common, and most of them are fixed in form. Due to high design difficulty or software defects, graphical programming multi-thread synchronization is not supported, which brings a lot of inconvenience to the user.
  • the present invention is directed to the deficiencies of the current technology in the field of graphical programming, and provides a graphical programming multi-thread synchronization method.
  • the object of the present invention is to provide an efficient and practical graphical programming multi-thread synchronization method, which can synchronize the graphical programming multi-threads of branches, thereby realizing more complicated graphic programs.
  • the specific technical solutions are as follows.
  • a graphical programming multi-thread synchronization method includes the following steps:
  • step (b) includes the following steps:
  • (b-1) Access the currently processed programming components, analyze the syntax structure, and translate to the underlying programming language.
  • the programming component has a certain function corresponding to the underlying programming language;
  • step (b-2) The thread start flag is used to start a new graphical programming thread; in step (b-4), the thread end flag is used to end the current graphical programming thread.
  • step (b-3) The thread allocation table is used to record the allocation of the current graphical programming thread.
  • step (c) comprises the following steps:
  • step (c-1) The new thread after synchronization is a new thread after the synchronization of the graphical thread, and is started by the first father programming component node of the merge point, that is, the thread start flag is added after processing the first father programming component node of the merge point.
  • step (c-2) The thread wait flag is used to wait for the synchronization of the graphical programming thread, that is, the processing of the current programming component is performed after waiting for all currently synchronized graphical programming threads to be processed.
  • the present invention has the following advantages and technical effects:
  • the present invention performs depth-first search on the connected components of a single graphical programming component, and processes the components one by one.
  • the programming component When the programming component is a branch node, a new branch thread startup flag is added, and the current thread is ended; when the programming component is a branch merge point (ie, a thread synchronization point), the first one of the merge points
  • the father programming component node is responsible for starting the thread and adding a thread wait flag waiting for synchronization of the graphical programming thread.
  • the multi-thread synchronization of graphical programming is realized, which makes the graphical multi-thread programming have more functions and improves the working efficiency of the programmer.
  • FIG. 1 is a flow chart of a graphical programming multi-thread synchronization method in an embodiment.
  • the main flow of a graphical programming multi-thread synchronization method includes the following steps:
  • Step (a) is made up of a single graphical programming component
  • the connected component performs a depth-first search, traversing to each vertex in the connected component,
  • the compiler notifies the unvisited and accessed nodes by respectively marking them. If you try to access a node that has not been visited before, it is found that the node has been accessed, and the connected component is not allowed to be compiled. Ensure directed acyclic of connected components consisting of graphical programming components And then compile and thread allocation one by one.
  • Step (b) When processing each programming component node, if it encounters a current programming component that is a branching node, a new thread is generated for each branch.
  • Step (b) includes the following steps:
  • (b-1) Access the currently processed programming components, analyze the syntax structure, and translate to the underlying programming language.
  • the programming component has a certain function corresponding to the underlying programming language;
  • step (b-2) The thread start flag of step (b-2) is used to start a new graphical programming thread; step (b-4) The thread end flag is used to end the current graphical programming thread.
  • Step (b-3) The thread allocation table is used to record the allocation of the current graphical programming thread to facilitate global access of the thread.
  • Step (c) Is a key step in multi-thread synchronization, when processing each programming component node, if the current programming component is a branch merge point (ie thread synchronization point) Wait until all currently synchronized graphical programming threads have finished processing before proceeding.
  • a branch merge point ie thread synchronization point
  • Step (c) includes the following steps:
  • Step (c-1) The new thread after synchronization is a new thread after the synchronization of the graphical thread, and is initiated by the first father programming component node of the merge point, that is, the thread start flag is added after the first parent programming component node of the merge point is processed.
  • Step (c-2) The thread wait flag is used to wait for the synchronization of the graphical programming thread, that is, the processing of the current programming component is performed after waiting for all currently synchronized graphical programming threads to be processed.
  • the present invention performs depth-first search on the connected components of a single graphical programming component, and processes the components one by one.
  • the programming component is a branch node
  • a new branch thread startup flag is added, and the current thread is ended;
  • the programming component is a branch merge point (ie, a thread synchronization point)
  • the first one of the merge points The father programming component node is responsible for starting the thread and adding a thread wait flag waiting for synchronization of the graphical programming thread.
  • the multi-thread synchronization of graphical programming is realized, which makes the graphical multi-thread programming have more functions and improves the working efficiency of the programmer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

一种图形化编程多线程同步方法,用户进行图形化编程,采用图形化编程多线程同步方法对图形化编程中的多线程进行管理与同步,解决了现有图形化编程系统不支持多线程同步的问题。本方法在进行多线程处理时,对由图形化编程组件组成有向无环图,其中的单个连通分量进行深度优先搜索,逐个编程组件进行处理。当该编程组件是一个分支节点时,加入新的分支线程启动标志,并结束当前线程;当该编程组件是一个分支合并点时,合并点的第一个父亲编程组件节点负责启动线程,并添加线程等待标志,等待图形化编程线程的同步。本方法能使图形化多线程编程具有线程同步的功能,使编程人员能编写具有更丰富功能的图形化程序。

Description

一种图形化编程多线程同步方法
技术领域
本发明一般涉及 图形化编程领域 ,具体涉及图形化编程多线程同步方法。
背景技术
随着社会的发展,人们生活水平的不断提高,同时计算机技术的飞速发展,软硬件编程已不再是 IT 人员的专职工作,编程者可能来自于社会上各行各业。但事实上,程序的世界仍然是大部分用户难以理解的,编程的高难度成为了人们探索计算机世界的绊脚石。非计算机专业的编程用户,是程序设计领域的特殊群体,随着使用计算机的次数增多和不断深入,他们将越来越感到现有的软硬件平台不能满足他们的需求,他们希望编程工具使用简单、功能强大;而专业的编程人员更期望使用直观易用、可读性强的编程语言。不同于文本型编程语言,图形化编程语言是一种能够将底层实现进行封装,用户仅需要简单拖拽编程组件,就能完成相应具有复杂逻辑的编程任务的编程语言。对于绝大多数非计算机专业的用户来说,简单直观的图形化编程语言能够给他们带来极大的便利。
现有的图形化编程软件并不常见,而且大都形式固定,由于设计难度高或软件缺陷,不支持图形化编程多线程同步,给使用者带来了诸多不便。
发明内容
本发明针对当前图形化编程领域技术的不足,提供了一种图形化编程多线程同步方法。本发明的目的在于提供一种高效实用的图形化编程多线程同步方法,能够对分支开的图形化编程多线程进行同步,从而实现更复杂的图形化程序, 具体技术方案如下。
一种图形化编程多线程同步方法,其包括以下步骤:
(a) 对每个由图形化编程组件组成的连通分量进行深度优先搜索,逐个编程组件进行处理,并通过分别不同标记未访问和已访问节点,以确保由图形化编程组件组成的连通分量的有向无环 ;
(b) 当处理的编程组件是一个分支节点时,添加新的图形化编程线程;
(c) 当处理的编程组件是一个分支合并点(即线程同步点)时,进行图形化编程线程的同步;
上述一种图形化编程多线程同步方法中,步骤 (b) 包括以下步骤:
(b-1) 访问当前处理的编程组件,分析语法结构,并翻译为底层编程语言。其中编程组件具有确定的功能,对应底层编程语言;
(b-2) 对节点的每个分支,均加入新的线程启动标志;
(b-3) 将新启动的图形化编程线程,均加入线程分配表;
(b-4) 在当前线程结尾,加入线程结束标志
(b-5) 将当前线程移出线程分配表。
上述一种图形化编程多线程同步方法中,步骤 (b-2) 中,所述线程启动标志用于启动新图形化编程线程;步骤 (b-4) 中,所述线程结束标志用于结束当前图形化编程线程。
上述一种图形化编程多线程同步方法中,步骤 (b-3) 中,所述线程分配表用于记录当前图形化编程线程的分配情况。
上述一种图形化编程多线程同步方法中,步骤 (c) 包括以下步骤:
(c-1) 启动同步后新线程,并加入线程分配表 ;
(c-2) 添加线程等待标志;
(c-3) 分析当前处理的编程组件的语法结构,并翻译为底层编程语言 。
上述一种图形化编程多线程同步方法中,步骤 (c-1) 中,所述同步后新线程是图形化线程同步后的新线程,由合并点的第一个父亲编程组件节点负责启动,即在合并点的第一个父亲编程组件节点处理后加入线程启动标志。
上述一种图形化编程多线程同步方法中,步骤 (c-2) 中,所述 线程等待标志,用于等待图形化编程线程的同步,即需等待所有当前同步的图形化编程线程都处理完毕后,才进行当前编程组件的处理 。
与现有技术相比,本发明具有如下优点和技术效果:
在并行化技术日益进步的今天,使用如 Fortran 或者 C 语言等传统编程语言已经难以胜任,高级编程语言能更好的支持多线程编程,但是作为高级编程语言的图形化编程语言,在多线程编程上仍然显得乏力,不支持线程间同步。本发明在进行多线程处理时,对单个图形化编程组件连通分量进行深度优先搜索,逐个编程组件进行处理。当该编程组件是一个分支节点时,加入新的分支线程启动标志,并结束当前线程;当该编程组件是一个分支合并点(即线程同步点)时,合并点的第一个 父亲编程组件节点 负责启动线程,并添加线程等待标志,等待图形化编程线程的同步。 实现了图形化编程的多线程同步,使图形化多线程编程具有更丰富的功能,提高编程人员的工作效率 。
附图说明
图 1 为实施方式中图形化编程多线程同步方法的流程图。
具体实施方式
以下结合附图对本发明的实施方式作进一步说明,但本发明的实施不限于此。
如图 1 ,一种图形化编程多线程同步方法的主要流程包括以下步骤:
(a) 对每个由图形化编程组件组成的连通分量进行深度优先搜索,逐个编程组件进行处理,并通过标记未访问和已访问节点,以确保由图形化编程组件组成的连通分量的有向无环 ;
(b) 当处理的编程组件是一个分支节点时,添加新的图形化编程线程;
(c) 当处理的编程组件是一个分支合并点(即线程同步点)时,进行图形化编程线程的同步。
步骤 (a) 是通过对单个 由图形化编程组件组成的 连通分量进行深度优先搜索,遍历到该连通分量中的每个顶点, 首先编译程序通过分别不同标记未访问和已访问节点,如果在试图访问一个之前未被访问过的节点时,发现该节点已被访问过,代表该连通分量存在环则不允许通过编译,以此确保由图形化编程组件组成的连通分量的有向无环 ,然后逐一进行编译与线程分配。
步骤 (b) 在处理每个编程组件节点时,如果遇到当前编程组件是一个分支节点时,对于每一个分支都会生成一条新线程。
步骤 (b) 包括以下步骤:
(b-1) 访问当前处理的编程组件,分析语法结构,并翻译为底层编程语言。其中编程组件具有确定的功能,对应底层编程语言;
(b-2) 对节点的每个分支,均加入新的线程启动标志;
(b-3) 将新启动的图形化编程线程,均加入线程分配表;
(b-4) 在当前线程结尾,加入线程结束标志;
(b-5) 将当前线程移出线程分配表。
其中步骤 (b-2) 所述线程启动标志用于启动新图形化编程线程;步骤 (b-4) 所述线程结束标志用于结束当前图形化编程线程。
步骤 (b-3) 所述线程分配表用于记录当前图形化编程线程的分配情况,方便线程的全局访问。
步骤 (c) 是多线程同步的关键步骤,在处理每个编程组件节点时,如果遇到当前编程组件是一个分支合并点(即线程同步点)时, 需等待所有当前同步的图形化编程线程都处理完毕后,才继续进行处理 。
步骤 (c) 包括以下步骤:
(c-1) 启动同步后新线程,并加入线程分配表 ;
(c-2) 添加线程等待标志;
(c-3) 分析当前处理的编程组件的语法结构,并翻译为底层编程语言 。
步骤 (c-1) 所述同步后新线程是图形化线程同步后的新线程,由合并点的第一个父亲编程组件节点负责启动,即在合并点的第一个父亲编程组件节点处理后加入线程启动标志 。
步骤 (c-2) 所述 线程等待标志,用于等待图形化编程线程的同步,即需等待所有当前同步的图形化编程线程都处理完毕后,才进行当前编程组件的处理。
本发明在进行多线程处理时,对单个图形化编程组件连通分量进行深度优先搜索,逐个编程组件进行处理。当该编程组件是一个分支节点时,加入新的分支线程启动标志,并结束当前线程;当该编程组件是一个分支合并点(即线程同步点)时,合并点的第一个 父亲编程组件节点 负责启动线程,并添加线程等待标志,等待图形化编程线程的同步。 实现了图形化编程的多线程同步,使图形化多线程编程具有更丰富的功能,提高编程人员的工作效率 。

Claims (7)

  1. 一种图形化编程多线程同步方法,其特征在于,包括以下步骤:
    (a) 对每个由图形化编程组件组成的连通分量进行深度优先搜索,逐个编程组件进行处理,并通过分别不同标记未访问和已访问节点,以确保由图形化编程组件组成的连通分量的有向无环;
    (b) 当处理的编程组件是一个分支节点时,添加新的图形化编程线程;
    (c) 当处理的编程组件是一个分支合并点即线程同步点时,进行图形化编程线程的同步。
  2. 根据权利要求1所述一种图形化编程多线程同步方法,其特征在于,步骤(b)包括以下步骤:
    (b-1) 访问当前处理的编程组件,分析语法结构,并翻译为底层编程语言。其中编程组件具有确定的功能,对应底层编程语言;
    (b-2) 对节点的每个分支,均加入新的线程启动标志;
    (b-3) 将新启动的图形化编程线程,均加入线程分配表;
    (b-4) 在当前线程结尾,加入线程结束标志;
    (b-5) 将当前线程移出线程分配表。
  3. 根据权利要求2所述一种图形化编程多线程同步方法,其特征在于,步骤(b-2)所述线程启动标志用于启动新图形化编程线程;步骤(b-4)所述线程结束标志用于结束当前图形化编程线程。
  4. 根据权利要求2所述一种图形化编程多线程同步方法,其特征在于,步骤(b-3)所述线程分配表用于记录当前图形化编程线程的分配情况。
  5. 据权利要求1所述一种图形化编程多线程同步方法,其特征在于,步骤(c)包括以下步骤:
    (c-1) 启动同步后新线程,并加入线程分配表;
    (c-2) 添加线程等待标志;
    (c-3) 分析当前处理的编程组件的语法结构,并翻译为底层编程语言。
  6. 根据权利要求5所述一种图形化编程多线程同步方法,其特征在于,步骤(c-1)所述同步后新线程是图形化线程同步后的新线程,由合并点的第一个父亲编程组件节点负责启动,即在合并点的第一个父亲编程组件节点处理后加入线程启动标志。
  7. 根据权利要求5所述一种图形化编程多线程同步方法,其特征在于,步骤(c-2)所述线程等待标志,用于等待图形化编程线程的同步,即需等待所有当前同步的图形化编程线程都处理完毕后,才进行当前编程组件的处理。
PCT/CN2017/113873 2017-06-01 2017-11-30 一种图形化编程多线程同步方法 Ceased WO2018218908A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710405733.7A CN107391266B (zh) 2017-06-01 2017-06-01 一种图形化编程多线程同步方法
CN201710405733.7 2017-06-01

Publications (1)

Publication Number Publication Date
WO2018218908A1 true WO2018218908A1 (zh) 2018-12-06

Family

ID=60331930

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/113873 Ceased WO2018218908A1 (zh) 2017-06-01 2017-11-30 一种图形化编程多线程同步方法

Country Status (2)

Country Link
CN (1) CN107391266B (zh)
WO (1) WO2018218908A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391266B (zh) * 2017-06-01 2021-03-30 华南理工大学 一种图形化编程多线程同步方法
CN109634572A (zh) * 2018-12-17 2019-04-16 王相军 一种流程图编程方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6421821B1 (en) * 1999-03-10 2002-07-16 Ronald J. Lavallee Flow chart-based programming method and system for object-oriented languages
CN103077006A (zh) * 2012-12-27 2013-05-01 浙江工业大学 一种基于多线程的长事务并行执行方法
CN103207903A (zh) * 2013-03-26 2013-07-17 南京南瑞继保电气有限公司 一种可视化图形程序拓扑排序方法
CN105468445A (zh) * 2015-11-20 2016-04-06 Tcl集团股份有限公司 一种基于WEB的Spark应用程序调度方法及系统
CN107391266A (zh) * 2017-06-01 2017-11-24 华南理工大学 一种图形化编程多线程同步方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100440759C (zh) * 2002-11-17 2008-12-03 华为技术有限公司 实现脚本并行执行的方法
US20050071438A1 (en) * 2003-09-30 2005-03-31 Shih-Wei Liao Methods and apparatuses for compiler-creating helper threads for multi-threading
US8549470B2 (en) * 2008-12-11 2013-10-01 The Mathworks, Inc. Multi-threaded subgraph execution control in a graphical modeling environment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6421821B1 (en) * 1999-03-10 2002-07-16 Ronald J. Lavallee Flow chart-based programming method and system for object-oriented languages
CN103077006A (zh) * 2012-12-27 2013-05-01 浙江工业大学 一种基于多线程的长事务并行执行方法
CN103207903A (zh) * 2013-03-26 2013-07-17 南京南瑞继保电气有限公司 一种可视化图形程序拓扑排序方法
CN105468445A (zh) * 2015-11-20 2016-04-06 Tcl集团股份有限公司 一种基于WEB的Spark应用程序调度方法及系统
CN107391266A (zh) * 2017-06-01 2017-11-24 华南理工大学 一种图形化编程多线程同步方法

Also Published As

Publication number Publication date
CN107391266A (zh) 2017-11-24
CN107391266B (zh) 2021-03-30

Similar Documents

Publication Publication Date Title
WO2018072493A1 (zh) 编译方法和编译系统
CN103744643B (zh) 一种多线程程序下多节点并行架构的方法及装置
CN102073588A (zh) 一种基于代码静态分析的多线程死锁检测方法及系统
CN101833476B (zh) 基于cmp的推测多线程机制下的独立栈函数调用方法
CN101571810A (zh) 执行程序的方法、验证程序结果的方法、装置及系统
CN106445656A (zh) 一种实现线程本地存储的方法及装置
CN110928531A (zh) 一种电磁频谱监测系统软件平台构建方法
CN108897569A (zh) iOS工程无用文件的清理方法及计算机可读存储介质
CN109308213B (zh) 基于改进任务调度机制的多任务断点调试方法
Marr et al. A concurrency-agnostic protocol for multi-paradigm concurrent debugging tools
CN107391266B (zh) 一种图形化编程多线程同步方法
CN105511867B (zh) 一种优化模式自动生成方法及优化装置
CN116483858A (zh) 数据查询方法及装置
Li et al. Fray: An Efficient General-Purpose Concurrency Testing Platform for the JVM
Hamou-Lhadj et al. A metamodel for the compact but lossless exchange of execution traces
CN115983047B (zh) 一种适用于多图形接口的跨平台的仿真系统
Vepsäläinen et al. Tool support for the UML automation profile-for domain-specific software development in manufacturing
CN116301826A (zh) Caa开发中调用软件命令进行数据批量处理的方法
CN1932766A (zh) 面向串行程序代码量大的领域的半自动并行化方法
CN105022653B (zh) 一种关于模板库编程约定的检查方法
Yu Design and Implementation of VxWorks Compatibility Library Based on Xenomai
Brandt et al. Concurrent, parallel garbage collection in linear time
Noll et al. An infrastructure for dynamic optimization of parallel programs
CN112558978A (zh) 支撑异构众核全芯片视角的加速编程和编译方法
CN117687805B (zh) 一种应用于plc与装置的多线程数据同步方法及系统

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: 17911935

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 1205 DATED 13/03/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17911935

Country of ref document: EP

Kind code of ref document: A1