Application processing method, application running method and related equipment

By assigning the application's business modules and their dependencies to different packaging queues and generating multiple packaging files, the problem of long loading time in the existing technology is solved, and more efficient loading and flexible packaging methods are achieved.

CN112445500BActive Publication Date: 2024-12-03BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011380287.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-30
Publication Date
2024-12-03
Estimated Expiration
2040-11-30

AI Technical Summary

Technical Problem

Existing applications have long loading times and lack flexibility because the code is packaged into a large file.

Method used

By determining the business modules of the application and their dependencies, assigning the modules to different packaging queues, generating multiple packaging files, and only partial files are loaded at runtime.

Benefits of technology

Improves application packaging flexibility and loading efficiency and reduces loading time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112445500B_ABST
    Figure CN112445500B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an application processing method, an application running method and related equipment. The application processing method includes: determining N business modules corresponding to the source code of the first application; determining the second business module that the first business module depends on through the first dependency function, the first business module is any business module among the K business modules; adding the first business module to the first packaging queue, and adding the second business module to the second packaging queue; generating M packaging files corresponding to the first application, the M packaging files at least include a first packaging file and a second packaging file, the first packaging file is obtained by packaging the code of the business module in the first packaging queue, and the second packaging file is obtained by packaging the code of the business module in the second packaging queue. The present disclosure can add two business modules that form a dependency relationship through the first dependency function to different packaging queues, and package them into different packaging files, so as to realize the autonomy of subpackaging.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to an application processing method, an application running method and related devices. Background Art

[0002] As the functions of applications become more and more numerous, the size of applications also increases. Applications are usually packaged and distributed for users to download and install. At present, application packaging usually packages the code of the application into a bundle file. In this way, when the electronic device runs the application, it needs to load the entire bundle file, resulting in a long loading time for the application. Summary of the invention

[0003] The present disclosure provides an application processing method, an application running method and related devices, so as to at least solve the problem in the related art that the application code is packaged into a package file, resulting in a long application loading time. The technical solution of the present disclosure is as follows:

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an application processing method, including:

[0005] Determine N business modules corresponding to the source code of the first application, where N is an integer greater than 1;

[0006] In the case where there are K business modules whose codes include a first dependency function among the N business modules, determining a second business module on which the first business module depends through the first dependency function, where the first business module is any business module among the K business modules, and K is a positive integer less than or equal to N;

[0007] Adding the first service module to a first packaging queue, and adding the second service module to a second packaging queue;

[0008] Generate M packaged files corresponding to the first application, the M packaged files include at least a first packaged file and a second packaged file, the first packaged file is obtained by packaging the code of the business module in the first packaged queue, and the second packaged file is obtained by packaging the code of the business module in the second packaged queue.

[0009] According to a second aspect of an embodiment of the present disclosure, there is provided a method for running an application program, including:

[0010] Receiving a first input for a first application, where the first input is used to indicate loading information corresponding to a first business module of the first application;

[0011] Sending a first request, where the first request is used to request the first service module;

[0012] receiving a first packaged file, where the first packaged file is obtained by packaging codes of a service module in a first packaged queue, where the first packaged queue includes the first service module;

[0013] According to the first packaging file, information corresponding to the first business module is loaded.

[0014] According to a third aspect of an embodiment of the present disclosure, there is provided an application processing device, including:

[0015] A first determination module is configured to determine N business modules corresponding to the source code of the first application program, where N is an integer greater than 1;

[0016] A second determination module is configured to determine, when there are K business modules whose codes include a first dependency function in the N business modules, a second business module on which the first business module depends through the first dependency function, wherein the first business module is any business module among the K business modules, and K is a positive integer less than or equal to N;

[0017] An adding module, configured to add the first service module to a first packaging queue, and add the second service module to a second packaging queue;

[0018] The first generating module is configured to generate M packaged files corresponding to the first application, wherein the M packaged files include at least a first packaged file and a second packaged file, wherein the first packaged file is obtained by packaging the code of the business module in the first packaged queue, and the second packaged file is obtained by packaging the code of the business module in the second packaged queue.

[0019] According to a fourth aspect of an embodiment of the present disclosure, there is provided an application program running device, including:

[0020] A third receiving module is configured to receive a first input for a first application, where the first input is used to indicate loading information corresponding to a first business module of the first application;

[0021] A third sending module is configured to send a first request, where the first request is used to request the first service module;

[0022] A fourth receiving module is configured to receive a first packaged file, where the first packaged file is obtained by packaging the code of the service module in the first packaged queue, where the first packaged queue includes the first service module;

[0023] The loading module is configured to load information corresponding to the first business module according to the first packaging file.

[0024] According to a fifth aspect of an embodiment of the present disclosure, a server is provided, including:

[0025] processor;

[0026] a memory for storing instructions executable by the processor;

[0027] The processor is configured to execute the instructions to implement the method as described in the first aspect.

[0028] According to a sixth aspect of an embodiment of the present disclosure, there is provided an electronic device, characterized in that it includes:

[0029] processor;

[0030] a memory for storing instructions executable by the processor;

[0031] The processor is configured to execute the instructions to implement the method as described in the second aspect.

[0032] According to a seventh aspect of an embodiment of the present disclosure, a storage medium is provided. When instructions in the storage medium are executed by a processor, the method described in the first aspect can be executed; or, the method described in the second aspect can be executed.

