A starting method and device, terminal equipment and medium

By defining a custom log printing method in the Android system to determine and move the startup message to the head of the queue, the problem of slowed startup speed caused by business message insertion was solved, and the startup message was executed with priority, thus improving the startup speed of the application.

CN116737252BActive Publication Date: 2026-06-26BEIJING ZITIAO NETWORK TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING ZITIAO NETWORK TECH CO LTD
Filing Date
2022-03-01
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In the Android system, inserting business messages into the main thread's message queue causes startup messages to be executed later, resulting in slower application startup speed.

Method used

By using a custom log printing method, the startup message is determined from the head of the message queue and moved to the head of the queue, ensuring that the startup message is executed first.

Benefits of technology

It effectively improves the startup speed of applications and avoids startup delays caused by business information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116737252B_ABST
    Figure CN116737252B_ABST
Patent Text Reader

Abstract

The present disclosure discloses a starting method, device, terminal equipment and medium. The method comprises: determining whether there is a starting message in a message queue from the head of the message queue; if so, moving the starting message to the head of the message queue; taking out the starting message from the message queue, and continuing to determine whether there is a starting message in the message queue from the head of the message queue until the required starting messages for starting are taken out; and executing the corresponding starting message at the execution time of the required starting messages for starting. The method can make the next time the message is taken out for execution to realize the priority execution of the starting message at the head, thereby avoiding the delayed execution of the starting information caused by the business information, and effectively improving the starting speed of the application program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a startup method, apparatus, terminal device, and medium. Background Technology

[0002] The message mechanism is a crucial feature of the Android system. Specifically, it works as follows: all messages on the main thread are placed in a queue before execution. The system's message loop (Looper) then continuously retrieves messages from this queue and executes them sequentially. Application startup also follows this message mechanism. Completing the startup process requires the execution of several specific system messages, such as binding the application (bindApplication) and launching the activity component (launchActivity). These specific system messages are also known as startup messages.

[0003] However, during the execution of these startup messages, business messages are also inserted into the main thread's message queue. These inserted business messages cause the startup messages necessary for starting the system application to be delayed, resulting in a slower startup speed. Summary of the Invention

[0004] This disclosure provides a startup method, apparatus, terminal device, and medium to improve the startup speed of applications.

[0005] In a first aspect, embodiments of this disclosure provide a startup method, including:

[0006] Determine whether a startup message exists in the message queue, starting from the head of the message queue.

[0007] If so, move the startup message to the head of the message queue;

[0008] The startup message is retrieved from the message queue, and the operation of determining whether there is a startup message in the message queue starting from the head of the message queue continues until all startup messages required for startup have been retrieved.

[0009] The corresponding startup message is executed when the required startup message is executed.

[0010] Secondly, embodiments of this disclosure also provide a starting device, comprising:

[0011] The determination module is used to determine whether a startup message exists in the message queue, starting from the head of the message queue.

[0012] A moving module, used to move the start message to the head of the message queue if the condition is met;

[0013] The retrieval module is used to retrieve the startup message from the message queue and continue to perform the operation of determining whether there is a startup message in the message queue starting from the head of the message queue, until all the startup messages required for startup have been retrieved;

[0014] The execution module is used to execute the corresponding startup message when the startup message required for startup is executed.

[0015] Thirdly, embodiments of this disclosure also provide a terminal device, including:

[0016] One or more processing devices;

[0017] Storage device for storing one or more programs;

[0018] The one or more programs are executed by the one or more processing devices, causing the one or more processing devices to implement the startup method provided in the embodiments of this disclosure.

[0019] Fourthly, embodiments of this disclosure also provide a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the startup method provided in embodiments of this disclosure.

