CN112631679A - Preloading method and device for micro-application - Google Patents

Preloading method and device for micro-application Download PDF

Info

Publication number
CN112631679A
CN112631679A CN202011582813.8A CN202011582813A CN112631679A CN 112631679 A CN112631679 A CN 112631679A CN 202011582813 A CN202011582813 A CN 202011582813A CN 112631679 A CN112631679 A CN 112631679A
Authority
CN
China
Prior art keywords
application
preloading
micro
request
applications
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
CN202011582813.8A
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 Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online 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 Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202011582813.8A priority Critical patent/CN112631679A/en
Publication of CN112631679A publication Critical patent/CN112631679A/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/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Abstract

After the micro application rendering displayed by the framework application is completed, a client side can firstly send a preloading request to a preloading scheduling module through the micro application, so that the preloading request is forwarded to a server through the preloading scheduling module, and a preloading scheme returned by the server is received through the preloading scheduling module. And then, the preloading scheduling module in the client sends the received preloading scheme to the framework application, so that the framework application sends an application acquisition request to be loaded to the server according to the application identification of the application to be loaded contained in the preloading scheme. And receiving application data of the application to be loaded returned by the server so as to pre-load the application to be loaded. By setting the preloading scheduling module and acquiring the preloading scheme from the server side by the preloading scheduling module, the preloading code does not need to be embedded in the page code, and the coupling between page applications is avoided.

Description

