Host computer plug-in instance destruction method and apparatus

CN116991496BActive Publication Date: 2026-08-18SHIJIAZHUANG TONHE ELECTRONICS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310947962.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-31
Publication Date
2026-08-18
Estimated Expiration
2043-07-31

AI Technical Summary

Technical Problem

[0004]有鉴于此,本发明提供了一种上位机插件的实例销毁方法及装置,旨在解决现有技术中上位机插件间的动态连接容易造成上位机卡顿的问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116991496B_ABST
    Figure CN116991496B_ABST
Patent Text Reader

Abstract

The application provides an example destruction method and device of a host computer plug-in, which first receives closing information sent by a host computer display interface; determines a corresponding target plug-in according to the closing information, and acquires the application times of the target plug-in; when the application times of the target plug-in are less than a first preset value, destroys the instance object of the target plug-in and deletes the connection pointer information of the target plug-in. Through real-time and orderly disconnection between the plug-ins according to the application times of the plug-ins and destruction of the instance objects of the connected plug-ins, repeated memory occupation can be effectively avoided, the possibility of host computer lag can be reduced, and the stable and efficient code running process can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of equipment debugging technology, and in particular relates to a method and apparatus for destroying instances of host computer plug-ins. Background Technology

[0002] Whether it's the power modules used in charging piles at charging stations, vehicle-mounted power modules, or military-grade power modules, a host computer is usually designed during the power supply debugging process to monitor the status of each power module in real time. This allows for accurate identification of problems in the power modules during debugging, enabling optimization of these problems.

[0003] In existing technologies, each function of the host computer is independently set as a plug-in, and corresponding configuration files and connectors are set. When modifications are needed, only some plug-ins need to be replaced and the configuration files modified, and the connectors ensure dynamic connections between independent plug-ins. However, dynamic connections between plug-ins consume a large amount of memory, and these memory fragments can easily cause the host computer to lag, affecting its operation. Summary of the Invention

[0004] In view of this, the present invention provides a method and apparatus for destroying instances of host computer plug-ins, aiming to solve the problem that dynamic connections between host computer plug-ins in the prior art can easily cause host computer lag.

[0005] The first aspect of this invention provides a method for destroying instances of a host computer plugin. The host computer contains multiple independent plugins, each plugin implementing a specific function of the host computer. The host computer includes a manager for managing a first mapping table and a target mapping table. The first mapping table includes multiple sub-tabs on the host computer's display interface and the display interface ID of at least one plugin corresponding to each sub-tab. The target mapping table includes the display interface IDs of multiple plugins and connection pointer information corresponding to each plugin's display interface ID. The method includes:

[0006] Received a shutdown message from the host computer's display interface;

[0007] Based on the closure information, identify the corresponding target plugin and obtain the number of times the target plugin has been applied;

[0008] When the number of times the target plugin is used is less than the first preset value, the instance object of the target plugin is destroyed and the connection pointer information of the target plugin is deleted.

[0009] A second aspect of this invention provides a device for destroying instances of a host computer plugin. The host computer contains multiple plugins, each independent of the others, and each plugin implements a specific function of the host computer. The host computer includes a manager for managing a first mapping table and a target mapping table. The first mapping table includes multiple sub-tabs on the host computer's display interface and the display interface ID of at least one plugin corresponding to each sub-tab. The target mapping table includes the display interface IDs of multiple plugins and connection pointer information corresponding to each plugin's display interface ID. The device includes:

[0010] The receiving module is used to receive the close message sent by the host computer display interface;

[0011] The acquisition module is used to determine the corresponding target plugin based on the closing information and to obtain the number of times the target plugin has been applied.

[0012] The destruction module is used to destroy the instance object of the target plugin and delete the connection pointer information of the target plugin when the number of times the target plugin is used is less than a first preset value.

[0013] A third aspect of the present invention provides a host computer, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the host computer plugin instance destruction method of the first aspect above.

[0014] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the instance destruction method for the host computer plug-in as described in the first aspect above.