[0020] This disclosure provides a startup method, apparatus, terminal device, and medium. First, it determines whether a startup message exists in the message queue, starting from the head of the queue. If so, the startup message is moved to the head of the message queue. Then, the startup message is retrieved from the message queue, and the process of determining whether a startup message exists in the message queue continues until all startup messages required for startup have been retrieved. Finally, the corresponding startup message is executed at the appropriate time. This method, by continuously determining whether a startup message exists in the message queue and moving the confirmed startup messages to the head of the queue, ensures that the startup message at the head of the queue is executed first during the next message retrieval and execution. This avoids delays in startup information execution caused by business information and effectively improves the startup speed of the application. Attached Figure Description

[0021] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0022] Figure 1 This is a flowchart illustrating a startup method provided in Embodiment 1 of this disclosure;

[0023] Figure 2 This is a flowchart illustrating a startup method provided in Embodiment 2 of this disclosure;

[0024] Figure 3 This is a schematic diagram illustrating the implementation of a printer replacement system according to Embodiment 2 of the present invention;

[0025] Figure 4 This is a schematic diagram illustrating the implementation of a startup method provided in Embodiment 2 of the present invention;

[0026] Figure 5 This is a schematic diagram of the structure of a starting device provided in Embodiment 3 of this disclosure;

[0027] Figure 6 This is a schematic diagram of the structure of a terminal device provided in Embodiment 4 of this disclosure. Detailed Implementation

[0028] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0029] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0030] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0031] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0032] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0033] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0034] In the following embodiments, each embodiment provides optional features and examples. The various features described in the embodiments can be combined to form multiple optional solutions. Each numbered embodiment should not be regarded as only one technical solution. Furthermore, unless otherwise specified, the embodiments and features in the embodiments of this disclosure can be combined with each other.

[0035] Currently, to address the issue of slow startup speed caused by business message insertion, one approach is to analyze each inserted business message individually and then modify the code implementation for message insertion. This can be done by avoiding or delaying message insertion, thus mitigating the startup slowdown. However, this solution is costly, and continuous optimization is required for new messages introduced during iterations. Furthermore, messages inserted into the main thread's message queue by external Software Development Kits (SDKs) may be unoptimizable due to the inability to modify their code. Therefore, this embodiment proposes a startup method to address the slow startup speed caused by business message insertion. This method eliminates the need for individual optimization of each business message, resulting in high optimization efficiency. It also automatically handles new message insertion issues introduced in subsequent business iterations, leading to low maintenance costs.

[0036] Example 1

[0037] Figure 1 This is a flowchart illustrating a startup method provided in Embodiment 1 of this disclosure. This method is applicable to improving application startup speed. The method can be executed by a startup device, which can be implemented by software and / or hardware and is generally integrated into a terminal device. In this embodiment, the terminal device includes, but is not limited to, devices such as computers, laptops, smartphones, and tablets.

[0038] like Figure 1 As shown in Embodiment 1 of this disclosure, a startup method includes the following steps:

[0039] S110. Determine whether a startup message exists in the message queue, starting from the head of the message queue.

[0040] In this embodiment, a message queue can be understood as a container for storing messages during message transmission. In this embodiment, it can be considered as a container for storing all pending messages in a main thread. When an application is launched, the system creates a corresponding process to execute the application launch, and at the same time, a thread immediately runs. This thread is usually referred to as the main thread of the process. This main thread can correspond to a message queue, which can store the launch messages required to launch the application. Launch messages can be understood as specific system messages required when the application starts, such as bindApplication, launchActivity, etc. The specific content of the launch messages is not limited here.

[0041] During the execution of the startup message, the business logic also inserts some business messages into the message queue corresponding to the main thread. These business messages are interspersed among these startup messages, which results in the message queue containing not only startup messages but also business messages.

[0042] It's important to note that when the application starts, the first message retrieved from the corresponding message queue is the startup message. Subsequent messages retrieved from the queue may be either startup messages or business messages. Since messages in the message queue are ordered, and each message is retrieved sequentially from the front of the queue, the presence of a startup message can be determined from the front of the queue. There's no specific limitation on how to determine the presence of a startup message from the front of the queue; for example, a custom log printing method could be used to determine this.

[0043] Optionally, determining whether a startup message exists in the message queue starting from the head of the message queue includes: determining whether a startup message exists in the message queue starting from the head of the message queue using a custom log printing method.

