JP2015041273A - Program update system, program update method, program update program, and communication device - Google Patents

Program update system, program update method, program update program, and communication device Download PDF

Info

Publication number
JP2015041273A
JP2015041273A JP2013172422A JP2013172422A JP2015041273A JP 2015041273 A JP2015041273 A JP 2015041273A JP 2013172422 A JP2013172422 A JP 2013172422A JP 2013172422 A JP2013172422 A JP 2013172422A JP 2015041273 A JP2015041273 A JP 2015041273A
Authority
JP
Japan
Prior art keywords
function
program
call
address
thread
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
JP2013172422A
Other languages
Japanese (ja)
Inventor
憲助 松尾
Kensuke Matsuo
憲助 松尾
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP2013172422A priority Critical patent/JP2015041273A/en
Publication of JP2015041273A publication Critical patent/JP2015041273A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To execute the correction of a plurality of functions having a dependence relation without stopping communication and bringing about malfunction of a system.SOLUTION: A program update system substitutes functions called via an intermediate table by a main body program, with corrected functions, and a plurality of functions have a dependence relation. When substitution is activated, a call to a function which the main body program tries to first call, out of the plurality of functions having a dependence relation is inhibited, and a stack in each thread in the main body program is traced to confirm whether there is a thread calling a function that is a substitution object or not. If there is a thread calling the function, the call inhibition state is released to complete the execution of the function call in the thread, and then the call inhibition state is restored. Thereafter, an address of the function in the intermediate table is rewritten with an address of a corrected function, and then the call inhibition state is released.

Description

本発明は、プログラム更新システム、プログラム更新方法及びプログラム更新プログラム、並びに、通信装置に関し、例えば、複数の加入者回線を集線する、IP(Internet Protocol)網へのアクセスネットワーク向けゲートウェイであるアクセスゲートウェイ(Access Gateway;AGW)に適用し得るものである。   The present invention relates to a program update system, a program update method, a program update program, and a communication apparatus. For example, an access gateway that is a gateway for an access network to an IP (Internet Protocol) network that collects a plurality of subscriber lines. It can be applied to Access Gateway (AGW).

アクセスゲートウェイにおける処理は、主として、CPUによるソフトウェア(アクセスゲートウェイプログラム)の実行によりなされる。また、アクセスゲートウェイは、常時、通信をサポートする状態にあることが求められる。   Processing in the access gateway is mainly performed by executing software (access gateway program) by the CPU. In addition, the access gateway is required to always support communication.

アクセスゲートウェイをアクセスゲートウェイとして機能させるアクセスゲートウェイプログラムは、プログラムであるため、適宜、バージョンアップする必要があるが、通信をサポートする状態に常にあるという制約下でバージョンアップを行うことを要する。   Since the access gateway program that causes the access gateway to function as an access gateway is a program, it is necessary to upgrade the version as appropriate. However, it is necessary to upgrade the version under the restriction that the communication is always supported.

プログラムの実行を停止することなく、プログラムの構成要素や構成単位(ここでは関数と呼ぶ)を更新する方法として、特許文献1や特許文献2に記載の方法(以下、プラグイン方式と呼ぶこともある)がある。このプラグイン方式は、プログラムの立上げ時(ビルド時)に行う前処理と、更新時に行う更新処理本体とでなる。   As a method for updating a program component or a unit (referred to as a function here) without stopping execution of the program, a method described in Patent Document 1 or Patent Document 2 (hereinafter also referred to as a plug-in method). There is). This plug-in method includes pre-processing performed at the time of program startup (at the time of building) and update processing main body performed at the time of updating.

プログラムのビルド時には、生成したオブジェクトファイルからnmコマンド(UNIX(登録商標)やそれに類似したオペレーティングシステムで採用されているコマンドの種類)によってグローバル関数の関数名を抽出し、関数単位で中間テーブルを作成し、共有ライブラリ化する。そして、プログラムを実行し、ライブラリをロードする際に、メモリにマッピングされた関数のアドレスを解決し、中間テーブルに設定する。   When building a program, the function name of the global function is extracted from the generated object file using the nm command (command type used in UNIX (registered trademark) and similar operating systems), and an intermediate table is created for each function. And make it a shared library. Then, when the program is executed and the library is loaded, the address of the function mapped in the memory is resolved and set in the intermediate table.

通常のプログラムの実行時においては、図6(A)に示すように、本体プログラム41によって、関数(図6ではfuncA)が実行される際、中間テーブル42を経由し、中間テーブル42に設定された関数のライブラリ43のアドレス0xabcdabcdにジャンプすることで関数コールを実現している。   At the time of execution of a normal program, as shown in FIG. 6A, when a function (funcA in FIG. 6) is executed by the main body program 41, it is set in the intermediate table 42 via the intermediate table 42. The function call is realized by jumping to the address 0xabcdabcd of the function library 43.

上述のような中間テーブル42を経由する構成としておくことにより、プログラムの実行を停止することなく、関数を更新することができる。   With the configuration via the intermediate table 42 as described above, the function can be updated without stopping the execution of the program.

関数の更新時においては、図6(B)に示すように、修正した関数に係る部分プログラムを共有ライブラリ(プラグインライブラリ)44として予め作成し、プラグイン適用コマンドによってプラグインライブラリ44を動的にロードし、修正した関数のアドレスを解決し、中間テーブル42における該当する関数のライブラリのアドレスをプラグインライブラリ44のアドレス0x01230123に書き換える。   When the function is updated, as shown in FIG. 6B, a partial program related to the corrected function is created in advance as a shared library (plug-in library) 44, and the plug-in library 44 is dynamically created by a plug-in application command. The address of the corrected function is resolved, and the address of the library of the corresponding function in the intermediate table 42 is rewritten to the address 0x01230123 of the plug-in library 44.

中間テーブル42におけるアドレスの書き換えによって、次回の関数の呼出しから、修正後の関数funcAが実行されるようになる。   By rewriting the address in the intermediate table 42, the corrected function funcA is executed from the next function call.

特開2005−284925号公報JP 2005-284925 A 特開2010−130620号公報JP 2010-130620 A

しかしながら、上述した従来のプラグイン方式では、他の関数と依存関係がある関数の更新に適用する際、正常に動作しない場合が生じる恐れがあった。   However, the conventional plug-in method described above may not operate normally when applied to updating a function having a dependency relationship with another function.

図7は、かかる課題が発生する場合を示している。   FIG. 7 shows a case where such a problem occurs.

例えば、funcA、funcBという2つの関数を修正し、プラグイン方式を適用させるとする。2つの関数funcA及びfuncBは、関数funcAから関数funcBが呼出されるという依存関係にある。また、関数funcAの修正処理には関数funcBの修正処理が必須であり、関数funcBの修正処理には関数funcAの修正処理が必須である。   For example, assume that two functions of funcA and funcB are modified and a plug-in method is applied. The two functions funcA and funcB have a dependency relationship that the function funcB is called from the function funcA. Further, the correction process of the function funcB is essential for the correction process of the function funcA, and the correction process of the function funcA is essential for the correction process of the function funcB.

従来のプラグインイン方式では、中間テーブル42の書き換え処理を1命令で実行することによって、1つの関数については、中間テーブル42の書き換え中に該当関数が起動されることがないことを保証していた。しかし、この例のように、プラグイン投入時(修正ライブラリのロード時)に、関数funcA及びfuncBが共に実行されていないこと、及び、プラグイン適用完了(修正処理の完了)まで関数funcA及びfuncBが実行されないことを保証することができない。そのため、修正前の関数funcAから修正後の関数funcBが実行されるなどの事象が発生し、正常に動作しない恐れがある。すなわち、図7に示すように、修正前の関数funcAの実行中で修正前の関数funcBの実行前にプラグインが適用され、関数funcAの実行時のジャンプ先アドレスや関数funcBの実行時のジャンプ先アドレスが書き換えられた場合、修正前の関数funcAが既に実行中であるため、その実行によって関数funcBを読み出す際には、修正後の関数funcBが読み出され、修正前の関数funcAと修正後の関数funcBとの不整合のため、関数funcBの処理が正常に動作しない。最悪の場合、プログラムが異常終了してしまう恐れがあり、これでは、通信をサポートする状態に常にあるという制約下を満足できない。   In the conventional plug-in method, by executing the rewriting process of the intermediate table 42 with one instruction, it is guaranteed that the corresponding function is not activated during the rewriting of the intermediate table 42 for one function. . However, as in this example, the functions funcA and funcB are not executed at the time of plug-in input (when the correction library is loaded), and the functions funcA and funcB until plug-in application completion (correction processing is completed). Cannot be guaranteed not to run. Therefore, an event such as execution of the function funcB after correction from the function funcA before correction may occur, and there is a possibility that the function does not operate normally. That is, as shown in FIG. 7, the plug-in is applied during the execution of the function funcB before the correction and before the execution of the function funcB before the correction, and the jump destination address when the function funcA is executed and the jump when the function funcB is executed. When the destination address is rewritten, since the function funcA before correction is already being executed, when the function funcB is read by the execution, the function funcB after correction is read out, and the function funcA before correction and the function after correction are corrected. The function funcB does not operate normally due to inconsistency with the function funcB. In the worst case, the program may end abnormally, and this does not satisfy the constraint that the communication is always supported.

アクセスゲートウェイでは、複数の呼処理スレッドが非同期的に呼処理を実行しているため、プラグイン適用時(修正ライブラリのロード時)に、修正対象の修正前の関数funcA、funcBが実行されていないことを保証することは困難であり、そのため、従来のアクセスゲートウェイでは、このような依存関係にある複数の関数のプラグイン方式による修正を適用不可としていた。   In the access gateway, a plurality of call processing threads execute call processing asynchronously, and therefore, the functions funcA and funcB before correction to be corrected are not executed when the plug-in is applied (when the correction library is loaded). It is difficult to guarantee this, and for this reason, in conventional access gateways, it has been impossible to apply corrections using a plug-in method for a plurality of functions having such dependency relationships.

そのため、依存関係にある複数の関数の修正を、通信を停止させることなく適切に実行できるプログラム更新システム、プログラム更新方法及びプログラム更新プログラム、並びに、通信装置が望まれている。   Therefore, a program update system, a program update method, a program update program, and a communication device that can appropriately execute correction of a plurality of functions having a dependency relationship without stopping communication are desired.

第1の本発明は、本体プログラムが中間テーブルを介して呼出す、引数と呼ばれるデータを受け取って定められた通りの処理を実行して結果を返すプログラム部分である関数を、修正した関数に置き換えるプログラム更新システムにおいて、(1)置き換え起動時に、依存関係がある複数の関数のうち、上記本体プログラムが最初に呼び出そうとする最上位依存元関数への呼出しを抑止する呼出抑止手段と、(2)上記本体プログラムが内蔵する各スレッドのスタックをトレースし、置換え対象の関数を呼出し中のスレッドがあるか確認し、置換え対象の関数を呼出し中のスレッドがあれば、抑止状態を解除し、そのスレッドについて呼出し関数の実行を完了させ、抑止状態に戻す関数非実行保証手段と、(3)置換え対象の関数を呼出し中のスレッドがない状態で、上記中間テーブルにおける関数のアドレスを、修正前の関数のアドレスから修正後の関数のアドレスへ書き換えるアドレス書換手段と、(4)アドレスの書換え後に、上記本体プログラムからの最上位依存元関数の呼出し抑止状態を解除する呼出抑止解除手段とを有することを特徴とする。   The first aspect of the present invention is a program that replaces a function, which is a program part that is called by a main body program via an intermediate table, receives data called an argument, executes a predetermined process and returns a result, with a corrected function. In the update system, (1) a call deterring means for deterring a call to the highest-level dependence source function that the main body program calls first among a plurality of functions having a dependency relationship at the time of replacement activation; ) Trace the stack of each thread built in the main program, check if there is a thread that is calling the function to be replaced, and if there is a thread that is calling the function to be replaced, release the suppression state. Function non-execution guarantee means for completing the execution of the calling function for the thread and returning it to the inhibited state, and (3) calling the function to be replaced Address rewriting means for rewriting the address of the function in the intermediate table from the address of the function before modification to the address of the function after modification in the absence of a thread, and (4) the highest level from the main body program after rewriting the address. Call suppression canceling means for canceling the call suppression state of the dependency source function.

第2の本発明は、本体プログラムが中間テーブルを介して呼出す、引数と呼ばれるデータを受け取って定められた通りの処理を実行して結果を返すプログラム部分である関数を、修正した関数に置き換えるプログラム更新方法において、(1)置き換え起動時に、依存関係がある複数の関数のうち、上記本体プログラムが最初に呼び出そうとする最上位依存元関数への呼出しを抑止する呼出抑止ステップと、(2)上記本体プログラムが内蔵する各スレッドのスタックをトレースし、置換え対象の関数を呼出し中のスレッドがあるか確認し、置換え対象の関数を呼出し中のスレッドがあれば、抑止状態を解除し、そのスレッドについて呼出し関数の実行を完了させ、抑止状態に戻す関数非実行保証ステップと、(3)置換え対象の関数を呼出し中のスレッドがない状態で、上記中間テーブルにおける関数のアドレスを、修正前の関数のアドレスから修正後の関数のアドレスへ書き換えるアドレス書換ステップと、(4)アドレスの書換え後に、上記本体プログラムからの最上位依存元関数の呼出し抑止状態を解除する呼出抑止解除ステップとを有することを特徴とする。   The second aspect of the present invention is a program that replaces a function, which is a program part that is called by a main body program via an intermediate table, receives data called an argument, executes a predetermined process and returns a result, with a corrected function. In the update method, (1) a call suppression step for suppressing a call to the highest-level dependency source function that the main body program tries to call first among a plurality of functions having a dependency relationship at the time of replacement activation; ) Trace the stack of each thread built in the main program, check if there is a thread that is calling the function to be replaced, and if there is a thread that is calling the function to be replaced, release the suppression state. A function non-execution guarantee step that completes the execution of the calling function for the thread and returns it to the inhibited state, and (3) calls the function to be replaced An address rewriting step of rewriting the address of the function in the intermediate table from the address of the function before the modification to the address of the function after the modification in the state where there is no thread in the intermediate table, and (4) after rewriting the address, And a call inhibition release step for releasing the call inhibition state of the highest-level dependent source function.

第3の本発明は、本体プログラムが中間テーブルを介して呼出す、引数と呼ばれるデータを受け取って定められた通りの処理を実行して結果を返すプログラム部分である関数を、修正した関数に置き換える機能を備えた通信装置に搭載されるコンピュータを、(1)置き換え起動時に、依存関係がある複数の関数のうち、上記本体プログラムが最初に呼び出そうとする最上位依存元関数への呼出しを抑止する呼出抑止手段と、(2)上記本体プログラムが内蔵する各スレッドのスタックをトレースし、置換え対象の関数を呼出し中のスレッドがあるか確認し、置換え対象の関数を呼出し中のスレッドがあれば、抑止状態を回除し、そのスレッドについて呼出し関数の実行を完了させ、抑止状態に戻す関数非実行保証手段と、(3)置換え対象の関数を呼出し中のスレッドがない状態で、上記中間テーブルにおける関数のアドレスを、修正前の関数のアドレスから修正後の関数のアドレスへ書き換えるアドレス書換手段と、(4)アドレスの書換え後に、上記本体プログラムからの最上位依存元関数の呼出し抑止状態を解除する呼出抑止解除手段として機能させることを特徴とする。   The third aspect of the present invention is a function that replaces a function that is a program part that is called by a main body program via an intermediate table, receives data called an argument, executes a predetermined process and returns a result, with a corrected function. (1) At the time of replacement start, among the multiple functions that have dependencies, the computer program suppresses calls to the highest dependency source function that the main body program tries to call first (2) Trace the stack of each thread built in the main program, check if there is a thread calling the function to be replaced, and if there is a thread calling the function to be replaced A function non-execution guarantee means that divides the suppression state, completes execution of the calling function for the thread, and returns to the suppression state; and (3) a replacement target An address rewriting means for rewriting the address of the function in the intermediate table from the address of the function before modification to the address of the function after modification in a state where there is no thread calling the function; and (4) after rewriting the address, It is made to function as a call suppression release means for canceling the call suppression status of the highest-level dependent source function from the program.

第4の本発明の通信装置は、第1の本発明のプログラム更新システムを有することを特徴とする。   A communication apparatus according to a fourth aspect of the present invention includes the program update system according to the first aspect of the present invention.

本発明によれば、依存関係にある複数の関数の修正を、通信を停止させることなく適切に実行することができるようになる。   According to the present invention, correction of a plurality of functions having a dependency relationship can be appropriately executed without stopping communication.

実施形態のアクセスゲートウェイ(通信装置)の機能的構成を示すブロック図である。It is a block diagram which shows the functional structure of the access gateway (communication apparatus) of embodiment. 実施形態のアクセスゲートウェイの詳細を、ハードウェア的な構成面から記載したブロック図である。It is the block diagram which described the detail of the access gateway of embodiment from the hardware-like structure side. 実施形態のアクセスゲートウェイに記憶されているAGW用プログラムの構成を示す説明図である。It is explanatory drawing which shows the structure of the program for AGW memorize | stored in the access gateway of embodiment. 実施形態のアクセスゲートウェイにおけるライブラリを修正したライブラリに置き換える動作の概要を示す説明図である。It is explanatory drawing which shows the outline | summary of the operation | movement which replaces the library in the access gateway of embodiment with the corrected library. 実施形態のアクセスゲートウェイにおけるライブラリを修正したライブラリに置き換える動作を示すフローチャートである。It is a flowchart which shows the operation | movement which replaces the library in the access gateway of embodiment with the corrected library. プログラムの構成要素や構成単位を更新する、従来のプラグイン方式の説明図である。It is explanatory drawing of the conventional plug-in system which updates the component and structural unit of a program. 従来のプラグイン方式の課題の説明図である。It is explanatory drawing of the subject of the conventional plug-in system.

(A)主たる実施形態
以下、本発明によるプログラム更新システム、プログラム更新方法及びプログラム更新プログラム、並びに、通信装置を、アクセスゲートウェイに適用した一実施形態を、図面を参照しながら説明する。
(A) Main Embodiment Hereinafter, an embodiment in which a program update system, a program update method, a program update program, and a communication apparatus according to the present invention are applied to an access gateway will be described with reference to the drawings.

(A−1)実施形態の構成
図1は、アクセスゲートウェイの機能的構成を示すブロック図である。アクセスゲートウェイ1は、収容する複数(図1では1個のみ記載している)の電話端末2をIP網3に接続させるゲートウェイ機能を担っているものである。アクセスゲートウェイ1は、電話端末2を終端している音声制御部10、IP網3側とのインタフェースを担当するネットワークインタフェース部11、ネットワークインタフェース部11を制御して収容している電話端末2とIP網3との接続等を制御する接続制御部12を有する。
(A-1) Configuration of Embodiment FIG. 1 is a block diagram showing a functional configuration of an access gateway. The access gateway 1 has a gateway function for connecting a plurality of telephone terminals 2 (only one is described in FIG. 1) to the IP network 3. The access gateway 1 includes a voice control unit 10 that terminates the telephone terminal 2, a network interface unit 11 that takes charge of an interface with the IP network 3 side, and a telephone terminal 2 that controls and accommodates the network interface unit 11 and the IP. A connection control unit 12 that controls connection with the network 3 and the like is included.

ここで、音声制御部10やネットワークインタフェース部11や接続制御部12は、主として、ソフトウェア処理によって、自己が担当する機能を実行するものである。   Here, the voice control unit 10, the network interface unit 11, and the connection control unit 12 mainly execute functions for which they are responsible by software processing.

図2は、図1とは異なり、アクセスゲートウェイ1のハードウェア的な構成面から記載したブロック図である。   FIG. 2 is a block diagram described from the hardware configuration side of the access gateway 1, unlike FIG. 1.

アクセスゲートウェイ1は、制御部20に対し、インタフェース部(IF)21を介して、入力部22、出力部23、通信部24、外部記憶装置25等が接続されているものである。また、入出力ポート16を備え、図示しない保守端末等が接続できるようになされている。制御部20は、CPUや、CPUが処理を実行する際にアクセスする各種のメモリ(ROM、RAMなど)からなり、メモリの一部はいわゆる主メモリとして利用される。外部記憶装置25は、例えば、ハードディスクやCD−ROMなどの記録媒体とそのアクセス構成とでなり、当該アクセスゲートウェイ1の主メモリにロードされるプログラム等が記憶されているものである。   In the access gateway 1, an input unit 22, an output unit 23, a communication unit 24, an external storage device 25, and the like are connected to the control unit 20 via an interface unit (IF) 21. In addition, an input / output port 16 is provided so that a maintenance terminal (not shown) can be connected. The control unit 20 includes a CPU and various memories (ROM, RAM, etc.) that are accessed when the CPU executes processing, and a part of the memory is used as a so-called main memory. The external storage device 25 includes, for example, a recording medium such as a hard disk or a CD-ROM and its access configuration, and stores a program and the like loaded into the main memory of the access gateway 1.

外部記憶装置25には、当該アクセスゲートウェイ1の立ち上げ時に主メモリにロードすべきプAGWとして動作させるためのAGW用プログラムが格納されている。図3は、外部記憶装置25に記憶されているAGW用プログラムの構成を示す説明図である。   The external storage device 25 stores an AGW program for operating as a group AGW to be loaded into the main memory when the access gateway 1 is started up. FIG. 3 is an explanatory diagram showing the configuration of the AGW program stored in the external storage device 25.

AGW用プログラム30は、複数のモジュールに分割されている。モジュールは、メインモジュール31と、ダイナミックリンクライブラリモジュール(以下、DLLモジュールと呼ぶ)32(32−a〜32−n)を有する。メインモジュール31は、いわゆる実行可能ファイルであり、OSによって主メモリにロードされるものである。DLLモジュール32は、メインモジュール31(実行可能ファイル)によって読み出されて主メモリにロードされるものである。なお、DLLモジュール32の識別子(名称)から、DLLモジュール32に係る処理の種類(ゲートウェイ処理用、障害処理用など)や、プログラムの種類(常駐プログラム、非常駐プログラム、サブルーチンなど)を区別できるようになされている。   The AGW program 30 is divided into a plurality of modules. The module includes a main module 31 and a dynamic link library module (hereinafter referred to as a DLL module) 32 (32-a to 32-n). The main module 31 is a so-called executable file and is loaded into the main memory by the OS. The DLL module 32 is read by the main module 31 (executable file) and loaded into the main memory. It should be noted that the type of processing related to the DLL module 32 (for gateway processing, fault processing, etc.) and the type of program (resident program, non-resident program, subroutine, etc.) can be distinguished from the identifier (name) of the DLL module 32. Has been made.

DLLモジュール32は、ライブラリであるので、汎用性の高い複数のプログラム部分を再利用可能な形でひとまとまりにしたものである。ライブラリに収容されているプログラム部分は、引数と呼ばれるデータを受け取り、定められた通りの処理を実行して結果を返す一連の命令群であるいわゆる関数である。同一のDLLモジュール32(ライブラリ)には、依存関係がある関数群が含まれていることがある。すなわち、ある関数が呼び出す他の関数が同一のDLLモジュール32(ライブラリ)に含まれていることがある。アクセスゲートウェイ1は、収容している電話端末2に関する呼処理を行うものであり、ある種類の呼処理は他の種類の呼処理の状態が開始条件となっていることも多く、DLLモジュール32(ライブラリ)に、依存関係がある関数群が含まれていることは多い。   Since the DLL module 32 is a library, a plurality of highly versatile program parts are grouped in a reusable form. The program portion accommodated in the library is a so-called function that is a series of instructions that receive data called an argument, execute a predetermined process, and return a result. The same DLL module 32 (library) may include a group of functions having a dependency relationship. That is, other functions called by a certain function may be included in the same DLL module 32 (library). The access gateway 1 performs call processing related to the telephone terminal 2 accommodated therein. In many types of call processing, the state of other types of call processing is often a start condition, and the DLL module 32 ( Library) often includes functions with dependencies.

