CN103077035B - A kind of process configuration management system and implementation method - Google Patents

A kind of process configuration management system and implementation method Download PDF

Info

Publication number
CN103077035B
CN103077035B CN201310007993.0A CN201310007993A CN103077035B CN 103077035 B CN103077035 B CN 103077035B CN 201310007993 A CN201310007993 A CN 201310007993A CN 103077035 B CN103077035 B CN 103077035B
Authority
CN
China
Prior art keywords
control unit
file
application program
proc
communication interface
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
Application number
CN201310007993.0A
Other languages
Chinese (zh)
Other versions
CN103077035A (en
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.)
Shanghai Feixun Data Communication Technology Co Ltd
Original Assignee
Shanghai Feixun Data Communication Technology 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 Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201310007993.0A priority Critical patent/CN103077035B/en
Publication of CN103077035A publication Critical patent/CN103077035A/en
Application granted granted Critical
Publication of CN103077035B publication Critical patent/CN103077035B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of process configuration management system and implementation method, it belongs to linux process configuring technicals field, specifically include application apparatus, kernel device and file storage device, application apparatus is connected by a communication interface with kernel device, and file storage device connects application apparatus and kernel device respectively;Implementation method includes:File or folder is added or deleted to application program, while setting a read-write to monitor this document or file, kernel device is monitored to the read-write operation of user in application program real time execution and returns to monitoring information to application program;The beneficial effect of above-mentioned technical proposal is:The interaction sense of application program and user in the setting of interior data structure and change application program, optimization Linux system can be accessed when application program is run.

Description

A kind of process configuration management system and implementation method
Technical field
The present invention relates to linux process configuring technicals field, more particularly to a kind of process configuration management system and realization side Method.
Background technology
In Linux software development process, how tuner obtains the inner parameter of application program in real time, how to match somebody with somebody in real time Application process is put, how application program interacts with user, is all the problem that developer is faced, but in linux system It also can be very good to solve this problem without a kind of mechanism.
The content of the invention
The defect according to present in prior art, now provides a kind of process configuration management system and implementation method, specific bag Include:
A kind of process configuration management system, it is adaptable to manage the proc files in the proc file system of Linux system, its In, including application apparatus, kernel device and file storage device, the application apparatus pass through a communication interface and the kernel Device is connected, and the file storage device connects the application apparatus and the kernel device respectively;
The application apparatus includes the first control unit and first storage component, first control unit connection described the One memory unit, and the kernel device is connected by the communication interface;The first storage component includes multiple independences The first memory space, each first memory space storage has the information of an application program;First control unit For the requirement according to the application program, operation requests are sent to the kernel device;
The kernel device includes the second control unit and second storage component, second control unit connection described the Two memory units, and first control unit is connected by the communication interface;Second control unit is also connected with described File storage device;Second control unit is used to receive the operation requests of the first control unit transmission and carried out corresponding Processing feedback;The second storage component includes multiple the second independent memory spaces, each second memory space Middle storage has a process sequence number;
Storage has a proc file system in the file storage device, and the proc file system includes proc texts Part is pressed from both sides and proc files.
It is preferred that, the process configuration management system, wherein, the communication interface is netlink interfaces.
It is preferred that, the process configuration management system, wherein, multiple independent three are also included in the second storage component Memory space, each 3rd memory space is used for the storage for depositing a file in the correspondence proc file system Path;The store path is relative path of the file relative to the proc file system root directories;The relative road Called when being written and read monitoring for second control unit in footpath.
A kind of process configuration management implementation method, wherein, using preferred process configuration management system, it is included in proc texts File is added and deleted in part system and outside read-write operation is monitored;
The method of add file is specifically included in the proc file system:
An application program in first storage component is set up via communication interface with kernel device to be connected;Second control unit The process sequence number that part will be stored in second storage component distributes to the application program;
The application program proposes the operation requests of add file to first control unit, while providing what is added The relative path of file;First control unit by the communication interface, to second control unit send described in add The operation requests of add file and the relative path;Second control unit is stored in file and filled according to the relative path Respective file is added in the proc file system put, and the relative path is stored in the 3rd memory space, with Called when being written and read monitoring for second control unit.
It is preferred that, the process configuration management implementation method, wherein, the method that file is deleted in the proc file system Specifically include:
The application program proposes to delete the operation requests of file to first control unit, while providing what is deleted The relative path of file;First control unit by the communication interface, to second control unit send described in delete Except the operation requests and the relative path of file;Second control unit is according to the relative path, in proc files system Respective file is found in system and is deleted;Second control unit will be deposited in corresponding in the 3rd memory space simultaneously The relative path is deleted.
It is preferred that, the process configuration management implementation method, wherein, the method that outside read-write operation is monitored specifically is wrapped Include:
When user is written and read operation to proc files, second control unit of the kernel device is monitored Generation read-write operation event, and produce the notification message of preset content;Second control unit will by the communication interface The notification message is sent to first control unit, and first control unit sends the notification message to corresponding The application program;The application program carries out corresponding read-write operation processing according to the notification message.
It is preferred that, the process configuration management implementation method, wherein, the preset content of the notification message includes:Operate class The relative path of type, operation object type and operation object;The action type is divided into read operation and write operation;The operation Object type is divided into file and file.
It is preferred that, the process configuration management implementation method, wherein, when the unassigned process sequence of the application program Number when, second control unit by the communication interface to first control unit return processing failure notice disappear Breath;First control unit returns to the notification message to the application program for proposing operation requests.
The beneficial effect of above-mentioned technical proposal is:Interior data structure and change can be accessed when application program is run The interaction sense of application program and user in the setting of application program, optimization Linux system.
Brief description of the drawings
Fig. 1 is a kind of structural representation of process configuration management system in embodiments of the invention;
Fig. 2 is the overall procedure schematic diagram of process configuration management implementation method in embodiments of the invention;
Fig. 3 is the schematic flow sheet of the add file in proc file system in embodiments of the invention;
Fig. 4 is the schematic flow sheet for deleting file in embodiments of the invention in proc file system;
Fig. 5 is the monitoring schematic flow sheet to proc file read-write operations in embodiments of the invention.
Embodiment
The invention will be further described with specific embodiment below in conjunction with the accompanying drawings, but not as limiting to the invention.
The technical problem to be solved in the present invention is in Linux software development process, it is impossible to operationally waits and accesses application The internal data structure and change application program of program are set.For example in debugging, how the Debug of Real-Time Switch process is printed How information, obtain the internal information of process, and in the application, how in real time according to environment configurations application process etc..
As shown in figure 1, process configuration management system includes application apparatus, kernel device and file storage device, using dress Put and kernel device is connected by a communication interface, file storage device connects application apparatus and kernel device respectively, the communication Interface is netlink interfaces;Application apparatus includes first storage component and the first control unit, and first storage component includes Multiple the first independent memory spaces(One of them is only shown in figure), storage has application program in each memory space Information;First control unit sends operation requests according to the request of application program to kernel device;Have in file storage device Proc file system, proc file system includes proc files and proc files.
Kernel device includes second storage component and the second control unit, and second storage component connects the second control unit Part;Second control unit threaded file storage device, and the first control unit is connected by communication interface;Second storage component bag Include multiple the second independent memory spaces(One of them is only shown in figure), each second memory space, which is deposited, has one uniquely The control unit of process sequence confession second distributes to application program;Also include multiple the 3rd independent storages in second storage component Space(One of them is only shown in figure), each 3rd memory space, which is used to depositing a correspondence proc file or folder, to be deposited Path is stored up, the store path is the relative path of this document or file relative to proc file system root directories(I.e. relative to/ Proc path;For example ,/proc/appproc/test relative path is appproc/test), for the second control unit Called when being written and read monitoring.
It is the schematic flow sheet of process configuration management implementation method as shown in Figure 2-5, wherein Fig. 2 illustrates for overall procedure Figure, its specific steps include:
Before being managed for configuration, application program needs to register to kernel device first:Application program is to the first control unit Part sends registration request, and the first control unit sends the registration request, the second control by communication interface to the second control unit Part transfers a process sequence number from the second memory space of second storage component and distributes to the application program, completes note Volume process;
The second control unit first checks for this before receiving the addition of application program transmission or deleting file request afterwards Whether application program is assigned process sequence number:If allocated, into next step;If being not yet allocated, the Two control units return to the announcement information of processing failure by communication interface to the first control unit, and the first control unit should to this The announcement information is returned to program, reminder application first completes registration process;I.e. kernel device only handles registered application Program, is disregarded to unregistered application program.
After application program has been allocated with process sequence number, the application program can carry out following additions and delete text The process of part or file:
As shown in figure 3, add file or file:First control unit reads add file or the text that application program is sent The request of part folder and the relative path of file or folder added is needed, the first control unit is by the operation requests and phase Path is sent to the second control unit by communication interface;Second control unit is according to the relative path in proc file system Middle addition new file or file;The relative path is stored in the 3rd memory space by the second control unit.
As shown in figure 4, deleting file or folder:First control unit reads the deletion file or text that application program is sent The relative path for the file or folder that the request of part folder and needs are deleted, the first control unit is by the request and with respect to road Footpath is sent to the second control unit by communication interface;Second control unit is according to the relative path, in proc file system Find corresponding file or folder and delete;The second control unit deletes the corresponding phase being stored in the 3rd memory space simultaneously To path.
After add file or file, the operation that user can be write or be read to it, the operation it is final by Application program is completed, but application program is in itself and can not to differentiate an operation be write-in or reading, and it is in the process of running Also can not voluntarily it be write or read operation, it is therefore desirable to add kernel device to be written and read the monitoring of operation:
As shown in figure 5, when user is written and read operation to a proc file or folder, in kernel device Two control units, and generation one includes the notification message of monitoring content;Second control unit passes through above-mentioned notification message logical Letter interface is sent to the first control unit, and the first control unit sends the notification message to application program, application program according to The notification message, the operation for calling default call back function to be read or write.
The content of above-mentioned notification message includes:
Message id:System generates an ID for a notification message automatically;
Message-length(LEN);
File type(TYPE):0 represents file, and 1 represents file;
Relative path(PATH);
Additional data(DATA);
Return value in detail after processing(RET);
Specific message format is as shown in the table:
ID LEN TYPE PATH DATA RET
The structure of call back function is called to be defined as follows in application program:
typedef struct APPPROC_FILE_STRUCT
Wherein:
path:Relative to the absolute path of/proc catalogues
fileType :File type, 0 represents file, and 1 represents file
proc_read :Call back function is read, when user reads file, the function can be called
proc_write :Call back function is write, when user is to file write data, the function can be called
data:Parameter, is not explicitly defined, incoming when proc_read and proc_write is called.
next:Point to next proc file structures.
The read-write event of one proc file can be monitored by multiple application programs, and each application program can be taken not Same processing.When there are such a proc files, multiple application programs can be configured simultaneously when creating this document.Read one It is individual monitored by many application processes file when, the global configuration information of these processes can be obtained, each process can be exported The information of oneself.Above-mentioned mechanism effectively easily can configure multiple application processes simultaneously.
The present invention can access the setting of interior data structure and change application program, optimization when application program is run The interaction sense of application program and user in Linux system.
Preferred embodiments of the present invention are the foregoing is only, embodiments of the present invention and protection model is not thereby limited Enclose, to those skilled in the art, should can appreciate that made by all utilization description of the invention and diagramatic content Scheme obtained by equivalent substitution and obvious change, should be included in protection scope of the present invention.