[0015] The method and apparatus for destroying instances of host computer plugins provided in this invention first receive a shutdown message sent by the host computer display interface; based on the shutdown message, the corresponding target plugin is determined, and the application count of the target plugin is obtained; when the application count of the target plugin is less than a first preset value, the instance object of the target plugin is destroyed, and the connection pointer information of the target plugin is deleted. By disconnecting the connections between plugins in real time and orderly according to the application count of each plugin, and destroying the instance objects of each connected plugin, repeated memory occupation can be effectively avoided, the possibility of host computer lag can be reduced, and the stable and efficient operation of the code can be ensured. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is an application scenario diagram of the instance destruction method for the host computer plugin provided in the embodiments of the present invention;

[0018] Figure 2 This is a flowchart illustrating the implementation of the instance destruction method for the host computer plugin provided in this embodiment of the invention.

[0019] Figure 3 This is a schematic diagram illustrating the implementation of the instance destruction method for the host computer plugin provided in this embodiment of the invention;

[0020] Figure 4 This is a schematic diagram of the structure of the instance destruction device for the host computer plug-in provided in an embodiment of the present invention;

[0021] Figure 5 This is a schematic diagram of the host computer structure provided in an embodiment of the present invention. Detailed Implementation

[0022] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.

[0023] Figure 1 This is an application scenario diagram of the instance destruction method for the host computer plugin provided in this embodiment of the invention. For example... Figure 1 As shown, in some embodiments, the method for destroying instances of the host computer plugin provided in this invention can be applied to, but is not limited to, this application scenario. In this embodiment, the system includes: a power module 11 and a host computer 12.

[0024] The power module 11 can be a power module used in charging piles, vehicle power modules, military power modules, or general power modules, etc., and is not limited here. The host computer 12 can be a computer, MCU, etc., and is not limited here. After connecting the power module 11 and the relevant debugging device, the host computer 12 uses its internally designed functions, namely the dynamic connection and disconnection process between various plug-ins, to debug the power module 11 and obtain the debugging results.

[0025] The host computer contains multiple independent plugins, each of which implements a specific function of the host computer. The host computer also includes a manager that manages a first mapping table and a target mapping table. The first mapping table includes multiple sub-tabs on the host computer's display interface and the display interface ID of at least one plugin corresponding to each sub-tab. The target mapping table includes the display interface IDs of multiple plugins and the connection pointer information corresponding to each plugin's display interface ID.

[0026] Figure 2 This is a flowchart illustrating the implementation of the instance destruction method for the host computer plugin provided in this embodiment of the invention. Figure 2 As shown, in some embodiments, the method for destroying instances of the host computer plugin is applied to... Figure 1 The host computer 12 shown in the figure includes the following method:

[0027] S210 receives a shutdown message sent from the host computer's display interface.

[0028] In response to the user terminal's shutdown operation, the number of times the target plugin is applied is obtained from the configuration file; the target plugin is determined by the shutdown operation and the first mapping table; the configuration file records the association between various plugins and the number of times each plugin is applied.

[0029] In this embodiment of the invention, the host computer display interface has multiple main tabs, each with at least one sub-tab; each sub-tab corresponds to the description information of at least one plugin. The main tab refers to the toolbar content of the main interface, including information such as tools, files, editing, and help. The sub-tab refers to the sub-content contained under the main tab, specifically the modification / implementation of that sub-content. When a sub-tab is clicked, the host computer executes the function implementation operation of the sub-content of that sub-tab. For example, according to the configuration file description above, the user can read the configuration file in the main interface and dynamically add sub-tabs to the main tab "Tools". The sub-tabs of the main tab "Tools" are: CANtools and CAN driver settings. Correspondingly, in response to the user terminal's closing operation, specifically, the user closes the sub-tab on the host computer interface.

[0030] S220: Based on the shutdown information, determine the corresponding target plugin and obtain the number of times the target plugin has been applied.