メインモジュール31は、AGWとして機能させる本体プログラム31A及び中間テーブル31B(図4参照)に加え、DLLモジュール32の操作用の処理ルーチンとして、図3に示すように、当該アクセスゲートウェイ1が新規に立ち上げられた際に、自己に記述されている所定のDLLモジュールを主メモリにロードするための初期立上げ時ロードルーチン31Cや、修正された新モジュール(若しくは新プログラム)を主メモリにロードしたり、修正により不要となった旧モジュール(若しくは旧プログラム)を主メモリからアンロードしたりするための更新ルーチン31D等を備えている。   In addition to the main body program 31A and the intermediate table 31B (see FIG. 4) that function as the AGW, the main module 31 newly establishes the access gateway 1 as a processing routine for operating the DLL module 32 as shown in FIG. When loaded, the initial startup load routine 31C for loading a predetermined DLL module described in itself into the main memory, or a modified new module (or new program) is loaded into the main memory. And an update routine 31D for unloading old modules (or old programs) that are no longer necessary due to the modification from the main memory.

(A−2)実施形態の動作
次に、実施形態のアクセスゲートウェイにおけるライブラリ(言い換えると、それに属する関数)を修正したものに置き換える動作を、図面を参照しながら説明する。このような修正動作は、プログラム更新プログラムであるメインモジュール31の更新ルーチン31Dが実行する。
(A-2) Operation of Embodiment Next, the operation of replacing the library (in other words, the function belonging to it) in the access gateway of the embodiment with a modified version will be described with reference to the drawings. Such a correction operation is executed by the update routine 31D of the main module 31 which is a program update program.

図4は、この実施形態によるライブラリを修正したライブラリ(プラグインライブラリ)に置き換える動作の概要を示す説明図である。   FIG. 4 is an explanatory diagram showing an outline of the operation of replacing the library according to this embodiment with a modified library (plug-in library).

メインモジュール31(図4では省略)は、上述したように、AGWとして機能させる本体プログラム31A及び中間テーブル31Bを備えている。本体プログラム31Aは、呼処理に供している電話端末2との回線など、処理を区別して管理する単位毎に生成されたスレッド35−1〜35−Xを有する。各スレッド35−1、…、35−Xはそれぞれ、関数の呼出し情報をスタック情報として管理している。図4は、2つの関数funcA、funcBがライブラリlibAに属している場合を示しており、このライブラリlibAを修正したプラグインライブラリpluglibAも既に搭載されている場合を示している。   As described above, the main module 31 (not shown in FIG. 4) includes a main body program 31A and an intermediate table 31B that function as an AGW. The main body program 31A includes threads 35-1 to 35-X that are generated for each unit that manages and distinguishes processing such as a line with the telephone terminal 2 that is used for call processing. Each of the threads 35-1,..., 35-X manages function call information as stack information. FIG. 4 shows a case where two functions funcA and funcB belong to the library libA, and shows a case where a plug-in library pluglibA obtained by modifying the library libA is already installed.

このような状態において、メインモジュール31の更新ルーチン31Dが起動されると、ライブラリlibAからプラグインライブラリpluglibAへの置き換え処理が開始される。   In such a state, when the update routine 31D of the main module 31 is activated, a replacement process from the library libA to the plug-in library pluglibA is started.

図4では示していないが、関数funcAの実行中に関数funcBを呼び出すことが必要である依存関係については、修正を指示する保守員が更新ルーチン31Dを起動する前に入力しておくようにしても良く、また、置き換えられるライブラリlibA若しくは置き換えるプラグインライブラリpluglibAの一部で依存関係の情報を管理しておき、起動された更新ルーチン31D(より正確に言えば、更新ルーチン31Dを実行する制御部;以下、同様に表現している箇所がある)が起動直後に管理されている依存関係情報を読み込むようにしても良く、さらに、依存関係の情報を本体プログラム31A若しくは中間テーブル31Bで管理しておき、起動された更新ルーチン31Dが起動直後に管理されている依存関係情報を読み込むようにしても良く、さらにまた、起動直後に更新ルーチン31DがライブラリlibAを解釈して関数の依存関係を把握するようにしても良い。図4や後述する図5は、関数funcA及びfuncBが依存関係にあることを認識した以降の処理を示している。   Although not shown in FIG. 4, the dependency that requires the function funcB to be called during the execution of the function funcA is input before the maintenance staff instructing the correction starts the update routine 31D. Also, dependency information is managed by a part of the library libA to be replaced or the plug-in library pluglibA to be replaced, and an activated update routine 31D (more precisely, a control unit that executes the update routine 31D) Hereafter, there are places that are also expressed in the same manner), it may be possible to read the dependency information managed immediately after startup, and the dependency information is managed by the main body program 31A or the intermediate table 31B. Then, the activated update routine 31D reads the dependency information managed immediately after the activation. May be useless, In addition, the update routine 31D immediately after start-up may be to understand the function of dependency to interpret the library libA. FIG. 4 and FIG. 5 to be described later show processing after recognizing that the functions funcA and funcB are in a dependency relationship.

更新ルーチン31Dは、まず、依存関係における参照元の関数funcAの、本体プログラム31Aからの呼出しを一時的に抑止させる(ST1)。   First, the update routine 31D temporarily suppresses the call from the main body program 31A of the reference source function funcA in the dependency relationship (ST1).

その後、更新ルーチン31Dは、全てのスレッド35−1〜35−Xに対し、順繰りにスタックをトレースし、依存関係における参照元の関数funcA若しくは依存関係における参照先の関数funcBの呼出し情報がスタックに残っているか否かをチェックし、関数funcA又はfuncBの少なくとも一方の呼出し情報がスタックに残っているスレッドについては、一時的な抑止状態を中断させて、関数funcBの実行をも含めて関数funcAを実行させる(ST2)。   Thereafter, the update routine 31D sequentially traces the stack for all the threads 35-1 to 35-X, and the call information of the reference function funcA in the dependency relationship or the reference function funcB in the dependency relationship is stored in the stack. It is checked whether or not the call remains, and for the thread in which at least one of the function funcA and funcB call information remains in the stack, the temporary inhibition state is suspended, and the function funcA is executed including the execution of the function funcB. It is executed (ST2).