Preloading method and device for micro-application
Technical Field
The present application relates to the field of front-end technologies, and in particular, to a method and an apparatus for preloading a micro application.
Background
Generally, when a user accesses a web application (web app), a terminal may send a page acquisition request to a server in real time according to user operation to acquire a page code for rendering and displaying. However, the time required for completing the page loading is often long and the page loading speed is slow from the time when the terminal sends the page acquisition request to the server to the time when the page code returned by the server is received.
In order to increase the page loading speed, a pre-loading code is generally written into the page code of a page during page development, wherein the pre-loading code is used for indicating that the next page of the page is loaded. When the page is loaded in the terminal, the terminal can send a page acquisition request for acquiring the next page to the server in advance by running the pre-loading code contained in the page code of the page, so as to save the loading time of the next page.
However, after the page code of the next page is updated and reissued, the pre-loaded code in the page code of the page needs to be changed synchronously and reissued, so that the pre-loading of the page can be realized, and the problem of serious coupling exists among the pages.
Disclosure of Invention
The embodiment of the specification provides a method and a device for preloading a micro application, which are used for partially solving the problems in the prior art.
The embodiment of the specification adopts the following technical scheme:
in a method for preloading a micro application provided in the present specification, a client is composed of a framework application, a plurality of micro applications, and a preloading scheduling module, where the micro applications are mounted in the framework application, and the method includes:
after the micro application displayed by the framework application is rendered, a client sends a preloading request to the preloading scheduling module through the micro application, wherein the preloading request at least comprises an application identifier of the micro application;
forwarding the preloading request to a server through the preloading scheduling module, and receiving a preloading scheme returned by the server through the preloading scheduling module;
sending the received preloading scheme to a framework application in the client through the preloading scheduling module;
sending an application acquisition request to be loaded to the server through the framework application according to the application identifier of the application to be loaded contained in the preloading scheme;
and receiving application data of the application to be loaded returned by the server through the framework application, and preloading the application to be loaded through the framework application according to the received application data of the application to be loaded.
Optionally, a page corresponding to the micro application is a long page, and the long page includes multiple screens;
sending a preload request to the preload scheduling module through the micro application, specifically including:
determining application entrances of other micro applications contained in the page of the current screen;
respectively determining application identifiers corresponding to the application inlets according to the determined application inlets of other micro applications;
and determining a preloading request according to the determined application identifications, and sending the preloading request to the preloading scheduling module through the micro application.
Optionally, the method further comprises:
and when the micro application monitors the operation of the designated behavior of the user, the client sends a preloading request to the preloading scheduling module through the micro application.
Optionally, before the client sends the preload request to the preload scheduling module through the micro application, the method further includes:
acquiring a preset event binding relationship from the server through the framework application, wherein the event binding relationship comprises the corresponding relationship between each specified behavior operation of a user and a plurality of micro applications which are triggered to be loaded;
and sending the configuration file containing the event binding relation to the micro application through the framework application.
The present specification provides a method for preloading a micro application, including:
the method comprises the steps that a server receives a preloading request sent by a client through a preloading scheduling module, wherein the preloading request comprises an application identifier of a micro application displayed in a framework application of the client;
determining a plurality of other micro applications to be accessed in the micro applications according to the preloading request;
determining a preloading scheme according to a plurality of other micro applications to be accessed in the micro applications and historical behavior data of a user, wherein the preloading scheme comprises the other micro applications to be loaded next;
and sending the determined preloading scheme to a preloading scheduling module of the client so that the frame application in the client preloads the other micro applications to be loaded according to the preloading scheme.
Optionally, determining a plurality of other micro applications to be accessed in the micro applications according to the preloading request specifically includes:
determining an application identification of each other micro-application exposed in the micro-application included in the preload request;
and determining a plurality of other micro applications to be accessed in the micro applications according to the determined application identifiers of the other micro applications.
Optionally, the method further comprises:
receiving user behavior feedback information sent by a client through the micro-application, wherein the user behavior feedback information at least comprises other micro-applications accessed by a user;
and updating the historical behavior data of the user according to the user behavior feedback information.
The specification provides a micro-application preloading device, which is composed of a framework application, a plurality of micro-applications and a preloading scheduling module, wherein the micro-applications are mounted in the framework application;
the device comprises:
the device comprises a first sending module, a second sending module and a third sending module, wherein the first sending module sends a preloading request to the preloading scheduling module through the micro application of the device after the micro application displayed by the framework application is rendered, and the preloading request at least comprises an application identifier of the micro application;
the receiving module forwards the preloading request to a server through the preloading scheduling module and receives a preloading scheme returned by the server through the preloading scheduling module;
a second sending module, configured to send the received preloading scheme to the framework application in the apparatus through the preloading scheduling module;
a third sending module, configured to send an application to be loaded acquisition request to the server through the framework application according to the application identifier of the application to be loaded included in the preloading scheme;
and the preloading module receives the application data of the application to be loaded returned by the server through the framework application and preloads the application to be loaded through the framework application according to the received application data of the application to be loaded.
The present specification provides a pre-loading apparatus for a micro-application, comprising:
the system comprises a receiving module, a pre-loading scheduling module and a pre-loading module, wherein the receiving module is used for receiving a pre-loading request sent by a client through the pre-loading scheduling module, and the pre-loading request comprises an application identifier of a micro application displayed in a framework application of the client;
the first determining module is used for determining a plurality of other micro applications to be accessed in the micro applications according to the preloading request;
the second determining module is used for determining a preloading scheme according to a plurality of other micro applications to be accessed in the determined micro applications and historical behavior data of a user, wherein the preloading scheme comprises the other micro applications to be loaded next;
and the preloading module is used for sending the determined preloading scheme to a preloading scheduling module of the client so as to enable the frame application in the client to preload other micro applications to be loaded according to the preloading scheme.
The present specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a preloading method for the above-described micro applications.
The electronic device provided by the present specification includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the preloading method of the above-mentioned micro application when executing the program.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
in this specification, after the rendering of the micro application displayed by the framework application in the client is completed, the client may first send a preload request to a preload scheduling module in the client through the micro application, so as to forward the preload request to the server through the preload scheduling module, and receive a preload scheme returned by the server through the preload scheduling module. And then, the preloading scheduling module in the client sends the received preloading scheme to the framework application, so that the framework application sends an application acquisition request to be loaded to the server according to the application identification of the application to be loaded contained in the preloading scheme. And receiving application data of the application to be loaded returned by the server so as to pre-load the application to be loaded. By setting the preloading scheduling module and acquiring the preloading scheme from the server side by the preloading scheduling module, the preloading code does not need to be embedded in the page code, and the coupling between page applications is avoided.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic diagram illustrating a preloading procedure of a micro application according to an embodiment of the present disclosure;
FIG. 2 is a diagram illustrating a micro application corresponding to a multi-screen long page according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating preloading of a micro application according to an embodiment of the present disclosure;
fig. 4 is a schematic view illustrating an interaction flow in a process of preloading a micro application according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a preload flow apparatus for a micro application according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a preload flow apparatus for a micro application according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of an electronic device implementing a preloading flow method of a micro application according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more apparent, the technical solutions of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person skilled in the art without making any inventive step based on the embodiments in the description belong to the protection scope of the present application.
Currently, in order to save the page loading time in the web app, a code embedding manner is usually adopted to embed a preloaded code into a page code, so that when a user loads the page in the process of accessing the web app, the next page can be loaded in advance by running the preloaded code in the page code. Wherein the preloading code is used for indicating that the next page of the page is preloaded.
For example: the A page comprises B, C, D page entries of three pages, wherein the probability of the user accessing the B page is high, so in the page development process, a developer can write preloading codes for preloading the B page in the A page codes. When a user accesses the A page, in the process of running the page code, the page data of the B page can be acquired from the server in advance according to the preloading code in the page code, so as to preload the B page. The pre-loaded code includes a page identifier of the B page, where the page identifier may be a Uniform Resource Locator (URL) of the B page.
However, when the B page is updated and reissued, the characteristic parameter corresponding to the B page is changed, for example, the hash value corresponding to the B page is changed. At this time, when preloading is performed again based on the preloading code included in the a page, the B page before the page update is preloaded. Therefore, after the B page is updated and published, the a page also needs to be updated and published again to realize correct preloading, and the problem of serious coupling exists between page applications.
Based on the above problem of serious coupling between page applications, the present specification provides a method for preloading a micro application, in which a preload scheduling module is provided in a client, so that a preload request can be sent to the preload scheduling module by the micro application when preloading is performed, and the preload scheduling module forwards the preload request to a server, so as to obtain a preload scheme from a server side. The preloading codes do not need to be embedded in the page codes of the page applications, and the coupling between the page applications is avoided.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic view of a preloading procedure of a micro application provided in an embodiment of the present disclosure, which may specifically include the following steps:
s100: and after the micro application displayed by the framework application is rendered, the client sends a preloading request to the preloading scheduling module through the micro application.
In one or more embodiments of the present description, in order to make front-end development more flexible, the front-end development may be performed based on a micro front-end architecture, and a client may be split into a framework application and several micro applications. The micro applications are page applications comprising a plurality of modules in one or more pages and can be independently released and deployed, and the framework applications are used for mounting each micro application and controlling the execution time of each micro application. The development based on the micro front-end architecture is a mature prior art, and the method for specifically splitting the micro front-end architecture into the framework application and the micro applications is not elaborated in detail in the specification.
Based on the above analysis, in order to avoid embedding a preloaded code in each micro application, the present specification further separately provides a preload scheduling module in the client for controlling the preloading of the micro application. For convenience of description, a page application in which the micro application is one page is described as an example.
When the next micro application is preloaded in the present specification, the next micro application may be preloaded by a preloading scheduling module in the client after the page display corresponding to the current micro application is completed.
Specifically, after the page rendering corresponding to the currently displayed micro application in the framework application is completed, the client may send a preloading request to a preloading scheduling module in the client through the micro application, so that the preloading scheduling module preloads the next micro application. The preload request at least includes an application identifier of the current micro application, where the application identifier may be a URL address of a page corresponding to the micro application.
Of course, the preload request may also include an application identifier of each of the other micro applications shown in the page corresponding to the current micro application. For example, when a page corresponding to the current micro application includes page entries of a plurality of secondary pages, a page identifier (e.g., a URL address) of each secondary page may be used as an application identifier of each other micro application.
S102: and forwarding the preloading request to a server through the preloading scheduling module, and receiving a preloading scheme returned by the server through the preloading scheduling module.
In one or more embodiments of the present disclosure, after the preload scheduling module receives the preload request, the preload request may be forwarded to a server side, and the server makes a decision to determine the preload scheme.
Specifically, after the preload scheduling module in the client receives the preload request, the preload request may be forwarded to the server, and the server makes a decision based on the preload request to determine the preload scheme. The specific process of determining the preloading scheme by the server is described in detail in the following steps S200 to S206, and this description is not repeated here.
And then, a preloading scheme returned by the server can be received by a preloading scheduling module in the client, wherein the preloading scheme comprises the determined application identifier of the next application to be loaded, and the next application to be loaded is preloaded through the framework application in the client in the following process.
S104: and sending the received preloading scheme to the framework application in the client through the preloading scheduling module.
S106: and sending an application acquisition request to be loaded to the server through the framework application according to the application identifier of the application to be loaded contained in the preloading scheme.
In one or more embodiments of the present description, since the framework application in the client may control the loading timing of each micro application, after receiving the preloading scheme returned by the server, the preloading scheduling module further needs to forward the preloading scheme to the framework application, so that the framework application preloads the next loaded micro application according to the preloading scheme.
Specifically, after the preloading scheduling module receives the preloading scheme, the preloading scheme may be first sent to a framework application in the client, and then the framework application sends an application acquisition request to be loaded to the server according to an application identifier of the application to be loaded included in the received preloading request, so as to acquire application data of the application to be loaded in advance and preload the application to be loaded.
S108: and receiving application data of the application to be loaded returned by the server through the framework application, and preloading the application to be loaded through the framework application according to the received application data of the application to be loaded.
In one or more embodiments of the present disclosure, after the framework application sends an application to be loaded acquisition request to a server, application data of the application to be loaded returned by the server may be received, so as to preload a next-loaded micro application.
Specifically, the client may receive application data of the application to be loaded, which is returned by the server, through the framework application, and preload the application to be loaded according to the received application data of the application to be loaded. To reduce the duration of loading the micro-application when a subsequent user accesses the next micro-application.
Further, in this specification, after the framework application receives the application data of the application to be loaded, the page corresponding to the application to be loaded may also be rendered in advance according to the application data of the application to be loaded, so as to further reduce the loading duration of the micro application.
Based on the method for preloading the micro-applications shown in fig. 1, after the rendering of the micro-applications shown by the framework application in the client is completed, the client may first send a preloading request to a preloading scheduling module in the client through the micro-applications, so as to forward the preloading request to the server through the preloading scheduling module, and receive a preloading scheme returned by the server through the preloading scheduling module. And then, the preloading scheduling module in the client sends the received preloading scheme to the framework application, so that the framework application sends an application acquisition request to be loaded to the server according to the application identification of the application to be loaded contained in the preloading scheme. And receiving application data of the application to be loaded returned by the server so as to pre-load the application to be loaded. By setting the preloading scheduling module and acquiring the preloading scheme from the server side by the preloading scheduling module, the preloading code does not need to be embedded in the page code, and the coupling between page applications is avoided.
In addition, in this specification, the micro application displayed in the current frame application may also correspond to a long page, where the long page includes multiple screen page contents, and the displayed contents of each screen page are different. Therefore, in step S100 in this specification, when a preload request is sent to the preload scheduling module through a currently displayed micro application, specifically, an application entry of each other micro application included in a page of a current screen may be determined through the micro application, and an application identifier corresponding to each application entry may be determined according to the determined application entry of each other micro application. And then, according to the determined application identifications, determining a preloading request, and sending the preloading request to the preloading scheduling module through the currently displayed micro application so as to perform preloading through subsequent steps.
As shown in fig. 2, the long page corresponding to the current micro application a in fig. 2 includes two screens of display content. The first screen displays the application entries of the micro application b and the micro application c, and the second screen displays the application entries of the micro application d and the micro application e. If the current page shows the content of the first screen, the application identifiers of the other micro applications b and c shown in the page of the current screen can be determined, that is, the user may access the micro application b or the micro application c. The preload request may be determined and sent to the preload scheduling module based on the application identification of the other micro-applications b, c.
If the current page displays the content of the second screen, the application identifiers of the other micro applications d and e displayed in the page of the current screen can be determined, that is, the user may access the micro application d or the micro application e. The preload request may be determined and sent to the preload scheduling module based on the application identification of the other micro-applications d, e.
In another embodiment of the present description, event-triggered preloading may also be provided. For example: when it is monitored that the user scrolls the page, indicating that the user is browsing the content of the current page, the current micro application can send a preloading request to the preloading scheduling module so as to preload the micro application which the user may access next.
Specifically, when monitoring the operation of the specified behavior of the user, the micro application may send a preload request to a preload scheduling module in the client. The designated behavior operation of the user may be set to user behaviors such as clicking and scrolling, and may be specifically set as required, which is not limited in this specification.
In an embodiment of the present specification, the preload request may include a monitored specified behavior operation of a user, the preload scheduling module forwards the preload request to a server, and the server determines, according to the preload request and a preset event binding relationship, a plurality of micro applications that are triggered and loaded by the specified behavior operation. The event binding relationship comprises the corresponding relationship between each specified behavior operation of the user and a plurality of micro applications which are triggered to be loaded. Finally, the server can determine the micro application with the highest access frequency from the plurality of micro applications triggered to be loaded according to the historical behavior data of the user as the next micro application to be loaded,
or, in another embodiment of this specification, before sending the preload request to the preload scheduling module, the framework application in the client may first obtain a preset event binding relationship from the server, where the event binding relationship includes a correspondence between each specified behavior operation of the user and the several micro applications that trigger loading. And then, the framework application sends the configuration file containing the event binding relationship to the currently displayed micro application, so that when the micro application monitors the specified behavior operation of the user, a plurality of micro applications which are triggered and loaded can be determined according to the event binding relationship in the configuration file, and a preloading request is determined according to the determined plurality of micro applications which are triggered and loaded.
For example, assume that the D page contains a page entry for secondary page E, F, G, and that the user's scrolling event in the D page is event-bound in advance with the user's possible access to secondary page E, F, G. The framework application may obtain a preset event binding relationship from the server, and send the event binding relationship carried in the configuration file to the currently displayed micro application, so that when the micro application monitors that the user scrolls in the D page, the micro application may send a preload request to the preload scheduling module according to the event binding relationship between the scrolling event and the secondary page E, F, G that the user may access, where the preload request includes a page identifier of the secondary page E, F, G that the user may access.
Further, in this specification, the event binding relationship may also be pre-stored in the framework application when the framework application is developed, so as to reduce the time length for the framework application to be acquired from the server. Specifically, the event binding relationship is stored in the framework application in advance, or the framework application acquires the event binding relationship from the server in real time, which can be set as required, and this specification does not limit this.
For the preloading method of the micro application shown in fig. 1, the present specification also correspondingly provides an execution flow on the server side, as shown in fig. 3.
Fig. 3 is a schematic view of a preloading procedure of another micro application provided in an embodiment of the present disclosure, where a server is used as an execution subject, and the preloading procedure may specifically include the following steps:
s200: and the server receives a preloading request sent by the client through the preloading scheduling module.
According to the method for preloading the micro applications, the preloading codes do not need to be embedded in the page applications, the preloading requests can be sent to the server through the preloading scheduling module after the micro applications are loaded, and the subsequent micro applications can be preloaded based on the preloading scheme returned by the server.
Therefore, in this specification, specifically, the server may first receive a preload request sent by the client through the preload scheduling module. To determine and issue the preload scheme through subsequent steps. The preloading request at least comprises an application identification of the currently presented micro application in the client. Of course, application identifications of several other micro applications included in the page corresponding to the currently presented micro application may also be included.
It should be noted that the server may be a single server, or may be a system composed of multiple servers, such as a distributed server, which is not limited in this specification and may be set as needed.
S202: determining a number of other ones of the micro-applications to be accessed according to the preload request.
In one or more embodiments of the present disclosure, after the server receives the preload request, a number of other micro applications that the user may access in the current micro application may be determined according to the preload request, so as to decide which micro application to preload from the number of other micro applications that the user may access through subsequent steps.
Specifically, when the received preload request only includes the application identifier of the micro application, the server may determine, according to the application identifier of the micro application included in the preload request, the plurality of other micro applications and the application identifiers thereof included in the micro application from the stored correspondence between the application identifier of each micro application and the application identifiers of the plurality of other micro applications included in the application.
For example, assume that the preload request includes the page identifier of the page application M, which includes the page entry of the secondary page N, O, P. The server may determine the secondary page N, O, P and its page identifier contained in the M page from the stored correspondence between the page identifier of each page and other pages contained in the page according to the page identifier of the M page contained in the preload request.
In another embodiment of the present specification, the received preload request may further include an application identifier of each other micro application shown in the page corresponding to the micro application. At this time, the server may determine, directly according to the application identifiers of the several other micro applications included in the preload request, several other micro applications to be accessed by the user in the micro application.
S204: and determining a preloading scheme according to the determined plurality of other micro applications to be accessed in the micro applications and the historical behavior data of the user.
In one or more embodiments of the present description, after the server determines a number of other micro applications to be accessed by the user in the micro application, a decision may be made as to which micro application to preload from the number of other micro applications to be accessed based on historical behavior data of the user.
Specifically, the server may determine, according to the determined several other micro applications that the user may access in the micro application and the historical behavior data of each user, the frequency of access by the user to each of the other micro applications. And then, according to the accessed frequency of each other micro-application, determining a preloading scheme, namely determining the other micro-application with the highest accessed frequency as the other micro-application to be loaded next.
S206: and sending the determined preloading scheme to a preloading scheduling module of the client so that the frame application in the client preloads the other micro applications to be loaded according to the preloading scheme.
In one or more embodiments of the present disclosure, when the server determines the preloading scheme, the preloading scheme may be returned to the client, so that the client may load the next micro application in advance according to the preloading scheme.
Specifically, the server may issue the determined preloading scheme to the preloading scheduling module of the client, so that the preloading scheduling module forwards the preloading scheme to the framework application, and the framework application of the client preloads the next micro application in advance according to the preloading scheme. The specific preloading procedure at the client side is elaborated in the above steps S100 to S108, and this description is not repeated here.
Based on the method for preloading the micro applications shown in fig. 3, the server may first receive a preloading request sent by the client through the preloading scheduling module, and determine a number of other micro applications to be accessed in the micro applications according to the preloading request. And then, determining a preloading scheme according to the determined plurality of other micro applications to be accessed in the micro applications and the historical behavior data of the user. And finally, the determined preloading scheme is sent to a preloading scheduling module in the client so that the frame application in the client can preload other determined micro applications to be loaded according to the preloading scheme. By means of obtaining the preloading scheme from the server side, the preloading code does not need to be embedded in the page code, and coupling among page applications is avoided.
In step S204, the server may also determine, based on the historical behavior data of each user, the frequency of access of the user to several other micro applications, so as to further determine a preloading scheme corresponding to the user. Specifically, the server may determine the historical behavior data of the user according to an account id of the user account included in the preload request. And then, according to the historical behavior data of the user and the determined plurality of other micro applications to be accessed, determining the access frequency of the user to each other micro application. And finally, determining other micro applications with the highest user access frequency as the next micro application to be loaded so as to pre-load the determined micro applications in the client.
In addition, since the access frequency of the user to each micro application may also change constantly, in this specification, the server may further receive user behavior feedback information sent by the client through the micro application, where the user behavior feedback information includes each other micro application that the user has accessed. Then, the server may update the historical behavior data of the user according to each other micro-application that the user has accessed and that is included in the user behavior feedback information.
Or, in another embodiment of the present specification, the server may also determine the access frequency of each user to each micro application by counting the received acquisition request of each micro application, so as to update the historical behavior data of each user according to the access frequency of each user to each micro application, and further update the preloading scheme.
Further, because the preloading scheme determined by the server is different from the micro-application actually accessed by the user, the framework application in the client can determine user behavior feedback information after the user accesses the next micro-application, wherein the user behavior feedback information includes whether the user actual access is consistent with the preloading scheme. And then, sending the user behavior feedback information to a preheating scheduling module so that the preheating scheduling module forwards the information to a server, and adjusting and updating the preloading scheme by the server according to the user behavior feedback information.
Fig. 4 is a schematic view of an interaction flow in a process of preloading a micro application, and with the above analysis in mind, when the micro application is preloaded in this specification, after a page corresponding to the currently displayed micro application in a client is rendered, the micro application sends a preload request to a preload scheduling module, and the preload scheduling module forwards the preload request to a server. Then, the server may determine, according to the application identifier of the micro application included in the preload request, a number of other micro applications to be accessed by the user in the micro application, and determine, according to the historical behavior data of the user, a preload scheme, that is, determine a micro application to be loaded next from the number of other micro applications. Then, the server issues the preloading scheme to a preloading scheduling module in the client, and the preloading scheduling module forwards the preloading scheme to the framework application. And finally, the framework application sends an application acquisition request to be loaded to a server according to the application identifier of the application to be loaded contained in the preloading scheme, the server can determine the application data of the application to be loaded after receiving the application acquisition request to be loaded and return the application data to the framework application, and the framework application controls the loading time of the micro-application according to the application data of the application to be loaded.
Based on the method for preloading a micro application shown in fig. 1, embodiments of the present disclosure further provide a schematic structural diagram of a preloading device for a micro application, as shown in fig. 5.
Fig. 5 is a schematic structural diagram of a preloading device for micro applications, which is provided in an embodiment of the present specification and is composed of a framework application, a number of micro applications, and a preloading scheduling module, where the micro applications are mounted in the framework application;
the device comprises:
a first sending module 300, configured to send a preload request to the preload scheduling module through the micro application of the device after the micro application displayed by the framework application is rendered, where the preload request at least includes an application identifier of the micro application;
a receiving module 302, configured to forward the preload request to a server through the preload scheduling module, and receive a preload scheme returned by the server through the preload scheduling module;
a second sending module 304, configured to send the received preload scheme to the framework application in the apparatus through the preload scheduling module;
a third sending module 306, configured to send an application to be loaded acquisition request to the server through the framework application according to the application identifier of the application to be loaded included in the preloading scheme;
the preloading module 308 receives the application data of the application to be loaded, which is returned by the server, through the framework application, and preloads the application to be loaded through the framework application according to the received application data of the application to be loaded.
Optionally, the page corresponding to the micro application is a long page, the long page includes multiple screens, and the first sending module 300 is specifically configured to determine application entries of each of the other micro applications included in the page of the current screen, determine application identifiers corresponding to the application entries according to the determined application entries of each of the other micro applications, determine a preload request according to the determined application identifiers, and send the preload request to the preload scheduling module through the micro application.
Optionally, the apparatus further includes an event triggering module 310, where the event triggering module 310 is specifically configured to, when the micro application monitors a specified behavior operation of a user, send a preload request to the preload scheduling module by the client through the micro application.
Optionally, the event triggering module 310 is specifically configured to obtain a preset event binding relationship from the server through the framework application, where the event binding relationship includes a correspondence between each specified behavior operation of the user and the plurality of micro applications triggered to be loaded, and send a configuration file including the event binding relationship to the micro applications through the framework application.
Based on the preloading method for the micro application shown in fig. 3, the embodiment of the present specification further provides a schematic structural diagram of a preloading device for the micro application, as shown in fig. 6.
Fig. 6 is a schematic structural diagram of a preloading device for a micro application according to an embodiment of the present disclosure, including:
the receiving module 400 receives a preloading request sent by a client through a preloading scheduling module, wherein the preloading request comprises an application identifier of a micro application shown in a framework application of the client;
a first determining module 402, configured to determine, according to the preload request, a number of other micro applications to be accessed in the micro applications;
a second determining module 404, configured to determine a preloading scheme according to the determined several other micro applications to be accessed in the micro applications and historical behavior data of the user, where the preloading scheme includes the next other micro applications to be loaded;
the preloading module 406 is configured to send the determined preloading scheme to the preloading scheduling module of the client, so that the framework application in the client preloads the other micro applications to be loaded according to the preloading scheme.
Optionally, the first determining module 402 is specifically configured to determine an application identifier of each other micro application shown in the micro application, which is included in the preload request, and determine a plurality of other micro applications to be accessed in the micro application according to the determined application identifiers of the other micro applications.
Optionally, the second determining module 404 is further configured to receive user behavior feedback information sent by the client through the micro application, where the user behavior feedback information at least includes each other micro application visited by the user, and update the historical behavior data of the user according to the user behavior feedback information.
Embodiments of the present specification also provide a computer-readable storage medium, which stores a computer program, where the computer program can be used to execute the method for preloading the micro application provided in fig. 1 or fig. 3.
Based on the preloading method of the micro application shown in fig. 1 or fig. 3, the embodiment of the present specification further provides a schematic structural diagram of the electronic device shown in fig. 7. As shown in fig. 7, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, but may also include hardware required for other services. The processor reads a corresponding computer program from the non-volatile memory into the memory and then runs the computer program to implement the method for preloading the micro application shown in fig. 1 or 3.
Of course, besides the software implementation, the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims (11)

