CN112925587A - Method and apparatus for initializing applications - Google Patents

Method and apparatus for initializing applications Download PDF

Info

Publication number
CN112925587A
CN112925587A CN202110263288.1A CN202110263288A CN112925587A CN 112925587 A CN112925587 A CN 112925587A CN 202110263288 A CN202110263288 A CN 202110263288A CN 112925587 A CN112925587 A CN 112925587A
Authority
CN
China
Prior art keywords
initialization
task
tasks
application
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110263288.1A
Other languages
Chinese (zh)
Inventor
段玉耀
陈小龙
宗雷雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110263288.1A priority Critical patent/CN112925587A/en
Publication of CN112925587A publication Critical patent/CN112925587A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Abstract

The application discloses a method and a device for initializing application, and relates to the technical field of program operation and program architecture. The method comprises the following steps: and responding to the received application compiling instruction, acquiring each initialization task for starting the application, generating a target execution time sequence according to the dependency relationship among the initialization tasks, and executing each initialization task according to the target execution time sequence.

Description

Method and apparatus for initializing applications
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to the field of program operations and program architectures, and in particular, to a method and an apparatus for initializing an application.
Background
When an application program is started, initialization setting needs to be performed, and in the conventional method for initializing the application, each initialization program is executed according to an execution sequence of each initialization program compiled in a main program of the application program to complete initialization setting of the application.
However, the existing method for initializing the application has the problem of low efficiency.
Disclosure of Invention
The present disclosure provides a method, an apparatus, an electronic device, and a computer-readable storage medium for initializing an application.
According to a first aspect, there is provided a method for initializing an application, the method comprising: acquiring each initialization task for starting the application in response to receiving the application compiling instruction; generating a target execution time sequence according to the dependency relationship among the initialization tasks; and executing each initialization task according to the target execution time sequence.
According to a second aspect, there is provided an apparatus for initializing an application, the apparatus comprising: a first acquisition unit configured to acquire, in response to receiving an application compilation instruction, respective initialization tasks for starting an application; the generating unit is configured to generate a target execution time sequence according to the dependency relationship among the initialization tasks; and the execution unit is configured to execute each initialization task according to the target execution sequence.
According to a third aspect, embodiments of the present disclosure provide an electronic device, comprising: one or more processors: a storage device for storing one or more programs which, when executed by one or more processors, cause the one or more processors to implement the method for initializing an application as provided in the first aspect.
According to a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium having a computer program stored thereon, where the program, when executed by a processor, implements the method for initializing an application provided by the first aspect.
According to the method and the device for initializing the application, the received application compiling instruction is responded, each initialization task for starting the application is obtained, the target execution time sequence is generated according to the dependency relationship among the initialization tasks, each initialization task is executed according to the target execution time sequence, and the efficiency of initializing the application can be improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is an exemplary system architecture diagram in which embodiments of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for initializing an application according to the present application;
FIG. 3 is an example of a target execution timing generated according to a method for initializing an application of the present application;
FIG. 4 is a flow diagram of another embodiment of a method for initializing an application according to the present application;
FIG. 5 is an example of another target execution timing generated according to the method for initializing an application of the present application;
FIG. 6 is an example of yet another target execution timing generated in accordance with the method for initializing an application of the present application;
FIG. 7 is an example of yet another target execution timing generated in accordance with a method for initializing an application of the present application;
FIG. 8 is a schematic block diagram illustrating one embodiment of an apparatus for initializing applications in accordance with the present application;
FIG. 9 is a block diagram of an electronic device used to implement the method for initializing an application of an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the method for initializing an application or the apparatus for initializing an application of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various client applications installed thereon, such as a video-type application, a play-type application, an audio-type application, a search-type application, a shopping-type application, a financial-type application, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting receiving server messages, including but not limited to smartphones, tablets, e-book readers, electronic players, laptop portable computers, desktop computers, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, and 103 are hardware, various electronic devices may be used, and when the terminal devices 101, 102, and 103 are software, the electronic devices may be installed in the above-listed electronic devices. It may be implemented as multiple pieces of software or software modules (e.g., multiple software modules to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
When the terminal devices 101, 102, and 103 receive the application compiling instruction, obtain each initialization task for starting the application, generate a target execution time sequence according to a dependency relationship between the initialization tasks, and execute each initialization task according to the target execution time sequence.
It should be noted that the method for initializing the application provided by the embodiment of the present disclosure is generally executed by the terminal device 101, 102, 103, and accordingly, the apparatus for initializing the application is generally disposed in the terminal device 101, 102, 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for initializing an application according to the present disclosure is shown. Method for initializing an application, comprising the steps of:
step 201, in response to receiving an application compiling instruction, acquiring each initialization task for starting an application.
In this embodiment, after an execution subject (for example, the terminal device shown in fig. 1) of the method for initializing an application receives an application compiling instruction in a wired or wireless manner, each initialization task for starting the application may be acquired. The application compiling instruction is an instruction for instructing to compile the application program. The initialization task refers to a preparation task that needs to be completed for running a main program/main project of an application, for example, assigning a running unit/a storage unit to the main program, assigning initial values to parameters of the main program, and the like.
Step 202, generating a target execution time sequence according to the dependency relationship among the initialization tasks.
In this embodiment, the target execution timing may be generated according to the dependency relationship between the respective initialization tasks. The dependency relationship among the initialization tasks includes whether the execution of one initialization task depends on the completion of other initialization tasks. The target execution timing includes the order/time in which the respective initialization tasks are executed.
For example, if each initialization task includes task 301, task 302, task 303, and task 304, the execution of task 301 depends only on the completion of task 302 and task 303, and the execution of task 303 depends only on the completion of task 304, the target execution sequence generated from the dependency relationship between the four initialization tasks may be as shown in fig. 3.
And step 203, executing each initialization task according to the target execution time sequence.
In the present embodiment, the respective initialization tasks may be executed in accordance with the order/timing of execution of the respective initialization tasks indicated by the target execution timing.
The present embodiment may generate the target execution timing based on the received application compiling instruction, that is, the target execution timing of each initialization task is generated in the program compiling stage. The target execution sequence may be encapsulated in the application program or may be stored in a storage space such as a server. When the application program is downloaded to the terminal device and the user starts the application program through the terminal device, the terminal device may execute each initialization task based on a pre-generated target execution timing sequence that has been encapsulated in the application program or obtained through the server, which may further save the application start time and improve the efficiency of initializing the application.
In the method for initializing an application, in response to receiving an application compiling instruction, each initialization task for starting the application is obtained, a target execution time sequence is generated according to a dependency relationship between the initialization tasks, and each initialization task is executed according to the target execution time sequence, so that the efficiency of initializing the application can be improved; and the execution time sequence of compiling the initialization task in the developed application by a developer is avoided, the application development efficiency can be improved, the application development cost can be reduced, and the program code can be simplified.
And the execution time sequence of compiling the initialization task in the developed application by a developer is avoided, so that the architecture or the compiler of each software is different only according to the realized function of each software, the normalization or the standardization of the software architecture or the software compilation is facilitated, and the software updating iteration efficiency and the updating iteration accuracy for different software are improved.
Optionally, generating a target execution time sequence according to a dependency relationship between the initialization tasks includes: in response to determining that execution of the first initialization task is dependent on completion of the second initialization task, determining that the first initialization task executes after the second initialization task.
In this embodiment, if the execution of the first initialization task depends on the completion of the second initialization task, it is determined that the first initialization task is executed after the execution of the second initialization task is completed. The embodiment may determine the timing sequence for executing the initialization tasks based on the dependency relationship between the initialization tasks, may avoid the problem of data processing congestion caused by stacking of each initialization task in the execution list in the application initialization process, and may avoid the problems of reading and executing the initialization tasks according to the identification order or the module architecture order, and reading the task that cannot be executed and wastes cache resources or computing resources caused by the current initialization task when the task that the current read initialization task depends on is not executed.
With further reference to FIG. 4, a flow 400 of another embodiment of a method for initializing an application is shown. The process 400 of the method for initializing an application includes the steps of:
step 401, in response to receiving an application compiling instruction, acquiring each initialization task for starting an application.
Step 402, obtaining execution threads of each initialization task.
In this embodiment, for each initialization task, a thread for the operating system to execute the initialization task, that is, a control flow for the operating system to execute the initialization task, or an operation space allocated by the operating system to execute the initialization task, may be obtained.
In step 403, a target execution time sequence is generated by using the dependency relationship between the initialization tasks and the execution threads of the initialization tasks.
In this embodiment, the target execution timing may be generated by using the dependency relationship between the initialization tasks and the thread in which each initialization task is located.
Specifically, a plurality of initialization tasks existing in the same thread may generate the execution timing of the thread in which the plurality of initialization tasks are located, according to the dependency relationship between the plurality of initialization tasks. The multiple execution timings corresponding to the multiple threads may constitute a target execution timing.
For example, if each initialization task includes a task 501, a task 502, a task 503, a task 511, a task 512, and a task 513, where the task 501, the task 502, and the task 503 exist in the thread 1, the task 503 is executed depending on the task 502, the task 502 is executed depending only on the task 501, the task 511, the task 512, and the task 513 exist in the thread 2, the task 513 is executed depending on the task 512, and the task 512 is executed depending only on the task 511, the target execution timing generated by the threads where the six initialization tasks are located according to the dependency relationship between the six initialization tasks and the target execution timing may be as shown in fig. 5.
And step 404, executing each initialization task according to the target execution time sequence.
In this embodiment, the descriptions of step 401 and step 404 are the same as the descriptions of step 201 and step 203, and are not repeated here.
The method for initializing the application, provided by this embodiment, can perform concurrent processing of multiple threads on each initialization task based on the dependency relationship among the initialization tasks and the execution thread in which each initialization task is located, and can improve the execution efficiency of the initialization tasks to improve the efficiency of initializing the application.
Optionally, obtaining the execution thread of each initialization task includes: for every two initialization tasks in each initialization task, determining that the two initialization tasks are executed in different threads in response to determining that no dependency exists between the two initialization tasks; alternatively, in response to determining that a dependency exists between the two initialization tasks, the two initialization tasks are determined to be executing in the same thread.
In this embodiment, for every two initialization tasks in each initialization task, if it is determined that there is no dependency relationship between the two initialization tasks, the two initialization tasks may be determined as the execution of tasks in different threads. Or, if the two initialization tasks are determined to have a dependency relationship, the two initialization tasks are determined to be executed in the same thread.
In this embodiment, a plurality of initialization applications without dependency relationship are determined to be in different execution threads, and initialization tasks with dependency relationship are determined to be in the same execution thread, so that each initialization task can be executed in sequence according to the dependency relationship between each initialization task, and each initialization task can be concurrently processed by multiple threads, thereby improving the efficiency of processing the initialization tasks.
Optionally, obtaining the execution thread of each initialization task includes: for each initialization task in each initialization task, determining that at least two initialization tasks are executed in different threads in response to determining that at least two initialization tasks on which the initialization tasks depend do not have a dependency relationship; it is determined that the initialization task is executing in any of the different threads.
In this embodiment, for each of the initialization tasks, if it is determined that there is no dependency relationship between the plurality of initialization tasks that the initialization task depends on, the plurality of initialization tasks that depend on may be determined as performing the task in different threads, and the initialization task may be determined as performing the task in any one of the different threads.
For example, if each initialization task includes a task 601, a task 602, and a task 603, where the execution of the task 603 only depends on the completion of the task 601 and the task 602, and there is no dependency relationship between the task 601 and the task 602, the task 601 and the task 602 may be determined to be executed in different threads 3 and 4, respectively, and the task 603 may be determined to be executed in any one of the different threads, and the target execution timing generated according to the dependency relationship between the three initialization tasks and the thread in which each initialization task is located may be as shown in fig. 6.
In this embodiment, the initialization task without dependency is concurrently processed by multiple threads, so that efficiency of processing the initialization task can be improved, and the utilization rate of the threads can be improved by determining that the initialization task is executed in any one of different threads.
Optionally, obtaining the execution thread of each initialization task includes: for every two initialization tasks in each initialization task, determining that the two initialization tasks are executed in different threads in response to determining that a dependency relationship exists between the two initialization tasks; alternatively, in response to determining that no dependency exists between the two initialization tasks, the two initialization tasks are determined to be executing in the same thread.
In this embodiment, for every two initialization tasks in each initialization task, if it is determined that there is a dependency relationship between the two initialization tasks, the two initialization tasks may be determined as the execution of tasks in different threads. Alternatively, if it is determined that there is no dependency relationship between the two initialization tasks, it may be determined that the two initialization tasks are executed in the same thread. Therefore, the flexibility of executing each initialization task by each thread can be improved, the utilization rate of the thread can be improved, and the efficiency of processing the initialization task can be improved.
In some optional implementations of the embodiments described above in connection with fig. 4, performing each initialization task according to the target execution timing includes: and executing each initialization task in the execution thread corresponding to each initialization task according to the target execution time sequence.
In this embodiment, a target execution timing sequence may be adopted, and each initialization task is sequentially executed in the execution thread in which each initialization task is located, and different execution threads may execute the tasks simultaneously/concurrently, so as to improve the efficiency of processing the initialization tasks.
In some optional implementations of the embodiments described above in connection with fig. 2 and 4, obtaining the respective initialization tasks for starting the application includes: acquiring at least one functional component of an application; reading each initialization task required for initializing the functional component.
In this embodiment, the application program may include different functional components, each functional component is configured to implement at least one function of the application, and the acquiring of the initialization task for starting the application specifically includes acquiring at least one functional component of the application and reading an initialization task required for initializing the functional component.
Alternatively, when the initialization task is read by the initialization functional component, the initialization task for initializing the same functional component may be determined as a task executed in the same thread, so that the initialization task for initializing the same functional component is executed in the same thread, and the initialization task for initializing different functional components is executed in different threads.
In some application scenarios, as shown in fig. 7(a), an application may include a plurality of functional components, such as a component a for implementing a chat function, a component B for implementing a shooting function, and a component C for implementing a data processing function, where tasks 701 and 702 are initialization tasks for initializing component a, tasks 703 and 704 are initialization tasks for initializing component B, tasks 705 are initialization tasks for initializing component C, and tasks 710 are tasks in a main program for implementing various functions of the application, that is, tasks 710 are tasks executed after initialization of the application is completed.
First, after the terminal device receives an application compiling instruction for starting the application, the terminal device may obtain a component a, a component B, and a component C of the application, and read each initialization task of the components.
Next, the initialization task for initializing the same functional component is determined to be a task executed on the same thread, that is, the tasks 701 and 702 are determined to be executed on the thread 5, the tasks 703 and 704 are determined to be executed on the thread 6, and the task 705 is determined to be executed on the thread 7.
The dependency relationship between the respective initialization tasks is read from the database or the storage unit that declares the dependency relationship between the tasks, and the independent initialization tasks are executed in advance according to the dependency relationship of the respective initialization tasks, the tasks that depend on the prior initialization tasks are executed after the prior initialization tasks, and the respective initialization tasks are executed in the execution thread in which they are located, so as to generate the target execution timing sequence shown in fig. 7 (b). It should be noted that, after the application initialization is completed, the main program task may be executed in any thread/process of the operating system, and the present disclosure does not make any limitation on the execution mode or the execution thread of the main program task.
With further reference to fig. 8, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an apparatus for initializing an application, which corresponds to the method embodiments shown in fig. 2 and fig. 4, and which may be applied in various electronic devices in particular.
As shown in fig. 8, the apparatus 800 for initializing an application of the present embodiment includes: a first acquisition unit 801, a generation unit 802, and an execution unit 803. The first obtaining unit is configured to obtain each initialization task for starting the application in response to receiving an application compiling instruction; the generating unit is configured to generate a target execution time sequence according to the dependency relationship among the initialization tasks; and the execution unit is configured to execute each initialization task according to the target execution sequence.
In some embodiments, the generating unit comprises: a first determination module configured to determine that the first initialization task is executed after the second initialization task in response to determining that execution of the first initialization task is dependent on completion of the second initialization task.
In some embodiments, an apparatus comprises: a second obtaining unit configured to obtain execution threads of the respective initialization tasks; a generation unit comprising: and the generating module is configured to generate a target execution time sequence by adopting the dependency relationship among the initialization tasks and the execution threads of the initialization tasks.
In some embodiments, the second obtaining unit includes: a second determination module configured to determine, for each two initialization tasks of the respective initialization tasks, that the two initialization tasks are executed in different threads in response to determining that there is no dependency between the two initialization tasks; or, a third determination module configured to determine that the two initialization tasks are executed in the same thread in response to determining that a dependency relationship exists between the two initialization tasks.
In some embodiments, the second obtaining unit includes: a fourth determining module configured to determine, for each of the respective initialization tasks, that at least two initialization tasks are executed in different threads in response to determining that there is no dependency relationship between at least two initialization tasks on which the initialization task depends; a fifth determination module configured to determine that the initialization task is executed in any of the different threads.
In some embodiments, an execution unit, comprising: and the execution module is configured to execute each initialization task in the execution thread corresponding to each initialization task according to the target execution time sequence.
In some embodiments, the first obtaining unit includes: an acquisition module configured to acquire at least one functional component of an application; and the reading module is configured to read each initialization task required for initializing the functional component.
The units in the apparatus 800 described above correspond to the steps in the method described with reference to fig. 2 and 4. Thus, the operations, features and technical effects that can be achieved by the method for initializing an application described above are also applicable to the apparatus 800 and the units included therein, and are not described herein again.
There is also provided, in accordance with an embodiment of the present application, an electronic device, a readable storage medium, and a computer program product.
FIG. 9 illustrates a schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 9, the apparatus 900 includes a computing unit 901, which can perform various appropriate actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)902 or a computer program loaded from a storage unit 908 into a Random Access Memory (RAM) 903. In the RAM903, various programs and data required for the operation of the device 900 can also be stored. The calculation unit 901, ROM 902, and RAM903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
A number of components in the device 900 are connected to the I/O interface 905, including: an input unit 906 such as a keyboard, a mouse, and the like; an output unit 907 such as various types of displays, speakers, and the like; a storage unit 908 such as a magnetic disk, optical disk, or the like; and a communication unit 905 such as a network card, modem, wireless communication transceiver, etc. The communication unit 905 allows the device 900 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 901 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 901 performs the respective methods and processes described above, such as the method for initializing the application. For example, in some embodiments, the method for initializing an application may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 900 via the ROM 902 and/or the communication unit 905. When the computer program is loaded into the RAM903 and executed by the computing unit 901, one or more steps of the method for initializing an application described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the method for initializing the application by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present application may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present application can be achieved, and the present invention is not limited herein.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (17)

