A plug-in loading method and device, computer equipment and storage medium

CN115202755BActive Publication Date: 2026-06-26DOUYIN VISION CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DOUYIN VISION CO LTD
Filing Date
2022-07-14
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing plugin preloading methods sometimes result in preloaded plugins that are not needed by the user, while unpreloaded plugins are needed by the user, leading to poor preloading performance.

Method used

By obtaining the plugin preloading sequence, the plugin preloading sequence is dynamically adjusted according to the plugin usage order when the target program was used last time. Plugins that users are accustomed to using earlier are loaded first, thus achieving dynamic preloading of plugins.

Benefits of technology

The preloading effect of plugins has been improved, enhancing the user experience and ensuring that plugins are successfully loaded before users use them.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115202755B_ABST
    Figure CN115202755B_ABST
Patent Text Reader

Abstract

The present disclosure provides a plug-in loading method and device, computer equipment and a storage medium. The method comprises: in response to triggering preloading of a plug-in corresponding to a target program, obtaining a plug-in preloading sequence; the plug-in preloading sequence is used to indicate a preloading order of a plurality of plug-ins of the target program; wherein the plug-in preloading sequence is determined based on a usage order of the plug-ins when the target program is used last time; and based on the preloading order of the plurality of plug-ins of the target program indicated by the plug-in preloading sequence, the plurality of plug-ins in the plug-in preloading sequence are sequentially preloaded. In this way, the preloading of the plug-in is realized according to the user's usage habit of the application program, so that the plug-in used earlier by the user is preloaded preferentially, and the plug-in is loaded successfully before the user uses it, thereby improving the preloading effect of the plug-in and the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to a plug-in loading method, apparatus, computer device, and storage medium. Background Technology

[0002] With the rapid iteration of mobile client services, plugin mechanisms, which can reduce installation package size and support dynamic capability changes, are playing an increasingly important role in application usage. However, plugins need to be loaded before the target application can be used each time it is launched, and loading plugins is a relatively time-consuming process. Therefore, plugin preloading is widely used. Current plugin preloading methods suffer from the problem of preloading plugins that are not needed by the user, while not preloading them does, resulting in poor preloading performance. Summary of the Invention

[0003] This disclosure provides at least one plug-in loading method, apparatus, computer device, and storage medium.

[0004] In a first aspect, embodiments of this disclosure provide a plugin loading method, the method comprising:

[0005] In response to triggering the preloading of plugins corresponding to the target program, a plugin preloading sequence is obtained; the plugin preloading sequence is used to indicate the preloading order of multiple plugins of the target program; wherein, the plugin preloading sequence is determined based on the usage order of the plugins when the target program was used previously;

[0006] Based on the preloading order of multiple plugins of the target program indicated by the plugin preloading sequence, the multiple plugins in the plugin preloading sequence are preloaded sequentially.

[0007] In one optional implementation, the method further includes:

[0008] In response to the target program being launched for the first time, the original plugin preload sequence is obtained;

[0009] Based on the preloading order of multiple plugins of the target program indicated by the original plugin preloading sequence, multiple plugins in the original plugin preloading sequence are preloaded sequentially.

[0010] In one optional implementation, the triggering of the plugin preloading event corresponding to the target program includes at least one of the following:

[0011] The target program is started, the functions associated with the plugin are activated, and a plugin preload instruction is received.

[0012] In one optional implementation, the method further includes:

[0013] In response to the first use of any plugin in the plugin preloading sequence during the current use of the target program, the usage order of any plugin among the multiple plugins in the plugin preloading sequence is determined;

[0014] The plugin preloading sequence is updated based on the usage order.

[0015] In one optional implementation, the target plugin is first triggered during the current use of the target program, including at least one of the following:

[0016] During this use of the target program, the search for the class corresponding to any of the plugins is triggered for the first time;

[0017] This plugin is used for the first time during this use of the target program.

[0018] In one optional implementation, updating the plugin preloading sequence based on the usage order includes:

[0019] Based on the usage order, determine the target position of any plugin in the plugin preloading sequence;

[0020] In response to a discrepancy between the current position and the target position of any plugin indicated by the plugin preloading sequence, the plugin preloading sequence is updated based on the target position.

[0021] In one optional implementation, the method further includes:

[0022] In response to the triggering of a plugin in the target program that is not present in the plugin preload sequence, the plugin that is not present in the plugin preload sequence is added to the plugin preload sequence.

[0023] In one optional implementation, the step of adding the plugin not present in the plugin preloading sequence to the plugin preloading sequence in response to the triggering of a plugin in the target program that is not present in the plugin preloading sequence includes:

[0024] The response is that a plugin not present in the plugin preloading sequence is triggered in the target program, and the number of times the plugin not present in the plugin preloading sequence is triggered during multiple uses of the target program is recorded;