[0033] According to an eighth aspect of the embodiments of the present disclosure, a computer program product is provided, including:

[0034] The executable instructions, when executed on a computer, enable the computer program product to execute the method according to the first aspect; or execute the method according to the second aspect.

[0035] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0036] In the embodiment of the present disclosure, for a first business module whose code includes a first dependent function, the first business module and a second business module that the first business module depends on through the first dependent function can be added to different packaging queues to obtain different packaging files of the application. It can be seen that the embodiment of the present disclosure can autonomously package the code of the application into at least one packaging file, thereby improving the flexibility of application packaging; in addition, when running the application, only part of the packaging files of the application can be loaded, thereby reducing the loading time of the application.

[0037] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0039] Figure 1 The invention is a schematic diagram of a communication system according to an exemplary embodiment.

[0040] Figure 2 The figure is a flowchart of a method for processing an application program according to an exemplary embodiment.

[0041] Figure 3 The figure is a flowchart of a method for running an application program according to an exemplary embodiment.

[0042] Figure 4 The figure is a flowchart of a method for packaging an application program according to an exemplary embodiment.

[0043] Figure 5 The figure is a flowchart of a method for running an application program according to an exemplary embodiment.

[0044] Figure 6 The invention is a block diagram of an application processing device according to an exemplary embodiment.

[0045] Figure 7 The invention is a block diagram of a device for running an application program according to an exemplary embodiment.

[0046] Figure 8 It is a block diagram of a communication device according to an exemplary embodiment. DETAILED DESCRIPTION

[0047] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0048] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0049] First, the application scenarios of the technical solutions provided by this disclosure are introduced:

[0050] Figure 1 FIG. 1 shows a communication system to which the embodiments of the present disclosure can be applied. Figure 1 As shown, the communication system may include an electronic device 11 and a server 12. The electronic device 11 and the server 12 may communicate. In specific implementation, the server 12 may package the code of the application and send the relevant packaged files of the application to the electronic device 11 upon the request of the electronic device 11. In actual applications, the electronic device 11 may be a mobile phone, a computer, a wearable device, etc.; the server 12 may be a packaging platform, etc.

[0051] The embodiments of the present disclosure are described in detail below in conjunction with specific embodiments.

[0052] See also Figure 2 , Figure 2 The figure is a flowchart of a method for processing an application program according to an exemplary embodiment. Figure 2 The application processing method shown can be applied to a server.

[0053] like Figure 2 As shown, the application processing method may include the following steps:

[0054] In step S21, N business modules corresponding to the source code of the first application are determined, where N is an integer greater than 1.

[0055] In the disclosed embodiment, the first application may be any application to be packaged. In actual applications, an application includes multiple different business modules, and each business module corresponds to a corresponding code. For example, in a shopping application, business modules such as a home page, a shopping cart, and product details are usually included. Therefore, in a specific implementation, after obtaining the source code of the first application, the server can determine the N business modules corresponding to the source code.

[0056] In some implementations of the disclosed embodiments, the first application may be written in Java, and its source code may be JavaScript (JS) code. However, it is understandable that in other implementations, the first application may be constructed in other writing languages, which is not limited in the disclosed embodiments.

[0057] In step S22, when there are K business modules whose codes include a first dependency function among the N business modules, a second business module on which the first business module depends through the first dependency function is determined, where the first business module is any business module among the K business modules, and K is a positive integer less than or equal to N.

[0058] Business modules in an application can be independent or have dependencies. For two business modules with dependencies, the operation of one business module (the relying party) requires calling the data, functions or attributes of another business module (the dependent party). For example, in a shopping application, when the shopping cart needs to display product details, the business module corresponding to the shopping cart needs to call the framework data of the business module corresponding to the product details page. In this case, the business module corresponding to the shopping cart and the business module corresponding to the product details page have a dependency relationship, and the business module corresponding to the shopping cart is the relying party, and the business module corresponding to the product details page is the dependent party.

[0059] The dependency relationship between business modules can be formed through dependency functions. Specifically, if the code of business module 1 includes a dependency function (the module name of business module 2), it means that the dependency function included in the code of business module 1 acts on business module 2. Then, business module 1 and business module 2 have a dependency relationship, and business module 1 depends on business module 2 and is the dependent party; business module 2 is dependent on business module 1 and is the dependent party.

[0060] In the embodiment of the present disclosure, the dependent function includes at least a first dependent function, and further, may include a second dependent function. In practical applications, the first dependent function may include an asynchronous callback (asyncRequire) function, and the second dependent function may include at least one of a callback (Require) function and an input (import) function, which may be determined according to actual conditions, and the embodiment of the present disclosure does not limit this.

[0061] For the convenience of distinction, in the embodiment of the present disclosure, the dependency relationship formed by the first dependency function is referred to as the first dependency relationship, and the dependency relationship formed by the second dependency function is referred to as the second dependency relationship. It should be noted that in the embodiment of the present disclosure, the codes of the two business modules that form a dependency relationship through the first dependency function, that is, the two business modules with the first dependency relationship, will be packaged in different packaged files, while the codes of the two business modules that form a dependency relationship through the second dependency function, that is, the two business modules with the second dependency relationship, can be packaged in the same packaged file. For example: assuming that business module 1 and business module 2 form a dependency relationship through the first dependency function, and business module 2 and business module 3 form a dependency relationship through the second dependency function, then the code of business module 1 can be packaged in package file a, and the code of business module 2 and business module 3 can be packaged in package file b.