1. The method for preloading the micro application is characterized in that a client side is composed of a framework application, a plurality of micro applications and a preloading scheduling module, wherein the micro applications are mounted in the framework application;
the method comprises the following steps:
after the micro application displayed by the framework application is rendered, a client sends a preloading request to the preloading scheduling module through the micro application, wherein the preloading request at least comprises an application identifier of the micro application;
forwarding the preloading request to a server through the preloading scheduling module, and receiving a preloading scheme returned by the server through the preloading scheduling module;
sending the received preloading scheme to a framework application in the client through the preloading scheduling module;
sending an application acquisition request to be loaded to the server through the framework application according to the application identifier of the application to be loaded contained in the preloading scheme;
and receiving application data of the application to be loaded returned by the server through the framework application, and preloading the application to be loaded through the framework application according to the received application data of the application to be loaded.
2. The method of claim 1, wherein the page corresponding to the micro application is a long page, the long page comprising multiple screens;
sending a preload request to the preload scheduling module through the micro application, specifically including:
determining application entrances of other micro applications contained in the page of the current screen;
respectively determining application identifiers corresponding to the application inlets according to the determined application inlets of other micro applications;
and determining a preloading request according to the determined application identifications, and sending the preloading request to the preloading scheduling module through the micro application.
3. The method of claim 1, wherein the method further comprises:
and when the micro application monitors the operation of the designated behavior of the user, the client sends a preloading request to the preloading scheduling module through the micro application.
4. The method of claim 3, wherein prior to a client sending a preload request to the preload schedule module through the micro-application, the method further comprises:
acquiring a preset event binding relationship from the server through the framework application, wherein the event binding relationship comprises the corresponding relationship between each specified behavior operation of a user and a plurality of micro applications which are triggered to be loaded;
and sending the configuration file containing the event binding relation to the micro application through the framework application.
5. A method for preloading a micro-application, comprising:
the method comprises the steps that a server receives a preloading request sent by a client through a preloading scheduling module, wherein the preloading request comprises an application identifier of a micro application displayed in a framework application of the client;
determining a plurality of other micro applications to be accessed in the micro applications according to the preloading request;
determining a preloading scheme according to a plurality of other micro applications to be accessed in the micro applications and historical behavior data of a user, wherein the preloading scheme comprises the other micro applications to be loaded next;
and sending the determined preloading scheme to a preloading scheduling module of the client so that the frame application in the client preloads the other micro applications to be loaded according to the preloading scheme.
6. The method of claim 5, wherein determining a number of other ones of the micro-applications to be accessed based on the preload request comprises:
determining an application identification of each other micro-application exposed in the micro-application included in the preload request;
and determining a plurality of other micro applications to be accessed in the micro applications according to the determined application identifiers of the other micro applications.
7. The method of claim 5, wherein the method further comprises:
receiving user behavior feedback information sent by a client through the micro-application, wherein the user behavior feedback information at least comprises other micro-applications accessed by a user;
and updating the historical behavior data of the user according to the user behavior feedback information.
8. The device for preloading the micro applications is characterized by consisting of a framework application, a plurality of micro applications and a preloading scheduling module, wherein the micro applications are mounted in the framework application;
the device comprises:
the device comprises a first sending module, a second sending module and a third sending module, wherein the first sending module sends a preloading request to the preloading scheduling module through the micro application of the device after the micro application displayed by the framework application is rendered, and the preloading request at least comprises an application identifier of the micro application;
the receiving module forwards the preloading request to a server through the preloading scheduling module and receives a preloading scheme returned by the server through the preloading scheduling module;
a second sending module, configured to send the received preloading scheme to the framework application in the apparatus through the preloading scheduling module;
a third sending module, configured to send an application to be loaded acquisition request to the server through the framework application according to the application identifier of the application to be loaded included in the preloading scheme;
and the preloading module receives the application data of the application to be loaded returned by the server through the framework application and preloads the application to be loaded through the framework application according to the received application data of the application to be loaded.
9. A pre-loading apparatus for a micro-application, comprising:
the system comprises a receiving module, a pre-loading scheduling module and a pre-loading module, wherein the receiving module is used for receiving a pre-loading request sent by a client through the pre-loading scheduling module, and the pre-loading request comprises an application identifier of a micro application displayed in a framework application of the client;
the first determining module is used for determining a plurality of other micro applications to be accessed in the micro applications according to the preloading request;
the second determining module is used for determining a preloading scheme according to a plurality of other micro applications to be accessed in the determined micro applications and historical behavior data of a user, wherein the preloading scheme comprises the other micro applications to be loaded next;
and the preloading module is used for sending the determined preloading scheme to a preloading scheduling module of the client so as to enable the frame application in the client to preload other micro applications to be loaded according to the preloading scheme.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-4 or claims 5-7.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1-4 or 5-7 when executing the program.
CN202011582813.8A 2020-12-28 2020-12-28 Preloading method and device for micro-application Pending CN112631679A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011582813.8A CN112631679A (en) 2020-12-28 2020-12-28 Preloading method and device for micro-application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011582813.8A CN112631679A (en) 2020-12-28 2020-12-28 Preloading method and device for micro-application