Claims (7)

1. a kind of process configuration management system, it is adaptable to manage the proc files in the proc file system of Linux system, it is special Levy and be, including application apparatus, kernel device and file storage device, the application apparatus by a communication interface with it is described Kernel device is connected, and the file storage device connects the application apparatus and the kernel device respectively;
The application apparatus includes the first control unit and first storage component, and the first control unit connection described first is deposited Part is stored up, and the kernel device is connected by the communication interface;The first storage component includes multiple independent One memory space, each first memory space storage has the information of an application program;First control unit is used for According to the requirement of the application program, operation requests are sent to the kernel device;
The kernel device includes the second control unit and second storage component, and the second control unit connection described second is deposited Part is stored up, and first control unit is connected by the communication interface;Second control unit is also connected with the file Storage device;Second control unit is used to receive the operation requests of the first control unit transmission and located accordingly Manage feedback;The second storage component includes multiple the second independent memory spaces, is deposited in each second memory space It is placed with a process sequence number;
Storage has a proc file system in the file storage device, and the proc file system includes proc files With proc files;
Also include multiple the 3rd independent memory spaces in the second storage component, each 3rd memory space is used to deposit Put the store path of a file in the correspondence proc file system;The store path is the file relative to institute State the relative path of proc file system root directories;The relative path is adjusted when being written and read monitoring for second control unit With.
2. process configuration management system as claimed in claim 1, it is characterised in that the communication interface is netlink interfaces.
3. a kind of process configuration management implementation method, it is characterised in that use entering as described in any one in claim 1-2 Journey configuration management system, is included in proc file system and adds and delete file and outside read-write operation is supervised Control;
The method of add file is specifically included in the proc file system:
An application program in first storage component is set up via communication interface with kernel device to be connected;Second control unit will A process sequence number being stored in second storage component distributes to the application program;
The application program proposes the operation requests of add file to first control unit, while providing added file Relative path;First control unit sends the addition text by the communication interface to second control unit The operation requests of part and the relative path;Second control unit is according to the relative path, in file storage device Proc file system in add respective file, and the relative path is stored in the 3rd memory space, for institute State when the second control unit is written and read monitoring and call.
4. process configuration management implementation method as claimed in claim 3, it is characterised in that deleted in the proc file system Except the method for file is specifically included:
The application program proposes to delete the operation requests of file to first control unit, while providing deleted file Relative path;First control unit sends the deletion text by the communication interface to second control unit The operation requests of part and the relative path;Second control unit is according to the relative path, in proc file system Find respective file and delete;Second control unit will be deposited in corresponding described in the 3rd memory space simultaneously Relative path is deleted.
5. process configuration management implementation method as claimed in claim 4, it is characterised in that outside read-write operation is monitored Method specifically include:
When user is written and read operation to proc files, second control unit of the kernel device monitors generation Read-write operation event, and produce the notification message of preset content;Second control unit will be described by the communication interface Notification message is sent to first control unit, and first control unit sends the notification message to corresponding described Application program;The application program carries out corresponding read-write operation processing according to the notification message.
6. process configuration management implementation method as claimed in claim 5, it is characterised in that the preset content of the notification message Including:The relative path of action type, operation object type and operation object;The action type is divided into read operation and writes behaviour Make;The operation object type is divided into file and file.
7. process configuration management implementation method as claimed in claim 6, it is characterised in that when the application program is unassigned During the process sequence, second control unit returns to processing to first control unit by the communication interface and lost The notification message lost;First control unit returns to the notification message to the application program for proposing operation requests.
CN201310007993.0A 2013-01-09 2013-01-09 A kind of process configuration management system and implementation method Expired - Fee Related CN103077035B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310007993.0A CN103077035B (en) 2013-01-09 2013-01-09 A kind of process configuration management system and implementation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310007993.0A CN103077035B (en) 2013-01-09 2013-01-09 A kind of process configuration management system and implementation method

