WO2012086948A2 - 에이엠 캐드용 디엘엘의 실시간 로딩 사용방법 - Google Patents

에이엠 캐드용 디엘엘의 실시간 로딩 사용방법 Download PDF

Info

Publication number
WO2012086948A2
WO2012086948A2 PCT/KR2011/009405 KR2011009405W WO2012086948A2 WO 2012086948 A2 WO2012086948 A2 WO 2012086948A2 KR 2011009405 W KR2011009405 W KR 2011009405W WO 2012086948 A2 WO2012086948 A2 WO 2012086948A2
Authority
WO
WIPO (PCT)
Prior art keywords
dll
file
cad
stream
memory
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/KR2011/009405
Other languages
English (en)
French (fr)
Other versions
WO2012086948A3 (ko
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.)
HD Hyundai Heavy Industries Co Ltd
Original Assignee
Hyundai Heavy Industries 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 Hyundai Heavy Industries Co Ltd filed Critical Hyundai Heavy Industries Co Ltd
Priority to CN201180059796.2A priority Critical patent/CN103415837B/zh
Publication of WO2012086948A2 publication Critical patent/WO2012086948A2/ko
Publication of WO2012086948A3 publication Critical patent/WO2012086948A3/ko
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/362Debugging of software

Definitions

  • the present invention relates to a method for using real-time loading of the AM CAD DLL, and more specifically, to load the DLL file in memory in real time without going through a reboot process of a computer, program, etc.
  • Dynamic Link in contrast to the described static link, can be defined as code that is linked to run-time rather than being bound during the link process. That is, it exists separately from the executable file and is dynamically linked as the executable file is executed. Using dynamic linking, many executables can share a single function loaded in memory, reducing the waste of memory or hard disk and speeding up program execution.
  • DLL Dynamic Link Library
  • the present invention has been made to solve the above problems of the prior art, by loading a DLL file in memory in real time without going through a reboot process of the computer, programs, etc., so that it can be used immediately to improve the efficiency of AM CAD usage time
  • the purpose is to provide a real-time loading method of DLLs for AM CAD that can be improved.
  • the present invention includes a first step of opening a DLL file for AM CAD program in the form of a file stream and outputting it in the form of a stream; Loading the DLL file in the stream form on a memory; Converting the DLL file of the stream type loaded on the memory into an instance object type usable in an AM CAD program; And a fourth step of dynamically invoking the instance object.
  • the program debug database (PDB) file is opened together with the DLL file and output as a stream.
  • PDB program debug database
  • the method for using real-time loading of the AM CAD DLL converts the DLL file into the form of an instance object usable by the AM CAD program in a state in which the DLL file is loaded into the memory and reboots the computer or the program. It loads a new DLL file into memory in real time without using it and makes it available immediately.
  • the PDB file is also transferred, so that the error of the DLL code can be checked more easily.
  • FIG. 1 is a view schematically showing a method of using the real-time loading of the DLL for the AM CAD according to the present invention.
  • FIG. 1 is a view schematically showing a method of using real-time loading of the AM CAD DLL according to the present invention.
  • the method of using real-time loading of the AM CAD DLL basically comprises opening the AM CAD program DLL file in a file stream form and outputting it in a stream form, and loading the DLL file in the stream form on a memory. And a third step of converting the stream-type DLL file loaded on the memory into an instance object type usable in an AM CAD program, and a fourth step of dynamically calling the instance object.
  • the DLL file is opened and output in the form of a stream through the FileStream class (providing a function of reading and writing a file), and then a memory stream object and a buffer are created to store the DLL file stream in memory.
  • the program source code is as follows.
  • Assembly type object Assembly open the DLL file, get as a stream to the FileStream type object fs, and then create a memory stream object. Then create a buffer of 1024 bytes, read 1024 bytes to the end of the Fs stream, and write to Ms. Data recorded in Ms is stored in assembly object according to Assembly class type.
  • the DLL file can be loaded into memory and called as a function.
  • the MemoryStream class creates a stream that uses memory as a backing store instead of a disk or network connection. Encapsulates data stored in an unsigned byte array that is initialized or made empty when the object is created, and the encapsulated data can be accessed directly from memory, reducing the need for application temporary buffers and files.
  • the DLL file stream stored in the memory is converted into a form of an instance object usable in the AM CAD program, and processed into a dynamic output form.
  • An example of the program source code is as follows.
  • the source code extracts only types such as type type from the data types stored in the assembly object, creates a new object with an array type name of argsConstructor if the type name is the same, and calls the methodName function in the DLL. Use InvokeMember to do this. Here the arguments in InvokeMember are simply written to use the InvokeMember function.
  • CreateInstance function of the Activator class is make an instance of the specified type using the constructor that best matches the specified parameters.
  • a PDB (Program Debug Database) file can be opened and output in a stream form together with a DLL file.
  • a DLL file is loaded into a memory in a stream form, the PDB file is also transmitted together. Checking for errors can be made easier, and the example of the program source code for using these PDB and DLL files at the same time is as follows.
  • the present invention may further include a fifth step of calling the DLL and the PDB file passed through the first to fourth steps in an external terminal, which stores the DLL file in a memory on the server and accesses the server on the network.
  • a plurality of external terminals are used to make the DLL file available in an AD CAD program in real time.
  • An example of a PML (Product Modeling Language) is as follows.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)
  • Software Systems (AREA)