[0025] In response to the number of times reaching a preset first threshold, the plugin that is not present in the plugin preloading sequence is added to the plugin preloading sequence.

[0026] In one optional implementation, the method further includes:

[0027] Record the number of consecutive times that each plugin in the plugin preloading sequence is not triggered during multiple uses of the target program;

[0028] In response to any plugin in the plugin preloading sequence reaching a preset second threshold number of consecutive times, the plugin is removed from the plugin preloading sequence.

[0029] Secondly, embodiments of this disclosure also provide a plug-in loading device, comprising:

[0030] The acquisition module, in response to triggering the preloading of plugins corresponding to the target program, acquires a plugin preloading sequence; the plugin preloading sequence is used to indicate the preloading order of multiple plugins of the target program; wherein, the plugin preloading sequence is determined based on the usage order of the plugins when the target program was used previously;

[0031] The processing module is used to preload multiple plugins in the plugin preloading sequence sequentially based on the preloading order of multiple plugins of the target program indicated by the plugin preloading sequence.

[0032] In an optional implementation, the processing module is further configured to:

[0033] In response to the target program being launched for the first time, the original plugin preload sequence is obtained;

[0034] Based on the preloading order of multiple plugins of the target program indicated by the original plugin preloading sequence, multiple plugins in the original plugin preloading sequence are preloaded sequentially.

[0035] In one optional embodiment, the apparatus further includes an update module, the update module being used to:

[0036] In response to the first use of any plugin in the plugin preloading sequence during the current use of the target program, the usage order of any plugin among the multiple plugins in the plugin preloading sequence is determined;

[0037] The plugin preloading sequence is updated based on the usage order.

[0038] In one optional implementation, the update module is further configured to:

[0039] Based on the usage order, determine the target position of any plugin in the plugin preloading sequence;

[0040] In response to a discrepancy between the current position and the target position of any plugin indicated by the plugin preloading sequence, the plugin preloading sequence is updated based on the target position.

[0041] In one optional embodiment, the apparatus further includes an adding module, the adding module being used for:

[0042] In response to the triggering of a plugin in the target program that is not present in the plugin preload sequence, the plugin that is not present in the plugin preload sequence is added to the plugin preload sequence.

[0043] In one optional implementation, the adding module is specifically used for:

[0044] The response is that a plugin not present in the plugin preloading sequence is triggered in the target program, and the number of times the plugin not present in the plugin preloading sequence is triggered during multiple uses of the target program is recorded;

[0045] In response to the number of times reaching a preset first threshold, the plugin that is not present in the plugin preloading sequence is added to the plugin preloading sequence.

[0046] In an optional embodiment, the apparatus further includes a deletion module, which is further configured to:

[0047] Record the number of consecutive times that each plugin in the plugin preloading sequence is not triggered during multiple uses of the target program;

[0048] In response to any plugin in the plugin preloading sequence reaching a preset second threshold number of consecutive times, the plugin is removed from the plugin preloading sequence.

[0049] Thirdly, an optional implementation of this disclosure also provides a computer device, a processor, and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is configured to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the steps of the first aspect above, or any possible implementation of the first aspect, are performed.

[0050] Fourthly, an optional implementation of this disclosure also provides a computer-readable storage medium storing a computer program that, when run, performs the steps of the first aspect or any possible implementation of the first aspect.

[0051] The plugin loading method, apparatus, computer device, and storage medium provided in this disclosure determine the plugin preloading sequence for the current use of the target program based on the order in which plugins in the plugin preloading sequence were used during the previous use of the target program. Based on this preloading sequence, multiple plugins are preloaded sequentially during the current use of the target program. This allows for dynamic adjustment of the plugin preloading sequence based on the user's previous plugin usage order, enabling plugin preloading based on the user's application usage habits. This prioritizes preloading plugins that the user is more likely to use earlier, ensuring that a plugin is loaded successfully before the user uses it, thus improving plugin preloading effectiveness and user experience.

[0052] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0053] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.

[0054] Figure 1 A flowchart of a plug-in loading method provided in an embodiment of this disclosure is shown;

[0055] Figure 2 An example diagram of the current plugin loading sequence in the plugin loading method provided in this embodiment of the present disclosure is shown;

[0056] Figure 3 The flowchart illustrates a method for updating the plugin preloading sequence according to the usage order in the plugin loading method provided in this embodiment of the present disclosure.

[0057] Figure 4 A schematic diagram of a plug-in loading device provided in an embodiment of this disclosure is shown;

[0058] Figure 5 A schematic diagram of a computer device provided in an embodiment of this disclosure is shown. Detailed Implementation

