A plug-in loading control method, system, terminal device and storage medium

By monitoring and replacing the resource information of conflicting plug-ins, plug-in loading failure and compatibility problems caused by duplicate so files and dex files in terminal devices are solved, and the normal installation of plug-ins and stable operation of application is achieved.

CN113434210BActive Publication Date: 2024-12-31SHENZHEN COOCAA NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110700721.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-23
Publication Date
2024-12-31
Estimated Expiration
2041-06-23

Smart Images

  • Figure CN113434210B_ABST
    Figure CN113434210B_ABST
Patent Text Reader

Abstract

The present invention provides a plug-in loading control method, system, terminal device and storage medium, which monitors whether a plug-in installation conflict event occurs in a terminal system; if so, obtains resource information of a conflicting first plug-in and a second plug-in; wherein the first plug-in information is a plug-in to be loaded and inserted into the system, and the second plug-in is a plug-in that has been loaded and inserted into the system; controls the removal of the resource information of the second plug-in, and loads the first plug-in until loading is completed. In this embodiment, when loading a plug-in, if a conflict occurs between the currently loaded plug-in and the previously loaded plug-in, the previously loaded plug-in is controlled to be removed, and then the plug-in that needs to be loaded is loaded, thereby avoiding the problem of failure of the current plug-in installation, and also solving the problem of multiple plug-in conflicts causing application crashes or resource confusion, causing the device to be unable to be used normally.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of terminal application control, and in particular to a plug-in loading control method, system, terminal equipment and storage medium. Background Art

[0002] Android's plug-in technology has been widely used because of its advantages such as flexibility, light weight, and dynamism. This plug-in technology is suitable for plug-ins with a small number of self-owned modules in applications. Once a large number of third-party SDKs (Software Development Kits) are integrated into the software, various duplicate so files (so files are program function libraries under Linux, that is, compiled codes and data that can be used by other programs) and dex files (dex files are executable files of the Android system, containing all the operating instructions and runtime data of the application) will cause information resource conflicts, making it impossible to load the plug-in normally, and the compatibility issues between new and old plug-ins are getting bigger and bigger, which will eventually lead to the inability of various applications to be used normally.

[0003] Therefore, the prior art needs to be further improved. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, the object of the present invention is to provide a plug-in loading control method, a terminal device and a storage medium to overcome the defect that the plug-in cannot be loaded normally due to duplicate so files and dex files in the system.

[0005] The solution disclosed in the embodiment of the present invention is as follows:

[0006] In a first aspect, this embodiment discloses a plug-in loading control method, wherein the method includes:

[0007] Monitor whether plug-in installation conflicts occur in the terminal system;

[0008] If yes, then obtain the resource information of the conflicting first plug-in and the second plug-in; wherein the first plug-in information is the plug-in to be loaded and inserted into the system, and the second plug-in is the plug-in already loaded and inserted into the system; the resource information includes: ID information, Dex file information and so file information;

[0009] Control to replace the resource information of the second plug-in with the resource information corresponding to the first plug-in, and load the first plug-in until loading is completed.

[0010] Optionally, the step of controlling the removal of the file of the second plug-in includes:

[0011] The dex file array corresponding to the second plug-in is replaced with the dex file array corresponding to the first plug-in based on reflection injection.

[0012] Optionally, the step of replacing the dex file array in the second plug-in with the dexElements array corresponding to the first plug-in in an unregistration manner includes:

[0013] Record the location information of the host apk and each application's Dex files in the entire array;

[0014] Determine a Dex file array corresponding to the first plug-in according to the location information;

[0015] The Dex file array corresponding to the first plug-in is replaced with the dex file array corresponding to the second plug-in.

[0016] Optionally, the step of determining a dex file array corresponding to the first plug-in according to the location information includes:

[0017] Regenerate the dex file array corresponding to the second plug-in and remove the Dex file therein;

[0018] The dex file of the first plug-in is reflectively injected into the newly generated dex file array to generate a dex file array corresponding to the first plug-in.

[0019] Optionally, the step of controlling the removal of the file of the second plug-in includes:

[0020] Modify the ID information of the first plug-in apk; wherein the ID information of the second plug-in apk is different from the ID information of the second plug-in apk.

[0021] Optionally, the first plug-in and the second plug-in contain the same class.

[0022] Optionally, the method further includes:

[0023] Determine whether the conflict type that occurs when loading the plug-in is a so file conflict;

[0024] If yes, ignore the so file conflict.

[0025] In a second aspect, this embodiment discloses a plug-in loading control system, which includes:

[0026] An event monitoring module is used to monitor whether a plug-in installation conflict event occurs in the terminal system;

[0027] An information acquisition module is used to acquire resource information of the conflicting first plug-in and second plug-in when a conflict event occurs; wherein the first plug-in information is a plug-in to be loaded and inserted into the system, and the second plug-in is a plug-in that has been loaded and inserted into the system; the resource information includes: ID information, Dex file information and so file information;

[0028] The reflection injection module is used to control the replacement of the resource information of the second plug-in with the resource information corresponding to the first plug-in, and load the first plug-in until the loading is completed.

[0029] In a third aspect, this embodiment discloses a terminal device, wherein the terminal device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, it executes the steps of implementing the plug-in loading control method.

[0030] In a fourth aspect, this embodiment discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the plug-in loading control method are implemented.

[0031] Beneficial effect: The present invention provides a plug-in loading control method, system, terminal device and storage medium, which monitors whether a plug-in installation conflict event occurs in the terminal system; if so, obtains the resource information of the conflicting first plug-in and second plug-in; wherein, the first plug-in information is a plug-in to be loaded and inserted into the system, and the second plug-in is a plug-in that has been loaded and inserted into the system; controls the removal of the resource information of the second plug-in, and loads the first plug-in until the loading is completed. In this embodiment, when loading a plug-in, if there is a conflict between the currently loaded plug-in and the previously loaded plug-in, the previously loaded plug-in is controlled to be removed, and then the plug-in that needs to be loaded is loaded, thereby avoiding the problem of failure of the current plug-in installation, and also solving the problem of multiple plug-in conflicts causing application crashes or resource confusion, causing the device to be unable to be used normally. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a schematic diagram of the principle of plug-in loading conflict in the prior art;

[0033] Figure 2 It is a flow chart of the steps of the plug-in loading control method provided by the present invention;

[0034] Figure 3 It is a principle block diagram of the plug-in loading control system of the present invention;

[0035] Figure 4 It is a principle structural diagram of a terminal device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0037] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0038] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.

[0039] Plug-in technology is commonly used in terminal devices due to its advantages such as dynamism and flexibility. However, when a large number of third-party SDKs are integrated into the terminal device, duplicate so files and Dex files may exist in each plug-in, which may cause the plug-in to fail to load due to resource conflicts or cause the application to crash. Figure 1 As shown, when plugin 1 and plugin 2 have the same class A, plugin 2 cannot be loaded into the host apk. When there is too much duplicate resource information between plugins in the system, it is necessary to solve the compatibility problem between plugins.

[0040] In order to solve the compatibility problem between various plug-ins, this embodiment proposes a plug-in loading control method based on anti-plug-inization. Before loading the plug-in, the plug-in that conflicts with the plug-in to be loaded is deleted, and then the loading operation of the current plug-in to be loaded is executed, thereby achieving smooth installation of the plug-in.

[0041] The method disclosed in the present invention is explained in more detail below in conjunction with the accompanying drawings.

[0042] Exemplary Methods

[0043] This embodiment discloses a plug-in loading control method, such as Figure 2 As shown, the method includes:

[0044] Step S1: monitoring whether a plug-in installation conflict event occurs in the terminal system.

[0045] If the terminal system has a plug-in to be installed, it is determined whether the plug-in to be installed contains duplicate so files and Dex files with the plug-ins installed in the system. If so, a plug-in resource conflict event will occur when loading the plug-in to be installed, and the next step is executed. If not, the plug-in to be installed is loaded normally.

[0046] Specifically, in this step, the method for determining whether a resource conflict occurs between the plug-in to be installed or loaded and the plug-in previously installed in the system includes:

[0047] Compare the resource information between the two plug-ins to determine whether there are duplicate so files and Dex files, or directly determine whether the resource addresses corresponding to the two plug-ins are the same, and determine whether the two plug-ins are different versions of the same plug-in. If they are new and old versions, it is determined that when the new version of the plug-in is loaded, the old version saved in the system will have a resource conflict with the new version.

[0048] Step S2: If a plug-in installation conflict event occurs in the system, the resource information of the conflicting first plug-in and the second plug-in is obtained; wherein the first plug-in information is a plug-in to be loaded and inserted into the system, and the second plug-in is a plug-in that has been loaded and inserted into the system; the resource information includes: ID information, Dex file information and so file information.

[0049] If a resource conflict occurs between the plug-in to be installed and the plug-in that has been installed before, the two plug-ins that have conflict are obtained. In a specific embodiment, the two plug-ins are named as the first plug-in and the second plug-in, respectively, where the first plug-in is the plug-in that needs to be installed in the application, and the second plug-in is the plug-in that has been installed in the system. The resource information of the two plug-ins is obtained, and it is determined which information causes the conflict based on the resource information of the two plug-ins.

[0050] Step S3: Control to replace the resource information of the second plug-in with the resource information corresponding to the first plug-in, and load the first plug-in until loading is completed.

[0051] When the two plug-ins corresponding to the conflict are determined, the resource information of the second plug-in loaded in the original system is controlled to be replaced with the resource information corresponding to the first plug-in currently to be loaded, thereby overcoming the resource information conflict between the first plug-in and the second plug-in.

[0052] The key parts of plug-inization include: 1. injection of dex; 2. loading of so files; 3. merging of resources. Completing these three parts basically completes the injection of a plug-in. After injecting multiple plug-ins, it is easy to cause conflicts between dex and resources, which may cause the entire application to crash or resource confusion. Therefore, the key part of the present invention is to solve the conflict problem of the above three parts.

[0053] Specifically, the resource information corresponding to the second plug-in is removed, and then the second plug-in is installed, thereby avoiding resource conflicts between the first plug-in and the second plug-in.

[0054] Specifically, the step of controlling to replace the resource information of the second plug-in with the resource information corresponding to the first plug-in includes:

[0055] The dex file array corresponding to the second plug-in is replaced with the dex file array corresponding to the first plug-in based on reflection injection.

[0056] That is, the location of the Dex file array corresponding to the second plug-in is found, and according to the found location, the Dex file array corresponding to the second plug-in is replaced with the Dex file array corresponding to the first plug-in, thereby removing the resource information corresponding to the second plug-in.

[0057] In a specific embodiment, the step of replacing the dex file array in the second plug-in with the dexElements array corresponding to the first plug-in based on the deregistration method includes:

[0058] Record the location information of the host apk and each application's Dex files in the entire array;

[0059] Determine a Dex file array corresponding to the first plug-in according to the location information;

[0060] The step of determining the dex file array corresponding to the first plug-in according to the location information includes:

[0061] Regenerate the dex file array corresponding to the second plug-in and remove the Dex file therein;

[0062] The dex file of the first plug-in is reflectively injected into the newly generated dex file array to generate a dex file array corresponding to the first plug-in.

[0063] The Dex file array corresponding to the first plug-in is replaced with the dex file array corresponding to the second plug-in.

[0064] Furthermore, the step of controlling to replace the resource information of the second plug-in with the resource information corresponding to the first plug-in includes:

[0065] Modify the ID information of the first plug-in apk; wherein the ID information of the second plug-in apk is different from the ID information of the second plug-in apk.

[0066] The apk corresponding to the plug-in includes code and resources. During the apk compilation process, the dex tool packages the code into a .dex file. The resource file will generate the corresponding ID by the aapt tool. When aapt is packaged, it is organized into a resources.arsc file. The resources.arsc file is used to describe the resource ID and resource location configuration information. It describes the configuration information of a resource ID from 18 dimensions (language, resolution, etc.), which is the resource ID and resource index table. The resource ID generation is regular, the rule is: 0xPPTTNNNN, composed of 8-bit hexadecimal, where:

[0067] PP segment: indicates the package space of the resource: 0x01 indicates the system resource space, 0x7f indicates the application resource space. TT segment: indicates the resource type. NNNN segment: 4 hexadecimal digits indicate the resource id, and the same type of resource in an apk starts from 0000 and increases.

[0068] In order to avoid conflicts between two plug-ins due to the same resource ID, in this step, the resource ID corresponding to the first plug-in is modified to be different from the resource ID corresponding to the original second plug-in, thereby avoiding such information conflicts.

[0069] When making specific modifications, the resource IDs of the plug-ins to be installed that may or may cause conflicts may be modified in sequence according to the above resource ID generation rules.

[0070] Furthermore, the first plug-in and the second plug-in have the same class, and thus there is a resource conflict due to the same class.

[0071] The method further comprises:

[0072] Determine whether the conflict type that occurs when loading the plug-in is a so file conflict;

[0073] If yes, ignore the so file conflict.

[0074] During the installation of the plug-in, since the so file itself is unlikely to be repeated, there will be no problem even if it is loaded repeatedly. Therefore, if it is found that the repeated resource in the resource conflict is a so file, just protect it and do not process it.

[0075] The method steps given in this embodiment are processed through the above three aspects, thereby avoiding resource conflicts between the plug-in to be installed and the previously installed plug-in, and realizing normal installation of the plug-in, thereby solving the problem of plug-in between software and providing a basis for the normal use of applications on the terminal.

[0076] The above method is further described in more detail below by taking the specific application of this embodiment as an example.

[0077] Since conflicts between plug-ins include: ID conflict, Dex file conflict and so file conflict, the above three types of information are processed during specific implementation.

[0078] 1. Conflict of resource ID.

[0079] Since the resource addresses of normally compiled APKs all start with 0x7f, it is inevitable that duplicate resource IDs will appear after multiple plug-ins are input into the host. Duplicate resource IDs will cause resource confusion. To solve the resource confusion problem, you can isolate the resource address. Force the resource address of the plug-in to avoid 0x7f.

[0080] 2. Conflict of Dex files.

[0081] Dex injection is usually achieved by modifying the dexElements of Element[] type in the host's DexPathList. In simple terms, it is to add the plugin's dex path to the host's dex path through reflection. From this, we can get a method to reverse dex injection.

[0082] a) When injecting dex, record the position of the host and each application's dex in the entire dexElements array

[0083] b) When unregistering, regenerate a new dexElements array, remove the dex part of the plugin that needs to be unregistered, and re-record the position of all plugin dex in the dexElements array

[0084] c) Replace the application's dexElements array with the new dexElements array through reflection.

[0085] At this point, the dex part of the anti-registration has been removed for the application.

[0086] 3. Conflict of so. In the process of plug-in implementation, so itself is unlikely to be repeated, and there will be no problem even if it is loaded repeatedly, just protect it.

[0087] After processing in the above manner, the plug-in deregistration is completed. Therefore, when a plug-in conflict is detected, the conflict problem can be solved by deregistering the previous plug-in through the above method and then loading the new plug-in.

[0088] This embodiment proposes a plug-in loading control method that is anti-plug-in. By removing the plug-in that conflicts with the plug-in to be installed, the resources of the plug-in to be installed are injected back into the system, thereby solving the problem of plug-in resource conflict and providing convenience for users to use various third-party applications normally.

[0089] Exemplary Devices

[0090] Based on the above plug-in loading control method, this embodiment also discloses a plug-in loading control system, such as Figure 3 As shown, including:

[0091] The event monitoring module 310 is used to monitor whether a plug-in installation conflict event occurs in the terminal system; its function is as described in step S1.

[0092] The information acquisition module 320 is used to obtain the resource information of the conflicting first plug-in and the second plug-in when a conflict event occurs; wherein the first plug-in information is the plug-in to be loaded and inserted into the system, and the second plug-in is the plug-in that has been loaded and inserted into the system; the resource information includes: ID information, Dex file information and so file information; its function is as described in step S2.

[0093] The reflection injection module 330 is used to control the replacement of the resource information of the second plug-in with the resource information corresponding to the first plug-in, and load the first plug-in until the loading is completed. Its function is as described in step S3.

[0094] Based on the above method, this embodiment further discloses a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the plug-in loading control method are executed. In one implementation, the terminal device can be a mobile phone, a tablet computer, or a smart TV.

[0095] Specifically, Figure 4As shown, the terminal device includes at least one processor (processor) 20 and a memory (memory) 22, and may also include a display screen 21, a communication interface (Communications Interface) 23 and a bus 24. Among them, the processor 20, the display screen 21, the memory 22 and the communication interface 23 can communicate with each other through the bus 24. The display screen 21 is configured to display a preset user guide interface in the initial setting mode. The communication interface 23 can transmit information. The processor 20 can call the logic instructions in the memory 22 to execute the steps of the method described in the above embodiment.

[0096] In addition, the logic instructions in the memory 22 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.

[0097] The memory 22, as a computer-readable storage medium, can be configured to store software programs, computer executable programs, such as program instructions or modules corresponding to the method in the embodiment of the present disclosure. The processor 30 executes the functional application and data processing by running the software program, instructions or modules stored in the memory 22, that is, implementing the steps of the method in the above embodiment.

[0098] The memory 22 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 22 may include a high-speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, may also be a transient storage medium.

[0099] On the other hand, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method are implemented.

[0100] The present invention provides a plug-in loading control method, system, terminal device and storage medium, which monitors whether a plug-in installation conflict event occurs in a terminal system; if so, obtains resource information of a conflicting first plug-in and a second plug-in; wherein the first plug-in information is a plug-in to be loaded and inserted into the system, and the second plug-in is a plug-in that has been loaded and inserted into the system; controls the removal of the resource information of the second plug-in, and loads the first plug-in until loading is completed. In this embodiment, when loading a plug-in, if a conflict occurs between the currently loaded plug-in and the previously loaded plug-in, the previously loaded plug-in is controlled to be removed, and then the plug-in that needs to be loaded is loaded, thereby avoiding the problem of failure of the current plug-in installation, and also solving the problem of multiple plug-in conflicts causing application crashes or resource confusion, causing the device to be unable to be used normally.

[0101] It is understandable that those skilled in the art can make equivalent substitutions or changes based on the technical solution and inventive concept of the present invention, and all these changes or substitutions should fall within the protection scope of the claims attached to the present invention.

Claims