Publications (1)

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

Family

ID=75325963

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011582813.8A Pending CN112631679A (en) 2020-12-28 2020-12-28 Preloading method and device for micro-application

Country Status (1)

Country Link
CN (1) CN112631679A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254237A (en) * 2021-06-11 2021-08-13 海尔数字科技(青岛)有限公司 Front-end application calling method, device, storage medium and program product
CN113934519A (en) * 2021-08-10 2022-01-14 荣耀终端有限公司 Application scheduling method and electronic equipment
CN114816639A (en) * 2022-04-24 2022-07-29 招银云创信息技术有限公司 Page display method, device, equipment, storage medium and program product

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254237A (en) * 2021-06-11 2021-08-13 海尔数字科技(青岛)有限公司 Front-end application calling method, device, storage medium and program product
CN113934519A (en) * 2021-08-10 2022-01-14 荣耀终端有限公司 Application scheduling method and electronic equipment
CN113934519B (en) * 2021-08-10 2022-08-02 荣耀终端有限公司 Application scheduling method and electronic equipment
CN114816639A (en) * 2022-04-24 2022-07-29 招银云创信息技术有限公司 Page display method, device, equipment, storage medium and program product

Similar Documents

Publication Publication Date Title
CN111639289B (en) Webpage loading method and device
CN112631679A (en) Preloading method and device for micro-application
CN106708899B (en) Automatic point burying method and device
CN111796823A (en) Method and device for updating page and displaying page and page maintenance system
CN108848244B (en) Page display method and device
CN107479868B (en) Interface loading method, device and equipment
CN111240788A (en) Method, device and equipment for generating small program page
CN112364277A (en) Webpage loading method and device
CN108460035B (en) Method and device for obtaining barrier-free function state and processing page
CN111796821A (en) Page updating method and device
CN109684573B (en) Target picture display method and device, storage medium and electronic equipment
CN112559934A (en) Page popup display method and device
CN111273965B (en) Container application starting method, system and device and electronic equipment
CN112597013A (en) Online development and debugging method and device
CN112685666A (en) Page loading method and device, storage medium and electronic equipment
CN111898056A (en) Webpage display method and device, storage medium and electronic equipment
CN110602163B (en) File uploading method and device
CN110427237B (en) Method and device for cross-application access to target page and electronic equipment
CN111880990B (en) Exception handling method and device
CN112035117A (en) Page display system, method and device
CN109582388B (en) Parameter configuration method, device and equipment
CN111538667A (en) Page testing method and device
CN113556260A (en) Flow monitoring method and device, storage medium and electronic equipment
CN111338655A (en) Installation package distribution method and system
CN110633321B (en) Data synchronization method, device and equipment

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