[0059] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown herein can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0060] Research has found that preloading plugins after application launch, before the user uses them, is a common plugin loading method. This method allows the application client to automatically load plugins at appropriate times, rather than waiting for the user to try them. This ensures the plugin loading process is completed before the user uses it, eliminating waiting time when the user needs to use the plugin's functionality. Current plugin preloading often uses a static method. Given the limitations of device processing power that prevents the simultaneous preloading of all plugins, static preloading requires developers to set a plugin preloading sequence in advance. However, this setting is often too subjective, and different plugin functionalities tend to prioritize their plugins in the preloading sequence. Furthermore, current plugin preloading methods generally correspond to a fixed preloading sequence, which may not suit all users' plugin usage habits. For some users, unnecessary plugins may be loaded first, while the desired plugins may have to wait, resulting in poor preloading effectiveness.

[0061] Based on the above research, this disclosure provides a plugin loading method that dynamically adjusts the plugin preloading sequence each time a user uses the target program by adjusting the order in which the user uses the plugins. This enables plugin preloading based on the user's application usage habits, prioritizing the preloading of plugins that the user is accustomed to using earlier. This ensures that a plugin is loaded successfully before the user uses it, improving the plugin preloading effect and the user experience.

[0062] The shortcomings of the above solutions are the result of the inventor's practical experience and careful research. Therefore, the discovery process of the above problems and the solutions proposed in this disclosure below should be considered as the inventor's contribution to this disclosure.

[0063] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0064] To facilitate understanding of this embodiment, a plug-in loading method disclosed in this disclosure will first be described in detail. The execution subject of the plug-in loading method provided in this disclosure is generally a computer device with certain computing capabilities. This computer device may include, for example, a terminal device, a server, or other processing devices. The terminal device may be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, an in-vehicle device, a wearable device, etc. In some possible implementations, this plug-in loading method can be implemented by the processor calling computer-readable instructions stored in memory.

[0065] The plugin loading method provided in the embodiments of this disclosure will be described below.

[0066] See Figure 1 The diagram shows a flowchart of a plugin loading method provided in this embodiment of the present disclosure. The method includes steps S101 to S102, wherein:

[0067] S101: In response to triggering the preloading of plugins corresponding to the target program, obtain a plugin preloading sequence; the plugin preloading sequence is used to indicate the preloading order of multiple plugins of the target program; wherein, the plugin preloading sequence is determined based on the order of use of the plugins when the target program was used previously.

[0068] S102: Based on the preloading order of multiple plugins of the target program indicated by the plugin preloading sequence, the multiple plugins in the plugin preloading sequence are preloaded sequentially.

[0069] In the plugin loading method provided in the above embodiments, the plugin preloading sequence for the current use of the target program is determined based on the order in which plugins in the plugin preloading sequence were used during the previous use of the target program. Based on this preloading sequence, multiple plugins are preloaded sequentially during the current use of the target program. This allows for dynamic adjustment of the plugin preloading sequence based on the user's previous plugin usage order, enabling plugin preloading based on the user's application usage habits. This prioritizes preloading plugins that the user is more likely to use earlier, ensuring that a plugin is loaded successfully before the user uses it, thus improving plugin preloading effectiveness and user experience.

[0070] The following provides a detailed explanation of S101 to S102.

[0071] Regarding S101 above, a plugin is a program written to target programs and following certain target program interfaces. It is mainly used to develop and implement functions that the original target program does not have.

[0072] For example, the target program can be a browser, and common plugins can be filters, virus scanners, and plugins that support browsing new file types.

[0073] For example, when users search for information using a native browser, they are often disturbed by a wide variety of pop-up ads on the browsing page, making it impossible for them to accurately obtain the information they want. In this browser usage scenario, a plugin with pop-up ad blocking function can be loaded to filter pop-up ads.

[0074] For example, when users watch videos using a native browser, they may encounter background music that they like but don't know the song title. In this browser usage scenario, a plugin with background music recognition capabilities can be loaded to identify the background music appearing in the video and provide links to various music websites for easy searching by users.

[0075] In another example, the target program can be software development software, and developers can use different plugins to implement functions such as quick navigation, variable translation, and code tracing, which can help developers work more conveniently.

[0076] Here, when a user uses a plugin, the plugin needs to be loaded first. However, due to the limited processing power of the device, it is not possible to load all plugins at the same time when faced with a large number of plugins. Therefore, a plugin preloading method in which the client automatically attempts to preload plugins according to the loading order in the plugin preloading sequence is widely used.

[0077] The plugin preloading sequence is used to indicate the preloading order of multiple plugins in the plugin preloading sequence. For example, based on the position of multiple plugins in the plugin preloading sequence, plugins can be preloaded sequentially from the front to the back of the plugin preloading sequence, or plugins can be inserted sequentially from the back to the front of the plugin preloading sequence.

[0078] The plugin preloading sequence includes, but is not limited to: the current plugin preloading sequence, or the plugin preloading sequence after the previous update.

[0079] For example, the current plugin preloading sequence is obtained when the target program responds to a plugin preloading event. The target program preloads plugins according to the loading order of multiple plugins in the current plugin preloading sequence. When a user first uses a plugin in the current plugin preloading sequence, the target program marks the order in which the user first uses the plugin within the plugin preloading sequence. In other words, during a single use of the target program, a user may first use multiple plugins. Therefore, the target program can update the plugin preloading sequence based on the order in which the user first uses these plugins. This update can occur every time the user first uses any plugin in the plugin preloading sequence. Specifically, if the first plugin used by the user is the first plugin used by the user in this use of the target program, the target program updates the current plugin preloading sequence; if the first plugin used by the user is not the first plugin used by the user in this use of the target program, the target program updates the previously updated plugin preloading sequence. It is understandable that during the use of a target program, there is only one current plugin preload sequence, but there may be one or more plugin preload sequences after the previous update.

[0080] In addition, the plugin preload sequence can be stored as a file in the preset storage space of the storage unit. When the target program needs to use the plugin preload sequence, it retrieves the file from the storage unit to obtain the plugin preload sequence.

[0081] Plugin preloading events include, but are not limited to, at least one of the following M1 to M3.

[0082] M1: The target program has been launched.

[0083] For example, a plugin preload event can be triggered when the user launches the target program, and the target program can retrieve the current plugin preload sequence from the storage unit.

[0084] M2: The functionality associated with the plugin is activated.

[0085] For example, when a user first attempts to search for a function associated with a plugin and it is activated, such as when a user wants to use the variable translation function in a software development program, the user will search for the relevant function in the search tool. At this time, the plugin preload event is triggered, and the target program can obtain the current plugin preload sequence from the storage unit.

[0086] M3: Received plugin preload instruction.

[0087] For example, when a user inputs a specific plugin preloading command, such as when the user inputs a plugin preloading command during an idle period, the target program receives the command, triggers a plugin preloading event, and the target program can retrieve the current plugin preloading sequence from the storage unit.

[0088] Furthermore, the preloading order of multiple plugins in the current plugin preloading is determined based on the order in which multiple plugins were used when the target program was used previously.

[0089] Regarding S102 above, when preloading multiple plugins sequentially according to the plugin preloading sequence, such as... Figure 2 As shown in the example diagram of a current plugin preloading sequence, the preloading sequence includes [plugin C, plugin D, plugin B, plugin E, plugin A] in sequence. The first column of the preloading sequence represents the sequence number corresponding to the plugin's preloading order. This sequence number is determined based on the order in which the plugins were used during the previous use of the target program. The target program preloads the plugins sequentially according to their sequence numbers in the current preloading sequence.

[0090] Understandably, if the target program is launched for the first time, an original plugin preloading sequence is required to preload the plugins. In this case, the plugin preloading order of the current plugin preloading sequence is determined by the plugin preloading order indicated by the original plugin preloading sequence.

[0091] In one embodiment provided in this disclosure, in response to the target program being launched for the first time, an original plugin preloading sequence is obtained; based on the preloading order of multiple plugins of the target program indicated by the original plugin preloading sequence, multiple plugins in the original plugin preloading sequence are preloaded sequentially.

[0092] Here, the plugins in the original plugin preload sequence refer to some plugins that users frequently use. This includes some plugins that were not specified by the developers, as well as some plugins that were specified by the developers.

[0093] Developer-specified plugins are those that developers believe will significantly impact the user experience for most users. Prioritizing these plugins for preloading improves the user experience for the majority. Furthermore, at least some of the developer-specified plugins in the original plugin preloading sequence may overlap with frequently used plugins; therefore, developer-specified plugins and frequently used plugins will at least partially overlap.

[0094] For example, when the target program is launched for the first time, if the user triggers the plugin preload event, the target program retrieves the original plugin preload sequence from the storage unit. The target program preloads the plugins sequentially according to the preload order indicated by the original plugin preload sequence. For example, taking the target program as a software development program, when the user launches the software development program for the first time, the preload order of multiple plugins specified by the developer is as follows: first load plugin A for quick navigation, then load plugin B for project management, and finally load plugin C for code tracing. When the user triggers the plugin preload event, the software development program will load the plugins in the above preload order.

[0095] Furthermore, when a user triggers the use of a plugin in the plugin preload sequence for the first time while using the target program, that plugin can be identified as the target plugin. It can be understood that the target plugin here can be some plugins that the user frequently uses, or some plugins specified by the developers.

[0096] In one embodiment provided in this disclosure, in response to any plugin in the plugin preloading sequence being triggered for the first time during the current use of the target program, the usage order of the any plugin among the multiple plugins in the plugin preloading sequence is determined; based on the usage order, the plugin preloading sequence is updated.

[0097] For example, during a user's current use of the target program, when the user first triggers any plugin in the plugin preloading sequence, the system records the first usage time corresponding to that first trigger and stores it in the plugin preloading sequence. Based on the first usage times of multiple plugins, the system determines the usage order of the plugins and updates the plugin preloading sequence accordingly. For instance, the current plugin preloading sequence of a target program includes [Plugin A, Plugin B, Plugin C]. During the user's current use of the target program, all three plugins are triggered for the first time. Assuming the plugin usage order indicated by the first usage times is: Plugin B before Plugin C before Plugin A, then the usage order of the three plugins can be determined as [Plugin B, Plugin C, Plugin A]. The plugin preloading sequence is then updated according to the usage order.

[0098] The plugin is first triggered during the current use of the target program, including but not limited to at least one of the following M4 to M5 methods:

[0099] M4: During the current use of the target program, the search for the class corresponding to any of the plugins is triggered for the first time.

[0100] Here, we assume a target program implementing a certain function consists of several plugins, each with its own class loader. When the target program runs, it calls an entry function to invoke the relevant functionality. These functionalities are encapsulated in corresponding class files. Therefore, it's common for one class file to call a method of another. If the other class file doesn't exist, a system exception will occur. When the target program starts, due to limitations in device processing power, the system doesn't load all class files simultaneously. Instead, it dynamically loads specific class files into memory using the class loader. Only after a class file is loaded into memory can it be referenced by other class files. Therefore, when the system first searches for a class corresponding to a plugin—that is, when the class file can only be found by the class loader corresponding to that plugin—it can be considered that the plugin is being used for the first time.

[0101] For example, when a user attempts to use a certain function, the system searches for and loads the class file corresponding to that function. If this class file can only be found through the class loader corresponding to a specific plugin, then it can be considered that the plugin is being used for the first time during this usage of the target program. For instance, in a browser with pop-up ad blocking functionality, when a user opens the browser's browsing page or enables the pop-up ad blocking function for the first time through the option, the system searches for and loads the class file corresponding to that function. If this class file can only be found through the class loader corresponding to the pop-up ad blocking plugin, then it is determined that the plugin is being used for the first time.

[0102] M5: This is the first time any plugin is used during this use of the target program.

[0103] For example, when a user wants to achieve a certain function and uses a plugin for the first time, the target program determines that the plugin is being used for the first time. For instance, when a user needs to modify a line of code in the program development software, the program will use a quick navigation plugin to locate the user-defined navigation point. If this is the first time the user uses the plugin after opening the program development software, then the plugin is determined to be being used for the first time.

[0104] In one embodiment provided in this disclosure, such as Figure 3The flowchart shown illustrates a method for updating the plugin preloading sequence according to usage order, including but not limited to the following steps S301-S302:

[0105] S301: Based on the usage order, determine the target position of any plugin in the plugin preloading sequence.

[0106] For example, suppose the target positions of multiple plugins in the current plugin preloading sequence, determined by the previous updated plugin preloading sequence, are as follows: [Plugin A, Plugin B, Plugin C, Plugin D, Plugin E]. Suppose that during the user's use of the target program, [Plugin E, Plugin C, and Plugin D] are triggered and used for the first time in sequence. Then, according to the usage order, the target positions of the plugins in the current plugin preloading sequence are updated. For example, [Plugin E, Plugin C, Plugin D] are placed at the first three positions of the plugin preloading sequence; [Plugin A, Plugin B] are inserted at the end of the current plugin preloading sequence. At this time, the target positions of multiple plugins in the current plugin preloading sequence are as follows: [Plugin E, Plugin C, Plugin D, Plugin A, Plugin B].

[0107] S302: In response to the fact that the current position of any plugin indicated by the plugin preloading sequence is different from the target position, the plugin preloading sequence is updated based on the target position.

[0108] Here, the current position of a plugin can be represented as the target position of the plugin in the plugin preload sequence after the previous update; the target position of a plugin can be represented as the target position of the plugin in the current plugin preload sequence.

[0109] For example, suppose the target positions of multiple plugins in the previous plugin preloading sequence are [Plugin E, Plugin C, Plugin D, Plugin A, Plugin B], and the user triggers and uses [Plugin A, Plugin B, Plugin D, Plugin C, Plugin E] for the first time in the current use of the target program. Taking Plugin A as an example, the target position of Plugin A in the previous plugin preloading sequence is different from the target position corresponding to the first triggering of the plugin in the current use of the target program. Based on the usage order of Plugin A among the multiple plugins, its target position in the current plugin preloading sequence is updated. On the other hand, taking Plugin D as an example, the target position of Plugin D in the previous plugin preloading sequence is the same as the target position corresponding to the first triggering of the plugin in the current use of the target program. Therefore, it is not necessary to perform an update process on the current plugin preloading sequence.

