CN112631682A - Applet processing method, device, equipment and storage medium - Google Patents

Applet processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN112631682A
CN112631682A CN202011594981.9A CN202011594981A CN112631682A CN 112631682 A CN112631682 A CN 112631682A CN 202011594981 A CN202011594981 A CN 202011594981A CN 112631682 A CN112631682 A CN 112631682A
Authority
CN
China
Prior art keywords
page
target page
file
component
frequently
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011594981.9A
Other languages
Chinese (zh)
Inventor
朱鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202011594981.9A priority Critical patent/CN112631682A/en
Publication of CN112631682A publication Critical patent/CN112631682A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44557Code layout in executable memory
    • G06F9/44563Sharing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a small program processing method, a device, equipment and a storage medium, and relates to the technical field of small programs and the technical field of intelligent terminals. The specific implementation scheme is as follows: responding to a detected resource loading request of a target page under the applet, and acquiring configuration information of the target page; and according to the configuration information, if the target page is determined to belong to one page of the configured frequently-visited pages, carrying out resource loading processing on the target page under the applet according to the shared component file which is pre-configured and corresponds to the frequently-visited page. Therefore, according to whether the target page is a frequently accessed page and a shared component file, the page under the applet is subjected to resource loading processing in a targeted mode, excessive page loading of components irrelevant to the page is avoided, and page loading performance of the applet is improved.

Description

