CN116991496A - Method and device for destroying instances of upper computer plug-in - Google Patents

Method and device for destroying instances of upper computer plug-in Download PDF

Info

Publication number
CN116991496A
CN116991496A CN202310947962.7A CN202310947962A CN116991496A CN 116991496 A CN116991496 A CN 116991496A CN 202310947962 A CN202310947962 A CN 202310947962A CN 116991496 A CN116991496 A CN 116991496A
Authority
CN
China
Prior art keywords
plug
target
display interface
upper computer
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310947962.7A
Other languages
Chinese (zh)
Inventor
张�浩
马群
李睿
田雨佳
郭凯瑞
刘梦飞
宋鑫
白朝阳
张逾良
徐卫东
司建龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shijiazhuang Tonghe Electronics Co Ltd
Original Assignee
Shijiazhuang Tonghe Electronics 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 Shijiazhuang Tonghe Electronics Co Ltd filed Critical Shijiazhuang Tonghe Electronics Co Ltd
Priority to CN202310947962.7A priority Critical patent/CN116991496A/en
Publication of CN116991496A publication Critical patent/CN116991496A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides an example destroying method and device of an upper computer plug-in, which comprises the steps of firstly receiving closing information sent by an upper computer display interface; determining a corresponding target plug-in according to the closing information, and acquiring the application times of the target plug-in; when the application times of the target plugin are smaller than a first preset value, destroying the instance object of the target plugin and deleting the connection pointer information of the target plugin. The connection among the plug-ins is disconnected in real time and orderly according to the application times of the plug-ins, and the instance objects of the plug-ins connected in each way are destroyed, so that repeated occupation of a memory can be effectively avoided, the possibility of blocking of an upper computer is reduced, and the stability and the high efficiency of a code running process are ensured.

Description

