Dynamic plug-in running method, device, system and storage medium
By acquiring user demand information in real time and dynamically loading plugin code, the problems of low processing efficiency and wasted storage space of dynamic plugins are solved, achieving efficient plugin operation and function expansion, and reducing resource consumption.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-30
- Publication Date
- 2026-03-27
AI Technical Summary
Existing dynamic plugin technology suffers from low processing efficiency and large storage space consumption. Especially during the compilation of JavaScript code, the compilation tools are overburdened, resulting in a waste of computer and human resources. Furthermore, it is difficult to mix and match compiled files from different batches, leading to a waste of storage space.
By acquiring user demand information in real time, selecting pre-stored plugin information, including storage address and metadata, sending data requests to obtain plugin running information, and dynamically loading and executing plugin code in the webpage, the plugin runs using various methods such as the eval() function, Function constructor, script tags, and hypertext references.
It enables the reuse and expansion of dynamic plugins, improves processing efficiency, reduces data storage, reduces waste of computer resources and storage space, and enhances the functionality and response speed of web applications.
Smart Images

Figure CN114461954B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of plug-in running, and in particular to a dynamic plug-in running method, device, system and storage medium. BACKGROUND
[0002] When a user opens a webpage for browsing based on a browser, JavaScript code contained in the webpage will be immediately downloaded, parsed and run by the browser. The loading process of the JavaScript code will occupy a certain amount of time, during which the browser will be in a state of being unable to respond in real time, resulting in poor user experience.
[0003] In order to solve the above-mentioned user experience problem, in the field of front-end development of browser webpages, front-end webpage developers will use a specific code compiling tool to process all JavaScript code into different files in order to make some JavaScript code be loaded and run on demand and later. Some of these JavaScript files will only be loaded and run by the browser after a specific logic trigger.
[0004] The JavaScript code dynamic loading and running method achieved by using the JavaScript code compiling tool can achieve dynamic plug-in of code blocks, but has the following problems:
[0005] 1. When the code is processed by the compiling tool, the webpage developer needs to pass all the codes in the webpage to the code compiling tool. This way, the compiling tool will obviously be heavily burdened. The compiling tool needs to run for a long time to perform compiling processing, thereby causing waste of computer resources. Moreover, this process needs the participation of the webpage developer, causing unnecessary consumption of human resources.
[0006] 2. After each code compiling processing, the code file output by the compiling tool is usually related to the current compiling activity, and it is difficult to mix and use the JavaScript files compiled in different batches. Therefore, the JavaScript files generated by each compiling processing will occupy approximately the same computer storage space in the webpage background system. The storage space linearly increases with the increase of the number of compilations, causing waste of storage space.
[0007] In summary, the existing dynamic plug-in has the disadvantages of low processing efficiency and large occupied space. SUMMARY
[0008] The dynamic plug-in running method, device, system and storage medium provided by the embodiments of the present application enable the dynamic plug-in to be reused and expanded according to actual conditions, increase the webpage application function, improve the processing efficiency and reduce the data storage amount.
[0009] In a first aspect, the present application provides a dynamic plug-in running method, characterized in that comprising:
[0010] acquiring demand information of a user in real time, selecting plug-in pre-stored information based on the demand information, the plug-in pre-stored information at least including a storage address and meta information of a dynamic plug-in;
[0011] sending a data request according to the storage address and the meta information to make a back end feedback plug-in running information according to the data request;
[0012] making the dynamic plug-in run in a webpage based on the plug-in running information.
[0013] Optionally, in a possible implementation manner of the first aspect, before the step of acquiring demand information of a user in real time, selecting plug-in pre-stored information based on the demand information, the plug-in pre-stored information at least including a storage address and meta information of a dynamic plug-in, comprising:
[0014] receiving a corresponding relationship between demand information and plug-in pre-stored information;
[0015] corresponding the demand information and the plug-in pre-stored information of the dynamic plug-in in an array form to obtain a plug-in corresponding list.
[0016] Optionally, in a possible implementation manner of the first aspect, before the step of acquiring demand information of a user in real time, selecting plug-in pre-stored information based on the demand information, the plug-in pre-stored information at least including a storage address and meta information of a dynamic plug-in, comprising:
[0017] storing a corresponding relationship between received demand information and a back-end interface;
[0018] selecting plug-in pre-stored information based on the demand information comprises:
[0019] selecting a back-end interface according to the corresponding relationship between the demand information and the back-end interface, and receiving the plug-in pre-stored information based on the back-end interface.
[0020] Optionally, in a possible implementation manner of the first aspect, the plug-in running information includes plug-in code recorded in a pure text form;
[0021] making the dynamic plug-in run in a webpage based on the plug-in running information comprises:
[0022] loading the plug-in code to an eval() function of a preset programming language to dynamically execute.
[0023] Optionally, in a possible implementation manner of the first aspect, the plug-in running information includes plug-in code recorded in a pure text form;
[0024] making the dynamic plug-in run in the webpage based on the plug-in running information comprises:
[0025] loading the plug-in code into a Function constructor of a preset programming language to dynamically execute.
[0026] Optionally, in a possible implementation manner of the first aspect, the plug-in running information comprises plug-in code recorded in plain text.
[0027] making the dynamic plug-in run in the webpage based on the plug-in running information comprises:
[0028] loading the plug-in code into a script tag of a preset hypertext markup language, and dynamically executing the plug-in code based on the script tag
[0029] Optionally, in a possible implementation manner of the first aspect, the plug-in running information comprises plug-in code recorded in plain text.
[0030] making the dynamic plug-in run in the webpage based on the plug-in running information comprises:
[0031] adding a hypertext reference in a preset hypertext document, and dynamically executing the plug-in code by taking the hypertext reference as a script tag.
[0032] Optionally, in a possible implementation manner of the first aspect, an immediately executed function in the plug-in code is acquired, and a function code corresponding to a return value of the immediately executed function is acquired based on the immediately executed function.
[0033] the webpage executes the function code.
[0034] In a second aspect of the embodiment of the application, a dynamic plug-in running device is provided, comprising:
[0035] a selection module configured to acquire demand information of a user in real time, and select plug-in pre-stored information based on the demand information, wherein the plug-in pre-stored information at least comprises a storage address and meta information of a dynamic plug-in;
[0036] a sending module configured to send a data request according to the storage address and the meta information, so that a back end feeds back plug-in running information according to the data request;
[0037] a running module configured to make the dynamic plug-in run in a webpage based on the plug-in running information.
[0038] In a third aspect of the embodiment of the application, a dynamic plug-in running system is provided, comprising:
[0039] The running front end is used for acquiring the demand information of a user in real time, selecting plug-in pre-stored information based on the demand information, the plug-in pre-stored information at least including a storage address and meta information of a dynamic plug-in, and sending a data request to the back end according to the storage address and the meta information;
[0040] The dynamic plug-in runs in the webpage based on plug-in running information fed back by the back end.
[0041] The management back end is used for generating plug-in running information according to the data request and sending the plug-in running information to the running front end.
[0042] In a fourth aspect, the embodiment of the present application provides a readable storage medium, wherein the readable storage medium stores a computer program, and the computer program is used for implementing the method in the first aspect and various possible designs of the first aspect when the computer program is executed by a processor.
[0043] The dynamic plug-in running method, device, system and storage medium provided by the present application can acquire the demand of a user in real time, select pre-stored plug-in running information according to the demand of the user, and load a dynamic plug-in based on the plug-in running. In this way, a plurality of dynamic plug-ins can be pre-configured, and when a webpage needs to trigger a certain dynamic plug-in, the pre-stored dynamic plug-in can quickly and timely respond. The same dynamic plug-in is only stored once, and has the advantages of high processing efficiency and small occupied space. BRIEF DESCRIPTION OF DRAWINGS
[0044] Figure 1 A flow chart of a first embodiment of the dynamic plug-in running method;
[0045] Figure 2 A flow chart of a second embodiment of the dynamic plug-in running method;
[0046] Figure 3 A flow chart of a third embodiment of the dynamic plug-in running method;
[0047] Figure 4 A structure diagram of a first embodiment of the dynamic plug-in configuration device. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the present application.
[0049] The terms "first", "second", "third", "fourth" and the like in the description and in the claims of the present application, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of these terms herein is to be construed as interchangeable in order to describe the embodiments of the present application.
[0050] It should be understood that, in various embodiments of the present application, the magnitude of the serial number of each process does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0051] It should be understood that in the present application, "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units does not necessarily limit to the clearly listed steps or units, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0052] It should be understood that in the present application, "a plurality of" means two or more. "And / or" is only a description of the association relationship between the associated objects, which means that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist together, and B exists alone. The character " / " generally represents that the associated objects before and after are in an "or" relationship. "Including A, B and C", "including A, B, C" means that A, B and C are all included, "including A, B or C" means that one of A, B and C is included, and "including A, B and / or C" means that any one or any two or three of A, B and C is included.
[0053] It should be understood that in the present application, "B corresponding to A", "B corresponding to A", "A corresponding to B" or "B corresponding to A" means that B is associated with A, and B can be determined according to A. Determining B according to A does not mean that B is determined only according to A, but B can also be determined according to A and / or other information. The matching of A and B means that the similarity of A and B is greater than or equal to a preset threshold.
[0054] Depending on the context, "if" as used herein can be interpreted as "when" or "while" or "in response to determining" or "in response to detecting".
[0055] The technical solutions of the present application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described in some embodiments.
[0056] About the part of the invention of the noun explanation, Setter function: the function of the calculated property is the function of the Setter; JavaScript: a language becomes; Global object: a place definition, everywhere available; Object: a software set of some related variables and methods; Actual parameter: there is a data transmission relationship between the calling function and the called function when calling a parameter function, when a function is called in the calling function, the parameters in the brackets after the function name are called "actual parameters" (abbreviated as "actual parameters"), the actual parameters can be constants, variables or expressions; Setter function: call it and pass in data, the function decides how to handle the data; Eval() function: the eval() function is used to execute a string expression and return the value of the expression; HTML: the English full name of HTML is Hyper Text Markup Language, that is, Hyper Text Markup Language; Script: script.
[0057] Browser-side web application main program - it will undertake the task of loading and running dynamic plug-ins. When the JavaScript code of the web page is running, the application main body will trigger the loading and running logic of the plug-in due to the design needs of the internal business logic or due to the user's intention.
[0058] Plug-in file management background system - this background system is used to manage the version information of the plug-in, the URL address of the JavaScript file of the plug-in, and the name of the plug-in and other information. The outside world can initiate a network request with the name and version number of the plug-in as parameters to query the URL address of the JavaScript code file corresponding to the plug-in with the specific name and version from the background.
[0059] Plug-in - the plug-in is composed of a JavaScript code block that can be run alone and its name, version number and other description information.
[0060] The application provides a dynamic plug-in running method, as shown in Figure 1 , comprising:
[0061] Step S110, real-time acquisition of user demand information, selection of plug-in pre-stored information based on the demand information, the plug-in pre-stored information at least including the storage address and meta information of the dynamic plug-in. The pre-stored plug-in information can be multiple, and each pre-stored plug-in information corresponds to a dynamic plug-in with different functions. This step will monitor the user's operation on the web page in real time, and determine the demand information according to the user's operation. For example, when the user needs to watch the web page video, the demand is the plug-in that can browse the video. At the same time, the application can also determine the demand information and / or plug-in pre-stored information according to the product design logic of all parties or the user's active trigger. According to the demand information, the plug-in pre-stored information is obtained, and the plug-in pre-stored information includes but is not limited to the storage plug-in name and version information.
[0062] The plug-in pre-stored information can be information stored at the running front end.
[0063] In the first embodiment of step S110, as shown in the following table, the step includes: Figure 2
[0064] In step S1111, the correspondence between the requirement information and the plug-in pre-stored information is received.
[0065] In step S1112, the plug-in pre-stored information of the dynamic plug-in is corresponded with the requirement information based on the array form to obtain a plug-in correspondence list.
[0066] The application records the code file URL address and meta information web page developer of all available dynamic plug-ins in the form of JavaScript array. The storage address includes the code file URL address. The array in the plug-in correspondence list is embedded in the code of the application subject and the running front end. When the application subject and the running front end are initialized and run, the plug-in pre-stored information and the plug-in correspondence list are stored in the storage device of the user computer system. When the requirement information is queried, the application subject queries the plug-in pre-stored information in the plug-in correspondence list from the storage device.
[0067] In the second embodiment of step S110, as shown in the following table, the step includes: Figure 3
[0068] In step S1121, the correspondence between the received requirement information and the background interface is stored.
[0069] The selection of the plug-in pre-stored information based on the requirement information includes:
[0070] In step S1122, the background interface is selected according to the correspondence between the requirement information and the background interface, and the plug-in pre-stored information is received based on the background interface.
[0071] The application subject and the running front end can use the API provided by the management back end to query the plug-in pre-stored information of the available dynamic plug-in through the network request mode. The plug-in pre-stored information includes but is not limited to the name, version information and all code file URLs of the dynamic plug-in. In this embodiment, the plug-in pre-stored information is stored in the management back end.
[0072] The difference between the first embodiment of step S110 and the second embodiment of step S120 is that the plug-in pre-stored information in the first embodiment is stored in the application subject and the running front end. The advantage of this mode is that the plug-in running information can be quickly retrieved. The plug-in pre-stored information in the second embodiment is stored in the management back end. The advantage of this mode is that the data storage amount of the application subject and the running front end is reduced, so that the application subject and the running front end have more space.
[0073] Step S120, sending a data request according to the storage address and the meta information to make the backend feedback plug-in running information according to the data request. After obtaining the storage address and the meta information of the dynamic plug-in, the application sends a data request to the management backend according to the storage address and the meta information of the dynamic plug-in. The content of the data request can be a request to receive the plug-in running information corresponding to the storage address (all code file URLs). The plug-in running information can include all code files of the dynamic plug-in.
[0074] Step S130, making the dynamic plug-in run in the webpage based on the plug-in running information.
[0075] In the first embodiment of step S130, the plug-in running information includes plug-in code recorded in pure text form.
[0076] Step S130 includes:
[0077] The plug-in code is loaded into the eval() function of the preset programming language for dynamic execution. The plug-in code can be JavaScript code, and the preset programming language can be JavaScript.
[0078] The eval() function is a built-in feature of the JavaScript language. For example, the usage is eval('....'), and the parameter is code stored in pure text form. For example, the code for printing "hello world" text is 'console.log("hello world")', and the above text code is dynamically executed in the following way:
[0079] eval('console.log("hello world")')).
[0080] The application subject, the running front end initiates network access to the storage address (URL) of all code files of the dynamic plug-in, obtains JavaScript code recorded in pure text form, and then passes the text as a parameter to the eval() function of JavaScript for dynamic execution, so as to realize the loading and dynamic execution of the plug-in code.
[0081] In the second embodiment of step S130, the plug-in running information includes plug-in code recorded in pure text form.
[0082] Step S130 includes:
[0083] The plug-in code is loaded into a Function constructor of a preset programming language for dynamic execution. The plug-in code can be JavaScript code, and the preset programming language can be JavaScript.
[0084] For example, the code for printing the "hello world" text is 'console.log("hello world")', and the dynamic execution of the code for the above text is implemented in the following manner:
[0085] let func=new Function('console.log("hello world")');
[0086] func();
[0087] The purpose of let func=new Function('console.log("hello world")') is to construct a function that can execute the printing logic described above. func() is the function obtained by running the Function constructor.
[0088] The application subject or running front end initiates network access to the storage address (URL) of the entire code file of the dynamic plug-in, obtains the JavaScript code recorded in the form of pure text, and then transmits the text as a parameter to the Function constructor of JavaScript for dynamic execution, thereby achieving the loading and dynamic execution of the plug-in code.
[0089] In the third embodiment of step S130, the plug-in running information includes plug-in code recorded in the form of pure text;
[0090] In step S130, the following is included:
[0091] The plug-in code is loaded into a script tag of a preset hypertext editing language, and the plug-in code is dynamically executed based on the script tag.
[0092] The application subject or running front end initiates network access to the storage address (URL) of the entire code file of the dynamic plug-in, obtains the JavaScript code recorded in the form of pure text, and then places the text as content into an HTML script (Script) tag, triggers the code execution mechanism of the browser, thereby achieving the loading and dynamic execution of the plug-in code.
[0093] For example, the code for printing the "hello world" text is 'console.log("hello world")', and the dynamic execution of the code for the above text is implemented in the following manner:
[0094] let node = document.createElement('script'); / / create script node;
[0095] node.type = 'text / javascript'; / / set MIME type of node to JavaScript script;
[0096] node.innerHTML = 'console.log("hello world")'; / / set code to run;
[0097] document.body.appendChild(node); / / append node to document body tag to take effect.
[0098] After the script node is inserted into the document, the application body, running the front end of the web page, recognizes the script node, and sends the text content contained in the script node to the JavaScript engine. The JavaScript engine will parse and compile the code to obtain machine code and then run it.
[0099] In the fourth embodiment of step S130, the plug-in running information includes plug-in code recorded in plain text form;
[0100] In step S130, the plug-in running information includes plug-in code recorded in plain text form;
[0101] In the fourth embodiment of step S130, the plug-in running information includes plug-in code recorded in plain text form;
[0102] For example, the address of a code file URL is http: / / example.com / a.js, and the code file is executed in the following way:
[0103] let node = document.createElement('script'); / / create script node;
[0104] node.type = 'text / javascript'; / / set MIME type of node to JS script;
[0105] node.src='http: / / example.com / a.js'; / / set the address of the code that needs to be run;
[0106] document.body.appendChild(node) / / hang the node to the body tag of the document to take effect.
[0107] The above JS is the abbreviation of JavaScript language. After the script node is inserted into the document, the browser and the webpage will detect the time when the script node is inserted, initiate a network request to the URL address pointed by the script node, and thus obtain the text content of the code. Then the browser sends the code text to the JavaScript engine. The JavaScript engine will parse and compile the code to obtain machine code and then run it.
[0108] The technical solution provided by the application can realize the loading of the plug-in running information and the entire code in the above four ways, so that the staff has more options and diversified implementation modes when building the scheme system of the application and implementing it.
[0109] In the first to fourth implementation modes of step S130, the loading and running modes of the plug-in running information and the entire code are all advantageous, and the execution of the code block is performed through the fifth implementation mode of step S130 after the loading of the plug-in running information. The implementation modes of the dynamic plug-in running in the application are diversified, easy to operate, and more widely applicable.
[0110] In the fifth implementation mode of step S130, step S130 includes:
[0111] An immediately executed function in the plug-in code is obtained, and a function code corresponding to a return value of the immediately executed function is obtained based on the immediately executed function. The application will configure the running mechanism of each dynamic plug-in in advance, and the immediately executed function can enable the dynamic plug-in to start executing its corresponding function. The pre-configured plug-in code at least includes the immediately executed function and the function code, and the main purpose of the immediately executed function is to return the execution code, and the execution code can realize the function of the dynamic plug-in.
[0112] The webpage executes the function code. When the webpage executes the function of the dynamic plug-in, the function code fed back by the immediately executed function is implemented.
[0113] The application further provides a dynamic plug-in running device, as shown in Figure 4 The device includes:
[0114] A selecting module is configured to acquire demand information of a user in real time, and select plug-in pre-stored information based on the demand information, wherein the plug-in pre-stored information at least includes a storage address and meta information of a dynamic plug-in;
[0115] A sending module is configured to send a data request according to the storage address and the meta information, so that a back end feeds back plug-in running information according to the data request;
[0116] A running module is configured to make the dynamic plug-in run in a webpage based on the plug-in running information.
[0117] The application further provides a dynamic plug-in running system, comprising:
[0118] A running front end is configured to acquire demand information of a user in real time, select plug-in pre-stored information based on the demand information, send a data request to a back end according to the storage address and the meta information, and make the dynamic plug-in run in a webpage based on plug-in running information fed back by the back end;
[0119] A running front end is configured to acquire demand information of a user in real time, select plug-in pre-stored information based on the demand information, send a data request to a back end according to the storage address and the meta information, and make the dynamic plug-in run in a webpage based on plug-in running information fed back by the back end;
[0120] A management back end is configured to include a plug-in file management background system, generate plug-in running information according to the data request, and send the plug-in running information to the running front end.
[0121] The technical scheme of the application realizes the reuse of JavaScript code at the user side browser end through the dynamic plug-in mode, thereby improving the waste of computing and storage resources caused by repeated compilation and repeated storage of code files.
[0122] The technical scheme of the application divides the whole webpage code into two categories of main programs and plug-ins, so that the main programs can be enhanced in function through the loading and running of plug-ins during running, thereby making the webpage application have dynamic and running-time expansibility.
[0123] Wherein, the readable storage medium can be a computer storage medium or a communication medium. The communication medium includes any medium that facilitates the transfer of computer program from one place to another. The computer storage medium can be any available medium that can be accessed by a general or special purpose computer. For example, the readable storage medium is coupled to the processor, so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). In addition, the ASIC can be located in the user equipment. Of course, the processor and the readable storage medium can also exist as discrete components in the communication device. The readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk and an optical data storage device, etc.
[0124] The present application also provides a program product, which includes execution instructions stored in a readable storage medium. At least one processor of the device can read the execution instructions from the readable storage medium, and the at least one processor executes the execution instructions to make the device implement the method provided by the various embodiments described above.
[0125] In the above-mentioned embodiments of the terminal or the server, it should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC) and the like. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor and the like. The steps of the method disclosed in combination with the present application can be directly embodied as the execution of the hardware processor, or the execution of the combination of the hardware and software modules in the processor.
[0126] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the above embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for running a dynamic plugin, characterized in that, include: The system acquires user demand information in real time and selects pre-stored plugin information based on the demand information. The pre-stored plugin information includes at least the storage address and metadata of the dynamic plugin. Each pre-stored plugin information corresponds to a dynamic plugin with different functions. Receive the correspondence between the requirement information and the pre-stored information of the plugin; obtain the plugin correspondence list by mapping the requirement information to the pre-stored information of the dynamic plugin in the form of an array; embed the array in the plugin correspondence list into the code of the application body and the running front end; when the application body and the running front end are initialized and run, the pre-stored information of the plugin and the plugin correspondence list will be stored in the storage device of the user's computer system. Send a data request based on the storage address and metadata so that the backend can provide feedback on plugin operation information based on the data request; The dynamic plugin is made to run on the webpage based on the plugin's runtime information.
2. The dynamic plugin execution method according to claim 1, characterized in that, Before the step of acquiring user demand information in real time and selecting pre-stored plugin information based on the demand information, wherein the pre-stored plugin information includes at least the storage address and metadata of the dynamic plugin, the following steps are included: Store the correspondence between the received requirement information and the backend interface; Based on the aforementioned requirement information, the pre-stored information for the selected plugin includes: Select a backend interface based on the correspondence between the requirement information and the backend interface, and receive the pre-stored information of the plugin based on the backend interface.
3. The dynamic plugin running method according to claim 1, characterized in that, The plugin runtime information includes the plugin code recorded in plain text form; Running a dynamic plugin on a webpage based on the plugin's runtime information includes: The plugin code is loaded into the eval() function of a preset programming language and executed dynamically.
4. The dynamic plugin execution method according to claim 1, characterized in that, The plugin runtime information includes the plugin code recorded in plain text form; Running a dynamic plugin on a webpage based on the plugin's runtime information includes: The plugin code is loaded into the Function constructor of a preset programming language and executed dynamically.
5. The dynamic plugin running method according to claim 1, characterized in that, The plugin runtime information includes the plugin code recorded in plain text form; Running a dynamic plugin on a webpage based on the plugin's runtime information includes: The plugin code is loaded into a script tag in a preset hypertext editing language, and the plugin code is dynamically executed based on the script tag.
6. The dynamic plugin execution method according to claim 1, characterized in that, The plugin runtime information includes the plugin code recorded in plain text form; Running a dynamic plugin on a webpage based on the plugin's runtime information includes: Add a hypertext reference to the preset hypertext document, and use the hypertext reference as a script tag to dynamically execute the plugin code.
7. The dynamic plugin running method according to any one of claims 3 to 6, characterized in that, Running a dynamic plugin on a webpage based on the plugin's runtime information includes: Obtain the immediately invoked function (IIF) in the plugin code, and then obtain the functional code corresponding to the return value of the IIF; The webpage executes the aforementioned function code.
8. A dynamic plug-in running device, characterized in that, include: A selected module is used to obtain user demand information in real time, and select plugin pre-stored information based on the demand information. The plugin pre-stored information includes at least the storage address and metadata of the dynamic plugin, wherein each pre-stored plugin information corresponds to a dynamic plugin with different functions. The correspondence between received demand information and pre-stored information in the plugin; The requirement information is mapped to the pre-stored information of the dynamic plugins in the form of an array to obtain the plugin correspondence list; the array in the plugin correspondence list is embedded in the code of the application body and the running front end; when the application body and the running front end are initialized and run, the pre-stored information of the plugins and the plugin correspondence list will be stored in the storage device of the user's computer system. The sending module is used to send a data request based on the storage address and metadata so that the backend can provide feedback on the plugin's operation information based on the data request; The runtime module is used to enable the dynamic plugin to run in the webpage based on the plugin runtime information.
9. A dynamic plug-in runtime system, characterized in that, include: The front-end is used to obtain user demand information in real time, and select plugin pre-stored information based on the demand information. The plugin pre-stored information includes at least the storage address and metadata of the dynamic plugin. Data requests are sent to the backend based on the storage address and metadata, wherein each pre-stored plugin information corresponds to a dynamic plugin with different functions; Receive the correspondence between the requirement information and the pre-stored information of the plugin; obtain the plugin correspondence list by mapping the requirement information to the pre-stored information of the dynamic plugin in the form of an array; embed the array in the plugin correspondence list into the code of the application body and the running front end; when the application body and the running front end are initialized and run, the pre-stored information of the plugin and the plugin correspondence list will be stored in the storage device of the user's computer system. Dynamic plugins can run on web pages based on plugin runtime information fed back from the backend. The management backend is used to generate plugin runtime information based on the data request and send the plugin runtime information to the runtime frontend.
10. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which, when executed by a processor, is used to implement the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Browser cache management method and device and computer readable storage medium
CN110727891A