Plug-in loading method, system and device of web system and readable storage medium
By obtaining and storing plug-in source code locally in the web system, the problem of plug-in resource cache failure is solved, waiting time is reduced, and user experience and efficiency are improved.
Patent Information
- Application Number
- CN202310226035.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2024-08-27
AI Technical Summary
In the existing technology, when a web system plug-in is loaded by dynamically constructing a script language tag through an HTML file, the plug-in resource cache is invalidated, which increases the user's waiting time and reduces the user experience.
By obtaining multiple plug-in identifiers, a plug-in source code acquisition request is sent to the server, the plug-in source code is downloaded to the local database, and permanently stored in the local database to avoid expiration of plug-in resources, and the plug-in source code is directly called from the local database to implement function calls.
It reduces the time for the operation object to wait for plug-in loading, improves the access experience of the web system, and improves efficiency and applicability.
Smart Images

Figure CN118550600A
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a plug-in loading method, system, device and readable storage medium for a web system. Background Art
[0002] The plug-in architecture can separate the running program of the web system into the kernel and different plug-ins, so as to facilitate the upgrading and expansion of the web system in the future. The kernel of the web system usually only includes the minimum functions of the web system operation, while different plug-ins are independent functional modules. The kernel of the web system can abstract the basic interface based on all functional businesses to provide it to the plug-in for calling, so that the web system can load rich plug-in functions.
[0003] Generally speaking, the plug-in resources in the server can be loaded into the web system by dynamically constructing script language tags in the web system's HyperText Mark-up Language (HTML) file to implement the corresponding plug-in functions. However, when loading the web system's plug-in by dynamically constructing script tags in HTML files, since the web system can only obtain the web system resource cache of the plug-in, and the web system resource cache will become invalid in a short time, the user needs to reload the plug-in resources when accessing the web system, which increases the waiting time for accessing the web system and reduces the user experience. Summary of the invention
[0004] The embodiments of the present application provide a plug-in loading method, system, computer device and computer-readable storage medium for a web system, which can reduce the time an operation object waits for plug-in loading, improve the access experience of the web system, and have high efficiency and strong applicability.
[0005] In a first aspect, the present application provides a method for loading a plug-in of a web system, the method comprising:
[0006] Obtain multiple plug-in identifiers of the web system, and send a plug-in source code acquisition request to the server, wherein the plug-in source code acquisition request carries the multiple plug-in identifiers;
[0007] Acquire multiple plug-in source codes corresponding to the multiple plug-in identifiers and returned by the server based on the plug-in source code acquisition request, wherein one plug-in source code corresponds to one plug-in identifier;
[0008] Downloading the plurality of plug-in source codes to a local database associated with the web system, the local database being used to permanently store any of the plug-in source codes if any of the stored plug-in source codes is not deleted by the operation object;
[0009] In response to a trigger operation for calling a function of a first plug-in of the web system, obtaining a first plug-in identifier of the first plug-in based on the trigger operation, and determining a plug-in source code in the local database whose plug-in identifier matches the first plug-in identifier as the first plug-in source code of the first plug-in;
[0010] The first plug-in source code is executed to implement the function call of the first plug-in of the web system.
[0011] In a possible implementation, the obtaining of multiple plug-in identifiers of the web system includes:
[0012] In response to an access operation to a web system, the web system is initialized based on the access operation to open an access homepage of the web system, and a plug-in identifier acquisition request is sent to a server when the access homepage of the web system is opened, to obtain multiple plug-in identifiers of the web system returned by the server based on the plug-in identifier acquisition request.
[0013] In a possible implementation, sending a plug-in identification acquisition request to a server, and acquiring multiple plug-in identifications of the web system returned by the server based on the plug-in identification acquisition request, includes:
[0014] Sending the plug-in identification acquisition request to the server, triggering the server to prioritize the multiple candidate plug-in identifications and return K candidate plug-in identifications with higher priorities among the multiple candidate plug-in identifications based on the plug-in identification acquisition request, where K is a positive integer;
[0015] The K candidate plug-in identifiers fed back by the server are obtained as multiple plug-in identifiers of the web system.
[0016] In a possible implementation, downloading the plurality of plug-in source codes to a local database associated with the web system includes:
[0017] Obtain the plug-in identification number and plug-in version number of each plug-in source code based on the plug-in identification corresponding to each plug-in source code;
[0018] Based on the mapping relationship between the plug-in identification number and the plug-in version number of each plug-in source code and the plug-in source code, mapping data of the plurality of plug-in source codes are obtained;
[0019] Based on the mapping data of the above-mentioned multiple plug-in source codes, the above-mentioned multiple plug-in source codes are stored in the above-mentioned local database to complete the download of the above-mentioned multiple plug-in source codes to the local database associated with the above-mentioned web system, wherein the data type of the above-mentioned each plug-in source code stored in the above-mentioned local database is a string.
[0020] In a possible implementation, after downloading the plurality of plug-in source codes to the local database associated with the web system, the method includes:
[0021] Get an update request for any plugin in the above web system;
[0022] Obtaining the updated source code, plug-in identification number and plug-in version number of any of the plug-ins returned by the server based on the update request;
[0023] Based on the mapping data of the above-mentioned multiple plug-in source codes, the plug-in source codes in the above-mentioned multiple plug-in source codes whose plug-in identification numbers and plug-in version numbers are the same as the plug-in identification numbers and plug-in version numbers of the above-mentioned update source codes are determined as the source codes to be updated, and the above-mentioned source codes to be updated are updated based on the above-mentioned update source codes.
[0024] In a possible implementation, determining the plug-in source code whose plug-in identifier in the local database matches the first plug-in identifier as the first plug-in source code of the first plug-in includes:
[0025] Based on the first plug-in identifier of the first plug-in, obtain a plug-in identification number and a plug-in version number of the first plug-in;
[0026] Based on the plug-in identification number and plug-in version number of the above-mentioned first plug-in, the mapping data of the above-mentioned multiple plug-in source codes in the above-mentioned local database are searched, and the plug-in source code whose plug-in identification number and plug-in version number in the mapping data of the above-mentioned multiple plug-in source codes are respectively the same as the plug-in identification number and plug-in version number of the above-mentioned first plug-in is determined as the first plug-in source code of the above-mentioned first plug-in.
[0027] In a possible implementation, after obtaining the plug-in identification number and the plug-in version number of the first plug-in based on the first plug-in identification of the first plug-in, the method further includes:
[0028] Searching for mapping data of the plurality of plug-in source codes in the local database based on the plug-in identification number and the plug-in version number of the first plug-in;
[0029] If there is no plug-in source code in the mapping data of the plurality of plug-in source codes that is identical to the plug-in identification number and plug-in version number of the first plug-in, sending the plug-in identification number and plug-in version number of the first plug-in to the server;
[0030] The first plug-in source code returned by the server based on the plug-in identification number and the plug-in version number of the first plug-in is obtained; wherein the data type of the first plug-in source code is a string.
[0031] In a possible implementation, the plug-in source code includes a plurality of source code sub-files, and the plurality of source code sub-files are stored in the local database through a plurality of public paths, and one source code sub-file corresponds to one public path, including:
[0032] Building a scripting language sandbox environment, and running the first plug-in source code based on the scripting language sandbox environment to obtain a common path of multiple source code sub-files of the first plug-in source code;
[0033] The plurality of source code sub-files of the first plug-in source code are imported based on the common paths of the plurality of source code sub-files to implement function calls of the first plug-in of the web system.
[0034] In a second aspect, the present application also provides a web system, including:
[0035] An identification acquisition module is used to acquire multiple plug-in identifications of the web system and send a plug-in source code acquisition request to the server, wherein the plug-in source code acquisition request carries the multiple plug-in identifications;
[0036] A source code acquisition module, used to acquire a plurality of plug-in source codes corresponding to the plurality of plug-in identifiers and returned by the server based on the plug-in source code acquisition request, wherein one plug-in source code corresponds to one plug-in identifier;
[0037] A source code storage module, used for downloading the plurality of plug-in source codes to a local database associated with the web system, the local database being used for permanently storing any of the plug-in source codes if the stored plug-in source codes are not deleted by the operation object;
[0038] a determination module, configured to respond to a trigger operation of a function call on a first plug-in of a web system, obtain a first plug-in identifier of the first plug-in based on the trigger operation, and determine a plug-in source code in the local database whose plug-in identifier matches the first plug-in identifier as the first plug-in source code of the first plug-in;
[0039] The execution module is used to execute the first plug-in source code to implement the function call of the first plug-in of the web system.
[0040] The identification acquisition module includes:
[0041] An initialization unit is used to respond to an access operation to a web system, initialize the web system based on the access operation to open an access homepage of the web system, and send a plug-in identifier acquisition request to a server when the access homepage of the web system is opened, and obtain multiple plug-in identifiers of the web system returned by the server based on the plug-in identifier acquisition request.
[0042] The identification acquisition module further includes:
[0043] an identification request unit, configured to send the plug-in identification acquisition request to the server, triggering the server to prioritize the multiple candidate plug-in identifications and return K candidate plug-in identifications with higher priorities among the multiple candidate plug-in identifications based on the plug-in identification acquisition request, where K is a positive integer;
[0044] The identifier determining unit is used to obtain the K candidate plug-in identifiers fed back by the server as multiple plug-in identifiers of the web system.
[0045] The source code storage module includes:
[0046] An identification number acquisition unit, used to acquire a plug-in identification number and a plug-in version number of each plug-in source code based on the plug-in identification corresponding to each plug-in source code;
[0047] A mapping unit, configured to obtain mapping data of the plurality of plug-in source codes based on a mapping relationship between a plug-in identification number and a plug-in version number of each plug-in source code and the plug-in source code;
[0048] A downloading unit is used to store the above-mentioned multiple plug-in source codes to the above-mentioned local database based on the mapping data of the above-mentioned multiple plug-in source codes, so as to complete the download of the above-mentioned multiple plug-in source codes to the local database associated with the above-mentioned web system, wherein the data type of the above-mentioned each plug-in source code stored in the above-mentioned local database is a string.
[0049] The source code storage module further includes:
[0050] An updating unit, used to obtain an update request for any plug-in in the above web system;
[0051] Obtaining the updated source code, plug-in identification number and plug-in version number of any of the plug-ins returned by the server based on the update request;
[0052] Based on the mapping data of the above-mentioned multiple plug-in source codes, the plug-in source codes in the above-mentioned multiple plug-in source codes whose plug-in identification numbers and plug-in version numbers are the same as the plug-in identification numbers and plug-in version numbers of the above-mentioned update source codes are determined as the source codes to be updated, and the above-mentioned source codes to be updated are updated based on the above-mentioned update source codes.
[0053] The identification number acquisition unit is further used for:
[0054] Based on the first plug-in identifier of the first plug-in, obtain a plug-in identification number and a plug-in version number of the first plug-in;
[0055] The above-mentioned determination module includes:
[0056] A search unit is used to search the mapping data of the above-mentioned multiple plug-in source codes in the above-mentioned local database based on the plug-in identification number and the plug-in version number of the above-mentioned first plug-in, and determine the plug-in source code whose plug-in identification number and plug-in version number in the mapping data of the above-mentioned multiple plug-in source codes are respectively the same as the plug-in identification number and the plug-in version number of the above-mentioned first plug-in as the first plug-in source code of the above-mentioned first plug-in.
[0057] The above-mentioned determination module further includes:
[0058] a judgment unit, configured to send the plug-in identification number and plug-in version number of the first plug-in to the server when there is no plug-in source code identical to the plug-in identification number and plug-in version number of the first plug-in in the mapping data of the plurality of plug-in source codes;
[0059] The acquiring unit is used to acquire the first plug-in source code returned by the server based on the plug-in identification number and the plug-in version number of the first plug-in; wherein the data type of the first plug-in source code is a string.
[0060] The execution module includes:
[0061] A public path acquisition unit, used to construct a scripting language sandbox environment, and run the first plug-in source code based on the scripting language sandbox environment to obtain a public path of multiple source code sub-files of the first plug-in source code;
[0062] The importing unit is used to import the multiple source code sub-files of the first plug-in source code based on the common paths of the multiple source code sub-files to implement the function call of the first plug-in of the web system.
[0063] In a third aspect, the present application further provides a computer device, including: a processor, a memory, and a network interface;
[0064] The above-mentioned processor is connected to the above-mentioned memory and the above-mentioned network interface, wherein the above-mentioned network interface is used to provide a data communication function, the above-mentioned memory is used to store program code, and the above-mentioned processor is used to call the above-mentioned program code to execute the method in the embodiment of the present application.
[0065] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method in the embodiment of the present application is executed.
[0066] In the plug-in loading method of the web system provided in the embodiment of the present application, by obtaining multiple plug-in identifiers corresponding to multiple plug-in source codes of the web system, wherein one plug-in identifier corresponds to one plug-in source code, a plug-in source code acquisition request carrying multiple plug-in identifiers can be generated, and the plug-in source code acquisition request can be sent to the server. It can be understood that the server includes multiple candidate plug-in source codes. The server can, based on the plug-in source code acquisition request sent by the web system, use the candidate plug-in source code whose plug-in identifier matches the multiple plug-in identifiers of the plug-in source code acquisition request as the plug-in source code of the web system in the multiple candidate plug-in source codes, and return the multiple plug-in source codes corresponding to the multiple plug-in identifiers to the web system. Further, after receiving the above-mentioned multiple plug-in source codes, the web system can download the multiple plug-in source codes to the local database of the web system, thereby completing the preloading of the plug-in resources of the web system. Among them, the plug-in resources stored in the local database will be permanently stored if the operation object is not manually deleted, that is, there will be no invalidation. Further, when the operation object triggers the web system to call the function of the first plug-in, the web system can search for multiple plug-in source codes in the local database based on the first plug-in identifier of the first plug-in, so as to determine the plug-in source code whose plug-in identifier matches the first plug-in identifier in the multiple plug-in source codes as the first plug-in source code of the first plug-in. Furthermore, the function call of the first plug-in can be realized by executing the first plug-in source code. Since the embodiment of the present application stores the plug-in resources through the local database, there is no situation where the plug-in resources expire and become invalid. Therefore, when the operation object accesses the web system again after a long time, the web system can directly execute the plug-in source code in the local database to call the function of the corresponding plug-in. It can be seen that the plug-in loading method of the web system provided by the embodiment of the present application can reduce the time for the operation object to wait for the plug-in to load, improve the access experience of the web system, and has high efficiency and strong applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0068] Figure 1It is a schematic diagram of a system architecture provided by an embodiment of the present application;
[0069] Figure 2 This is a flow chart of a method for loading a plug-in in a web system provided in an embodiment of the present application;
[0070] Figure 3 It is a schematic diagram of a framework of a method for loading a plug-in of a web system provided in an embodiment of the present application;
[0071] Figure 4 This is another flowchart of a method for loading a plug-in in a web system provided in an embodiment of the present application;
[0072] Figure 5 This is another flowchart of a method for loading a plug-in in a web system provided in an embodiment of the present application;
[0073] Figure 6 It is another schematic diagram of a framework of a plug-in loading method of a web system provided in an embodiment of the present application;
[0074] Figure 7 It is another schematic diagram of the framework of the plug-in loading method of the web system provided in the embodiment of the present application;
[0075] Figure 8 It is another schematic diagram of the framework of the plug-in loading method of the web system provided in the embodiment of the present application;
[0076] Fig. 9 It is a structural diagram of a web system provided in an embodiment of the present application;
[0077] Fig.10 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0078] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0079] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources in a wide area network or local area network to achieve data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool and be used on demand, which is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, image websites and more portal websites. With the rapid development and application of the Internet industry, each item may have its own identification mark in the future, and all need to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.
[0080] Among them, cloud storage is a new concept extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as the storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
[0081] At present, the storage method of the storage system is: create a logical volume, and when creating the logical volume, allocate physical storage space for each logical volume, and the physical storage space may be composed of disks of a certain storage device or several storage devices. The client stores data on a certain logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.
[0082] The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the capacity of the actual objects to be stored) and the grouping of independent redundant disk arrays (RAID), the physical storage space is divided into stripes in advance. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.
[0083] Database, in short, can be regarded as an electronic filing cabinet - a place to store electronic files, where users can add, query, update, delete, and other operations on the data in the files. The so-called "database" is a collection of data that is stored together in a certain way, can be shared with multiple users, has as little redundancy as possible, and is independent of the application. Database Management System (DBMS) is a computer software system designed for managing databases, generally with basic functions such as storage, interception, security, and backup. Database management systems can be classified according to the database model it supports, such as relational, Extensible Markup Language (XML); or according to the type of computer supported, such as server clusters, mobile phones; or according to the query language used, such as Structured Query Language (SQL), XQuery; or according to the performance impulse focus, such as maximum scale, maximum operating speed; or other classification methods. Regardless of the classification method used, some DBMS can cross categories, for example, supporting multiple query languages at the same time.
[0084] The solution provided in the embodiment of the present application involves cloud storage technology and database technology of cloud technology, which is specifically described by the following embodiment. Figure 1 , Figure 1 Schematic diagram of a system architecture provided by an embodiment of the present application. Figure 1As shown, the system architecture may include a business server 100 and a terminal cluster, and the terminal cluster may include: terminal devices 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n and the like. Among them, the above-mentioned business server 100 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud database, cloud service, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and big data and artificial intelligence platform. The terminal device (including terminal device 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n) may be a handheld computer, a smart phone, a laptop computer, a desktop computer, a tablet computer, a mobile Internet device (mobile internet device, MID), a wearable device (such as a smart watch, a smart bracelet, etc.), a smart computer, a smart car and the like, but is not limited thereto. Among them, the business server 100 can establish a communication connection with each terminal device in the terminal cluster, and a communication connection can also be established between each terminal device in the terminal cluster. In other words, the business server 100 can establish a communication connection with each terminal device in the terminal device 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n. For example, a communication connection can be established between the terminal device 200a and the business server 100. A communication connection can be established between the terminal device 200a and the terminal device 200b, and a communication connection can also be established between the terminal device 200a and the terminal device 200c. Among them, the above-mentioned communication connection does not limit the connection method, and can be directly or indirectly connected through a wired communication method, or can be directly or indirectly connected through a wireless communication method, etc., which can be determined according to the actual application scenario, and this application is not limited here.
[0085] It should be understood that Figure 1 Each terminal device in the terminal cluster shown in the figure can be installed with a web system. When the web system runs in each terminal device, it can be respectively connected to the above Figure 1The business servers 100 shown are used for data interaction, so that the business server 100 can receive business data from each terminal device, or the business server 100 can push business data (such as plug-in resources, web multimedia resources) to each terminal device. Among them, the above-mentioned web system can be a browser application, news application, learning application, social application, instant messaging application, live broadcast application, short video application, video application, music application, shopping application, novel application, payment application and other information management systems with data information functions such as display text, images and videos, which can be determined according to the actual application scenario requirements, and are not limited here. Among them, the web system can be an independent information management system, or it can be an embedded subsystem integrated in a certain information management system (such as a browser application, a social application, etc.), which can be determined according to the actual application scenario, and are not limited here. For the convenience of description, the embodiment of the present application takes the browser application (hereinafter referred to as the browser) as an example for simple explanation. In the process of using the browser through the terminal device, each operation object can view, click, collect and share different web multimedia resources on the browser through the terminal device. It can be understood that the above-mentioned web multimedia resources can be any kind of multimedia data, which can specifically include but not limited to audio, pictures or videos, etc., which can be determined according to the actual application scenario and are not limited here. The business server 100, as a server that provides web multimedia resources to the browser, can be a collection of multiple servers including a background server and a data processing server corresponding to the web system. Furthermore, in order to enrich the browsing experience and meet different functional requirements, the browser can expand the functions of the browser by loading different plug-ins. A plug-in is a program written in accordance with a certain specification of the application program interface. There are many types of plug-ins. After installing the relevant plug-ins, the browser can directly call the installed plug-in program to process specific types of files. For example, the plug-in functions of the browser may include: blocking web ads, beautifying web pages, translating words, collecting web pictures, etc.
[0086] It should be understood that the business server 100 can be used as a server that provides plug-in resources to the browser, and the browser can achieve rich extended functions by loading different plug-in resources. Specifically, the business server 100 can receive a plug-in resource request from each terminal device, and based on the plug-in resource request of each terminal device, search for a plug-in resource that matches the plug-in resource request in the plug-in resource database of the business server 100. The business server 100 can return the matching plug-in resource to the terminal device requesting the plug-in resource. The above-mentioned web system can be a browser for displaying web multimedia resources to the operation object. Specifically, the browser can generate a corresponding plug-in resource request based on the click operation of the operation object on the target website and send it to the above-mentioned business server 100. Further, the above-mentioned browser can also receive the plug-in resource returned by the business server 100, and load it based on the plug-in resource to realize the plug-in function of the browser.
[0087] It should be understood that the plug-in architecture in the web system, also known as the microkernel architecture, is a scalable architecture that is split for functions. The plug-in architecture of the web system includes a system kernel and multiple plug-ins, wherein the kernel of the web system is usually only used to implement the basic functions of the system operation, such as the plug-in operation for managing the system. The multiple plug-ins of the web system are independent modules, and each plug-in can provide a single plug-in function. Further, the kernel of the web system obtains the plug-in interface with the smallest granularity by abstracting all the services to be completed, and provides the plug-in interface to the plug-in for calling, thereby greatly improving the development efficiency of the plug-in. For example, the above-mentioned browser can be used as a plug-in architecture, and the browser itself is the kernel in the plug-in architecture. When the operation object accesses the browser, the kernel of the browser can first be triggered to run to obtain the basic functions of the browser, such as displaying the browser homepage and providing related web page links. It can be understood that running the core code (i.e., the kernel) of the above-mentioned browser can run the browser into an initialized state. Furthermore, in order to make the browser have more abundant functions, after running the core code of the browser and realizing the basic functions of the browser, the browser can insert various browser plug-ins into the browser system through the Application Programming Interface (API), that is, the above-mentioned plug-in interface, so that the browser can call each plug-in to realize rich plug-in functions. In general, the web system retains a stable kernel with the minimum functions required for the operation of the system, and separates the remaining functions from the kernel of the web system in a plug-in manner. The core code for realizing basic functions in the web system can run independently, and when running the core code of the web system, according to the access of the operation object to the web system, the corresponding plug-in resources are downloaded through the above-mentioned API, and the plug-in resources are dynamically loaded to realize the plug-in functions.
[0088] It is understandable that in order to enable the web system to obtain the plug-in resources in the plug-in resource database of the business server 100, so as to load the plug-in resources to realize the plug-in function during the operation of the web system, the plug-in resources in the plug-in resource database of the business server 100 can be downloaded by dynamically constructing a scr i pt tag in the HTML file of the web system. Specifically, an HTML file refers to a file that can be read by a variety of web systems (such as a browser) to generate a web page to transmit various web page resources (i.e., the above-mentioned web page multimedia resources). Usually, HTML files are stored on hard disks distributed on various servers, and the web system can remotely obtain the web page multimedia resources conveyed by the HTML files stored in the business server through a transmission protocol. The web system can parse HTML files to display web page content. For example, when the operating object uses a browser to browse web pages on the Internet, the browser can automatically complete the conversion of HTML files to web pages. Furthermore, it can be seen from the above content that after the web system runs the core code to implement the basic functions of the system, it can parse the HTML file of the web system, dynamically construct a script tag, and request the corresponding plug-in resource from the business server 100 based on the script tag. The plug-in resource obtained by the dynamic request based on the script tag is usually a JavaScript code. When the plug-in resource of the web system is ready, the web system can automatically execute the JavaScript code in the plug-in resource, and then the operation object can use the plug-in function in the web system. Among them, since the process of obtaining the plug-in resource through the script tag and executing the plug-in resource are coupled together, the web system can only cache the product after the plug-in resource is executed, but cannot download the original JavaScript code.
[0089] It should be understood that when the operation object first accesses the web system, since it has not been accessed before, the system cache of the web system does not store any plug-in resources required for the operation object to access the web system. Therefore, when the operation object first accesses the web system, the web system needs to request the corresponding plug-in resources from the business server 100, and cache the product of the plug-in resources to the system cache of the web system after executing the plug-in resources. It can be seen that when the operation object first accesses the web system, it needs to wait for the plug-in of the web system to load, and there is a delay in page loading. It is understandable that the plug-in resources dynamically loaded by the web system based on the script tag in the HTML file will be stored in the system cache. Since the system cache of the web system is temporarily stored, when the cached process is closed, the resources in the system cache will be cleared, or after a certain period of time, the cache of the web system will become invalid, and the resources in the system cache will also be cleared. Further, when the cache of the web system is not invalid, the operation object accesses the web system again, and the web system can directly call the cached plug-in resources from the system cache for execution without requesting the plug-in resources of the business server 100, thereby saving the time for the web system to request the plug-in resources from the business server 100 and improving the user experience of the operation object. However, after a period of time (the specific time is related to the cache expiration time of the web system, which is not limited here), the system cache of the web system expires, and when the operation object accesses the web system, since the plug-in resources in the web system cache have been cleared, the web system needs to request the business server 100 to obtain the plug-in resources again, and only after the plug-in resources are successfully obtained can the plug-in resources be executed to implement the plug-in function. It can be seen that the invalidation of the web system cache will cause the operation object to wait for the loading of the plug-in resources when accessing the web system, which reduces the user experience. In addition, the plug-in resources of the web system will be updated. When the operation object accesses the web system again, since the plug-in resources in the system cache of the web system have expired or have not been updated, after the plug-in resources are updated, the web system still needs to request the business server 100 to obtain the updated plug-in resources. It can be seen that after the web system has undergone a technical upgrade, the operating object needs to wait for the loading of plug-in resources when accessing the web system, which in turn loses a lot of user experience.
[0090] Generally speaking, the operation object needs to wait for the plug-in resource of the web system to load when accessing the web system for the first time, and because the plug-in resource is dynamically loaded through the script tag in the HTML file, and the two steps of executing the plug-in resource are coupled together, the web system can only store the product after the plug-in resource is executed to the system cache of the web system, and the system cache will fail after a period of time, so that the operation object still needs to wait for the plug-in to load when re-accessing the web system, and the user experience is poor. In addition, since the product after the plug-in resource (i.e., the above-mentioned JavaScript code) is executed may contain complex data such as object data type (Object), and the local database of the web system can only store string type data. Therefore, if the product after the plug-in resource is executed is downloaded to avoid cache failure, the object data type in the plug-in resource execution product needs to be converted to a string type. However, the problem of losing data precision occurs when the data type is converted. It can be seen from this that the plug-in resource dynamically loaded by the web system through the script tag cannot be permanently stored.
[0091] It is understandable that in the specific implementation of this application, related data such as object information is involved. When the embodiments of this application are applied to specific products or technologies, it is necessary to obtain the object's permission or consent, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0092] The plug-in loading method of the web system provided in the embodiment of the present application is applicable to the plug-in loading in the information management system (such as the above-mentioned browser). It is understandable that the terminal equipment to which the plug-in loading method of the above-mentioned web system is applicable includes but is not limited to smart phones, computers, tablet computers, personal digital assistants (PDA), mobile Internet devices (MID) and wearable devices. Optionally, the terminal equipment can also be the server corresponding to the above-mentioned smart phones, computers, tablet computers, PDAs, MIDs and wearable devices, etc., which can be specifically determined according to the actual application scenario and is not limited here. Correspondingly, the web page identification processing device provided in the embodiment of the present application includes but is not limited to smart phones, computers, tablet computers, PDAs, MIDs and wearable devices, etc. For the convenience of description, the web system and / or terminal equipment provided in the embodiment of the present application will be described by taking smart phones (or simply mobile phones) as an example.
[0093] It is understandable that the web system plug-in loading method provided in the embodiment of the present application can be implemented as follows: Figure 1The service server 100 shown in the figure may also be executed by a terminal device (such as Figure 1 The example embodiment of the present invention can be executed by any one of the terminal devices 200a, 200b, ..., 200n shown in the figure), or by the terminal device and the service server together. The specific implementation can be determined according to the actual application scenario and is not limited here. Figure 1 A terminal device is selected from the terminal device cluster as a target terminal device, for example, the terminal device 200b is selected as the target terminal device.
[0094] In the plug-in loading method of the web system provided in the embodiment of the present application, when the operation object first accesses the web system, the web system completes initialization and generates a plug-in identification acquisition request after accessing the homepage and sends it to the server. The server can return multiple plug-in identifications corresponding to multiple plug-in source codes preloaded by the web system based on the plug-in identification acquisition request, wherein one plug-in identification corresponds to one plug-in source code. Among them, the server can sort according to the priority of multiple candidate plug-in identifications, and determine the K candidate plug-in identifications with higher priority among the multiple candidate plug-in identifications as multiple plug-in identifications of the web system according to the above plug-in identification acquisition request. Further, after obtaining multiple plug-in identifications, the web system can generate a plug-in source code acquisition request carrying multiple plug-in identifications and send it to the server. It can be understood that the server includes multiple candidate plug-in source codes. The server can use the plug-in source code acquisition request sent by the web system as the plug-in source code of the web system, and return multiple plug-in source codes corresponding to multiple plug-in identifications to the web system. It can be understood that after receiving the above multiple plug-in source codes, the web system can download the multiple plug-in source codes to the local database of the web system. Specifically, the mapping data of multiple plug-in source codes can be obtained, and the multiple plug-in source codes can be stored in the local database of the web system based on the mapping data of the multiple plug-in source codes, thereby completing the preloading of the plug-in resources of the web system. Further, when the operation object accesses other web pages of the web system and triggers the web system to call the function of the first plug-in, the web system can search for multiple plug-in source codes in the local database based on the first plug-in identifier of the first plug-in, so as to determine the plug-in source code matching the plug-in identifier with the first plug-in identifier as the first plug-in source code of the first plug-in according to the mapping data of the multiple plug-in source codes. Further, the function call of the first plug-in can be realized by executing the first plug-in source code. In the embodiment of the present application, the web system preloads the plug-in resources after generating the access homepage, so even if the operation object is accessing the web system for the first time, when the web system calls the plug-in function later, the web system can directly execute the plug-in source code in the local database without waiting for the web system to download the plug-in source code before executing. In addition, since the embodiment of the present application stores the plug-in resources through the local database, there is no situation where the plug-in resources expire and become invalid. Therefore, when the operation object accesses the web system again after a long time, the web system can directly execute the plug-in source code in the local database to call the function of the corresponding plug-in. It can be seen that the plug-in loading method of the web system provided in the embodiment of the present application can reduce the time the operation object waits for the plug-in to load, improve the access experience of the web system, and has high efficiency and strong applicability.
[0095] The plug-in loading method of the web system provided in the embodiment of the present application can be applied to various types of plug-in loaded applications, wherein the above-mentioned applications for various types of plug-in loading processing include but are not limited to: multimedia applications, browser applications, game applications, shopping applications, tool applications, social applications, travel applications, and educational applications, etc., which have application clients that implement different plug-in functions, and are not limited here. Among them, the above-mentioned applications of the same type may include multiple applications, which are not limited here. For example, the above-mentioned multimedia applications may include movie players, music players, photography applications, photo applications, and audio recording applications. The above-mentioned shopping applications include but are not limited to movie ticket purchase applications, food reservation applications, and daily necessities purchase applications. The above-mentioned tool applications include but are not limited to file editing, email, alarm clock, calendar, album, settings, and compass, etc.
[0096] For further information, see Figure 2 , Figure 2 1 is a flow chart of a method for loading a plug-in of a web system provided in an embodiment of the present application. Figure 1 The terminal device 200b in the example is described, and the service server can be the above Figure 1 The business server 100 of the corresponding embodiment. The embodiment of the present application can be applied to various scenarios, including but not limited to cloud technology, cloud storage, etc. Figure 2 In the web system plug-in loading method shown in FIG. 1 , each step of loading a web system plug-in can be performed as described above. Figure 1 The terminal device 200b in the embodiment is executed as follows: Figure 2 As shown, the plug-in loading method of the web system may at least include the following steps S101 to S104.
[0097] Step S101: Acquire multiple plug-in identifiers of a web system, and send a plug-in source code acquisition request to a server.
[0098] In some feasible implementations, it can be seen from the above content that the web system can realize rich extended functions by loading different plug-ins. Since the web system can load various types of plug-ins, in order to correctly call the corresponding plug-in functions and upgrade resources for different plug-ins, plug-in identifiers can be added to each plug-in of the web system so that the web system and the business server 100 can distinguish different plug-ins. Specifically, a plug-in has a specific plug-in identifier, which can be understood as information used to distinguish different plug-ins. Further, the plug-in identifier can include the account information and plug-in model of the plug-in. When the web system calls the plug-in, it can find the plug-in resource carrying the plug-in identifier according to the plug-in identifier that needs to be called, so as to load the plug-in resource to realize the corresponding plug-in function. It can be seen from the above content that when the operation object first accesses the web system, the process of waiting for the web system to load the plug-in will reduce the access experience of the operation object. To this end, the plug-in loading method of the web system provided in the embodiment of the present application can reduce the time waiting for the web system to load the plug-in and improve the access experience of the operation object by automatically triggering the preloading of the plug-in resource when the operation object accesses the web system.
[0099] In some feasible implementations, the plug-in loading method of the web system provided in the embodiment of the present application can obtain multiple plug-in identifiers of the web system through the following content. Specifically, first, when the operating object accesses the web system, it can respond to the access operation for the web system and generate a corresponding initialization signal, which can be understood as being used to initialize the web system. Further, the web system can be initialized according to the above initialization signal to obtain the access homepage of the web system. The access homepage of the web system refers to the first page displayed to the operating object after the web system is opened, which can also be called a landing page. The access homepage of the web system can be a homepage, which is used to attract the attention of the visitor (operating object) and present the important content of the web system. For example, in order to facilitate the operating object to access other web pages, the browser's access homepage usually provides links to important pages and new articles of the browser, and a search box is attached to the access homepage to guide the operating object to access more other web page content. In addition, when the operating object opens the web system, the first page displayed by the web system (i.e., the above landing page) can also be a login page in addition to the homepage of the web system. Different from the access homepage displayed by the web system when the operation object directly accesses the web system, the operation object can also enter the landing page of the web system by clicking on the link of other web pages. For example, the operation object sees an advertisement of interest on the website, and can click on the advertisement to link to other websites. Since the operation object visits the website based on specific needs (advertisements), the website can set up a landing page that presents targeted information to meet the needs of the operation object, such as displaying coupon information of the goods in the advertisement on the landing page to attract the operation object to consume. It is understandable that when the operation object accesses the web system, in order to quickly complete the initialization to load the access homepage of the web system, the web system can realize system initialization through the built-in function, that is, the system is initialized by running the core code of the web system. Similarly, the source code resources of the access homepage of the web system can be stored in the local database of the web system to facilitate the web system to quickly render the access homepage.
[0100] In some feasible implementations, when the operation object accesses the web system, it can access other web pages of the web system through the access homepage of the web system. When the operation object performs access operations on other web pages of the web system, it can be seen from the above content that the web system can meet the functional requirements of accessing the web system by calling different plug-ins. Further, the plug-in loading method of the web system provided in the embodiment of the present application can preload the plug-in resources of the web system, so that the operation object does not have to wait for the web system to load the plug-in resources, thereby improving the access efficiency. When the operation object accesses the web system, it can be seen from the above content that first, the web system can be initialized based on the access operation to obtain the access homepage of the web system. The web system can load the core code of the web system in the initialization stage, and preload the plug-in resources of the web system when the access homepage of the web system is opened. Specifically, the web system can send a plug-in identification acquisition request to the server to obtain multiple plug-in identifications of the web system returned by the server based on the plug-in identification acquisition request. Further, the server stores multiple candidate plug-in identifications of the web system, and the candidate plug-in identification can be understood as information used to distinguish different plug-ins, and a candidate plug-in identification is used to characterize a type of plug-in. It is understandable that different types of web systems may call different plug-ins, and different types of web systems may preload different plug-in resources. Therefore, when preloading plug-in resources of a web system, a plug-in identification acquisition request may be sent to a server, and the server searches among multiple stored candidate plug-in identifications based on the type information of the web system included in the plug-in identification acquisition request to determine at least one candidate plug-in identification as a plug-in identification, and returns the plug-in identification to the web system.
[0101] In a feasible implementation, the server may sort the stored multiple candidate plug-in identifiers, and when obtaining the plug-in identifier acquisition request sent by the web system, at least one candidate plug-in identifier that is ranked earlier or later from the multiple candidate plug-in identifiers is determined as the plug-in identifier of the web system according to the plug-in identifier acquisition request. Specifically, the server may obtain the priority of each candidate plug-in identifier, and sort the stored multiple candidate plug-in identifiers in sequence according to the priority of each candidate plug-in identifier. Among them, the priority of the candidate plug-in identifier can be understood as the importance of the plug-in corresponding to the candidate plug-in identifier among all the plug-ins called by the web system. The higher the priority of the candidate plug-in identifier, the higher the importance of the plug-in corresponding to the candidate plug-in identifier, and the lower the priority of the candidate plug-in identifier, the lower the importance of the plug-in corresponding to the candidate plug-in identifier. It can be understood that the plug-in that is called more frequently in the web system will have a higher importance than other plug-ins that are less frequently called. For ease of understanding, the embodiment of the present application is briefly explained by taking the browser plug-in loading as an example.
[0102] In some feasible implementations, it can be seen from the above content that the candidate plug-in identifier or plug-in identifier can be used to characterize different types of plug-ins, and a candidate plug-in identifier (plug-in identifier) characterizes a plug-in. For example, the multiple candidate plug-in identifiers stored by the server may include a first candidate plug-in identifier, a second candidate plug-in identifier, a third candidate plug-in identifier, a fourth candidate plug-in identifier, a fifth candidate plug-in identifier, a sixth candidate plug-in identifier, and a seventh candidate plug-in identifier. Among them, the first candidate plug-in identifier can be used to characterize an interception plug-in, the second candidate plug-in identifier can be used to characterize a night mode plug-in, the third candidate plug-in identifier can be used to characterize a screenshot plug-in, the fourth candidate plug-in identifier can be used to characterize a language translation plug-in, the fifth candidate plug-in identifier can be used to characterize a multimedia resource download plug-in, the sixth candidate plug-in identifier can be used to characterize a browsing record plug-in, and the seventh candidate plug-in identifier can be used to characterize a web page beautification plug-in. Among them, the above-mentioned interception plug-in is used to intercept advertisements or junk information in a web page. The above-mentioned night mode plug-in can be used to adjust the color, brightness, and contrast of the page, so that the operating object can obtain a comfortable browsing experience when using a browser in different environments. The above-mentioned language translation plug-in is used to translate foreign languages and display the translation results. The operating object may need to use a language translation plug-in for translation when using a browser to visit a foreign website. The above-mentioned multimedia resource download plug-in is used to download and manage all multimedia resources in the browser, such as music resources and picture resources, and can be sorted and classified according to the type of multimedia resources. The operating object often calls the multimedia resource download plug-in to download and manage multimedia resources when using the browser. The above-mentioned browsing record plug-in is used to detect the access behavior of the operating object on different web pages of the browser, and generate corresponding browsing records in the form of charts, which is convenient for the operating object to view and summarize. The above-mentioned web page beautification plug-in is used to extract the content in the browser page and reorganize it into an interface that is more suitable for the operating object to read. It is understandable that the server can also store candidate plug-in identifiers of more other types of plug-ins, and this application does not give examples one by one here.
[0103] In some feasible implementations, the server can obtain the priority of each candidate plug-in identifier according to the importance of multiple plug-ins represented by multiple candidate plug-in identifiers. For example, in the process of using a browser to access a website, it is often necessary to download and manage different types of multimedia resources, that is, the browser often calls the multimedia resource download plug-in, so the fifth candidate plug-in identifier corresponding to the multimedia resource download plug-in has a higher priority. In addition, when visiting a foreign website, it is often necessary to translate the content of the web page. At this time, the browser needs to call the above-mentioned language translation plug-in, so the fourth candidate plug-in identifier corresponding to the language translation plug-in has a higher priority. Further, in order to improve the user experience of the operation object, the browser can also call the above-mentioned web page beautification plug-in to adjust the content of the web page, so the seventh candidate plug-in identifier corresponding to the web page beautification plug-in has a higher priority. It can be understood that when the operation object accesses the browser, it is less likely to take the initiative to check the browsing records of accessing different web pages, that is, the browser rarely calls the browsing record plug-in, so the sixth candidate plug-in identifier corresponding to the browsing record plug-in has a lower priority. In addition, the operation object often retains the original usage habits, and rarely adjusts the color and contrast of the browser page, that is, the browser rarely calls the night mode plug-in, so the second candidate plug-in identifier corresponding to the night mode plug-in has a lower priority. It is understandable that the priorities of multiple candidate plug-in identifiers can be obtained according to different actual application scenarios, and this application does not limit this. Further, when the server receives the above plug-in identifier acquisition request sent by the browser, the server can prioritize the multiple candidate plug-in identifiers according to their priorities. It is understandable that the arrangement order of the above multiple candidate plug-in identifiers can be adjusted according to actual applications, and this application does not limit this.
[0104] In some feasible implementations, in order to avoid the impact of too many plug-in resources preloading on the browser, the server can obtain a request for the plug-in identification sent by the browser, and send the candidate plug-in identification with a higher priority among the stored multiple candidate plug-in identifications as the plug-in identification to the browser, so that the browser preloads the plug-in resources with a higher degree of importance according to the plug-in identification. Specifically, the server obtains the request for the plug-in identification, determines the K candidate plug-in identifications with a higher priority among the multiple candidate plug-in identifications after priority sorting as the multiple plug-in identifications of the browser and returns them to the browser. For example, in some application scenarios, the server can prioritize the multiple candidate plug-in identifications according to the importance of the multiple plug-ins illustrated above, so as to obtain the following ranking: the fifth candidate plug-in identification (multimedia resource download plug-in), the first candidate plug-in identification (interception plug-in), the fourth candidate plug-in identification (language translation plug-in), the seventh candidate plug-in identification (webpage beautification plug-in), the third candidate plug-in identification (screenshot plug-in), the sixth candidate plug-in identification (browsing record plug-in), and the second candidate plug-in identification (night mode plug-in). Among them, the fifth candidate plug-in identification has the highest priority, and the second candidate plug-in identification has the lowest priority. It can be understood that the arrangement order of the above multiple candidate plug-in identifications can be adjusted according to the actual application, and this application is not limited here. Further, assuming that K=3, the server can use the top three candidate plug-in identifiers in the above multiple candidate plug-in identifiers as the plug-in identifiers of the browser. It is understandable that after the browser obtains the three plug-in identifiers returned by the server, it can generate a plug-in resource request carrying the above three plug-in identifiers, and send the plug-in resource request to the corresponding server to obtain the plug-in resources of the three plug-ins corresponding to the three plug-in identifiers, thereby completing the preloading of the plug-in resources. It is understandable that the value of K can be adjusted according to the actual application scenario, and this application does not limit it here.
[0105] For some possible implementations, see Figure 3 , Figure 3 FIG. 1 is another schematic diagram of a web system plug-in loading method provided in an embodiment of the present application. Figure 3 As shown, in the plug-in loading method of the web system provided in the embodiment of the present application, when the operation object accesses the web system, triggering the web system to complete initialization and generate an access homepage, the web system can generate a corresponding plug-in identification acquisition request and send it to the server. From the above content, it can be seen that the server can store multiple candidate plug-in identifications, and the above multiple candidate plug-in identifications can include a first candidate plug-in identification, a second candidate plug-in identification, a third candidate plug-in identification, a fourth candidate plug-in identification, etc. When the server receives the plug-in identification acquisition request, the server can use the candidate plug-in identification with a higher priority among the above multiple candidate plug-in identifications as the plug-in identification of the web system according to the plug-in identification acquisition request. For example, Figure 3 As shown, assuming that the server determines the above-mentioned first candidate plug-in identifier, the second candidate plug-in identifier and the third candidate plug-in identifier as the first plug-in identifier, the second plug-in identifier and the third plug-in identifier of the web system according to the plug-in identifier acquisition request, the server can return the above-mentioned multiple plug-in identifiers to the web system. Further, the web system can request corresponding plug-in resources (such as the first plug-in source code, the second plug-in source code and the third plug-in source code) from the server according to the multiple plug-in identifiers and store them. When the web system needs to call the first plug-in, the web system can load the first plug-in source code in the preloaded plug-in resources, thereby realizing the call of the first plug-in function. It can be understood that since the plug-in loading method of the web system provided in the embodiment of the present application preloads the plug-in resources of the web system after the web system is initialized and generates the access homepage, the web system can directly load the plug-in source code when accessing the plug-in without waiting, which can improve the efficiency of accessing the web system.
[0106] Step S102: Acquire multiple plug-in source codes corresponding to multiple plug-in identifiers returned by the server based on the plug-in source code acquisition request.
[0107] In some feasible implementations, after the web system obtains multiple plug-in identifiers returned by the server based on the plug-in identifier acquisition request, it can generate a plug-in source code acquisition request carrying the above multiple plug-in identifiers based on the multiple plug-in identifiers. The plug-in source code acquisition request is sent to the server to request the server to obtain the corresponding multiple plug-in source codes. Among them, one of the above plug-in source codes corresponds to one of the above plug-in identifiers, that is, the multiple plug-in identifiers carried by the plug-in source code acquisition request correspond to multiple plug-in source codes respectively. It can be understood that each plug-in identifier is used to represent a plug-in, and the plug-in source code corresponding to each plug-in identifier is used to execute the plug-in corresponding to the plug-in identifier, that is, the above multiple plug-in source codes can all be understood as being used to implement the corresponding plug-in function after execution.
[0108] For ease of understanding, the embodiments of the present application are illustrated in the following content. For example, it is assumed that the web system obtains three plug-in identifiers returned by the server based on the plug-in identifier request, which are respectively an interception plug-in identifier, a web page beautification plug-in identifier, and a screenshot plug-in identifier. Further, the web system can generate a corresponding plug-in source code acquisition request based on the interception plug-in identifier, the web page beautification plug-in identifier, and the screenshot plug-in identifier. It can be understood that the plug-in source code acquisition request carries the interception plug-in identifier, the web page beautification plug-in identifier, and the screenshot plug-in identifier. The web system can send the plug-in source code acquisition request to the server. It can be understood that the server stores candidate plug-in source codes of multiple plug-ins, and each candidate plug-in source code corresponds to a plug-in identifier of a plug-in. After receiving the plug-in source code acquisition request sent by the web system, the server can search for the plug-in identifier of the candidate plug-in source code stored in the server according to the plug-in identifier carried in the plug-in source code acquisition request, and determine the candidate plug-in source code that matches the plug-in identifier carried in the plug-in source code acquisition request as the plug-in source code corresponding to the plug-in identifier carried in the plug-in source code acquisition request. Specifically, as can be seen from the above content, if the plug-in source code acquisition request carries an interception plug-in identifier, the server can search for a candidate plug-in source code with a plug-in identifier identical to the interception plug-in identifier among the stored multiple candidate plug-in source codes, and determine the candidate plug-in source code with a plug-in identifier identical to the interception plug-in identifier as the plug-in source code of the interception plug-in. When the server returns the plug-in source code of the interception plug-in found to the web system, the web system executes the plug-in source code of the interception plug-in when the operation object accesses the web system, and the plug-in function of intercepting advertisements can be realized. Similarly, as can be seen from the above content, if the plug-in source code acquisition request carries a webpage beautification plug-in identifier, the server can search for a candidate plug-in source code with a plug-in identifier identical to the webpage beautification plug-in identifier among the stored multiple candidate plug-in source codes, and determine the candidate plug-in source code with a plug-in identifier identical to the webpage beautification plug-in identifier as the plug-in source code of the webpage beautification plug-in. When the server returns the plug-in source code of the webpage beautification plug-in found to the web system, the web system executes the plug-in source code of the webpage beautification plug-in when the operation object accesses the web system, and the plug-in function of webpage beautification can be realized. Similarly, from the above content, it can be seen that the plug-in source code acquisition request carries the screenshot plug-in identifier, then the server can search for the candidate plug-in source code whose plug-in identifier is the same as the screenshot plug-in identifier among the multiple stored candidate plug-in source codes, and determine the candidate plug-in source code whose plug-in identifier is the same as the screenshot plug-in identifier as the plug-in source code of the screenshot plug-in. When the server returns the found plug-in source code of the screenshot plug-in to the web system, the web system executes the plug-in source code of the screenshot plug-in when the operation object accesses the web system, thereby realizing the plug-in function of web page screenshot.
[0109] Step S103: Download multiple plug-in source codes to a local database associated with the web system.
[0110] In some feasible implementations, it can be seen from the above content that when the operating object accesses the web system again, the plug-in resources cached by the web system will become invalid, which causes the operating object to wait for the plug-in resources of the web system to load, affecting the access experience. Therefore, the plug-in loading method of the web system provided in the embodiment of the present application can avoid the delay of waiting for the plug-in resources to load when the operating object accesses the web system by downloading and storing the plug-in resources. Specifically, after the web system obtains the multiple plug-in source codes corresponding to the multiple plug-in identifiers returned by the server based on the above plug-in source code request, the obtained multiple plug-in source codes can be downloaded to the local database for storage. Among them, the local database of the web system is used to permanently store any of the above plug-in source codes when any of the stored plug-in source codes is not deleted by the operating object. It can be understood that the caching method is to temporarily store the plug-in source code. Once the process cached by the web system is closed, the cached plug-in source code will also be cleared. Different from the caching method, the plug-in loading method of the web system provided in the embodiment of the present application can permanently store the multiple plug-in source codes of the web system by downloading the plug-in resources (i.e., the multiple plug-in source codes mentioned above) to the local database. If the operation object does not actively change or delete the plug-in source codes in the local database of the web system, the multiple plug-in source codes in the local database of the web system will not become invalid. Therefore, after a long period of time, when the operation object accesses the web system again, since the local database of the web system stores the corresponding plug-in resources, the operation object does not need to wait for the web system to load the plug-in resources, which can improve the access experience.
[0111] In some feasible implementations, the plug-in loading method of the web system of the embodiment of the present application can download the above-mentioned multiple plug-in source codes to the local database associated with the above-mentioned web system according to the following steps. Figure 4 , Figure 4 FIG. 1 is another flow chart of a method for loading a plug-in of a web system provided in an embodiment of the present application. Figure 4As shown, the plug-in loading method for the web system provided in the embodiment of the present application obtains multiple plug-in source codes corresponding to multiple plug-in identifiers through steps S201-S202, and then stores the multiple plug-in source codes in a local database. When the web system calls the plug-in function of the first plug-in, the function call of the first plug-in of the web system is implemented through steps S206-S207. Among them, the specific implementation method of obtaining multiple plug-in source codes corresponding to multiple plug-in identifiers in steps S201-S202 can refer to the implementation method provided by steps S101-S102, and the specific implementation method of implementing the function call of the first plug-in of the web system in steps S206-S207 can refer to the implementation method provided by steps S104-S105, which will not be repeated in this application. Furthermore, the above-mentioned storage of multiple plug-in source codes in the local database may include the following steps:
[0112] Step S203: Obtain the plug-in identification number and plug-in version number of each plug-in source code based on the plug-in identification corresponding to each plug-in source code.
[0113] In some feasible implementations, it can be seen from the above content that in order to correctly call different plug-ins, different plug-ins and plug-in resources (i.e., plug-in source codes) can be distinguished by plug-in identifiers. Therefore, when the above multiple plug-in source codes are stored in the local database of the web system, the plug-in identification number and plug-in version number corresponding to the plug-in identification of each plug-in source code can be obtained, so that when calling any plug-in source code in the local database of the web system, the plug-in source code to be called can be determined according to the plug-in identification number and plug-in version number corresponding to the plug-in source code. Specifically, the plug-in identification number can be understood as a code used to distinguish different plug-ins and different types of plug-ins. Different types of plug-ins have different plug-in identification numbers. The plug-in version number can be understood as a code used to distinguish different versions of the same plug-in. The same type of plug-ins have the same plug-in identification number, but different plug-in version numbers. For example, assuming that the plug-in identification number of the above interception plug-in is 001, the plug-in identification number of the screenshot plug-in can be 002, and the plug-in identification number of the web beautification plug-in is 003. Different plug-in types can be distinguished by different plug-in identification numbers. Similarly, assuming that the plugin version number of the first version of the interception plugin is V1, after being updated, the plugin version number of the second version of the interception plugin is V2, and the plugin version number of the third version of the interception plugin is V3, different versions of the same type of plugin can be distinguished by different plugin version numbers. It is understandable that after the version of any plugin is updated, the plugin source code corresponding to the plugin is also updated. Therefore, in order to enable the server to return the correct type and version of the plugin source code to the web system, when the above multiple plugin source codes are stored in the local database of the web system, the plugin identification number and plugin version number corresponding to the plugin identification of each plugin source code can be obtained, so that when the web system requests to obtain the plugin source code, the matching plugin source code can be found according to the plugin identification number and plugin version number and returned to the web system.
[0114] For ease of understanding, the embodiments of the present application are illustrated in the following content. Assume that the multiple plug-in source codes stored in the local database include: interception plug-in source code, screenshot plug-in source code, web beautification plug-in source code, and multimedia resource download plug-in source code. When the operation object accesses the web system, the web system can generate a corresponding plug-in source code call request based on the access requirements of the operation object to call the corresponding plug-in source code in the local database to implement the plug-in function. Among them, each plug-in source code call request carries a corresponding plug-in identification number and plug-in version number to accurately call the plug-in source code of the plug-in identification number and plug-in version number. It can be seen from the above content that the plug-in identification number and plug-in version number corresponding to each plug-in source code in the local database can be obtained based on the plug-in identification corresponding to each plug-in source code. Specifically, based on the plug-in identifier of the interception plug-in source code, the plug-in identifier of the interception plug-in source code can be obtained as 001 and the plug-in version number V1, and based on the plug-in identifier of the screenshot plug-in source code, the plug-in identifier of the screenshot plug-in source code can be obtained as 002 and the plug-in version number V4, and based on the plug-in identifier of the web page beautification plug-in source code, the plug-in identifier of the web page beautification plug-in source code can be obtained as 003 and the plug-in version number V2, and based on the plug-in identifier of the multimedia resource download plug-in source code, the plug-in identifier of the multimedia resource download plug-in source code can be obtained as 004 and the plug-in version number V4, and the plug-in identifier of the plug-in is 001. Further, when the operation object accesses the web system, it is assumed that the web system receives a plug-in source code call request, and the plug-in source code call request carries the plug-in identifier 001 and the plug-in version number V1, as well as the plug-in identifier 002 and the plug-in version number V5. The local database can be searched in the local database based on the plug-in identification number and plug-in version number carried in the above plug-in source code call request, so as to determine the interception plug-in source code with the plug-in identification number of 001 and the plug-in version number of V1 in the above local database as the plug-in source code requested by the web system, and transmit it to the execution module of the web system for execution, so as to realize the interception plug-in function. In addition, since there is only the screenshot plug-in source code with the plug-in identification number of 002 and the plug-in version number of V4 in the local database, and there is no screenshot plug-in source code with the plug-in identification number of 002 and the plug-in version number of V5 after the update, in order to improve the user experience of the web system, the plug-in loading method of the web system provided in the implementation of this application can return the plug-in source code with the same plug-in identification number but different plug-in version number to the web system for execution, that is, the screenshot plug-in source code with the plug-in identification number of 002 and the plug-in version number of V4 in the above local database is transmitted to the execution module of the web system for execution, so as to realize the screenshot plug-in function.
[0115] Step S204: Obtain mapping data of multiple plug-in source codes based on the mapping relationship between the plug-in identification number, the plug-in version number and the plug-in source code of each plug-in source code.
[0116] In some feasible implementations, it can be seen from the above content that in order to accurately search for multiple plug-in source codes stored in the local database, the plug-in identification numbers and plug-in version numbers of the multiple plug-in source codes can be obtained based on the plug-in identifications of the multiple plug-in source codes. Further, the mapping data of the multiple plug-in source codes can be obtained by establishing a mapping relationship between the plug-in identification numbers, plug-in version numbers and plug-in source codes of the above-mentioned respective plug-in source codes.
[0117] For ease of understanding, the present application embodiment is illustrated in the following content. Assume that the multiple plug-in source codes stored in the local database include: interception plug-in source code, screenshot plug-in source code, web beautification plug-in source code, and multimedia resource download plug-in source code. Further, the interception plug-in source code plug-in identification number 001 and plug-in version number V1 can be obtained based on the plug-in identification of the interception plug-in source code, and the first mapping relationship from the interception plug-in source code to the plug-in identification number 001 and plug-in version number V1 can be established. Similarly, the screenshot plug-in source code plug-in identification number 002 and plug-in version number V4 can be obtained based on the plug-in identification of the screenshot plug-in source code, and the second mapping relationship from the screenshot plug-in source code to the plug-in identification number 002 and plug-in version number V4 can be established. Similarly, the web beautification plug-in source code plug-in identification number 003 and plug-in version number V2 can be obtained based on the plug-in identification of the web beautification plug-in source code, and the third mapping relationship from the web beautification plug-in source code to the plug-in identification number 003 and plug-in version number V2 can be established. Similarly, the multimedia resource download plug-in source code can be obtained based on the plug-in identification of the multimedia resource download plug-in source code, the plug-in identification number is 004, and the plug-in version number is V4, then the fourth mapping relationship from the multimedia resource download plug-in source code to the plug-in identification number 004 and the plug-in version number V4 can be established. Further, the local database of the web system can obtain the mapping relationship corresponding to multiple plug-in source codes, and obtain the mapping data of multiple plug-in source codes from the mapping relationship of multiple plug-in source codes, and the mapping data can be understood as the plug-in identification number, plug-in version number and the mapping relationship between the two for characterizing any plug-in source code. For example, the mapping data of the above-mentioned interception plug-in source code refers to the plug-in identification number of the interception plug-in source code is 001, the plug-in version number is V1, and the plug-in source code with the plug-in identification number 001 and the plug-in version number V1 is the interception plug-in source code. Similarly, the mapping data of the above-mentioned screenshot plug-in source code refers to the plug-in identification number of the screenshot plug-in source code is 002, the plug-in version number is V4, and the plug-in source code with the plug-in identification number 002 and the plug-in version number V4 is the screenshot plug-in source code. Similarly, the mapping data of the webpage beautification plug-in source code refers to the plug-in identification number of the webpage beautification plug-in source code as 003 and the plug-in version number as V2, and the plug-in source code of the plug-in identification number as 001 and the plug-in version number as V2 is the webpage beautification plug-in source code. Similarly, the mapping data of the multimedia resource download plug-in source code refers to the plug-in identification number as 004 and the plug-in version number as V4 of the multimedia resource download plug-in source code, and the plug-in source code of the plug-in identification number as 004 and the plug-in version number as V4 is the multimedia resource download plug-in source code.
[0118] Step S205: storing the multiple plug-in source codes into a local database based on the mapping data of the multiple plug-in source codes, so as to complete the downloading of the multiple plug-in source codes into the local database associated with the web system.
[0119] In some feasible implementations, it can be seen from the above content that the plug-in loading method of the web system provided in the embodiment of the present application can obtain the mapping data of multiple plug-in source codes, and can search for the plug-in source code that needs to be called based on the mapping data of each plug-in source code. Further, in order to facilitate the search, multiple plug-in source codes can be stored in a local database based on the mapping data of multiple plug-in source codes. In addition, it can be seen from the above content that the local database of the web system can only store source codes whose data type is a string type. For this reason, the data type of each of the above plug-in source codes stored in the above local database is a string.
[0120] In some feasible implementations, the plug-in loading method of the web system of the embodiment of the present application can update any plug-in source code in the local database according to the following steps. Figure 5 , Figure 5 FIG. 1 is another flow chart of a method for loading a plug-in of a web system provided in an embodiment of the present application. Figure 5 As shown, after the plug-in loading method of the web system provided in the embodiment of the present application downloads multiple plug-in source codes to the local database associated with the web system through steps S301-S303, the multiple plug-in source codes in the local database can be further updated. Among them, the specific implementation of steps S301-S303 downloading multiple plug-in source codes to the local database associated with the web system can refer to the implementation provided by steps S101-S103, and this application will not repeat them here. Furthermore, the above-mentioned update of any plug-in source code in the local database may include the following steps:
[0121] Step S304: Obtain an update request for any plug-in in the web system.
[0122] In some feasible implementations, it can be seen from the above content that in order to make the plug-in functions more complete and rich, the plug-in that has been released can be updated. Furthermore, the plug-in function can be updated by updating the plug-in source code corresponding to the plug-in. Specifically, the web system can receive an update request for any plug-in in the web system. The update request can be understood as a request for updating any plug-in of the web system. In order to distinguish the update requests for different plug-ins, the update request carries the plug-in identification number and plug-in version number of the corresponding plug-in. After receiving the update request for any plug-in, the web system can send the update request to the server to request the server to obtain the updated source code of the plug-in corresponding to the update request.
[0123] Step S305: Obtain the update source code, plug-in identification number and plug-in version number of any plug-in returned by the server based on the update request.
[0124] In some feasible implementations, after receiving the update request sent by the web system, the server can search in multiple plug-in source codes stored in the server based on the plug-in identification number and plug-in version number carried in the update request, and determine the plug-in source code whose plug-in identification number is the same as the plug-in identification number carried in the update request and whose plug-in version number is larger than the plug-in version number carried in the update request as the update source code corresponding to the update request. Among them, the larger the plug-in version number, the more updated the corresponding plug-in source code. For example, assuming that the plug-in identification number carried in the update request is 001 and the plug-in version number is V2, the server finds the plug-in source code with the plug-in identification number of 001 and the plug-in version number of V3 in multiple plug-in source codes based on the update request. Since the plug-in version number V3 of the plug-in source code is larger than the plug-in version number V2 carried in the update request, it can be understood that on the basis of the plug-in version number V2, the plug-in source code is updated to the update source code with the plug-in version number V3. In general, the server can find the corresponding update source code based on the plug-in identification number and the plug-in version number carried in the update request, and return the update source code and the plug-in identification number and plug-in version number of the update source code to the web system for updating.
[0125] Step S306: Based on the mapping data of the multiple plug-in source codes, the plug-in source codes whose plug-in identification numbers and plug-in version numbers are the same as the plug-in identification numbers and plug-in version numbers of the update source codes are determined as the source codes to be updated, and the source codes to be updated are updated based on the update source codes.
[0126] In some feasible implementations, after receiving the updated source code returned by the server and the plug-in identification number and plug-in version number of the updated source code, the web system can search for multiple plug-in source codes in the local database based on the mapping data of the multiple plug-in source codes in the local database to update the plug-in source code corresponding to the updated source code in the local database. For example, assuming that the plug-in identification number of the updated source code is 001 and the plug-in version number is V3, the plug-in source code with the plug-in identification number of 001 can be searched based on the mapping data of the multiple plug-in source codes. Assuming that the plug-in source code with the plug-in identification number of 001 and the plug-in version number of V2 is found, the plug-in source code with the plug-in identification number of 001 and the plug-in version number of V2 can be determined as the source code to be updated. Further, the source code to be updated can be updated based on the updated source code. Specifically, the source code to be updated can be deleted, and the updated source code and its plug-in identification number and plug-in version number can be added to the local database, thereby completing the update of the plug-in source code.
[0127] Step S104: respond to a trigger operation for calling a function of a first plug-in of the web system, obtain a first plug-in identifier of the first plug-in based on the trigger operation, and determine a plug-in source code whose plug-in identifier in a local database matches the first plug-in identifier as the first plug-in source code of the first plug-in.
[0128] In some feasible implementations, after completing the preloading of the plug-in resources of the web system based on the above content, when the operation object accesses the web system, it can directly query the local database of the web system whether the plug-in resource has been downloaded, and when the plug-in resource has been downloaded to the local database, directly retrieve the corresponding plug-in source code for execution, so that the operation object does not need to wait for the web system to request the server to load the corresponding plug-in source code during the access process. Specifically, when the function of the first plug-in of the web system is called, the plug-in identifier of the first plug-in can be obtained for the corresponding trigger operation to obtain the first plug-in identifier. Furthermore, based on the first plug-in identifier of the first plug-in, the plug-in source code whose plug-in identifier in the local database matches the first plug-in identifier can be determined as the first plug-in source code of the first plug-in.
[0129] In some feasible implementations, the first plug-in source code of the first plug-in may be obtained according to the following content. Specifically, first, the plug-in identification number and plug-in version number of the first plug-in may be obtained based on the first plug-in identification of the first plug-in, and then the mapping data of the multiple plug-in source codes in the local database may be searched based on the plug-in identification number and plug-in version number of the first plug-in, and the plug-in source code whose plug-in identification number and plug-in version number in the mapping data of the multiple plug-in source codes are respectively the same as the plug-in identification number and plug-in version number of the first plug-in may be determined as the first plug-in source code of the first plug-in.
[0130] For ease of understanding, the embodiments of the present application are illustrated in the following content. Assuming that when the operation object accesses the web system, a function call of the interception plug-in for the web system is triggered, the triggering operation for the operation object can obtain the interception plug-in identifier of the web system interception plug-in. Further, the plug-in identification number of the interception plug-in can be obtained based on the interception plug-in identification of the interception plug-in, which is 001 and the plug-in version number is V2. It is understandable that by searching in the local database based on the plug-in identification number 001 and the plug-in version number V2 of the interception plug-in, the plug-in source code with the plug-in identification number 001 and the plug-in version number V2 is searched in the mapping data of multiple plug-in source codes in the local database. In some application scenarios, when there is no plug-in source code with the plug-in identification number 001 and the plug-in version number V2 in the local database, that is, there is no plug-in source code with matching plug-in identification number and plug-in version number in the local database, in order to improve the compatibility of the web system, the plug-in source code with the same plug-in identification number and different plug-in version number can be determined as the plug-in source code of the interception plug-in. For example, assuming that there is only a plug-in source code with a plug-in identification number of 001 and a plug-in version number of V1 in the local database, the plug-in source code with a plug-in identification number of 001 and a plug-in version number of V1 can be determined as the plug-in source code of the interception plug-in (plug-in identification number of 001 and plug-in version number of V2) requested to be called, so as to implement the function call of the interception plug-in of the web system.
[0131] In some feasible implementations, after the first plug-in identifier of the first plug-in obtains the plug-in identification number and plug-in version number of the first plug-in, it can be known from the above content that the mapping data of the above multiple plug-in source codes in the above local database can be searched based on the plug-in identification number and plug-in version number of the above first plug-in. At this time, if there is no plug-in source code with the same plug-in identification number and plug-in version number as the above first plug-in in the mapping data of the above multiple plug-in source codes, the plug-in loading method of the web system provided by the present application can request the above server to obtain the plug-in source code of the first plug-in.
[0132] For some possible implementations, see Figure 6 , Figure 6 is another schematic diagram of a web system plug-in loading method provided in an embodiment of the present application. Figure 6 As shown, first, the plug-in identification number and plug-in version number of the above-mentioned first plug-in can be sent to the server through the application program interface (WebFetch API). It can be understood that after receiving the plug-in identification number and plug-in version number of the first plug-in, the server can, based on the plug-in identification number and plug-in version number of the first plug-in, determine the candidate plug-in source code whose plug-in identification number and plug-in version number are the same as the plug-in identification number and plug-in version number of the first plug-in from multiple candidate plug-in source codes stored on the server as the first plug-in source code of the first plug-in, and return the first plug-in source code of the first plug-in to the web system. It can be understood that after obtaining the first plug-in source code returned by the server, the web system can transmit the first plug-in source code to the execution module of the web system for execution to implement the function call of the first plug-in. At the same time, as Figure 6 As shown, the first plug-in source code can also be stored in the local database (InterexDB) of the web system, so that when the operation object accesses the web system again, the first plug-in source code can be directly called in the local database. In addition, it can be seen from the above content that the local database of the web system can only store source codes with a data type of string type. For this reason, the data type of each plug-in source code stored in the local database is a string (string). Similarly, the data type of the first plug-in source code of the first plug-in is also a string.
[0133] Step S105: Execute the first plug-in source code to implement the function call of the first plug-in of the web system.
[0134] In some feasible implementations, after obtaining the first plug-in source code of the first plug-in, the first plug-in source code can be executed to implement the function call of the first plug-in. For example, assuming that the first plug-in is an interception plug-in, after executing the first plug-in source code, the function call of the interception plug-in can be implemented, specifically, the advertisements or junk information in the web page can be intercepted. Similarly, assuming that the first plug-in is a night mode plug-in, after executing the first plug-in source code, the function call of the night mode plug-in can be implemented, specifically, the color, brightness and contrast of the page in the web system can be adjusted, so that the operating object can obtain a comfortable browsing experience when using the web system in different environments. Similarly, assuming that the first plug-in is a language translation plug-in, after executing the first plug-in source code, the function call of the language translation plug-in can be implemented, specifically, the web system can translate foreign languages and display the translation results. Similarly, assuming that the first plug-in is a multimedia resource download plug-in, after executing the first plug-in source code, the function call of the multimedia resource download plug-in can be implemented, specifically, the web system can download and manage all multimedia resources in the browser, such as music resources and picture resources, and can be sorted and classified according to the type of multimedia resources. Similarly, assuming that the first plug-in is a browsing record plug-in, after executing the first plug-in source code, the function call of the browsing record plug-in can be realized. Specifically, the web system can detect the access behavior of the operation object on different web pages of the browser, and generate corresponding browsing records in the form of charts, which is convenient for the operation object to view and summarize. Similarly, assuming that the first plug-in is a web beautification plug-in, after executing the first plug-in source code, the function call of the web beautification plug-in can be realized. Specifically, the content in the page of the web system can be extracted and reorganized into an interface that is more suitable for the operation object to read. It is understandable that the server can also realize the function call of the plug-in by executing more other types of plug-in source code, and this application does not give examples one by one here.
[0135] In some feasible implementations, the plug-in source code may include multiple source code sub-files, and the multiple source code sub-files may be stored in the local database through multiple public paths. One of the source code sub-files corresponds to one of the public paths. In the process of executing any plug-in source code, in order to execute any source code sub-file in the plug-in source code, any source code sub-file may be imported through the public path of any source code sub-file, so that the plug-in source code may be executed to obtain the corresponding plug-in function. The web system may input the plug-in source code into the sandbox to execute the plug-in source code. The above-mentioned execution of the first plug-in source code to implement the function call of the first plug-in of the web system includes:
[0136] In some feasible implementations, the source code of the first plug-in can be executed by the following content. For details, please refer to Figure 7 , Figure 7 FIG. 1 is another schematic diagram of a web system plug-in loading method provided in an embodiment of the present application. Figure 7 As shown, first, a scripting language sandbox environment can be constructed, for example, a JavaScript sandbox environment, and then the first plug-in source code is input into the JavaScript sandbox environment through the communication API of the web system for operation. It can be understood that the above-mentioned JavaScript sandbox environment can be understood as a virtual environment for running independent source code. The JavaScript sandbox environment can make the first plug-in source code run in an isolated environment without affecting other running programs in the outside world, so it can avoid malicious plug-in source code from affecting the normal operation of the web system. At the same time, it can also avoid that other running programs of the web system affect the operation of the first plug-in source code. Further, the JavaScript sandbox environment runs the above-mentioned first plug-in source code and returns the element (Hackdocument.currentScript API) to which the currently running script belongs, thereby obtaining the public path of multiple source code subfiles of the above-mentioned first plug-in source code. Furthermore, the multiple source code sub-files of the first plug-in source code can be imported based on the common path of the multiple source code sub-files through the communication API of the web system to complete the execution of the first plug-in source code and generate corresponding execution products, thereby realizing the function call of the first plug-in of the web system. In addition, the plug-in loading method of the web system provided in the embodiment of the present application is also used to provide the execution product of the first plug-in source code to the web system slot. It can be understood that the operation object can pass the first plug-in source code to other components or modules of other web systems through the web system slot for use, which can be adjusted according to the actual application scenario, and the present application does not limit it here.
[0137] For some possible implementations, see Figure 8 , Figure 8 This is another schematic diagram of the framework of the web system plug-in loading method provided in the embodiment of the present application. Figure 8 A brief description is given. Figure 8As shown, the web system can implement the call (access) of the plug-in function of the web system through three stages of operation. Specifically, when the operation object accesses the web system, the web system can be initialized based on the access operation of the operation object (initialization stage). Among them, the above-mentioned web system can load the core code (i.e., core package) of the web system during the initialization stage, and open the access homepage of the web system after loading the above-mentioned core package. Furthermore, after the access homepage of the above-mentioned web system is opened, the web system can preload the plug-in resources of the web system. Specifically, as Figure 8 As shown, the web system can request the server to obtain the corresponding plug-in source code during the download phase to complete the pre-download of the plug-in source code, and store the pre-downloaded plug-in source code so that when the web system calls the plug-in function, the stored plug-in source code can be directly read for execution to implement the call of the plug-in function. Furthermore, when the web system needs to access the first plug-in to call the plug-in function of the first plug-in, the web system can search according to the above-mentioned stored plug-in source code to determine whether the first plug-in source code of the first plug-in has been downloaded. If it has been downloaded, the downloaded plug-in source code of the first plug-in is taken out and transmitted to the constructed sandbox environment for execution, thereby implementing the web system's function call to the first plug-in. It can be understood that if the plug-in source code of the first plug-in has not been downloaded, such as Figure 8 As shown, the web system can request the server to download the plug-in source code of the first plug-in according to the above content, and after obtaining the plug-in source code of the first plug-in returned by the server, store it and transmit it to the constructed sandbox environment for execution, thereby realizing the web system's function call on the first plug-in. It can be understood that compared with the method of dynamically downloading plug-in resources through the scr i pt tag, the plug-in method of the web system provided in the embodiment of the present application can reduce the time waiting for the download of plug-in resources by preloading the plug-in resources of the web system, as shown in the following table:
[0138]
[0139] In the plug-in loading method of the web system provided in the embodiment of the present application, when the operation object first accesses the web system, the web system completes initialization and generates a plug-in identification acquisition request after accessing the homepage and sends it to the server. The server can return multiple plug-in identifications corresponding to multiple plug-in source codes preloaded by the web system based on the plug-in identification acquisition request, wherein one plug-in identification corresponds to one plug-in source code. Among them, the server can sort according to the priority of multiple candidate plug-in identifications, and determine the K candidate plug-in identifications with higher priority among the multiple candidate plug-in identifications as multiple plug-in identifications of the web system according to the above plug-in identification acquisition request. Further, after obtaining multiple plug-in identifications, the web system can generate a plug-in source code acquisition request carrying multiple plug-in identifications and send it to the server. It can be understood that the server includes multiple candidate plug-in source codes. The server can use the plug-in source code acquisition request sent by the web system as the plug-in source code of the web system, and return multiple plug-in source codes corresponding to multiple plug-in identifications to the web system. It can be understood that after receiving the above multiple plug-in source codes, the web system can download the multiple plug-in source codes to the local database of the web system. Specifically, the mapping data of multiple plug-in source codes can be obtained, and the multiple plug-in source codes can be stored in the local database of the web system based on the mapping data of the multiple plug-in source codes, thereby completing the preloading of the plug-in resources of the web system. Further, when the operation object accesses other web pages of the web system and triggers the web system to call the function of the first plug-in, the web system can search for multiple plug-in source codes in the local database based on the first plug-in identifier of the first plug-in, so as to determine the plug-in source code matching the plug-in identifier with the first plug-in identifier as the first plug-in source code of the first plug-in according to the mapping data of the multiple plug-in source codes. Further, the function call of the first plug-in can be realized by executing the first plug-in source code. In the embodiment of the present application, the web system preloads the plug-in resources after generating the access homepage, so even if the operation object is accessing the web system for the first time, when the web system calls the plug-in function later, the web system can directly execute the plug-in source code in the local database without waiting for the web system to download the plug-in source code before executing. In addition, since the embodiment of the present application stores the plug-in resources through the local database, there is no situation where the plug-in resources expire and become invalid. Therefore, when the operation object accesses the web system again after a long time, the web system can directly execute the plug-in source code in the local database to call the function of the corresponding plug-in. It can be seen that the plug-in loading method of the web system provided in the embodiment of the present application can reduce the time that the operation object waits for the plug-in to load, improve the access experience of the web system, and has high efficiency and strong applicability.
[0140] Based on the description of the embodiment of the plug-in loading method of the web system, the embodiment of the present application also discloses a web system. The web system can be applied to Figures 1 to 8 The web system plug-in loading method of the embodiment shown is used to execute the steps in the web system plug-in loading method. Here, the web system can be the above Figures 1 to 8 The service server or terminal device in the embodiment shown, that is, the web system can be the above Figures 1 to 8 The execution body of the plug-in loading method of the web system in the embodiment shown. Fig. 9 , Fig. 9 This is a structural diagram of a web system provided in an embodiment of the present application. In an embodiment of the present application, the web system can run the following modules:
[0141] The identification acquisition module 1 is used to acquire multiple plug-in identifications of the web system and send a plug-in source code acquisition request to the server, wherein the plug-in source code acquisition request carries the multiple plug-in identifications;
[0142] Source code acquisition module 2, used to acquire multiple plug-in source codes corresponding to the multiple plug-in identifiers returned by the server based on the plug-in source code acquisition request, where one plug-in source code corresponds to one plug-in identifier;
[0143] A source code storage module 3, used for downloading the plurality of plug-in source codes to a local database associated with the web system, wherein the local database is used for permanently storing any of the plug-in source codes if the stored plug-in source codes are not deleted by the operation object;
[0144] Determining module 4, used for responding to a trigger operation of calling a function of a first plug-in of the web system, obtaining a first plug-in identifier of the first plug-in based on the trigger operation, and determining a plug-in source code whose plug-in identifier in the local database matches the first plug-in identifier as the first plug-in source code of the first plug-in;
[0145] The execution module 5 is used to execute the first plug-in source code to implement the function call of the first plug-in of the web system.
[0146] The identification acquisition module 1 includes:
[0147] The initialization unit 11 is used to respond to the access operation to the web system, initialize the web system based on the access operation to open the access homepage of the web system, and send a plug-in identification acquisition request to the server when the access homepage of the web system is opened, and obtain multiple plug-in identifications of the web system returned by the server based on the plug-in identification acquisition request.
[0148] The identification acquisition module 1 further includes:
[0149] The identification request unit 12 is used to send the plug-in identification acquisition request to the server, triggering the server to prioritize the multiple candidate plug-in identifications and return K candidate plug-in identifications with higher priorities among the multiple candidate plug-in identifications based on the plug-in identification acquisition request, where K is a positive integer;
[0150] The identifier determining unit 13 is used to obtain the K candidate plug-in identifiers fed back by the server as multiple plug-in identifiers of the web system.
[0151] The source code storage module 3 includes:
[0152] An identification number acquisition unit 31 is used to acquire a plug-in identification number and a plug-in version number of each plug-in source code based on the plug-in identification corresponding to each plug-in source code;
[0153] A mapping unit 32, configured to obtain mapping data of the plurality of plug-in source codes based on a mapping relationship between a plug-in identification number and a plug-in version number of each plug-in source code and the plug-in source code;
[0154] The downloading unit 33 is used to store the above-mentioned multiple plug-in source codes to the above-mentioned local database based on the mapping data of the above-mentioned multiple plug-in source codes, so as to complete the downloading of the above-mentioned multiple plug-in source codes to the local database associated with the above-mentioned web system, wherein the data type of the above-mentioned each plug-in source code stored in the above-mentioned local database is a string.
[0155] The source code storage module 3 further includes:
[0156] An updating unit 34, configured to obtain an update request for any plug-in in the above web system;
[0157] Obtaining the updated source code, plug-in identification number and plug-in version number of any of the plug-ins returned by the server based on the update request;
[0158] Based on the mapping data of the above-mentioned multiple plug-in source codes, the plug-in source codes in the above-mentioned multiple plug-in source codes whose plug-in identification numbers and plug-in version numbers are the same as the plug-in identification numbers and plug-in version numbers of the above-mentioned update source codes are determined as the source codes to be updated, and the above-mentioned source codes to be updated are updated based on the above-mentioned update source codes.
[0159] The identification number obtaining unit 31 is further used for:
[0160] Based on the first plug-in identifier of the first plug-in, obtain a plug-in identification number and a plug-in version number of the first plug-in;
[0161] Wherein, the above-mentioned determination module 4 includes:
[0162] The search unit 41 is used to search the mapping data of the above-mentioned multiple plug-in source codes in the above-mentioned local database based on the plug-in identification number and the plug-in version number of the above-mentioned first plug-in, and determine the plug-in source code whose plug-in identification number and plug-in version number in the mapping data of the above-mentioned multiple plug-in source codes are respectively the same as the plug-in identification number and the plug-in version number of the above-mentioned first plug-in as the first plug-in source code of the above-mentioned first plug-in.
[0163] The above-mentioned determination module 4 further includes:
[0164] A determination unit 42 is configured to send the plug-in identification number and plug-in version number of the first plug-in to the server when there is no plug-in source code identical to the plug-in identification number and plug-in version number of the first plug-in in the mapping data of the plurality of plug-in source codes;
[0165] The acquiring unit 43 is configured to acquire the first plug-in source code returned by the server based on the plug-in identification number and the plug-in version number of the first plug-in; wherein the data type of the first plug-in source code is a string.
[0166] The execution module 5 includes:
[0167] A public path acquisition unit 51 is used to construct a scripting language sandbox environment, and run the first plug-in source code based on the scripting language sandbox environment to obtain public paths of multiple source code sub-files of the first plug-in source code;
[0168] The importing unit 52 is used to import the multiple source code sub-files of the first plug-in source code based on the common paths of the multiple source code sub-files to implement the function call of the first plug-in of the web system.
[0169] In the plug-in loading method of the web system provided in the embodiment of the present application, when the operation object first accesses the web system, the web system completes initialization and generates a plug-in identification acquisition request after accessing the homepage and sends it to the server. The server can return multiple plug-in identifications corresponding to multiple plug-in source codes preloaded by the web system based on the plug-in identification acquisition request, wherein one plug-in identification corresponds to one plug-in source code. Among them, the server can sort according to the priority of multiple candidate plug-in identifications, and determine the K candidate plug-in identifications with higher priority among the multiple candidate plug-in identifications as multiple plug-in identifications of the web system according to the above plug-in identification acquisition request. Further, after obtaining multiple plug-in identifications, the web system can generate a plug-in source code acquisition request carrying multiple plug-in identifications and send it to the server. It can be understood that the server includes multiple candidate plug-in source codes. The server can use the plug-in source code acquisition request sent by the web system as the plug-in source code of the web system, and return multiple plug-in source codes corresponding to multiple plug-in identifications to the web system. It can be understood that after receiving the above multiple plug-in source codes, the web system can download the multiple plug-in source codes to the local database of the web system. Specifically, the mapping data of multiple plug-in source codes can be obtained, and the multiple plug-in source codes can be stored in the local database of the web system based on the mapping data of the multiple plug-in source codes, thereby completing the preloading of the plug-in resources of the web system. Further, when the operation object accesses other web pages of the web system and triggers the web system to call the function of the first plug-in, the web system can search for multiple plug-in source codes in the local database based on the first plug-in identifier of the first plug-in, so as to determine the plug-in source code matching the plug-in identifier with the first plug-in identifier as the first plug-in source code of the first plug-in according to the mapping data of the multiple plug-in source codes. Further, the function call of the first plug-in can be realized by executing the first plug-in source code. In the embodiment of the present application, the web system preloads the plug-in resources after generating the access homepage, so even if the operation object is accessing the web system for the first time, when the web system calls the plug-in function later, the web system can directly execute the plug-in source code in the local database without waiting for the web system to download the plug-in source code before executing. In addition, since the embodiment of the present application stores the plug-in resources through the local database, there is no situation where the plug-in resources expire and become invalid. Therefore, when the operation object accesses the web system again after a long time, the web system can directly execute the plug-in source code in the local database to call the function of the corresponding plug-in. It can be seen that the plug-in loading method of the web system provided in the embodiment of the present application can reduce the time that the operation object waits for the plug-in to load, improve the access experience of the web system, and has high efficiency and strong applicability.
[0170] In the embodiment of the present application, each module in the device shown in the above figure can be separately or all merged into one or several other modules to constitute, or some (some) modules therein can also be split into multiple smaller modules in function to constitute, which can achieve the same operation without affecting the realization of the technical effect of the embodiment of the present application. The above modules are divided based on logical functions. In practical applications, the function of a module can also be realized by multiple modules, or the function of multiple modules is realized by one module. In other feasible implementations of the present application, the above device can also include other modules. In practical applications, these functions can also be implemented with the assistance of other modules, and can be implemented by the collaboration of multiple modules, which is not limited here.
[0171] See also Fig.10 , Fig.10 Schematic diagram of a computer device provided in an embodiment of the present application. Fig.10 As shown, the computer device 1000 may be the above Figure 1-Figure 8 The terminal device in the corresponding embodiment. The computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally be at least one storage device located away from the aforementioned processor 1001. Fig.10 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
[0172] The network interface 1004 in the computer device 1000 can also be connected to the above Figure 1 The terminal 200b in the corresponding embodiment is connected to the network, and the optional user interface 1003 may also include a display screen (Display) and a keyboard (Keyboard). Fig.10In the computer device 1000 shown in the figure, the network interface 1004 can provide a network communication function; the user interface 1003 is mainly used to provide an input interface for developers; and the processor 1001 can be used to call the device control application stored in the memory 1005 to implement the above Figure 2 The plug-in loading method of the web system in the corresponding embodiment.
[0173] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the above Figure 2 The description of the webpage identification processing method in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here either.
[0174] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, Figure 2 The web system plug-in loading method provided in each step is as follows. Figure 2 The implementation methods provided by each step will not be repeated here.
[0175] The computer-readable storage medium may be an internal storage unit of the web system or the computer device provided in any of the aforementioned embodiments, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (smartmed ia card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. equipped on the computer device. Further, the computer-readable storage medium may also include both an internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0176] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, device, product, or equipment that includes a series of steps or units is not limited to the listed steps or modules, but optionally includes steps or modules that are not listed, or optionally includes other step units inherent to these processes, methods, devices, products, or equipment.
[0177] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0178] The method and related apparatus provided by the embodiment of the present application are described with reference to the method flow chart and / or structural diagram provided by the embodiment of the present application. Specifically, each process and / or box in the method flow chart and / or structural diagram, as well as the combination of the processes and / or boxes in the flow chart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A flow or multiple flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.
[0179] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for loading a plug-in of a web system, characterized in that: The method comprises: Acquire multiple plug-in identifiers of the web system, and send a plug-in source code acquisition request to the server, wherein the plug-in source code acquisition request carries the multiple plug-in identifiers; Acquire multiple plug-in source codes corresponding to the multiple plug-in identifiers and returned by the server based on the plug-in source code acquisition request, wherein one plug-in source code corresponds to one plug-in identifier; Downloading the plurality of plug-in source codes to a local database associated with the web system, wherein the local database is used to permanently store any plug-in source code when any stored plug-in source code is not deleted by the operation object; In response to a trigger operation of calling a function of a first plug-in of a web system, obtaining a first plug-in identifier of the first plug-in based on the trigger operation, and determining a plug-in source code in the local database whose plug-in identifier matches the first plug-in identifier as the first plug-in source code of the first plug-in; The first plug-in source code is executed to implement a function call of the first plug-in of the web system.
2. The method according to claim 1, characterized in that: The obtaining of multiple plug-in identifiers of the web system includes: In response to an access operation to a web system, the web system is initialized based on the access operation to open an access homepage of the web system, and a plug-in identifier acquisition request is sent to a server when the access homepage of the web system is opened, and multiple plug-in identifiers of the web system returned by the server based on the plug-in identifier acquisition request are acquired.
3. The method according to claim 2, characterized in that The step of sending a plug-in identification acquisition request to a server and acquiring multiple plug-in identifications of the web system returned by the server based on the plug-in identification acquisition request includes: Sending the plug-in identification acquisition request to the server, triggering the server to prioritize multiple candidate plug-in identifications and return K candidate plug-in identifications with higher priorities among the multiple candidate plug-in identifications based on the plug-in identification acquisition request, where K is a positive integer; The K candidate plug-in identifiers fed back by the server are obtained as multiple plug-in identifiers of the web system.
4. The method according to claim 1, characterized in that: The downloading of the plurality of plug-in source codes to a local database associated with the web system includes: Obtaining a plug-in identification number and a plug-in version number of each plug-in source code based on the plug-in identification corresponding to each plug-in source code; Based on the mapping relationship between the plug-in identification number and the plug-in version number of each plug-in source code and the plug-in source code, obtaining mapping data of the plurality of plug-in source codes; Based on the mapping data of the multiple plug-in source codes, the multiple plug-in source codes are stored in the local database to complete the download of the multiple plug-in source codes to the local database associated with the web system, wherein the data type of each plug-in source code stored in the local database is a string.
5. The method according to claim 4, characterized in that After downloading the plurality of plug-in source codes to a local database associated with the web system, the method comprises: Obtaining an update request for any plug-in in the web system; Obtaining the update source code, plug-in identification number and plug-in version number of any plug-in returned by the server based on the update request; Based on the mapping data of the multiple plug-in source codes, the plug-in source codes among the multiple plug-in source codes whose plug-in identification numbers and plug-in version numbers are the same as the plug-in identification number and plug-in version number of the update source code are determined as source codes to be updated, and the source codes to be updated are updated based on the update source code.
6. The method according to claim 4, characterized in that The step of determining the plug-in source code whose plug-in identifier in the local database matches the first plug-in identifier as the first plug-in source code of the first plug-in includes: Acquire a plug-in identification number and a plug-in version number of the first plug-in based on the first plug-in identification of the first plug-in; Based on the plug-in identification number and plug-in version number of the first plug-in, the mapping data of the multiple plug-in source codes in the local database are searched, and the plug-in source code whose plug-in identification number and plug-in version number in the mapping data of the multiple plug-in source codes are respectively the same as the plug-in identification number and plug-in version number of the first plug-in is determined as the first plug-in source code of the first plug-in.
7. The method according to claim 6, characterized in that After acquiring the plug-in identification number and the plug-in version number of the first plug-in based on the first plug-in identification of the first plug-in, the method further includes: Searching for mapping data of the plurality of plug-in source codes in the local database based on the plug-in identification number and the plug-in version number of the first plug-in; If there is no plug-in source code in the mapping data of the plurality of plug-in source codes that is the same as the plug-in identification number and the plug-in version number of the first plug-in, sending the plug-in identification number and the plug-in version number of the first plug-in to the server; The first plug-in source code returned by the server based on the plug-in identification number and the plug-in version number of the first plug-in is obtained; wherein the data type of the first plug-in source code is a string.
8. The method according to any one of claims 1 to 7, characterized in that: The plug-in source code includes a plurality of source code sub-files, and the plurality of source code sub-files are stored in the local database through a plurality of public paths, and one source code sub-file corresponds to one public path; The executing the first plug-in source code to implement the function call of the first plug-in of the web system includes: Building a scripting language sandbox environment, and running the first plug-in source code based on the scripting language sandbox environment to obtain a common path of multiple source code sub-files of the first plug-in source code; The multiple source code sub-files of the first plug-in source code are imported based on the common paths of the multiple source code sub-files to implement function calls of the first plug-in of the web system.
9. A web system, characterized in that: include: An identification acquisition module, used to acquire multiple plug-in identifications of the web system, and send a plug-in source code acquisition request to the server, wherein the plug-in source code acquisition request carries the multiple plug-in identifications; A source code acquisition module, used to acquire a plurality of plug-in source codes corresponding to the plurality of plug-in identifiers and returned by the server based on the plug-in source code acquisition request, wherein one plug-in source code corresponds to one plug-in identifier; A source code storage module, used for downloading the plurality of plug-in source codes to a local database associated with the web system, wherein the local database is used for permanently storing any plug-in source code when any stored plug-in source code is not deleted by the operation object; a determination module, configured to respond to a trigger operation of a function call on a first plug-in of a web system, obtain a first plug-in identifier of the first plug-in based on the trigger operation, and determine a plug-in source code in the local database whose plug-in identifier matches the first plug-in identifier as the first plug-in source code of the first plug-in; An execution module is used to execute the first plug-in source code to implement the function call of the first plug-in of the web system.
10. A computer device, characterized in that: include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, the memory is used to store program code, and the processor is used to call the program code to execute the steps of the method described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are executed.
