A page display method, device, electronic device and storage medium
By calling and running public functional modules from shared locations in the front-end architecture, the problem of high maintenance costs of multiple business sharing modules is solved, and efficient resource utilization and maintenance costs are achieved.
Patent Information
- Application Number
- CN202010331522.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-24
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2040-04-24
AI Technical Summary
In the front-end architecture, the same functional modules shared by multiple businesses are costly to maintain because developers of each business need to independently maintain these modules, resulting in waste of resources and duplicate work.
By calling and running public functional modules from a designated shared location, centralized maintenance of multiple business sharing modules is achieved, reducing the maintenance needs of developers for each business. The method includes obtaining the page loading request, loading the display object, and calling and running the public function module during the loading process. The public function module is the same module shared by the target business and other services.
It reduces the maintenance cost of multiple business-same modules in the front-end architecture, improves resource utilization, and reduces duplicate maintenance work. Specialized developers can be responsible for the maintenance of public modules.
Smart Images

Figure CN113553522B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of front-end technology, and in particular to a page display method, device, electronic device and storage medium. Background Art
[0002] Front-end development is the process of creating front-end interfaces such as web pages or APP (Application) pages to present to users and realize user interface interaction of Internet products. Usually, the front-end architecture includes multiple businesses. For example, in a video website, different businesses such as news, sports, and variety shows are included. For each business, it is necessary to maintain the functional modules of the business. Different functional modules correspond to different display objects that need to be loaded when displaying the page of the business. By running the functional modules of the business, the loading of the display objects corresponding to each functional module can be completed, so that the corresponding page of the business can be displayed on the front end.
[0003] However, the inventors found in the process of implementing the present invention that the related art has at least the following problems:
[0004] Multiple different businesses may have the same functional modules. For example, in a video website, the news, sports and variety shows all maintain the same header module and menu module. When maintaining these same functional modules, for example, revising these same functional modules, the developers of each business have to modify these modules, wasting a lot of human resources. It can be seen that in the related art, the maintenance cost is high for the same modules of multiple businesses in the front-end architecture. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide a page display method, device, electronic device and storage medium to reduce the maintenance cost of the same modules of multiple services in the front-end architecture. The specific technical solution is as follows:
[0006] In a first aspect, an embodiment of the present invention provides a page display method, which is applied to a client, and the method includes:
[0007] Obtain a loading request for a page of a target business;
[0008] In response to the loading request, each display object in the page is loaded;
[0009] In the process of loading each display object, a specified common function module is called and run from a specified shared location to complete the loading of the display object corresponding to the common function module; the common function module is the same function module possessed by the target business and other businesses other than the target business.
[0010] Optionally, calling and executing a specified common function module from a specified shared location includes:
[0011] By accessing the target link, the specified common function module is called and run from the specified shared location; wherein the target link is the access address information generated after packaging the code corresponding to the common function module and is used to access the common function module from the specified shared location.
[0012] Optionally, the code corresponding to the common function module is written based on native JavaScript.
[0013] Optionally, the method of packaging the code corresponding to the common function module includes:
[0014] Based on the gulp technology, the codes corresponding to the common function modules are packaged.
[0015] Optionally, the target link includes a JS link, or the target link includes a JS link and a Cascading Style Sheet (CSS) link.
[0016] Optionally, by accessing the target link, calling and running the specified public function module from the specified shared location, including:
[0017] When it is determined that the loading request is issued by a third application, calling and running a specified common function module from a specified shared location by accessing a first target link corresponding to the third-party application;
[0018] otherwise, calling and running the specified public function module from the specified shared location by accessing the second target link;
[0019] The first target link is access address information required for a third application to access the common function module, and the second target link is access address information required for the client to access the common function module.
[0020] In a second aspect, an embodiment of the present invention provides a page display device, applied to a client, the device comprising:
[0021] An acquisition module, used to obtain a loading request for a page of a target business;
[0022] A first loading module, configured to respond to the loading request and load each display object in the page;
[0023] The second loading module is used to call and run the specified common function module from the specified shared location during the process of loading each display object, so as to complete the loading of the display object corresponding to the common function module; the common function module is the same function module as the target business and other businesses other than the target business.
[0024] Optionally, the second loading module is specifically used to call and run a specified common function module from a specified shared location by accessing a target link; wherein the target link is access address information generated after packaging the code corresponding to the common function module and required for accessing the common function module from the specified shared location.
[0025] Optionally, the code corresponding to the common function module is written based on native JavaScript.
[0026] Optionally, the device further comprises:
[0027] The packaging module is used to package the codes corresponding to the common function modules based on the gulp technology.
[0028] Optionally, the target link includes a JS link, or the target link includes a JS link and a CSS link.
[0029] Optionally, the second loading module includes: a first loading unit and a second loading unit;
[0030] The first loading unit is configured to, when it is determined that the loading request is issued by a third application, call and run the specified common function module from a specified shared location by accessing a first target link corresponding to the third-party application; otherwise, trigger the second loading unit;
[0031] The second loading unit is used to call and run the specified common function module from the specified shared location by accessing the second target link;
[0032] The first target link is access address information required for a third application to access the common function module, and the second target link is access address information required for the client to access the common function module.
[0033] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0034] Memory, used to store computer programs;
[0035] The processor is used to implement the page display method steps described in the first aspect above when executing the program stored in the memory.
[0036] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the page display method steps described in the first aspect above are implemented.
[0037] In the page display method provided by the embodiment of the present invention, a loading request for a page for a target business is obtained; each display object in the page is loaded; in the process of loading each display object, a specified common function module is called and run from a specified shared location to complete the loading of the display object corresponding to the common function module; the common function module is the same function module possessed by the target business and other businesses other than the target business. It can be seen that in this solution, the same function modules possessed by multiple businesses are called and run from a specified shared location as common function modules, and these common function modules do not need to be maintained by the developers of each business, but can be maintained by dedicated developers. Therefore, this solution can reduce the maintenance cost of the same modules of multiple businesses in the front-end architecture.
[0038] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0040] Figure 1 A flow chart of a page display method provided by an embodiment of the present invention;
[0041] Figure 2 It is a schematic diagram of the front-end architecture in the prior art;
[0042] Figure 3 A schematic diagram of a front-end structure in an embodiment of the present invention;
[0043] Figure 4 A flowchart of another page display method provided by an embodiment of the present invention;
[0044] Figure 5 A structural diagram of a page display device provided by an embodiment of the present invention;
[0045] Figure 6 A structural diagram of another page display device provided by an embodiment of the present invention;
[0046] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0048] In order to solve the problems in the prior art, the embodiments of the present invention provide a page display method, device, electronic device and storage medium. The page display method provided by the embodiments of the present invention can be applied to a client. There can be many types of clients, for example, in terms of business type, the client can be a video, news, shopping, map client, etc. In terms of display form, the client can be an APP or a web client.
[0049] like Figure 1 As shown, a page display method provided by the present invention may include the following steps:
[0050] S101, obtaining a loading request for a page of a target business.
[0051] The front-end architecture of the client can include multiple services. For example, in a video website, different services such as news, sports, and variety shows can be included. Each service can correspond to multiple pages. When a user accesses the client and needs to open a page of a certain service, the service is regarded as the target service. Then, the user can issue a loading request for a page of the target service by clicking, sliding, etc. in the client.
[0052] S102, responding to the loading request, loading each display object in the page.
[0053] When the client receives a page loading request for the target service, it can respond to the loading request and load various display objects in the page. The types of display objects in the page may include: pictures, animations, videos, links, buttons, input windows, menus, etc.
[0054] S103, in the process of loading each display object, calling and running the specified common function module from the specified shared location to complete the loading of the display object corresponding to the common function module.
[0055] The common function module is the same function module that the target business and other businesses other than the target business have.
[0056] Among the various display objects that need to be loaded, there may be display objects corresponding to certain public function modules in the target business. For these display objects, the specified public function modules can be called and run from the specified shared location to complete the loading of these display objects. Among them, the specified public function modules refer to the public function modules in the target business that need to be accessed when loading the various display objects of the above-mentioned page. For example, the target business includes 3 public function modules, namely public function modules 1 to 3. When loading the various display objects of the above-mentioned page, only public function modules 1 and 2 in the target business need to be accessed. That is to say, among the various display objects that need to be loaded, there are display objects corresponding to public function modules 1 and 2 respectively. Then, the specified public function modules are public function modules 1 and 2.
[0057] In this embodiment, the common function module is not maintained by the developers of each business including the common function module, but can be maintained by a dedicated developer. Specifically, it is not maintained by the developers of each business in the code repository of the business, but can be maintained by a dedicated developer in a separate code repository. Therefore, when it is necessary to access the common function module, the common function module can be called and run from a designated shared location, and the designated shared location is the access location of the common function module.
[0058] For easier understanding, see Figure 2 and Figure 3 , Figure 2 is a schematic diagram of a front-end mechanism in the prior art, Figure 3 Schematic diagram of the front-end architecture in an embodiment of the present invention. Figure 2 In the front-end architecture shown, the header module and menu module, which are the same functional modules in services 1 to 3, are all called in the code repository of each service and maintained by the developers of each service. Figure 3 In the front-end architecture shown, the header module and the menu module, which are the same functional modules in services 1 to 3, are called as common functional modules and maintained by dedicated developers.
[0059] application Figure 1 In the embodiment shown, a loading request for a page of a target business is obtained; each display object in the page is loaded; in the process of loading each display object, a specified common function module is called and run from a specified shared location to complete the loading of the display object corresponding to the common function module; the common function module is the same function module that the target business and other businesses other than the target business have. Figure 1In the embodiment shown, the same function modules of multiple services are called and run as common function modules from a designated shared location. These common function modules do not need to be maintained by developers of each service, but can be maintained by dedicated developers. Therefore, this solution can reduce the maintenance cost of the same modules of multiple services in the front-end architecture.
[0060] Optionally, in one implementation, Figure 1 In the illustrated embodiment, calling and executing the specified common function module from the specified shared location in step S103 may include:
[0061] By accessing the target link, the specified public function module is called and run from the specified shared location; wherein the target link is the access address information generated after packaging the code corresponding to the public function module and is used to access the public function module from the specified shared location.
[0062] When maintaining a public function module separately, in order to facilitate each business to access the public function module, the code corresponding to the public function module can be packaged and a target link corresponding to the public function module can be generated. The target link is the access address information required to access the public function module from a specified shared location. By accessing the target link, the specified public function module can be called and run from the specified shared location.
[0063] Specifically, the process of loading each display object of a page may be the process of running the page code corresponding to the page. Then, the target link may be introduced into the page code, so that in the process of running the page code, the target link is accessed, and the specified common function module is called and run from the specified shared location, so as to load the display object corresponding to the common function module. Exemplarily, in the front-end technology, the page code may be an HTML (HyperText Markup Language) file, and thus, the target link may be introduced into the HTML file corresponding to the page.
[0064] Optionally, the code corresponding to the common function module can be written based on native JavaScript language, but it is not limited to this. The JS (JavaScript) file written based on native JavaScript language is an unencapsulated JS file, that is, no framework is used. The code corresponding to the common function module written based on native JavaScript language can be applied to any front-end framework type, such as react, vue or angular.
[0065] Optionally, the method of packaging the code corresponding to the common function module may include: packaging the code corresponding to the common function module based on gulp technology. Among them, gulp technology is an automated construction tool in front-end development, which can merge, compress and package the code. In this embodiment, the code corresponding to the common function module is packaged based on gulp technology to generate a target link corresponding to the common function module.
[0066] Optionally, the target link includes a JS link, or includes a JS link and a CSS link.
[0067] When the code corresponding to the common function module is written based on the native JavaScript language and the code is packaged, the packaged common function module is a JS file, which contains the JS code corresponding to the common function module. Therefore, after the code corresponding to the common function module is packaged, the generated target link is a JS link.
[0068] It is understandable that if the common function module does not include the page style, the target link only includes the JS link; if the common function module includes the page style, the target link includes a CSS (Cascading Style Sheets) link in addition to the JS link. The CSS link corresponds to the CSS file, which includes the specific content of the defined page style.
[0069] Since page loading requests can be issued in the client or through a third-party application, in order to adapt to these two issuance methods, such as Figure 4 As shown, another page display method provided by an embodiment of the present invention may include the following steps:
[0070] S401, obtaining a loading request for a page of a target business.
[0071] S402, responding to the loading request, loading each display object in the page.
[0072] Steps S401 and S402 can be respectively Figure 1 Steps S101 and S102 in the embodiment are identical and will not be described in detail here.
[0073] S403, in the process of loading each display object, when it is determined that the loading request is issued by a third application, the first target link corresponding to the third-party application is accessed, and the specified public function module is called and run from the specified shared location to complete the loading of the display object corresponding to the public function module; otherwise, the second target link is accessed, and the specified public function module is called and run from the specified shared location to complete the loading of the display object corresponding to the public function module.
[0074] The first target link is the access address information required for the third application to access the common function module, and the second target link is the access address information required for the client to access the common function module.
[0075] In actual applications, the target business page can be opened from the client or from a third-party application. For example, the target business page can be opened from a small program corresponding to the client in a third-party application.
[0076] When it is determined that the loading request is issued by a third-party application, that is, when it is determined that the page of the target business is opened from a third-party application, for the public function module specified in the target business, the specified public function module can be called and run from the specified shared location by accessing the access address information required to access the public function module from the third-party application. If it is determined that the page of the target business is not opened from a third-party application, which means that the page of the target business is opened from the client, then for the public function module specified in the target business, the specified public function module can be called and run from the specified shared location by accessing the access address information required to access the public function module from the client.
[0077] That is to say, when opening a page from the client and opening a page from a third-party application, the specified public function module is called and run by accessing different access addresses to complete the loading of the display object corresponding to the specified public function module. It is understandable that for the operator of the client, when the user has not installed the client software or it is inconvenient to open the client software, the operator hopes that the user can also open the page through a third-party application. In order to facilitate the user to open the page from a third-party application, the operator can provide special access address information to the third-party application, that is, the above-mentioned first target link. In this way, when the page of the target business is opened from a third-party application, the specified public function module can be called and run from the specified shared location by accessing the first target link, thereby realizing the pluggable nature of the client's business, that is, the public function module of the target business can also be called and run in the third-party application.
[0078] application Figure 4 In the embodiment shown, a loading request for a page of a target business is obtained; each display object in the page is loaded; in the process of loading each display object, when it is determined that the loading request is issued by a third application, the first target link corresponding to the third-party application is accessed, and the specified public function module is called and run from the specified shared location to complete the loading of the display object corresponding to the public function module; otherwise, the second target link is accessed, and the specified public function module is called and run from the specified shared location to complete the loading of the display object corresponding to the public function module. It can be seen that the application Figure 4 In the illustrated embodiment, the same function modules of multiple businesses are called and run from a specified shared location as common function modules. These common function modules do not need to be maintained by developers of each business, but can be maintained by specialized developers. Therefore, the maintenance cost of the same modules of multiple businesses in the front-end architecture can be reduced through this solution. Moreover, when the page of the target business is opened from a third-party application, the specified common function module can be called and run from the specified shared location by accessing the first target link, thereby achieving the pluggability of the client's business, that is, the common function module of the target business can also be called and run in the third-party application.
[0079] The embodiment of the present invention also provides a page display device, which is applied to a client, such as Figure 5 As shown, the device comprises:
[0080] The acquisition module 501 is used to obtain a loading request for a page of a target business;
[0081] A first loading module 502, configured to respond to the loading request and load each display object in the page;
[0082] The second loading module 503 is used to call and run a specified common function module from a specified shared location during the process of loading each display object, so as to complete the loading of the display object corresponding to the common function module; the common function module is the same function module as that of the target business and other businesses other than the target business.
[0083] application Figure 5 In the embodiment shown, a loading request for a page of a target business is obtained; each display object in the page is loaded; in the process of loading each display object, a specified common function module is called and run from a specified shared location to complete the loading of the display object corresponding to the common function module; the common function module is the same function module that the target business and other businesses other than the target business have. Figure 5 In the embodiment shown, the same function modules of multiple services are called and run as common function modules from a designated shared location. These common function modules do not need to be maintained by developers of each service, but can be maintained by dedicated developers. Therefore, this solution can reduce the maintenance cost of the same modules of multiple services in the front-end architecture.
[0084] Optionally, the first loading module 502 is specifically used to call and run a specified common function module from a specified shared location by accessing a target link; wherein the target link is access address information generated after packaging the code corresponding to the common function module and required for accessing the common function module from the specified shared location.
[0085] Optionally, the code corresponding to the common function module is written based on native JavaScript.
[0086] Optionally, the device further comprises:
[0087] The packaging module is used to package the codes corresponding to the common function modules based on the gulp technology.
[0088] Optionally, the target link includes a JS link, or includes a JS link and a CSS link.
[0089] Since page loading requests can be issued in the client or through a third-party application, in order to adapt to these two issuance methods, such as Figure 6 As shown, another page display device provided by an embodiment of the present invention may include:
[0090] The acquisition module 601 is used to obtain a loading request for a page of a target business;
[0091] A first loading module 602, configured to respond to the loading request and load each display object in the page;
[0092] The second loading module 603 includes: a first loading unit 6031 and a second loading unit 6032;
[0093] The first loading unit 6031 is used to call and run the specified common function module from the specified shared location by accessing the first target link corresponding to the third-party application when it is determined that the loading request is issued by the third-party application; otherwise, trigger the second loading unit 6032;
[0094] The second loading unit 6032 is used to call and run the specified common function module from the specified shared location by accessing the second target link.
[0095] The first target link is access address information required for a third application to access the common function module, and the second target link is access address information required for the client to access the common function module.
[0096] application Figure 6In the embodiment shown, a loading request for a page of a target business is obtained; each display object in the page is loaded; in the process of loading each display object, when it is determined that the loading request is issued by a third application, the first target link corresponding to the third-party application is accessed, and the specified public function module is called and run from the specified shared location to complete the loading of the display object corresponding to the public function module; otherwise, the second target link is accessed, and the specified public function module is called and run from the specified shared location to complete the loading of the display object corresponding to the public function module. It can be seen that the application Figure 6 In the illustrated embodiment, the same function modules of multiple businesses are called and run from a specified shared location as common function modules. These common function modules do not need to be maintained by developers of each business, but can be maintained by specialized developers. Therefore, the maintenance cost of the same modules of multiple businesses in the front-end architecture can be reduced through this solution. Moreover, when the page of the target business is opened from a third-party application, the specified common function module can be called and run from the specified shared location by accessing the first target link, thereby achieving the pluggability of the client's business, that is, the common function module of the target business can also be called and run in the third-party application.
[0097] The embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.
[0098] Memory 703, used for storing computer programs;
[0099] The processor 701 is used to implement a page display method when executing the program stored in the memory 703. The page display method is applied to the client and includes:
[0100] Obtain a loading request for a page of a target business;
[0101] Respond to the loading request and load each display object in the page;
[0102] In the process of loading each display object, the specified common function module is called and run from the specified shared location to complete the loading of the display object corresponding to the common function module; the common function module is the same function module possessed by the target business and other businesses other than the target business.
[0103] Optionally, calling and executing a specified public function module from a specified shared location includes:
[0104] By accessing the target link, the specified public function module is called and run from the specified shared location; wherein the target link is the access address information generated after packaging the code corresponding to the public function module and is used to access the public function module from the specified shared location.
[0105] Optionally, the code corresponding to the public function module is written based on native JavaScript.
[0106] Optionally, the method of packaging the codes corresponding to the common function modules includes:
[0107] Based on gulp technology, the codes corresponding to the public function modules are packaged.
[0108] Optionally, the target link includes a JS link, or the target link includes a JS link and a Cascading Style Sheet (CSS) link.
[0109] Optionally, by accessing the target link, calling and running the specified public function module from the specified shared location, including:
[0110] When it is determined that the loading request is issued by a third application, calling and running the specified common function module from the specified shared location by accessing the first target link corresponding to the third-party application;
[0111] otherwise, calling and running the specified public function module from the specified shared location by accessing the second target link;
[0112] The first target link is the access address information required for the third application to access the common function module, and the second target link is the access address information required for the client to access the common function module.
[0113] application Figure 7 In the embodiment shown, a loading request for a page of a target business is obtained; each display object in the page is loaded; in the process of loading each display object, a specified common function module is called and run from a specified shared location to complete the loading of the display object corresponding to the common function module; the common function module is the same function module that the target business and other businesses other than the target business have. Figure 7 In the embodiment shown, the same function modules of multiple services are called and run as common function modules from a designated shared location. These common function modules do not need to be maintained by developers of each service, but can be maintained by dedicated developers. Therefore, this solution can reduce the maintenance cost of the same modules of multiple services in the front-end architecture.
[0114] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0115] The communication interface is used for communication between the above electronic device and other devices.
[0116] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0117] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0118] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the page display method described in any of the above embodiments to obtain the same technical effect.
[0119] In another embodiment provided by the present invention, a computer program product including instructions is also provided. When the computer program product is run on a computer, the computer executes the page display method described in any of the above embodiments to obtain the same technical effect.
[0120] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0121] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0122] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for embodiments such as devices, electronic devices, and storage media, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0123] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A page display method, It is characterized in that Applied to a client, the front-end architecture of the client includes multiple services, and the method includes: Obtaining a loading request for a page of a target business, wherein the target business includes a common function module, the common function module is a common function module possessed by the target business and other businesses other than the target business, and the common function module is maintained by a developer who does not belong to each business; In response to the loading request, the page code corresponding to the page is run to load each display object of the page, the page code introduces a target link, and in the process of running the page code, the target link is accessed, the common function module is called and run from the specified shared location, and the loading of the display object corresponding to the common function module is completed, wherein the target link is generated after the code corresponding to the common function module is packaged, and is used for accessing the common function module from the specified shared location. The code corresponding to the common function module is written based on native JavaScript; The access target link, calling and running the common function module from a specified shared location, includes: When it is determined that the loading request is issued by a third-party application, calling and running the common function module from a designated shared location by accessing a first target link corresponding to the third-party application; otherwise, calling and running the common function module from the designated shared location by accessing the second target link; The first target link is access address information required for a third-party application to access the public function module, and the second target link is access address information required for the client to access the public function module.
2. The method according to claim 1, It is characterized in that The method of packaging the code corresponding to the common function module includes: Based on the gulp technology, the codes corresponding to the common function modules are packaged.
3. The method according to claim 1, It is characterized in that The target link includes a JS link, or the target link includes a JS link and a Cascading Style Sheet (CSS) link.
4. A page display device, It is characterized in that Applied to a client, the front-end architecture of the client includes multiple services, and the device includes: An acquisition module, used for obtaining a loading request for a page of a target business, wherein the target business includes a common function module, the common function module is a common function module of the target business and other businesses other than the target business, and the common function module is maintained by a developer who does not belong to each business; A first loading module, for responding to the loading request, running the page code corresponding to the page to load each display object of the page, wherein the page code introduces a target link; A second loading module is used to access the target link during the process of running the page code, and for a common function module included in the target business, call and run the common function module from a designated shared location to complete the loading of a display object corresponding to the common function module, wherein the target link is access address information generated after packaging the code corresponding to the common function module and required for accessing the common function module from the designated shared location, and the code corresponding to the common function module is written based on native JavaScript; Among them, the second loading module is specifically used to call and run the common function module from a specified shared location by accessing a first target link corresponding to the third-party application when it is determined that the loading request is issued by a third-party application; otherwise, call and run the common function module from a specified shared location by accessing a second target link; wherein the first target link is the access address information required for the third-party application to access the common function module, and the second target link is the access address information required for the client to access the common function module.
5. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 3 when executing a program stored in a memory.
6. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Page display method and apparatus in composite webpage system
CN106528587A