Method and device for destroying instances of upper computer plug-in
Technical Field
The application belongs to the technical field of equipment debugging, and particularly relates to an instance destroying method and device of an upper computer plug-in.
Background
Whether the power module is used in the charging pile of the charging station, the vehicle-mounted power module, or the military power supply and the electric power module, an upper computer is generally designed in the power debugging process and used for real-time monitoring of the states of all the power modules so as to accurately position the problems of the power modules in the module debugging process, thereby optimizing the problems.
In the prior art, by independently setting each function of the upper computer as a plug-in unit and correspondingly setting a configuration file and a connector, when the modification is needed, only part of plug-in units are needed to be replaced and the configuration file is needed to be modified, and the dynamic connection between the independent plug-in units can be ensured through the connector. However, the dynamic connection between the plugins occupies a large amount of memory, and the memory fragments easily cause the upper computer to be blocked, so that the operation of the upper computer is affected.
Disclosure of Invention
In view of this, the present application provides a method and a device for destroying an instance of an upper computer plug-in, which aims to solve the problem in the prior art that the dynamic connection between the upper computer plug-ins easily causes the upper computer to be blocked.
The first aspect of the embodiment of the application provides an example destroying method of an upper computer plug-in, wherein a plurality of mutually independent plug-ins are arranged in the upper computer, and each plug-in is used for realizing one type of function of the upper computer; a manager is arranged in the upper computer; the manager is used for managing the first mapping table and the target mapping table; the first mapping table comprises a plurality of sub-labels on the upper computer display interface and a display interface id of at least one plug-in corresponding to each sub-label; the target mapping table comprises the display interface ids of the plurality of plug-ins and the connection pointer information corresponding to the display interface id of each plug-in; the method comprises the following steps:
receiving closing information sent by a display interface of an upper computer;
determining a corresponding target plug-in according to the closing information, and acquiring the application times of the target plug-in;
when the application times of the target plugin are smaller than a first preset value, destroying the instance object of the target plugin and deleting the connection pointer information of the target plugin.
The second aspect of the embodiment of the application provides an example destroying device of an upper computer plug-in unit, wherein a plurality of plug-ins are arranged in the upper computer, the plug-ins are mutually independent, and each plug-in unit is used for realizing one type of function of the upper computer; a manager is arranged in the upper computer; the manager is used for managing the first mapping table and the target mapping table; the first mapping table comprises a plurality of sub-labels on the upper computer display interface and a display interface id of at least one plug-in corresponding to each sub-label; the target mapping table comprises the display interface ids of the plurality of plug-ins and the connection pointer information corresponding to the display interface id of each plug-in; the device comprises:
the receiving module is used for receiving closing information sent by the upper computer display interface;
the acquisition module is used for determining a corresponding target plug-in according to the closing information and acquiring the application times of the target plug-in;
the destroying module is used for destroying the instance object of the target plug-in and deleting the connection pointer information of the target plug-in when the application times of the target plug-in are smaller than a first preset value.
A third aspect of an embodiment of the present application provides a host computer, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method for destroying instances of the host computer plug-in according to the first aspect above when the processor executes the computer program.
A fourth aspect of the embodiments of the present application provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method for destroying instances of a higher-level computer plug-in as described above in the first aspect.
The embodiment of the application provides an example destroying method and device of an upper computer plug-in, which comprises the steps of firstly receiving closing information sent by an upper computer display interface; determining a corresponding target plug-in according to the closing information, and acquiring the application times of the target plug-in; when the application times of the target plugin are smaller than a first preset value, destroying the instance object of the target plugin and deleting the connection pointer information of the target plugin. The connection among the plug-ins is disconnected in real time and orderly according to the application times of the plug-ins, and the instance objects of the plug-ins connected in each way are destroyed, so that repeated occupation of a memory can be effectively avoided, the possibility of blocking of an upper computer is reduced, and the stability and the high efficiency of a code running process are ensured.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is an application scenario diagram of an example destruction method of an upper computer plug-in provided by an embodiment of the present application;
fig. 2 is a flowchart of an implementation of an example destruction method of an upper computer plug-in provided by an embodiment of the present application;
fig. 3 is a schematic implementation diagram of an example destruction method of an upper computer plug-in provided by an embodiment of the present application;
fig. 4 is a schematic structural diagram of an example destroying device of an upper computer plug-in unit according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an upper computer according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
Fig. 1 is an application scenario diagram of an example destruction method of an upper computer plug-in provided by an embodiment of the present application. As shown in fig. 1, in some embodiments, the method for destroying an instance of a host computer plug-in provided by the embodiments of the present application may be applied to the application scenario, but is not limited to the application scenario. In an embodiment of the application, the system comprises: a power module 11 and an upper computer 12.
The power supply module 11 may be a power supply module used in a charging pile, a vehicle-mounted power supply module, a military power supply, a power supply module, or the like, and is not limited herein. The host computer 12 may be a computer, an MCU, etc., and is not limited herein. After the power module 11 and the related debugging device are connected, the upper computer 12 realizes the debugging of the power module 11 through the functions designed in the upper computer, namely the dynamic connection and disconnection processes among all the plug-ins, and obtains the debugging result.
Wherein, a plurality of mutually independent plug-ins are arranged in the upper computer, and each plug-in is used for realizing one type of function of the upper computer; a manager is arranged in the upper computer; the manager is used for managing the first mapping table and the target mapping table; the first mapping table comprises a plurality of sub-labels on the upper computer display interface and a display interface id of at least one plug-in corresponding to each sub-label; the target mapping table comprises display interface ids of a plurality of plug-ins and connection pointer information corresponding to the display interface ids of each plug-in.
Fig. 2 is a flowchart of an implementation method of an example destruction method of an upper computer plug-in provided by an embodiment of the present application. As shown in fig. 2, in some embodiments, an example destruction method of the upper computer plug-in is applied to the upper computer 12 shown in fig. 1, and the method includes:
s210, receiving closing information sent by the upper computer display interface.
Responding to closing operation of the user terminal, and acquiring the application times of the target plugin recorded in the configuration file; wherein the target plugin is determined by the shutdown operation and the first mapping table; the configuration file records the association relation among the plug-ins and the application times of each plug-in.
In the embodiment of the application, a plurality of main labels are arranged on the upper computer display interface, and at least one sub-label is arranged under each main label; each sub-label corresponds to the description information of at least one plug-in. Wherein, the main label refers to toolbar content of the main interface, and comprises: tools, files, edits, aids, etc. The sub-tag refers to sub-content contained under the main tag, specifically, modification/implementation of the sub-content, after the sub-tag is clicked, the upper computer executes function implementation operation of the sub-content of the sub-tag, for example, after describing according to the configuration file, a user reads the configuration file in the main interface, and the sub-tag can be dynamically added in a main tag "tool", where the main tag "tool" sub-tag is: CAN tools and CAN drive settings. Correspondingly, the sub-label is closed on the upper computer interface by responding to the closing operation of the user terminal, specifically, the user.
S220, determining a corresponding target plug-in according to the closing information, and acquiring the application times of the target plug-in.
In the embodiment of the application, the application times of each plug-in are recorded in the configuration file, and the application times are adjusted when the plug-in is connected/destroyed each time.
And S230, destroying the instance object of the target plug-in and deleting the connection pointer information of the target plug-in when the application times of the target plug-in are smaller than a first preset value.
In the embodiment of the present application, the preset times may be determined according to actual requirements, which is not limited herein. For example, the preset number of times can be set to be 1, when the plug-in needs to be disconnected, the number of applications of the plug-in and the plug-in connected with the plug-in is reduced by one, the process is continuously and cumulatively reduced, at this time, the upper computer continuously and circularly executes the traversing and judging process, and when judging that the number of applications of a certain plug-in is less than zero, the plug-in can be disconnected, so that the orderly disconnection of the plug-in is ensured.
In the embodiment of the application, after the plug-ins are connected, for part of plug-ins, the example objects are required to be stored to avoid repeated opening of the memory caused by repeated connection of the plug-ins, but for other plug-ins, the plug-ins are required to be destroyed in time, so that the blocking caused by memory occupation is avoided, and the efficient operation of the upper computer code is ensured. Thus, during the running process of the plug-ins, the instance objects of each plug-in need to be continuously destroyed in real time and orderly.
For example, the implementation of CAN functionality requires: CAN tools function, CAN driver setup function. There are multiple plug-ins under each function. The plug-in the CAN drive setting function does not need to be destroyed in real time, and the plug-in the CANtools function needs to be destroyed in real time for the following reasons:
firstly, after one CAN drive setting is completed, the CAN tools are required to be used for multiple times of opening and closing, if the CAN drive setting interface is closed, the plug-in is automatically destroyed in real time, and the CAN drive setting is required to be reset once for each time of opening the CAN tools, so that the use complexity of a user is increased;
secondly, the object of the Cantools function plug-in instance needs to be destroyed in real time, and the Cantools are not necessary to keep the memory space and the connection relation among the related item plug-ins because the Cantools are not opened again after being opened once and then closed.
Therefore, in the embodiment of the application, the plug-in to be destroyed is selected according to the application times, so that the plug-in repeatedly applied can be ensured not to be destroyed, and only the plug-in with fewer application times is destroyed, so that the memory occupation is reduced as much as possible on the premise of not influencing the operation of the upper computer.
In the embodiment of the application, the connection among the plug-ins is disconnected in real time and orderly according to the application times of the plug-ins, and the instance objects of the plug-ins connected are destroyed, so that the repeated occupation of the memory can be effectively avoided, the possibility of blocking of an upper computer is reduced, the stability and the high efficiency of the code running process are ensured, and the code modification is reduced.
In some embodiments, prior to S210, the method further comprises: for each plug-in the upper computer, if a window corresponding to the current plug-in is displayed on a display interface of the upper computer and the current plug-in is an inlet plug-in, detecting whether the application times corresponding to the current plug-in the current configuration file are second preset values or not; the configuration file records the association relation among the plug-ins and the application times of each plug-in; if the application frequency corresponding to the current plug-in the current configuration file is a second preset value, adding one to the application frequency of the current plug-in the configuration file; connecting the signal of the current plug-in to the destruction slot function of the manager; the number of applications of the plug-in associated with the current plug-in is increased by one. In addition, in order to ensure the detection and execution of the plug-in disconnection, the connection and destruction functions of the plug-in and the manager of the dynamic library are required to be called, and the signal of the inlet plug-in is connected to the destruction groove function of the manager to realize the connection of the signal groove.
In the embodiment of the application, each time an instance object is generated on the upper computer by the plugin, namely, the plugin is displayed on the display interface of the upper computer and is an inlet plugin, the application times of the plugin are increased by one, the connected plugin also necessarily generates the instance object at the moment, and the application times of the plugin connected with the plugin are correspondingly increased by one.
In the embodiment of the application, the user can set the initial value of the application times of each plug-in unit to 0, and can set the initial value of the application times of each plug-in unit according to the historical application conditions of the plug-in units, which is not limited herein. When the current plug-in is detected to be the inlet plug-in, besides the application times++ of the inlet plug-in, the connection and the destruction function of the plug-in and the manager of the dynamic library are also called, and the inlet plug-in signal is connected to the destruction groove function of the manager to realize the connection of the signal groove.
In some embodiments, the method further comprises: acquiring the application times of a target plug-in a history period; and determining the initial value of the application times of each target plug-in the configuration file record according to the application times of each target plug-in the history period.
In some embodiments, after detecting whether the number of applications corresponding to the current plug-in the current configuration file is the second preset value, the method further includes: if the application times corresponding to the current plug-in the current configuration file are not the second preset value, the application times of the current plug-in and the application times of the associated plug-in are kept unchanged.
In the embodiment of the application, the application frequency of the plug-in is initialized to be 0 by using the configuration file, so that the application frequency of the inlet plug-in is updated, and when the association of a certain plug-in is traversed, the application frequency of the current association plug-in is updated, and the update is prepared for the subsequent disconnection operation. Even if the number of applications of the profile record reaches the second preset value, it is not increased any more.
In some embodiments, prior to S230, the method further comprises: for each target plug-in, if the current target plug-in is an inlet plug-in, disconnecting the current target plug-in from the manager, and subtracting one from the application frequency of the current target plug-in; for each target plugin, disconnecting the current target plugin from the associated plugin of the current target plugin, and subtracting one from the associated number of applications of the current target plugin.
In some embodiments, when the number of applications of the current target plugin is not less than the first preset value, the step of jumping to determine whether the number of applications of the current target plugin is less than the first preset value is performed until all target plugins corresponding to the closing information are traversed.
In the embodiment of the application, the plugins corresponding to each sub-tag in the configuration file can be divided into a subset, and each plugin under the subset corresponds to a main value, namely the id of the plugin and the description information of the plugin. And each time the user executes a closing operation on the function of one sub-label, traversing all target plugins corresponding to the closing operation, namely all main values corresponding to the subset, so as to realize ordered destruction of the plugins.
In some embodiments, the target mapping table includes a second mapping table and a third mapping table; the second mapping table comprises each display interface id and a dynamic library entry function pointer corresponding to each display interface id; the third mapping table comprises various display interface ids and instance object pointers corresponding to the display interface ids; accordingly, S220 may include: when the application times of the target plug-in are smaller than a first preset value, determining the display interface id of the target plug-in; deleting an instance object pointer corresponding to the display interface id of the plug-in to be deleted in the third mapping table and a dynamic library entry function pointer corresponding to the display interface id of the plug-in to be deleted in the second mapping table; and calling an interface function of a dynamic library corresponding to the display interface id of the plug-in to be deleted to destroy the instance object of the plug-in to be deleted.
Fig. 3 is an implementation schematic diagram of an example destruction method of an upper computer plug-in provided by an embodiment of the present application. As shown in fig. 3, in this implementation example, each plug-in forms a dynamic library of the plug-ins, and the external interface of each dynamic library is: creating and destroying functions of plug-in instances, wherein each plug-in inherits to the connector and is a virtual function realization of the connector, and the external interface of the connector is as follows: in addition to inter-plug-in communication signals, inter-plug-in communication slot functions and inter-plug-in connection functions, a plug-in show method with an interface is added to facilitate the display of the plug-in with the interface. The dynamic library is used in the connection method.
The destroying step of the plug-in this implementation example specifically includes:
and the first step, when a certain plug-in interface is closed, a plug-in and manager communication signal is sent, and the signal informs the manager of the destruction slot function.
The second step, after the destroying groove function of the manager receives the signal, the plug-in is destroyed, wherein the destroying process in the second step is as follows:
1. traversing the sub-values of the extracted subset, judging whether the sub-values are the entry plugins, disconnecting the manager from the plugins if the sub-values are the entry plugins, and turning the application times of the entry plugins into the number of times.
2. Traversing the association item of the current entry plug-in, disconnecting the connection between the current plug-in and the current association item, and applying the current association item for a number of times until all the association items of the current entry plug-in are traversed.
3. Until all sub-values of the subset in 1 have been traversed.
4. Traversing the sub-values of the extracted subset again, judging whether the application times of the current plug-in is less than 1, if so, executing the step 5, and if not, executing the step 6.
5. Deleting an object pointer of a certain plug-in instance in the mapping table 3, deleting an entry function pointer of a certain plug-in dynamic library in the mapping table 2, calling an interface function of the dynamic library to destroy the certain plug-in instance, and entering a step 6.
6. And continuing traversing the next sub-value of the extracted subset, and carrying out the judgment of the steps 4, 5 and 6 of a new round again.
The plugins corresponding to each sub-tag in the configuration file can be divided into a subset, and each plugin under the subset corresponds to a main value, namely the id of the plugin and the description information of the plugin.
In summary, the beneficial effects of the application are as follows:
the connection among the plug-ins is disconnected in real time and orderly according to the application times of the plug-ins, and the instance objects of the plug-ins connected in each way are destroyed, so that repeated occupation of a memory can be effectively avoided, the possibility of blocking of an upper computer is reduced, the stability and the high efficiency of a code running process are ensured, and code modification is reduced.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present application.
Fig. 4 is a schematic structural diagram of an example destroying device of an upper computer plug-in unit according to an embodiment of the present application. As shown in fig. 4, in some embodiments, the example destruction device 4 of the upper computer plug-in includes:
an obtaining module 410, configured to obtain, in response to a closing operation of the user terminal, an application number of the target plugin recorded in the configuration file; wherein the target plugin is determined by the shutdown operation and the first mapping table; the configuration file records the association relation among the plug-ins and the application times of each plug-in.
The destroying module 420 is configured to destroy the instance object of the target plug-in and the connection pointer information of the target plug-in the target mapping table according to the number of applications of the target plug-in.
Optionally, the example destroying device 4 of the upper computer plug-in further includes: the accumulation module is used for adding one to the application times of the plug-in of the configuration file when the window corresponding to the plug-in is displayed on the display interface of the upper computer and the plug-in is an inlet plug-in for each plug-in the upper computer; connecting the signal of each portal plug-in to the destruction slot function of the manager; for each portal plug-in, the number of applications of the plug-in to which the portal plug-in is currently connected is increased by one.
Optionally, the example destroying device 4 of the upper computer plug-in further includes: the accumulation and subtraction module traverses each target plugin, when the target plugin is an inlet plugin, the connection between the target plugin and the manager is disconnected, and the application frequency of the target plugin is subtracted by one; traversing each plug-in connected with the target plug-in, disconnecting the target plug-in from each plug-in connected with the target plug-in, and subtracting one from the application times of each plug-in connected with the target plug-in.
Optionally, the destruction module 420 is specifically configured to: traversing each target plug-in, and judging whether the application times of the target plug-in are smaller than preset times or not; when the application times of the target plugin are smaller than the preset times, destroying the instance object of the target plugin and the connection pointer information of the target plugin in the target mapping table; and when the application times of the target plug-ins are greater than or equal to the preset times, jumping to traverse each target plug-in, and judging whether the application times of the target plug-ins are less than the preset times.
Optionally, the destruction module 420 is specifically configured to determine a destruction sequence of the target plugin according to the number of applications of the target plugin; and destroying the instance objects of the target plug-in sequence according to the destroying sequence.
Optionally, the destruction module 420 is specifically configured to sort the application times of the target plugins from small to large, so as to obtain a destruction sequence; and destroying the instance objects of the target plug-in sequence according to a preset time interval according to the destroying sequence.
Optionally, the target mapping table includes a second mapping table and a third mapping table; the second mapping table comprises each display interface id and a dynamic library entry function pointer corresponding to each display interface id; the third mapping table comprises various display interface ids and instance object pointers corresponding to the display interface ids; correspondingly, the destruction module 420 is specifically configured to determine a display interface id of the plug-in to be deleted according to the application times of the target plug-in; deleting an instance object pointer corresponding to the display interface id of the plug-in to be deleted in the third mapping table and a dynamic library entry function pointer corresponding to the display interface id of the plug-in to be deleted in the second mapping table; and calling an interface function of a dynamic library corresponding to the display interface id of the plug-in to be deleted to destroy the instance object of the plug-in to be deleted.
The example destroying device of the upper computer plug-in provided in the embodiment can be used for executing the method embodiment, and the implementation principle and the technical effect are similar, and the embodiment is not repeated here.
Fig. 5 is a schematic structural diagram of an upper computer according to an embodiment of the present application. As shown in fig. 5, an embodiment of the present application provides a host computer 5, where the host computer 5 includes: a processor 50, a memory 51 and a computer program 52 stored in the memory 51 and executable on the processor 50. The steps of the above-described exemplary embodiment of the method for destroying a host computer plug-in are implemented by the processor 50 when executing the computer program 52, such as steps 210 to 220 shown in fig. 2. Alternatively, the processor 50, when executing the computer program 52, performs the functions of the modules/units of the system embodiments described above, such as the functions of the modules 410-420 shown in fig. 4.
By way of example, the computer program 52 may be partitioned into one or more modules/units, which are stored in the memory 51 and executed by the processor 50 to complete the present application. One or more of the modules/units may be a series of computer program instruction segments capable of performing a specific function, which instruction segments describe the execution of the computer program 52 in the upper computer 5.
The host computer 5 may be a mobile phone, an MCU, an ECU, an industrial personal computer, etc., and the server may be a physical server, a cloud server, etc., and is not limited herein. The upper computer 5 may include, but is not limited to, a processor 50, a memory 51. It will be appreciated by those skilled in the art that fig. 5 is merely an example of the upper computer 5, and is not limited to the upper computer 5, and may include more or less components than those illustrated, or may combine some components, or different components, e.g., the upper computer may further include an input/output device, a network access device, a bus, etc.
The processor 50 may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may be an internal storage unit of the upper computer 5, for example, a hard disk or a memory of the upper computer 5. The memory 51 may be an external storage device of the host computer 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided in the host computer 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the upper computer 5. The memory 51 is used for storing a computer program and other programs and data required by the host computer. The memory 51 may also be used to temporarily store data that has been output or is to be output.
The embodiment of the application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the steps in the embodiment of the method for destroying the instance of the upper computer plug-in when being executed by a processor.
The computer readable storage medium stores a computer program 52, the computer program 52 includes program instructions, which when executed by the processor 50 implement all or part of the procedures of the method embodiments described above, or may be implemented by means of hardware associated with the instructions of the computer program 52, the computer program 52 may be stored in a computer readable storage medium, and the computer program 52, when executed by the processor 50, implements the steps of the method embodiments described above. The computer program 52 comprises computer program code, which may be in the form of source code, object code, executable files, or in some intermediate form, among others. The computer readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth.
The computer readable storage medium may be an internal storage unit of the upper computer of any of the foregoing embodiments, for example, a hard disk or a memory of the upper computer. The computer readable storage medium may also be an external storage device of the upper computer, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the upper computer. Further, the computer-readable storage medium may include both an internal storage unit of the upper computer and an external storage device. The computer readable storage medium is used for storing computer programs and other programs and data required by the upper computer. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present application.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/host computer and method may be implemented in other manners. For example, the apparatus/upper computer embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, and the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, executable files or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. The instance destroying method of the upper computer plug-in is characterized in that a plurality of plug-ins which are mutually independent are arranged in the upper computer, and each plug-in is used for realizing one type of function of the upper computer; a manager is arranged in the upper computer; the manager is used for managing the first mapping table and the target mapping table; the first mapping table comprises a plurality of sub-labels on the upper computer display interface and a display interface id of at least one plug-in corresponding to each sub-label; the target mapping table comprises display interface ids of a plurality of plug-ins and connection pointer information corresponding to the display interface ids of each plug-in;
the method comprises the following steps:
receiving closing information sent by a display interface of an upper computer;
determining a corresponding target plug-in according to the closing information, and acquiring the application times of the target plug-in;
when the application times of the target plugin are smaller than a first preset value, destroying the instance object of the target plugin and deleting the connection pointer information of the target plugin.
2. The method for destroying an instance of a host computer plug-in according to claim 1, wherein before receiving the shutdown information sent by the host computer display interface, the method further comprises:
for each plug-in the upper computer, if a window corresponding to the current plug-in is displayed on a display interface of the upper computer and the current plug-in is an inlet plug-in, detecting whether the application times corresponding to the current plug-in a current configuration file are second preset values or not; the configuration file records the association relation among the plug-ins and the application times of each plug-in;
if the application times corresponding to the current plug-in the current configuration file are the second preset value, adding one to the application times of the current plug-in the configuration file;
connecting the signal of the current plug-in to the destruction slot function of the manager;
and adding one to the application times of the associated plug-in connected with the current plug-in.
3. The method for destroying an instance of a host computer plug-in according to claim 2, further comprising, after said detecting whether the number of applications corresponding to the current plug-in the current configuration file is a second preset value:
if the application times corresponding to the current plug-in the current configuration file are not the second preset value, keeping the application times of the current plug-in and the application times of the associated plug-in unchanged.
4. The method for destroying an instance of a host computer plug-in according to claim 2, wherein before destroying an instance object of the target plug-in and deleting connection pointer information of the target plug-in when the number of applications of the target plug-in is smaller than a first preset value, the method further comprises:
for each target plug-in, if the current target plug-in is an entry plug-in, disconnecting the current target plug-in from the manager, and subtracting one from the application frequency of the current target plug-in;
and for each target plug-in, disconnecting the current target plug-in from the associated plug-in of the current target plug-in, and subtracting one from the application times of the associated plug-in of the current target plug-in.
5. The method for destroying instances of a host computer plug-in as recited in claim 1, further comprising:
when the application times of the current target plug-in are not smaller than a first preset value, selecting the next target plug-in as the current target plug-in; and jumping to the step of judging whether the application times of the current target plug-in are smaller than a first preset value, and executing until all the target plug-ins corresponding to the closing information are traversed.
6. The method for destroying instances of a host computer plug-in as recited in claim 1, further comprising:
acquiring the application times of the target plug-in a history period;
and determining the initial value of the application times of each target plug-in the configuration file record according to the application times of each target plug-in the history period.
7. The method for destroying an instance of a host computer plug-in according to claim 1, wherein the target mapping table includes a second mapping table and a third mapping table; the second mapping table comprises each display interface id and a dynamic library entry function pointer corresponding to each display interface id; the third mapping table comprises various display interface ids and instance object pointers corresponding to the display interface ids;
when the application times of the target plugin are smaller than a first preset value, destroying the instance object of the target plugin and deleting the connection pointer information of the target plugin, including:
when the application times of the target plug-in are smaller than a first preset value, determining the display interface id of the target plug-in;
deleting an instance object pointer corresponding to the display interface id of the plug-in to be deleted in the third mapping table and a dynamic library entry function pointer corresponding to the display interface id of the plug-in to be deleted in the second mapping table;
and calling an interface function of a dynamic library corresponding to the display interface id of the plug-in to be deleted to destroy the instance object of the plug-in to be deleted.
8. An instance destroying device of an upper computer plug-in is characterized in that a plurality of plug-ins which are mutually independent are arranged in the upper computer, and each plug-in is used for realizing one type of function of the upper computer; a manager is arranged in the upper computer; the manager is used for managing the first mapping table and the target mapping table; the first mapping table comprises a plurality of sub-labels on the upper computer display interface and a display interface id of at least one plug-in corresponding to each sub-label; the target mapping table comprises display interface ids of a plurality of plug-ins and connection pointer information corresponding to the display interface ids of each plug-in;
the device comprises:
the receiving module is used for receiving closing information sent by the upper computer display interface;
the acquisition module is used for determining a corresponding target plug-in according to the closing information and acquiring the application times of the target plug-in;
the destroying module is used for destroying the instance object of the target plug-in and deleting the connection pointer information of the target plug-in when the application times of the target plug-in are smaller than a first preset value.
9. A host computer comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the steps of the method for destroying instances of a host computer plug-in according to any of the preceding claims 1 to 7.
10. A computer-readable storage medium, characterized in that it stores a computer program which, when executed by a processor, implements the steps of the method for destroying instances of a higher computer plug-in according to any of the preceding claims 1 to 7.
CN202310947962.7A 2023-07-31 2023-07-31 Method and device for destroying instances of upper computer plug-in Pending CN116991496A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310947962.7A CN116991496A (en) 2023-07-31 2023-07-31 Method and device for destroying instances of upper computer plug-in

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310947962.7A CN116991496A (en) 2023-07-31 2023-07-31 Method and device for destroying instances of upper computer plug-in