[0062] Therefore, in the embodiment of the present disclosure, after determining the N business modules, the server can detect whether there is a business module whose code includes the first dependent function among the N business modules, obtain the detection result, and perform corresponding packaging operations according to the detection result.

[0063] Specifically, when the detection result is that there are K business modules whose codes include the first dependency function among the N business modules, for any business module among the K business modules, the business module on which it depends through the first dependency function can be determined, and step S23 is executed.

[0064] When the detection result is that there is no business module including the first dependent function among the N business modules, the N business modules can be added to the same packaging queue, and the codes of the business modules in the packaging queue can be packaged to obtain a packaging file.

[0065] In step S23, the first service module is added to a first packaging queue, and the second service module is added to a second packaging queue.

[0066] In the disclosed embodiment, before packaging, the server may first add the business modules that can be packaged together to the same packaging queue, so that the server can package the codes of all business modules in the same packaging queue into the same packaging file.

[0067] From the foregoing content, it can be seen that the codes of the two business modules that form a dependency relationship through the first dependency function will be packaged in different packaging files, and the first business module and the second business module formally form a dependency relationship through the first dependency function. Therefore, the first business module and the second business module can be added to different packaging queues.

[0068] In step S24, M packaged files corresponding to the first application are generated, and the M packaged files include at least a first packaged file and a second packaged file. The first packaged file is obtained by packaging the code of the business module in the first packaged queue, and the second packaged file is obtained by packaging the code of the business module in the second packaged queue.

[0069] During specific implementation, the server may package the first packaging queue and the second packaging queue successively, or may package the first packaging queue and the second packaging queue in parallel, thereby improving packaging efficiency.

[0070] In the application processing method of the embodiment of the present disclosure, for a first business module whose code includes a first dependency function, the first business module and the second business module that the first business module depends on through the first dependency function can be added to different packaging queues to obtain different packaging files of the application. It can be seen that the embodiment of the present disclosure can autonomously package the code of the application into at least one packaging file, thereby improving the flexibility of application packaging; in addition, when running the application, only part of the packaging files of the application can be loaded, thereby reducing the loading time of the application.

[0071] In the embodiment of the present disclosure, optionally, before the step of adding the first service module to the first packaging queue and the second service module to the second packaging queue, the method further includes:

[0072] In a case where the code of the first business module further includes a second dependent function, determining a third business module on which the first business module depends through the second dependent function;

[0073] The step of adding the first service module to the first packaging queue and the step of adding the second service module to the second packaging queue includes:

[0074] The first service module and the third service module are added to a first packaging queue, and the second service module is added to a second packaging queue.

[0075] As can be seen from the foregoing, two business modules that form a dependency relationship through the second dependency function can be packaged in the same package file. Therefore, in this optional implementation, the first business module and the third business module can be added to the same package queue and packaged into the same package file.

[0076] It can be seen that in the embodiments of the present disclosure, the business modules with the first dependency relationship can be added to different packaging queues and packaged into different packaging files through the dependency function in the code; the business modules with the second dependency relationship can be added to the same packaging queue and packaged into the same packaging file, thereby realizing autonomous confirmation of the business modules in the packaging file, thereby improving the autonomy of packaging.

[0077] In the embodiment of the present disclosure, optionally, after the step of determining the N business modules corresponding to the source code of the first application and before the step of adding the first business module to the first packaging queue and the second business module to the second packaging queue, the method further includes:

[0078] According to the N business modules, an abstract syntax tree (AST) including P paths is generated, wherein the P paths include N nodes, the N nodes correspond to the N business modules one by one, the business modules corresponding to two adjacent nodes of each path in the P paths have a dependency relationship, and the business modules corresponding to the nodes included in different paths do not have a dependency relationship, and P is a positive integer;

[0079] After the step of generating an abstract syntax tree AST including P paths, and before the step of adding the first service module to the first packaging queue and the second service module to the second packaging queue, the method further includes:

[0080] Identify a first path among the P paths, where the first path includes at least a first node and a second node, where the first node corresponds to the first service module, and the second node corresponds to the second service module;

[0081] The first path is updated to a first sub-path set, where the first sub-path set includes at least a first sub-path and a second sub-path, the first sub-path includes the first node, and the dependency relationship of the business modules corresponding to the nodes included in the first sub-path is formed by a second dependency function, the second sub-path includes the second node, and the dependency relationship of the business modules corresponding to the nodes included in the second sub-path is generated by the second dependency function;

[0082] The step of adding the first service module to the first packaging queue and the step of adding the second service module to the second packaging queue includes:

[0083] The service modules corresponding to the nodes included in the first sub-path are added to the first packaging queue, and the service modules corresponding to the nodes included in the second sub-path are added to the second packaging queue.

[0084] It should be noted that the dependency relationship between the business modules corresponding to two adjacent nodes of each of the P paths can be any one of the following: the first dependency relationship and the second dependency relationship. In other words, the dependency relationship between the business modules corresponding to two adjacent nodes of each of the P paths can be formed by any one of the following: the first dependency function and the second dependency function.