1. A method for initializing an application, comprising:
responding to the received application compiling instruction, and acquiring each initialization task for starting the application;
generating a target execution time sequence according to the dependency relationship among the initialization tasks;
and executing each initialization task according to the target execution time sequence.
2. The method of claim 1, wherein the generating a target execution timing according to the dependency relationship between the initialization tasks comprises:
in response to determining that execution of a first initialization task is dependent on completion of a second initialization task, determining that the first initialization task executes after the second initialization task.
3. The method of claim 1, wherein the method comprises:
acquiring execution threads of the initialization tasks;
generating a target execution time sequence according to the dependency relationship among the initialization tasks, wherein the generating comprises:
and generating the target execution time sequence by adopting the dependency relationship among the initialization tasks and the execution threads of the initialization tasks.
4. The method of claim 3, wherein the obtaining the thread of execution of the respective initialization task comprises:
for each two initialization tasks in the initialization tasks, determining that the two initialization tasks are executed in different threads in response to determining that no dependency exists between the two initialization tasks; alternatively, the first and second electrodes may be,
in response to determining that a dependency exists between the two initialization tasks, it is determined that the two initialization tasks execute in the same thread.
5. The method of claim 3, wherein the obtaining the thread of execution of the respective initialization task comprises:
for each initialization task in the initialization tasks, determining that the at least two initialization tasks are executed in different threads in response to determining that the at least two initialization tasks on which the initialization task depends do not have a dependency relationship;
determining that the initialization task is executing in any of the different threads.
6. The method of claim 3, wherein said executing the respective initialization tasks according to the target execution timing comprises:
and executing each initialization task in the execution thread corresponding to each initialization task according to the target execution time sequence.
7. The method of claim 1, wherein the obtaining of the respective initialization tasks for starting the application comprises:
acquiring at least one functional component of the application;
reading each initialization task required for initializing the functional component.
8. An apparatus for initializing an application, comprising:
a first obtaining unit configured to obtain, in response to receiving an application compiling instruction, each initialization task for starting the application;
the generating unit is configured to generate a target execution time sequence according to the dependency relationship among the initialization tasks;
and the execution unit is configured to execute the initialization tasks according to the target execution time sequence.
9. The apparatus of claim 8, wherein the generating unit comprises:
a first determination module configured to determine that a first initialization task is executed after a second initialization task in response to determining that execution of the first initialization task is dependent on completion of the second initialization task.
10. The apparatus of claim 8, wherein the apparatus comprises:
a second obtaining unit configured to obtain execution threads of the respective initialization tasks;
the generation unit includes:
and the generating module is configured to generate the target execution time sequence by adopting the dependency relationship among the initialization tasks and the execution threads of the initialization tasks.
11. The apparatus of claim 10, wherein the second obtaining unit comprises:
a second determination module configured to determine, for each two of the respective initialization tasks, that the two initialization tasks are executed in different threads in response to determining that there is no dependency between the two initialization tasks; alternatively, the first and second electrodes may be,
a third determination module configured to determine that the two initialization tasks are executing in the same thread in response to determining that a dependency exists between the two initialization tasks.
12. The apparatus of claim 10, wherein the second obtaining unit comprises:
a fourth determining module configured to determine, for each of the respective initialization tasks, that at least two initialization tasks that the initialization task depends on are executed in different threads in response to determining that the at least two initialization tasks do not have a dependency relationship;
a fifth determination module configured to determine that the initialization task is executed in any of the different threads.
13. The apparatus of claim 10, wherein the execution unit comprises:
and the execution module is configured to execute each initialization task in the execution thread corresponding to each initialization task according to the target execution time sequence.
14. The apparatus of claim 1, wherein the first obtaining unit comprises:
an acquisition module configured to acquire at least one functional component of the application;
a reading module configured to read each initialization task required to initialize the functional component.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
16. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
17. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-7.
CN202110263288.1A 2021-03-11 2021-03-11 Method and apparatus for initializing applications Pending CN112925587A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110263288.1A CN112925587A (en) 2021-03-11 2021-03-11 Method and apparatus for initializing applications

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110263288.1A CN112925587A (en) 2021-03-11 2021-03-11 Method and apparatus for initializing applications