Applet processing method, device, equipment and storage medium
Technical Field
The present application relates to the field of applet technology and intelligent terminal technology in the field of computer technology, and in particular, to an applet processing method, apparatus, device, and storage medium.
Background
An applet generally includes a logic layer and a view layer, and the same functional module, such as a "search box" and a "file upload button", is used for multiple pages in the view layer. In order to avoid repeated development of the functional modules, developers abstract the functional modules frequently used by the view layer into the custom assembly, and the applet calls the custom assembly to realize the functional view on the page when the page is loaded.
With the function of the applet becoming more and more complex, the number of the custom components increasing, and the volume of the custom component file also becoming larger and larger, many custom components irrelevant to the current page can be loaded when the page of the applet is loaded, and the page loading performance is further affected.
Therefore, how to effectively manage the custom components in the applet to improve the page loading performance of the applet is a problem that needs to be solved urgently.
Disclosure of Invention
The application provides an applet processing method, an applet processing device, an applet processing apparatus and a storage medium.
According to a first aspect of the present application, there is provided an applet processing method including:
responding to the detected resource loading request of the target page under the applet, and acquiring the configuration information of the target page;
and according to the configuration information, if the target page is determined to belong to one of configured frequently-accessed pages, carrying out resource loading processing on the target page under the applet according to a shared component file which is pre-configured and corresponds to the frequently-accessed page.
According to a second aspect of the present application, there is provided an applet processing apparatus comprising:
the acquisition unit is used for responding to the detected resource loading request of the target page under the small program and acquiring the configuration information of the target page;
and the loading unit is used for carrying out resource loading processing on the target page under the applet according to the shared component file which is pre-configured and corresponds to the frequently-accessed page if the target page is determined to belong to one of the configured frequently-accessed pages according to the configuration information.
According to a third aspect of the present application, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method according to the first aspect.
According to a fourth aspect of the present application, there is provided a chip comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method according to the first aspect.
According to a fifth aspect of the present application, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of the first aspect as described above.
According to a sixth aspect of the present application, there is provided a computer program product comprising: a computer program, stored in a readable storage medium, from which at least one processor of an electronic device can read the computer program, execution of the computer program by the at least one processor causing the electronic device to perform the method of the first aspect.
The small program processing method, the small program processing device, the small program processing equipment and the storage medium respond to the detected resource loading request of the target page and acquire the configuration information of the target page; and according to the configuration information, if the target page is determined to belong to one page of the configured frequently-accessed pages, carrying out resource loading processing on the target page under the applet according to the shared component file which is pre-configured and corresponds to the accessed page. Therefore, the size of the component file is reduced through the pre-configured shared component file, the resource loading processing is performed on the frequently-visited page in a targeted manner according to whether the target page belongs to the configured frequently-visited page or not, the phenomenon that the target page is excessively loaded with components irrelevant to the target page is avoided, and the page loading performance of the applet is effectively improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present application, nor do they limit the scope of the present application. Other features of the present application will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a schematic flow chart of a page loading method in the related art;
fig. 2 is a schematic diagram of an application scenario applicable to the embodiment of the present application;
fig. 3 is a flowchart illustrating an applet processing method according to an embodiment of the present application;
FIG. 4 is an exemplary diagram of a relationship between a page and a component in an applet, provided by an embodiment of the present application;
fig. 5 is a flowchart illustrating an applet processing method according to another embodiment of the present application;
fig. 6 is a flowchart illustrating an applet processing method according to another embodiment of the present application;
FIG. 7 is a diagram illustrating an example of loading resources into a page in an applet, according to an embodiment of the present application;
FIG. 8 is a flowchart illustrating an applet processing method according to another embodiment of the present application;
fig. 9 is a flowchart illustrating an applet processing method according to another embodiment of the present application;
fig. 10 is a schematic structural diagram of an applet processing apparatus according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
An applet is an application that can be used without installation, or, alternatively, is a lightweight application.
The applet comprises a logic layer and a view layer, the logic layer performs data processing and feeds back the processed data to the view layer, the view layer interacts with a user and feeds back an event based on user interaction detection to the logic layer. In the view layer, an applet typically has multiple pages. When the applet has multiple pages, different pages may use the same function module, for example, the same search box and the same file upload button are provided on different two pages.
In the process of page development, in order to avoid repeated development of the same functional module and reduce code redundancy, developers abstract the same functional module adopted by a plurality of pages into a self-defined component. That is, the custom component is a code written by a developer and is used to implement an abstract function or service, and the page may display a corresponding component view on the page view by calling the custom component. For example, by invoking a custom component of the search box, a component view of the search box is displayed on the page.
For simplicity of description, custom components are subsequently referred to as components.
Besides the component view, the page also includes non-componentized view elements, such as background color of the page, layout of the page, and the non-componentized view elements of each page are usually specific to each page.
In the related art, developers tend to write all components of an applet in the same component file, and write codes of view elements of each page, which are not componentized, in the view file of each page, and different pages can load the components by loading the component file, so that code redundancy can be effectively reduced. Meanwhile, each page can realize the loading of other view elements by loading the respective view file.
However, as the functions of the applet become more complex, the number of the components increases, the size of the component file also becomes larger, and when the page of the applet is loaded, many custom components which are not related to the current page are loaded, so that the page loading performance is poor. In the related art, as shown in fig. 1, after a page resource request is received, whether a page uses components is determined, if yes, component files where all components are located are loaded, and a view file is loaded, otherwise, the view file is directly loaded.
Therefore, in order to avoid that a page needs to load too many components unrelated to the page itself and provide the page loading performance of the applet, embodiments of the present application provide a method, an apparatus, a device, and a storage medium for processing the applet, where in a case where a resource loading request of a target page is detected, configuration information of the target page is obtained, and according to the configuration information, if it is determined that the target page belongs to one of configured frequently-accessed pages, resource loading processing is performed on the target page under the applet according to a shared component file that is pre-configured and corresponds to the frequently-accessed page. Therefore, the size of the component file is reduced by sharing the component file, and the targeted component file is provided for the page of the applet according to whether the target page belongs to the frequently accessed page, so that excessive components irrelevant to the page are prevented from being loaded on the page, targeted resource loading processing is provided for the page, and page loading performance is effectively provided.
Fig. 2 is a schematic diagram of an application scenario applicable to the embodiment of the present application. As shown in fig. 2, the application scenario includes a terminal device and a server, and network communication is performed between the terminal device and the server. In the application scene, a user opens an applet on the terminal device or performs page switching operation of the applet, and the terminal device performs page loading and rendering of the applet when detecting the operations of the user, so that a corresponding page of the applet is displayed on a display screen of the terminal device. For example, upon detecting an operation of opening an applet by a user, a terminal device typically loads a main interface of the applet and renders the main interface on a display screen. For another example, when an operation of switching an applet page by a user is detected, the terminal device loads the switched page and renders the page on a display screen.
In the process of loading the page of the applet by the terminal equipment according to the operations of the user, the page resource of the page can be obtained from the local and loaded, and a page resource loading request can also be sent to a server associated with the applet so as to return the page resource of the page from the server and load the page resource.
The terminal device 101 may be a Personal Digital Assistant (PDA) device, a handheld device (e.g., a smart phone or a tablet), a computing device (e.g., a Personal Computer (PC)), an on-vehicle device, a wearable device (e.g., a smart watch or a smart band), and a smart home device (e.g., a smart speaker, a smart display device), and the like, where fig. 1 illustrates a smart speaker. The server 102 may be a centralized server, a distributed server, or a cloud server.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 3 is a flowchart illustrating an applet processing method according to an embodiment of the present application, where an execution subject is, for example, a terminal device in the application scenario shown in fig. 2. As shown in fig. 3, the method includes:
s301, responding to the detected resource loading request of the target page under the applet, and acquiring the configuration information of the target page.
The target page is determined according to user operation.
For example, when the user operates to open the applet, the target page is a pre-designated page of the applet, where the pre-designated page includes a user login page of the applet and a main page designated in the applet, and usually there is only one main page of the applet, for example, the first page after entering the applet.
For another example, when the user operates the page switching operation on the same applet, the target page is a page adjacent to the current page. Such as: when the switching operation is switching to the previous page (for example, a hand motion of the user sliding to the right side of the screen is detected), the target page is the page previous to the current page. For another example: when the switching operation is switching to the next page (for example, a hand motion of the user sliding to the left side of the screen is detected), the target page is the page next to the current page.
For another example, when the user operates the page switching operation between different applets, the target page is a designated page of the applet to be switched or a page opened recently.
The resource loading request of the target page is used for requesting to load the page resource of the target page, and the page resource is used for rendering each view element on the target page. The view elements on the target page are, for example, the page background, the page layout, the input box, the drop-down selection box, etc. of the target page.
The user operation can trigger a resource loading request of the target page.
For example, when the operation of opening the applet by a user is detected, the applet is started and a resource loading request of a main interface under the applet is generated; for another example, when an operation that a user switches from one page of the applet to another page is detected, a resource loading request of the other page of the applet is generated; as another example, upon detecting a user operation to switch from an applet to another applet, a resource load request is generated for a specified page or a recently opened page under the other applet.
Each page in the applet has corresponding configuration information, and the configuration information of the page includes, for example, a directory where the page resource is located, a background color of the page, a title of the page, a type of the page, and the like.
Specifically, after a resource loading request of a target page is detected, configuration information of the target page can be acquired under a file directory of an applet where the target page is located; or the resource loading request of the target page carries the configuration information of the target page, and the configuration information of the target page can be directly obtained from the resource loading request of the target page; or, a mapping table of the page identifier of the page and the configuration information may be pre-established, and in the mapping table, the configuration information of the target page is searched according to the page identifier of the target page, where the page identifier of the target page may be carried in the resource loading request of the target page.
S302, according to the configuration information, if the target page is determined to belong to one of the configured frequently-visited pages, resource loading processing is carried out on the target page under the applet according to the shared component file which is pre-configured and corresponds to the frequently-visited page.
Wherein a plurality of frequently accessed pages are determined in advance among a plurality of pages of the applet.
For example, a developer sets one or more pages in an applet as frequently accessed pages when developing the applet or performing update maintenance on the applet. As another example, a user sets one or more pages of an applet to frequently accessed pages during use of the applet.
One possible implementation of determining frequently visited pages among one or more pages of an applet is: the method comprises the steps of obtaining access information of a plurality of pages in the applet, selecting at least one page from the plurality of pages according to the access information of the plurality of pages, and enabling the access information of the selected at least one page to be matched with a preset frequency access threshold. Determining the selected at least one page as a frequently visited page.
The access information of the page comprises one or more of the following items: access times, access frequency, and access times. The number of times of page access includes the number of times of page access by a user, the access frequency of a page refers to the number of times of page access by a user within a unit time (e.g., one minute, one hour) when the user uses an applet, and the access number ratio of a page refers to the ratio of the number of times of page access within a preset total number of times of access (e.g., 100 accesses by a user).
Wherein the frequency access threshold comprises one or more of: an access number threshold, an access frequency threshold, and an access number ratio threshold.
The access information of the page is matched with a preset frequency access threshold, for example, the access information includes one or more of the number of access times of the page being greater than or equal to the access time threshold, the access frequency of the page being greater than or equal to the access frequency threshold, and the access time ratio of the page being greater than or equal to the access time ratio threshold. Therefore, the page with higher access frequency, more frequent access and/or larger access frequency can be determined as the frequently-accessed page, the loading performance of the page with higher access frequency, more frequent access and/or larger access frequency is improved, and the whole page loading performance of the applet is further obviously improved.
Another possible implementation of determining frequently visited pages among one or more pages of an applet is: when the frequent access page is determined in a plurality of pages of the applet, the number of the previous pages related to each page is obtained according to the jump relation among the pages, and the more the previous pages related to the page are, the more the probability that the page is accessed by the user is. Therefore, the pages with the number of the associated previous pages being greater than or equal to the number threshold value can be determined as the frequently-visited pages according to the number of the associated previous pages of each page and the preset number threshold value. For example, if page a is the previous page of page B and page C is the previous page of page B, page a may jump to page B, and page C may also jump to page B, which shows that page B has a higher probability of being accessed.
The resource file of the target page comprises a component file, the component file comprises a shared component file, and the shared component file comprises one or more components referenced by the frequently-accessed page.
Specifically, in the configuration information of the target page, whether the target page belongs to one of the frequently visited pages is described, and therefore, whether the target page belongs to one of the frequently visited pages can be determined according to the configuration information of the target page. And if the target page belongs to one page of the frequently-accessed pages, loading components required by the target page according to a pre-configured shared component file so as to perform subsequent page rendering on the target page. Thus, one possible implementation of determining whether the target page belongs to one of the frequently visited pages is: and determining whether the target page belongs to one page in the frequently visited pages according to the configuration information of the target page.
For example: the configuration information of the target page comprises a page identifier of the target page, wherein the page identifier of the page is unique. And searching whether a page identifier of a target page exists in a page identifier table of the pre-established frequently-visited pages, if so, determining that the target page belongs to one of the frequently-visited pages, namely, the target page is the frequently-visited page, otherwise, determining that the target page does not belong to one of the frequently-visited pages.
After determining the frequently-visited pages in the multiple pages in the applet, a frequently-visited identifier may be added to the configuration information of the frequently-visited pages, and therefore, another possible implementation manner of determining whether the target page belongs to one of the frequently-visited pages is as follows: and if the configuration information of the target page comprises the frequent access identifier, determining that the target page belongs to one of the frequent access pages, and otherwise, determining that the target page does not belong to one of the frequent access pages.
In the embodiment of the application, when a resource loading request of a target page is detected, configuration information of the target page is obtained, and if the target page is determined to belong to one page of frequently accessed pages according to the configuration information of the target page, resource loading processing is performed on the target page under an applet according to a pre-configured shared component file. Because the shared component file only relates to the components in the frequently accessed page, excessive loading of components which are irrelevant to the shared component file is avoided when the target page carries out resource loading, and the page loading performance is effectively improved.
In some embodiments, after determining the frequently-visited pages in the multiple pages in the applet, the components referred to by each frequently-visited page may be obtained, and the shared component file is constructed according to the components referred to by each frequently-visited page, so that the components referred to by each frequently-visited page are comprehensively considered, and the shared component file including one or more components referred to by each frequently-visited page is obtained. The shared component file does not include components referenced by other pages except the frequently-accessed pages, so that excessive components irrelevant to the frequently-accessed pages are prevented from being loaded when the resources of the frequently-accessed pages are loaded.
Optionally, when the shared component file is constructed according to the components referenced by the frequently-accessed pages, all the components referenced by the frequently-accessed pages are placed in the shared component file.
Optionally, when the shared component file is constructed according to the components referred by the frequently-accessed pages, the components referred by the frequently-accessed pages are obtained, the number of the pages referred to by the frequently-accessed pages of the components is determined for each component referred by the frequently-accessed pages, and if the number of the pages referred to by the frequently-accessed pages of the components is greater than or equal to a preset number threshold value for comparison, the components are placed in the shared component file.
For example, as shown in fig. 4, the frequently visited pages include page 1, page 2, and page 3, the components referenced by page 1 include component a and component B, the components referenced by page 2 include component a, component B, and component C, and the components referenced by page 3 include component a, component D, and component E, although page 1, page 2, and page 3 may also reference some non-componentized view elements. It can be known that the number of pages of frequently-accessed pages referencing the component a is 3, the number of pages of frequently-accessed pages referencing the component B is 2, the number of pages of frequently-accessed pages referencing the component C is 1, the number of pages of frequently-accessed pages referencing the component D is 1, and the number of pages of frequently-accessed pages referencing the component E is 1. And if the preset number threshold is 2, the shared component file comprises the component A and the component B, and if the preset number threshold is 3, the shared component file comprises the component A. The reference of the component by the page refers to a component view designed with the component on the page, for example, after the function of the drop-down selection box is modularized, the drop-down selection box is a corresponding component view.
Therefore, if the number of the pages of the frequently-accessed pages of the referencing component is greater than or equal to the preset frequency threshold, the component is placed in the shared component file, the component shared by a plurality of frequently-accessed pages is ensured to be located in the shared component file as much as possible, and meanwhile, the phenomenon that when the number of the frequently-accessed pages is large, the shared component file is too large due to the fact that all the components referenced by the frequently-accessed pages are placed in the shared component file is avoided, and too many components which are irrelevant to the component are loaded when the shared component file is loaded by the frequently-accessed pages is reduced.
On the basis that each component in the shared component file is a component which is referred by at least a preset number threshold of frequently-accessed pages, after the target page is determined to belong to one page in the frequently-accessed pages, whether the target page refers to the component in the shared component file or not can be determined according to the configuration information, if the target page does not refer to the component in the shared component file, the shared component file does not need to be obtained, and if the target page refers to the component in the shared component file, the shared component file is obtained and loaded. Therefore, whether the shared component file is acquired or not is determined according to the actual situation of the component reference of the target page, and excessive components irrelevant to the target page are prevented from being loaded in the resource loading process.
By way of example, the shared component file comprises a component A and a component B, the target page references the components comprising a component D, a component E and a component F, and the target page belongs to a frequently-accessed page, and the target page does not need to be loaded with the shared component file.
Fig. 5 is a flowchart of an applet processing method according to another embodiment of the present application, where each component in the shared component file is a component referenced by at least a preset number threshold of frequently-visited pages, and an execution subject is, for example, a terminal device in the application scenario shown in fig. 2. As shown in fig. 5, the method includes:
s501, responding to a detected resource loading request of a target page under the applet, and acquiring configuration information of the target page.
The specific implementation principle and process of S501 may refer to the foregoing embodiments, and are not described again.
S502, if the target page is determined to belong to one of the frequently accessed pages, determining whether the target page refers to the component in the shared component file according to the configuration information of the target page.
Specifically, if the target page references a component in the shared component file, the target page needs to load the component of the shared component file, and S503 is executed, otherwise S504 is executed.
Optionally, the configuration information of the target page records component identifications of the components referenced by the target page. And searching whether a component corresponding to any component identifier in the accessory information of the target page exists in the shared component file, if so, determining that the target page refers to the component in the shared component file, and otherwise, determining that the target page does not refer to the component in the shared component file.
Optionally, when the shared component file is constructed, if a component of the frequently-accessed page is placed in the shared component file, the shared identifier is added to the configuration information of the frequently-accessed page. Therefore, whether the target page references a component in the shared component file can be determined according to whether the configuration information of the target page includes the shared identifier. And if the configuration information of the target page comprises the sharing identification, determining that the target page refers to the component in the sharing component file, and otherwise, determining that the target page does not refer to the component in the sharing component file. Therefore, the efficiency of judging whether the target page refers to the component in the shared component file or not is effectively improved through the shared identification in the configuration information.
And S503, loading the shared component file on the target page under the applet.
Specifically, if the target page references a component in the shared component file, the shared component file is acquired and loaded, so that the component in the shared component file is loaded.
After loading the shared component file, the target page may also reference components that are not located in the shared component file because only the components referenced by at least a preset number threshold of frequently accessed pages are included in the shared component file. Furthermore, the target page also comprises view elements which are not componentized, such as a page background page, a page layout and the like, besides the component view. Therefore, S504 is also executed to load components other than the shared component file and view elements that are not componentized.
S504, obtaining the view file associated with the target page.
The view file associated with the target page, that is, the view file of the target page, has its own view file for each page in the applet, and the view file of a page includes view elements that are not componentized on the page.
And under the condition that the target page is the frequently-accessed page, the view file of the target page also comprises the components, which are referenced by the target page, except the components in the shared component file.
Specifically, the configuration information of the target page includes a file address of the view file of the target page, so that the file address of the view file of the target page can be obtained from the configuration information of the target page, and the view file of the target file can be read from the file address of the view file of the target page.
In the process of constructing the shared component file, all components referenced by each frequently-accessed page can be acquired, the page number of the frequently-accessed page referencing the component is determined for each component referenced by each frequently-accessed page, if the number of times that the component is referenced by the frequently-accessed page is greater than or equal to a preset number threshold value, the component is placed in the shared component file, otherwise, the component is placed in a view file referencing the page of the component. Therefore, the frequently-accessed page can complete the loading of all resources by loading the shared component file and the view file, and the number of components which are loaded on the frequently-accessed page and are irrelevant to the frequently-accessed page can be effectively reduced.
And S505, loading the view file on the target page under the small program.
Specifically, the view file is loaded after the view file is obtained, so that loading of components, which are referenced by the target page, except for the components in the shared component file and loading of non-componentized view elements are realized.
In the embodiment of the application, under the condition that the target page belongs to one page of the frequently accessed pages, whether the target page needs to refer to the components in the shared component file is determined, if yes, the shared component file and the view file are loaded on the target page under the applet, and otherwise, the view file is loaded on the target page under the applet. Therefore, the component reference condition of the page is flexibly and more frequently accessed, the resource file loaded by the target page is adjusted, excessive components irrelevant to the page are prevented from being loaded by the frequently accessed page, and the page loading performance of the small program is improved.
Fig. 6 is a flowchart of an applet processing method according to another embodiment of the present application, and an execution main body is, for example, a terminal device in the application scenario shown in fig. 2. As shown in fig. 6, the method includes:
s601, responding to the detected resource loading request of the target page under the applet, and acquiring the configuration information of the target page.
For specific implementation principles and processes of S601, reference may be made to the foregoing embodiments, which are not described in detail.
S602, according to the configuration information of the target page, if the target page is determined not to belong to one page of the frequently accessed pages, carrying out resource loading processing on the target page under the applet according to the shared component file and/or the pre-configured non-shared component file.
Optionally, the components in the non-shared component file are the remaining components, other than the components in the shared component file, in the plurality of components referenced by the plurality of pages of the applet. After the shared component file is constructed, a plurality of components referenced by a plurality of pages in the applet can be obtained, the rest components except the components in the shared component file in the plurality of components are placed into the non-shared component file, and finally the non-shared component file is constructed. Therefore, when the target page does not belong to the page in the frequently-visited page, the resource loading processing can be performed on the target page under the applet according to the shared component file and/or the non-shared component file. The components referenced by all the pages are prevented from being placed in the same component file, and the size of the component file is reduced. Moreover, when the target page only refers to the components in the shared component file or only refers to the components in the non-shared component file, the number of the components which are loaded by the target page and are not related to the target page can be reduced.
As an example, as shown in fig. 7, fig. 7 includes 3 frequently visited pages: page 1, page 2, page 3, and further includes a plurality of infrequently visited pages (i.e., the remaining pages in the applet other than the frequently visited pages): page 4-page N. The components referenced by the page 1 comprise a component A and a component B, the components referenced by the page 2 comprise a component A, a component B and a component C, the components referenced by the page 3 comprise a component A, a component D and a component E, the components referenced by the page 4 comprise a component F and a component N, and the components referenced by the page N comprise a component M and a component N. In addition to components, the above pages also reference non-componentized view elements.
According to the multiple pages shown in fig. 7, the existing solution usually puts all components in one component file, such as the total component file shown in fig. 7, which results in the total component file being too large, and the page needs to load the total component file when loading the components, resulting in the page loading many components that are not related to itself. The applet processing method provided by the application can construct a shared component file and a non-shared component file shown in fig. 7, wherein the shared component file comprises a component a and a component B, and the non-shared component file comprises the rest components, such as a component C, a component D, a component E, … … and a component N, which are referenced by a plurality of pages of the applet and are except for the components in the shared component file. Therefore, the size of the component file is effectively reduced, and the number of the residual components which are loaded by the page and are not related to the page is reduced, for example, page 1 can only load the shared component file when the resource is loaded, and page 4 is willing to only load the non-shared component file when the resource is loaded.
Optionally, the components in the non-shared component file are the remaining components, other than the components in the shared component file, in the plurality of components referenced by the plurality of pages of the applet other than the frequently-accessed pages. After the shared component file is constructed, a plurality of components referred by a plurality of pages in the applet except the frequently accessed pages can be obtained, the rest components in the plurality of components except the components in the shared component file are put into the non-shared component file, and finally the non-shared component file is constructed. Therefore, the obtained non-shared component file does not consider the components quoted by the frequently accessed pages, the relevance of the non-shared component file and the pages in the small program except the frequently accessed pages is effectively ensured, the size of the non-shared component file is further reduced, and the number of the components loaded by the target page and irrelevant to the non-shared component file is reduced.
Specifically, the specific implementation principle and process for determining whether the target page belongs to one of the frequently visited page pages according to the configuration information of the target page may refer to the foregoing embodiments, and are not described in detail again. If the target page is determined not to belong to one of the frequently accessed pages, the resource loading processing can be carried out on the target page under the applet according to the component referenced by the target page and the shared component file and/or the non-shared component file.
In the embodiment of the application, under the condition that the target page does not belong to one page of the frequently accessed pages, the resource loading processing is carried out on the target page under the applet according to the shared component file and/or the non-shared component file, and the resource loading processing is based on the shared component file and/or the non-shared component file. Therefore, based on the shared component file and/or the non-shared component file, under the condition that the target page does not belong to one page of the frequently accessed pages, the target page is prevented from being loaded with too many components which are not related to the target page, and the page loading performance of the small program is improved.
Fig. 8 is a flowchart illustrating an applet processing method according to another embodiment of the present application, where an execution subject is, for example, a terminal device in the application scenario shown in fig. 2.
As shown in fig. 8, the method includes:
s801, responding to the detected resource loading request of the target page under the applet, and acquiring the configuration information of the target page.
The specific implementation principle and process of S801 may refer to the foregoing embodiments, and are not described again.
S802, according to the configuration information of the target page, if the target page is determined not to belong to one page of the frequently accessed pages, whether the target page refers to the component in the shared component file or not is determined according to the configuration information.
Specifically, whether the target page belongs to one of the frequently accessed pages may be determined according to the configuration information of the target page, and if the target page does not belong to one of the frequently accessed pages, whether the target page references the component in the shared component file may be determined according to the configuration information. For the specific implementation principle and process of determining whether the target page belongs to one of the frequently accessed pages according to the configuration information of the target page, reference may be made to the foregoing embodiment, and for the specific implementation principle and process of determining whether the target page refers to a component in the shared component file according to the configuration information, reference may be made to the foregoing embodiment, which is not described again. If the target page references a component in the shared component file, S803 is performed, otherwise S804 is performed directly.
And S803, loading the shared component file on the target page under the applet.
Specifically, if the target page refers to a component in the shared component file, the file address of the shared component file may be obtained according to a preset file address of the shared component file or from the configuration information of the target page, and the shared component file is obtained and loaded from the file address of the shared component file, so as to implement loading of the component in the shared component file.
Since the target page may also refer to a non-shared component file, execution continues with S804.
S804, whether the target page refers to the component in the non-shared component file is determined.
Optionally, in a case that the target page does not refer to a component in the shared component file, determining whether the target page refers to the component according to a record in the configuration information, for example, if a component identifier is recorded in the configuration information or the component identifier is not null, determining that the target page refers to the component. If the target page references a component, then it is determined that the target page references a component in the non-shared component file.
Optionally, in a case where the target page refers to a component in the shared component file, component identifiers of all components recorded in the configuration information may be acquired, and according to the component identifiers, whether a component corresponding to at least one component identifier exists in the non-shared component file is searched for, and if the component exists, it is determined that the target page refers to a component in the non-shared component file.
Optionally, whether a preset non-shared identifier exists or not may be searched for in the configuration information of the target page, and if so, it is determined that the target page refers to a component in the non-shared component file.
Specifically, if it is determined that the target page references a component in the non-shared component file, S805 is performed. Otherwise, S806 is performed.
And S805, loading the non-shared component file on the target page under the applet.
Specifically, if the target page refers to a component in the non-shared component file, the file address of the non-shared component file may be obtained according to a preset file address of the non-shared component file or from configuration information of the target page, and the non-shared component file is obtained and loaded from the file address of the non-shared component file, so that loading of the component in the non-shared component file is realized.
Since the view on the target page includes the view elements that are not componentized in addition to the component view, execution continues with S806.
And S806, acquiring the view file associated with the target page.
When the target page does not belong to one of the frequently visited pages, the view file of the target page comprises view elements which are not componentized on the target page.
Specifically, the configuration information of the target page includes a file address of the view file of the target page, so that the file address of the view file of the target page can be obtained from the configuration information of the target page, and the view file of the target file can be read from the file address of the view file of the target page.
And S807, loading the view file on the target page under the applet.
Specifically, the view file is loaded after the view file is obtained, so that the loading of the non-componentized view elements referenced by the target page is realized.
In the embodiment of the application, under the condition that the target page does not belong to one page of the frequently accessed pages, according to the component reference condition of the applet, and according to the shared component file and/or the non-shared component file, the resource loading processing is carried out on the target page under the applet. And if the target page does not refer to the shared component file and refers to the non-shared component file, loading the non-shared component file on the target page without loading the shared component file. Therefore, based on the shared component file and/or the non-shared component file, under the condition that the target page does not belong to one page of the frequently accessed pages, the target page is effectively prevented from being loaded with too many components which are irrelevant to the target page, and the page loading performance of the small program is improved.
Fig. 9 is a flowchart illustrating an applet processing method according to another embodiment of the present application, where an execution subject is, for example, a terminal device in the application scenario shown in fig. 2.
As shown in fig. 9, the method includes:
s901, responding to the detected resource loading request of the target page under the small program, and acquiring the configuration information of the target page.
S902, determining whether the target page belongs to one of the frequently visited pages according to the configuration information of the target page.
Specifically, if it is determined that the target page belongs to one of the frequently accessed pages, S903 is performed, and if it is determined that the target page does not belong to one of the frequently accessed pages, S905 is performed.
And S903, determining whether the target page refers to the component in the shared component file or not according to the configuration information.
Specifically, in the case where the target page belongs to one of the frequently accessed pages, if the target page refers to a component in the shared component file, S904 is performed, otherwise S909 is performed.
And S904, loading the shared component file on the target page under the applet.
Specifically, in the case where the target page belongs to one of the frequently accessed pages, if the target page references a component in the shared component file, the target page is loaded with the shared component file under the applet, and then S909 is executed.
S905, determining whether the target page refers to the component in the shared component file or not according to the configuration information.
Specifically, in the case where the target page does not belong to one of the frequently accessed pages, if the target page references a component in the shared component file, S906 is performed, otherwise, S907 is performed.
And S906, loading the shared component file on the target page under the applet.
Specifically, in the case where the target page does not belong to one of the frequently accessed pages, if the target page references a component in the shared component file, the shared component file is loaded on the target page under the applet, and then S907 is executed.
S907, determining whether the target page refers to the component in the non-shared component file or not according to the configuration information.
Specifically, in the case where the target page does not belong to one of the frequently accessed pages, if the target page refers to a component in the unshared component file, S908 is performed, otherwise S909 is performed.
And S908, loading the non-shared component file on the target page under the small program.
And S909, acquiring the view file associated with the target page.
S910, loading the view file on the target page under the small program.
The specific implementation principle and process of S901 to S910 may refer to the foregoing embodiments, and are not described again.
In the embodiment of the application, if the target page belongs to one of the frequently accessed pages, the resource loading processing is performed on the target page under the applet according to the shared component file and the view file, and if the target page does not belong to one of the frequently accessed pages, the resource loading processing is performed on the target page under the applet according to the shared component file, the non-shared component file and the view file. Therefore, by classifying the pages, resources are loaded for the frequently-accessed pages in the applet and the rest pages except the frequently-accessed pages in the applet in a targeted manner, and by utilizing the characteristic that the components can be quoted by a plurality of pages, the phenomenon that the pages are excessively loaded with components irrelevant to the pages in the process of overlong resource loading is effectively avoided, and the page loading performance is effectively improved.
Fig. 10 is a schematic structural diagram of an applet processing apparatus according to an embodiment of the present application. As shown in fig. 10, the apparatus includes:
an obtaining unit 1001, configured to obtain configuration information of a target page in response to a detected resource loading request of the target page under an applet;
and a loading unit 1002, configured to, according to the configuration information, if it is determined that the target page belongs to one of the configured frequently-visited pages, perform resource loading processing on the target page under the applet according to the shared component file which is pre-configured and corresponds to the frequently-visited page.
In one possible implementation, the applet processing apparatus further comprises:
the page configuration unit is used for acquiring access information of a plurality of pages in the applet, selecting at least one page from the plurality of pages according to the access information of the plurality of pages, matching the access information of the selected at least one page with a preset frequency access threshold value, and configuring the selected at least one page as a frequently-accessed page; wherein the access information comprises one or more of: access times, access frequency, and access times.
In one possible implementation, the page configuration unit 1003 includes:
the identifier adding module is used for adding a preset frequent access identifier in the configuration information of the selected at least one page;
the applet processing apparatus further comprising:
and the type determining unit is used for determining that the target page is one page belonging to the frequently-accessed pages if the configuration information of the target page comprises the frequently-accessed identification.
In one possible implementation, the applet processing apparatus further comprises:
and the shared file construction unit is used for acquiring the components referred by the frequently-accessed pages and constructing the pre-configured shared component file according to the components referred by the frequently-accessed pages.
In one possible implementation manner, the shared file constructing unit includes:
the page number determining module is used for determining the page number of the frequently-accessed page which refers to the component aiming at the component which is referred by the frequently-accessed page;
and the file construction sub-module is used for placing the component into the shared component file if the number of the pages of the frequently-accessed pages of the referenced component is greater than or equal to a preset number threshold.
In one possible implementation, the loading unit 1002 includes:
the page number determining module is used for determining the page number of the frequently-accessed page which refers to the component aiming at the component which is referred by the frequently-accessed page;
and the file construction sub-module is used for placing the component into the shared component file if the number of the pages of the frequently-accessed pages of the referenced component is greater than or equal to a preset number threshold.
In one possible implementation, the first component reference determination module includes:
and the reference determining sub-module is used for determining that the target page references the components in the shared component file if the configuration information of the target page comprises the preset shared identifier, and otherwise determining that the target page does not reference the components in the shared component file.
In a possible implementation manner, the loading unit 1002 further includes:
and the infrequent page loading module is used for loading resources to the target page under the applet according to the configuration information of the target page and according to the shared component file and/or the preconfigured infrequent component file if the target page is determined not to belong to one page of the frequently accessed page.
In one possible implementation, the infrequent page load module includes:
and the non-shared file construction unit is used for acquiring a plurality of components referred by a plurality of pages in the applet and constructing the non-shared component file according to the rest components except the components in the shared component file in the plurality of components.
In one possible implementation, the infrequent page load module includes:
the second component reference determining module is used for determining whether the target page references the components in the shared component file and whether the target page references the components in the non-shared component file according to the configuration information if the target page is determined not to belong to one page in the frequently-accessed pages;
the second shared file loading module is used for loading the shared component file on the target page under the applet if the target page references the components in the shared component file and does not reference the components in the non-shared component file;
and the non-shared file loading module is used for loading the non-shared component file to the target page under the applet if the target page does not refer to the component in the shared component file and refers to the component in the non-shared component file.
In one possible implementation, the obtaining unit 1001 further includes:
the view file acquisition module is used for acquiring a view file associated with the target page;
the loading unit 1002 further includes:
the view file loading module is used for loading a view file on a target page under the applet;
and if the target page belongs to one page in the frequently-visited pages, the view file comprises the non-componentized view elements referenced by the target page and the components referenced by the target page except the components in the shared component file, otherwise, the view file comprises the non-componentized view elements referenced by the target page.
The applet processing apparatus provided in fig. 11 can execute the corresponding method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
According to an embodiment of the present application, the present application also provides a chip. The chip may include: at least one processor and a memory communicatively coupled to the at least one processor. The memory stores instructions executable by the at least one processor to cause the at least one processor to implement a method according to any one of the embodiments described above.
The processor may be a general-purpose processor, including a central processing unit CPU, a Network Processor (NP), and the like; but also a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The memory may include a Random Access Memory (RAM), and may further include a non-volatile memory (non-volatile memory), such as at least one disk memory.
There is also provided, in accordance with an embodiment of the present application, a computer program product, including: a computer program, stored in a readable storage medium, from which at least one processor of the electronic device can read the computer program, the at least one processor executing the computer program causing the electronic device to perform the solution provided by any of the embodiments described above.
FIG. 11 shows a schematic block diagram of an example electronic device 1100 that may be used to implement embodiments of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 11, the electronic device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)1102 or a computer program loaded from a storage unit 1108 into a Random Access Memory (RAM) 1103. In the RAM 1103, various programs and data necessary for the operation of the device 1100 may also be stored. The calculation unit 1101, the ROM 1102, and the RAM 1103 are connected to each other by a bus 1104. An input/output (I/O) interface 1105 is also connected to bus 1104.
A number of components in device 1100 connect to I/O interface 1105, including: an input unit 1106 such as a keyboard, a mouse, and the like; an output unit 1107 such as various types of displays, speakers, and the like; a storage unit 1108 such as a magnetic disk, optical disk, or the like; and a communication unit 1109 such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 1109 allows the device 1100 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 1101 can be a variety of general purpose and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The calculation unit 1101 performs the respective methods and processes described above, such as the applet processing method. For example, in some embodiments, the applet processing method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 1108. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1100 via ROM 1102 and/or communication unit 1109. When the computer program is loaded into the RAM 1103 and executed by the computing unit 1101, one or more steps of the applet processing method described above may be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured to perform the applet processing method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (25)