1. A plug-in loading control method, characterized in that: The method comprises: Monitor whether plug-in installation conflicts occur in the terminal system; If yes, then obtain the resource information of the conflicting first plug-in and the second plug-in; wherein the first plug-in information is the plug-in to be loaded and inserted into the system, and the second plug-in is the plug-in already loaded and inserted into the system; the resource information includes: ID information, Dex file information and so file information; Controlling to replace the resource information of the second plug-in with the resource information corresponding to the first plug-in, and loading the first plug-in until loading is completed; The step of controlling to replace the resource information of the second plug-in with the resource information corresponding to the first plug-in includes: Record the location information of the host apk and each application's Dex files in the entire array; Determine a Dex file array corresponding to the first plug-in according to the location information; Replace the dex file array corresponding to the second plug-in with the dex file array corresponding to the first plug-in; and modifying the resource IDs corresponding to the first plug-in that generates the conflict in sequence according to the resource ID generation rule, so as to be different from the resource ID corresponding to the original second plug-in; During the modification process, the resource IDs of the conflicting plug-ins to be installed are modified in turn according to the resource ID generation rules; The step of determining the dex file array corresponding to the first plug-in according to the location information includes: Regenerate a dex file array corresponding to the second plug-in, and remove the Dex file in the second plug-in; Reflectively injecting the dex file corresponding to the first plug-in into the regenerated dex file array to generate a dex file array corresponding to the first plug-in; The step of reflectively injecting a dex file corresponding to the first plug-in includes: When injecting dex, record the position of the host and each application's dex in the entire dexElements array; When unregistering, a new dexElements array is regenerated, the dex part of the first plug-in that needs to be unregistered is removed, and the position of all plug-in dex in the dexElements array is re-recorded; Replace the application's dexElements array with the new dexElements array through reflection; The first plug-in and the second plug-in have the same class; The method further comprises: Determine whether the conflict type that occurs when loading the plug-in is a so file conflict; If so, ignore the so file conflict; Methods for determining whether a resource conflict occurs between a plug-in to be installed or loaded and a plug-in previously installed in the system include: Compare the resource information between the two plug-ins to determine whether there are duplicate so files and Dex files, or directly determine whether the resource addresses corresponding to the two plug-ins are the same, and determine whether the two plug-ins are different versions of the same plug-in. If they are new and old versions, it is determined that when the new version of the plug-in is loaded, the old version saved in the system will have a resource conflict with the new version.

2. A plug-in loading control system, characterized in that: include: An event monitoring module is used to monitor whether a plug-in installation conflict event occurs in the terminal system; An information acquisition module, used for acquiring resource information of the conflicting first plug-in and second plug-in when a conflict event occurs; wherein the first plug-in information is a plug-in to be loaded and inserted into the system, and the second plug-in is a plug-in already loaded and inserted into the system; the resource information includes: ID information, Dex file information and so file information; A reflection injection module, used to control the replacement of the resource information of the second plug-in with the resource information corresponding to the first plug-in, and load the first plug-in until loading is completed; The reflection injection module is used to record the location information of the host apk and the Dex files of each application in the entire array; determine the Dex file array corresponding to the first plug-in according to the location information; replace the Dex file array corresponding to the second plug-in with the Dex file array corresponding to the first plug-in; and modify the resource ID corresponding to the first plug-in that generates the conflict in turn according to the resource ID generation rule, and modify it to be different from the resource ID corresponding to the original second plug-in; in the modification process, modify the resource ID of each plug-in that generates the conflict to be installed in turn according to the resource ID generation rule; The information acquisition module is further used to regenerate a dex file array corresponding to the second plug-in and remove the Dex file in the second plug-in; reflectively inject the dex file corresponding to the first plug-in into the regenerated dex file array to generate a dex file array corresponding to the first plug-in; The step of reflectively injecting a dex file corresponding to the first plug-in includes: When injecting dex, record the position of the host and each application's dex in the entire dexElements array; When unregistering, a new dexElements array is regenerated, the dex part of the first plug-in that needs to be unregistered is removed, and the position of all plug-in dex in the dexElements array is re-recorded; Replace the application's dexElements array with the new dexElements array through reflection; The first plug-in and the second plug-in have the same class; The system is also used to determine whether the conflict type that occurs when the plug-in is loaded is a so file conflict; If so, ignore the so file conflict; The method for determining whether a resource conflict occurs between a plug-in to be installed or loaded and a plug-in previously installed in the system in the event monitoring module includes: Compare the resource information between the two plug-ins to determine whether there are duplicate so files and Dex files, or directly determine whether the resource addresses corresponding to the two plug-ins are the same, and determine whether the two plug-ins are different versions of the same plug-in. If they are new and old versions, it is determined that when the new version of the plug-in is loaded, the old version saved in the system will have a resource conflict with the new version.

3. A terminal device, characterized in that: The terminal device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the plug-in loading control method described in claim 1 are performed.

4. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the plug-in loading control method according to claim 1 are implemented.