Abstract

본 발명은 AM 캐드용 DLL의 실시간 로딩 사용방법에 관한 것으로서, 이는 컴퓨터, 프로그램 등의 재부팅 과정을 거치지 않고 실시간으로 DLL 파일을 메모리상에 로딩시킨 다음 바로 사용가능하도록 하여 AM 캐드 사용의 시간대비 효율성을 향상시키기 위한 것이다. 이를 위해 본 발명은, AM 캐드 프로그램용 DLL 파일을 파일스트림 형태로 오픈하여 스트림 형태로 출력하는 제1 단계와; 상기 스트림 형태의 DLL 파일을 메모리상에 적재하는 제2 단계와; 메모리상에 적재된 상기 스트림 형태의 DLL 파일을 AM 캐드 프로그램에서 사용가능한 인스턴스 오브젝트 형태로 변환하는 제3 단계와; 상기 인스턴스 오브젝트를 동적으로 호출하는 제4 단계;로 이루어지는 것을 특징으로 한다.

Description

에이엠 캐드용 디엘엘의 실시간 로딩 사용방법
본 발명은 AM 캐드용 DLL의 실시간 로딩 사용방법에 관한 것으로서, 보다 구체적으로는 컴퓨터, 프로그램 등의 재부팅 과정을 거치지 않고 실시간으로 DLL 파일을 메모리상에 로딩시킨 다음 바로 사용가능하도록 하여 AM 캐드 사용의 시간대비 효율성을 향상시키기 위한 AM 캐드용 DLL의 실시간 로딩 사용방법에 관한 것이다.
일반적으로 프로그램 작성 시 소스 코드를 컴파일 후 목적파일(*.obj)이 만들어지면 이들을 서로 연결하는 링크 과정으로 들어가게 되고, 여기서의 링크는 컴파일로 만들어진 여러 목적파일을 묶여 하나의 *.exe파일로 출력하게 되며, 이렇게 컴파일 과정에서 링크되는 것을 정적 링크(Static Link)라고 한다. 정적 링크를 사용하면 하나의 실행파일에 대해서만 유효하다. 즉, 실행파일이 여러개 있을때 똑같은 기능을 하는 함수가 필요하다면 각 실행파일에 같은 함수들이 모두 정의되어야하기 때문에 실행시 많은 코드들이 메모리에 로드되어 필요없는 공간을 사용하게 되는 단점을 갖는다.
기술된 정적링크와 대비되는 의미의 동적링크(Dynamic Link)는 링크 과정에서 묶이는 것이 아니라 실행시간(Run-Time)에 연결되는 코드라고 정의할 수 있다. 즉, 실행파일과는 별도로 존재하고 실행파일이 실행되면서 동적으로 링크되어 사용된다. 동적링크를 사용하면 많은 실행파일들이 메모리에 로드된 하나의 함수를 공유할수 있기 때문에 메모리나 하드 디스크의 낭비를 줄일 수 있고 프로그램의 실행속도가 빨라질 수 있다.
이러한 동적링크의 장점을 활용한 DLL(Dynamic Link Library)의 경우 다른 프로그램으로 인해 이미 메모리에 로드된 상태라면 로드과정이 필요없어지게 되지만, 현재까지 공지된 기술에 따르면 컴퓨터, 프로그램 등의 재부팅 과정을 거치지 않고 실시간으로 새로운 DLL 파일을 메모리상에 로딩시키기 어려운 문제점이 있다.
본 발명은 상기한 종래 기술의 문제점을 해결하기 위해 안출된 것으로서, 컴퓨터, 프로그램 등의 재부팅 과정을 거치지 않고 실시간으로 DLL 파일을 메모리상에 로딩시킨 다음 바로 사용가능하도록 하여 AM 캐드 사용 시간대비 효율성을 향상시킬 수 있는 AM 캐드용 DLL의 실시간 로딩 사용방법을 제공하는데 그 목적이 있다.
상기 목적을 달성하기 위하여, 본 발명은, AM 캐드 프로그램용 DLL 파일을 파일스트림 형태로 오픈하여 스트림 형태로 출력하는 제1 단계와; 상기 스트림 형태의 DLL 파일을 메모리상에 적재하는 제2 단계와; 메모리상에 적재된 상기 스트림 형태의 DLL 파일을 AM 캐드 프로그램에서 사용가능한 인스턴스 오브젝트 형태로 변환하는 제3 단계와; 상기 인스턴스 오브젝트를 동적으로 호출하는 제4 단계;로 이루어지는 것을 특징으로 한다.
상기 제1 단계에서는 DLL 파일과 함께 PDB(Program Debug Database) 파일을 오픈하여 스트림 형태로 출력하는 것을 특징으로 한다.
상술된 바와 같이, 본 발명에 따른 AM 캐드용 DLL의 실시간 로딩 사용방법은 DLL 파일을 스트림 형태로 메모리에 적재한 상태에서 AM 캐드 프로그램에서 사용가능한 인스턴스 오브젝트 형태로 변환하여 컴퓨터, 프로그램 등의 재부팅 과정을 거치지 않아도 실시간으로 새로운 DLL 파일을 메모리상에 로딩시킨 다음 바로 사용가능하게 한다.
또한 DLL 파일을 스트림 형태로 메모리에 적재할 시 PDB 파일 또한 함께 전송하여 DLL 코드의 오류에 대한 확인작업이 보다 용이하게 진행되도록 할 수 있다.
도 1은 본 발명에 따른 AM 캐드용 DLL의 실시간 로딩 사용방법을 개략적으로 도시한 도면.
이하, 도면을 참조로 하여 본 발명에 따른 AM 캐드용 DLL의 실시간 로딩 사용방법을 설명하기로 한다.
도 1은 본 발명에 따른 AM 캐드용 DLL의 실시간 로딩 사용방법을 개략적으로 도시한 도면이다.
본 발명에 따른 AM 캐드용 DLL의 실시간 로딩 사용방법은 기본적으로 AM 캐드 프로그램용 DLL 파일을 파일스트림 형태로 오픈하여 스트림 형태로 출력하는 제1 단계와, 상기 스트림 형태의 DLL 파일을 메모리상에 적재하는 제2 단계와, 메모리상에 적재된 상기 스트림 형태의 DLL 파일을 AM 캐드 프로그램에서 사용가능한 인스턴스 오브젝트 형태로 변환하는 제3 단계와, 상기 인스턴스 오브젝트를 동적으로 호출하는 제4 단계로 이루어진다.
상기 제1 및 제2 단계에서는 FileStream 클래스(파일을 읽고 쓰는 기능을 제공)를 통해 DLL 파일을 오픈하여 스트림 형태로 출력한 다음, 메모리 스트림 객체 및 버퍼를 생성하여 DLL 파일 스트림이 메모리상에 저장되도록 하며, 이의 프로그램 소스코드 예는 다음과 같다.
Assembly assembly = null;
using (FileStream fs = File.Open(dllName, FileMode.Open))
{
using (MemoryStream ms = new MemoryStream())
{
byte[] byteBuffer = new byte[1024];
int nRead = 0;
while ((nRead = fs.Read(byteBuffer, 0, 1024)) > 0)
{
ms.Write(byteBuffer, 0, nRead);
}
assembly = Assembly.Load(ms.ToArray());
}
}
상기 소스코드에 대해 구체적으로 살펴보면, Assembly형 객체 Assembly를 생성하고, DLL 파일을 열어서 FileStream형 객체 fs에 스트림형태로 받아온 다음, 메모리 스트림 객체를 생성한다. 그 후 1024바이트 크기의 버퍼를 생성하고, Fs 스트림의 끝까지 1024 바이트씩 읽어들여 Ms에 기록한다. Ms에 기록된 데이터를 Assembly 클래스형에 맞게 assembly 객체에 저장한다.
이와 같은 상기 소스코드의 과정에 따라 DLL 파일을 메모리에 적재해 놓았다가 함수형태로 호출하여 사용할 수 있게 되며, 참고로 MemoryStream 클래스에서는 디스크나 네트워크 연결 대신 메모리를 백업 저장소로 사용하는 스트림을 만들고, MemoryStream 객체 작성 시 초기화되거나 비어 있게 만들어진 부호 없는 바이트 배열로 저장된 데이터를 캡슐화하며, 캡슐화된 데이터는 메모리에서 직접 액세스할 수 있음에 따라 응용 프로그램의 임시 버퍼 및 파일의 필요성을 감소시키는 기능을 수행한다.
상기 제2 내지 제4 단계에서는 메모리에 저장된 DLL 파일 스트림을 AM 캐드 프로그램에서 사용가능한 인스턴스 오브젝트 형태로 변환하여 동적 출력가능한 형태로 가공하며, 이의 프로그램 소스코드 예는 다음과 같다.
foreach (Type type in assembly.GetExportedTypes())
{
if (type.FullName.Equals(typeName))
{
object[] argsConstructor = new object[] { };
object instance = Activator.CreateInstance(type,
argsConstructor);
object[] argsMethod = new object[] { };
object outValue = type.InvokeMember(methodName,
BindingFlags.Default | BindingFlags.InvokeMethod,
null, instance, argsMethod);
}
}
상기 소스코드에 대해 구체적으로 살펴보면, assembly 객체에 저장된 데이터 타입 중에 Type형 type과 같은 것들만 추출하고, 타입명(typeName)과 같으면 새로운 오브젝트를 argsConstructor이라는 배열형태 이름으로 생성하며, DLL 안에 methodName 함수를 호출하기 위해서 InvokeMember를 사용한다. 여기서 InvokeMember 안의 argument들은 단순히 그 InvokeMember 함수를 사용하기 위해 기록된 것이다.
참고로 Activator 클래스의 CreateInstance 함수지정된 매개 변수와 가장 일치하는 생성자를 사용하여 지정된 형식의 인스턴스를 만들게 된다.
한편으로 상기 제1 단계에서는 DLL 파일과 함께 PDB(Program Debug Database) 파일을 오픈하여 스트림 형태로 출력할 수 있는데, 다시 말해서 DLL 파일을 스트림 형태로 메모리에 적재할 시 PDB 파일 또한 함께 전송하여 DLL 코드의 오류에 대한 확인작업이 보다 용이해지도록 할 수 있으며, 이러한 PDB와 DLL 파일을 동시에 사용하기 위한 프로그램 소스코드의 예는 하기와 같다.
sing (FileStream fs = File.Open(dllName, FileMode.Open), pfs = File.Open(pdbName, FileMode.Open))
{
using (MemoryStream ms = new MemoryStream(), pms = new MemoryStream())
{
...
assembly = Assembly.Load(ms.ToArray(), pms.ToArray());
}
}
추가로 본 발명에서는 상기 제1 내지 제4 단계를 거친 DLL 및 PDB 파일을 외부단말기에서 호출하는 제5 단계를 더 포함할 수 있는데, 이는 서버상의 메모리에 DLL 파일을 저장하여 네트워크상에서 그 서버와 접속된 복수개의 외부단말기가 실시간으로 그 DLL 파일을 AD 캐드 프로그램에서 사용가능하도록 하기 위한 것이며, 이를 위한 PML(Product Modeling Language)의 일례는 하기와 같다.
define function !!HHIDllAgent()
import 'HHI.Marine.Hull.Utility.Agent'
handle any
import 'Curved_DLL/HHI.Marine.Hull.Utility.Agent'
handle any
endhandle
endhandle
using namespace 'HHI.Marine.Hull.Utility.Agent'
!dll = '\\10.4.20.34\DLL\HHI.Marine.Field.Any.dll'
!typ = 'HHI.Marine.Any.AnyWrapper'
!exe = 'Show'
!pdb = '\\10.4.20.34\PDB\HHI.Marine.Field.Any.pdb'
!obj = object HHIDllAgentWrapper()
!obj.Execution(!dll, !typ, !exe, !pdb)
endfunction