Publications (2)

Publication Number Publication Date
CN103077035A CN103077035A (en) 2013-05-01
CN103077035B true CN103077035B (en) 2017-08-25

Family

ID=48153573

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310007993.0A Expired - Fee Related CN103077035B (en) 2013-01-09 2013-01-09 A kind of process configuration management system and implementation method

Country Status (1)

Country Link
CN (1) CN103077035B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107038373A (en) * 2017-04-28 2017-08-11 北京洋浦伟业科技发展有限公司 A kind of Process Debugging detection method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1480878A (en) * 2002-09-02 2004-03-10 联想(北京)有限公司 Method for obtaining information of linux operation system
USH2196H1 (en) * 2004-09-30 2007-07-03 Symantec Corporation Method for intercepting specific system calls in a specific application from applications space for security
CN101630285A (en) * 2009-08-07 2010-01-20 华南理工大学 Software performance testing method applied in embedded system
CN102662785A (en) * 2012-04-12 2012-09-12 青岛海信移动通信技术股份有限公司 Method and device for acquiring kernel error messages of Android system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1480878A (en) * 2002-09-02 2004-03-10 联想(北京)有限公司 Method for obtaining information of linux operation system
USH2196H1 (en) * 2004-09-30 2007-07-03 Symantec Corporation Method for intercepting specific system calls in a specific application from applications space for security
CN101630285A (en) * 2009-08-07 2010-01-20 华南理工大学 Software performance testing method applied in embedded system
CN102662785A (en) * 2012-04-12 2012-09-12 青岛海信移动通信技术股份有限公司 Method and device for acquiring kernel error messages of Android system

Also Published As

Publication number Publication date
CN103077035A (en) 2013-05-01

Similar Documents

Publication Publication Date Title
US9734021B1 (en) Visualizing restoration operation granularity for a database
US8195979B2 (en) Method and apparatus for realizing application high availability
US20180107725A1 (en) Data Storage Method and Apparatus, and Data Read Method and Apparatus
CN108170612B (en) Automatic testing method and device and server
CN109791500A (en) Intermediate host integrated circuit between virtual machine instance and client programmable logic
CN103309650B (en) The generation method and apparatus of persistent layer code
CN107181679A (en) A kind of port binding implementation method and device
CN104881466B (en) The processing of data fragmentation and the delet method of garbage files and device
SG190767A1 (en) Techniques for network replication
CN108268331A (en) Virtual machine system
CN111343037B (en) Flow monitoring method and device for cloud platform load according to application, and computer equipment
CN107329991A (en) A kind of list access to web page and methods of exhibiting and its system
CN104077199A (en) Shared disk based high availability cluster isolation method and system
WO2022095366A1 (en) Redis-based data reading method and apparatus, device, and readable storage medium
CN105095103A (en) Storage device management method and device used for cloud environment
CN109558191A (en) A kind of method, apparatus, storage medium and computer equipment configuring the page
CN110300960A (en) The program change method of information system, management program and information system
CN114840223A (en) Resource processing method and device
JP2019091460A (en) SYSTEM AND METHOD FOR CONTROLLING IoT DEVICE EXECUTION ORDER
CN110196680A (en) Data processing method, device and storage medium
CN105335450B (en) Data storage processing method and device
US20200389546A1 (en) State replication, allocation and failover in stream processing
CN107145399A (en) A kind of shared-memory management method and shared-memory management equipment
CN108696559B (en) Stream processing method and device
CN103077035B (en) A kind of process configuration management system and implementation method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170825

Termination date: 20190109

CF01 Termination of patent right due to non-payment of annual fee