CN106528405A - Method and system for implementing debugging in operation of OSGi (Open Service Gateway initiative)-based building software - Google Patents

Method and system for implementing debugging in operation of OSGi (Open Service Gateway initiative)-based building software Download PDF

Info

Publication number
CN106528405A
CN106528405A CN201610879667.2A CN201610879667A CN106528405A CN 106528405 A CN106528405 A CN 106528405A CN 201610879667 A CN201610879667 A CN 201610879667A CN 106528405 A CN106528405 A CN 106528405A
Authority
CN
China
Prior art keywords
osgi
debugging
script
perform
debugged
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
CN201610879667.2A
Other languages
Chinese (zh)
Inventor
熊奇民
杨明涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Genew Technologies Co Ltd
Original Assignee
Shenzhen Genew Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Genew Technologies Co Ltd filed Critical Shenzhen Genew Technologies Co Ltd
Priority to CN201610879667.2A priority Critical patent/CN106528405A/en
Publication of CN106528405A publication Critical patent/CN106528405A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and a system for implementing debugging in operation of OSGi (Open Service Gateway initiative)-based building software. The method comprises the steps of: initializing an installation script language bank, and initializing an installed OSGi execution script language command line plug-in at an OSGi server; when a script program is captured via the OSGi execution script language command line plug-in, executing a debugging program in a console to debug the script program, and judging whether the OSGi execution script language command line plug-in is uninstalled when the debugging is completed; when the OSGi execution script language command line plug-in needs to be uninstalled, uninstalling the OSGi execution script language command line plug-in. By compiling the script program and depending on hot plug and unplug of an OSGi and based on the service search characteristic, the debugging script is independent from the debugged program, and timely compilation and timely use of the acquired context of the debugged system are realized.

Description

