Mobile terminal extension loading method, electronic device and readable storage medium
Through the mobile extension loading method, full page and module-level expansion, combined with configuration files and extension scripts, the problem of resource waste and high cost of mobile customization needs is solved, and user experience and development efficiency is improved.
Patent Information
- Application Number
- CN202011324629.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-23
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2040-11-23
AI Technical Summary
The mobile terminal faces many exclusive scenarios and special customer needs. The existing technology leads to waste of resources, large capital investment and high labor costs during customized processing.
Provide a mobile extension loading method, through full page expansion and module-level expansion, configuration files and extension scripts are used to realize full page and module-level customization, allowing users to flexibly choose according to their needs and reduce development costs.
It improves user experience, saves mobile development cycle and cost, balances product and user needs, and achieves flexible satisfaction of the special needs of different users.
Smart Images

Figure CN112433781B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer data processing, and in particular to a mobile terminal extension loading method, an electronic device and a readable storage medium. Background Art
[0002] In the related technologies, mobile terminals face numerous exclusive scenarios, special customer demands and customer development needs. If the mobile terminals are customized according to different customized needs, it will cause problems such as waste of resources, large capital investment and high labor costs. Summary of the invention
[0003] The present invention aims to solve at least one of the above technical problems.
[0004] To this end, a first object of the present invention is to provide a mobile terminal extension loading method.
[0005] A second objective of the present invention is to provide an electronic device.
[0006] A third object of the present invention is to provide a readable storage medium.
[0007] To achieve the first purpose of the present invention, the technical solution of the present invention provides a mobile terminal extension loading method, including: obtaining the extension loading mode of the mobile terminal, the extension loading mode includes full-page extension or module-level extension; based on the extension loading mode being full-page extension, loading the replacement page through a configuration file to achieve full-page extension; based on the extension loading mode being module-level extension, achieving module-level extension through an extension script.
[0008] In this technical solution, first, the extension loading mode of the mobile terminal is obtained, and the extension loading mode includes full-page extension or module-level extension, wherein the full-page extension is for the customization requirements of the entire module page, or 80% of the current module page needs to be customized, and the module-level extension is for the methods and / or properties of the local module or part of the module of the page. In this embodiment, the extension of the mobile terminal is divided into full-page extension and module-level extension, which can be flexibly selected according to the special needs and usage habits of different users, so that the customer experience is more comfortable, and at the same time, the development cycle of the mobile terminal is saved and the development cost is reduced. Then, for the full-page extension, the replacement page can be opened for the customer, and the method of loading the replacement page through the configuration file is simple and easy. Finally, for the module-level extension, the extension is realized by the extension script, and the module-level extension is realized by the extension script, which has high accuracy and reliability. Under the premise of not affecting the standard product, this embodiment performs extension development processing according to the special needs of different users and the usage habits of the product, balances the balance between product needs and user needs, improves user experience, and saves development costs.
[0009] In addition, the technical solution provided by the present invention may also have the following additional technical features:
[0010] In the above technical solution, the replacement page is loaded through the configuration file to realize the full page expansion, including: the client loads the page module and obtains the client configuration file; sends a routing request to the node server to obtain the address of the replacement page; the node server sends a request to obtain the remote page stream file of the replacement page and responds to the client.
[0011] In this technical solution, the address of the replacement page is obtained to achieve expansion of the entire page, which is easy to operate, has a good user experience, and can meet the diverse needs of users.
[0012] In any of the above technical solutions, a routing request is sent to a node server to obtain the address of a replacement page, including: checking a client configuration file, requesting a prefabricated custom route based on the check, and sending a routing request to the node server; after the node server receives the routing request, it matches the client configuration file with the node server configuration file to obtain the address of the replacement page.
[0013] In this technical solution, in view of different customized needs of users, the address of the replacement page is obtained to finally achieve full page expansion. The method is simple and can meet customer needs without affecting standard products.
[0014] In any of the above technical solutions, module-level extension is achieved by extending the script, including:
[0015] The client loads the module script and obtains the extended script information; and extends the methods and / or properties in the extended script information to the module script.
[0016] In this technical solution, modular expansion is achieved by extending the script, which is easy to operate and provides a good user experience, and can meet the diverse needs of users.
[0017] In any of the above technical solutions, the client loads the module script and obtains the extended script information, including: the client loads the module script and obtains the document flow information of the page document object model; and parses the document flow information to obtain the extended script information.
[0018] This technical solution supports the storage of extended scripts on other servers according to the actual situation of users, provides a more convenient way to obtain extended scripts, and improves the user experience of users.
[0019] In any of the above technical solutions, the extended script supports same-name overwriting, and overwriting of methods and / or properties is achieved by giving the same name to the methods and / or properties.
[0020] In the present technical solution, when performing modular expansion, the methods and / or properties that need to be changed in the module script can be quickly replaced by using the same naming method in the expansion script. By adopting a method that supports same-name overwriting, rapid replacement can be achieved, thereby improving the stability of system operation.
[0021] In any of the above technical solutions, when the extended script runs in the module instance, it directly accesses and / or modifies the methods and properties in the module script.
[0022] In this technical solution, when the extension script runs in a module instance, the extension script is integrated into the module script, so the extension script can directly access and / or modify the methods and properties in the module script, thereby increasing the freedom of extension script development and improving user experience.
[0023] In any of the above technical solutions, when the extension script runs in the module instance, it directly accesses the data information cached by the client.
[0024] In this technical solution, when the extension script runs in the module instance, the extension script is integrated into the module script, so the extension script can directly access the data information cached by the client, thereby increasing the freedom of extension script development and improving user experience.
[0025] To achieve the third purpose of the present invention, the technical solution of the present invention provides an electronic device, including: a memory and a processor, the memory stores programs and instructions, and the processor executes the programs and instructions; wherein, when the processor executes the programs and instructions, it implements the steps of the mobile terminal extension loading method of any technical solution of the present invention.
[0026] The electronic device provided by the technical solution of the present invention implements the steps of the mobile terminal extension loading method of any technical solution of the present invention, and thus has all the beneficial effects of the mobile terminal extension loading method of any technical solution of the present invention, which will not be repeated here.
[0027] To achieve the fourth purpose of the present invention, the technical solution of the present invention provides a readable storage medium, which stores programs and instructions. When the programs and instructions are executed by a processor, the steps of the mobile terminal extension loading method of any of the above technical solutions are implemented.
[0028] The readable storage medium provided by the technical solution of the present invention implements the steps of the mobile terminal extension loading method of any technical solution of the present invention, and thus has all the beneficial effects of the mobile terminal extension loading method of any technical solution of the present invention, which will not be repeated here.
[0029] Additional aspects and advantages of the present invention will become apparent from the following description or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0031] Figure 1 This is one of the flow charts of the mobile terminal extension loading method according to an embodiment of the present invention;
[0032] Figure 2 This is a second flow chart of a mobile terminal extension loading method according to an embodiment of the present invention;
[0033] Figure 3 This is a flow chart 3 of a mobile terminal extension loading method according to an embodiment of the present invention;
[0034] Figure 4 This is a fourth flow chart of a mobile terminal extension loading method according to an embodiment of the present invention;
[0035] Figure 5 This is a fifth flow chart of a mobile terminal extension loading method according to an embodiment of the present invention;
[0036] Figure 6 This is a sixth flow chart of a mobile terminal extension loading method according to an embodiment of the present invention;
[0037] Figure 7 A schematic diagram of an electronic device according to an embodiment of the present invention;
[0038] Figure 8 This is a flow chart 7 of a mobile terminal extension loading method according to an embodiment of the present invention;
[0039] Fig. 9 This is a flowchart of a mobile terminal extension loading method according to an embodiment of the present invention;
[0040] Fig.10 This is a ninth flow chart of a mobile terminal extension loading method according to an embodiment of the present invention.
[0041] in, Figure 7 The corresponding relationship between the reference numerals and the component names is as follows:
[0042] 200: electronic device, 210: memory, 220: processor. DETAILED DESCRIPTION
[0043] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0044] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0045] Refer to the following Figures 1 to 10 The mobile terminal extension loading method, the electronic device 200 and the readable storage medium according to some embodiments of the present invention are described.
[0046] Embodiment 1:
[0047] like Figure 1 and Figure 2 As shown, this embodiment provides a mobile terminal extension loading method, including the following steps:
[0048] Step S102, obtaining an extension loading mode of the mobile terminal, where the extension loading mode includes full-page extension or module-level extension;
[0049] Step S104, based on the extension loading mode being full page extension, a replacement page is loaded through a configuration file to implement full page extension;
[0050] Step S106, based on the extension loading mode being module-level extension, module-level extension is implemented through an extension script.
[0051] At present, for mobile terminals, usage scenarios generally include applications (Apps), WeChat public accounts, WeChat applets, international versions, derived dedicated versions or dedicated deployment versions, etc. In the face of numerous dedicated scenarios and customer special needs and customer development needs, this embodiment proposes a mobile terminal expansion mechanism to achieve and meet customer needs without affecting standard products for different customized needs. Customer development refers to secondary development by customers, which makes functional changes to standard products or integrates with other systems for personalized needs.
[0052] In this embodiment, first, the extension loading mode of the mobile terminal is obtained, and the extension loading mode includes full-page extension or module-level extension, wherein the full-page extension is for the customization requirements of the entire module page, or 80% of the current module page needs to be customized, and the module-level extension is for the methods and / or properties of the local module or part of the module of the page. In this embodiment, the extension of the mobile terminal is divided into full-page extension and module-level extension, which can be flexibly selected according to the special needs and usage habits of different users, so that the customer experience is more comfortable, and at the same time, the development cycle of the mobile terminal is saved and the development cost is reduced. Then, for the full-page extension, the replacement page can be opened for the customer, and the method of loading the replacement page through the configuration file is adopted, and the method is simple and easy. Finally, for the module-level extension, the extension is realized by the extension script, and the module-level extension is realized by the extension script, which has high accuracy and reliability. Under the premise of not affecting the standard product, this embodiment performs extension development processing according to the special needs of different users and the usage habits of the product, balances the balance between product needs and user needs, improves user experience, and saves development costs.
[0053] Embodiment 2:
[0054] like Figure 3 As shown, in addition to the technical features of the above embodiment, this embodiment further includes the following technical features:
[0055] Through the configuration file, load the replacement page to achieve full page expansion, including the following steps:
[0056] Step S202, the client loads the page module and obtains the client configuration file;
[0057] Step S204, sending a routing request to the node server to obtain the address of the replacement page;
[0058] Step S206: the node server sends a request to obtain the remote page stream file of the replacement page and responds to the client.
[0059] For example, the application scenario may be: the user has a customer development team, and the customer development team has developed a replacement page. The original page of the system needs to be replaced with the replacement page. First, the client loads the page module and obtains the client configuration file. Then, a routing request is sent to the node server to obtain the address of the replacement page. Finally, the node server sends a request to obtain the remote page stream file of the replacement page and responds to the client. The user of the client accesses the replacement page. The method is simple and easy.
[0060] In this embodiment, the address of the replacement page is obtained to achieve full page expansion, which is easy to operate, has a good user experience, and can meet the diverse needs of users.
[0061] Embodiment 3:
[0062] like Figure 4 As shown, in addition to the technical features of the above embodiment, this embodiment further includes the following technical features:
[0063] Send a routing request to the node server to obtain the address of the replacement page, including the following steps:
[0064] Step S302, checking the client configuration file, based on the prefabricated custom route checked, requesting the prefabricated custom route, and sending the route request to the node server;
[0065] Step S304: After receiving the routing request, the node server matches the client configuration file with the node server configuration file to obtain the address of the replacement page.
[0066] A mapping relationship is set in the client configuration file, a custom route is prefabricated, and access to the custom route is achieved through the client configuration file, and finally, the address of the replacement page is obtained. In this embodiment, according to different customized requirements of users, the address of the replacement page is obtained to finally achieve full page expansion, and the method is simple and can meet customer needs without affecting standard products.
[0067] Embodiment 4:
[0068] like Figure 5 As shown, in addition to the technical features of the above embodiment, this embodiment further includes the following technical features:
[0069] Implementing module-level extension through extension scripts includes the following steps:
[0070] Step S402, the client loads the module script and obtains the extended script information;
[0071] Step S404: Extend the methods and / or properties in the extended script information to the module script.
[0072] For example, the application scenario may be: if the user is satisfied with most of the page and only needs to change or adjust a part of it, the modular expansion of a part of the page can be achieved through the embedded extension script.
[0073] The methods and / or properties in the extended script information are extended to the module script, merged, and then returned to the client for rendering and execution.
[0074] In this embodiment, modular expansion is achieved by extending the script, which is easy to operate and provides a good user experience, thereby meeting the diverse needs of users.
[0075] Embodiment 5:
[0076] like Figure 6 As shown, in addition to the technical features of the above embodiment, this embodiment further includes the following technical features:
[0077] The client loads the module script and obtains the extended script information, including the following steps:
[0078] Step S502, the client loads the module script and obtains the document flow information of the page document object model;
[0079] Step S504: parse the document flow information to obtain extended script information.
[0080] In this embodiment, the extended script can be on other servers, such as a remote server, a content delivery network (CDN) or the cloud, and the document flow information of the page document object model can be obtained by loading the module script, and the extended script information can be obtained by parsing the document flow information.
[0081] This embodiment supports storage of extended scripts on other servers according to actual user conditions, provides a more convenient way to obtain extended scripts, and improves the user experience.
[0082] Embodiment 6:
[0083] In addition to the technical features of the above embodiment, this embodiment further includes the following technical features:
[0084] The extended script supports overriding with the same name, which enables overriding of methods and / or properties by giving them the same name.
[0085] When performing modular expansion, methods and / or properties that need to be changed in the module script can be quickly replaced by using the same naming method in the expansion script. By adopting a method that supports same-name overwriting, quick replacement can be achieved to improve system operation stability.
[0086] Embodiment 7:
[0087] In addition to the technical features of the above embodiment, this embodiment further includes the following technical features:
[0088] When an extension script runs in a module instance, it directly accesses and / or modifies methods and properties within the module script.
[0089] In this embodiment, when the extension script runs in the module instance, the extension script is integrated into the module script, so the extension script can directly access and / or modify the methods and properties in the module script, thereby increasing the freedom of extension script development and improving user experience.
[0090] Embodiment 8:
[0091] In addition to the technical features of the above embodiment, this embodiment further includes the following technical features:
[0092] When the extension script runs in a module instance, it directly accesses the data information cached by the client.
[0093] In this embodiment, when the extension script runs in the module instance, the extension script is integrated into the module script, so the extension script can directly access the data information cached by the client, thereby increasing the freedom of extension script development and improving user experience.
[0094] The data information cached on the client may include: the data information cached by the application (App) on the client (including user login context information, login token, business data, etc.) and the data information cached in the client's LocalStroge (local storage, local cache), Cookies (small text files), etc.
[0095] Embodiment 9:
[0096] like Figure 7 As shown, this embodiment provides an electronic device 200, including: a memory 210 and a processor 220, the memory 210 stores programs and instructions, and the processor 220 executes the programs and instructions; wherein, when the processor 220 executes the programs and instructions, it implements the steps of the mobile terminal extension loading method as in any embodiment of the present invention.
[0097] Embodiment 10:
[0098] This embodiment provides a readable storage medium, which stores programs and instructions. When the programs and instructions are executed by a processor, the steps of the mobile terminal extension loading method in any of the above embodiments are implemented.
[0099] Embodiment 11:
[0100] This embodiment provides a mobile terminal expansion mechanism, which is applicable to the field of computer software, especially in the mobile terminal application scenario that tends to U-order. This embodiment can perform expansion development and processing according to the special needs of different users and the usage habits of the product, without affecting the standard products, and balancing product needs and user needs.
[0101] U-ordering mobile terminal usage scenarios include App, WeChat public account, WeChat applet, international version and derived exclusive version, exclusive deployment version, etc. Faced with numerous exclusive scenarios and special customer needs, we start to consider designing mobile terminal expansion mechanism based on customer needs, and aim at different customized needs, and try to achieve and meet customer needs without affecting standard products.
[0102] When facing customized needs of customers or customer-developed page access, a variety of page extension mechanisms can be used to meet the following requirements:
[0103] (1) Supports loading cross-domain pages and supports mutual communication and reading and writing cache information.
[0104] (2) Supports function expansion by module.
[0105] This embodiment is an extended loading mechanism created to meet the current demand for ordering mobile terminal products and customer customization needs, so as to realize customer customization needs.
[0106] There are three main types of extensions:
[0107] (1) Full page extension (custom route extension);
[0108] This expansion mode is suitable for when there is a need for customization of the entire module page or the non-reusable part of the current module page exceeds 80%. You can freely develop exclusive pages and finally provide a link after the page is deployed.
[0109] (2) Framework-level extension;
[0110] It is suitable for customized requirements on methods within the system framework. The core methods within the system can be replaced and expanded to meet one's own needs.
[0111] (3) Module-level expansion;
[0112] It is suitable for local extension of pages. For local page templates at the page module level and some internal methods of modules that do not meet the requirements, functional adjustments can be made by pre-making extension scripts of the module.
[0113] The process is: run the application (app running), analyze (analysis) the extension type (extend type). Based on module extension (mode extend), mode extension is adopted, node server is controlled to request the extension script (extend JS), prototype mode is controlled to the extension script (extend JS), controller is overridden, controller controls the constructor, preprocessing (before process), page initialization (beforepageinit), previous page (before pageback), etc., enters the page declaration event (page life event), and presents the page; common method extension is adopted, node server is used to request the extension script (extend JS), common method extension (common extend) is extended to the extension script (extendJS), controller is overridden, controller controls the constructor, preprocessing (before process), page initialization (before pageinit), page fallback event (before pageback), etc., enters the page life cycle event (page life event). event), and render the page. Based on the custom router (define page), it transmits (pipe) the defined page (define page) to the node server (node server) through the hypertext transfer protocol (http), and renders the page.
[0114] like Figure 8 As shown, specifically including:
[0115] Step S602, running the application;
[0116] Step S604, extending the type;
[0117] Based on module expansion, proceed to step S606, and based on a custom router, proceed to step 634;
[0118] Step S606, module expansion;
[0119] Based on the pattern expansion, the process goes to step S608; based on the public method expansion, the process goes to step S616;
[0120] Step S608, mode expansion;
[0121] Step S610, control;
[0122] Based on the control node server, proceed to step S612, otherwise, control the prototype mode to the extended script, cover the controller, and proceed to step S620;
[0123] Step S612, node server;
[0124] Node server requests extension script;
[0125] Step S614, extending the script;
[0126] Step S616, public method extension;
[0127] Based on the node server, proceed to step S618, otherwise, extend the extension script, cover the controller, and proceed to step S622;
[0128] Step S618, node server;
[0129] Node server requests extension script;
[0130] Step S620, controller;
[0131] Controlling step S624, step S626, step S628 and step S630;
[0132] Step S622, controller;
[0133] Controlling step S624, step S626, step S628 and step S630;
[0134] Step S624, constructor;
[0135] Then, proceed to step S632;
[0136] Step S626, preprocessing;
[0137] Then, proceed to step S632;
[0138] Step S628, page initialization;
[0139] Then, proceed to step S632;
[0140] Step S630, page rollback event;
[0141] Then, proceed to step S632;
[0142] Step S632, page life cycle events;
[0143] Then, proceed to step S640;
[0144] Step S634, customizing the router;
[0145] to the node server via Hypertext Transfer Protocol;
[0146] Step S636, node server;
[0147] Transfer to the definition page;
[0148] Step S638, define the page;
[0149] Step S640, presenting the page.
[0150] First, for full-page expansion;
[0151] The APP full page replacement extension method is mainly implemented through configuration files, mainly by setting the client configuration file and the node configuration file. The client will actively check the configuration file information when loading the module. If the system route of the module in the configuration file pre-sets the custom routing information, the system will redirect to the new routing system and send a routing request to the node. After receiving the routing request, the node matches it with the node configuration file, obtains the full URL of the replacement page, and sends a request on the node to read the remote page stream file and respond to the client.
[0152] The loaded remote page belongs to the same domain as the current page, and can imitate the original client to send http requests and complete data responses, etc.
[0153] The full page replacement process is to load the page module in the app client, check the router configuration, redirect the page if there is a redirect page, enter the node router, otherwise, directly enter the node router, check the server configuration in the node server, if there is custom routing information, request the define page, and then respond, otherwise, respond directly.
[0154] like Fig. 9 As shown, specifically including:
[0155] Step S702, loading the page module;
[0156] Step S704, check the configuration route;
[0157] If yes, go to step S706, if no, go to step S708;
[0158] Step S706, redirecting the page;
[0159] Step S708, node router;
[0160] Step S710, checking server configuration;
[0161] If yes, go to step S712, if no, go to step S716;
[0162] Step S712, request;
[0163] Step S714, define the page;
[0164] Step S716, response.
[0165] Second, for module-level expansion;
[0166] When the module script is loaded, the framework's loadPage is triggered to make an ajax request for the page, obtain the page DOM document stream information, and parse it, separate the template and Controller script and extended script information, parse the extended script information, and gradually extend the method attributes in the extended script information to the module script, and generate the module's controller instance through the new operation and attach it to the Controller cache for storage.
[0167] When the framework is in the process of loading the page life cycle, it will trigger the corresponding page life cycle events in stages and execute the original logic and extended logic of the corresponding events.
[0168] The extended script supports the principle of same-name overwriting. By naming the attribute method with the same name, the page-level attribute method can be overwritten to abolish the original execution logic and adopt the extended logic.
[0169] When the extension script runs in a module instance, the this scope points to the current controller instance, and the methods and properties in the module script can be directly accessed and modified. At the same time, the data information cached by the app on the client (including user login context information, login tokens, business data, etc.) and the data information cached in the client's LocalStorage and Cookies can also be accessed.
[0170] The module-level extension process is to load the model (load model), load the controller (loadcontroller), load the extension (load extend), load the extension method (anly extend, a description of the extension loaded in the previous step, which is one or several of the loading extension methods), create a new controller (new controller), set the constructor (constructor) in the page events (page events), perform page preinit (page preinit), page initialization (pageinit), page deletion (pageremove), etc.
[0171] like Fig.10 As shown, specifically including:
[0172] Step S802, loading the model;
[0173] Step S804, loading the controller;
[0174] Step S806, loading the extension;
[0175] Step S808, loading the extension mode;
[0176] Step S810: Create a new controller
[0177] Step S812, page event, constructor;
[0178] Step S814, page event, page pre-initialization;
[0179] Step S816, page event, page initialization;
[0180] Step S818, page event, page deletion;
[0181] Step S820, page event.
[0182] Perform other operations on the page.
[0183] This embodiment solves the cross-domain problem generated when embedding through iframe when developing pages for customers, and the customer-developed pages can also reuse the web server and client cache information of the original product.
[0184] In summary, the beneficial effects of the embodiments of the present invention are:
[0185] 1. This embodiment divides the extension of the mobile terminal into full-page extension and module-level extension, which can be flexibly selected according to the special needs and usage habits of different users, making the customer experience more comfortable. At the same time, it saves the development cycle of the mobile terminal and reduces the development cost.
[0186] 2. In the full page expansion of this embodiment, the replacement page can be a guest page, and the replacement page is loaded through a configuration file, which is simple and easy.
[0187] 3. The module-level expansion in this embodiment is achieved through an extension script. The module-level expansion is achieved by using an extension script, which has high accuracy and reliability.
[0188] 4. Under the premise of not affecting standard products, this embodiment performs extended development processing according to the special needs of different users and product usage habits, balances product needs and user needs, improves user experience, and saves development costs.
[0189] In the present invention, the terms "first", "second", and "third" are used for descriptive purposes only and should not be understood as indicating or implying relative importance; the term "plurality" refers to two or more, unless otherwise clearly defined. The terms "installed", "connected", "connected", "fixed", etc. should be understood in a broad sense. For example, "connected" can be a fixed connection, a detachable connection, or an integral connection; "connected" can be a direct connection or an indirect connection through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0190] In the description of the present invention, it is necessary to understand that the directions or positional relationships indicated by terms such as “upper”, “lower”, “left”, “right”, “front” and “back” are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or unit referred to must have a specific direction, be constructed and operated in a specific orientation, and therefore, cannot be understood as a limitation on the present invention.
[0191] In the description of this specification, the description of the terms "one embodiment", "some embodiments", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0192] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A mobile terminal extension loading method, characterized in that: include: Obtaining an extension loading mode of a mobile terminal, wherein the extension loading mode includes full-page extension or module-level extension; Based on the extension loading mode being the full-page extension, a replacement page is loaded through a configuration file to implement the full-page extension; Based on the fact that the extension loading mode is module-level extension, the module-level extension is realized through an extension script; The module-level extension is realized by extending the script, including: The client loads the module script and obtains the extended script information; The methods and / or properties in the extended script information are extended to the module script, integrated, and returned to the client for rendering and execution.
2. The mobile terminal extension loading method according to claim 1, characterized in that: The method of loading a replacement page through a configuration file to implement the full page expansion includes: The client loads the page module and obtains the client configuration file; Sending a routing request to the node server to obtain the address of the replacement page; The node server sends a request to obtain the remote page stream file of the replacement page and responds to the client.
3. The mobile terminal extension loading method according to claim 2, characterized in that: The sending of a routing request to the node server to obtain the address of the replacement page includes: Check the client configuration file, based on the prefabricated custom route checked, request the prefabricated custom route, and send a route request to the node server; After receiving the routing request, the node server matches the client configuration file with the node server configuration file to obtain the address of the replacement page.
4. The mobile terminal extension loading method according to claim 1, characterized in that: The client loads the module script and obtains extended script information, including: The client loads the module script and obtains the document flow information of the page document object model; The document flow information is parsed to obtain extended script information.
5. The mobile terminal extension loading method according to claim 1, characterized in that: The extension script supports same-name overwriting, and overwriting the method and / or the property is achieved by giving the method and / or the property the same name.
6. The mobile terminal extension loading method according to claim 1, characterized in that: When the extension script runs in a module instance, it directly accesses and / or modifies methods and properties in the module script.
7. The mobile terminal extension loading method according to claim 6, characterized in that: When the extension script runs in the module instance, it directly accesses the data information cached by the client.
8. An electronic device (200), characterized in that: include: A memory (210) storing programs or instructions; A processor (220) for executing the program or instruction; Wherein, when executing the program or instruction, the processor (220) implements the steps of the mobile terminal extension loading method as described in any one of claims 1 to 7.
9. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps of the mobile terminal extension loading method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method for realizing page insertion in WEB application and WEB server
CN101727490A
Application service dynamic switching method, system and device and storage medium
CN110764895A
Marking method and device for characters in web page, computer equipment and storage medium
CN111800492A