Claims (3)

  1. AM 캐드 프로그램용 DLL 파일을 파일스트림 형태로 오픈하여 스트림 형태로 출력하는 제1 단계와;
    상기 스트림 형태의 DLL 파일을 메모리상에 적재하는 제2 단계와;
    메모리상에 적재된 상기 스트림 형태의 DLL 파일을 AM 캐드 프로그램에서 사용가능한 인스턴스 오브젝트 형태로 변환하는 제3 단계와;
    상기 인스턴스 오브젝트를 동적으로 호출하는 제4 단계;로 이루어지는 것을 특징으로 하는 AM 캐드용 DLL의 실시간 로딩 사용방법.
  2. 청구항 1에 있어서,
    상기 제1 단계에서는 DLL 파일과 함께 PDB(Program Debug Database) 파일을 오픈하여 스트림 형태로 출력하는 것을 특징으로 하는 AM 캐드용 DLL의 실시간 로딩 사용방법.
  3. 청구항 2에 있어서,
    상기 제1 내지 제4 단계를 거친 DLL 및 PDB 파일을 외부단말기에서 호출하는 제5 단계가 더 포함되는 것을 특징으로 하는 AM 캐드용 DLL의 실시간 로딩 사용방법.
PCT/KR2011/009405 2010-12-21 2011-12-07 에이엠 캐드용 디엘엘의 실시간 로딩 사용방법 Ceased WO2012086948A2 (ko)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201180059796.2A CN103415837B (zh) 2010-12-21 2011-12-07 Am cad用动态链接库的实时加载使用方法

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20100132017A KR101485561B1 (ko) 2010-12-21 2010-12-21 Am 캐드용 dll의 실시간 로딩 사용방법
KR10-2010-0132017 2010-12-21