[0044] The system's log printing method refers to the method used to output logs related to messages. A custom log printing method can be understood as a log printing method defined based on the system's log printing method. A log printing method can be represented as a Printer. Determining whether a startup message exists in the message queue from the head of the message queue using a custom log printing method can be understood as checking the message queue for a startup message when the custom log printing method is executed.

[0045] In one embodiment, when the startup message is executed, the original system Printer can be obtained and cached in the corresponding memory by reflecting the message log processing (i.e., mLogging) variable of the Looper in the Android operating system (OS). Based on this, the message log setting method of the Looper in the system (i.e., setMessageLogging method) is called to replace the system Printer with a custom Printer, i.e., a custom log printing method.

[0046] Optionally, a custom log printing method can be used to determine whether a startup message exists in the message queue, starting from the head of the message queue. This includes determining whether a startup message exists in the message queue, starting from the head of the message queue, when the print method of the custom log printing method is called.

[0047] The `print method` can refer to the specific method for logging contained within a custom log printing method, and can be represented as the `println` method. The process of determining whether a startup message exists in the message queue from the head of the message queue using a custom log printing method can be as follows: when the `print` method of the custom log printing method is called, it checks whether a startup message exists in the message queue from the head of the message queue.

[0048] In one embodiment, the timing of determining whether a startup message exists in the message queue starting from the head of the message queue is not limited. For example, it could be done after a message is retrieved from the message queue and executed, starting from the head of the message queue. Alternatively, it could be done before a message is retrieved and executed, or even during the process of retrieving and executing a message, starting from the head of the message queue.

[0049] S120. If so, move the start message to the head of the message queue.

[0050] In this embodiment, starting from the head of the message queue, messages in the message queue are sequentially determined to be startup messages. Once a startup message is determined to be a startup message, it can be moved to the head of the message queue.

[0051] In one embodiment, the process of moving the startup message to the head of the message queue can be as follows: first, the startup message is deleted from the message queue to obtain the message queue after the startup message is deleted, that is, the startup message and its position in the message queue have been deleted; then, the startup message is added to the head of the message queue after the startup message is deleted, so that the startup message can be obtained from the head of the message queue later.

[0052] S130. The startup message is retrieved from the message queue, and the operation of determining whether there is a startup message in the message queue starting from the head of the message queue continues until all startup messages required for startup are retrieved.

[0053] In this embodiment, after moving the startup message to the head of the message queue, the startup message is retrieved from the message queue, and the operation of determining whether a startup message exists in the message queue, starting from the head of the message queue, continues until all startup messages required for startup have been retrieved. Here, the startup messages required for startup can refer to the startup messages contained in the message queue that are necessary to launch the application.

[0054] S140. Execute the corresponding startup message when the startup message required for startup is executed.

[0055] In this embodiment, the timing of executing the startup message required for startup can be understood as the timing of executing the startup message required for startup; for example, the execution timing can be after the startup message is retrieved from the message queue and executed, or it can be before the startup message is retrieved from the message queue and executed; the execution timing is not limited here. It is understood that when all startup messages in the message queue have been executed, it indicates that the application startup is complete.

[0056] The startup method provided in Embodiment 1 of this disclosure firstly determines whether a startup message exists in the message queue, starting from the head of the message queue. If so, the startup message is moved to the head of the message queue. Then, the startup message is retrieved from the message queue, and the process of determining whether a startup message exists in the message queue continues until all startup messages required for startup have been retrieved. Finally, the corresponding startup message is executed at the appropriate time. This method, by continuously determining whether a startup message exists in the message queue and moving the confirmed startup messages to the head of the message queue, ensures that the startup message at the head of the queue is executed first during the next message retrieval and execution. This avoids delays in startup information execution caused by business information and effectively improves the startup speed of the application.

[0057] Example 2