[0031] In this embodiment of the invention, the configuration file records the number of times each plugin is applied, and the number of applications is adjusted each time a plugin is connected or destroyed.

[0032] S230, when the number of times the target plugin is used is less than the first preset value, the instance object of the target plugin is destroyed and the connection pointer information of the target plugin is deleted.

[0033] In this embodiment of the invention, the preset number of times can be determined according to actual needs and is not limited here. For example, the preset number of times can be set to 1. When a plugin needs to be disconnected, the application count of the plugin and its connected plugins is decremented by one. This process is continuously accumulated. At this time, the host computer continuously executes the above traversal and judgment process in a loop. When it is determined that the application count of a certain plugin is less than zero, the plugin can be disconnected, thereby ensuring the orderly disconnection of plugins.

[0034] In this embodiment of the invention, after a plugin completes its connection, for some plugins, their instance objects need to be stored to avoid repeated memory allocation caused by repeated plugin connections. However, for other plugins, they need to be destroyed promptly to avoid memory usage-induced lag and ensure efficient operation of the host computer code. Therefore, during plugin operation, it is necessary to continuously and systematically destroy the instance objects of each plugin in real time.

[0035] For example, implementing CAN functionality requires two functions: CANtools and CAN driver settings. Each function has multiple plugins. Plugins in the CAN driver settings function do not need to be destroyed in real time, while plugins in the CANtools function do need to be destroyed in real time, for the following reasons:

[0036] First, once the CAN driver is set up, CANtools needs to be used multiple times when it is opened and closed. If the plugin is automatically destroyed in real time after the CAN driver setting interface is closed, then the CAN driver settings need to be reset every time CANtools is opened, which increases the user's cumbersome usage.

[0037] Secondly, the CANtools function plugin instance objects need to be destroyed in real time, because after opening and closing CANtools once, it may not be opened again in the future. Therefore, there is no need for CANtools to continue to maintain memory space, nor is it necessary to continue to maintain the connection relationship between various related plugins.

[0038] Therefore, in this embodiment of the invention, selecting plugins to be destroyed according to the number of times they are used ensures that plugins that are repeatedly used are not destroyed, and only plugins that are used less often are destroyed, thereby minimizing memory usage without affecting the operation of the host computer.

[0039] In this embodiment of the invention, by disconnecting the connections between plugins in real time and in an orderly manner based on the number of times each plugin is used, and destroying the instance objects of each connected plugin, it is possible to effectively avoid repeated memory occupation, reduce the possibility of upper computer lag, ensure the stability and efficiency of the code running process, and reduce code modification.

[0040] In some embodiments, prior to S210, the method further includes: for each plugin in the host computer, if the window corresponding to the current plugin is displayed on the host computer's display interface and the current plugin is an entry plugin, then checking whether the application count corresponding to the current plugin in the current configuration file is a second preset value; wherein, the configuration file records the association relationship between each plugin and the application count of each plugin; if the application count corresponding to the current plugin in the current configuration file is the second preset value, then incrementing the application count of the current plugin in the configuration file by one; connecting the signal of the current plugin to the destruction slot function of the manager; and incrementing the application count of the plugins associated with the current plugin by one. Furthermore, to ensure the detection and execution of plugin disconnection, it is necessary to call the connection and destruction functions of the plugin and manager in the dynamic library, connecting the entry plugin signal to the destruction slot function of the manager, thus realizing the signal slot connection.

[0041] In this embodiment of the invention, each time a plugin generates an instance object on the host computer, that is, when it is displayed on the host computer's display interface and is the entry plugin, its application count is incremented by one. At this time, the plugin connected to it will also generate an instance object, and the application count of the plugin connected to it will also be incremented by one.

[0042] In this embodiment of the invention, the user can set the initial application count of each plugin to 0, or set the initial application count of each plugin according to the plugin's historical application data; no limitation is made here. When the current plugin is detected as an entry plugin, in addition to incrementing the application count of the entry plugin, the connection and destruction functions of the dynamic library's plugin and manager are also called to connect the entry plugin signal to the manager's destruction slot function, thus realizing the signal slot connection.