[0110] Furthermore, based on the different usage habits of different users, when the target program is used multiple times, some plugins in the non-plugin preload sequence may be frequently triggered and used by users.

[0111] In response to this situation, in one embodiment provided in this disclosure, in response to the triggering of a plugin in the target program that does not exist in the plugin preloading sequence, the plugin that does not exist in the plugin preloading sequence is added to the plugin preloading sequence.

[0112] Here, plugins that are not present in the plugin preload sequence can be represented as plugins that the developers believe most users will only use occasionally.

[0113] For example, when a user first triggers a plugin that is not present in the plugin preloading sequence during a single use of the target program, the system determines the plugin's storage location in the plugin preloading sequence based on the order in which the plugin was first used within the plugin preloading sequence. The plugin can then be preloaded the next time the user uses the target program.

[0114] In addition, the number of times a plugin is used that is not present in the plugin preloading sequence can be recorded to indicate whether the plugin is frequently used by the user.

[0115] In one embodiment provided in this disclosure, in response to a plugin in the target program that does not exist in the plugin preloading sequence being triggered for use, the number of times the plugin that does not exist in the plugin preloading sequence is triggered for use during multiple uses of the target program is recorded; in response to the number of times being triggered for use reaching a preset first number threshold, the plugin that does not exist in the plugin preloading sequence is added to the plugin preloading sequence.

[0116] For example, when a user first uses a plugin that is not in the plugin preloading sequence during a single use of the target program, the system records one usage count. In subsequent uses of the target program, if the plugin is used during that use, the system increments the plugin's usage count by 1. When the plugin's usage count reaches the first threshold, it indicates that the plugin is frequently used by the user and can be preloaded, thus reducing the loading time for the user. Therefore, this plugin can be identified as a target plugin and added to the plugin preloading sequence. This first threshold can be set according to the actual application. For example, developers might consider a plugin not in the plugin preloading sequence to be frequently used by the user if it is used more than 10 times. Therefore, this plugin is identified as frequently used and added to the plugin preloading sequence, so it can be preloaded the next time the target program is launched.

[0117] Furthermore, during the multiple uses of the target program, some plugins in the plugin preload sequence may not be triggered by the user.

[0118] In response to this situation, in one embodiment provided in this disclosure, the number of consecutive times that each plugin in the plugin preloading sequence is not triggered during multiple uses of the target program can also be recorded; in response to any plugin in the plugin preloading sequence having a consecutive number of times that reaches a preset second number threshold, the plugin is deleted from the plugin preloading sequence.

[0119] For example, when a user does not trigger a plugin in the plugin pre-loading sequence during a single use of the target program, the system records one instance of non-use for that plugin. When the consecutive non-use count of a plugin reaches a second threshold, the plugin is removed from the pre-loading sequence. This second threshold represents the number of consecutive times a plugin is not triggered during multiple uses of the target program. This second threshold can be set according to the actual application. For example, developers might determine that if a user does not trigger a plugin in 10 consecutive uses of the target program, then that plugin is considered infrequently used and is therefore removed from the plugin pre-loading sequence.

[0120] In a specific example of plugin loading provided in this disclosure, possible application scenarios include, but are not limited to, those shown in a1 to a3 below:

[0121] a1: The plugin preloading sequence uses a single-threaded pool. Each plugin that needs to be preloaded is loaded sequentially.

[0122] Using a single-threaded pool here can avoid negatively impacting the device's processing capabilities.

[0123] For example, depending on the device's processing power, multiple plugins that need to be preloaded can be loaded simultaneously. The specific settings depend on the actual application situation, and no restrictions are imposed here.

[0124] a2: The update process of the plugin preloading sequence also uses a single-threaded pool.

[0125] Here, using a single-threaded pool allows the update process to be triggered at any time and avoids concurrent write conflicts.

[0126] For example, operations such as adding, deleting, and updating can be performed on the plugin preloading sequence in a single-threaded pool.

[0127] a3: The preloading order of plugins in the plugin preloading sequence needs to be persistently stored locally.

[0128] For example, the present invention only needs the Share Preferences storage class to meet the requirements of local persistent storage. Specifically, Share Preferences is a lightweight data storage class that can store some string and scalar values ​​in the target program, such as various configuration information of the target program, the number of times each plugin in the target program is used, the first time of use, and other data.

[0129] In the possible application scenarios described in a1 to a3 above, the plugin loading process includes, but is not limited to, the following steps S1 to S5:

[0130] S1: When a user installs and launches the target program for the first time, plugins are preloaded in the order indicated by the original plugin preload sequence.

[0131] S2: After the target program starts, when a user tries to use a plugin for the first time, it can be considered as the first time the plugin is triggered and the first time the plugin is used is recorded.

[0132] Here, "plugin" can refer to some plugins that users frequently use, as mentioned in the above embodiments.

[0133] S3: While recording the first use time of a plugin, record the usage order of the plugin, update its target position in the plugin preloading sequence, and store it in the storage unit.

[0134] S4: When the user starts the target program here, the plugin preload sequence after the previous update is read from the storage unit and the plugin is preloaded according to the sequence.

[0135] S5: Repeat steps S2 to S4 above.

[0136] Through the above process, the plugin preloading sequence can be dynamically updated according to the user's usage habits each time the target application is used.

[0137] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0138] Based on the same inventive concept, this disclosure also provides a plug-in loading device corresponding to the plug-in loading method. Since the principle of the device in this disclosure for solving the problem is similar to the plug-in loading method described above in this disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0139] Reference Figure 4The diagram shown is a schematic of a plug-in loading device provided in an embodiment of this disclosure. The device includes: an acquisition module 41 and a processing module 42; wherein,

[0140] The acquisition module 41, in response to triggering the preloading of plugins corresponding to the target program, acquires a plugin preloading sequence; the plugin preloading sequence is used to indicate the preloading order of multiple plugins of the target program; wherein, the plugin preloading sequence is determined based on the usage order of the plugins when the target program was used previously;

[0141] The processing module 42 is used to preload multiple plugins in the plugin preloading sequence sequentially based on the preloading order of multiple plugins of the target program indicated by the plugin preloading sequence.

[0142] In an optional implementation, the processing module 42 is further configured to:

[0143] In response to the target program being launched for the first time, the original plugin preload sequence is obtained;

[0144] Based on the preloading order of multiple plugins of the target program indicated by the original plugin preloading sequence, multiple plugins in the original plugin preloading sequence are preloaded sequentially.

[0145] In an optional embodiment, the device further includes an update module 45, the update module 45 being used for:

[0146] In response to the first use of any plugin in the plugin preloading sequence during the current use of the target program, the usage order of any plugin among the multiple plugins in the plugin preloading sequence is determined;

[0147] The plugin preloading sequence is updated based on the usage order.

[0148] In one optional implementation, the update module 45 is further configured to:

[0149] Based on the usage order, determine the target position of any plugin in the plugin preloading sequence;

[0150] In response to a discrepancy between the current position and the target position of any plugin indicated by the plugin preloading sequence, the plugin preloading sequence is updated based on the target position.

[0151] In an optional embodiment, the device further includes an adding module 43, the adding module 43 being used for:

[0152] In response to the triggering of a plugin in the target program that is not present in the plugin preload sequence, the plugin that is not present in the plugin preload sequence is added to the plugin preload sequence.

[0153] In one optional implementation, the adding module 43 is specifically used for:

[0154] The response is that a plugin not present in the plugin preloading sequence is triggered in the target program, and the number of times the plugin not present in the plugin preloading sequence is triggered during multiple uses of the target program is recorded;

[0155] In response to the number of times reaching a preset first threshold, the plugin that is not present in the plugin preloading sequence is added to the plugin preloading sequence.

[0156] In an optional embodiment, the device further includes a deletion module 44, which is further configured to:

[0157] Record the number of consecutive times that each plugin in the plugin preloading sequence is not triggered during multiple uses of the target program;

[0158] In response to any plugin in the plugin preloading sequence reaching a preset second threshold number of consecutive times, the plugin is removed from the plugin preloading sequence.

[0159] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.

[0160] This disclosure also provides a computer device, such as... Figure 5 The diagram shown is a schematic representation of a computer device structure provided in an embodiment of this disclosure, including:

[0161] A processor 51 and a memory 52; the memory 52 stores machine-readable instructions executable by the processor 51, and the processor 51 executes the machine-readable instructions stored in the memory 52. ​​When the machine-readable instructions are executed by the processor 51, the processor 51 performs the following steps:

[0162] In response to triggering the preloading of plugins corresponding to the target program, a plugin preloading sequence is obtained; the plugin preloading sequence is used to indicate the preloading order of multiple plugins of the target program; wherein, the plugin preloading sequence is determined based on the usage order of the plugins when the target program was used previously;

[0163] Based on the preloading order of multiple plugins of the target program indicated by the plugin preloading sequence, the multiple plugins in the plugin preloading sequence are preloaded sequentially.