1. An applet processing method, the method comprising:
responding to the detected resource loading request of the target page under the applet, and acquiring the configuration information of the target page;
and according to the configuration information, if the target page is determined to belong to one of configured frequently-accessed pages, carrying out resource loading processing on the target page under the applet according to a shared component file which is pre-configured and corresponds to the frequently-accessed page.
2. The method of claim 1, further comprising:
obtaining access information of a plurality of pages in the applet, wherein the access information comprises one or more of the following items: access times, access frequency and access times are in proportion;
and selecting at least one page from the multiple pages according to the access information of the multiple pages, wherein the access information of the selected at least one page is matched with a preset frequency access threshold value, and the selected at least one page is configured as the frequently-accessed page.
3. The method of claim 2, said configuring said selected at least one page as said frequently visited page, comprising:
adding a preset frequent access identifier in the configuration information of the selected at least one page;
the method further comprises the following steps:
and if the configuration information of the target page comprises the frequent access identifier, determining that the target page belongs to one page of the frequent access pages.
4. The method of claim 2, further comprising:
acquiring a component referenced by the frequently-visited page;
and constructing the shared component file according to the components referenced by the frequently-accessed pages.
5. The method of claim 4, wherein constructing the shared component file according to the components referenced by the frequently accessed pages comprises:
determining, for a component referenced by the frequently-visited page, a number of pages of the frequently-visited page that reference the component;
and if the page number of the frequently-accessed pages which refer to the component is greater than or equal to a preset number threshold, putting the component into the shared component file.
6. The method according to any one of claims 1 to 5, wherein if the target page is determined to belong to one of configured frequently-visited pages, performing resource loading processing on the target page under the applet according to a shared component file which is pre-configured and corresponds to the frequently-visited page, the method includes:
if the target page is determined to be one of the frequently-accessed pages, determining whether the target page refers to a component in the shared component file according to the configuration information of the target page;
and if the target page refers to the component in the shared component file, loading the shared component file on the target page under the applet.
7. The method of claim 6, the determining whether the target page references a component in the shared components file according to the configuration information of the target page, comprising:
and if the configuration information of the target page comprises a preset sharing identifier, determining that the target page refers to the component in the sharing component file, otherwise, determining that the target page does not refer to the component in the sharing component file.
8. The method according to any one of claims 1-5, further comprising:
and according to the configuration information of the target page, if the target page is determined not to belong to one page of the frequently accessed page, carrying out resource loading processing on the target page under the applet according to the shared component file and/or a pre-configured non-shared component file.
9. The method of claim 8, further comprising:
acquiring a plurality of components referred by a plurality of pages in the applet;
and constructing the non-shared component file according to the rest components except the components in the shared component file in the plurality of components.
10. The method of claim 9, the performing, if it is determined that the target page does not belong to one of the frequently accessed pages, a resource loading process on the target page under the applet according to the shared component file and/or a preconfigured non-shared component file, comprising:
if the target page is determined not to belong to one of the frequently-visited pages, determining whether the target page refers to a component in the shared component file and whether the target page refers to a component in the non-shared component file according to the configuration information;
if the target page refers to the component in the shared component file and does not refer to the component in the non-shared component file, loading the shared component file on the target page under the applet;
and if the target page does not refer to the component in the shared component file and refers to the component in the non-shared component file, loading the non-shared component file on the target page under the applet.
11. The method of claim 8, further comprising:
acquiring a view file associated with the target page;
loading the view file on the target page under the applet;
wherein if the target page belongs to one of the frequently visited pages, the view file includes the non-componentized view elements referenced by the target page and the components referenced by the target page other than the components in the shared component file, otherwise, the view file includes the non-componentized view elements referenced by the target page.
12. An applet processing apparatus, the apparatus comprising:
the acquisition unit is used for responding to the detected resource loading request of the target page under the applet and acquiring the configuration information of the target page;
and the loading unit is used for carrying out resource loading processing on the target page under the applet according to the shared component file which is pre-configured and corresponds to the frequently-accessed page if the target page is determined to belong to one of the configured frequently-accessed pages according to the configuration information.
13. The apparatus of claim 12, the apparatus further comprising:
the page configuration unit is used for acquiring access information of a plurality of pages in the applet, selecting at least one page from the plurality of pages according to the access information of the plurality of pages, matching the access information of the selected at least one page with a preset frequency access threshold value, and configuring the selected at least one page as the frequently-accessed page;
wherein the access information comprises one or more of: access times, access frequency, and access times.
14. The apparatus of claim 13, the page configuration unit comprising:
the identifier adding module is used for adding a preset frequent access identifier in the configuration information of the selected at least one page;
the device further comprises:
and the type determining unit is used for determining that the target page belongs to one of the frequently-accessed pages if the configuration information of the target page comprises the frequently-accessed identifier.
15. The apparatus of claim 13, the apparatus further comprising:
and the shared file construction unit is used for acquiring the components referred by the frequently-accessed pages and constructing the shared component file according to the components referred by the frequently-accessed pages.
16. The apparatus of claim 15, the shared file constructing unit comprising:
the page number determining module is used for determining the page number of the frequently-visited pages which refer to the components aiming at the components which are referred by the frequently-visited pages;
and the file construction sub-module is used for placing the component into the shared component file if the page number of the frequently-accessed pages which refer to the component is greater than or equal to a preset number threshold.
17. The apparatus of any of claims 12-16, the loading unit comprising:
a first component reference determining module, configured to determine, if the target page is determined to be one of the frequently-visited pages, whether the target page references a component in the shared component file according to configuration information of the target page;
and the first shared file loading module is used for loading the shared component file on the target page under the applet if the target page refers to the component in the shared component file.
18. The apparatus of claim 17, the first component reference determination module comprising:
and the reference determining submodule is used for determining that the target page references the components in the shared component file if the configuration information of the target page comprises a preset shared identifier, and otherwise determining that the target page does not reference the components in the shared component file.
19. The apparatus of any of claims 12-16, the loading unit further comprising:
and the infrequent page loading module is used for loading resources to the target page under the applet according to the configuration information of the target page and the shared component file and/or the preconfigured infrequent component file if the target page is determined not to belong to one page of the frequently-accessed page.
20. The apparatus of claim 19, the infrequent page load module comprising:
and the non-shared file construction unit is used for acquiring a plurality of components referred by a plurality of pages in the applet and constructing the non-shared component file according to the rest components except the components in the shared component file in the plurality of components.
21. The apparatus of claim 20, the infrequent page load module comprising:
a second component reference determining module, configured to determine, if the target page is determined not to belong to one of the frequently visited pages, whether the target page references a component in the shared component file and whether the target page references a component in the non-shared component file according to the configuration information;
a second shared file loading module, configured to load the shared component file on the target page under the applet if the target page references a component in the shared component file and does not reference a component in the unshared component file;
and the non-shared file loading module is used for loading the non-shared component file to the target page under the applet if the target page does not refer to the component in the shared component file and refers to the component in the non-shared component file.
22. The apparatus of claim 19, the obtaining unit further comprising:
the view file acquisition module is used for acquiring a view file associated with the target page;
the load unit further includes:
the view file loading module is used for loading the view file on the target page under the applet;
wherein if the target page belongs to one of the frequently visited pages, the view file includes the non-componentized view elements referenced by the target page and the components referenced by the target page other than the components in the shared component file, otherwise, the view file includes the non-componentized view elements referenced by the target page.
23. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-11.
24. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-11.
25. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-11.
CN202011594981.9A 2020-12-28 2020-12-28 Applet processing method, device, equipment and storage medium Pending CN112631682A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011594981.9A CN112631682A (en) 2020-12-28 2020-12-28 Applet processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011594981.9A CN112631682A (en) 2020-12-28 2020-12-28 Applet processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112631682A true CN112631682A (en) 2021-04-09