[0043] In some embodiments, the method further includes: obtaining the number of times the target plugin was used in a historical period; and determining the initial value of the number of times each target plugin was used in the configuration file based on the number of times each target plugin was used in the historical period.

[0044] In some embodiments, after detecting whether the number of applications corresponding to the current plugin in the current configuration file is a second preset value, the method further includes: if the number of applications corresponding to the current plugin in the current configuration file is not a second preset value, then the number of applications of the current plugin and the number of applications of the associated plugin remain unchanged.

[0045] In this embodiment of the invention, the application count of the plugin is initialized to 0 using the configuration file. Not only is the application count of the entry plugin updated, but the application count of the currently associated plugin is also updated when traversing the associated items of a plugin. This update prepares for future disconnection operations. Even if the application count recorded in the configuration file reaches a second preset value, it will no longer increase.

[0046] In some embodiments, before S230, the method further includes: for each target plugin, if the current target plugin is an entry plugin, disconnecting the current target plugin from the manager and decrementing the application count of the current target plugin by one; for each target plugin, disconnecting the current target plugin from the plugins associated with the current target plugin and decrementing the application count associated with the current target plugin by one.

[0047] In some embodiments, when the number of times the current target plugin is used is not less than a first preset value, the process jumps to the step of determining whether the number of times the current target plugin is used is less than the first preset value, until all target plugins corresponding to the shutdown information have been traversed.

[0048] In this embodiment of the invention, the plugins corresponding to each sub-tag in the configuration file can be divided into a subset. Each plugin in this subset corresponds to a master value, namely the plugin's ID and description information. Each time a user performs a close operation on a sub-tag's function, all target plugins corresponding to the close operation, i.e., all master values ​​corresponding to the subset, are traversed, thereby achieving the orderly destruction of plugins.

[0049] In some embodiments, the target mapping table includes a second mapping table and a third mapping table; the second mapping table includes each display interface ID and a pointer to the dynamic library entry function corresponding to each display interface ID; the third mapping table includes each display interface ID and a pointer to the instance object corresponding to each display interface ID; accordingly, S220 may include: when the number of times the target plugin is applied is less than a first preset value, determining the display interface ID of the target plugin; deleting the pointer to the instance object corresponding to the display interface ID of the plugin to be deleted in the third mapping table and the pointer to the dynamic library entry function corresponding to the display interface ID of the plugin to be deleted in the second mapping table; and calling the interface function of the dynamic library corresponding to the display interface ID of the plugin to be deleted to destroy the instance object of the plugin to be deleted.

[0050] Figure 3 This is a schematic diagram illustrating the implementation of the instance destruction method for the host computer plugin provided in this embodiment of the invention. For example... Figure 3 As shown in this implementation example, each plugin forms its own dynamic library. The external interface of each dynamic library consists of functions for creating and destroying plugin instances. Each plugin inherits from the linker and implements the linker's virtual functions. The linker's external interface includes inter-plugin communication signals, inter-plugin communication slot functions, and inter-plugin connection functions. In addition, to facilitate the display of plugins with a user interface, a `show` method for plugins with a user interface is added. This dynamic library is used for the aforementioned connection methods.

[0051] The specific steps for destroying the plugin in this implementation example are as follows:

[0052] The first step is to send a communication signal between the plugin and the manager when the plugin interface is closed. This signal notifies the manager's destruction slot function.

[0053] The second step involves the manager's destruction slot function receiving a signal and then destroying the plugin. The destruction process in the second step is as follows:

[0054] 1. Iterate through the extracted subset values ​​and determine if they are entry plugins. If they are entry plugins, disconnect the connection between the manager and the plugin and reduce the number of times the entry plugin has been used.

[0055] 2. Iterate through the associated items of the current entry plugin, disconnect the connection between the current plugin and the current associated item, and decrement the application count of the current associated item until all associated items of the current entry plugin have been iterated.

