Module loading method and device, electronic equipment and storage medium
By obtaining and using the module loading policy prediction model to generate user-specific module loading strategies when receiving user access requests, the problem of slow module loading speed in front-end web engineering is solved, and faster loading speed and higher performance are achieved.
Patent Information
- Application Number
- CN202411198687.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-08-29
AI Technical Summary
In modern front-end web engineering, as the project iteration, the functional complexity increases, resulting in slower loading of modules and affecting user experience. The existing technology occupies more resources before loading all functional modules, with high performance requirements and unsatisfactory results.
By receiving user information when receiving user access requests, input it into the pre-built module loading policy prediction model, generate user-specific module loading policies, and perform module loading according to this policy. Each application is pre-packaged and deployed according to the policy, reducing the number of data being reduced. Unnecessary module loading.
It improves module loading speed, reduces application volume, improves user experience, matches appropriate module loading strategies for each user, optimizes resource usage, and improves performance.
Smart Images

Figure CN119201265A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a module loading method, device, electronic device and storage medium. Background Art
[0002] In modern front-end web projects, as projects iterate, functions become more and more complex, and web applications rely on more and more resources and modules, resulting in an increasing size of front-end applications. When users use certain functions or request certain resources, they need to load multiple dependent resources and modules, and the loading process is sometimes slow, which has a significant impact on user experience.
[0003] In the prior art, in order to speed up the loading process, all functional modules are loaded before the application is started. However, for some medium-to-large-scale applications, this will occupy more resources, have higher performance requirements, and the module loading effect is not ideal. Summary of the invention
[0004] In view of this, the present application provides a module loading method, device, electronic device and storage medium to solve the problem of unsatisfactory module loading effect in the prior art.
[0005] To achieve the above objectives, this application provides the following technical solutions:
[0006] In a first aspect, the present application discloses a module loading method, which is applied to a gateway, wherein the module loading method comprises:
[0007] When receiving an access request from a user, obtaining user information of the user; wherein the user information includes user authority and user historical routing information;
[0008] Inputting the user information into a pre-built module loading strategy prediction model for processing to obtain a module loading strategy corresponding to the user information; wherein the module loading strategy is used to characterize the functional modules that the user needs to load;
[0009] The access request is sent to the application for which the module loading policy is set to trigger the application to respond to the access request and load the module based on the module loading policy; wherein each application corresponds to a module loading policy, and each application is pre-packaged and deployed according to the corresponding module loading policy.
[0010] Optionally, in the above method, the process of constructing the module loading strategy prediction model includes:
[0011] Acquire sample data of user groups; wherein the sample data includes user information sample data and function module loading strategy sample data;
[0012] Performing data preprocessing on the sample data of the user groups;
[0013] Inputting the user information sample data into the initial model for calculation to obtain the function module loading strategy corresponding to the current user information sample data;
[0014] Determine whether the function module corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data;
[0015] If the function module loading strategy corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data, then the construction of the module loading strategy prediction model is completed;
[0016] If the function module loading strategy corresponding to the current user information sample data is inconsistent with the function module loading strategy sample data actually corresponding to the current user information sample data, the loss function is calculated, and the parameters of the initial model are adjusted based on the loss function until the function module corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data, and the construction of the module loading strategy prediction model is completed.
[0017] Optionally, in the above method, each application is pre-packaged and deployed according to a corresponding module loading strategy, including:
[0018] For each application, determine the module loading strategy corresponding to the current application;
[0019] Based on the module loading strategy corresponding to the current application, the code of the current application is optimized, and the application with optimized code is packaged;
[0020] The code-optimized application is deployed to a Web server.
[0021] Optionally, the above method further includes:
[0022] If user feedback information is received, the module loading strategy prediction model is optimized based on the user feedback information.
[0023] A second aspect of the present application provides a module loading device, which is applied to a gateway, wherein the module loading device includes:
[0024] An acquisition unit, configured to acquire user information of a user upon receiving an access request from the user; wherein the user information includes user authority and user historical routing information;
[0025] A processing unit, used for inputting the user information into a pre-built module loading strategy prediction model for processing, and obtaining a module loading strategy corresponding to the user information; wherein the module loading strategy is used to characterize the functional modules that the user needs to load;
[0026] A sending unit is used to send the access request to the application program for which the module loading policy is set, so as to trigger the application program to respond to the access request and load the module based on the module loading policy; wherein each application program corresponds to a module loading policy, and each application program is pre-packaged and deployed according to the corresponding module loading policy.
[0027] Optionally, in the above-mentioned device, the processing unit includes:
[0028] An acquisition subunit, used to acquire sample data of user groups; wherein the sample data includes user information sample data and function module loading strategy sample data;
[0029] A preprocessing subunit, used for performing data preprocessing on the sample data of the user group;
[0030] A calculation subunit, used for inputting the user information sample data into the initial model for calculation, and obtaining a function module loading strategy corresponding to the current user information sample data;
[0031] A judging subunit, used to judge whether the function module corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data;
[0032] A construction subunit, configured to complete the construction of the module loading strategy prediction model if the function module loading strategy corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data;
[0033] The adjustment subunit is used to calculate the loss function if the function module loading strategy corresponding to the current user information sample data is inconsistent with the function module loading strategy sample data actually corresponding to the current user information sample data, and adjust the parameters of the initial model based on the loss function until the function module corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data, thereby completing the construction of the module loading strategy prediction model.
[0034] Optionally, in the above device, the adjusting subunit includes:
[0035] A determination subunit is used to determine, for each application, a module loading strategy corresponding to the current application;
[0036] A packaging subunit, configured to optimize the code of the current application based on the module loading strategy corresponding to the current application, and to package the application after the code optimization;
[0037] The deployment subunit is used to deploy the code-optimized application to a Web server.
[0038] Optionally, the above device further includes:
[0039] The optimization unit is used to optimize the module loading strategy prediction model based on the user feedback information if the user feedback information is received.
[0040] The third aspect of the present application discloses an electronic device, comprising:
[0041] one or more processors;
[0042] a storage device having one or more programs stored thereon;
[0043] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of the first aspects of the present invention.
[0044] A fourth aspect of the present application discloses a computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method described in any one of the first aspects of the present invention is implemented.
[0045] It can be seen from the above technical scheme that in a module loading method provided by the present application, when receiving the user's access request, the user information of the user is obtained. Then the user information is input into the pre-built module loading strategy prediction model for processing to obtain the module loading strategy corresponding to the user information; wherein the module loading strategy is used to characterize the functional modules that the user needs to load. Finally, the access request is sent to the application program with the module loading strategy set to trigger the application program to respond to the access request and load the module based on the module loading strategy; wherein each application program corresponds to a module loading strategy, and each application program is pre-packaged and deployed according to the corresponding module loading strategy. It can be seen that, using the method of the present application, the module loading strategy corresponding to the current user can be obtained for each user through the pre-built module loading strategy prediction model, and then the corresponding application program is matched to load the module based on the module loading strategy corresponding to the user, and respond to the access request. And each application program is also pre-packaged and deployed according to the corresponding module loading strategy, and only the modules in the module loading strategy are retained, which reduces the application volume and improves the module loading speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0047] Figure 1 A flowchart of a module loading method disclosed in an embodiment of the present application;
[0048] Figure 2 A schematic diagram of the corresponding relationship between the user group and the module loading strategy disclosed in the embodiment of the present application;
[0049] Figure 3 It is a schematic diagram of different module loading strategies disclosed in the embodiments of the present application;
[0050] Figure 4 This is a schematic diagram of another different module loading strategy disclosed in an embodiment of the present application;
[0051] Figure 5 A flowchart of an implementation method of a process for constructing a module loading strategy prediction model disclosed in an embodiment of the present application;
[0052] Figure 6 An example diagram of a user accessing a server corresponding to a module loading strategy disclosed in an embodiment of the present application;
[0053] Figure 7 A schematic diagram of packaging and deploying an application disclosed in an embodiment of the present application;
[0054] Figure 8 A schematic diagram of a module loading device disclosed in an embodiment of the present application;
[0055] Fig. 9 A schematic diagram of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0057] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0058] Furthermore, in this document, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0059] As can be seen from the background technology, in the prior art, in order to speed up the loading speed, all functional modules are loaded before the application is started. However, for some medium and large-scale applications, this will occupy more resources, have higher performance requirements, and the module loading effect is not ideal.
[0060] In view of this, the present application provides a module loading method, device, electronic device and storage medium to solve the problem of unsatisfactory module loading effect in the prior art.
[0061] The present application embodiment provides a module loading method, which is applied to a gateway, such as Figure 1 As shown, specifically including:
[0062] S101. Upon receiving an access request from a user, obtain user information of the user; wherein the user information includes user authority and user historical routing information.
[0063] It should be noted that when a user needs to access a Web server, he sends an access request to the gateway. When the gateway receives the user's access request, it obtains the user's user information, where the user information includes user permissions and user historical routing information. User permissions are generally related to the user's identity, such as administrator permissions, salesperson permissions, etc. User historical routing information refers to: the front-end page URL used by the user. By checking the corresponding front-end html, css, js and other file resources loaded when opening the URL, the corresponding front-end resource module can be learned.
[0064] S102: Input the user information into a pre-built module loading strategy prediction model for processing to obtain a module loading strategy corresponding to the user information; wherein the module loading strategy is used to characterize the functional modules that the user needs to load.
[0065] It should be noted that after obtaining the user information, the user information is input into the pre-built module loading strategy prediction model for processing to obtain the module loading strategy corresponding to the user information. In this process, the module loading strategy prediction model first determines the user group information to which the user belongs based on the user information, for example, user group 1 is the management group, and user group 2 is the business group. Then, based on the following example, Figure 2 The mapping relationship between the user group and the module loading strategy shown in FIG. 1 is used to obtain the module loading strategy corresponding to the user. The module loading strategy is used to characterize the functional modules that the user needs to load. Different module loading strategies load different functional modules, such as Figure 3 and Figure 4 shown.
[0066] Optionally, in another embodiment of the present application, an implementation method of the construction process of the above module loading strategy prediction model is as follows: Figure 5 As shown, it may include:
[0067] S501. Obtain sample data of user groups; wherein the sample data includes user information sample data and function module loading strategy sample data.
[0068] It should be noted that first, sample data of user groups are obtained, wherein the sample data includes user information sample data and function module loading strategy sample data, and each user information sample data corresponds to a function module loading strategy sample data.
[0069] S502: Perform data preprocessing on sample data of user groups.
[0070] It should be noted that data preprocessing is performed on the sample data of the user groups, such as cleaning, normalization, missing value processing and other preprocessing operations to ensure data quality.
[0071] S503: Input the user information sample data into the initial model for calculation to obtain the function module loading strategy corresponding to the current user information sample data.
[0072] It should be noted that the user information sample data is input into the constructed initial model for calculation to obtain the function module loading strategy corresponding to the current user information sample data.
[0073] S504: Determine whether the function module loading strategy corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data.
[0074] It should be noted that after the function module loading strategy corresponding to the current user information sample data is calculated in the initial calculation model, the function module corresponding to the current user information sample data is compared with the function module loading strategy sample data actually corresponding to the current user information sample data, so as to determine whether the function module loading strategy corresponding to the current user information sample data calculated in the initial calculation model is accurate.
[0075] S505: If the function module loading strategy corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data, the construction of the module loading strategy prediction model is completed.
[0076] It should be noted that if the function module loading strategy corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data, it means that the calculation result of the model is accurate, and the construction of the module loading strategy prediction model is completed.
[0077] S506. If the function module loading strategy corresponding to the current user information sample data is inconsistent with the function module loading strategy sample data actually corresponding to the current user information sample data, then calculate the loss function and adjust the parameters of the initial model based on the loss function until the function module corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data, and then the construction of the module loading strategy prediction model is completed.
[0078] It should be noted that if the function module loading strategy corresponding to the current user information sample data is inconsistent with the function module loading strategy sample data actually corresponding to the current user information sample data, it means that the calculation result of the model is inaccurate. Then the loss function is calculated, and the parameters of the initial model are adjusted based on the loss function, and a new round of calculation is performed again until the function module corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data, and the construction of the module loading strategy prediction model is completed.
[0079] S103. Send an access request to an application program for which a module loading policy is set, so as to trigger the application program to respond to the access request and load the module based on the module loading policy; wherein each application program corresponds to a module loading policy, and each application program is pre-packaged and deployed according to the corresponding module loading policy.
[0080] It should be noted that after determining the module loading policy corresponding to the user information, the application program for which the module loading policy is set is determined, and the access request is sent to the application program. After receiving the user's access request, the application program responds to the user's access request, loads the module according to the module loading policy corresponding to the user information, and provides the user with access. The overall access process is as follows: Figure 6 As shown, each application corresponds to a module loading strategy, and each application is pre-packaged according to the corresponding module loading strategy and then deployed on the Web server.
[0081] Optionally, in another embodiment of the present application, in step S103, each application is pre-packaged and deployed according to a corresponding module loading strategy, which may include:
[0082] For each application, determine the module loading strategy corresponding to the current application.
[0083] Based on the module loading strategy corresponding to the current application, the code of the current application is optimized, and the application with optimized code is packaged.
[0084] Deploy the code-optimized application to a web server.
[0085] It should be noted that each application corresponds to only one module loading strategy. After a module loading strategy is determined, the application is packaged for the current module loading strategy. The most direct approach is to make restrictions directly at the code level. For example, when packaging applications used by business personnel, all codes that are not related to the business personnel’s permissions are deleted, and applications specifically for business personnel are packaged, thereby minimizing the size of the packaged application. In addition, different environment variables can be set according to permissions in the front-end functions, and different logics are executed in the code according to different environment variables. Environment variables are used as input parameters during packaging. After packaging, the packaging tool will automatically optimize the code according to different input parameters, and automatically delete unused code through strategies such as tree shaking optimization, thereby realizing the packaging of the application. Then use DevOps tools to automatically deploy these applications to the Web server. For the specific process, see Figure 7 .
[0086] In a module loading method provided by the present application, when receiving the user's access request, the user information of the user is obtained. The user information is input into a pre-built module loading strategy prediction model for processing to obtain the module loading strategy corresponding to the user information; wherein the module loading strategy is used to characterize the functional modules that the user needs to load; the access request is sent to the application program for which the module loading strategy is set to trigger the application program to respond to the access request and load the module based on the module loading strategy; wherein each application program corresponds to a module loading strategy, and each application program is pre-packaged and deployed according to the corresponding module loading strategy. It can be seen from this that, using the method of the present application, the module loading strategy corresponding to the current user can be obtained for each user through a pre-built module loading strategy prediction model, and then the corresponding application program is matched to load the module based on the module loading strategy corresponding to the user, and respond to the access request. And each application program is also pre-packaged and deployed according to the corresponding module loading strategy, and only the modules in the module loading strategy are retained, which reduces the application volume and improves the module loading speed.
[0087] Optionally, in another embodiment of the present application, the module loading method may further include:
[0088] If user feedback information is received, the module loading strategy prediction model is optimized based on the user feedback information.
[0089] It should be noted that if user feedback is received, for example, the user feedback indicates that some modules should be loaded but some modules do not need to be loaded, then the parameters of the module loading strategy prediction model are adjusted and optimized based on the user feedback information to improve the accuracy of the model.
[0090] Another embodiment of the present application also discloses a module loading device, such as Figure 8 As shown, specifically including:
[0091] The acquisition unit 801 is used to acquire user information of the user upon receiving an access request from the user; wherein the user information includes user authority and user historical routing information.
[0092] The processing unit 802 is used to input the user information into a pre-built module loading strategy prediction model for processing to obtain a module loading strategy corresponding to the user information; wherein the module loading strategy is used to characterize the functional modules that the user needs to load.
[0093] The sending unit 803 is used to send an access request to an application for which a module loading policy is set, so as to trigger the application to respond to the access request and load the module based on the module loading policy; wherein each application corresponds to a module loading policy, and each application is pre-packaged and deployed according to the corresponding module loading policy.
[0094] In this embodiment, the specific execution process of the acquisition unit 801, the processing unit 802, and the sending unit 803 can be found in the corresponding Figure 1 The content of the method embodiment will not be repeated here.
[0095] In a module loading device provided by the present application, when receiving the user's access request, the acquisition unit 801 acquires the user information of the user. The processing unit 802 inputs the user information into the pre-built module loading strategy prediction model for processing, and obtains the module loading strategy corresponding to the user information; wherein the module loading strategy is used to characterize the functional modules that the user needs to load; the sending unit 803 sends the access request to the application program with the module loading strategy set to trigger the application program to respond to the access request, and load the module based on the module loading strategy; wherein each application program corresponds to a module loading strategy, and each application program is pre-packaged and deployed according to the corresponding module loading strategy. It can be seen from this that, using the method of the present application, the module loading strategy corresponding to the current user can be obtained for each user through the pre-built module loading strategy prediction model, and then the corresponding application program is matched to load the module based on the module loading strategy corresponding to the user, and responds to the access request. And each application program is also pre-packaged and deployed according to the corresponding module loading strategy, and only the modules in the module loading strategy are retained, which reduces the application volume and improves the loading speed of the module.
[0096] Optionally, in another embodiment of the present application, an implementation of the processing unit 802 includes:
[0097] The acquisition subunit is used to acquire sample data of user groups; wherein the sample data includes user information sample data and function module loading strategy sample data.
[0098] The preprocessing subunit is used to perform data preprocessing on the sample data of the user groups.
[0099] The operation subunit is used to input the user information sample data into the initial model for operation, and obtain the function module loading strategy corresponding to the current user information sample data.
[0100] The judging subunit is used to judge whether the function module corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data.
[0101] The construction subunit is used to complete the construction of the module loading strategy prediction model if the function module loading strategy corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data.
[0102] The adjustment subunit is used to calculate the loss function if the function module loading strategy corresponding to the current user information sample data is inconsistent with the function module loading strategy sample data actually corresponding to the current user information sample data, and adjust the parameters of the initial model based on the loss function until the function module corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data, thereby completing the construction of the module loading strategy prediction model.
[0103] In this embodiment, the specific execution process of the acquisition subunit, the preprocessing subunit, the operation subunit, the judgment subunit, the construction subunit and the adjustment subunit can be referred to in the corresponding Figure 5 The content of the method embodiment will not be repeated here.
[0104] Optionally, in another embodiment of the present application, an implementation of the sending unit 803 includes:
[0105] The determination subunit is used to determine, for each application, a module loading strategy corresponding to the current application.
[0106] The packaging subunit is used to optimize the code of the current application based on the module loading strategy corresponding to the current application, and to package the application after the code optimization.
[0107] The deployment subunit is used to deploy the code-optimized application to the Web server.
[0108] In this embodiment, the specific execution process of determining sub-units, packaging sub-units, and deploying sub-units can be found in the corresponding method embodiments described above, and will not be repeated here.
[0109] Optionally, in another embodiment of the present application, the module loading device may further include:
[0110] The optimization unit is used to optimize the module loading strategy prediction model based on the user feedback information if the user feedback information is received.
[0111] Another embodiment of the present application further provides an electronic device, such as Fig. 9 As shown, specifically including:
[0112] One or more processors 901.
[0113] The storage device 902 stores one or more programs.
[0114] When one or more programs are executed by one or more processors 901 , the one or more processors 901 implement any one of the methods in the above embodiments.
[0115] Another embodiment of the present application further provides a computer storage medium on which a computer program is stored, wherein when the computer program is executed by a processor, any one of the methods in the above embodiments is implemented.
[0116] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0117] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0118] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A module loading method, characterized in that: Applied to a gateway, wherein the module loading method comprises: When receiving an access request from a user, obtaining user information of the user; wherein the user information includes user authority and user historical routing information; Inputting the user information into a pre-built module loading strategy prediction model for processing to obtain a module loading strategy corresponding to the user information; wherein the module loading strategy is used to characterize the functional modules that the user needs to load; The access request is sent to the application for which the module loading policy is set to trigger the application to respond to the access request and load the module based on the module loading policy; wherein each application corresponds to a module loading policy, and each application is pre-packaged and deployed according to the corresponding module loading policy.
2. The method according to claim 1, characterized in that: The construction process of the module loading strategy prediction model includes: Acquire sample data of user groups; wherein the sample data includes user information sample data and function module loading strategy sample data; Performing data preprocessing on the sample data of the user groups; Inputting the user information sample data into the initial model for calculation to obtain the function module loading strategy corresponding to the current user information sample data; Determine whether the function module corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data; If the function module loading strategy corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data, then the construction of the module loading strategy prediction model is completed; If the function module loading strategy corresponding to the current user information sample data is inconsistent with the function module loading strategy sample data actually corresponding to the current user information sample data, the loss function is calculated, and the parameters of the initial model are adjusted based on the loss function until the function module corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data, and the construction of the module loading strategy prediction model is completed.
3. The method according to claim 1, characterized in that Each application is pre-packaged and deployed according to the corresponding module loading strategy, including: For each application, determine the module loading strategy corresponding to the current application; Based on the module loading strategy corresponding to the current application, the code of the current application is optimized, and the application with optimized code is packaged; The code-optimized application is deployed to a Web server.
4. The method according to claim 1, characterized in that: Also includes: If user feedback information is received, the module loading strategy prediction model is optimized based on the user feedback information.
5. A module loading device, characterized in that: Applied to a gateway, wherein the module loading device comprises: An acquisition unit, configured to acquire user information of a user upon receiving an access request from the user; wherein the user information includes user authority and user historical routing information; A processing unit, used for inputting the user information into a pre-built module loading strategy prediction model for processing, and obtaining a module loading strategy corresponding to the user information; wherein the module loading strategy is used to characterize the functional modules that the user needs to load; A sending unit is used to send the access request to the application program for which the module loading policy is set, so as to trigger the application program to respond to the access request and load the module based on the module loading policy; wherein each application program corresponds to a module loading policy, and each application program is pre-packaged and deployed according to the corresponding module loading policy.
6. The device according to claim 5, characterized in that The processing unit comprises: An acquisition subunit, used to acquire sample data of user groups; wherein the sample data includes user information sample data and function module loading strategy sample data; A preprocessing subunit, used for performing data preprocessing on the sample data of the user group; A calculation subunit, used for inputting the user information sample data into the initial model for calculation, and obtaining a function module loading strategy corresponding to the current user information sample data; A judging subunit, used to judge whether the function module corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data; A construction subunit, configured to complete the construction of the module loading strategy prediction model if the function module loading strategy corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data; The adjustment subunit is used to calculate the loss function if the function module loading strategy corresponding to the current user information sample data is inconsistent with the function module loading strategy sample data actually corresponding to the current user information sample data, and adjust the parameters of the initial model based on the loss function until the function module corresponding to the current user information sample data is consistent with the function module loading strategy sample data actually corresponding to the current user information sample data, thereby completing the construction of the module loading strategy prediction model.
7. The device according to claim 5, characterized in that The adjusting subunit comprises: A determination subunit is used to determine, for each application, a module loading strategy corresponding to the current application; A packaging subunit, configured to optimize the code of the current application based on the module loading strategy corresponding to the current application, and to package the application after the code optimization; The deployment subunit is used to deploy the code-optimized application to a Web server.
8. The device according to claim 5, characterized in that Also includes: The optimization unit is used to optimize the module loading strategy prediction model based on the user feedback information if the user feedback information is received.
9. An electronic device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 4.
10. A computer storage medium, characterized in that: A computer program is stored thereon, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Application program prediction model establishment and preloading method and device, medium and terminal
CN109766138A
APP page display method and system, mobile terminal and computer readable medium
CN109885787A
Application program preloading method and device, storage medium and mobile terminal
CN109947498A
Pre-downloading method of application program update package, related equipment and storage medium
CN112685058A
Page loading method and device, storage medium and computer equipment
CN116225567A