Running method of application program and electronic equipment
By running multiple threads in parallel to load the required files of the application, the problem of slow application startup speed under Windows system is solved, and faster startup speed is achieved.
Patent Information
- Application Number
- CN202411214985.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-02-14
AI Technical Summary
When an application is started on Windows system, a large number of files need to be loaded, resulting in a slow startup speed.
By receiving the application startup instructions, determine the list of files to be loaded, and determine the number of threads based on the file list. Each thread corresponds to a set of files to be loaded, and the files are loaded by running multiple threads in parallel.
It effectively shortens the time to load files to be loaded and improves the startup speed of the application.
Smart Images

Figure CN119440653A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of application program operation, and in particular to an application program operation method and an electronic device. Background Art
[0002] When starting an application under Windows system, it is usually necessary to load a large number of files such as loading files. Usually, when starting an application, after the operating system creates a process space, it first loads the EXE file, then analyzes the EXE file to determine the loading file that needs to be loaded. Since there is a dependency between loading files, when loading the current file, the next loading file that needs to be loaded can be determined based on the current loading file.
[0003] Since all loading files need to be loaded one by one, the application startup speed is slower. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method for running an application and an electronic device.
[0005] In a first aspect, an embodiment of the present application provides a method for running an application, including:
[0006] receiving a start instruction for a first application;
[0007] In response to the startup instruction, determine a file list that needs to be loaded to start the first application, the file list includes at least two groups of files to be loaded, each group of files to be loaded includes a plurality of files to be loaded that have a dependency relationship;
[0008] Based on the file list, determine the number of threads, each of the threads corresponds to a group of files to be loaded, and each group of files to be loaded is required to be loaded to start the first application;
[0009] The plurality of threads are run in parallel to load each corresponding group of files to be loaded.
[0010] In a possible implementation manner, after starting the first application, the following steps are included:
[0011] receiving a closing instruction for the first application;
[0012] determining properties of each of the loaded files;
[0013] The loading file with the control attribute of the first category is released, and the loading file with the control attribute of the second category is not released, wherein the loading file belonging to the first category corresponds to one application, and the loading file belonging to the second category corresponds to multiple applications.
[0014] In a possible implementation manner, determining the attribute of each of the loaded files includes:
[0015] Identify identification information of each of the loaded files;
[0016] It is determined according to the identification information whether the loaded file belongs to the first category or the second category.
[0017] In a possible implementation manner, the control attribute of releasing the loaded file of the first category and the control attribute of not releasing the loaded file of the second category include:
[0018] Determine whether there is a second application associated with the first application among other applications running in the electronic device;
[0019] If it exists, the load file with the control attribute of the first category is released, and the load file with the control attribute of the second category is not released;
[0020] If not present, controls the release of all loaded files.
[0021] In a possible implementation manner, determining whether there is a second application associated with the first application among other applications running in the electronic device includes:
[0022] For each other application program running in the electronic device, determining whether there is a loading file that is the same as the loading file among the loading files corresponding to the other application program;
[0023] If so, determine that the other application is the second application.
[0024] In a possible implementation, there are multiple file lists, and determining the number of threads based on the file lists includes:
[0025] Acquire status information of the electronic device to which the first application belongs, the status information including at least one of power supply mode, central processing unit operation information and memory information;
[0026] Based on the status information, determining a target file list from a plurality of file lists;
[0027] The number of threads is determined according to the target file list.
[0028] In a possible implementation, the running of the plurality of threads in parallel includes:
[0029] Injecting a target file, running a target file can create a thread, and the target file includes code or a loading file;
[0030] If there are multiple target files, the target files are executed simultaneously to execute multiple threads in parallel.
[0031] In a possible implementation manner, the process of starting the first application includes:
[0032] The number of threads corresponding to the first application, the loading file, and the corresponding relationship between each thread and the loading file are recorded and saved.
[0033] In a possible implementation manner, the operating method further includes:
[0034] After the first application is upgraded, the file list is updated.
[0035] In a second aspect, an embodiment of the present application further provides an electronic device, including:
[0036] A first receiving module configured to receive a start instruction for a first application program;
[0037] A first determining module is configured to respond to the startup instruction and determine a file list that needs to be loaded to start the first application, wherein the file list includes at least two groups of files to be loaded, and each group of files to be loaded includes a plurality of files to be loaded that have a dependency relationship;
[0038] A second determination module is configured to determine the number of threads based on the file list, each of the threads corresponds to a group of files to be loaded, and each group of files to be loaded is required to be loaded to start the first application;
[0039] The loading module is configured to run the plurality of threads in parallel to load each corresponding group of files to be loaded.
[0040] In an embodiment of the present application, after receiving a startup instruction for a first application, a file list that needs to be loaded to start the first application is determined, and the number of threads is determined based on the file list, wherein the file list includes at least two groups of files to be loaded, that is, the number of threads is at least 2. Thereafter, multiple threads are run in parallel to load each corresponding group of files to be loaded, thereby effectively shortening the loading time of the files to be loaded and improving the startup speed of the application. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the present application or 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 some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0042] Figure 1 A flowchart showing a method for running an application program provided by the present application is shown;
[0043] Figure 2 A flowchart showing a method for running another application provided by the present application is shown;
[0044] Figure 3 A schematic diagram of determining the number of threads based on a file list provided by the present application is shown;
[0045] Figure 4 A schematic diagram of the structure of an electronic device provided by the present application is shown;
[0046] Figure 5 A structural schematic diagram of another electronic device provided by the present application is shown. DETAILED DESCRIPTION
[0047] Various aspects and features of the present application are described herein with reference to the accompanying drawings.
[0048] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.
[0049] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0050] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.
[0051] It should also be understood that, although the present application has been described with reference to some specific examples, those skilled in the art will be able to implement many other equivalent forms of the present application that have the features described in the claims and are therefore within the scope of protection defined thereby.
[0052] The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
[0053] Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments applied for are merely examples of the present application, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that obscure the present application. Therefore, the specific structural and functional details applied for herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present application in a variety of ways with substantially any suitable detailed structure.
[0054] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present application.
[0055] To facilitate understanding of the present application, a method for operating an application provided by the present application is first introduced in detail. Figure 1 A flowchart of a method for running an application provided in an embodiment of the present application is shown, wherein specific steps include S101-S104.
[0056] S101, receiving a start instruction for a first application.
[0057] In a specific implementation, the startup operations performed by the user through interactive devices such as a mouse, keyboard, touch screen, etc. are collected, the corresponding first application is determined based on the startup operations, and a startup instruction for the first application is generated.
[0058] The operating system or central processing unit of the electronic device can receive the start-up instruction for the first application in real time to achieve the purpose of starting the first application.
[0059] S102, responding to the start instruction, determining a file list that needs to be loaded when starting the first application, the file list including at least two groups of files to be loaded, each group of files to be loaded including a plurality of files to be loaded having a dependency relationship.
[0060] After receiving the startup instruction for the first application, respond to the startup instruction and determine the file list that needs to be loaded when starting the first application. Optionally, the file list can be generated in real time, specifically, respond to the startup instruction and predetermine all the files that need to be loaded when starting the first application through a filter driver to generate the file list; in another example, the file list can also be pre-generated for the first application, and the corresponding relationship between the first application and the file list is stored.
[0061] Among them, the file list includes at least two groups of files to be loaded, each group of files to be loaded includes multiple files to be loaded with dependencies, the files to be loaded in the embodiment of the present application include at least dynamic link library files (Dynamic LinkLibrary, DLL), and the files to be loaded may include other types of files required for application startup.
[0062] S103, based on the file list, determine the number of threads, each thread corresponds to a group of files to be loaded, and each group of files to be loaded is required to be loaded when starting the first application.
[0063] After determining the file list that needs to be loaded when starting the first application, the number of threads is determined based on the file list, wherein each thread corresponds to a group of files to be loaded, and it can be seen from the above that the file list includes at least two groups of files to be loaded, based on which the number of threads is at least 2.
[0064] Furthermore, each group of files to be loaded needs to be loaded to start the first application, that is, the first application can be started only after each group of files to be loaded is loaded.
[0065] S104, running multiple threads in parallel to load each corresponding group of files to be loaded.
[0066] After determining the number of threads, multiple threads are run in parallel to load each corresponding group of files to be loaded in a multi-tasking manner, thereby shortening the loading time of the files to be loaded. For example, if the number of threads is 3, three groups of files to be loaded are loaded in parallel, which is shorter than loading the files to be loaded with a single thread, thereby shortening the startup time of the first application, improving the startup speed of the application, and improving the user experience.
[0067] It should be noted that the number of files in each group of files to be loaded can be the same or different. For example, if the number of files to be loaded required to start the first application is 100, and the file list includes two groups of files to be loaded, the number of files to be loaded in each group can be set to 50, or the number of files to be loaded in one group can be set to 40 and the number of files to be loaded in the other group can be set to 60. Preferably, there are no duplicate files to be loaded between each group of files to be loaded, and even if there are duplicate files to be loaded, the same file to be loaded will not be loaded repeatedly.
[0068] The multiple groups of to-be-loaded files corresponding to the multiple threads are loaded into a process environment block (PEB) space corresponding to the first application program in the memory, so as to start and run the first application program.
[0069] In an embodiment of the present application, after receiving a startup instruction for a first application, a file list that needs to be loaded to start the first application is determined, and the number of threads is determined based on the file list, wherein the file list includes at least two groups of files to be loaded, that is, the number of threads is at least 2. Thereafter, multiple threads are run in parallel to load each corresponding group of files to be loaded, thereby effectively shortening the loading time of the files to be loaded and improving the startup speed of the application.
[0070] After launching the first application, Figure 2 A flow chart of another method for running an application is shown, wherein specific steps include S201-S203.
[0071] S201, receiving a closing instruction for a first application.
[0072] S202: Determine the attributes of each loaded file.
[0073] S203, controlling the release of loading files with a first attribute and not controlling the release of loading files with a second attribute, wherein the loading files belonging to the first category correspond to one application and the loading files belonging to the second category correspond to multiple applications.
[0074] In a specific implementation, after the first application is started and run, the closing operation performed by the user on the first application through the interactive device is collected in real time, and a closing instruction for the first application is generated based on the closing operation.
[0075] After receiving the closing instruction for the first application, the loading files loaded by the first application are further determined, and the attributes of each loading file are determined. Specifically, all loading files are determined based on the PEB space corresponding to the first application.
[0076] As an example, when determining the attributes of each loaded file, identification information of each loaded file is identified, and the identification information may include a number, and the number represents the number of applications corresponding to the loaded file; the identification information may also include the name of the corresponding application, etc. On this basis, it is determined whether the loaded file belongs to the first category or the second category according to the identification information. The loaded file belonging to the first category corresponds to one application, and the loaded file belonging to the second category corresponds to multiple applications.
[0077] After determining the attributes of each loading file, the loading files with the first category of control attributes are released in response to the closing instruction for the first application, and the loading files with the second category of control attributes are not released to avoid affecting the normal operation of the application corresponding to the loading file.
[0078] In a specific implementation, the application corresponding to the loading file with the attribute of the second category may be running or not running. In order to avoid the loading file occupying space and affecting the normal operation of the application corresponding to the loading file, when the loading file with the control attribute of the first category is released and the loading file with the control attribute of the second category is not released, the embodiment of the present application first determines whether there is a second application associated with the first application among other running applications in the electronic device.
[0079] Optionally, through the central processing unit or operating system of the electronic device, other applications currently running except the first application are queried, and for each other application, it is determined whether the other application has an association relationship with the first application, and the other applications that have an association relationship with the first application are determined as second applications.
[0080] As an example, when determining whether the other application has an association relationship with the first application, for each other application running in the electronic device, it is determined whether there is a loading file that is identical to the loading file in the loading file corresponding to the other application. If so, it is determined that the other application has an association relationship with the first application, that is, the other application is the second application.
[0081] Furthermore, if there is a second application among other applications running in the electronic device, the control attribute is that the loaded files of the first category are released, and the control attribute is that the loaded files of the second category are not released, thereby achieving the goal of simultaneously avoiding the first category of loaded files occupying space and avoiding affecting the normal operation of the second application corresponding to the second category of loaded files; if there is no second application among other applications running in the electronic device, all loaded files are controlled to be released, and the space occupied by the loaded files of the first application is released.
[0082] It is worth noting that, in the embodiment of the present application, when controlling the release of the loaded file, a delay time, such as 2s, can be set for some loaded files, that is, after receiving the close instruction and within the extended time, the loaded file will not be released. Among them, some loaded files can be pre-set by the user, or can be loaded files belonging to the second category, etc.
[0083] Moreover, the control unit is notified through the file system driver to re-reference the partially loaded file within the extended time to increase the reference count of the partially loaded file, so that the partially loaded file remains resident in the memory and is not released. Therefore, when the application corresponding to the partially loaded file is started, it can be directly loaded from the memory, which improves the startup speed of the application to a certain extent.
[0084] In the embodiment of the present application, there are multiple file lists. For example, the first application corresponds to three file lists, namely file list A, file list B and file list C. File list A includes two groups of files to be loaded, file list B includes three groups of files to be loaded, and file list C includes four groups of files to be loaded. Of course, the number of groups of files to be loaded is different, and the number of files to be loaded included in each group of files to be loaded is also different.
[0085] From above, Figure 3 A flow chart of determining the number of threads based on a file list is shown, wherein specific steps include S301-S303.
[0086] S301, obtaining status information of an electronic device to which a first application belongs, where the status information includes at least one of a power supply mode, central processing unit operation information, and memory information.
[0087] S302: Determine a target file list from a plurality of file lists based on the status information.
[0088] S303, determining the number of threads according to the target file list.
[0089] After determining that the first application corresponds to multiple file lists, further obtain the status information of the electronic device to which the first application belongs, the status information at least including at least one of the power supply mode, the central processing unit operation information and the memory information. Among them, the power supply mode includes the power supply mode and the battery mode, the central processing unit operation information includes the number of currently running processes and the category of each process, etc., and the memory information includes the current remaining memory space size.
[0090] After obtaining the status information, the target file list is determined from the multiple file lists based on the status information. Since the number of file groups to be loaded in each file list is different, optionally, if the power supply mode of the electronic device is the battery mode, the file list with fewer file groups to be loaded is determined to be the target file list; if the number of processes currently in operation in the electronic device is large (such as the number of processes currently in operation is greater than 10) or the category of the process represents that the process has high power consumption (such as the category of the process is a game class), the file list with fewer file groups to be loaded is determined to be the target file list; if the current remaining memory space in the memory of the electronic device is small, such as the current remaining memory space accounts for less than 10% of the total memory space, the file list with fewer file groups to be loaded is determined to be the target file list. On the contrary, if the power supply mode of the electronic device is the power supply mode, or the number of processes currently in operation in the electronic device is small or the category of the process represents that the process has low power consumption, or the current remaining memory space in the memory of the electronic device is large, the file list with more file groups to be loaded is determined to be the target file list. Of course, weights can be set for the power supply mode, the CPU operation information, and the memory information, respectively, to select the target file list in combination with the weights.
[0091] After the target file list is determined, the number of threads is determined according to the target file list, that is, the number of groups of files to be loaded in the target file list is the number of threads.
[0092] Of course, there is an application that only has one file list. This application can directly determine the number of threads based on its corresponding file list without executing Figure 3 Steps in .
[0093] In a specific implementation, when multiple threads are run in parallel, the number of injected target files is determined according to the number of threads. For example, when the number of threads is 2, one target file is injected. When the first application is started, it will construct a thread to perform the loading task.
[0094] The target file includes code or loading files. After injecting a target file and running the target file, a corresponding thread can be created to perform the loading task. In one example, if there are multiple target files, multiple target files can be run at the same time to run multiple threads in parallel, thereby speeding up the loading speed of the files to be loaded.
[0095] In another example, during the process of starting a first application, the number of threads corresponding to the first application, the loaded files, and the correspondence between each thread and the loaded files are recorded and saved. Afterwards, the file list can be adjusted according to the number of threads started this time, the loaded files, the correspondence between each thread and the loaded files, and the startup time, so that the file list better meets the startup requirements, such as shortening the startup time.
[0096] It is worth noting that after the application is upgraded, the files to be loaded at startup may change. Based on this, after the first application is upgraded, the file list is updated based on the files to be loaded when the new version of the first application is started to ensure that the first application starts normally.
[0097] As an example, the files to be loaded of the application include files to be loaded related to display. The application can configure the add-in items and the display properties of the application, such as whether to load certain function items, and set the display properties of the application such as the program background image and the display language pack of the application. According to the configuration information of the application, the corresponding files to be loaded may be different, so that the grouping of the files to be loaded in the file list may be different.
[0098] User-related information may also cause the corresponding files to be loaded to be different. For example, a user account with high permissions can display more function options, and a low-privilege account may limit the use of application functions. The application will only load the available files to be loaded so that the application can display some functions.
[0099] The number and grouping of the files to be loaded in the file list are determined according to at least one of the configuration of the application and the user information, so that the loading speed of the application is improved.
[0100] Based on the same inventive concept, the second aspect of the present application also provides an electronic device corresponding to a method for running an application. Since the principle of solving the problem by the electronic device in the present application is similar to the above-mentioned method for running the application, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0101] Figure 4 A schematic diagram of an electronic device provided in an embodiment of the present application is shown, specifically comprising:
[0102] A first receiving module 401, configured to receive a start instruction for a first application;
[0103] A first determining module 402 is configured to determine, in response to the startup instruction, a file list required to be loaded for starting the first application, the file list comprising at least two groups of files to be loaded, each group of files to be loaded comprising a plurality of files to be loaded having a dependency relationship;
[0104] A second determination module 403 is configured to determine the number of threads based on the file list, each of the threads corresponding to a group of files to be loaded, each of the groups of files to be loaded being required to be loaded for starting the first application;
[0105] The loading module 404 is configured to run the plurality of threads in parallel to load each corresponding group of files to be loaded.
[0106] In yet another embodiment, the electronic device further comprises:
[0107] A second receiving module 405, configured to receive a closing instruction for the first application;
[0108] A third determination module 406, configured to determine the attribute of each of the loaded files;
[0109] The release module 407 is configured to control the release of loading files with a first attribute and not to control the release of loading files with a second attribute, wherein the loading files belonging to the first category correspond to one application and the loading files belonging to the second category correspond to multiple applications.
[0110] In yet another embodiment, the third determining module 406 is specifically configured as follows:
[0111] Identify identification information of each of the loaded files;
[0112] It is determined according to the identification information whether the loaded file belongs to the first category or the second category.
[0113] In yet another embodiment, the release module 407 is specifically configured as follows:
[0114] Determine whether there is a second application associated with the first application among other applications running in the electronic device;
[0115] If it exists, the load file with the control attribute of the first category is released, and the load file with the control attribute of the second category is not released;
[0116] If not present, controls the release of all loaded files.
[0117] In yet another embodiment, the release module 407 is further configured to:
[0118] For each other application program running in the electronic device, determining whether there is a loading file that is the same as the loading file among the loading files corresponding to the other application program;
[0119] If so, determine that the other application is the second application.
[0120] In yet another embodiment, there are multiple file lists, and the second determination module 403 is specifically configured as follows:
[0121] Acquire status information of the electronic device to which the first application belongs, the status information including at least one of power supply mode, central processing unit operation information and memory information;
[0122] Based on the status information, determining a target file list from a plurality of file lists;
[0123] The number of threads is determined according to the target file list.
[0124] In yet another embodiment, the loading module 404 is specifically configured as follows:
[0125] Injecting a target file, running a target file can create a thread, and the target file includes code or a loading file;
[0126] If there are multiple target files, the target files are executed simultaneously to execute multiple threads in parallel.
[0127] In yet another embodiment, the electronic device further includes a recording module 408, which is configured to:
[0128] The number of threads corresponding to the first application, the loading file, and the corresponding relationship between each thread and the loading file are recorded and saved.
[0129] In yet another embodiment, the electronic device further includes an updating module 409, which is configured to:
[0130] After the first application is upgraded, the file list is updated.
[0131] In an embodiment of the present application, after receiving a startup instruction for a first application, a file list that needs to be loaded to start the first application is determined, and the number of threads is determined based on the file list, wherein the file list includes at least two groups of files to be loaded, that is, the number of threads is at least 2. Thereafter, multiple threads are run in parallel to load each corresponding group of files to be loaded, thereby effectively shortening the loading time of the files to be loaded and improving the startup speed of the application.
[0132] The present application also provides an electronic device. The structural diagram of the electronic device can be as follows: Figure 5 As shown, at least a memory 501 and a processor 502 are included, the memory 501 stores a computer program, and the processor 502 implements the method provided by any embodiment of the present application when executing the computer program on the memory 501. Exemplarily, the steps of the electronic device computer program are as follows S11-S14:
[0133] S11, receiving a start instruction for a first application;
[0134] S12, in response to the startup instruction, determining a file list that needs to be loaded to start the first application, the file list comprising at least two groups of files to be loaded, each group of files to be loaded comprising a plurality of files to be loaded having a dependency relationship;
[0135] S13, based on the file list, determining the number of threads, each of the threads corresponding to a group of files to be loaded, each group of files to be loaded is required to be loaded to start the first application;
[0136] S14, running the plurality of threads in parallel to load each corresponding group of files to be loaded.
[0137] In an embodiment of the present application, after receiving a startup instruction for a first application, a file list that needs to be loaded to start the first application is determined, and the number of threads is determined based on the file list, wherein the file list includes at least two groups of files to be loaded, that is, the number of threads is at least 2. Thereafter, multiple threads are run in parallel to load each corresponding group of files to be loaded, thereby effectively shortening the loading time of the files to be loaded and improving the startup speed of the application.
[0138] An embodiment of the present application provides a storage medium, which is a computer-readable medium and stores a computer program. When the computer program is executed by a processor, the method provided in any embodiment of the present application is implemented, including the following steps S21-S24:
[0139] S21, receiving a start instruction for a first application;
[0140] S22, in response to the startup instruction, determining a file list that needs to be loaded to start the first application, the file list comprising at least two groups of files to be loaded, each group of files to be loaded comprising a plurality of files to be loaded having a dependency relationship;
[0141] S23, determining the number of threads based on the file list, each of the threads corresponding to a group of files to be loaded, each group of files to be loaded being required to be loaded for starting the first application;
[0142] S24, running the plurality of threads in parallel to load each corresponding group of files to be loaded.
[0143] In an embodiment of the present application, after receiving a startup instruction for a first application, a file list that needs to be loaded to start the first application is determined, and the number of threads is determined based on the file list, wherein the file list includes at least two groups of files to be loaded, that is, the number of threads is at least 2. Thereafter, multiple threads are run in parallel to load each corresponding group of files to be loaded, thereby effectively shortening the loading time of the files to be loaded and improving the startup speed of the application.
[0144] Optionally, in this embodiment, the above-mentioned storage medium may include, but is not limited to, various media that can store program codes, such as a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk. Optionally, in this embodiment, the processor executes the method steps recorded in the above-mentioned embodiment according to the program code stored in the storage medium. Optionally, the specific examples in this embodiment can refer to the examples described in the above-mentioned embodiment and the optional implementation mode, and this embodiment is not repeated here. Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present application can be implemented with a general computing device, which can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. Optionally, they can be implemented with executable program codes of computing devices, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from here, or they can be made into individual integrated circuit modules respectively, or multiple modules or steps in them can be made into a single integrated circuit module to implement. In this way, the present application is not limited to any specific combination of hardware and software.
[0145] In addition, although exemplary embodiments have been described herein, the scope includes any and all embodiments based on the present application with equivalent elements, modifications, omissions, combinations (e.g., various embodiments intersecting schemes), adaptations or changes. The elements in the claims will be interpreted broadly based on the language adopted in the claims, and are not limited to the examples described in this specification or during the implementation of the application, and the examples will be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered as examples only, and the true scope and spirit are indicated by the following claims and the full scope of their equivalents.
[0146] The above description is intended to be illustrative rather than restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. For example, those of ordinary skill in the art can use other embodiments when reading the above description. In addition, in the above-mentioned specific embodiments, various features can be grouped together to simplify the application. This should not be interpreted as an intention that a disclosed feature that does not require protection is necessary for any claim. On the contrary, the subject matter of the present application may be less than all the features of a specific disclosed embodiment. Thus, the following claims are incorporated into the specific embodiments as examples or embodiments, wherein each claim is independently used as a separate embodiment, and it is considered that these embodiments can be combined with each other in various combinations or arrangements. The scope of the present application should be determined with reference to the attached claims and the full scope of equivalent forms granted by these claims.
[0147] Multiple embodiments of the present application are described in detail above, but the present application is not limited to these specific embodiments. Those skilled in the art can make various variations and modifications to the embodiments based on the concept of the present application, and these variations and modifications should all fall within the scope of protection required by the present application.
Claims
1. A method for running an application, comprising: receiving a start instruction for a first application; In response to the startup instruction, determine a file list that needs to be loaded to start the first application, the file list includes at least two groups of files to be loaded, each group of files to be loaded includes a plurality of files to be loaded that have a dependency relationship; Based on the file list, determine the number of threads, each of the threads corresponds to a group of files to be loaded, and each group of files to be loaded is required to be loaded to start the first application; The plurality of threads are run in parallel to load each corresponding group of files to be loaded.
2. The operation method according to claim 1, after starting the first application, comprising: receiving a closing instruction for the first application; determining properties of each of the loaded files; The loading file with the control attribute of the first category is released, and the loading file with the control attribute of the second category is not released, wherein the loading file belonging to the first category corresponds to one application, and the loading file belonging to the second category corresponds to multiple applications.
3. The operation method according to claim 2, wherein determining the attribute of each of the loaded files comprises: Identify identification information of each of the loaded files; It is determined according to the identification information whether the loaded file belongs to the first category or the second category.
4. The operation method according to claim 2, wherein the control attribute is that the load file of the first category is released, and the control attribute is that the load file of the second category is not released, comprising: Determine whether there is a second application associated with the first application among other applications running in the electronic device; If it exists, the load file with the control attribute of the first category is released, and the load file with the control attribute of the second category is not released; If not present, controls the release of all loaded files.
5. The operation method according to claim 4, wherein determining whether there is a second application associated with the first application among other applications running in the electronic device comprises: For each other application program running in the electronic device, determining whether there is a loading file that is the same as the loading file among the loading files corresponding to the other application program; If so, determine that the other application is the second application.
6. The operation method according to claim 1, wherein the file list is multiple, and the determining the number of threads based on the file list comprises: Acquire status information of the electronic device to which the first application belongs, the status information including at least one of power supply mode, central processing unit operation information and memory information; Based on the status information, determining a target file list from a plurality of file lists; The number of threads is determined according to the target file list.
7. The operation method according to claim 6, wherein the parallel operation of the plurality of threads comprises: Injecting a target file, running a target file can create a thread, and the target file includes code or a loading file; If there are multiple target files, the target files are executed simultaneously to execute multiple threads in parallel.
8. The operation method according to any one of claims 1 to 7, in the process of starting the first application, comprises: The number of threads corresponding to the first application, the loading file, and the corresponding relationship between each thread and the loading file are recorded and saved.
9. The operating method according to claim 1, further comprising: After the first application is upgraded, the file list is updated.
10. An electronic device comprising: A first receiving module configured to receive a start instruction for a first application program; A first determining module is configured to respond to the startup instruction and determine a file list that needs to be loaded to start the first application, wherein the file list includes at least two groups of files to be loaded, and each group of files to be loaded includes a plurality of files to be loaded that have a dependency relationship; A second determination module is configured to determine the number of threads based on the file list, each of the threads corresponds to a group of files to be loaded, and each group of files to be loaded is required to be loaded to start the first application; The loading module is configured to run the plurality of threads in parallel to load each corresponding group of files to be loaded.