[0056] 3. Continue until all subset values ​​in step 1 have been traversed.

[0057] 4. Iterate through the extracted subset values ​​again and determine if the current plugin's application count is less than 1. If it is less than 1, proceed to step 5; otherwise, proceed to step 6.

[0058] 5. Delete the pointer to a plugin instance object in mapping table 3, delete the pointer to the entry function of a plugin dynamic library in mapping table 2, call the interface function of the dynamic library to destroy the plugin instance, and proceed to step 6.

[0059] 6. Continue iterating through the next sub-value of the extracted subset and repeat the judgment in steps 4, 5, and 6 for a new round.

[0060] In the configuration file, each sub-tag corresponds to a plugin that can be divided into a subset. Each plugin in this subset corresponds to a master value, namely the plugin's ID and its description.

[0061] In summary, the beneficial effects of the present invention are as follows:

[0062] By disconnecting the connections between plugins in real time and in an orderly manner based on the number of times each plugin has been used, and destroying the instance objects of each connected plugin, it is possible to effectively avoid repeated memory occupation, reduce the possibility of upper computer lag, ensure the stability and efficiency of the code execution process, and reduce code modifications.

[0063] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0064] Figure 4 This is a schematic diagram of the structure of an instance destruction device for a host computer plug-in provided in an embodiment of the present invention. Figure 4As shown, in some embodiments, the instance destruction device 4 of the host computer plug-in includes:

[0065] The acquisition module 410 is used to acquire the number of times the target plugin is applied, as recorded in the configuration file, in response to the user terminal's closing operation. The target plugin is determined by the closing operation and the first mapping table. The configuration file records the association between various plugins and the number of times each plugin is applied.

[0066] The destruction module 420 is used to destroy the instance object of the target plugin and the connection pointer information of the target plugin in the target mapping table according to the number of times the target plugin has been used.

[0067] Optionally, the instance destruction device 4 for the host computer plugin further includes: an accumulation module, used to increment the application count of each plugin in the configuration file when the window corresponding to the plugin is displayed on the display interface of the host computer and the plugin is an entry plugin; connect the signal of each entry plugin to the destruction slot function of the manager; and increment the application count of the plugin currently connected to the entry plugin for each entry plugin.

[0068] Optionally, the instance destruction device 4 of the host computer plugin also includes: a decrement module, which traverses each target plugin, disconnects the target plugin from the manager when the target plugin is an entry plugin, and decrements the application count of the target plugin by one; it traverses each plugin connected to the target plugin, disconnects the target plugin from each plugin it is connected to, and decrements the application count of each plugin it is connected to by one.

[0069] Optionally, the destruction module 420 is specifically used for: traversing each target plugin and determining whether the number of times the target plugin is used is less than a preset number; when the number of times the target plugin is used is less than the preset number, destroying the instance object of the target plugin and the connection pointer information of the target plugin in the target mapping table; when the number of times the target plugin is used is greater than or equal to the preset number, jumping to the step of traversing each target plugin and determining whether the number of times the target plugin is used is less than the preset number.

[0070] Optionally, the destruction module 420 is specifically used to determine the destruction order of the target plugin based on the number of times the target plugin has been used; and to destroy the instance objects of the target plugin in turn according to the destruction order.

[0071] Optionally, the destruction module 420 is specifically used to sort the application counts of the target plugins from smallest to largest to obtain the destruction order; according to the destruction order, the instance objects of the target plugins are destroyed sequentially at preset time intervals.

[0072] Optionally, the target mapping table includes a second mapping table and a third mapping table; the second mapping table includes each display interface ID and a pointer to the dynamic library entry function corresponding to each display interface ID; the third mapping table includes each display interface ID and a pointer to the instance object corresponding to each display interface ID; correspondingly, the destruction module 420 is specifically used to determine the display interface ID of the plugin to be deleted based on the number of times the target plugin has been used; delete the instance object pointer corresponding to the display interface ID of the plugin to be deleted in the third mapping table and the pointer to the dynamic library entry function corresponding to the display interface ID of the plugin to be deleted in the second mapping table; and call the interface function of the dynamic library corresponding to the display interface ID of the plugin to be deleted to destroy the instance object of the plugin to be deleted.

