CN111984343B - Plug-in resource searching method, device, equipment and readable storage medium - Google Patents

Plug-in resource searching method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN111984343B
CN111984343B CN201910430953.4A CN201910430953A CN111984343B CN 111984343 B CN111984343 B CN 111984343B CN 201910430953 A CN201910430953 A CN 201910430953A CN 111984343 B CN111984343 B CN 111984343B
Authority
CN
China
Prior art keywords
plug
module
resource
request
host
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910430953.4A
Other languages
Chinese (zh)
Other versions
CN111984343A (en
Inventor
刘海涛
白玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baidu China Co Ltd
Original Assignee
Baidu China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Baidu China Co Ltd filed Critical Baidu China Co Ltd
Priority to CN201910430953.4A priority Critical patent/CN111984343B/en
Publication of CN111984343A publication Critical patent/CN111984343A/en
Application granted granted Critical
Publication of CN111984343B publication Critical patent/CN111984343B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/4492Inheritance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Abstract

The invention provides a plug-in resource searching method, a device, equipment and a readable storage medium, which are used for searching resources to a system module according to a first resource searching request acquired from a plug-in module to acquire system plug-in resources, wherein the plug-in module and a host module of the plug-in module are sub-class objects of an inherited system module, so that each plug-in module is used as an independent resource searching and loading object, and development dependence among plug-ins is relieved; the system plug-in resources are sent to a plug-in module; responding to a second resource searching request obtained from the plug-in module to search resources in a preset plug-in shared resource, and obtaining a host plug-in resource; the host plug-in resource is sent to the plug-in module, so that the plug-in module loads the host plug-in resource, multiplexing of the system resource and the host resource is achieved, reliability of resource searching is improved, local resource quantity of the plug-in module is reduced, and consistency of the plug-in module, the system module and the host module can be kept.

Description

Plug-in resource searching method, device, equipment and readable storage medium
Technical Field
The present invention relates to the field of plugins, and in particular, to a plugin resource searching method, device, equipment and readable storage medium.
Background
In order to meet the increasing use demands of users, a great deal of human resources are consumed by online addition, deletion and change caused by the fact that more and more application programs are rapidly online or replaced, and the online addition, deletion and change is one of reasons for limiting software updating. The plug-in system greatly improves the efficiency of software updating by adopting a mode that multiple plug-ins refer to the same host resource. With development and enrichment of plug-ins, one host corresponds to a large number of plug-ins.
In the existing plug-in system, the host and the plug-in are realized in a step-by-step inheritance loading mode. The plug-in inherits the functions of the host and the host inherits the functions of the system. The plug-in initiates a resource searching request to the host, and the host returns the local plug-in resource to the plug-in loading, or searches the plug-in resource in the system and returns the plug-in resource to the plug-in loading.
However, since multiple plugins inherit the same host, resource lookup may fail or even crash once resource path naming conflicts occur in two or more plugins. The reliability of the existing plug-in resource searching method is not high enough.
Disclosure of Invention
The embodiment of the invention provides a plug-in resource searching method, device, equipment and readable storage medium, which enable each plug-in module to be used as an independent resource searching and loading object, thereby relieving development dependence among plug-ins; the multiplexing of system resources and host resources is realized, the reliability of resource searching is improved, the local resource quantity of the plug-in module is reduced, and the consistency of the resources among the plug-in module, the system module and the host module can be kept.
In a first aspect of an embodiment of the present invention, a method for searching a plug-in resource is provided, including:
searching resources to a system module according to a first resource searching request obtained from the plug-in module to obtain system plug-in resources, wherein the plug-in module and a host module of the plug-in module are sub-class objects inheriting the system module;
the system plug-in resource is sent to the plug-in module, so that the plug-in module loads the system plug-in resource, and a second resource searching request is sent to a host module according to the first resource searching request and the system plug-in resource;
performing resource searching in a preset plug-in shared resource according to the second resource searching request to acquire a host plug-in resource;
And sending the host plug-in resource to the plug-in module so that the plug-in module loads the host plug-in resource.
Optionally, the searching the resources for the system module according to the first resource searching request obtained from the plugin module to obtain the system plugin resource includes:
acquiring request content and a plug-in identification of a plug-in module according to a first resource searching request acquired from the plug-in module;
acquiring a third resource searching request containing the request content according to the request content and preset safety identity information;
sending the third resource searching request to a system module;
receiving response information of the third resource searching request from the system module, wherein the response information of the third resource searching request comprises system plug-in resources;
and sending the system plug-in resource to a plug-in module corresponding to the plug-in identifier.
Optionally, the sending the system plug-in resource to the plug-in module corresponding to the plug-in identifier includes:
acquiring response information of the first resource searching request according to the system plug-in resource, wherein the response information of the first resource searching request comprises the system plug-in resource;
And sending the response information of the first resource searching request to a plug-in module corresponding to the plug-in identifier.
Optionally, before the obtaining the third resource searching request containing the request content according to the request content and the preset security identity information, the method further includes:
judging whether the request content comprises preset non-plug-in permission request content or not;
if yes, executing the third resource searching request containing the request content according to the request content and preset safety identity information;
if not, replacing the plug-in identification of the first resource searching request with a host identification, and sending the replaced first resource searching request to the system module, and receiving response information of the replaced first resource searching request from the system module, wherein the response information of the replaced first resource searching request contains system plug-in resources.
Optionally, before the determining whether the request content includes the preset non-plug-in permission request content, the method further includes:
and determining the request content as legal content.
Optionally, the searching for the resource in the preset shared resource of the plugin according to the second resource searching request to obtain the host plugin resource includes:
And searching resources in the plug-in shared resources of the host local and/or the plug-in shared resources outside the host according to the second resource searching request to acquire the host plug-in resources.
Optionally, the system plug-in resources include plug-in resources consistent with system user interface features;
the host plug-in resources include plug-in resources consistent with host user interface features.
According to a second aspect of the present invention, there is provided a plug-in resource searching method, including:
when a starting instruction is received from a host module, a first resource searching request for searching resources in a system module is sent, wherein the first resource searching request comprises a plug-in identifier of a plug-in module, and the host module and the plug-in module of the host module are sub-class objects inheriting the system module;
receiving system plug-in resources and loading the system plug-in resources;
sending a second resource searching request to a host module according to the first resource searching request and the system plug-in resource;
and receiving the host plug-in resource and loading the host plug-in resource.
Optionally, the sending, according to the first resource search request and the system plug-in resource, a second resource search request to the host module includes:
According to the request content of the first resource searching request and the system plug-in resource, determining the request content which is not queried by the system;
acquiring a second resource searching request according to the request content which is not queried by the system;
and sending a second resource searching request to the host module.
Optionally, the obtaining a second resource search request according to the request content not queried by the system includes:
according to the request content which is not queried by the system, carrying out local searching in the local resources of the plug-in module to acquire local plug-in resources;
determining the rest request content according to the request content which is not queried by the system and the local plug-in resource;
and acquiring a second resource searching request according to the residual request content.
According to a third aspect of the present invention, there is provided a plug-in resource searching apparatus, including:
the first searching module is used for searching resources to the system module according to a first resource searching request acquired from the plug-in module to acquire system plug-in resources, wherein the plug-in module and the host module of the plug-in module are sub-class objects of the inherited system module;
the first sending module is used for sending the system plug-in resource to the plug-in module so that the plug-in module loads the system plug-in resource and sends a second resource searching request to the host module according to the first resource searching request and the system plug-in resource;
The second searching module is used for searching resources in the preset shared plug-in resources according to the second resource searching request to acquire host plug-in resources;
and the second sending module is used for sending the host plug-in resource to the plug-in module so that the plug-in module loads the host plug-in resource.
Optionally, the first searching module is configured to obtain, according to a first resource searching request obtained from the plug-in module, a request content and a plug-in identifier of the plug-in module; acquiring a third resource searching request containing the request content according to the request content and preset safety identity information; sending the third resource searching request to a system module; receiving response information of the third resource searching request from the system module, wherein the response information of the third resource searching request comprises system plug-in resources; and sending the system plug-in resource to a plug-in module corresponding to the plug-in identifier.
Optionally, the first search module is configured to obtain response information of the first resource search request according to the system plugin resource, where the response information of the first resource search request includes the system plugin resource; and sending the response information of the first resource searching request to a plug-in module corresponding to the plug-in identifier.
Optionally, the first search module is further configured to determine, before the third resource search request including the request content is obtained according to the request content and preset security identity information, whether the request content includes preset non-plugin permission request content; if yes, executing the third resource searching request containing the request content according to the request content and preset safety identity information; if not, replacing the plug-in identification of the first resource searching request with a host identification, and sending the replaced first resource searching request to the system module, and receiving response information of the replaced first resource searching request from the system module, wherein the response information of the replaced first resource searching request contains system plug-in resources.
Optionally, the first search module is further configured to determine, before the determining whether the requested content includes the preset non-plug-in permission requested content, that the requested content is legal content.
Optionally, the second searching module is configured to perform resource searching in the plug-in shared resource local to the host and/or in the plug-in shared resource outside the host according to the second resource searching request, so as to obtain a host plug-in resource.
Optionally, the system plug-in resources include plug-in resources consistent with system user interface features;
the host plug-in resources include plug-in resources consistent with host user interface features.
According to a fourth aspect of the present invention, there is provided a plug-in resource searching apparatus, including:
the system comprises a first request module, a second request module and a system module, wherein the first request module is used for sending a first resource searching request for searching resources in the system module when receiving a starting instruction from the host module, the first resource searching request comprises a plug-in identifier of the plug-in module, and the plug-in modules of the host module and the host module are both sub-class objects inheriting the system module;
the first receiving module is used for receiving system plug-in resources and loading the system plug-in resources;
the second request module is used for sending a second resource searching request to the host module according to the first resource searching request and the system plug-in resource;
and the second receiving module is used for receiving the host plug-in resources and loading the host plug-in resources.
Optionally, the second request module is configured to find, according to the first resource, the requested content of the request and the system plugin resource, and determine the requested content that is not queried by the system; acquiring a second resource searching request according to the request content which is not queried by the system; and sending a second resource searching request to the host module.
Optionally, the second request module is configured to perform local search in a local resource of the plug-in module according to the request content that is not queried by the system, so as to obtain a local plug-in resource; determining the rest request content according to the request content which is not queried by the system and the local plug-in resource; and acquiring a second resource searching request according to the residual request content.
In a fifth aspect of an embodiment of the present invention, there is provided an apparatus comprising: the system comprises a memory, a processor and a computer program, wherein the computer program is stored in the memory, and the processor runs the computer program to execute the plug-in resource searching method according to the first aspect and various possible designs of the first aspect.
A sixth aspect of the embodiments of the present invention provides a readable storage medium, where a computer program is stored, where the computer program is used to implement the plug-in resource searching method according to the first aspect and the various possible designs of the first aspect when the computer program is executed by a processor.
According to the plug-in resource searching method, device and equipment and the readable storage medium, resource searching is carried out on a system module according to a first resource searching request obtained from a plug-in module to obtain system plug-in resources, wherein the plug-in module and a host module of the plug-in module are sub-class objects of an inherited system module, so that each plug-in module is used as an independent resource searching and loading object, and development dependence among plug-ins is relieved; the system plug-in resource is sent to the plug-in module, so that the plug-in module loads the system plug-in resource, and a second resource searching request is sent to a host module according to the first resource searching request and the system plug-in resource; performing resource searching in a preset plug-in shared resource according to the second resource searching request to acquire a host plug-in resource; and sending host plug-in resources to the plug-in module so that the plug-in module loads the host plug-in resources, thereby realizing multiplexing of system resources and host resources, improving reliability of resource searching, reducing local resource quantity of the plug-in module, and keeping consistency of the plug-in module, the system module and the host module.
Drawings
Fig. 1 is a signaling flow diagram of a plug-in resource searching method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a plug-in resource searching system according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of step S102 according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a plug-in resource searching device applied to a host module according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a plug-in resource searching device applied to a plug-in module according to an embodiment of the present invention;
fig. 6 is a schematic hardware structure of an apparatus according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms first, second, third and the like in the description and in the claims and in the above drawings, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein.
It should be understood that, in various embodiments of the present invention, the sequence number of each process does not mean that the execution sequence of each process should be determined by its functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
It should be understood that in the present invention, "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements that are expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present invention, "plurality" means two or more. "and/or" is merely an association relationship describing an association object, and means that three relationships may exist, for example, and/or B may mean: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship. "comprising A, B and C", "comprising A, B, C" means that all three of A, B, C comprise, "comprising A, B or C" means that one of the three comprises A, B, C, and "comprising A, B and/or C" means that any 1 or any 2 or 3 of the three comprises A, B, C.
It should be understood that in the present invention, "B corresponding to a", "a corresponding to B", or "B corresponding to a" means that B is associated with a, from which B can be determined. Determining B from a does not mean determining B from a alone, but may also determine B from a and/or other information. The matching of A and B is that the similarity of A and B is larger than or equal to a preset threshold value.
As used herein, "if" may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to detection" depending on the context.
The technical scheme of the invention is described in detail below by specific examples. The following embodiments may be combined with each other, and some embodiments may not be repeated for the same or similar concepts or processes.
In the existing plug-in system, the host and the plug-in are realized in a step-by-step inheritance loading mode. The plug-in is positioned at the bottommost layer in the existing plug-in system, and the functions of the host need to be inherited. When a plurality of product lines are plugged, different plug-ins inherit resources from the same host, so that resource path naming conflict cannot occur in all plug-in product lines. When the product lines among a plurality of plug-ins and hosts cooperate, the resource names or the plug-in package modifications need to be contracted and reserved in advance, and the efficiency of parallel development of multiple products is seriously affected. Moreover, as the plurality of plug-ins cannot keep the same set of resource source codes with the native application, the N times level increases the subsequent problem investigation and continuous updating maintenance cost. The existing plug-in system has heavier logic integral coupling and is inconvenient to flexibly expand and adjust the functions of corresponding modules, thereby limiting the upgrading development of the integral system.
In order to solve the problems in the prior art, the invention provides a plug-in resource searching method, a device, equipment and a readable storage medium, so that each plug-in module is used as an independent resource searching and loading object, and development dependence among plug-ins is relieved; the multiplexing of system resources and host resources is realized, the reliability of resource searching is improved, the local resource quantity of the plug-in module is reduced, and the consistency of the resources among the plug-in module, the system module and the host module can be kept.
The steps in the following embodiments of the present invention may be implemented by a host module or a plug-in module in a terminal, where the terminal may be a mobile terminal or a fixed terminal. Mobile terminals include, but are not limited to, mobile devices with image capturing capabilities such as cell phones, personal Digital Assistants (PDAs), tablet computers, portable devices (e.g., portable computers, pocket computers, or hand-held computers). The fixed terminal comprises, but is not limited to, fixed equipment with an image acquisition function, such as an access control, a smart fixed telephone, a console and the like. The embodiment of the invention is not limited to the form of the terminal.
The host module may be understood as an application program accessing the plug-in module, and the plug-in module may be understood as a program having a certain function, and the operation of the plug-in module needs to depend on the host module. For example, the host module accesses a plurality of plug-in modules through a built-in plug-in framework, wherein the host module is, for example, an assistant APP, and the plurality of plug-in modules are, for example, function plug-ins such as a music playing plug-in, a video plug-in, a picture viewing plug-in and the like. The assistant APP with the music playing plug-in, the video plug-in and the picture viewing plug-in can call the functions of the plug-ins according to the requirements of users, and the multifunctional integration of a single APP is realized.
The system module can be understood as a system where the host module is located, for example, an operating system such as an android system or an IOS system of the mobile phone.
Referring to fig. 1, a signaling flow diagram of a plug-in resource searching method according to an embodiment of the present invention is provided. The method shown in fig. 1 includes steps S101 to S108, specifically as follows:
s101, the plug-in module sends out a first resource searching request for searching resources in the system module when receiving a starting instruction from the host module.
For example, the user wants to use the assistant APP to view the picture, trigger the picture viewing function in the assistant APP, and send a start instruction to the picture viewing plug-in when the assistant APP calls the picture viewing plug-in. The plug-in module responds to the starting instruction to start searching and loading of the resource. And plug-in resources required by the plug-in module may be in the system module or in the host module, and in order to be consistent with the system resources preferentially, a first resource searching request for searching the resources in the system module is sent first. Wherein the first resource lookup request may be sent by the plug-in module to the system module, see dotted arrow pointing in fig. 1.
The first resource searching request comprises a plug-in identifier of a plug-in module, and the host module and the plug-in module of the host module are sub-class objects inheriting the system module. Because the plug-in module is the same as the host module and is a sub-class object of the system module, the plug-in module and the host module are mutually independent resource loading objects, and the plug-in module operates in the host module, so that the plug-in module can refer to the resources in the host module, and the host module can call the functions of the plug-in module. Therefore, a triangle brother indirect holding mode is formed among the host module, the plug-in module and the system module, and referring to fig. 2, a schematic diagram of a plug-in resource searching system is provided in the embodiment of the invention.
In the system architecture shown in fig. 2, the host module and the plug-in module inherit from a common system module, and the plug-in module indirectly holds the resources of the host module. Through the inheritance mode shown in fig. 2, the resources of the host module and the plug-in module are completely independent, and core interception loading of loading common resources or common resources can be realized, so that dependence among the plug-in modules and between the plug-in modules and the host module is reduced, autonomy of parallel independent development of the plug-in modules and the host module is improved, dependence among the plug-in modules is avoided, and independent parallel development and test of different plug-in modules are realized. The plug-in module indirectly holds the resources of the host module, and the plug-in module can set the shared code as the configuration of an external Provider (Provider) when compiling, but eliminates the shared code (Exclude) when packaging the plug-in module, so that the simplified multiplexing package of the resource public library of the multi-plug-in product line from N to 1 can be realized. Namely, the common code part which is originally needed to be contained in each plug-in module reduces the code quantity of each plug-in module by the mode that a host module exists and is externally referenced when the plug-in module runs. All plug-in modules can be developed by relying on the same resource interface, and the synchronous state of the plug-in modules is kept consistent with the current resource of the host module all the time in practice, so that the problem that the multi-plug-in product line is based on an interface resource library and does not need to pay attention to a specific host resource version is truly realized.
S102, the host module searches resources for the system module according to the first resource searching request, and acquires system plug-in resources.
Because the plug-in module is operated in the host module, when the plug-in module sends out a first resource searching request, the host module intercepts the first resource searching request and searches the system module for resources according to the first resource searching request to acquire system plug-in resources.
In some embodiments, the host module may intercept the first resource search request in a dynamic proxy manner and perform resource search to the system module. Since the host information of the host module is legal in the system module, the host module performs resource searching for the system module in the form of the host module, and is legal at the system module side.
S103, the host module sends the system plug-in resource to the plug-in module.
The system plug-in resource may be a plug-in resource consistent with the system user interface feature, such as a picture resource or a video resource with the android system interface feature, or a picture resource or a video resource with the IOS system interface feature.
Thus, one resource searching process from the plug-in module to the system module is completed. In general, the operation of a plug-in module needs to be consistent with the system in which the plug-in module is located and the host APP, for example, the plug-in module has the characteristics of an android system and needs to be consistent with the interface style of an assistant APP, so that the problem that the display effect of the plug-in module is quite different from the host style can be avoided. Thus, a part of the resources required by the plug-in module are consistent with the system module, and a part of the resources are consistent with the host module, and after a part of the plug-in resources are acquired from the system module, the embodiment also performs secondary resource searching to acquire the plug-in resources consistent with the host module.
S104, the plug-in module receives the system plug-in resource and loads the system plug-in resource.
S105, the plug-in module sends a second resource searching request to the host module according to the first resource searching request and the system plug-in resource.
All resources needed by loading in the starting process of the plug-in module are needed to be searched for by the first resource searching request, but the resources can be stored in the system module or the host module, so that the plug-in module needs to search for the first time in the system module and then search for the second time in the host module, and the resource synchronization with the system and the host can be realized, and the system is in priority synchronization. The plug-in module can determine which resources are not acquired in the system module according to the first resource searching request and the system plug-in resources, and accordingly generates a second resource searching request to perform secondary searching of the resources in the host module.
In some embodiments, the plugin module may determine, according to the request content of the first resource search request and the system plugin resource, the request content not queried by the system. And then acquiring a second resource searching request according to the non-queried request content of the system. And finally, sending a second resource searching request to the host module.
In some embodiments, the plug-in module may also perform a resource lookup locally at the plug-in module before generating the second resource lookup request. For example, after obtaining the request content which is not queried by the system, according to the request content which is not queried by the system, carrying out local search in the local resources of the plug-in module to obtain the local plug-in resources. And then the plug-in module determines the rest request content according to the request content which is not queried by the system and the local plug-in resource. And finally, the plug-in module acquires a second resource searching request according to the residual request content.
S106, the host module searches resources in the preset shared plug-in resources according to the second resource search request to acquire host plug-in resources.
It will be appreciated that the plug-in module configures the plug-in resources that need to be consistent with the host module as an externally provided means (Provider), so the plug-in module itself may achieve efficient packing by not saving that portion of the resources, but need to be obtained externally at run-time. In this embodiment, the plug-in resources that need to be consistent with the host module are stored in the plug-in shared resources of the host module, so that each plug-in module can be reused when loading the resources.
In some embodiments, the plug-in common resource may be stored locally to the host module or in a third party memory external to the host. And the host module searches resources in the plug-in shared resources of the host local and/or the plug-in shared resources outside the host according to the second resource searching request to acquire the host plug-in resources.
In some embodiments, the host plug-in resource may be a plug-in resource that includes features consistent with the host user interface. Such as a picture asset or a video asset with helper APP interface features. Interface features are, for example, display effect, color style, etc.
S107, the host module sends host plug-in resources to the plug-in module.
S108, the plug-in module receives the host plug-in resource and loads the host plug-in resource.
The plug-in module can realize the resource synchronization with the system module and the host module through searching the resources of the system module and the host module. For example, after the function of the plug-in module is updated (for example, the compatible format is promoted), the displayed prompt pattern still accords with the version requirement of the host module, so that before the host does not update the resource, the plug-in module only updates the function implementation, and the display effect still accords with the host module. And after the host module is updated and the plug-in resources are updated, the plug-in module realizes synchronous updating when multiplexing the plug-in resources of the host module.
According to the plug-in resource searching method provided by the embodiment, when a plug-in module receives a starting instruction from a host module, a first resource searching request for searching resources in a system module is sent out; the host module searches resources to the system module according to the first resource searching request to acquire system plug-in resources; the plug-in modules and the host modules of the plug-in modules are sub-class objects of the inheritance system modules, so that each plug-in module is used as an independent resource searching and loading object, and development dependence among plug-ins is relieved; the host module sends the system plug-in resource to the plug-in module; the plug-in module receives system plug-in resources and loads the system plug-in resources; the plug-in module sends a second resource searching request to the host module according to the first resource searching request and the system plug-in resource; the host module searches resources in the preset shared plug-in resources according to the second resource searching request to acquire host plug-in resources; the host module sends host plug-in resources to the plug-in module; the plug-in module receives the host plug-in resource and loads the host plug-in resource; therefore, multiplexing of system resources and host resources is realized, reliability of resource searching is improved, local resource quantity of the plug-in module is reduced, and consistency of the resources among the plug-in module, the system module and the host module can be maintained.
In the embodiment shown in fig. 1, the implementation manner of step S102 (the host module performs resource searching for the system module according to the first resource searching request to obtain the system plug-in resource) may be various, for example, refer to fig. 3, which is a schematic flowchart of step S102 provided in the embodiment of the present invention. The method shown in fig. 3 is implemented by a host module, and mainly includes steps S201 to S205, which are specifically as follows:
s201, the host module obtains request content and plug-in identification of the plug-in module according to a first resource search request obtained from the plug-in module.
The host module analyzes the first resource searching request to acquire the request content, namely which resources are needed to be searched by the plug-in module. The host module may also record the plug-in identification of the plug-in module to determine which plug-in module to send to after subsequently obtaining system plug-in resources from the system module.
S202, the host module obtains a third resource searching request containing the request content according to the request content and preset safety identity information.
It can be understood that, the request content of the first resource searching request is encapsulated again with the security identity information of the host module, so as to obtain a third resource searching request of the host module. The security identity information is, for example, information required for the system module to perform security verification, for example, a security verification code registered in advance in the system module by the host module.
In some embodiments, the system module does not perform security verification on all the requests, so that before step S202, a plug-in authority determination may be performed, and for the request content that does not exceed the plug-in authority, that is, the request content that the system module does not perform security verification, only the replacement of the plug-in identifier is performed without adding the security identity information; for the request content exceeding the plug-in authority, i.e. the request content for which the system module requires the security check, step S202 is performed to add the security identity information so that the security check can be passed at the system module. Specifically, it may be that whether the request content includes a preset non-plug-in authority request content is judged; if yes, go to step S202; if not, replacing the plug-in identification of the first resource searching request with a host identification, and sending the replaced first resource searching request to the system module, and receiving response information of the replaced first resource searching request from the system module, wherein the response information of the replaced first resource searching request contains system plug-in resources.
In some embodiments, the host module may further perform other audits on the first resource search request, for example, audit whether the requested content of the first resource search request is legal, before determining whether the requested content includes the preset non-plug-in rights requested content. If the request content is determined to be legal, continuing to judge whether the request content comprises preset non-plug-in permission request content. If the host module determines that the request content of the first resource searching request is illegal content, for example, security risk exists or a preset standard condition is not met, the processing is not continued, or the resource loading and running of the plug-in module are prevented.
S203, the host module sends the third resource searching request to the system module.
It can be understood that when the system module receives the third resource search request, the request is identified as a request initiated by the host module, so that if security verification is required, security identity information of the host is verified. And after obtaining the search result according to the third resource search request, returning the search result to the host module.
S204, the host module receives response information of the third resource searching request from the system module, wherein the response information of the third resource searching request comprises system plug-in resources.
S205, the host module sends the system plug-in resource to a plug-in module corresponding to the plug-in identifier.
Because the host module intercepts the first resource searching request in a dynamic proxy mode, when the system plug-in resource is sent to the plug-in module corresponding to the plug-in identifier, response information of the first resource searching request can be obtained according to the system plug-in resource, wherein the response information of the first resource searching request comprises the system plug-in resource. It can be understood that the host module encapsulates the system plug-in resource into response information of the first resource searching request, and then sends the response information of the first resource searching request to the plug-in module corresponding to the plug-in identifier. Thereby enabling the plug-in module to process the response information of the first resource lookup request.
In the embodiment, the host module intercepts and processes information when the plug-in module runs in a dynamic proxy mode, so that the plug-in module and the system module can interact smoothly, the problem that the request of the plug-in module is not supported is solved, and the reliability of the resource search of the plug-in module is improved.
On the basis of the above embodiment, referring to fig. 4, a schematic structural diagram of a plug-in resource searching device applied to a host module according to an embodiment of the present invention is provided. The plug-in resource searching apparatus 40 shown in fig. 4 includes:
the first search module 41 is configured to perform resource search for the system module according to a first resource search request obtained from the plug-in module, and obtain a system plug-in resource, where the plug-in module and the host module of the plug-in module are both sub-class objects of the inheritance system module.
And the first sending module 42 is configured to send the system plug-in resource to the plug-in module, so that the plug-in module loads the system plug-in resource, and send a second resource search request to the host module according to the first resource search request and the system plug-in resource.
And the second searching module 43 is configured to perform resource searching in a preset shared resource of the plug-ins according to the second resource searching request, so as to obtain a host plug-in resource.
And the second sending module 44 is configured to send a host plug-in resource to the plug-in module, so that the plug-in module loads the host plug-in resource.
The plug-in resource searching device in the embodiment shown in fig. 4 may be correspondingly used to perform the steps performed by the host module in the embodiment of the method shown in fig. 1, and the implementation principle and technical effects are similar, which are not repeated herein.
On the basis of the above embodiment, the first search module 41 is configured to obtain, according to a first resource search request obtained from a plug-in module, a request content and a plug-in identifier of the plug-in module; acquiring a third resource searching request containing the request content according to the request content and preset safety identity information; sending the third resource searching request to a system module; receiving response information of the third resource searching request from the system module, wherein the response information of the third resource searching request comprises system plug-in resources; and sending the system plug-in resource to a plug-in module corresponding to the plug-in identifier.
On the basis of the foregoing embodiment, the first search module 41 is configured to obtain, according to the system plug-in resource, response information of the first resource search request, where the response information of the first resource search request includes the system plug-in resource; and sending the response information of the first resource searching request to a plug-in module corresponding to the plug-in identifier.
On the basis of the above embodiment, the first search module 41 is further configured to determine, before the obtaining, according to the request content and the preset security identity information, a third resource search request including the request content, whether the request content includes a preset non-plugin permission request content; if yes, executing the third resource searching request containing the request content according to the request content and preset safety identity information; if not, replacing the plug-in identification of the first resource searching request with a host identification, and sending the replaced first resource searching request to the system module, and receiving response information of the replaced first resource searching request from the system module, wherein the response information of the replaced first resource searching request contains system plug-in resources.
On the basis of the above embodiment, the first search module 41 is further configured to determine that the requested content is legal content before the determining whether the requested content includes the preset non-plug-in permission requested content.
On the basis of the foregoing embodiment, the second searching module 43 is configured to perform resource searching in the plug-in shared resource local to the host and/or in the plug-in shared resource external to the host according to the second resource searching request, so as to obtain the host plug-in resource.
Based on the above embodiment, the system plug-in resource includes a plug-in resource consistent with a system user interface feature; the host plug-in resources include plug-in resources consistent with host user interface features.
On the basis of the above embodiment, referring to fig. 5, a schematic diagram of a plug-in resource searching device applied to a plug-in module according to an embodiment of the present invention is provided. The plug-in resource searching apparatus 50 shown in fig. 5 includes:
the first request module 51 is configured to send a first resource search request for performing resource search in the system module when receiving a start instruction from the host module, where the first resource search request includes a plug-in identifier of a plug-in module, and the host module and the plug-in module of the host module are both child objects that inherit the system module.
The first receiving module 52 is configured to receive a system plug-in resource and load the system plug-in resource.
And the second request module 53 is configured to send a second resource search request to the host module according to the first resource search request and the system plug-in resource.
And the second receiving module 54 is configured to receive the host plug-in resource and load the host plug-in resource.
The plug-in resource searching device in the embodiment shown in fig. 5 may be correspondingly used to execute the steps executed by the plug-in module in the embodiment of the method shown in fig. 1, where the implementation principle and the technical effect are similar, and are not repeated herein.
On the basis of the above embodiment, the second request module is configured to find, according to the first resource, the requested content of the request and the system plugin resource, and determine the requested content that is not queried by the system; acquiring a second resource searching request according to the request content which is not queried by the system; and sending a second resource searching request to the host module.
On the basis of the above embodiment, the second request module is configured to perform local search in a local resource of the plug-in module according to a request content that is not queried by the system, so as to obtain a local plug-in resource; determining the rest request content according to the request content which is not queried by the system and the local plug-in resource; and acquiring a second resource searching request according to the residual request content.
Referring to fig. 6, a schematic hardware structure of an apparatus according to an embodiment of the present invention includes: a processor 61, a memory 62 and a computer program; wherein the method comprises the steps of
A memory 62 for storing the computer program, which memory may also be a flash memory (flash). Such as application programs, functional modules, etc. implementing the methods described above.
And a processor 61, configured to execute the computer program stored in the memory, so as to implement each step executed by the host module or the plug-in module in the plug-in resource searching method. Reference may be made in particular to the description of the embodiments of the method described above.
Alternatively, the memory 62 may be separate or integrated with the processor 61.
When the memory 62 is a device separate from the processor 61, the apparatus may further include:
a bus 63 for connecting the memory 62 and the processor 61.
The present invention also provides a readable storage medium having stored therein a computer program for implementing the plug-in resource searching method provided in the above various embodiments when the computer program is executed by a processor.
The readable storage medium may be a computer storage medium or a communication medium. Communication media includes any medium that facilitates transfer of a computer program from one place to another. Computer storage media can be any available media that can be accessed by a general purpose or special purpose computer. For example, a readable storage medium is coupled to the processor such that the processor can read information from, and write information to, the readable storage medium. In the alternative, the readable storage medium may be integral to the processor. The processor and the readable storage medium may reside in an application specific integrated circuit (Application Specific Integrated Circuits, ASIC for short). In addition, the ASIC may reside in a user device. The processor and the readable storage medium may reside as discrete components in a communication device. The readable storage medium may be read-only memory (ROM), random-access memory (RAM), CD-ROMs, magnetic tape, floppy disk, optical data storage device, etc.
The present invention also provides a program product comprising execution instructions stored in a readable storage medium. The at least one processor of the device may read the execution instructions from the readable storage medium, and execution of the execution instructions by the at least one processor causes the device to implement the plug-in resource lookup method provided by the various embodiments described above.
In the above embodiment of the apparatus, it should be understood that the processor may be a central processing unit (english: central Processing Unit, abbreviated as CPU), or may be other general purpose processors, digital signal processors (english: digital Signal Processor, abbreviated as DSP), application specific integrated circuits (english: application Specific Integrated Circuit, abbreviated as ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (11)

1. A plug-in resource searching method is characterized by comprising the following steps:
acquiring request content and a plug-in identification of a plug-in module according to a first resource searching request acquired from the plug-in module;
judging whether the request content comprises preset non-plug-in permission request content or not; if yes, acquiring a third resource searching request containing the request content according to the request content and preset safety identity information;
sending the third resource searching request to a system module;
receiving response information of the third resource searching request from the system module, wherein the response information of the third resource searching request comprises system plug-in resources;
if not, replacing the plug-in identification of the first resource searching request with a host identification, and sending the replaced first resource searching request to the system module, wherein response information of the replaced first resource searching request is received from the system module, the response information of the replaced first resource searching request contains system plug-in resources, and the plug-in module and the host module of the plug-in module are both sub-class objects inheriting the system module;
The system plug-in resource is sent to the plug-in module, so that the plug-in module loads the system plug-in resource, and a second resource searching request is sent to a host module according to the first resource searching request and the system plug-in resource;
performing resource searching in a preset plug-in shared resource according to the second resource searching request to acquire a host plug-in resource;
and sending the host plug-in resource to the plug-in module so that the plug-in module loads the host plug-in resource.
2. The method of claim 1, wherein the sending the system plug-in resource to the plug-in module corresponding to the plug-in identifier comprises:
acquiring response information of the first resource searching request according to the system plug-in resource, wherein the response information of the first resource searching request comprises the system plug-in resource;
and sending the response information of the first resource searching request to a plug-in module corresponding to the plug-in identifier.
3. The method of claim 1, further comprising, prior to said determining whether the requested content comprises a preset non-plug-in rights requested content:
And determining the request content as legal content.
4. The method of claim 1, wherein the performing resource lookup in the preset shared plugin resource according to the second resource lookup request to obtain the host plugin resource includes:
and searching resources in the plug-in shared resources of the host local and/or the plug-in shared resources outside the host according to the second resource searching request to acquire the host plug-in resources.
5. The method according to any one of claim 1 to 4, wherein,
the system plug-in resources comprise plug-in resources consistent with the characteristics of the system user interface;
the host plug-in resources include plug-in resources consistent with host user interface features.
6. A plug-in resource searching method is characterized by comprising the following steps:
when a starting instruction is received from a host module, a first resource searching request for searching resources in a system module is sent, wherein the first resource searching request comprises a plug-in identifier of a plug-in module, and the host module and the plug-in module of the host module are sub-class objects inheriting the system module;
receiving system plug-in resources and loading the system plug-in resources;
According to the request content of the first resource searching request and the system plug-in resource, determining the request content which is not queried by the system; acquiring a second resource searching request according to the request content which is not queried by the system;
sending a second resource search request to the host module;
and receiving the host plug-in resource and loading the host plug-in resource.
7. The method of claim 6, wherein the obtaining a second resource lookup request based on the content of the request not queried by the system comprises:
according to the request content which is not queried by the system, carrying out local searching in the local resources of the plug-in module to acquire local plug-in resources;
determining the rest request content according to the request content which is not queried by the system and the local plug-in resource;
and acquiring a second resource searching request according to the residual request content.
8. A plug-in resource lookup apparatus, comprising:
the first searching module is used for acquiring request content and plug-in identification of the plug-in module according to a first resource searching request acquired from the plug-in module;
judging whether the request content comprises preset non-plug-in permission request content or not; if yes, acquiring a third resource searching request containing the request content according to the request content and preset safety identity information;
Sending the third resource searching request to a system module;
receiving response information of the third resource searching request from the system module, wherein the response information of the third resource searching request comprises system plug-in resources;
if not, replacing the plug-in identification of the first resource searching request with a host identification, and sending the replaced first resource searching request to the system module, and receiving response information of the replaced first resource searching request from the system module, wherein the response information of the replaced first resource searching request contains system plug-in resources, and the plug-in module and the host module of the plug-in module are both sub-class objects of the inherited system module;
the first sending module is used for sending the system plug-in resource to the plug-in module so that the plug-in module loads the system plug-in resource and sends a second resource searching request to the host module according to the first resource searching request and the system plug-in resource;
the second searching module is used for searching resources in the preset shared plug-in resources according to the second resource searching request to acquire host plug-in resources;
And the second sending module is used for sending the host plug-in resource to the plug-in module so that the plug-in module loads the host plug-in resource.
9. A plug-in resource lookup apparatus, comprising:
the system comprises a first request module, a second request module and a system module, wherein the first request module is used for sending a first resource searching request for searching resources in the system module when receiving a starting instruction from the host module, the first resource searching request comprises a plug-in identifier of the plug-in module, and the plug-in modules of the host module and the host module are both sub-class objects inheriting the system module;
the first receiving module is used for receiving system plug-in resources and loading the system plug-in resources;
the second request module is used for searching the request content of the request and the system plug-in resource according to the first resource and determining the request content which is not searched by the system; acquiring a second resource searching request according to the request content which is not queried by the system;
sending a second resource search request to the host module;
and the second receiving module is used for receiving the host plug-in resources and loading the host plug-in resources.
10. A plug-in resource lookup apparatus, comprising: a memory, a processor and a computer program stored in the memory, the processor running the computer program to perform the plug-in resource lookup method of any one of claims 1 to 7.
11. A readable storage medium, wherein a computer program is stored in the readable storage medium, which computer program, when being executed by a processor, is adapted to implement the plug-in resource lookup method according to any one of claims 1 to 7.
CN201910430953.4A 2019-05-22 2019-05-22 Plug-in resource searching method, device, equipment and readable storage medium Active CN111984343B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910430953.4A CN111984343B (en) 2019-05-22 2019-05-22 Plug-in resource searching method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910430953.4A CN111984343B (en) 2019-05-22 2019-05-22 Plug-in resource searching method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN111984343A CN111984343A (en) 2020-11-24
CN111984343B true CN111984343B (en) 2024-03-01

Family

ID=73436053

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910430953.4A Active CN111984343B (en) 2019-05-22 2019-05-22 Plug-in resource searching method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN111984343B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436269A (en) * 2007-11-14 2009-05-20 华为软件技术有限公司 Unionized resource management system and resource lookup method of business analysis system
CN102186164A (en) * 2011-02-18 2011-09-14 华为技术有限公司 Method and management device for operating device resource
CN103078859A (en) * 2012-12-31 2013-05-01 普天新能源有限责任公司 Service system authority management method, equipment and system
WO2016200656A1 (en) * 2015-06-09 2016-12-15 Intel Corporation System, apparatus and method for access control list processing in a constrained environment
CN107025117A (en) * 2016-01-29 2017-08-08 上海卓易科技股份有限公司 The loading method and its system of plug-in unit
CN107092494A (en) * 2016-02-18 2017-08-25 腾讯科技(深圳)有限公司 The method and apparatus for accessing APK resources
CN107528976A (en) * 2017-08-31 2017-12-29 广东欧珀移动通信有限公司 Resource allocation method and Related product
CN108228210A (en) * 2017-12-08 2018-06-29 平安科技(深圳)有限公司 A kind of resource regeneration method and system
CN108287758A (en) * 2017-01-09 2018-07-17 阿里巴巴集团控股有限公司 A kind of application resource management method, application method and device
CN109101550A (en) * 2018-07-09 2018-12-28 广州极天信息技术股份有限公司 Semantic network management system, method, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6668183B2 (en) * 2016-07-01 2020-03-18 株式会社東芝 Communication device, communication method, communication system and program

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436269A (en) * 2007-11-14 2009-05-20 华为软件技术有限公司 Unionized resource management system and resource lookup method of business analysis system
CN102186164A (en) * 2011-02-18 2011-09-14 华为技术有限公司 Method and management device for operating device resource
CN103078859A (en) * 2012-12-31 2013-05-01 普天新能源有限责任公司 Service system authority management method, equipment and system
WO2016200656A1 (en) * 2015-06-09 2016-12-15 Intel Corporation System, apparatus and method for access control list processing in a constrained environment
CN107025117A (en) * 2016-01-29 2017-08-08 上海卓易科技股份有限公司 The loading method and its system of plug-in unit
CN107092494A (en) * 2016-02-18 2017-08-25 腾讯科技(深圳)有限公司 The method and apparatus for accessing APK resources
CN108287758A (en) * 2017-01-09 2018-07-17 阿里巴巴集团控股有限公司 A kind of application resource management method, application method and device
CN107528976A (en) * 2017-08-31 2017-12-29 广东欧珀移动通信有限公司 Resource allocation method and Related product
CN108228210A (en) * 2017-12-08 2018-06-29 平安科技(深圳)有限公司 A kind of resource regeneration method and system
CN109101550A (en) * 2018-07-09 2018-12-28 广州极天信息技术股份有限公司 Semantic network management system, method, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ControllerSEPA: A Security-Enhancing SDN Controller Plug-in for OpenFlow Applications;Y. Tseng 等;《2016 17th International Conference on Parallel and Distributed Computing, Applications and Technologies (PDCAT)》;268-273 *
基于插件的动态模块框架研究;郭娜 等;《吉林大学学报》;第26卷(第01期);69-75 *

Also Published As

Publication number Publication date
CN111984343A (en) 2020-11-24

Similar Documents

Publication Publication Date Title
EP3441876B1 (en) Patch upgrade-based file processing method and device, terminal, and storage medium
CN107832100B (en) APK plug-in loading method and terminal thereof
CN110688232B (en) Application program calling method, terminal equipment and computer readable storage medium
US9189300B2 (en) Dynamic service discovery
US20120227032A1 (en) Method, apparatus, and system for invoking widget
CN110795192B (en) Language switching method and device and terminal equipment
CN115378735B (en) Data processing method and device, storage medium and electronic equipment
US10516699B2 (en) Electronic device and method for suggesting response manual in occurrence of denial
CN107402792B (en) Integration method, device, equipment and storage medium of application software installation package
CN110888658B (en) Method and device for dynamically changing function modules in application program and storage medium
CN108268261B (en) UI (user interface) customization method of intelligent terminal, storage medium and intelligent terminal
CN112688811B (en) Wireless local area network management method, device, equipment and storage medium
CN115048642A (en) Communication method between trusted applications in multiple trusted execution environments and electronic equipment
CN112256351B (en) Method for realizing Feign component, method and device for calling micro-service
CN111984343B (en) Plug-in resource searching method, device, equipment and readable storage medium
CN111338633B (en) Method and device for generating installation-free file and electronic equipment
CN106778270B (en) Malicious application detection method and system
US20230350738A1 (en) Method for Reusing Shared Library and Electronic Device
US11934853B2 (en) Electronic device and operating method thereof
CN116643778B (en) Application program optimization method and electronic equipment
CN108345507B (en) Communication method and device between JS module and Java module
CN110287734B (en) Method and device for setting secure communication node, terminal and storage medium
CN114489853A (en) Plug-in registration method, electronic device and computer-readable storage medium
CN114356352A (en) Management method of application data under multiple users and terminal equipment
CN114880140A (en) Component management method, device, electronic apparatus, storage medium, and program product

Legal Events

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