Family

ID=75286112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011594981.9A Pending CN112631682A (en) 2020-12-28 2020-12-28 Applet processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112631682A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113608794A (en) * 2021-05-28 2021-11-05 北京达佳互联信息技术有限公司 Applet processing method, device and system, electronic equipment and storage medium
CN113687892A (en) * 2021-07-30 2021-11-23 阿里巴巴新加坡控股有限公司 Page processing method and device and computer program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102123168A (en) * 2011-01-14 2011-07-13 广州市动景计算机科技有限公司 Web page pre-reading and integration method and system based on relay server
JP2018169941A (en) * 2017-03-30 2018-11-01 富士通株式会社 Information processing device, method, and program
CN109241474A (en) * 2017-07-11 2019-01-18 阿里巴巴集团控股有限公司 Offer, displaying, dissemination method, server and the client of page info
CN110881079A (en) * 2018-09-06 2020-03-13 上海伴我科技有限公司 Method for switching multiple resources in parallel in flat interaction hierarchy and electronic equipment
CN111666516A (en) * 2020-04-24 2020-09-15 北京奇艺世纪科技有限公司 Page loading method and device, electronic equipment and storage medium
CN111736884A (en) * 2020-06-22 2020-10-02 平安医疗健康管理股份有限公司 Componentization method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102123168A (en) * 2011-01-14 2011-07-13 广州市动景计算机科技有限公司 Web page pre-reading and integration method and system based on relay server
JP2018169941A (en) * 2017-03-30 2018-11-01 富士通株式会社 Information processing device, method, and program
CN109241474A (en) * 2017-07-11 2019-01-18 阿里巴巴集团控股有限公司 Offer, displaying, dissemination method, server and the client of page info
CN110881079A (en) * 2018-09-06 2020-03-13 上海伴我科技有限公司 Method for switching multiple resources in parallel in flat interaction hierarchy and electronic equipment
CN111666516A (en) * 2020-04-24 2020-09-15 北京奇艺世纪科技有限公司 Page loading method and device, electronic equipment and storage medium
CN111736884A (en) * 2020-06-22 2020-10-02 平安医疗健康管理股份有限公司 Componentization method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
金榆林: "面向智慧景区的情境化电子商务平台", 《中国优秀硕士学位论文全文数据库》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113608794A (en) * 2021-05-28 2021-11-05 北京达佳互联信息技术有限公司 Applet processing method, device and system, electronic equipment and storage medium
CN113687892A (en) * 2021-07-30 2021-11-23 阿里巴巴新加坡控股有限公司 Page processing method and device and computer program product
CN113687892B (en) * 2021-07-30 2024-05-03 阿里巴巴创新公司 Page processing method, device and computer program product