Publications (2)

Publication Number Publication Date
WO2012086948A2 true WO2012086948A2 (ko) 2012-06-28
WO2012086948A3 WO2012086948A3 (ko) 2012-09-07

Family

ID=46314574

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2011/009405 Ceased WO2012086948A2 (ko) 2010-12-21 2011-12-07 에이엠 캐드용 디엘엘의 실시간 로딩 사용방법

Country Status (3)

Country Link
KR (1) KR101485561B1 (ko)
CN (1) CN103415837B (ko)
WO (1) WO2012086948A2 (ko)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116400945A (zh) * 2023-06-08 2023-07-07 中航信移动科技有限公司 一种动态链接库升级方法、电子设备及存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111984342B (zh) * 2020-09-03 2023-04-07 科大讯飞股份有限公司 一种加载动态链接库的方法和相关装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6963908B1 (en) 2000-03-29 2005-11-08 Symantec Corporation System for transferring customized hardware and software settings from one computer to another computer to provide personalized operating environments
JP3907463B2 (ja) 2000-12-26 2007-04-18 富士通株式会社 Cadデータを管理するためのプログラムを記録したコンピュータ読み取り可能な記録媒体およびプログラム
US7305397B2 (en) 2002-01-31 2007-12-04 Tririga Llc Caching data communications to reduce latency
KR20100048779A (ko) * 2008-10-31 2010-05-11 (주)코지소프트 플랫폼 독립적인 어플리케이션 실행 방법 및 그 장치

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116400945A (zh) * 2023-06-08 2023-07-07 中航信移动科技有限公司 一种动态链接库升级方法、电子设备及存储介质
CN116400945B (zh) * 2023-06-08 2023-10-27 中航信移动科技有限公司 一种动态链接库升级方法、电子设备及存储介质