[0073] The instance destruction device for the host computer plug-in provided in this embodiment can be used to execute the above method embodiment. Its implementation principle and technical effect are similar, and will not be described again in this embodiment.

[0074] Figure 5 This is a schematic diagram of the host computer structure provided in an embodiment of the present invention. Figure 5 As shown, an embodiment of the present invention provides a host computer 5, which includes a processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the processor 50. When the processor 50 executes the computer program 52, it implements the steps in the embodiments of the above-described host computer plugin instance destruction methods, for example... Figure 2 Steps 210 to 220 are shown. Alternatively, when processor 50 executes computer program 52, it implements the functions of each module / unit in the above system embodiments, for example... Figure 4 The functions of modules 410 to 420 are shown.

[0075] For example, computer program 52 can be divided into one or more modules / units, one or more of which are stored in memory 51 and executed by processor 50 to complete the present invention. One or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of computer program 52 in host computer 5.

[0076] The host computer 5 can be a mobile phone, MCU, ECU, industrial control computer, etc., and is not limited thereto. The server can be a physical server, cloud server, etc., and is not limited thereto. The host computer 5 may include, but is not limited to, a processor 50 and a memory 51. Those skilled in the art will understand that... Figure 5 This is merely an example of the host computer 5 and does not constitute a limitation on the host computer 5. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the host computer may also include input / output devices, network access devices, buses, etc.

[0077] The processor 50 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0078] The memory 51 can be an internal storage unit of the host computer 5, such as the hard disk or RAM of the host computer 5. The memory 51 can also be an external storage device of the host computer 5, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the host computer 5. Furthermore, the memory 51 can include both internal storage units and external storage devices of the host computer 5. The memory 51 is used to store computer programs and other programs and data required by the host computer. The memory 51 can also be used to temporarily store data that has been output or will be output.

[0079] This invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the steps in the above-described method for destroying instances of a host computer plug-in.

[0080] A computer-readable storage medium stores a computer program 52. The computer program 52 includes program instructions. When executed by the processor 50, the program instructions implement all or part of the processes in the methods described in the above embodiments. The computer program 52 can also instruct related hardware to implement these processes. The computer program 52 can be stored in a computer-readable storage medium. When executed by the processor 50, the computer program 52 can implement the steps of the various method embodiments described above. The computer program 52 includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0081] The computer-readable storage medium can be an internal storage unit of the host computer in any of the foregoing embodiments, such as the host computer's hard disk or memory. The computer-readable storage medium can also be an external storage device of the host computer, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the host computer. Furthermore, the computer-readable storage medium can include both internal storage units and external storage devices of the host computer. The computer-readable storage medium is used to store computer programs and other programs and data required by the host computer. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0082] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0083] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0084] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0085] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0086] In the embodiments provided by this invention, it should be understood that the disclosed device / host computer and method can be implemented in other ways. For example, the device / host computer embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0087] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0088] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0089] If an integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0090] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. An instance destruction method of a host computer plug-in, characterized by, The host computer is equipped with multiple independent plugins, each plugin is used to implement a certain function of the host computer; the host computer is equipped with a manager; the manager is used to manage a first mapping table and a target mapping table; the first mapping table includes multiple sub-tabs on the host computer display interface and the display interface ID of at least one plugin corresponding to each sub-tab; The target mapping table includes the display interface IDs of multiple plugins and the connection pointer information corresponding to the display interface ID of each plugin; The method includes: Received a shutdown message from the host computer's display interface; Based on the closed information, the corresponding target plugin is determined, and the number of times the target plugin has been used is obtained; When the number of times the target plugin is used is less than a first preset value, the instance object of the target plugin is destroyed and the connection pointer information of the target plugin is deleted; Before receiving the shutdown message sent by the host computer display interface, the method further includes: For each plugin in the host computer, if the window corresponding to the current plugin is displayed on the display interface of the host computer and the current plugin is the entry plugin, then check whether the number of times the current plugin is applied in the current configuration file is the second preset value; wherein, the configuration file records the association between each plugin and the number of times each plugin is applied. If the number of times the current plugin is applied in the current configuration file is the second preset value, then the number of times the current plugin is applied in the configuration file is incremented by one. Connect the signal of the current plugin to the destroy slot function of the manager; Increment the application count of the associated plugins connected to the current plugin by one. After detecting whether the number of applications corresponding to the current plugin in the current configuration file is the second preset value, the method further includes: If the number of times the current plugin is used in the current configuration file is not the second preset value, then the number of times the current plugin is used and the number of times the associated plugin is used remain unchanged. The target mapping table includes a second mapping table and a third mapping table; the second mapping table includes each display interface ID and a pointer to the dynamic library entry function corresponding to each display interface ID; the third mapping table includes each display interface ID and a pointer to the instance object corresponding to each display interface ID. When the number of times the target plugin is used is less than a first preset value, the instance object of the target plugin is destroyed and the connection pointer information of the target plugin is deleted, including: When the number of times the target plugin is used is less than a first preset value, the display interface ID of the target plugin is determined; Delete the instance object pointer corresponding to the display interface ID of the plugin to be deleted in the third mapping table and the dynamic library entry function pointer corresponding to the display interface ID of the plugin to be deleted in the second mapping table; Call the interface function of the dynamic library corresponding to the display interface ID of the plugin to be deleted to destroy the instance object of the plugin to be deleted.