[0164] The aforementioned memory 52 includes a main memory 521 and an external memory 522; the main memory 521, also known as internal memory, is used to temporarily store the computational data in the processor 51, as well as the data exchanged with external memory 522 such as a hard disk. The processor 51 exchanges data with the external memory 522 through the main memory 521.

[0165] The specific execution process of the above instructions can be referred to the steps of the plug-in loading method described in the embodiments of this disclosure, and will not be repeated here.

[0166] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the plug-in loading method described in the above method embodiments. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0167] This disclosure also provides a computer program product carrying program code. The program code includes instructions that can be used to execute the steps of the plug-in loading method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0168] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0169] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

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

[0171] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0172] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0173] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A plugin loading method, characterized in that, include: In response to a trigger, the plugins corresponding to the target program are preloaded, and the plugin preload sequence is obtained. The plugin preloading sequence is used to indicate the preloading order of multiple plugins of the target program; wherein, the plugin preloading sequence is determined based on the usage order of the plugins when the target program was used previously, so as to dynamically adjust the plugin preloading sequence when the target program is used again; Based on the preloading order of multiple plugins of the target program indicated by the plugin preloading sequence, the multiple plugins in the plugin preloading sequence are preloaded sequentially. In response to the target program being launched for the first time, the original plugin preload sequence is obtained; Based on the preloading order of multiple plugins of the target program indicated by the original plugin preloading sequence, the multiple plugins in the original plugin preloading sequence are preloaded sequentially. In response to the first use of any plugin in the plugin preloading sequence during the current use of the target program, the usage order of any plugin among the multiple plugins in the plugin preloading sequence is determined; Based on the usage order, determine the target position of any plugin in the plugin preloading sequence; In response to a discrepancy between the current position and the target position of any plugin indicated by the plugin preloading sequence, the plugin preloading sequence is updated based on the target position.

2. The method according to claim 1, characterized in that, The triggering of preloading the plugin corresponding to the target program includes at least one of the following: The target program is started, the functions associated with the plugin are activated, and a plugin preload instruction is received.

3. The method according to claim 1, characterized in that, Any plugin in the plugin preloading sequence is triggered for the first time during the current use of the target program, including at least one of the following: During this use of the target program, the search for the class corresponding to any of the plugins is triggered for the first time; This is the first time any plugin has been used during this use of the target program.

4. The method according to claim 1, characterized in that, Also includes: In response to the triggering of a plugin in the target program that is not present in the plugin preload sequence, the plugin that is not present in the plugin preload sequence is added to the plugin preload sequence.

5. The method according to claim 4, characterized in that, The step of adding the plugin not present in the plugin preloading sequence to the plugin preloading sequence in response to the triggering of a plugin in the target program, includes: The response is that a plugin not present in the plugin preloading sequence is triggered in the target program, and the number of times the plugin not present in the plugin preloading sequence is triggered during multiple uses of the target program is recorded; In response to the number of times reaching a preset first threshold, the plugin that is not present in the plugin preloading sequence is added to the plugin preloading sequence.

6. The method according to claim 1, characterized in that, Also includes: Record the number of consecutive times that each plugin in the plugin preloading sequence is not triggered during multiple uses of the target program; In response to any plugin in the plugin preloading sequence reaching a preset second threshold number of consecutive times, the plugin is removed from the plugin preloading sequence.

7. A plug-in loading device, characterized in that, The device includes: The acquisition module is used to acquire a plugin preloading sequence in response to a trigger to preload the plugins corresponding to the target program; the plugin preloading sequence is used to indicate the preloading order of multiple plugins of the target program; wherein, the plugin preloading sequence is determined based on the usage order of the plugins when the target program was used before, so as to dynamically adjust the plugin preloading sequence when the target program is used again; The processing module is configured to preload multiple plugins in the plugin preloading sequence sequentially based on the preloading order of multiple plugins of the target program indicated by the plugin preloading sequence. The processing module is also used for: In response to the target program being launched for the first time, the original plugin preload sequence is obtained; Based on the preloading order of multiple plugins of the target program indicated by the original plugin preloading sequence, the multiple plugins in the original plugin preloading sequence are preloaded sequentially. In response to the first use of any plugin in the plugin preloading sequence during the current use of the target program, the usage order of any plugin among the multiple plugins in the plugin preloading sequence is determined; Based on the usage order, determine the target position of any plugin in the plugin preloading sequence; In response to a discrepancy between the current position and the target position of any plugin indicated by the plugin preloading sequence, the plugin preloading sequence is updated based on the target position.

8. A computer device, characterized in that, include: A processor and a memory, the memory storing machine-readable instructions executable by the processor, the processor executing the machine-readable instructions stored in the memory, wherein when the machine-readable instructions are executed by the processor, the processor performs the steps of the plug-in loading method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a computer device, performs the steps of the plug-in loading method as described in any one of claims 1 to 6.