Also Published As

Publication number Publication date
KR101485561B1 (ko) 2015-01-22
CN103415837A (zh) 2013-11-27
WO2012086948A3 (ko) 2012-09-07
CN103415837B (zh) 2016-08-10
KR20120070456A (ko) 2012-06-29

Similar Documents

Publication Publication Date Title
US10990423B2 (en) Performance optimizations for emulators
EP1486870B1 (en) Systems and Methods for Employing Tagged Dataypes in a Dynamic Runtime Environment
Brachthäuser et al. Effects, capabilities, and boxes: from scope-based reasoning to type-based reasoning and back
US8296745B2 (en) Method and apparatus for portable stub generation
CN113626038B (zh) 代码转换方法、装置、设备以及存储介质
CA2082068A1 (en) System and method for automatically interfacing call conventions between two dissimilar program units
WO2011158478A1 (ja) データ処理システム及びデータ処理方法
WO2012086948A2 (ko) 에이엠 캐드용 디엘엘의 실시간 로딩 사용방법
Lohmann et al. Lean and efficient system software product lines: Where aspects beat objects
WO2016076583A1 (ko) 주석기반의 의사코드를 이용한 프로그램 변환 방법 및 그 방법을 구현하기 위한 프로그램이 기록된 컴퓨터 판독 가능한 기록매체
CN112148283A (zh) 一种跨平台的abi兼容c++组件框架的实现方法
Wootton General purpose input/output (GPIO)
Ung et al. SRL-a simple retargetable loader
Vasudevan Sakthi: A retargetable dynamic framework for binary instrumentation
WO2020215425A1 (zh) 一种软件运行方法、系统、计算设备及存储介质
Aubert Quick Recipes on Symbian OS: Mastering C++ Smartphone Development
서영원 Automating Cross-Language Interoperability with MLIR and LLVM
Terashima et al. Static call graph generator for C++ using debugging information
Janakiram et al. Object‐oriented wrappers for the Linux kernel
de Paula A Foreign Function Interface For Pallene
Sonesten RTIC Scope: Real-Time Tracing for the RTIC RTOS Framework
Adler Foreign Library Interface
Bügling The component template library protocol and its java implementation
Krook et al. Higher-Order Concurrency for Microcontrollers
KOMÁREK Extension of the eRPC generator implementation

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

Country of ref document: EP

Kind code of ref document: A2

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11851001

Country of ref document: EP

Kind code of ref document: A2