Similar Documents

Publication Publication Date Title
CN113961510B (en) File processing method, device, equipment and storage medium
CN112631682A (en) Applet processing method, device, equipment and storage medium
CN113805962B (en) Application page display method and device and electronic equipment
CN113778644A (en) Task processing method, device, equipment and storage medium
CN116545905A (en) Service health detection method and device, electronic equipment and storage medium
CN115905322A (en) Service processing method and device, electronic equipment and storage medium
CN113747423B (en) Cloud mobile phone state synchronization method, device, equipment, storage medium and program product
CN112966201B (en) Object processing method, device, electronic equipment and storage medium
CN112073505B (en) Method for unloading on cloud server, control device and storage medium
CN111292223B (en) Graph calculation processing method and device, electronic equipment and storage medium
CN111741053B (en) Data pre-downloading method, device, server, terminal and storage medium
CN111813407B (en) Game development method, game running device and electronic equipment
CN113656731A (en) Advertisement page processing method and device, electronic equipment and storage medium
CN113391870A (en) Page jump method and device, electronic equipment and readable storage medium
CN113691403A (en) Topological node configuration method, related device and computer program product
CN113342413B (en) Method, apparatus, device, medium, and article for processing components
CN113032040B (en) Method, apparatus, device, medium, and article for processing tasks
CN114296609B (en) Interface processing method and device, electronic equipment and storage medium
CN112468952B (en) Positioning method, positioning device, storage medium and electronic equipment
CN117827194A (en) Method, apparatus, device and storage medium for inspecting elements
CN116700791A (en) Method, apparatus, device and medium for caching instructions
CN113849170A (en) Code sharing method and device, electronic equipment and storage medium
CN114449031A (en) Information acquisition method, device, equipment and storage medium
CN116010744A (en) Page data processing method and device, electronic equipment and readable storage medium
CN115061664A (en) Object conversion method and device, electronic equipment and storage medium

Legal Events

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