CN101989203A - Software component management system - Google Patents
Software component management system Download PDFInfo
- Publication number
- CN101989203A CN101989203A CN2010105472886A CN201010547288A CN101989203A CN 101989203 A CN101989203 A CN 101989203A CN 2010105472886 A CN2010105472886 A CN 2010105472886A CN 201010547288 A CN201010547288 A CN 201010547288A CN 101989203 A CN101989203 A CN 101989203A
- Authority
- CN
- China
- Prior art keywords
- component
- interface
- software
- counter
- management system
- 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
Links
- 230000004044 response Effects 0.000 claims abstract description 21
- 230000006870 function Effects 0.000 claims abstract description 19
- 238000000034 method Methods 0.000 claims abstract description 15
- 230000003247 decreasing effect Effects 0.000 claims description 11
- 230000004083 survival effect Effects 0.000 claims description 10
- 238000007726 management method Methods 0.000 abstract description 18
- 230000008569 process Effects 0.000 abstract description 7
- 230000007246 mechanism Effects 0.000 abstract description 2
- 238000012545 processing Methods 0.000 abstract description 2
- 238000004891 communication Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 7
- 230000000694 effects Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000002054 transplantation Methods 0.000 description 1
Images
Landscapes
- Stored Programmes (AREA)
Abstract
The invention provides a software component management system and a software component management method. A public interface with a counter is defined as the common standard of all interfaces; a component manager controls a lifetime of a component by the counter and a processing strategy of component response time, thereby realizing a management process of dynamically loading and unloading the component. The scheme is strong in expandability and simple in mechanism; on the premise of retaining the original functions of an overall software program, the invention can effectively distribute and use system resources, thereby improving the efficiency of the system.
Description
Technical Field
The invention relates to the field of computers, in particular to a management technology of a software component.
Background
The components are products of recent industrial development, the purpose is functional modularization, each functional component forming the product can be produced by professional manufacturers, the quality is improved, the cost is reduced, meanwhile, the same components can be applied to various products and fields, and the transplantation and application of the technology are greatly expanded.
The components in the software engineering, or software components, refer to: "a physical, replaceable component in a system that encapsulates the implementation and provides a range of available interfaces. A component represents the physical part implemented in a system, including software code (source code, binary code, executable code) or some similar content, such as a script or a command file. "one of the greatest benefits of using software component technology is to decompose software by componentizing the software, thereby reducing the complexity of the software and improving the integration and reusability of the software.
In the existing software products using software componentization technology, the problems of slow program starting speed, large memory occupation, high CPU occupancy rate and the like generally exist, because too many components are loaded during program starting, and each component occupies a certain memory space and CPU, so that the whole program is overstaffed. For the dynamic management of components, only similar technologies are currently used in embedded systems, but the implementation of these technologies is complex and limited by the technologies supported by the embedded systems themselves.
Disclosure of Invention
The invention provides a method for starting a software component in a software component product, and aims to solve the problem that when a program in the prior art is started, too many components are loaded, so that the whole program runs slowly. Therefore, the present invention is directed to a system and method for managing software components to solve at least one of the above problems.
According to one aspect of the invention, the invention provides a software component management system, which comprises a starting module, a component manager, a public interface and at least one software component; wherein,
a starting module: the entrance of the whole program interacts with the component manager, and each software component is loaded through the component manager;
the component manager: the system is used for managing software components and dynamically realizing functions of loading and unloading the software components and the like;
public interface: defining a common standard and common capability which all interfaces must comply with in common, wherein the common standard is to contain a counter, and the common capability is to increase the counting capability and decrease the counting capability;
software components: and each module component is used as a management object of the software component management system and provides a service function for a program.
Further, the component manager specifically includes,
configuration files: the configuration information of the software component is stored, and the configuration information of the component comprises: the unique identifier of the component, the access path of the component on the physical device, the interface contained by the component and the survival time of the component;
an interface query unit: the system is used for inquiring the interface entry address through the interface unique identification;
a component loading unit: the component loading unit loads the component into the application program system from the physical device according to the component configuration information;
a response time recording unit: the method is used for recording the last response time of each currently loaded component, namely the last time when an interface contained in each currently loaded component is called;
a component unloading unit: is responsible for the unloading of the component.
Further, the common interface specifically means that each interface comprises a counter, when an interface is used, the counter is increased, the counter is decreased after the interface is used, the step when the counter is increased must be consistent with the step when the counter is decreased, and the counter records how many users use the interface currently.
Further, the software component comprises a business component and a function component, and the interfaces contained in the software component are inherited by the common interface and conform to the standard of the common interface.
Furthermore, the number of the interfaces contained in the component is one or more, and the interfaces are a comparison relation table of the unique identifier of the component and the unique identifier of the interface.
Further, the component survival time refers to the time when a loaded component is continuously inactive, and exceeds the component survival time, the component is unloaded.
Further, the component uninstalling unit is started when the program is started, periodically detects all currently loaded software components, and uninstalls a certain software component when the component reaches an uninstalling condition.
Further, the component's unload condition means that all interfaces included in the component are not currently in use and that the component's last response time has exceeded a predetermined component lifetime.
Compared with the prior art, the invention defines a public interface with a counter, manages the life cycle of each component through the component manager, and more efficiently distributes and uses system resources under the condition of keeping the original functions of the whole software program unchanged, thereby improving the efficiency of the system.
Drawings
FIG. 1 is a block diagram of a component management system of the present invention;
FIG. 2 is a schematic diagram of a program at start-up according to a preferred embodiment of the present invention;
FIG. 3 is a diagram illustrating dynamic loading of components in accordance with a preferred embodiment of the present invention;
FIG. 4 is a diagram illustrating dynamic unloading of components in accordance with a preferred embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings.
The core idea of the invention is to define a common interface with a counter as the common standard of all interfaces, and control the life cycle of the component by formulating a certain strategy, thereby realizing the management process of dynamic loading and unloading of the component.
For a better understanding of the practice of the invention, reference will now be made to the terms of the art to which this invention pertains.
Interface: we can understand this as a portal that invokes a "service" that can provide some capability (e.g., make a call, do a text chat, do some mathematical calculation, etc.) and has a set of attributes (e.g., unique identification of the interface, number of times the interface is currently used, etc.). Each interface has a unique identifier, the unique identifier is a label that is different from other interfaces, and it can be a group of numbers with special meaning or a string of texts with special contents, and is not limited to the above two ways, and the unique identifier is not necessarily absolutely unique and will not be repeated, and it only remains unique in the working environment where the identifier is used.
Inheritance: it can be understood that a new interface is extended on the basis of an interface, the new interface not only contains the functions and properties of the original interface, but also can contain the new functions and properties of the new interface, and the extension is called as inheritance. For example: we say that the three extended services are inherited to the dialog service, and if we continue to extend the chat room dialog service including the video function on the basis of the chat room dialog service, we say that the chat room dialog service including the video function is directly inherited to the chat room dialog service and indirectly to the dialog service.
As shown in FIG. 1, the software component management system of the present invention comprises a start module, a component manager, a common interface, and at least one software component, wherein
A starting module: the entrance of the whole program interacts with the component manager, and each software component is loaded through the component manager;
the component manager: the method is used for dynamically managing the software components and dynamically realizing the functions of loading and unloading the software components and the like.
Public interface: the counter is increased when the interface is used, the counter is decreased after the interface is used, and the steps when the counter is increased must be consistent with the steps when the counter is decreased. The "counter" records how many users are currently using the interface (the user is not limited to a subscriber, and may be another service), and when the interface is used, the counter is incremented by N (N is an integer), and when the interface is used, the counter is decremented by N.
It should be noted that: the common interface is specifically defined for the purpose of managing components and interfaces, and only contains a common standard which all interfaces must comply with in common, but no specific service capability and attribute.
Software components: means modules providing service functions for programs, such as: a text chat component, a voice call component, a file transmission component, a system setting component, etc. The interfaces contained in the components are inherited by the common interface, conform to the standard of the common interface, and expand respective service functions according to different service positions of the components, and the interfaces are management objects of the component management system.
The component manager in the embodiment of the invention further comprises a configuration file, a component loading unit, an interface query unit, a response time recording unit and a component unloading unit:
configuration files: the configuration information responsible for storing the components comprises: the unique identification of the component, the access path of the component on the physical device, the interface contained by the component, and the maximum survival time of the component in the absence of response. Wherein,
the unique component identifier refers to an identifier used for distinguishing and locating the uniqueness of the component in a certain working environment.
The access path of the component on the physical device refers to an absolute or relative path of the component physically existing in the computer system, and the component manager can normally access the component according to the access path of the component, such as loading the component.
The interfaces contained in the assembly: a component may contain one or more interfaces, so that the interface contained by the component is actually a set of mapping tables of component unique identifiers and interface unique identifiers. As known from the containing relation between the components and the interfaces, when a certain service needs to be used, the components containing the interfaces providing the service need to be loaded firstly, then the service can be used through the interfaces, and if the components are loaded, repeated loading is not needed.
Component time-to-live refers to unloading a loaded component when the time that the component has been inactive exceeds the maximum time-to-live of the component when it is unresponsive. This time is the time delay of unloading the component set to avoid frequent loading of the unloading component. This time is typically specified by the user of the patent based on the business characteristics of the application that he or she has developed.
A component loading unit: loading the component from the physical device into the application system according to the component configuration information;
an interface query unit: for querying the interface entry address by the interface unique identification.
A response time recording unit: the method is used for recording the last response time of each currently loaded component, namely the last time that an interface contained in each currently loaded component is called. The last response time is updated as soon as any of the interfaces included in the component is used.
A component unloading unit: the method is used for unloading the components, the components are started together when a program is started, all the currently loaded components are detected periodically, and once a certain component reaches an unloading condition, the component is unloaded. The component unloading unit is an independently operated unit, and the component unloading conditions include: all interfaces provided by the component are currently unused and the last response time of the component has exceeded the component lifetime.
The user of the interface inquires the interface address which the user wants to call through the interface inquiry unit. The interface query unit firstly queries the configuration file to obtain the unique identifier of the component containing the interface. The interface query unit queries the response time recording unit, and if the unique identifier of the component is found not to be recorded with the activity time currently, the component is not loaded currently. The interface query unit informs the component loading unit to load the component, and after the loading is successful, the interface query unit returns the interface address to the querier and informs the response time recording unit to record the activity time of the component. After a component is unloaded by the component uninstall unit, the component uninstall unit notifies the response time recording unit to delete the active time record of the component.
Based on the software component management system, the software component management method of the invention comprises the following steps:
Step 2, after the program is started, if the service provided by a certain software component needs to be used, a user inquires an interface providing the service through the component manager, if the component containing the inquired interface is not loaded at present, the component manager reads the configuration file to obtain an access path of the component, loads the component first, and then returns an access entry address of the component interface to the user.
For example: when a user needs to use the interface A, the user obtains the access entry address of the interface A through the interface query unit of the component manager, the count of the interface A is increased by 1 time, after the interface A is used, the count of the interface A is decreased by 1 time, when the counter of the interface A is decreased to 0 (assuming that the counter is initially counted from 0), the interface A indicates that the interface A is not used by any user and can be destroyed, and the interface A informs the component manager to destroy the interface A.
And 3, recording the current activity condition of the component in the component manager, recording the time when the counter of the interface contained in the component is changed for the last time as the last response time of the component, and if all the interfaces contained in the component are not called within a period of time, unloading the component by the component unloading unit of the component manager after the time exceeds the survival time of the component. If the component's interface is accessed again before the time of no response reaches the component's time to live, the last response time is re-recorded.
FIG. 2 is a schematic diagram of the start-up of the program according to the preferred embodiment of the present invention, including
1. When the application program is started, the starting module starts the component manager, and the component manager calls the login interface, the login service interface, the TCP communication interface and the main interface by reading the component configuration information in the configuration file, so that the component manager loads the currently required components, as shown in the figure: the system comprises a bottom layer communication component (ID: 01), a login component (ID: 02) and a main interface component (ID: 03).
It should be noted that when the program is started, the telephone function, the text chat function, the file transfer function, etc. do not need to be used, so the related components are not loaded, as shown in the figure: a telephone component (ID: 04), a text chat component (ID: 05), an address book component (ID: 06), a system setting component (ID: 07), and a file transfer component (ID: 08).
2. The component manager records the last response time of each component; a count of each called interface.
As shown in fig. 3, which is a schematic diagram of the component in the dynamic loading according to the preferred embodiment of the present invention, the component includes:
1. in the application process of the program, a user clicks an address book function label on the main interface and wants to open the address book interface for address book query, so the main interface (03a) queries the address book interface (06a) through the component manager.
2. After the component manager receives the query request of the main interface (03a), the component manager checks the configuration file, finds that the address book interface (06a) belongs to the address book component (06), and the address book component (06) is not loaded at present, so the component manager firstly loads the address book component (06), then returns the address book interface (06a) to a caller, and increases the counter of the address book interface (06a) by 1.
The user operates the address book interface to inquire, the address book interface (06a) inquires the address book service interface (06b) of the component manager, the component manager checks the configuration file, and the address book service interface (06b) is found to belong to the address book component (06), and the address book component (06) is loaded at present, so that the component manager directly returns to the address book service interface (06 b).
The address book service interface (06b) needs to establish connection with a remote address book database in the inquiry process, so the address book service interface (06b) inquires the TCP communication interface (01a) to the component manager, the component manager checks the configuration file, finds that the TCP communication interface (01a) belongs to the bottom layer communication component (01), and the bottom layer communication component (01) is loaded at present, so the component manager directly returns to the TCP communication interface (01 a).
Since the program is already started and logged in, the TCP communication interface count used in the login process is decreased by 1 (becomes 0), the login interface count is decreased by 1 (becomes 0), and the login service interface count is decreased by 1 (becomes 0).
In the process of inquiring the address list, the used TCP communication interface count is increased by 1 (changed into 1), the address list interface count is increased by 1 (changed into 1), and the address list service interface count is increased by 1 (changed into 1).
The interface counter of the main interface is not changed because the main interface is always used.
Fig. 4 is a schematic diagram of the dynamic unloading of the component according to the preferred embodiment of the present invention, which includes:
if the preset component survival time is 10 minutes, after the program logs in for 10 minutes, because the counter of the login interface (02a) is 0, the counter of the login service interface (02b) is 0, and the login component (02) reaches the maximum survival time of the configured unresponsive component, the component uninstalling condition is reached, and the component uninstalling unit automatically uninstalls the login component (02).
In summary, the management system and method for software components provided by the present invention define a common interface with a counter as a common standard for all interfaces, and control the lifecycle of the components by the component manager according to the processing policy of the counter and the response time of the components, thereby implementing the management process of dynamic loading and unloading of the components. The scheme has strong expandability and simple mechanism, and can be learned and used by a person with ordinary skill in the art through the description of the above embodiments and the accompanying drawings.
Claims (8)
1. A software component management system comprises a starting module, a component manager, a public interface and at least one software component; wherein,
a starting module: the entrance of the whole program interacts with the component manager, and each software component is loaded through the component manager;
the component manager: the system is used for managing software components and dynamically realizing functions of loading and unloading the software components and the like;
public interface: defining a common standard and common capability which all interfaces must comply with in common, wherein the common standard is to contain a counter, and the common capability is to increase the counting capability and decrease the counting capability;
software components: and each module component is used as a management object of the software component management system and provides a service function for a program.
2. The management system of claim 1, wherein the component manager specifically comprises,
configuration files: the configuration information of the software component is stored, and the configuration information of the component comprises: the unique identifier of the component, the access path of the component on the physical device, the interface contained by the component and the survival time of the component;
an interface query unit: the system is used for inquiring the interface entry address through the interface unique identification;
a component loading unit: the component loading unit loads the component into the application program system from the physical device according to the component configuration information;
a response time recording unit: the method is used for recording the last response time of each currently loaded component, namely the last time when an interface contained in each currently loaded component is called;
a component unloading unit: is responsible for the unloading of the component.
3. The management system of claim 1,
the common interface specifically means that each interface comprises a counter, when the interface is used, the counter is increased, the counter is decreased after the interface is used, the step when the counter is increased must be consistent with the step when the counter is decreased, and the counter records how many users use the interface currently.
4. The management system of claim 2, wherein the software components comprise a business component and a function component, and the interfaces included in the software components are inherited by the common interface and conform to the standard of the common interface.
5. The management system according to claim 2 or 3,
the component comprises one or more interfaces, and the interfaces are a comparison relation table of the unique identifier of the component and the unique identifier of the interface.
6. The management system according to claim 2 or 3,
the component survival time refers to the time when a loaded component is not active continuously, and the component survival time is exceeded, the component is unloaded.
7. The management system according to claim 2 or 3,
the component uninstalling unit is started when the program is started, periodically detects all currently loaded software components, and uninstalls a certain software component when the component reaches an uninstalling condition.
8. The management system of claim 7,
the component's unload condition means that all interfaces that the component contains are not currently in use and that the component's last response time has exceeded a predetermined component lifetime.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2010105472886A CN101989203A (en) | 2010-01-05 | 2010-11-09 | Software component management system |
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010001553.0 | 2010-01-05 | ||
CN201010001553 | 2010-01-05 | ||
CN2010105472886A CN101989203A (en) | 2010-01-05 | 2010-11-09 | Software component management system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN101989203A true CN101989203A (en) | 2011-03-23 |
Family
ID=43745755
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2010105472886A Pending CN101989203A (en) | 2010-01-05 | 2010-11-09 | Software component management system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101989203A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103077032A (en) * | 2013-01-06 | 2013-05-01 | 北京百度网讯科技有限公司 | Operation method for application program and application program client-side |
CN104933083A (en) * | 2014-03-19 | 2015-09-23 | 国家电网公司 | Sensor data dynamic scaling processing method and apparatus |
CN104935561A (en) * | 2014-03-19 | 2015-09-23 | 国家电网公司 | Assembly data processing method and device thereof |
CN105278942A (en) * | 2014-07-23 | 2016-01-27 | 腾讯科技(深圳)有限公司 | Component management method and apparatus |
CN105893041A (en) * | 2016-03-31 | 2016-08-24 | 努比亚技术有限公司 | Application program management method and device |
CN104935561B (en) * | 2014-03-19 | 2018-06-01 | 国家电网公司 | A kind of module data treating method and apparatus |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101499022A (en) * | 2008-02-01 | 2009-08-05 | 鸿富锦精密工业(深圳)有限公司 | Internal memory space releasing system and method |
CN101561763A (en) * | 2009-04-30 | 2009-10-21 | 腾讯科技(北京)有限公司 | Method and device for realizing dynamic-link library |
CN101876913A (en) * | 2010-01-05 | 2010-11-03 | 深圳中兴网信科技有限公司 | Software component management method and software component manager |
-
2010
- 2010-11-09 CN CN2010105472886A patent/CN101989203A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101499022A (en) * | 2008-02-01 | 2009-08-05 | 鸿富锦精密工业(深圳)有限公司 | Internal memory space releasing system and method |
CN101561763A (en) * | 2009-04-30 | 2009-10-21 | 腾讯科技(北京)有限公司 | Method and device for realizing dynamic-link library |
CN101876913A (en) * | 2010-01-05 | 2010-11-03 | 深圳中兴网信科技有限公司 | Software component management method and software component manager |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103077032A (en) * | 2013-01-06 | 2013-05-01 | 北京百度网讯科技有限公司 | Operation method for application program and application program client-side |
CN103077032B (en) * | 2013-01-06 | 2019-08-27 | 北京百度网讯科技有限公司 | The operating method of application program and the client of application program |
CN104933083A (en) * | 2014-03-19 | 2015-09-23 | 国家电网公司 | Sensor data dynamic scaling processing method and apparatus |
CN104935561A (en) * | 2014-03-19 | 2015-09-23 | 国家电网公司 | Assembly data processing method and device thereof |
CN104933083B (en) * | 2014-03-19 | 2018-02-09 | 国家电网公司 | A kind of processing method and processing device of sensing data dynamic retractility |
CN104935561B (en) * | 2014-03-19 | 2018-06-01 | 国家电网公司 | A kind of module data treating method and apparatus |
CN105278942A (en) * | 2014-07-23 | 2016-01-27 | 腾讯科技(深圳)有限公司 | Component management method and apparatus |
CN105893041A (en) * | 2016-03-31 | 2016-08-24 | 努比亚技术有限公司 | Application program management method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101876913A (en) | Software component management method and software component manager | |
CN101882092B (en) | Management method and device for application program | |
CN107832100B (en) | APK plug-in loading method and terminal thereof | |
US9330265B2 (en) | Method for component access control and electronic device | |
CN111367659B (en) | Resource management method, equipment and medium for nodes in Kubernetes | |
CN111338854A (en) | Kubernetes cluster-based method and system for quickly recovering data | |
CN114064213B (en) | Quick arranging service method and system based on Kubernets container environment | |
CN106331065A (en) | Proxy application for host system with service container and system | |
CN113590433B (en) | Data management method, data management system, and computer-readable storage medium | |
CN101989203A (en) | Software component management system | |
CN113420007B (en) | Audit processing method and device for database access and electronic equipment | |
CN101510156B (en) | Information system resource recovery method and device | |
CN114153525A (en) | AI model service sharing method and system for power grid regulation and control business | |
CN112799588B (en) | Data storage method for loading container cluster application data by using external storage | |
CN114020444A (en) | Calling system and method for resource service application in enterprise digital middleboxes | |
CN114710549A (en) | Dynamic management method, system and service node of network card in container platform | |
CN101729329A (en) | Method for managing application programs in open service gateway service platform and architecture thereof | |
CN111339173A (en) | Data sharing method, server and readable storage medium | |
WO2024078465A1 (en) | Scheduled job processing method, device, and storage medium | |
CN114911421B (en) | Data storage method, system, device and storage medium based on CSI plug-in | |
CN115801569B (en) | Access rule deployment method, device, equipment, medium and cloud platform | |
CN110650033B (en) | Distributed application configuration management method and distributed computing system | |
CN115080504A (en) | File management method, terminal and storage medium | |
CN101478425B (en) | Method and system for network management proxy | |
CN112000390A (en) | User information management method and device, electronic equipment and 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 | ||
DD01 | Delivery of document by public notice |
Addressee: Wu Zhenyu Document name: Notification of Passing Examination on Formalities |
|
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20110323 |