全てのスレッド35−1〜35−Xに対するスタックのトレースと、それに伴う関数の実行完了処理が終了すると、更新ルーチン31Dは、中間テーブル31Bにおける関数funcA及びfuncBの呼出しアドレスを、ライブラリlibAにおけるアドレスからプラグインライブラリpluglibAにおけるアドレスに書き換える(ST3)。   When the stack trace for all the threads 35-1 to 35 -X and the execution completion process of the function associated therewith are completed, the update routine 31 D obtains the call addresses of the functions funcA and funcB in the intermediate table 31 B from the addresses in the library libA. The address in the plug-in library pluglibA is rewritten (ST3).

そして最後に、更新ルーチン31Dは、依存関係における参照元の関数funcAの、本体プログラム31Aからの呼出しの一時的な抑止を解除させる(ST4)。   Finally, the update routine 31D releases the temporary inhibition of the call from the main body program 31A of the reference function funcA in the dependency relationship (ST4).

図5は、この実施形態におけるライブラリを修正したライブラリ(プラグインライブラリ)に置き換える動作(更新ルーチン31Dの主要部;プログラム更新プログラム)を示すフローチャートである。図5は、図4と同様な動作の流れを示しているが、更新ルーチン31Dによる処理の流れという観点から示しており、以下では、図5の動作主体が制御部20(のCPU)であるとして説明する。   FIG. 5 is a flowchart showing an operation (main part of the update routine 31D; program update program) for replacing the library in this embodiment with a modified library (plug-in library). FIG. 5 shows a flow of operations similar to FIG. 4, but from the viewpoint of the flow of processing by the update routine 31D. In the following, the operating subject of FIG. 5 is the control unit 20 (CPU). Will be described.

制御部20は、図5に示す処理を開始すると、まず、依存関係における参照元の関数funcAの、本体プログラム31Aからの呼出し(ジャンプ)を一時的に停止する(ステップ100)。   When the processing shown in FIG. 5 is started, the control unit 20 first temporarily stops the call (jump) of the reference source function funcA in the dependency relationship from the main body program 31A (step 100).

その後、制御部20は、未処理のスレッドが残っているか否かを確認し、未処理のスレッドが残っている場合には、その一つを処理対象にする(ステップ101S)。そして、処理対象のスレッドのスタックに、依存関係における参照元の関数funcA若しくは依存関係における参照先の関数funcBの少なくとも一方の呼出し情報が残っているか否かをチェックする(ステップ102)。   Thereafter, the control unit 20 checks whether or not an unprocessed thread remains. If an unprocessed thread remains, one of them is set as a processing target (step 101S). Then, it is checked whether the call information of at least one of the reference source function funcA in the dependency relationship or the reference destination function funcB in the dependency relationship remains in the stack of the processing target thread (step 102).

処理対象スレッドのスタックに、関数funcAの呼出し情報も関数funcBの呼出し情報も残っていない場合には、制御部20は、未処理のスレッドが残っているかの確認処理を実行させる(ステップ101E)。   When neither the function funcA call information nor the function funcB call information remains in the stack of the processing target thread, the control unit 20 performs a process of confirming whether an unprocessed thread remains (step 101E).

これに対して、関数funcA又は関数funcBの少なくとも一方の呼出し情報が処理対象スレッドのスタックに残っていると、制御部20は、本体プログラム31A(スレッド)からの関数funcAの呼出しの一時的停止を解除した後(ステップ103)、関数funcAの処理(関数funcBの処理を含む)に要する時間を保証し得る所定時間の経過を待って(ステップ104)、再び、本体プログラム31A(スレッド)からの関数funcAの呼出しを一時的に停止する(ステップ100)。   On the other hand, when the call information of at least one of the function funcA or the function funcB remains in the stack of the processing target thread, the control unit 20 temporarily stops calling the function funcA from the main body program 31A (thread). After canceling (step 103), after waiting for the elapse of a predetermined time that can guarantee the time required for the processing of the function funcA (including the processing of the function funcB) (step 104), the function from the main body program 31A (thread) again. The calling of funcA is temporarily stopped (step 100).

図5では、所定時間経過したときには直ちに、次の未処理スレッドを処理対象にするものを示したが、所定時間経過したときには、スタックに、関数funcAの呼出し情報も関数funcBの呼出し情報も残っていないことを確認してから、次の未処理スレッドを処理対象にするようにしても良い。この変形例の場合において、スタックに情報が残っていないことを確認できない場合には、上述したステップ103及びステップ104を実行することとなる。   FIG. 5 shows that the next unprocessed thread is processed immediately after a predetermined time elapses. However, when the predetermined time elapses, the function funcA call information and the function funcB call information remain in the stack. After confirming that there is no thread, the next unprocessed thread may be set as a processing target. In the case of this modification, when it cannot be confirmed that no information remains in the stack, the above-described steps 103 and 104 are executed.

全てのスレッドに対する処理が終了して未処理のスレッドがなくなると、制御部20は、中間テーブル31Bにおける関数funcA及びfuncBの呼出しアドレスを、ライブラリlibAにおけるアドレスからプラグインライブラリpluglibAにおけるアドレスに書き換える(ステップ105)。   When the processing for all the threads is completed and there are no unprocessed threads, the control unit 20 rewrites the call addresses of the functions funcA and funcB in the intermediate table 31B from the addresses in the library libA to the addresses in the plug-in library pluglibA (step). 105).

そして最後に、制御部20は、本体プログラム31Aからの関数funcAの呼出しの一時的な停止を解除し(ステップ106)、図5に示す一連の処理を終了させる。   Finally, the control unit 20 releases the temporary stop of the function funcA call from the main body program 31A (step 106), and ends the series of processes shown in FIG.

これ以降、本体プログラム31Aが関数funcAを呼出した際には、中間テーブル31Bを介して、プラグインライブラリpluglibA上の修正された関数funcAが呼出される。   Thereafter, when the body program 31A calls the function funcA, the modified function funcA on the plug-in library pluglibA is called via the intermediate table 31B.