[0085] Since the codes of the two business modules with the first dependency relationship in the embodiment of the present disclosure need to be packaged in different packaged files, while the codes of the two business modules with the second dependency relationship can be packaged in the same packaged file. Therefore, for the path with the first dependency relationship, it can be updated to at least two sub-paths, so that the business modules corresponding to each node in each sub-path are the second dependency relationship. After the update, the business modules corresponding to the nodes of the different paths updated in the AST can be added to different packaged queues to obtain different packaged files.

[0086] For ease of understanding, the following examples are provided:

[0087] Assume that the first application includes business modules 1 to 7, wherein the code of business module 1 includes the first dependency function (module name of business module 2), the code of business module 2 includes the second dependency function (module name of business module 3), the code of business module 4 includes the first dependency function (module name of business module 5), and the code of business module 6 includes the second dependency function (module name of business module 7). It can be seen that business module 1 and business module 2 have a first dependency relationship, business module 2 and business module 3 have a second dependency relationship, business module 4 and business module 5 have a first dependency relationship, and business module 6 and business module 7 have a second dependency relationship.

[0088] Then, in this example, the AST generated by the server may include three independent paths, which are respectively recorded as path 1, path 2 and path 3. Among them, path 1 includes nodes 1, node 2 and node 3 in sequence, node 1 corresponds to business module 1, node 2 corresponds to business module 2, and node 3 corresponds to business module 3; path 2 includes nodes 4 and node 5 in sequence, node 4 corresponds to business module 4, and node 5 corresponds to business module 5; path 3 includes nodes 6 and node 7 in sequence, node 6 corresponds to business module 6, and node 7 corresponds to business module 7.

[0089] Through the above optional implementation, the server can update path 1 to sub-path a and sub-path b, where sub-path a includes node 1, and sub-path b includes node 2 and node 3 in sequence; and update path 2 to sub-path c and sub-path d, where sub-path c includes node 3, and sub-path d includes node 4 in sequence.

[0090] The server can add the business modules corresponding to the nodes of subpath a, subpath b, subpath c, subpath d and path 3 to different packaging queues to form different packaging files. For example, Bundle 1 includes the code of business module 1, Bundle 2 includes the code of business module 2 and business module 3, Bundle 3 includes the code of business module 4, Bundle 4 includes the code of business module 5, and Bundle 5 includes the code of business module 6 and business module 7.

[0091] In the embodiment of the present disclosure, after the server packages the code of the first application, the electronic device may request to download the corresponding package file of the first application according to the running requirements of the first application, as described in detail as follows:

[0092] Optionally, receiving a first request, where the first request is used to request the first service module;

[0093] The first packaged file is sent.

[0094] In a specific implementation, after receiving a first input for a first application, the first input being used to indicate loading information corresponding to a first service module of the first application, the electronic device may send a first request to a server for requesting the first service module. After receiving the first request, the server may respond to the first request by sending only the first package file to the electronic device.

[0095] As can be seen from the foregoing, the first business module depends on the second business module, that is, the first business module needs to call the data, functions or attributes of the second business module. Therefore, the electronic device also needs to obtain the second package file corresponding to the second business module to load the second business module. If the electronic device does not store the second package file, it is necessary to request the server to send the second package file. In this case, optionally, after the step of sending the first package file, the method further includes:

[0096] receiving a second request, where the second request is used to request the second package file;

[0097] The second package file is sent.

[0098] It can be seen that in the disclosed embodiment, the server can send a packaged file matching the request based on the request of the electronic device, and will not directly send all the packaged files of the first electronic device to the electronic device, thereby improving the flexibility of packaged file processing. On the other hand, the electronic device does not need to load all the packaged files at once, thereby reducing the loading time and improving the loading efficiency.

[0099] See also Figure 3 , Figure 3 The figure is a flowchart of a method for running an application program according to an exemplary embodiment. Figure 3 The application running method shown can be executed by an electronic device.

[0100] like Figure 3 As shown, the application running method may include the following steps:

[0101] In step S31, a first input for a first application is received, where the first input is used to indicate loading of information corresponding to a first business module of the first application.

[0102] In step S32, a first request is sent, where the first request is used to request the first service module.

[0103] In step S33, a first packaged file is received, where the first packaged file is obtained by packaging the code of the service module in the first packaged queue, where the first packaged queue includes the first service module.

[0104] In step S34, information corresponding to the first business module is loaded according to the first packaging file.

[0105] Optionally, after the step of receiving the first package file and before the step of loading the information corresponding to the first business module, the method further includes:

[0106] In a case where the code of the first business module includes a first dependency function, detecting whether a second business module is stored, where the second business module is a business module that the first business module depends on through the first dependency function;

[0107] If the second business module is not stored, sending a second request, where the second request is used to request a second package file corresponding to the second business module;

[0108] receiving the second package file;

[0109] The step of loading information corresponding to the first business module according to the first packaging file includes:

[0110] Information corresponding to the first service module and information corresponding to the second service module are loaded according to the first packaging file and the second packaging file.

[0111] Optionally, after the step of sending the second request, the method further includes:

[0112] In the case where the second package file is not received, a prompt message is output, where the prompt message is used to prompt that the first application program runs abnormally.

[0113] In the application running method of the disclosed embodiment, the electronic device can load the packaged file corresponding to the business module of the application on demand, and return to the module to continue to execute subsequent processes after the loading is completed. In this way, the reliability of the application running can be improved.

[0114] It should be noted that this embodiment is Figure 2The electronic device embodiments corresponding to the method embodiments can therefore be found in Figure 2 The relevant descriptions in the method embodiment can achieve the same beneficial effects. In order to avoid repeated descriptions, they will not be repeated here.

[0115] The various optional implementations introduced in the embodiments of the present disclosure may be implemented in combination with each other or may be implemented separately if they do not conflict with each other, and the embodiments of the present disclosure are not limited to this.

[0116] For ease of understanding, the following examples are provided:

[0117] During development, the developer can add a first dependency function asyncRequire in the application code, and form a dependency relationship between business modules through asyncRequire.

[0118] When packaging, the packaging platform can statically parse the path module acted upon by asyncRequire in the code, exclude the path module and its dependencies from the list of modules packaged in the current page, and then put the path module and its dependencies into another packaging queue. After the packaging queue corresponding to the current page is packaged, continue to take other modules from other queues for packaging.

[0119] For easier understanding, please refer to Figure 4 .like Figure 4 As shown, the application packaging method may include the following steps:

[0120] In step S41, the JS code of the application is parsed into AST.

[0121] In step S42, asyncRequire in AST is identified, the path module is extracted to generate sub-packaging rules, and the corresponding dependencies of the path module are modified.

[0122] In step S43, a dependency graph between JS modules is generated.

[0123] In step S44, the dependent modules are assembled into a bundle package.

[0124] During runtime, asyncRequire will query whether there is a corresponding bundle locally. If not, it will request network download. After loading is complete, it will return to the module to continue executing subsequent processes.

[0125] For easier understanding, please refer to Figure 5 .like Figure 5 As shown, the method for running the application may include the following steps:

[0126] In step S51, the first bundle file is loaded.

[0127] In step S52, it is identified that asyncRequire exists in the first bundle file.

[0128] In step S53, it is detected whether there is a path module affected by asyncRequire in the memory.

[0129] If it exists, execute step S54; if it does not exist, execute step S55.

[0130] In step S54, the path module to which asyncRequire acts is returned.

[0131] In step S55, a loading indicator is displayed, and the second bundle file corresponding to the path module acted upon by asyncRequire is downloaded.

[0132] In step S56, it is detected whether the second bundle file is loaded successfully.

[0133] If unsuccessful, execute step S57; if successful, execute step S58.

[0134] In step S57, a JS exception is thrown.

[0135] In step S58, the path module acted upon by asyncRequire is put into the memory cache.

[0136] The disclosed embodiment can add a first dependency function in the code of the application program, that is, enable the server to parse the dependency function in the code and implement bundle packaging for the application program, thereby improving the autonomy of server packaging.

[0137] Figure 6 FIG. 1 is a block diagram of an application processing device according to an exemplary embodiment. Figure 6 , the application processing device may include:

[0138] A first determination module 601 is configured to determine N business modules corresponding to the source code of the first application program, where N is an integer greater than 1;

[0139] The second determining module 602 is configured to determine, when there are K business modules whose codes include the first dependency function among the N business modules, a second business module on which the first business module depends through the first dependency function, wherein the first business module is any business module among the K business modules, and K is a positive integer less than or equal to N;

[0140] An adding module 603 is configured to add the first service module to a first packaging queue, and add the second service module to a second packaging queue;

[0141] The first generating module 604 is configured to generate M packaged files corresponding to the first application, and the M packaged files include at least a first packaged file and a second packaged file. The first packaged file is obtained by packaging the code of the business module in the first packaging queue, and the second packaged file is obtained by packaging the code of the business module in the second packaging queue.

[0142] Optionally, the application processing device further includes:

[0143] A third determining module is configured to determine a third business module on which the first business module depends through the second dependent function when the code of the first business module further includes a second dependent function;

[0144] The adding module 603 is configured to add the first service module and the third service module to the first packaging queue, and add the second service module to the second packaging queue.

[0145] Optionally, the application processing device further includes:

[0146] A second generation module is configured to generate an abstract syntax tree AST including P paths according to the N business modules, wherein the P paths include N nodes, the N nodes correspond to the N business modules one by one, the business modules corresponding to two adjacent nodes of each path in the P paths have a dependency relationship, and the business modules corresponding to the nodes included in different paths do not have a dependency relationship, and P is a positive integer;

[0147] an identification module configured to identify a first path among the P paths, the first path comprising at least a first node and a second node, the first node corresponding to the first service module, and the second node corresponding to the second service module;

[0148] an updating module, configured to update the first path to a first sub-path set, the first sub-path set including at least a first sub-path and a second sub-path, the first sub-path including the first node, and the dependency relationship of the business modules corresponding to the nodes included in the first sub-path is formed by a second dependency function, the second sub-path including the second node, and the dependency relationship of the business modules corresponding to the nodes included in the second sub-path is generated by the second dependency function;

[0149] The adding module 603 is configured to add the service modules corresponding to the nodes included in the first sub-path to the first packaging queue, and add the service modules corresponding to the nodes included in the second sub-path to the second packaging queue.

[0150] Optionally, the application processing device further includes:

[0151] A first receiving module is configured to receive a first request, where the first request is used to request the first service module;

[0152] The first sending module is configured to send the first packaged file.

[0153] Optionally, the application processing device further includes:

[0154] A second receiving module is configured to receive a second request, where the second request is used to request the second package file;

[0155] The second sending module is configured to send the second package file.

[0156] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0157] Figure 7 FIG. 1 is a block diagram of an application program running device according to an exemplary embodiment. Figure 7 , the application running device may include:

[0158] The third receiving module 701 is configured to receive a first input for a first application, where the first input is used to indicate loading information corresponding to a first business module of the first application;

[0159] A third sending module 702 is configured to send a first request, where the first request is used to request the first service module;

[0160] The fourth receiving module 703 is configured to receive a first packaged file, where the first packaged file is obtained by packaging the code of the service module in the first packaged queue, where the first packaged queue includes the first service module;

[0161] The loading module 704 is configured to load information corresponding to the first business module according to the first packaging file.

[0162] Optionally, the application program running device further includes:

[0163] a detection module configured to detect whether a second business module is stored when the code of the first business module includes a first dependency function, the second business module being a business module that the first business module depends on through the first dependency function;

[0164] a fourth sending module, configured to send a second request when the second business module is not stored, wherein the second request is used to request a second package file corresponding to the second business module;

[0165] a fifth receiving module, configured to receive the second package file;

[0166] The loading module is configured to load information corresponding to the first business module and information corresponding to the second business module according to the first packaging file and the second packaging file.

[0167] Optionally, the application program running device further includes:

[0168] The output module is configured to output prompt information when the second package file is not received, wherein the prompt information is used to prompt that the first application program runs abnormally.

[0169] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0170] Figure 8 FIG. 1 is a block diagram of a communication device according to an exemplary embodiment. Figure 8 As shown, the communication device includes: a processor 801 , a memory 802 , a user interface 803 , a bus interface 804 and a transceiver 805 .

[0171] exist Figure 8 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 801 and various circuits of memory represented by memory 802 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface 804 provides an interface. For different user devices, the user interface 803 may also be an interface that can be connected to external or internal devices, and the connected devices include but are not limited to keypads, displays, speakers, microphones, joysticks, etc. The processor 801 is responsible for managing the bus architecture and general processing, and the memory 802 may store data used by the processor 801 when performing operations.

[0172] 1. The communication device is the aforementioned server.

[0173] The processor 801 is used to read the program in the memory 802 and execute the following process:

[0174] Determine N business modules corresponding to the source code of the first application, where N is an integer greater than 1;

[0175] In the case where there are K business modules whose codes include a first dependency function among the N business modules, determining a second business module on which the first business module depends through the first dependency function, where the first business module is any business module among the K business modules, and K is a positive integer less than or equal to N;

[0176] Adding the first service module to a first packaging queue, and adding the second service module to a second packaging queue;

[0177] Generate M packaged files corresponding to the first application, the M packaged files include at least a first packaged file and a second packaged file, the first packaged file is obtained by packaging the code of the business module in the first packaged queue, and the second packaged file is obtained by packaging the code of the business module in the second packaged queue.

[0178] Optionally, the processor 801 is configured to read a program in the memory 802 and perform the following process:

[0179] In a case where the code of the first business module further includes a second dependent function, determining a third business module on which the first business module depends through the second dependent function;

[0180] The first service module and the third service module are added to a first packaging queue, and the second service module is added to a second packaging queue.

[0181] Optionally, the processor 801 is configured to read a program in the memory 802 and perform the following process:

[0182] According to the N business modules, an abstract syntax tree AST including P paths is generated, wherein the P paths include N nodes, the N nodes correspond to the N business modules one by one, the business modules corresponding to two adjacent nodes of each path in the P paths have a dependency relationship, and the business modules corresponding to the nodes included in different paths do not have a dependency relationship, and P is a positive integer;

[0183] Identify a first path among the P paths, where the first path includes at least a first node and a second node, where the first node corresponds to the first service module, and the second node corresponds to the second service module;

[0184] The first path is updated to a first sub-path set, where the first sub-path set includes at least a first sub-path and a second sub-path, the first sub-path includes the first node, and the dependency relationship of the business modules corresponding to the nodes included in the first sub-path is formed by a second dependency function, the second sub-path includes the second node, and the dependency relationship of the business modules corresponding to the nodes included in the second sub-path is generated by the second dependency function;

[0185] The service modules corresponding to the nodes included in the first sub-path are added to the first packaging queue, and the service modules corresponding to the nodes included in the second sub-path are added to the second packaging queue.

[0186] Optionally, the processor 801 is configured to read a program in the memory 802 and perform the following process:

[0187] Receiving a first request through the transceiver 805, where the first request is used to request the first service module;

[0188] The first packaged file is sent via the transceiver 805 .

[0189] Optionally, the processor 801 is configured to read a program in the memory 802 and perform the following process:

[0190] Receiving, by the transceiver 805, a second request for requesting the second package file;

[0191] The second package file is sent through the transceiver 805 .

[0192] 2. The communication equipment is the aforementioned electronic equipment.

[0193] The processor 801 is used to read the program in the memory 802 and execute the following process:

[0194] Receiving, through the user interface 803, a first input for a first application, the first input being used to indicate loading information corresponding to a first service module of the first application;

[0195] Sending a first request through the transceiver 805, where the first request is used to request the first service module;

[0196] Receiving a first packaged file through the transceiver 805, where the first packaged file is obtained by packaging the code of the service module in the first packaged queue, where the first packaged queue includes the first service module;

[0197] According to the first packaging file, information corresponding to the first business module is loaded.

[0198] Optionally, the processor 801 is configured to read a program in the memory 802 and perform the following process:

[0199] In a case where the code of the first business module includes a first dependency function, detecting whether a second business module is stored, where the second business module is a business module that the first business module depends on through the first dependency function;

[0200] In the case where the second service module is not stored, sending a second request through the transceiver 805, where the second request is used to request a second package file corresponding to the second service module;

[0201] Receiving the second package file through the transceiver 805;

[0202] Information corresponding to the first service module and information corresponding to the second service module are loaded according to the first packaging file and the second packaging file.

[0203] Optionally, the processor 801 is configured to read a program in the memory 802 and perform the following process:

[0204] In the case where the second package file is not received, a prompt message is output, where the prompt message is used to prompt that the first application program runs abnormally.

[0205] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 801 of the network device to complete the above method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0206] In an exemplary embodiment, a computer program product is also provided, comprising: executable instructions, which enable the computer to execute the above method when the executable instructions are executed on the computer.

[0207] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0208] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for processing an application program, It is characterized in that The method comprises: Determine N business modules corresponding to the source code of the first application, where N is an integer greater than 1; In the case where there are K business modules whose codes include a first dependency function among the N business modules, determining a second business module on which the first business module depends through the first dependency function, the first business module being any business module among the K business modules, K being a positive integer less than or equal to N, and the first dependency function including an asynchronous callback function; Adding the first service module to a first packaging queue, and adding the second service module to a second packaging queue; Generate M packaged files corresponding to the first application, the M packaged files at least including a first packaged file and a second packaged file, the first packaged file is obtained by packaging the code of the service module in the first packaged queue, and the second packaged file is obtained by packaging the code of the service module in the second packaged queue; Before the step of adding the first service module to the first packaging queue and the step of adding the second service module to the second packaging queue, the method further includes: In a case where the code of the first business module further includes a second dependency function, determining a third business module on which the first business module depends through the second dependency function, wherein the second dependency function includes at least one of a callback Require function and an input import function; The step of adding the first service module to the first packaging queue and the step of adding the second service module to the second packaging queue includes: The first service module and the third service module are added to a first packaging queue, and the second service module is added to a second packaging queue.

2. The method according to claim 1, It is characterized in that After the step of determining the N business modules corresponding to the source code of the first application program, and before the step of adding the first business module to the first packaging queue and the second business module to the second packaging queue, the method further includes: According to the N business modules, an abstract syntax tree AST including P paths is generated, wherein the P paths include N nodes, the N nodes correspond to the N business modules one by one, the business modules corresponding to two adjacent nodes of each path in the P paths have a dependency relationship, and the business modules corresponding to the nodes included in different paths do not have a dependency relationship, and P is a positive integer; After the step of generating an abstract syntax tree AST including P paths, and before the step of adding the first service module to the first packaging queue and the second service module to the second packaging queue, the method further includes: Identify a first path among the P paths, where the first path includes at least a first node and a second node, where the first node corresponds to the first service module, and the second node corresponds to the second service module; The first path is updated to a first sub-path set, where the first sub-path set includes at least a first sub-path and a second sub-path, the first sub-path includes the first node, and the dependency relationship of the business modules corresponding to the nodes included in the first sub-path is formed by a second dependency function, the second sub-path includes the second node, and the dependency relationship of the business modules corresponding to the nodes included in the second sub-path is generated by the second dependency function; The step of adding the first service module to the first packaging queue and the step of adding the second service module to the second packaging queue includes: The service modules corresponding to the nodes included in the first sub-path are added to the first packaging queue, and the service modules corresponding to the nodes included in the second sub-path are added to the second packaging queue.

3. The method according to claim 1, It is characterized in that After the step of generating M package files corresponding to the first application, the method further includes: receiving a first request, where the first request is used to request the first service module; The first packaged file is sent.

4. The method according to claim 3, It is characterized in that After the step of sending the first package file, the method further includes: receiving a second request, where the second request is used to request the second package file; The second package file is sent.

5. A method for running an application program, It is characterized in that The method comprises: Receiving a first input for a first application, where the first input is used to indicate loading information corresponding to a first business module of the first application; Sending a first request, where the first request is used to request the first service module; receiving a first packaged file, where the first packaged file is obtained by packaging codes of a service module in a first packaged queue, where the first packaged queue includes the first service module; According to the first packaging file, loading information corresponding to the first business module; After the step of receiving the first package file and before the step of loading the information corresponding to the first business module, the method further includes: In a case where the code of the first business module includes a first dependency function, detecting whether a second business module is stored, the second business module being a business module that the first business module depends on through the first dependency function, and the first dependency function including an asynchronous callback function; If the second business module is not stored, sending a second request, where the second request is used to request a second packaged file corresponding to the second business module, where the second packaged file is obtained by packaging codes of the business modules in a second packaged queue, where the second packaged queue includes the second business module; receiving the second package file; The step of loading information corresponding to the first business module according to the first packaging file includes: Loading information corresponding to the first service module and information corresponding to the second service module according to the first packaged file and the second packaged file; Among them, when the code of the first business module includes a second dependent function, the first packaging queue also includes a third business module, and the third business module is a business module that the first business module depends on through the second dependent function, and the second dependent function includes at least one of a callback Require function and an input import function.