[0058] Figure 2 This is a flowchart illustrating a startup method provided in Embodiment 2 of this disclosure. Embodiment 2 is a specific embodiment based on the various optional solutions described in the above embodiments. In this embodiment, the subsequent processing when a startup message is not present in the message queue, the process of moving the startup message to the head of the message queue, and the process of determining when a startup message exists in the message queue are specifically described. For details not covered in this embodiment, please refer to Embodiment 1.

[0059] like Figure 2 As shown in Embodiment 2 of this disclosure, a startup method includes the following steps:

[0060] S210. After retrieving a message from the message queue and executing the retrieved message, start from the head of the message queue to determine if there is a startup message in the message queue. If yes, execute S230; otherwise, execute S250.

[0061] In this embodiment, after a message is retrieved from the message queue and the retrieved message has been executed, it can be determined from the head of the message queue whether a start message exists in the message queue.

[0062] S220. Before retrieving a message from the message queue and executing the retrieved message, determine whether a startup message exists in the message queue starting from the head of the message queue. If yes, execute S230; otherwise, execute S250.

[0063] In this embodiment, before a message is retrieved from the message queue and executed, it can be determined from the head of the message queue whether a startup message exists in the message queue.

[0064] One approach is to determine whether a startup message exists in the message queue, starting from the head, using a custom log printing method. Specifically, this can be achieved by calling the custom log printing method's print function, which then checks the message queue for startup messages from the head.

[0065] S230. Move the startup message to the head of the message queue.

[0066] In this embodiment, if a startup message exists in the message queue, the startup message can be moved to the head of the message queue.

[0067] Optionally, moving the startup message to the head of the message queue includes: deleting the startup message from the message queue; or adding the startup message to the head of the message queue after the startup message has been deleted.

[0068] The process of moving the startup message to the head of the message queue can be achieved by deleting the startup message from the message queue and then adding the startup message to the head of the message queue after the deletion of the startup message.

[0069] S240. Retrieve the startup message from the message queue and execute S260.

[0070] In this embodiment, after the startup message is moved to the head of the message queue, the startup message can be retrieved from the message queue.

[0071] S250. Retrieve the next message from the message queue.

[0072] In this embodiment, if there is no start message in the message queue, the next message can be retrieved from the message queue in sequence. The next message may be the business information that was previously inserted.

[0073] S260. Continue executing the operation of determining whether there is a startup message in the message queue starting from the head of the message queue, until all startup messages required for startup have been retrieved.

[0074] In this embodiment, after retrieving a message (whether it is a startup message or a business message) from the message queue, the operation of determining whether a startup message exists in the message queue can continue to be performed starting from the head of the message queue, until all startup messages required for startup are retrieved.

[0075] S270. Execute the corresponding startup message when the startup message required for startup is executed.

[0076] This disclosure provides a startup method in embodiment two, which specifies the subsequent processing when a startup message is not present in the message queue, the process of moving the startup message to the head of the message queue, and the timing for determining whether a startup message exists in the message queue. This method improves the flexibility of timing by setting the determination of whether a startup message exists in the message queue to be after the retrieved message has been executed or before it has been executed; furthermore, by moving startup messages in the message queue, it prioritizes the execution of startup messages, thereby effectively improving the application startup speed.

[0077] The present disclosure is described by way of example below:

[0078] This disclosure proposes a startup method that uses message scheduling to move the necessary system messages (i.e. startup messages) to the front of the main thread message queue (i.e., the head of the message queue), so that these system messages can be executed with priority, thereby optimizing startup speed.

[0079] Figure 3This is a schematic diagram illustrating the implementation of a printer replacement system according to Embodiment 2 of the present invention. Figure 3 As shown, after Android retrieves message x from the message queue, it calls the system's Printer's println method to output message-related logs before and after execution. This disclosure allows the use of a custom Printer to replace the system's Printer. When the custom Printer is executed, it checks the messages in the main thread's message queue. If there is a next system startup message to be executed in the message queue, then the startup message can be moved to the front of the message queue, thereby optimizing startup speed.