Publications (1)

Publication Number Publication Date
CN112925587A true CN112925587A (en) 2021-06-08

Family

ID=76172551

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110263288.1A Pending CN112925587A (en) 2021-03-11 2021-03-11 Method and apparatus for initializing applications

Country Status (1)

Country Link
CN (1) CN112925587A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767123A (en) * 2020-05-07 2020-10-13 北京奇艺世纪科技有限公司 Operation optimization method and device
CN113094052A (en) * 2021-06-09 2021-07-09 中电金信软件有限公司 Application construction method and device, computer equipment and storage medium
CN113568673A (en) * 2021-06-10 2021-10-29 北京旷视科技有限公司 Initialization method, initialization device, electronic equipment and computer-readable storage medium
CN114466012A (en) * 2022-02-07 2022-05-10 北京百度网讯科技有限公司 Content initialization method, device, electronic equipment and storage medium
CN114546520A (en) * 2022-01-27 2022-05-27 浪潮通用软件有限公司 Initialization method, equipment and medium based on software as a service (SaaS) application

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101236505A (en) * 2007-01-30 2008-08-06 国际商业机器公司 Method for initialization data processing system and data processing system
CN109814998A (en) * 2019-01-22 2019-05-28 中国联合网络通信集团有限公司 A kind of method and device of multi-process task schedule
CN110442396A (en) * 2019-07-31 2019-11-12 网易(杭州)网络有限公司 Application program launching method and device, storage medium and electronic equipment
CN111258740A (en) * 2020-02-03 2020-06-09 北京无限光场科技有限公司 Method and device for starting application program and electronic equipment
CN111813536A (en) * 2019-04-11 2020-10-23 华为技术有限公司 Task processing method, device, terminal and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101236505A (en) * 2007-01-30 2008-08-06 国际商业机器公司 Method for initialization data processing system and data processing system
CN109814998A (en) * 2019-01-22 2019-05-28 中国联合网络通信集团有限公司 A kind of method and device of multi-process task schedule
CN111813536A (en) * 2019-04-11 2020-10-23 华为技术有限公司 Task processing method, device, terminal and computer readable storage medium
CN110442396A (en) * 2019-07-31 2019-11-12 网易(杭州)网络有限公司 Application program launching method and device, storage medium and electronic equipment
CN111258740A (en) * 2020-02-03 2020-06-09 北京无限光场科技有限公司 Method and device for starting application program and electronic equipment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767123A (en) * 2020-05-07 2020-10-13 北京奇艺世纪科技有限公司 Operation optimization method and device
CN113094052A (en) * 2021-06-09 2021-07-09 中电金信软件有限公司 Application construction method and device, computer equipment and storage medium
CN113568673A (en) * 2021-06-10 2021-10-29 北京旷视科技有限公司 Initialization method, initialization device, electronic equipment and computer-readable storage medium
CN114546520A (en) * 2022-01-27 2022-05-27 浪潮通用软件有限公司 Initialization method, equipment and medium based on software as a service (SaaS) application
CN114546520B (en) * 2022-01-27 2023-06-09 浪潮通用软件有限公司 Initializing method, device and medium based on SaaS application
CN114466012A (en) * 2022-02-07 2022-05-10 北京百度网讯科技有限公司 Content initialization method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN113961351B (en) Distributed training method, device, equipment and storage medium for deep learning model
CN112925587A (en) Method and apparatus for initializing applications
CN112948079B (en) Task scheduling method, device, equipment and computer storage medium
EP4088232A1 (en) Resource usage prediction for deep learning model
CN112328301B (en) Method and device for maintaining consistency of operating environments, storage medium and electronic equipment
EP4060496A2 (en) Method, apparatus, device and storage medium for running inference service platform
CN115509522A (en) Interface arranging method and system for low-code scene and electronic equipment
CN111782181A (en) Code generation method and device, electronic equipment and storage medium
CN115168130A (en) Chip testing method and device, electronic equipment and storage medium
CN114443076A (en) Mirror image construction method, device, equipment and storage medium
CN115269431A (en) Interface testing method and device, electronic equipment and storage medium
EP3819758A2 (en) Instruction executing method and apparatus, electronic device, and computer-readable storage medium
CN114386577A (en) Method, apparatus, and storage medium for executing deep learning model
CN114741294A (en) Page debugging method, device, equipment and storage medium
CN114168151A (en) Container-based program compiling method and device, electronic equipment and storage medium
CN113407259A (en) Scene loading method, device, equipment and storage medium
CN114816758B (en) Resource allocation method and device
CN113031962B (en) Compiling method, compiling apparatus, electronic device, storage medium, and program product
CN113535187B (en) Service online method, service updating method and service providing method
CN107145372A (en) information generating method and device
CN115759260B (en) Reasoning method and device of deep learning model, electronic equipment and storage medium
CN112817573B (en) Method, apparatus, computer system, and medium for building a streaming computing application
CN110825438B (en) Method and device for simulating data processing of artificial intelligence chip
CN117093266A (en) Instruction processing device, method, electronic device, and storage medium
CN114997329A (en) Method, apparatus, device, medium and product for generating a model

Legal Events

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