Publications (1)

Publication Number Publication Date
CN116991496A true CN116991496A (en) 2023-11-03

Family

ID=88531545

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310947962.7A Pending CN116991496A (en) 2023-07-31 2023-07-31 Method and device for destroying instances of upper computer plug-in

Country Status (1)

Country Link
CN (1) CN116991496A (en)

Similar Documents

Publication Publication Date Title
US10628066B2 (en) Ensuring in-storage data atomicity and consistency at low cost
CN107688626B (en) Slow query log processing method and device and electronic equipment
CN110515795A (en) A kind of monitoring method of big data component, device, electronic equipment
CN111343267B (en) Configuration management method and system
US20210357251A1 (en) Electronic device and non-transitory storage medium implementing test path coordination method
CN111143092B (en) Fault recording data processing method, system and terminal equipment
CN112732556A (en) Automatic testing method, device, equipment and storage medium for distributed system
CN110390463B (en) Wind control data processing method and device and terminal equipment
CN116991496A (en) Method and device for destroying instances of upper computer plug-in
CN112214394A (en) Memory leak detection method, device and equipment
CN111209608A (en) Big data storage system
CN109348288A (en) A kind of processing method of video, device, storage medium and terminal
CN115643044A (en) Data processing method, device, server and storage medium
CN113030648B (en) Power cable fault point position determining method and device and terminal equipment
CN111199003B (en) Multi-webpage window management method, management device and terminal equipment
CN114185318A (en) Production line information processing method and system based on artificial intelligence
CN112527276A (en) Data updating method and device in visual programming tool and terminal equipment
CN113238911A (en) Alarm processing method and device
CN114648656A (en) Image recognition method and device, terminal equipment and readable storage medium
CN116954756A (en) Mapping table management-based upper computer plug-in dynamic connection method and device
CN112712610A (en) Vehicle diagnosis log processing method and device, terminal device and readable storage medium
CN116070268B (en) Privacy data identification monitoring method, device and equipment
CN109885491B (en) Method for detecting existence of data overflow expression and terminal equipment
CN109597813B (en) Vehicle data processing method and device
CN113127572B (en) Archive merging method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination