CN1271518C - A Method of Dynamically Querying Application Configuration Information - Google Patents
A Method of Dynamically Querying Application Configuration Information Download PDFInfo
- Publication number
- CN1271518C CN1271518C CN 03148773 CN03148773A CN1271518C CN 1271518 C CN1271518 C CN 1271518C CN 03148773 CN03148773 CN 03148773 CN 03148773 A CN03148773 A CN 03148773A CN 1271518 C CN1271518 C CN 1271518C
- Authority
- CN
- China
- Prior art keywords
- interface
- configuration
- information
- application deployment
- configuration file
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 25
- 230000003139 buffering effect Effects 0.000 claims 1
- 230000001105 regulatory effect Effects 0.000 abstract 1
- 230000000694 effects Effects 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本发明涉及一种查询应用程序配置信息的方法,特别涉及一种应用程序运行时动态查询配置信息的方法。The invention relates to a method for querying configuration information of an application program, in particular to a method for dynamically querying configuration information when an application program is running.
背景技术Background technique
在通常情况下,应用程序需要在运行时读取配置文件内相关项的参数。比如PageTimeOut(页加锁超时时限)、MaxBufferSize(缓冲区大小)、LockRetry(加锁失败时重试次数)等参数,通过对这些参数的读取对应用程序运行环境的设定、潜在错误的捕获等均会有很大的改善。应用程序需要参数和配置数据以适应不同用户和环境的需要,好的程序设计的方法和正确的参数配置也可以提高程序的性能,有时在同等情况下只要改变一个参数,程序执行效率就能大大提高。当一个复杂的应用程序运行时,用户通常要求查询影响运行结果的参数配置,公知的做法是用户通过打开参数配置文件查询,或者查看尚未释放资源的界面来获取这些信息,但这种做法通常较慢,用户要经过漫长的等待,而且不够直观,当存在较多配置时,往往会消耗大量的系统资源而最终导致混乱。Under normal circumstances, the application needs to read the parameters of related items in the configuration file at runtime. For example, parameters such as PageTimeOut (page locking timeout), MaxBufferSize (buffer size), LockRetry (number of retries when locking fails), etc., set the application running environment and capture potential errors by reading these parameters The average will be greatly improved. The application program needs parameters and configuration data to meet the needs of different users and environments. A good program design method and correct parameter configuration can also improve the performance of the program. Sometimes, under the same circumstances, only one parameter can be changed, and the program execution efficiency can be greatly improved. improve. When a complex application program is running, the user usually asks to query the parameter configuration that affects the running result. It is known that the user obtains this information by opening the parameter configuration file to query, or viewing the interface that has not released resources, but this method is usually relatively inconvenient. Slow, users have to wait for a long time, and it is not intuitive enough. When there are many configurations, it will often consume a lot of system resources and eventually lead to confusion.
发明内容Contents of the invention
本发明所要解决的技术问题为提出一种动态查询应用程序配置信息的方法,通过多窗口动态调节配置参数,以及程序主界面与配置界面相互切换方法,使用户既直观又快速的得到配置信息。The technical problem to be solved by the present invention is to propose a method for dynamically querying configuration information of application programs, dynamically adjust configuration parameters through multiple windows, and switch between the main interface of the program and the configuration interface, so that users can obtain configuration information intuitively and quickly.
所以为达上述目的,本发明所提供的动态查询应用程序配置信息方法,首先赋予每个界面一身份(ID)标识,然后根据该身份标识存储配置信息,其中包括配置界面的相关参数、打开该界面的配置文件以及在该配置文件中存储界面信息,接下来释放界面资源,切换应用程序主界面至配置界面,同时读取该配置界面的相应配置文件,其中包括获取配置界面标识、根据该标识查找配置文件以及根据该配置文件读取约定的键以获取其值,最后根据该配置文件还原该配置界面。Therefore, in order to achieve the above-mentioned purpose, the method for dynamically querying application program configuration information provided by the present invention first gives each interface an identity (ID) mark, and then stores configuration information according to the identity mark, including related parameters of the configuration interface, opening the Interface configuration file and store interface information in the configuration file, then release the interface resources, switch the main interface of the application to the configuration interface, and read the corresponding configuration file of the configuration interface at the same time, including obtaining the configuration interface ID, according to the ID Find the configuration file and read the agreed key according to the configuration file to obtain its value, and finally restore the configuration interface according to the configuration file.
根据本发明所提出的动态查询应用程序配置信息方法,将配置信息直接反馈到配置界面,从而达到以小的开销获取便捷直观的效果。由于以XML文件作为存储格式,方便了配置的重新整理和格式化。本发明的界面还原是单独的线程进行的,这样将减小对主线程的干扰,保证运行时能灵活方便的进行配置查看。According to the method for dynamically querying the configuration information of the application program proposed by the present invention, the configuration information is directly fed back to the configuration interface, thereby achieving the effect of convenient and intuitive acquisition with a small cost. Since the XML file is used as the storage format, it is convenient to rearrange and format the configuration. The restoration of the interface of the present invention is carried out by a separate thread, which will reduce the interference to the main thread and ensure flexible and convenient configuration viewing during operation.
本发明的前述目的、特征及优点,在配合下列说明及所附图示后,将可获得更好的理解:The foregoing purposes, features and advantages of the present invention will be better understood after coordinating the following descriptions and accompanying drawings:
附图说明Description of drawings
图1为本发明所提出的动态查询应用程序配置信息的方法流程图;Fig. 1 is a flow chart of a method for dynamically querying application configuration information proposed by the present invention;
图2为本发明存储配置信息的流程图;及Fig. 2 is the flow chart of storing configuration information of the present invention; And
图3为本发明读取配置文件的流程图。Fig. 3 is a flow chart of reading configuration files in the present invention.
具体实施方式Detailed ways
通常在外部文件中保存应用程序配置信息,编程人员无须重新编译应用程序即可更新应用程序的某些属性。本发明是一种在程序运行过程中,实时查询软硬件局部或整体配置的方法,借助XML文件的存取,以很小的资源开销完成配置的动态查询,直观便捷灵活。Application configuration information is usually saved in an external file, and programmers can update certain properties of the application without recompiling the application. The present invention is a method for real-time inquiring about partial or overall configuration of software and hardware during the running of a program. With the help of XML file access, the dynamic inquiring of configuration can be completed with very little resource overhead, which is intuitive, convenient and flexible.
本发明通过运行窗口与配置窗口分离,运行时刻在运行窗口与配置窗口之间切换,根据配置界面的不同读取相应配置文件将界面还原。The invention separates the running window from the configuration window, switches between the running window and the configuration window at running time, and reads corresponding configuration files according to different configuration interfaces to restore the interface.
首先通过图1来说明本发明的流程,该图为本发明所提出的动态查询应用程序配置信息的方法流程图,首先赋予每个界面一身份标识(步骤110),根据该身份标识存储配置信息(步骤120),释放界面资源(步骤130),切换应用程序主界面至配置界面,同时读取该配置界面的相应配置文件(步骤140),根据该配置文件还原该配置界面(步骤150)。First, the flow process of the present invention is illustrated by Fig. 1, which is a flow chart of the method for dynamically inquiring application program configuration information proposed by the present invention, at first giving each interface an identity mark (step 110), and storing configuration information according to the identity mark (step 120), release the interface resources (step 130), switch the application program main interface to the configuration interface, read the corresponding configuration file of the configuration interface (step 140) simultaneously, restore the configuration interface (step 150) according to the configuration file.
根据本发明提供的方法,首先按照一定的规则对各个配置界面赋予一唯一的ID标识,然后根据该ID标识存储配置信息。According to the method provided by the present invention, a unique ID is given to each configuration interface according to certain rules, and then the configuration information is stored according to the ID.
图2为本发明存储配置信息的流程图。本发明用一系列的XML配置文件来设置程序执行环境的基本属性。以XML文件作为存储格式,以便于配置的重新整理和格式化。首先配置该界面的相关参数(步骤210),如切换界面或某些关键值被修改等。如修改字符串、选定列表某值、改变按钮状态等。然后打开该界面的配置文件(步骤220),这里是以ID(或是ID的变换)为文件名打开或创建文件(若文件不存在,则创建文件),以Key-Value成对的方式将界面要存的信息存储到这个文件中,也就是说一个key值对应至一个value,可由key值立刻查询到value值。保存各个界面状态到约定的键(Key)的值(Value)。从而在该配置文件中存储界面信息(步骤230)。Fig. 2 is a flowchart of storing configuration information in the present invention. The invention uses a series of XML configuration files to set the basic attributes of the program execution environment. The XML file is used as the storage format to facilitate configuration rearrangement and formatting. First configure the relevant parameters of the interface (step 210), such as switching the interface or modifying some key values. Such as modifying a string, selecting a value in a list, changing the state of a button, etc. Then open the configuration file (step 220) of this interface, here is to open or create a file (if the file does not exist, then create a file) with ID (or the transformation of ID) as the file name, with Key-Value paired mode will The information to be stored in the interface is stored in this file, that is to say, a key value corresponds to a value, and the value value can be queried immediately from the key value. Save each interface state to the value (Value) of the agreed key (Key). The interface information is thus stored in the configuration file (step 230).
此时界面资源被释放,只对频繁使用的资源做缓存。用户切换至其它界面时,保存此时经改动的配置界面的控件状态到XML文件,然后根据界面显示的频率决定是否销毁,如是则释放界面占用的资源;否则隐藏,并在未被加入缓冲区的情况下将其加入界面缓冲区。还可以使用其它工具对生成的XML配置文件作进一步处理,如结合XML技术格式化到网页、传递到远程计算机直接使用其做界面还原等。At this time, the interface resources are released, and only frequently used resources are cached. When the user switches to another interface, save the control state of the modified configuration interface to the XML file, and then decide whether to destroy it according to the frequency of the interface display, if so, release the resources occupied by the interface; otherwise, hide it and add it to the buffer Add it to the interface buffer in the case of You can also use other tools to further process the generated XML configuration file, such as formatting it into a web page with XML technology, transferring it to a remote computer and using it directly for interface restoration, etc.
当程序运行的时候,配置界面与运行相关的配置项变为不可写,当切换到某个配置界面时,初始化函数将按约定读取相应的配置文件,若该配置文件不存在则使用默认值。When the program is running, the configuration items related to the configuration interface become unwritable. When switching to a certain configuration interface, the initialization function will read the corresponding configuration file according to the agreement. If the configuration file does not exist, the default value will be used. .
图3为本发明读取配置文件的流程图。首先获取配置界面ID标识(步骤310);然后判断是否存在缓存界面的步骤,若存在缓存界面则退出程序。由配置界面管理线程来决定直接从缓冲取用或是创建新界面,再根据分配的唯一ID标识查找配置文件(步骤320);若配置文件不存在,则用默认值初始化。若配置文件存在,则根据该配置文件读取约定的Key以获取其Value(步骤330)。从而将存储过的配置重新反映到界面,刷新界面控件状态,还原该配置界面。Fig. 3 is a flow chart of reading configuration files in the present invention. First obtain the ID of the configuration interface (step 310); then determine whether there is a cache interface, and exit the program if there is a cache interface. It is decided by the configuration interface management thread to directly fetch from the cache or create a new interface, and then search for the configuration file according to the assigned unique ID (step 320); if the configuration file does not exist, initialize it with a default value. If the configuration file exists, read the agreed Key according to the configuration file to obtain its Value (step 330). In this way, the stored configuration is re-reflected to the interface, the state of the interface controls is refreshed, and the configuration interface is restored.
对于从系统检测到的信息,在用户不要求刷新的情况下,使用保存的配置即可。界面的还原是由单独的线程来完成的,程序运行是以单独的线程运行主界面、配置界面以及程序主线程。这样将减小对主线程的干扰。For the information detected from the system, if the user does not request to refresh, the saved configuration can be used. The restoration of the interface is done by a separate thread, and the program runs by running the main interface, the configuration interface and the main thread of the program in a separate thread. This will minimize interference with the main thread.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 03148773 CN1271518C (en) | 2003-06-25 | 2003-06-25 | A Method of Dynamically Querying Application Configuration Information |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 03148773 CN1271518C (en) | 2003-06-25 | 2003-06-25 | A Method of Dynamically Querying Application Configuration Information |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1567206A CN1567206A (en) | 2005-01-19 |
CN1271518C true CN1271518C (en) | 2006-08-23 |
Family
ID=34472367
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 03148773 Expired - Fee Related CN1271518C (en) | 2003-06-25 | 2003-06-25 | A Method of Dynamically Querying Application Configuration Information |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN1271518C (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4839049B2 (en) * | 2005-09-20 | 2011-12-14 | クラリオン株式会社 | Information processing apparatus and display screen control method |
CN101858934B (en) * | 2009-04-10 | 2012-08-22 | 北京动力源科技股份有限公司 | Method and system for implementing program controlled alternating current source |
CN102023894A (en) * | 2010-11-18 | 2011-04-20 | 华为终端有限公司 | User operation interface transformation method and terminal |
CN102799421A (en) * | 2011-05-25 | 2012-11-28 | 腾讯科技(深圳)有限公司 | Multi-view switching system and method |
CN103500081A (en) * | 2013-09-26 | 2014-01-08 | 乐视致新电子科技(天津)有限公司 | Display method and display device |
CN106648715B (en) * | 2015-10-29 | 2020-11-27 | 阿里巴巴集团控股有限公司 | Method and system for loading popup control |
CN108132818B (en) * | 2016-11-30 | 2021-12-21 | 阿里巴巴集团控股有限公司 | Interface processing method and electronic device for executing same |
CN109450708B (en) * | 2018-12-14 | 2021-09-07 | 北京明朝万达科技股份有限公司 | Nginx dynamic configuration method and system |
-
2003
- 2003-06-25 CN CN 03148773 patent/CN1271518C/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN1567206A (en) | 2005-01-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7421438B2 (en) | Metadata editing control | |
AU2004287137B2 (en) | Promotion and demotion techniques to facilitate file property management between object systems | |
US7908582B2 (en) | System and method to facilitate design-time component discovery | |
US20150095854A1 (en) | Persisting state at scale across browser sessions | |
US20100333085A1 (en) | Streaming Optimized Virtual Application Images | |
US8176100B2 (en) | System for storing and managing objects | |
JPH0997204A (en) | Method and apparatus for provision of transparent invariancein distributed object operating environment | |
JP2014504768A (en) | Method, computer program product, and apparatus for progressively unloading classes using a region-based garbage collector | |
CN1271518C (en) | A Method of Dynamically Querying Application Configuration Information | |
KR100712374B1 (en) | Data processing | |
WO2019205365A1 (en) | Method and apparatus for loading dom node data, and computer device and storage medium | |
US8745503B2 (en) | Graphical interface for managing server environment | |
US20040215603A1 (en) | Grid data processing systems and methods | |
KR20040094888A (en) | Time-multiplexed speculative multi-threading to support single- threaded applications | |
US9146757B1 (en) | Dynamically loaded plug-ins to provide an integrated graphical user interface | |
KR20000012132A (en) | Data processing | |
KR20000012134A (en) | Video processing and rendering | |
KR20000012135A (en) | Digital video processing apparatus | |
GB2517780A (en) | Improved checkpoint and restart | |
US8881152B2 (en) | Working sets of sub-application programs of application programs currently running on computing system | |
KR20000012136A (en) | Animation of video special effects | |
US7567257B2 (en) | Partition-based undo of partitioned object graph | |
CN118916557A (en) | Front-end list rendering method and device, computer equipment and storage medium | |
JP2002108677A (en) | Device for managing document and method for the same and storage medium | |
CN112035380B (en) | Data processing method, device and equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CB03 | Change of inventor or designer information | ||
CB03 | Change of inventor or designer information |
Inventor after: Feng Haixia Inventor after: Wang Shuli Inventor after: Xu Guangdong Inventor after: Yang Dongmei Inventor before: Liu Wenhan Inventor before: Song Jianfu Inventor before: Yan Zaofa |
|
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20170329 Address after: Tianjin, Nankai District red flag Road, Xinhua Park building, 7 floor Patentee after: Feng Haixia Patentee after: Wang Shuli Patentee after: Xu Guangdong Patentee after: Yang Dongmei Address before: Taipei City, Taiwan, China Patentee before: Inventec Corporation |
|
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20060823 Termination date: 20170625 |