(A−3)実施形態の効果
第1の実施形態によれば、依存関係のある複数の関数を修正したものに、通信を停止させることなく適切に置き換えることができる。
(A-3) Effect of Embodiment According to the first embodiment, it is possible to appropriately replace a plurality of functions having dependencies with each other without stopping communication.

より具体的に効果を記載すると、第1に、関数funcAの実行中にプラグインが適用された場合でも、修正前の関数funcAから修正後の関数funcBが実行されることによるプログラムの実行エラーを防止することができ、第2に、関数funcBの実行中にプラグインが適用され、修正後の関数funcBの呼出しによって期待していた動作が実行されていない状態で修正後の関数funcAに処理が戻ることによるプログラムの実行エラーを防止することができる。   To describe the effect more specifically, first, even when a plug-in is applied during the execution of the function funcA, an execution error of the program due to the execution of the function funcB after the correction from the function funcA before the correction Second, the plug-in is applied during the execution of the function funcB, and the function funcA after correction is processed in a state where the operation expected by the call of the function funcB after correction is not executed. An execution error of the program due to returning can be prevented.

(B)他の実施形態
上記実施形態では、2つの依存関係がある関数を、プラグインライブラリを適用して修正したものへ置き換える場合を示したが、3つ以上の依存関係がある関数を、プラグインライブラリを適用して修正したものへ置き換える場合に対しても、本発明を適用することができる。
(B) Other Embodiments In the above embodiment, a case where a function having two dependencies is replaced with a function modified by applying a plug-in library has been described. The present invention can also be applied to a case where a plug-in library is applied and modified.

また、上記実施形態では、アクセスゲートウェイに本発明の技術思想を適用した場合を示したが、他の通信装置に対しても、本発明の技術思想を適用することができる。   Moreover, although the case where the technical idea of this invention was applied to the access gateway was shown in the said embodiment, the technical idea of this invention is applicable also to another communication apparatus.

1…アクセスゲートウェイ、20…制御部、30…AGW用プログラム、31…メインモジュール、31A…本体プログラム、31B…中間テーブル、31C…初期立上げ時ロードルーチン、31D…更新ルーチン、32、32−a〜32−n…ダイナミックリンクライブラリモジュール(DLLモジュール)、35−1〜35−X…スレッド。   DESCRIPTION OF SYMBOLS 1 ... Access gateway, 20 ... Control part, 30 ... AGW program, 31 ... Main module, 31A ... Main body program, 31B ... Intermediate table, 31C ... Initial startup load routine, 31D ... Update routine, 32-, 32-a ˜32-n... Dynamic link library module (DLL module), 35-1 to 35-X... Thread.

Claims (5)

本体プログラムが中間テーブルを介して呼出す、引数と呼ばれるデータを受け取って定められた通りの処理を実行して結果を返すプログラム部分である関数を、修正した関数に置き換えるプログラム更新システムにおいて、
置き換え起動時に、依存関係がある複数の関数のうち、上記本体プログラムが最初に呼び出そうとする最上位依存元関数への呼出しを抑止する呼出抑止手段と、
上記本体プログラムが内蔵する各スレッドのスタックをトレースし、置換え対象の関数を呼出し中のスレッドがあるか確認し、置換え対象の関数を呼出し中のスレッドがあれば、抑止状態を解除し、そのスレッドについて呼出し関数の実行を完了させ、抑止状態に戻す関数非実行保証手段と、
置換え対象の関数を呼出し中のスレッドがない状態で、上記中間テーブルにおける関数のアドレスを、修正前の関数のアドレスから修正後の関数のアドレスへ書き換えるアドレス書換手段と、
アドレスの書換え後に、上記本体プログラムからの最上位依存元関数の呼出し抑止状態を解除する呼出抑止解除手段と
を有することを特徴とするプログラム更新システム。
In a program update system that replaces a function, which is a program part that a main program calls through an intermediate table, receives data called an argument, executes a predetermined process and returns a result, with a corrected function,
A call deterring means for deterring a call to the highest-order dependent source function that the main program first calls out of a plurality of functions having a dependency relationship at the time of replacement activation;
Trace the stack of each thread built in the main program, check if there is a thread that is calling the function to be replaced, and if there is a thread that is calling the function to be replaced, release the suppression state, A function non-execution guarantee means that completes the execution of the calling function and returns to the inhibited state;
An address rewriting means for rewriting the address of the function in the intermediate table from the address of the function before modification to the address of the function after modification, in a state where there is no thread calling the function to be replaced;
A program update system comprising: call suppression release means for canceling a call suppression state of the highest-level dependent source function from the main body program after rewriting the address.
本体プログラムが中間テーブルを介して呼出す、引数と呼ばれるデータを受け取って定められた通りの処理を実行して結果を返すプログラム部分である関数を、修正した関数に置き換えるプログラム更新方法において、
置き換え起動時に、依存関係がある複数の関数のうち、上記本体プログラムが最初に呼び出そうとする最上位依存元関数への呼出しを抑止する呼出抑止ステップと、
上記本体プログラムが内蔵する各スレッドのスタックをトレースし、置換え対象の関数を呼出し中のスレッドがあるか確認し、置換え対象の関数を呼出し中のスレッドがあれば、抑止状態を解除し、そのスレッドについて呼出し関数の実行を完了させ、抑止状態に戻す関数非実行保証ステップと、
置換え対象の関数を呼出し中のスレッドがない状態で、上記中間テーブルにおける関数のアドレスを、修正前の関数のアドレスから修正後の関数のアドレスへ書き換えるアドレス書換ステップと、
アドレスの書換え後に、上記本体プログラムからの最上位依存元関数の呼出し抑止状態を解除する呼出抑止解除ステップと
を有することを特徴とするプログラム更新方法。
In a program update method in which a function that is a program part that is called by a main body program via an intermediate table, receives data called an argument, executes processing as defined, and returns a result, is replaced with a corrected function.
A call suppression step for suppressing a call to the highest-level dependency source function that the main program first calls out of a plurality of functions having a dependency relationship at the time of replacement start;
Trace the stack of each thread built in the main program, check if there is a thread that is calling the function to be replaced, and if there is a thread that is calling the function to be replaced, release the suppression state, A function non-execution guarantee step that completes the execution of the calling function for and returns it to the inhibited state
An address rewriting step for rewriting the address of the function in the intermediate table from the address of the function before modification to the address of the function after modification, in a state where there is no thread calling the function to be replaced;
And a call deterrence canceling step of canceling the call deterrence state of the highest-level dependent source function from the main body program after rewriting the address.
本体プログラムが中間テーブルを介して呼出す、引数と呼ばれるデータを受け取って定められた通りの処理を実行して結果を返すプログラム部分である関数を、修正した関数に置き換える機能を備えた通信装置に搭載されるコンピュータを、
置き換え起動時に、依存関係がある複数の関数のうち、上記本体プログラムが最初に呼び出そうとする最上位依存元関数への呼出しを抑止する呼出抑止手段と、
上記本体プログラムが内蔵する各スレッドのスタックをトレースし、置換え対象の関数を呼出し中のスレッドがあるか確認し、置換え対象の関数を呼出し中のスレッドがあれば、抑止状態を回除し、そのスレッドについて呼出し関数の実行を完了させ、抑止状態に戻す関数非実行保証手段と、
置換え対象の関数を呼出し中のスレッドがない状態で、上記中間テーブルにおける関数のアドレスを、修正前の関数のアドレスから修正後の関数のアドレスへ書き換えるアドレス書換手段と、
アドレスの書換え後に、上記本体プログラムからの最上位依存元関数の呼出し抑止状態を解除する呼出抑止解除手段と
して機能させることを特徴とするプログラム更新プログラム。
Installed in a communication device equipped with a function that replaces a function, which is a program part that the main program calls through an intermediate table, receives data called an argument, executes the specified processing and returns the result, with a modified function Computer
A call deterring means for deterring a call to the highest-order dependent source function that the main program first calls out of a plurality of functions having a dependency relationship at the time of replacement activation;
Trace the stack of each thread built in the main program, check if there is a thread that is calling the function to be replaced, and if there is a thread that is calling the function to be replaced, divide the suppression state, A function non-execution guarantee means for completing execution of the calling function for the thread and returning it to the inhibited state;
An address rewriting means for rewriting the address of the function in the intermediate table from the address of the function before modification to the address of the function after modification, in a state where there is no thread calling the function to be replaced;
A program update program that functions as a call deterrence canceling unit that cancels the call deterrence state of the highest-level dependent source function from the main body program after rewriting the address.
請求項1に記載のプログラム更新システムを有することを特徴とする通信装置。   A communication apparatus comprising the program update system according to claim 1. 当該通信装置がアクセスゲートウェイであることを特徴する請求項4に記載の通信装置。   The communication apparatus according to claim 4, wherein the communication apparatus is an access gateway.
JP2013172422A 2013-08-22 2013-08-22 Program update system, program update method, program update program, and communication device Pending JP2015041273A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013172422A JP2015041273A (en) 2013-08-22 2013-08-22 Program update system, program update method, program update program, and communication device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013172422A JP2015041273A (en) 2013-08-22 2013-08-22 Program update system, program update method, program update program, and communication device