[0080] Figure 4 This is a schematic diagram illustrating the implementation of a startup method provided in Embodiment 2 of the present invention. Figure 4 As shown, with Figure 4 Taking the message order in the middle as an example, the specific steps are as follows:

[0081] 1) When startup message 1 is executed, reflect the mgoogging variable of android.OS.Looper (i.e., the Looper in the Android system), obtain the original system Printer and cache it in memory, and then call the setMessageLogging method of android.OS.Looper to replace the system Printer with a custom Printer (i.e., a custom log printing method).

[0082] 2) After startup message 1 is executed, when the println method of the custom Printer is called (i.e. when the print method of the custom log printing method is called), check the main thread message queue to see if startup message 2 exists (i.e., start from the head of the message queue to determine if there is a startup message in the message queue);

[0083] 3) If startup message 2 exists, move startup message 2 to the front of the main thread message queue (i.e., the head of the message queue), and then call the system's Printer's println method to output the original log.

[0084] 4) If startup message 2 does not exist, other business messages in the message queue are executed sequentially until startup message 2 exists in the main thread message queue, at which point it is moved to the front of the main thread message queue.

[0085] 5) Since startup message 2 is moved to the front of the main thread's message queue, startup message 2 will be executed first when a message is retrieved from the message queue for execution next time;

[0086] 6) And so on. In the subsequent process, the subsequent startup messages are moved to the front of the main thread's message queue until the application startup is complete (that is, continue to execute the operation of checking whether there is a startup message in the message queue starting from the front of the message queue until all the startup messages required for startup have been executed, indicating that the application startup is complete).

[0087] Example 3

[0088] Figure 5 This is a schematic diagram of a starting device provided in Embodiment 3 of the present disclosure, wherein the device can be implemented by software and / or hardware, and is generally integrated into a terminal device.

[0089] like Figure 5 As shown, the device includes: a determining module 310, a moving module 320, a taking out module 330, and an execution module 340;

[0090] The determining module 310 is used to determine whether a startup message exists in the message queue, starting from the head of the message queue.

[0091] The moving module 320 is used to move the start message to the head of the message queue if the condition is met.

[0092] The retrieval module 330 is used to retrieve the startup message from the message queue and continue to perform the operation of determining whether there is a startup message in the message queue starting from the head of the message queue, until all startup messages required for startup have been retrieved;

[0093] The execution module 340 is used to execute the corresponding startup message when the startup message required for startup is executed.

[0094] In this embodiment, the device first determines whether a startup message exists in the message queue, starting from the head of the message queue, using a determining module 310. Then, using a moving module 320, if a startup message exists, it is moved to the head of the message queue. Next, using a retrieving module 330, the startup message is retrieved from the message queue, and the process of determining whether a startup message exists in the message queue, starting from the head of the message queue, continues until all startup messages required for startup have been retrieved. Finally, using an execution module 340, the corresponding startup message is executed when the required startup message is executed. By continuously determining whether a startup message exists in the message queue and moving the confirmed startup messages to the head of the message queue, the device ensures that the startup message at the head of the queue is executed first during the next message retrieval and execution, thereby avoiding delays in startup information execution caused by business information and effectively improving the startup speed of the application.

[0095] Optionally, module 310 is defined, specifically including:

[0096] The determining unit is used to determine whether a startup message exists in the message queue, starting from the head of the message queue, using a custom log printing method.

[0097] Optional, define the unit, specifically for:

[0098] When the print method of the custom log printing method is called, the presence of a startup message in the message queue is determined starting from the head of the message queue.

[0099] Optionally, the device further includes:

[0100] The retrieval module is configured to, if it is determined from the head of the message queue that there is no startup message in the message queue, retrieve the next message from the message queue and continue the operation of determining whether there is a startup message in the message queue from the head of the message queue.

[0101] Optional, the mobile module 320 specifically includes:

[0102] A deletion unit is used to delete the startup message from the message queue;

[0103] An adding unit is used to add the startup message to the head position of the message queue after the startup message is deleted.

[0104] Optionally, module 310 is determined, specifically for:

[0105] After retrieving a message from the message queue and executing the retrieved message, determine whether a startup message exists in the message queue, starting from the head of the message queue.

[0106] Optionally, module 310 is further used for:

[0107] Before retrieving a message from the message queue and executing the retrieved message, determine whether a startup message exists in the message queue, starting from the head of the message queue.

[0108] The above-described starting device can execute the starting method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the method.

[0109] Example 4

[0110] Figure 6 This is a schematic diagram of the structure of a terminal device provided in Embodiment 4 of this disclosure. Figure 6A schematic diagram of a terminal device 400 suitable for implementing embodiments of the present disclosure is shown. The terminal device 400 in embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The terminal device 400 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.

[0111] like Figure 6 As shown, the terminal device 400 may include one or more processing devices (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 408 into random access memory (RAM) 403. One or more processing devices 401 implement the methods provided in this disclosure. Various programs and data required for the operation of the electronic device 400 are also stored in RAM 403. The processing devices 401, ROM 402, and RAM 403 are interconnected via bus 404. An input / output (I / O) interface 405 is also connected to bus 404.

[0112] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, magnetic tapes, hard disks, etc., for storing one or more programs; and communication devices 409. Communication device 409 allows terminal device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 A terminal device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0113] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 409, or installed from a storage device 408, or installed from a ROM 402. When the computer program is executed by a processing device 401, it performs the functions defined in the methods of embodiments of this disclosure.

[0114] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0115] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol, such as Hypertext Transfer Protocol (HTTP), and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0116] The aforementioned computer-readable medium may be included in the aforementioned terminal device 400; or it may exist independently and not assembled into the terminal device 400.

[0117] The aforementioned computer-readable medium stores one or more computer programs that, when executed by a processing device, implement the following method: the computer-readable medium carries one or more programs that, when executed by the electronic device, cause the terminal device 400 to: write computer program code for performing the operations of this disclosure in one or more programming languages ​​or combinations thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0118] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. Each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0119] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules are not, in some cases, intended to limit the functionality of the module itself.

[0120] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Parts (ASSP), System on Chip (SOC), Complex Programming Logic Device (CPLD), and so on.

[0121] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0122] According to one or more embodiments of this disclosure, Example 1 provides a startup method, including:

[0123] Determine whether a startup message exists in the message queue, starting from the head of the message queue.

[0124] If so, move the startup message to the head of the message queue;

[0125] The startup message is retrieved from the message queue, and the operation of determining whether there is a startup message in the message queue starting from the head of the message queue continues until all startup messages required for startup have been retrieved.

[0126] The corresponding startup message is executed when the required startup message is executed.

[0127] According to one or more embodiments of this disclosure, Example 2 describes the method described in Example 1.

[0128] The step of determining whether a startup message exists in the message queue, starting from the head of the message queue, includes:

[0129] The presence of a startup message in the message queue is determined by starting from the head of the message queue using a custom log printing method.

[0130] According to one or more embodiments of this disclosure, Example 3 describes the method described in Example 1.

[0131] Determining whether a startup message exists in the message queue by starting from the head of the message queue using a custom log printing method includes:

[0132] When the print method of the custom log printing method is called, the presence of a startup message in the message queue is determined starting from the head of the message queue.

[0133] According to one or more embodiments of this disclosure, Example 4 describes the method described in Example 1.

[0134] Also includes:

[0135] If not, retrieve the next message from the message queue and continue with the operation of determining whether a start message exists in the message queue, starting from the head of the message queue.

[0136] According to one or more embodiments of this disclosure, Example 5 describes the method described in Example 1.

[0137] Moving the startup message to the head of the message queue includes:

[0138] Remove the startup message from the message queue;

[0139] Add the startup message to the head of the message queue after the startup message is deleted.

[0140] According to one or more embodiments of this disclosure, Example 6 describes the method described in Example 1.

[0141] Determining whether a startup message exists in the message queue, starting from the head of the message queue, includes:

[0142] After retrieving a message from the message queue and executing the retrieved message, determine whether a startup message exists in the message queue, starting from the head of the message queue.

[0143] According to one or more embodiments of this disclosure, Example 7 describes the method described in Example 1.

[0144] Determining whether a startup message exists in the message queue, starting from the head of the message queue, includes:

[0145] Before retrieving a message from the message queue and executing the retrieved message, determine whether a startup message exists in the message queue, starting from the head of the message queue.

[0146] According to one or more embodiments of this disclosure, Example 8 provides a starting device, including:

[0147] The determination module is used to determine whether a startup message exists in the message queue, starting from the head of the message queue.

[0148] The moving module is used to move the startup message to the head of the message queue if the condition is met, and to output the log.

[0149] The retrieval module is used to retrieve the startup message from the message queue and continue to perform the operation of determining whether there is a startup message in the message queue starting from the head of the message queue, until all the startup messages required for startup have been retrieved;

[0150] The execution module is used to execute the corresponding startup message when the startup message required for startup is executed.

[0151] According to one or more embodiments of this disclosure, Example 9 provides a terminal device, including:

[0152] One or more processing devices;

[0153] Storage device for storing one or more programs;

[0154] When the one or more programs are executed by the one or more processing devices, the one or more processing devices perform the method as described in any of Examples 1-7.

[0155] According to one or more embodiments of the present disclosure, Example 10 provides a computer-readable medium having a computer program stored thereon that, when executed by a processing device, implements the method described in any of Examples 1-7.

[0156] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0157] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0158] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A startup method, characterized in that, The method includes: Determine whether a startup message exists in the message queue, starting from the head of the message queue. If so, move the startup message to the head of the message queue. The startup message is retrieved from the message queue, and the operation of determining whether there is a startup message in the message queue starting from the head of the message queue continues until all startup messages required for startup have been retrieved. The corresponding startup message is executed at the appropriate time when the startup message is required to start. The step of determining whether a startup message exists in the message queue, starting from the head of the message queue, includes: The presence of a startup message in the message queue is determined by starting from the head of the message queue using a custom log printing method.

2. The method according to claim 1, characterized in that, Determining whether a startup message exists in the message queue by starting from the head of the message queue using a custom log printing method includes: When the print method of the custom log printing method is called, the presence of a startup message in the message queue is determined starting from the head of the message queue.

3. The method according to claim 1, characterized in that, Also includes: If not, retrieve the next message from the message queue and continue with the operation of determining whether a start message exists in the message queue, starting from the head of the message queue.

4. The method according to claim 1, characterized in that, Moving the startup message to the head of the message queue includes: Remove the startup message from the message queue; Add the startup message to the head of the message queue after the startup message is deleted.

5. The method according to claim 1, characterized in that, Determining whether a startup message exists in the message queue, starting from the head of the message queue, includes: After retrieving a message from the message queue and executing the retrieved message, determine whether a startup message exists in the message queue, starting from the head of the message queue.

6. The method according to claim 1, characterized in that, Determining whether a startup message exists in the message queue, starting from the head of the message queue, includes: Before retrieving a message from the message queue and executing the retrieved message, determine whether a startup message exists in the message queue, starting from the head of the message queue.

7. A starting device, characterized in that, include: The determination module is used to determine whether a startup message exists in the message queue, starting from the head of the message queue. A moving module, used to move the start message to the head of the message queue if the condition is met; The retrieval module is used to retrieve the startup message from the message queue and continue to perform the operation of determining whether there is a startup message in the message queue starting from the head of the message queue, until all the startup messages required for startup have been retrieved; The execution module is used to execute the corresponding startup message when the startup message required for startup is executed; The determining module includes a determining unit, which is used to determine whether a startup message exists in the message queue, starting from the head of the message queue, using a custom log printing method.

8. A terminal device, characterized in that, include: One or more processing devices; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processing devices, the one or more processing devices perform the method as described in any one of claims 1-6.

9. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processing device, it implements the method as described in any one of claims 1-6.