2. The host computer plug-in instance destruction method of claim 1, wherein, Before destroying the instance object of the target plugin and deleting the connection pointer information of the target plugin when the number of times the target plugin is used is less than a first preset value, the method further includes: For each target plugin, if the current target plugin is an entry plugin, then disconnect the current target plugin from the manager and decrement the application count of the current target plugin by one; For each target plugin, disconnect the connection between the current target plugin and its associated plugin, and decrement the application count of the current target plugin's associated plugin by one.

3. The method for destroying instances of a host computer plugin according to claim 1, characterized in that, The method further includes: When the number of times the current target plugin is used is not less than the first preset value, the next target plugin is selected as the current target plugin; the process jumps to the step of determining whether the number of times the current target plugin is used is less than the first preset value, until all target plugins corresponding to the closing information have been traversed.

4. The method for destroying instances of a host computer plugin according to claim 1, characterized in that, The method further includes: Obtain the number of times the target plugin was used within a historical time period; Based on the number of times each target plugin was used within a historical period, the initial value of the number of times each target plugin was used in the configuration file was determined.

5. An instance destruction device for a host computer plugin that executes the instance destruction method for a host computer plugin as described in claim 1, characterized in that, The host computer is equipped with multiple independent plugins, each plugin is used to implement a certain function of the host computer; the host computer is equipped with a manager; the manager is used to manage a first mapping table and a target mapping table; the first mapping table includes multiple sub-tabs on the host computer display interface and the display interface ID of at least one plugin corresponding to each sub-tab; The target mapping table includes the display interface IDs of multiple plugins and the connection pointer information corresponding to the display interface ID of each plugin; The device includes: The receiving module is used to receive the close message sent by the host computer display interface; The acquisition module is used to determine the corresponding target plugin based on the closing information, and to acquire the number of times the target plugin has been used. The destruction module is used to destroy the instance object of the target plugin and delete the connection pointer information of the target plugin when the number of times the target plugin is used is less than a first preset value.

6. A host computer, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the instance destruction method of the host computer plug-in as described in any one of claims 1 to 4 above.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the instance destruction method for the host computer plug-in as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Plug-in management method and system thereof

    CN101464805A

  • Plug-in loading method for saving memory cost

    CN101582039A