Publications (1)

Publication Number Publication Date
JP2015041273A true JP2015041273A (en) 2015-03-02

Family

ID=52695391

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013172422A Pending JP2015041273A (en) 2013-08-22 2013-08-22 Program update system, program update method, program update program, and communication device

Country Status (1)

Country Link
JP (1) JP2015041273A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021002317A (en) * 2019-06-21 2021-01-07 ベイジン バイドゥ ネットコム サイエンス アンド テクノロジー カンパニー リミテッド Method, apparatus, device and storage medium for upgrading application
JP7440822B2 (en) 2019-10-31 2024-02-29 京セラドキュメントソリューションズ株式会社 information processing system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021002317A (en) * 2019-06-21 2021-01-07 ベイジン バイドゥ ネットコム サイエンス アンド テクノロジー カンパニー リミテッド Method, apparatus, device and storage medium for upgrading application
US11281445B2 (en) 2019-06-21 2022-03-22 Beijing Baidu Netcom Science And Technology Co., Ltd. Method, apparatus, device and storage medium for upgrading application
JP7090657B2 (en) 2019-06-21 2022-06-24 ベイジン バイドゥ ネットコム サイエンス テクノロジー カンパニー リミテッド Methods, devices, devices and storage media for upgrading applications
JP7440822B2 (en) 2019-10-31 2024-02-29 京セラドキュメントソリューションズ株式会社 information processing system

Similar Documents

Publication Publication Date Title
US10701084B2 (en) Reliable and secure firmware update with a dynamic validation for internet of things (IoT) devices
US10761860B2 (en) Dynamically loaded plugin architecture
US8499289B2 (en) Method, device and system for realizing kernel online patching
US8782643B2 (en) Device and method for controlling communication between BIOS and BMC
US7389505B2 (en) Method and apparatus for modifying software
CA2968947C (en) Enhanced upgrade path
US8112745B2 (en) Apparatus and method for capabilities verification and restriction of managed applications in an execution environment
JP2012508919A (en) Application restore point
KR20120052406A (en) Firmware image update and management
US20150193218A9 (en) Enhanced upgrade path
US20080301389A1 (en) Memory-protection method and apparatus
KR20170067826A (en) Updating of firmware
US8924947B2 (en) Direct deployment of static content
CN110908730A (en) Cloud platform configuration file management method and management system
CN106708547B (en) Service plug-in management method and system
US8997074B1 (en) Dynamic linking library (DLL) replacement in an embedded operating system environment
JP2023009293A (en) Communication apparatus and information processing method
JP2015041273A (en) Program update system, program update method, program update program, and communication device
CN104111843A (en) Sandbox based script updating method and system
US8539468B2 (en) System and methods for replacing software application classes using transparent object adapters
JP6073710B2 (en) Information processing apparatus, automatic recovery method from startup failure, and automatic recovery program from startup failure
CN114356658A (en) Processing method of firmware upgrading exception, computer equipment and readable storage medium
JP2007188244A (en) Process-sharing memory management system, process- sharing memory management method and program
KR20140069936A (en) Method for upgrading hypervisor component and system thereof
CN111459570A (en) PDF plug-in loading method, electronic equipment and computer storage medium