6. The method according to claim 5, It is characterized in that After the step of sending the second request, the method further includes: In the case where the second package file is not received, a prompt message is output, where the prompt message is used to prompt that the first application program runs abnormally.

7. An application processing device, It is characterized in that The application processing device comprises: A first determining module is configured to determine N business modules corresponding to the source code of the first application program, where N is an integer greater than 1; A second determination module is configured to determine, when there are K business modules whose codes include a first dependency function among the N business modules, a second business module on which the first business module depends through the first dependency function, wherein the first business module is any business module among the K business modules, K is a positive integer less than or equal to N, and the first dependency function includes an asynchronous callback function; An adding module, configured to add the first service module to a first packaging queue, and add the second service module to a second packaging queue; A first generating module is configured to generate M packaged files corresponding to the first application, the M packaged files at least including a first packaged file and a second packaged file, the first packaged file is obtained by packaging the code of the service module in the first packaged queue, and the second packaged file is obtained by packaging the code of the service module in the second packaged queue; The application processing device further includes: A third determining module is configured to determine, when the code of the first business module further includes a second dependency function, a third business module on which the first business module depends through the second dependency function, wherein the second dependency function includes at least one of a callback Require function and an input import function; The adding module is configured to add the first service module and the third service module to the first packaging queue, and add the second service module to the second packaging queue.

8. The application processing device according to claim 7, It is characterized in that The application processing device further includes: A second generation module is configured to generate an abstract syntax tree AST including P paths according to the N business modules, wherein the P paths include N nodes, the N nodes correspond to the N business modules one by one, the business modules corresponding to two adjacent nodes of each path in the P paths have a dependency relationship, and the business modules corresponding to the nodes included in different paths do not have a dependency relationship, and P is a positive integer; an identification module configured to identify a first path among the P paths, the first path comprising at least a first node and a second node, the first node corresponding to the first service module, and the second node corresponding to the second service module; an updating module, configured to update the first path to a first sub-path set, the first sub-path set including at least a first sub-path and a second sub-path, the first sub-path including the first node, and the dependency relationship of the business modules corresponding to the nodes included in the first sub-path is formed by a second dependency function, the second sub-path including the second node, and the dependency relationship of the business modules corresponding to the nodes included in the second sub-path is generated by the second dependency function; The adding module is configured to add the service modules corresponding to the nodes included in the first sub-path to the first packaging queue, and add the service modules corresponding to the nodes included in the second sub-path to the second packaging queue.

9. The application processing device according to claim 7, It is characterized in that The application processing device further includes: A first receiving module is configured to receive a first request, where the first request is used to request the first service module; The first sending module is configured to send the first packaged file.

10. The application processing device according to claim 9, It is characterized in that The application processing device further includes: A second receiving module is configured to receive a second request, where the second request is used to request the second package file; The second sending module is configured to send the second package file.

11. An application program running device, It is characterized in that The application program running device comprises: A third receiving module is configured to receive a first input for a first application, where the first input is used to indicate loading information corresponding to a first business module of the first application; A third sending module is configured to send a first request, where the first request is used to request the first service module; A fourth receiving module is configured to receive a first packaged file, where the first packaged file is obtained by packaging the code of the service module in the first packaged queue, where the first packaged queue includes the first service module; A loading module, configured to load information corresponding to the first business module according to the first packaging file; The application program running device also includes: a detection module configured to detect whether a second business module is stored when the code of the first business module includes a first dependency function, the second business module being a business module that the first business module depends on through the first dependency function, and the first dependency function including an asynchronous callback function; a fourth sending module, configured to send a second request when the second business module is not stored, the second request being used to request a second packaged file corresponding to the second business module, the second packaged file being obtained by packaging codes of the business modules in a second packaged queue, the second packaged queue including the second business module; a fifth receiving module, configured to receive the second package file; The loading module is configured to load information corresponding to the first service module and information corresponding to the second service module according to the first package file and the second package file; Among them, when the code of the first business module includes a second dependent function, the first packaging queue also includes a third business module, and the third business module is a business module that the first business module depends on through the second dependent function, and the second dependent function includes at least one of a callback Require function and an input import function.

12. The application program execution device according to claim 11, It is characterized in that The application program running device also includes: The output module is configured to output prompt information when the second package file is not received, wherein the prompt information is used to prompt that the first application program runs abnormally.

13. A communication device, It is characterized in that include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the application processing method according to any one of claims 1 to 4; or to implement the application running method according to claim 5 or 6.

14. A storage medium, It is characterized in that When the instructions in the storage medium are executed by a processor, the application processing method according to any one of claims 1 to 4 can be executed; or, the application running method according to claim 5 or 6 can be executed.

15. A computer program product, It is characterized in that include: An executable instruction, when the executable instruction is executed on a computer, enables the computer program product to execute the application processing method according to any one of claims 1 to 4; Or, execute the application running method as described in claim 5 or 6.