Being built in running software based on OSGi carries out realization of debugging method and system
Technical field
The present invention relates to OSGi platform technologys field, more particularly to debugged in being based on OSGi structure running softwares Realization method and system.
Background technology
The problem that current software system is imbedded in exposing design in actual moving process, usually and realizing;And The problem found in positioning and mode these runnings, it appears extremely difficult;Although being based on JVM(Java Virtual Machine, i.e. Java Virtual Machine)Software system have many favourable conditions, be based particularly on OSGi technologies(Open Service Gateway Initiative, i.e. open service gateway initiative agreement, which is that the one of Java mobilism modular systems is Row specification)The software system of exploitation brings many advantages condition for dynamic mode, but still relies on following two in practice Method:
1)JVM is opened into debugging mode and by IDE(Integrated Development Environment, i.e., it is integrated to open Hair ring border)Instrument interrupts mode a little;This method can compare the execution sequence of code and obtain each variable and fortune in program Row track, but the production environment in normal operation cannot be run by breakpoint;Even opening when starting remote Journey mode port, because there is potential safety hazard and operational efficiency, and do not receive;Therefore this mode is in production environment It is generally limited.
2)By the mode that third-party charging software is modified to bytecode;But business software general expenses it is higher and The technical problem for using, it is difficult to scale is used.
Therefore, prior art has yet to be improved and developed.
The content of the invention
In view of above-mentioned the deficiencies in the prior art, it is an object of the invention to provide built in running software based on OSGi carry out Realization of debugging method and system, it is intended to solve JVM in prior art and open debugging mode and interrupt mode a little by IDE instruments Because of the low defect of safety and operational efficiency.
Technical scheme is as follows:
A kind of structure in running software based on OSGi carries out realization of debugging method, wherein, the method comprising the steps of:
A, initialization installation script language library, and it is slotting to install OSGi perform script verbal orders row in the initialization of OSGi service end Part;Wherein, the OSGi perform scripts verbal order row plug-in unit is used for capturing control station input, and calls shell script;
B, when shell script is captured by OSGi perform script verbal order row plug-in units, perform debugging routine in the console Shell script is debugged, judges whether to unload the OSGi perform scripts verbal order row plug-in unit when debugging is completed;
C, when the OSGi perform scripts verbal order row plug-in unit need to be unloaded, then to the OSGi perform scripts verbal order row Plug-in unit is unloaded.
Described structure in running software based on OSGi carries out realization of debugging method, and wherein, the script storehouse is Groovy language librarys, JRuby language librarys or Scala language librarys.
Described structure in running software based on OSGi carries out realization of debugging method, and wherein, in step B, shell script can Modify in real time, and called by debugging routine again after modification is completed and preserved and debugged.
Described structure in running software based on OSGi carries out realization of debugging method, wherein, when according to script in step B After program obtains object to be debugged, property value included by object to be debugged is shown, and object to be debugged is beaten Print to control station.
A kind of structure in running software based on OSGi carries out realization of debugging system, wherein, including:
Initialization module, for initializing installation script language library, and OSGi perform scripts are installed in initialization at OSGi service end Verbal order row plug-in unit;Wherein, the OSGi perform scripts verbal order row plug-in unit is used for capturing control station input, and calls foot This program;
Debugging detection module, for when shell script is captured by OSGi perform script verbal order row plug-in units, in control Perform debugging routine to debug shell script in platform, judge whether to unload the OSGi perform scripts language when debugging is completed Speech order line plug-in unit;
Unload module, for when unloading the OSGi perform scripts verbal order row plug-in unit, then performing foot to the OSGi This verbal order row plug-in unit is unloaded.
Described structure in running software based on OSGi carries out realization of debugging system, and wherein, the script storehouse is Groovy language librarys, JRuby language librarys or Scala language librarys.
Described structure in running software based on OSGi carries out realization of debugging system, wherein, foot in the debugging detection module This program can be modified in real time, and called by debugging routine again after modification is completed and preserved and debugged.
It is described based on OSGi build running software in carry out realization of debugging system, wherein, it is described debugging detection module in when Obtain, after object to be debugged, showing property value included by object to be debugged according to shell script, and will be to be debugged Object print to control station.
Provided by the present invention structure in running software based on OSGi carries out realization of debugging method and system, and method includes: Initialization installation script language library, and OSGi perform script verbal order row plug-in units are installed in initialization at OSGi service end;When logical When crossing OSGi perform script verbal order row plug-in units and capturing shell script, debugging routine is performed in the console to shell script Debugged, judge whether to unload the OSGi perform scripts verbal order row plug-in unit when debugging is completed;It is described when unloading During OSGi perform script verbal order row plug-in units, then the OSGi perform scripts verbal order row plug-in unit is unloaded.This It is bright to rely on the hot-swappable of OSGi and be based on service search characteristic by writing shell script, realize debugging script independently of being adjusted Examination program, and the timely compiling for obtaining debugged system context when running is timely used.
Description of the drawings
Fig. 1 is the flow process for being built based on OSGi and carrying out realization of debugging method preferred embodiment in running software of the present invention Figure.
Fig. 2 is the structure for being built based on OSGi and carrying out realization of debugging system preferred embodiment in running software of the present invention Block diagram.
Specific embodiment
The present invention is provided a kind of structure in running software based on OSGi and carries out realization of debugging method and system, for making the present invention Purpose, technical scheme and effect it is clearer, clear and definite, the present invention is described in more detail below.It should be appreciated that this place The specific embodiment of description only to explain the present invention, is not intended to limit the present invention.
As shown in figure 1, the flow chart for hiding implementation method preferred embodiment for communication information of the present invention, methods described Comprise the following steps:
Step S100, initialization installation script language library, and OSGi perform scripts language life is installed in the initialization of OSGi service end Make row plug-in unit;Wherein, the OSGi perform scripts verbal order row plug-in unit is used for capturing control station input, and calls script journey Sequence;
Step S200, when shell script is captured by OSGi perform script verbal order row plug-in units, perform in the console Debugging routine is debugged to shell script, judges whether to unload the OSGi perform scripts verbal order row when debugging is completed Plug-in unit;
Step S300, when the OSGi perform scripts verbal order row plug-in unit need to be unloaded, then to the OSGi perform scripts language Speech order line plug-in unit is unloaded.
In embodiments of the invention, when OSGi perform script verbal order row plug-in units are the hot plugs using OSGi platforms Characteristic is installed or is unloaded.OSGi perform script verbal order rows plug-in unit can be installed when needing and using, and complete to adjust Try the normal operation for removing and not affecting original system later.
Script is utilized in the present invention also(Especially explanatory script)Characteristic, change code when without the need for compile Immediately come into force by translating, lift diagnosis and the efficiency debugged, save the time of orientation problem.
And, by the metaprogramming characteristic of script on the basis of the original bytecode of script is not changed, can be with The data structure checked inside object and code is woven to original object.
It can be seen that, present invention achieves conveniently to system(That is OSGi service end)Diagnosis debugging is carried out, need not be restarted System, hot-swappable mode increases to the system run/delete debugging module;The use of user under production environment is nor affected on, The shell script of diagnosis comes into force immediately, maximizes and lifts diagnosis efficiency;The class file of original system is not modified, When flexibly checking operation, user data and insertion debugging code, can prevent from introducing new problem during debugging routine.
Further, the script storehouse is Groovy language librarys, JRuby language librarys or Scala language librarys.
Wherein, Groovy is a kind of quick dynamic language for Java Virtual Machine, and it is a kind of ripe towards right As programming language, both can be used for OOP, can serve as pure script again.Need not be compiled using this kind of language Excessive code is write, while and with other characteristics in closure and dynamic language.
JRuby is that it combines Ruby language towards Ruby, a kind of interpretive program based on Java Virtual Machine (JVM) The execution mechanism of simplification and powerful JVM, including being fully integrated with Java storehouses.
Scala is the programming language of normal form more than, a kind of programming language of similar java, and design original intention is to realize stretching The language of contracting the various characteristics of integrated OOP and functional expression programming.Scala can be interoperated with Java.It uses This compiler of scalac is compiled into source file the class files of Java(The bytecode for running on JVM).Can be from All of java class storehouse is called in Scala, similarly can call the code of Scala from java application.
Preferably, in step S200, shell script can be modified in real time, and by adjusting after modification is completed and preserved Examination program is called again and is debugged.
Preferably, in the step S200 after object to be debugged is obtained according to shell script, to object to be debugged Included property value is shown, and object to be debugged is printed to control station.
Based on said method embodiment, it is real that the present invention carries out debugging in also providing a kind of structure running software based on OSGi It is existing.As shown in Fig. 2 carry out realization of debugging system in the structure running software based on OSGi including:
Initialization module 100, for initializing installation script language library, and installs OSGi execution feet in the initialization of OSGi service end This verbal order row plug-in unit;Wherein, the OSGi perform scripts verbal order row plug-in unit is used for capturing control station input, and calls Shell script;
Debugging detection module 200, for when shell script is captured by OSGi perform script verbal order row plug-in units, in control Perform debugging routine to debug shell script in platform processed, judge whether to unload the OSGi perform scripts when debugging is completed Verbal order row plug-in unit;
Unload module 300, for when unloading the OSGi perform scripts verbal order row plug-in unit, then performing to the OSGi Script order line plug-in unit is unloaded.
Preferably, carry out in realization of debugging system in described structure in running software based on OSGi, the script storehouse For Groovy language librarys, JRuby language librarys or Scala language librarys.
Preferably, carry out in realization of debugging system in described structure in running software based on OSGi, the debugging detection mould In block, shell script can be modified in real time, and called by debugging routine again after modification is completed and preserved and debugged.
Preferably, carry out in realization of debugging system in described structure in running software based on OSGi, the debugging detection mould In block after object to be debugged is obtained according to shell script, property value included by object to be debugged is shown, and will Object to be debugged prints to control station.
In sum, provided by the present invention structure in running software based on OSGi carries out realization of debugging method and system, Method includes:Initialization installation script language library, and OSGi perform script verbal order rows are installed in initialization at OSGi service end Plug-in unit;When shell script being captured by OSGi perform script verbal order row plug-in units, perform debugging routine in the console Shell script is debugged, judges whether to unload the OSGi perform scripts verbal order row plug-in unit when debugging is completed;When When need to unload the OSGi perform scripts verbal order row plug-in unit, then the OSGi perform scripts verbal order row plug-in unit is carried out Unloading.The present invention relies on the hot-swappable of OSGi and is based on service search characteristic by writing shell script, realizes that debugging script is only Debugged program is stood on, and the timely compiling for obtaining debugged system context when running is timely used.
It should be appreciated that the application of the present invention is not limited to above-mentioned citing, and for those of ordinary skills, can To be improved according to the above description or be converted, all these modifications and variations should all belong to the guarantor of claims of the present invention Shield scope.

Claims (8)

1. a kind of structure in running software based on OSGi carries out realization of debugging method, it is characterised in that methods described includes following Step:
A, initialization installation script language library, and it is slotting to install OSGi perform script verbal orders row in the initialization of OSGi service end Part;Wherein, the OSGi perform scripts verbal order row plug-in unit is used for capturing control station input, and calls shell script;
B, when shell script is captured by OSGi perform script verbal order row plug-in units, perform debugging routine in the console Shell script is debugged, judges whether to unload the OSGi perform scripts verbal order row plug-in unit when debugging is completed;
C, when the OSGi perform scripts verbal order row plug-in unit need to be unloaded, then to the OSGi perform scripts verbal order row Plug-in unit is unloaded.
2. being built in running software based on OSGi according to claim 1 carries out realization of debugging method, it is characterised in that described Script storehouse is Groovy language librarys, JRuby language librarys or Scala language librarys.
3. being built in running software based on OSGi according to claim 1 carries out realization of debugging method, it is characterised in that described In step B, shell script can be modified in real time, and called by debugging routine again after modification is completed and preserved and debugged.
4. being built in running software based on OSGi according to claim 1 carries out realization of debugging method, it is characterised in that described In step B after object to be debugged is obtained according to shell script, property value included by object to be debugged is shown, and Object to be debugged is printed to into control station.
5. a kind of structure in running software based on OSGi carries out realization of debugging system, it is characterised in that include:
Initialization module, for initializing installation script language library, and OSGi perform scripts are installed in initialization at OSGi service end Verbal order row plug-in unit;Wherein, the OSGi perform scripts verbal order row plug-in unit is used for capturing control station input, and calls foot This program;
Debugging detection module, for when shell script is captured by OSGi perform script verbal order row plug-in units, in control Perform debugging routine to debug shell script in platform, judge whether to unload the OSGi perform scripts language when debugging is completed Speech order line plug-in unit;
Unload module, for when unloading the OSGi perform scripts verbal order row plug-in unit, then performing foot to the OSGi This verbal order row plug-in unit is unloaded.
6. being built in running software based on OSGi according to claim 5 carries out realization of debugging system, it is characterised in that described Script storehouse is Groovy language librarys, JRuby language librarys or Scala language librarys.
7. being built in running software based on OSGi according to claim 5 carries out realization of debugging system, it is characterised in that described Debugging detection module in shell script can modify in real time, and after modification is completed and is preserved by debugging routine call again into Row debugging.
8. being built in running software based on OSGi according to claim 5 carries out realization of debugging system, it is characterised in that described In debugging detection module after object to be debugged is obtained according to shell script, property value included by object to be debugged is carried out Show, and object to be debugged is printed to into control station.
CN201610879667.2A 2016-10-09 2016-10-09 Method and system for implementing debugging in operation of OSGi (Open Service Gateway initiative)-based building software Pending CN106528405A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610879667.2A CN106528405A (en) 2016-10-09 2016-10-09 Method and system for implementing debugging in operation of OSGi (Open Service Gateway initiative)-based building software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610879667.2A CN106528405A (en) 2016-10-09 2016-10-09 Method and system for implementing debugging in operation of OSGi (Open Service Gateway initiative)-based building software

Publications (1)

Publication Number Publication Date
CN106528405A true CN106528405A (en) 2017-03-22

Family

ID=58331276

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610879667.2A Pending CN106528405A (en) 2016-10-09 2016-10-09 Method and system for implementing debugging in operation of OSGi (Open Service Gateway initiative)-based building software

Country Status (1)

Country Link
CN (1) CN106528405A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109189663A (en) * 2018-07-12 2019-01-11 武汉精测电子集团股份有限公司 A kind of plug-in unit adjustment method, test method and microkernel architecture system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070157174A1 (en) * 2005-12-30 2007-07-05 Boris Gebhardt Debugger with on the fly script generation
CN102929643A (en) * 2012-11-09 2013-02-13 北京中电普华信息技术有限公司 Method and system developing Java 2 platform enterprise edition (J2EE) application
CN102981957A (en) * 2012-11-30 2013-03-20 福建天晴数码有限公司 Virtual breakpoint script debugging method
US8572578B2 (en) * 2010-06-15 2013-10-29 Microsoft Corporation Script debugging
CN104657142A (en) * 2015-02-12 2015-05-27 中国科学院计算机网络信息中心 CCFD (China Computational Fluid Dynamics) system based on OSGi (Open Service Gateway Initiative) technology

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070157174A1 (en) * 2005-12-30 2007-07-05 Boris Gebhardt Debugger with on the fly script generation
US8572578B2 (en) * 2010-06-15 2013-10-29 Microsoft Corporation Script debugging
CN102929643A (en) * 2012-11-09 2013-02-13 北京中电普华信息技术有限公司 Method and system developing Java 2 platform enterprise edition (J2EE) application
CN102981957A (en) * 2012-11-30 2013-03-20 福建天晴数码有限公司 Virtual breakpoint script debugging method
CN104657142A (en) * 2015-02-12 2015-05-27 中国科学院计算机网络信息中心 CCFD (China Computational Fluid Dynamics) system based on OSGi (Open Service Gateway Initiative) technology

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
LAUTERBACH GMBH公司: ""在Eclipse IDE环境下使用TRACE32调试工具"", 《电子设计技术》 *
张晓群等: ""基于 Eclipse 的 RBAC通用插件的设计与实现"", 《现代电子技术》 *
詹涛主编: "《大学计算机实训教程》", 30 November 2014, 西北工业大学出版社 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109189663A (en) * 2018-07-12 2019-01-11 武汉精测电子集团股份有限公司 A kind of plug-in unit adjustment method, test method and microkernel architecture system
CN109189663B (en) * 2018-07-12 2021-10-29 武汉精测电子集团股份有限公司 Plug-in debugging method, plug-in testing method and micro-kernel architecture system

Similar Documents

Publication Publication Date Title
KR102059705B1 (en) Adaptive portable libraries
US10540262B2 (en) Using edit and continue to dynamically set and unset optimizations in source code while debugging
CN107526625B (en) Java intelligent contract security detection method based on bytecode inspection
US20040025083A1 (en) Generating test code for software
CN103136002B (en) The control method of a kind of upgrading automatically based on UBoot and system
CN106022130A (en) Shelling method and device for reinforced application program
JP2000181725A (en) Method and system for altering executable code and giving addition function
US10248409B1 (en) Limiting the effects of source code patches on corresponding native-code patches
US11030074B2 (en) Code update based on detection of change in runtime code during debugging
CN104462943A (en) Non-intrusive performance monitoring device and method for service system
CN101030241A (en) Method and system based on Keil C51 software protecting development
CN109408101A (en) A kind of code development maintaining method and electronic equipment for programming
CN104133676A (en) Function execution method and function execution device based on scripts
CN106528405A (en) Method and system for implementing debugging in operation of OSGi (Open Service Gateway initiative)-based building software
CN111061486B (en) Android application program increment method
JP4009517B2 (en) Program development support apparatus and compiling method
CN109144849B (en) Embedded software debugging method
CN110991614A (en) GPU neural network deep learning test method and system under Linux
CN104991774A (en) System and method for guiding interception system in UEFI platform
US9021426B2 (en) Streamlining hardware initialization code
CN103440149A (en) Method for loading non-digital signature Windows X64 drive program
CN106371895A (en) Method for upgrading KVM (Kernel-based Virtual Machine) for de-virtualization
JP2010079516A (en) Simulation method and program
TWI637277B (en) Standard programming language scripting architecture combined with virtual machine control method and program product
JP4061931B2 (en) Execution history recording device, break instruction setting device, and program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170322

RJ01 Rejection of invention patent application after publication