System starting method, terminal, medium and product
By monitoring and switching systems during the startup process of the vehicle terminal, the problem of identifying system anomalies during non-OTA upgrades is solved, ensuring the operational reliability of the dual-system terminals and improving the startup reliability and security of the vehicle terminal.
Patent Information
- Application Number
- CN202410671788.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2025-11-28
AI Technical Summary
In existing technologies, the problem of how to identify system anomalies and switch systems during over-the-air (OTA) upgrades for vehicle-mounted dual-system terminals has not been effectively solved, affecting the operational reliability of the terminals.
During the terminal startup process, the system determines whether any startup stage fails among multiple startup phases. If any stage fails, another system is started to ensure the reliability of the dual-system terminal operation. Specific methods include using preset and backup flags to monitor and switch systems, and utilizing on-chip registers and external memory to store the flags to ensure reliable system switching.
This enables a switch to another system even if one system fails during startup, ensuring the operational reliability of both systems and improving the startup reliability and security of the vehicle terminal.
Smart Images

Figure CN121029482A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of application system, in particular to a system starting method, a terminal, a medium and a product. BACKGROUND
[0002] With the development of electronic information technology, in order to improve the security of the terminal, a dual system design is adopted in the terminal, and a dual system terminal emerges as the times require.
[0003] For vehicle terminal, it is necessary to ensure the reliability of operation. For vehicle dual system terminal, at present, the switching strategy in the over the air (OTA) upgrade process is mainly concentrated, and for non-OTA upgrade process, for example, in the terminal starting process, how to determine system abnormality and switch system is a problem to be solved urgently. SUMMARY
[0004] The present disclosure provides a system starting method, a terminal, a medium and a product.
[0005] In a first aspect, the embodiments of the present disclosure provide a system starting method applied to a terminal, the terminal comprising a first system and a second system, the method comprising: determining whether any of a plurality of starting stages included in the first system fails to start in a process of starting the first system; and starting the second system in a case where it is determined that any of the plurality of starting stages included in the first system fails to start.
[0006] In a second aspect, the embodiments of the present disclosure provide a terminal comprising a memory and a processor, wherein the memory stores a computer program executable by the processor, and the computer program is executed by the processor to implement the first aspect and any one of the possible embodiments of the first aspect.
[0007] In a third aspect, the embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the first aspect and any one of the possible embodiments of the first aspect.
[0008] In a fourth aspect, the embodiments of the present disclosure provide a computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the first aspect and any one of the possible embodiments of the first aspect.
[0009] In the present disclosure, for a dual-system terminal comprising a first system and a second system, in a process of starting the first system, it is determined whether any of a plurality of starting stages comprised by the first system fails to start, in the case that any of the plurality of starting stages comprised by the first system fails to start, it is determined that the first system fails to start, and the second system is started. In this way, in the case that any of a plurality of starting stages comprised by one of the dual-system terminal fails to start, it can be determined that the system fails to start, and the other system of the dual-system terminal is started to ensure the reliability of the operation of the dual-system terminal. BRIEF DESCRIPTION OF DRAWINGS
[0010] In the accompanying drawings for the embodiments of the present disclosure:
[0011] Figure 1 A flowchart of a system starting method provided by the embodiments of the present disclosure;
[0012] Figure 2 Another flowchart of a system starting method provided by the embodiments of the present disclosure;
[0013] Figure 3 A hardware interaction schematic diagram provided by the embodiments of the present disclosure;
[0014] Figure 4 A terminal structure schematic diagram provided by the embodiments of the present disclosure. DETAILED DESCRIPTION
[0015] In order for those skilled in the art to better understand the technical solutions of the present disclosure, a system starting method, a terminal, a medium and a product provided by the embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0016] The present disclosure will be described more fully hereinafter with reference to the accompanying drawings, in which embodiments are shown. The present disclosure may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0017] The accompanying drawings for the embodiments of the present disclosure are used to provide a further understanding of the embodiments of the present disclosure, and constitute a part of the specification, and are used to explain the present disclosure together with the detailed embodiments, and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art from the detailed embodiments described below, by reference to the drawings.
[0018] In the case of no conflict, each embodiment of the present disclosure and each feature in the embodiments can be combined with each other.
[0019] The terminology used by the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the present disclosure. As used in the present disclosure, the term "and / or" includes any and all combinations of one or more of the associated listed items. As used in the present disclosure, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. As used in the present disclosure, the terms "comprises," "comprising," "consists of," and "consisting of" specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0020] In the description of the present disclosure, the words "first", "second", and so on in the description are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can it be understood as indicating or implying order.
[0021] Unless otherwise defined, all terms (including technical and scientific terms) used in the present disclosure have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and should not be interpreted in an idealized or overly formal sense unless expressly so defined by the present disclosure.
[0022] In the present disclosure, the following technical terms should be understood as follows unless otherwise specified:
[0023] 1) Read-Only Memory (ROM), which works in a non-destructive readout manner and can only read out information and cannot write information.
[0024] 2) Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM), which is an SDRAM with double data rate, its data transmission speed is twice the system clock frequency, and its transmission performance is better than that of traditional SDRAM due to the increase in speed.
[0025] 3) Cache, which is a technology used to improve data access speed, which uses a smaller and faster storage device as a buffer for a larger and slower storage device.
[0026] 4) Flash, which is a long-life non-volatile memory that can retain stored data information in the event of power failure.
[0027] 5) Embedded Multi Media Card (eMMC), a new storage technology established by the MMC Association. The architecture standard puts MMC components (flash memory plus controller) into a small ball grid array package (BGA), which is an embedded non-volatile memory system mainly used in printed circuit boards.
[0028] 6) Primary Bootloader (PBL), also known as the first bootloader, mainly performs initialization of the chip and detection of the underlying hardware.
[0029] 7) Secondary Bootloader (SBL), mainly responsible for reading data from storage media and loading it into memory for execution.
[0030] 8) Universal Boot Loader (Uboot), a universal bootloader, usually used for the startup and initialization of embedded systems.
[0031] 9) Kernel, the most basic part of the system, responsible for managing the system's processes, memory, device drivers, files, and network systems, etc., determining the performance and stability of the system. It is a bridge connecting application programs and hardware, providing a hardware abstraction layer, hiding complexity and making program design simpler.
[0032] 10) Root File System (Rootfs), a file system that is the first file system mounted when the kernel starts. The image file of the kernel code can be saved in the root file system, and the system boot program will load some initialization scripts and services into memory to run after the root file system is mounted.
[0033] 11) Realtime communication (RTC), refers to the ability to communicate and exchange information in real time over the Internet. RTC includes technologies and protocols that enable synchronized communication of audio, video, and other types of data between devices.
[0034] For vehicle terminals, it is necessary to ensure the reliability of operation. For vehicle dual-system terminals, the current focus is on the switching strategy during the OTA upgrade process, and for non-OTA upgrade processes, such as during the terminal startup process, how to determine system abnormalities and switch systems is a problem that needs to be solved urgently.
[0035] Therefore, the embodiments of the present disclosure provide a system startup method, a terminal, a medium and a product to determine system abnormalities and switch systems during the terminal startup process. The following will be described in detail in conjunction with the drawings.
[0036] In a first aspect, with reference to the accompanying drawings Figure 1 A system starting method flowchart is provided in the embodiments of the present disclosure, and is applied to a terminal. The terminal includes a first system and a second system. The method includes the following steps.
[0037] S101: In the process of starting the first system, it is determined whether any starting stage of a plurality of starting stages included in the first system fails to start.
[0038] In the embodiments of the present disclosure, the starting stage failing to start can include, but is not limited to, the starting stage failing to authenticate or load.
[0039] In the embodiments of the present disclosure, the terminal can be a vehicle-mounted terminal or other terminal with high safety requirements, and the terminal is not limited to this. The terminal refers to a dual-system terminal, and the dual system includes the first system and the second system. The first system and the second system can be the same system or different systems. The present disclosure does not limit the types of the first system and the second system. For example, the first system and the second system can be embedded systems. Taking an embedded linux system as an example, the plurality of starting stages included in the embedded linux system can include PBL, SBL, Uboot, Kernel and Rootfs.
[0040] In the embodiments of the present disclosure, in the process of starting the terminal, one of the systems is usually started first, for example, the first system or the second system can be started first. There are various ways to determine whether the first system or the second system is started. The following provides a possible implementation manner.
[0041] In some embodiments, a preset first flag is obtained, and the preset first flag is used to indicate whether the first system or the second system is started. In this embodiment, the terminal can determine whether the first system or the second system is started according to the preset first flag.
[0042] In the embodiments of the present disclosure, the preset first flag can be stored in an on-chip register that is always powered. The register can be powered by a backup battery even in the case of whole machine power-off (for example, restart, shutdown, abnormal power-off, etc.). In a possible implementation, the preset first flag can be stored in a reserved register of an RTC. In this way, the preset first flag can still be saved in the case of whole machine power-off, and the preset first flag can be accessed in all starting stages.
[0043] S102: In the case where any starting stage of the plurality of starting stages included in the first system fails to start, it is determined that the first system fails to start, and the second system is started.
[0044] In the embodiments of the present disclosure, for a dual-system terminal including a first system and a second system, in a process of starting the first system, whether a starting phase included in the first system fails is determined, and in a case that any starting phase included in the first system fails, it is determined that the first system fails to start, and the second system is started. In this way, in a case that any starting phase included in one of the systems of the dual-system terminal fails, it is determined that the system fails to start, and the other system of the dual-system terminal is started to ensure the operation reliability of the dual-system terminal.
[0045] In some embodiments, a first value of a preset first flag is used to indicate starting the first system, and a second value of the preset first flag is used to indicate starting the second system; in this embodiment, after it is determined that the first system fails to start, the method further includes: updating the value of the preset first flag from the first value to the second value; in this embodiment, starting the second system includes: starting the second system according to the updated value of the preset first flag.
[0046] In the embodiments of the present disclosure, the specific values of the first value and the second value are not limited, and can be used for the purpose of distinguishing indication.
[0047] In some embodiments, in a case that a current starting phase included in the first system succeeds, a backup flag of the preset first flag is obtained; the preset first flag and the backup flag are synchronously assigned values, and the backup flag is used to assign values to the preset first flag in a case that the preset first flag has been reset; in this embodiment, whether the values of the preset first flag and the backup flag are equal is determined; in a case that the values of the preset first flag and the backup flag are equal, a next starting phase of the current starting phase is started. In this way, even in a case that a register storing the preset first flag is reset to a default value (usually 0 or 1) of the register, the preset first flag can be assigned values through the backup flag, and the effectiveness of the preset first flag is ensured.
[0048] In the embodiments of the present disclosure, the success of starting a starting phase can include the success of authentication and loading of the starting phase.
[0049] In the embodiments of the present disclosure, the backup flag can be stored in an external storage, for example, can be stored in a Flash, an eMMC, or the like.
[0050] In some embodiments, in a case where it is determined that the preset first flag bit and the backup flag bit are not equal, it is determined whether the preset first flag bit has been reset; in a case where it is determined that the preset first flag bit has been reset, the preset first flag bit is assigned a value of the backup flag bit; in a case where it is determined that the preset first flag bit has not been reset, a next startup stage of the current startup stage is started.
[0051] In some embodiments, after it is determined that the first system fails to start, the method further comprises: updating a value of the backup flag bit and the preset first flag bit from the first value to the second value.
[0052] In some embodiments, determining whether the preset first flag bit has been reset comprises: obtaining a preset second flag bit, wherein the preset second flag bit is used to indicate whether the first preset identifier has been reset; and determining, according to the preset second flag bit, whether the preset first flag bit has been reset.
[0053] In the embodiments of the present disclosure, the preset second flag bit can be stored in an on-chip register, for example, can be stored in any one of the on-chip reserver registers.
[0054] In some embodiments, a value of the preset second flag bit being the third value is used to indicate that the first preset identifier has been reset, and a value of the preset second flag bit being the fourth value is used to indicate that the first preset identifier has not been reset; in this embodiment, determining, according to the preset second flag bit, whether the preset first flag bit has been reset comprises: in a case where the value of the preset second flag bit is the third value, determining that the first preset identifier has been reset; and in a case where the value of the preset second flag bit is the fourth value, determining that the first preset identifier has not been reset; in this embodiment, after it is determined that the preset first flag bit has been reset and the preset first flag bit is assigned the value of the backup flag bit, the method further comprises: updating the value of the preset second flag bit from the third value to the fourth value.
[0055] In some embodiments, before S101, the method further comprises: in a case where the value of the preset first flag bit is the first value, determining to start the first system; and in a case where the value of the preset first flag bit is the second value, determining to start the second system; in addition, the method further comprises: in a case where the value of the preset first flag bit is neither the first value nor the second value, setting the value of the preset second flag bit to the third value.
[0056] In some embodiments, the first system and the second system are the same or different systems, and the first system and the second system share at least one of the plurality of start-up stages. For example, taking the first system and the second system as embedded Linux systems, the first system and the second system can share PBL. For another example, taking the first system as an embedded Linux system and the second system as a system other than an embedded Linux system, the first system and the second system can also share PBL.
[0057] In order for those skilled in the art to more clearly understand the technical solutions provided by the embodiments of the present disclosure, the technical solutions provided by the embodiments of the present disclosure are further described below with specific embodiments:
[0058] Reference is made to the accompanying drawings Figure 2 For another system start-up method flowchart provided by the embodiments of the present disclosure, the following will be described in combination with Figure 2 The system start-up method of this embodiment is described in detail.
[0059] In Figure 2 In the embodiment shown, the first system included in the terminal is A system, and the second system is B system, both the A system and the B system are embedded Linux systems, the system start-up stages can include PBL, SBL, Uboot, Kernel and Rootfs, the A system and the B system share PBL, wherein the start-up of each start-up stage of the A system can be represented by PBL->SBL->Uboot->Kernel->Rootfs, and the start-up of each start-up stage of the B system can be represented by PBL->SBL1->Uboot1->Kernel1->Rootfs1. A first flag is preset as Flag, the value of Flag is 5 for indicating starting the A system, the value of Flag is 6 for indicating starting the B system, a backup flag of the first flag is preset as Sync, the current default start-up system is the A system, i.e. the default initial value of Flag is 5, Sync is assigned synchronously with Flag, and the default initial value of Sync is also 5. A second flag is preset as Def, the value of Def is 3 for indicating that Flag has been reset, and the value of Def is 0 for indicating that Flag has not been reset.
[0060] In addition, in this embodiment, the policy running and process data need to use the registers, ROM, Cache, DDR, Flash, eMMC and other hardware storage devices of the terminal. The boot policy involved in the PBL starting stage can be run in the on-chip ROM, the boot policy involved in the SBL starting stage can be run in the on-chip Cache, the boot policy of the Uboot, Kernel and Rootfs and other starting stages can be run in the DDR, the Flag and Def flag bits involved are stored in the on-chip registers, and the Sync flag bit is stored in the external storage such as Flash / eMMC. Referring to the hardware interaction schematic diagram provided by the embodiment of the present disclosure, Figure 3 A hardware interaction schematic diagram provided by the embodiment of the present disclosure, Figure 3 The interaction relationship between the various hardware involved in this embodiment is shown.
[0061] The system starting method flow of this embodiment will be described in detail below.
[0062] S1: The terminal is powered on and started.
[0063] S2: The PBL is run.
[0064] S3: In the PBL running process, it is judged whether the value of Flag is equal to 5. If the value of Flag is equal to 5, S31 is executed continuously; if the value of Flag is not equal to 5, S4 is executed continuously.
[0065] S31: The SBL is authenticated and loaded, and S32 is executed continuously.
[0066] S32: It is judged whether the SBL authentication and loading are successful. If the SBL authentication or loading fails, S321 is executed continuously; if the SBL authentication and loading are successful, S322 is executed continuously.
[0067] S321: The value of Flag is set to 6, and S325 is executed continuously.
[0068] S322: It is judged whether the values of Sync and Flag are equal. If the values of Sync and Flag are equal, S33 is executed continuously; if the values of Sync and Flag are not equal, S323 is executed continuously.
[0069] S323: It is judged whether the value of Def is equal to 3. If the value of Def is equal to 3, S324 is executed continuously; if the value of Def is not equal to 3, S33 is executed continuously.
[0070] S324: The value of Flag is assigned using the value of Sync, the value of Def is set to 0, and S325 is executed continuously.
[0071] S325: The system is restarted, and S2 is executed continuously.
[0072] S33: authenticating and loading Uboot, and continuing to perform S34.
[0073] S34: judging whether the authentication and loading of Uboot are successful, if the authentication or loading of Uboot fails, continuing to perform S341, if the authentication and loading of Uboot are successful, continuing to perform S342.
[0074] S341: setting the value of Flag as 6, setting the value of Sync as 6, setting the value of Def as 0, and continuing to perform S325.
[0075] S342: setting the value of Def as 0, and continuing to perform S35.
[0076] S35: authenticating and loading Kernel, and continuing to perform S36.
[0077] S36: judging whether the authentication and loading of Kernel are successful, if the authentication or loading of Kernel fails, continuing to perform S361, if the authentication and loading of Kernel are successful, continuing to perform S37.
[0078] S361: setting the value of Flag as 6, setting the value of Sync as 6, and continuing to perform S325.
[0079] S37: authenticating and loading Rootfs, and continuing to perform S38.
[0080] S38: judging whether the authentication and loading of Rootfs are successful, if the authentication or loading of Rootfs fails, continuing to perform S361, if the authentication and loading of Rootfs are successful, continuing to perform S6.
[0081] S4: judging whether the value of Flag is equal to 6 during the running of PBL, if the value of Flag is equal to 6, continuing to perform S41, if the value of Flag is not equal to 6, performing S5.
[0082] S41: authenticating and loading SBL1, and continuing to perform S42.
[0083] S42: judging whether the authentication and loading of SBL1 are successful, if the authentication or loading of SBL1 fails, continuing to perform S421, if the authentication and loading of SBL1 are successful, continuing to perform S422.
[0084] S421: setting the value of Flag as 5, and continuing to perform S425.
[0085] S422: judge whether the value of Sync and Flag is equal, if the value of Sync and Flag is equal, continue to execute S43, if the value of Sync and Flag is not equal, continue to execute S423.
[0086] S423: judge whether the value of Def is equal to 3, if the value of Def is equal to 3, continue to execute S424, if the value of Def is not equal to 3, continue to execute S43.
[0087] S424: use the value of Sync to assign value to Flag, and set the value of Def to 0, and continue to execute S425.
[0088] S425: restart the system, and continue to execute S2.
[0089] S43: authenticate and load Ubootl, and continue to execute S44.
[0090] S44: judge whether the authentication and loading of Ubootl is successful, if the authentication or loading of Ubootl fails, continue to execute S441, if the authentication and loading of Ubootl is successful, continue to execute S442.
[0091] S441: set the value of Flag to 5, set the value of Sync to 5, set the value of Def to 0, and continue to execute S425.
[0092] S442: set the value of Def to 0, and continue to execute S45.
[0093] S45: authenticate and load Kernell, and continue to execute S46.
[0094] S46: judge whether the authentication and loading of Kernell is successful, if the authentication or loading of Kernell fails, continue to execute S461, if the authentication and loading of Kernell is successful, continue to execute S47.
[0095] S461: set the value of Flag to 5, set the value of Sync to 5, and continue to execute S425.
[0096] S47: authenticate and load Rootfsl, and continue to execute S48.
[0097] S48: judge whether the authentication and loading of Rootfsl is successful, if the authentication or loading of Rootfsl fails, continue to execute S461, if the authentication and loading of Rootfsl is successful, continue to execute S6.
[0098] S5: Set the value of Flag to 5, set the value of Def to 3, and continue to execute S31.
[0099] S6: The system is successfully started.
[0100] It should be noted that, Figure 2 The "==" involved in the present disclosure is used to judge whether the variables or constants on both sides of the symbol are equal, and the "=" is used to assign the variable or constant on the right side of the symbol to the variable on the left side of the symbol.
[0101] In a second aspect, referring to the drawings Figure 4 The present disclosure provides a terminal structure diagram, which comprises:
[0102] one or more processors 401;
[0103] a memory 402, which stores one or more programs, when the one or more programs are executed by the one or more processors 401, the one or more processors 401 implement the above-mentioned first aspect and any one of the possible embodiments in the first aspect;
[0104] one or more I / O interfaces 403, which are located between the processor 401 and the memory 402, and are configured to realize the information interaction between the processor 401 and the memory 402.
[0105] Among them, the processor 401 is a device with data processing capability, including but not limited to central processing unit (CPU) and the like; the memory 402 is a device with data storage capability, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) 403 is located between the processor 401 and the memory 402, and can realize the information interaction between the processor 401 and the memory 402.
[0106] In some embodiments, the processor 401, the memory 402 and the I / O interface 403 are connected with each other through the bus 404, and further connected with other components of the computing device.
[0107] In a third aspect, the present disclosure provides a computer readable medium, which stores a computer program, and the computer program is executed by the processor to realize the first aspect and any one of the possible embodiments in the first aspect.
[0108] In a fourth aspect, the present disclosure provides a computer program product, which comprises a computer program, and the computer program is executed by the processor to realize the first aspect and any one of the possible embodiments in the first aspect.
[0109] Those of ordinary skill in the art will understand that the functional modules / units in all or some of the steps, systems, apparatuses disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof.
[0110] In hardware implementation, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component can have multiple functions, or one function or step can be performed by several physical components in cooperation.
[0111] Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit (CPU), a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on computer readable media, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media include, but are not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), FLASH memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile discs (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, any other medium that can be used to store the desired information and that can be accessed by a computer. Further, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. As a non-limiting example, the foregoing example of a non-transitory medium is merely meant to illustrate that such can be embodied in a computer program, i.e., software, that is downloaded to or accessed from one or more computer storage media or communication media.
[0112] The present disclosure has disclosed example embodiments, and although the specific terms are employed, they are used in a generic sense only and should not be construed to be limited to the specific embodiments described herein. In some instances, it will be readily apparent to those skilled in the art that a feature, characteristic or element described in connection with a particular embodiment can be used in conjunction with other embodiments unless expressly stated otherwise. Accordingly, it will be understood that various changes in form and details can be made without departing from the scope of the disclosure as set forth in the appended claims.
Claims
1. A system startup method applied to a terminal, the terminal comprising a first system and a second system, the method comprising: During the startup process of the first system, it is determined whether any of the multiple startup stages included in the first system have failed to start. If it is determined that any one of the multiple startup stages included in the first system has failed to start, the first system has failed to start, and the second system is started.
2. The method according to claim 1, wherein, Before determining whether any of the multiple startup stages included in the first system fail during the startup process, the method further includes: Obtain a preset first flag bit, wherein the preset first flag bit is used to indicate the start of the first system or the second system.
3. The method according to claim 2, wherein, The preset first flag bit is set to a first value to indicate the start of the first system, and the preset first flag bit is set to a second value to indicate the start of the second system; After determining that the first system has failed to start, the method further includes: The value of the preset first flag bit is updated from the first value to the second value; Starting the second system includes: The second system is started based on the updated value of the preset first flag.
4. The method according to claim 3, wherein, The method further includes: If it is determined that the current startup phase among the multiple startup phases included in the first system has started successfully, the backup flag bit of the preset first flag bit is obtained; The preset first flag bit and the backup flag bit are assigned values synchronously, and the backup flag bit is used to assign a value to the preset first flag bit when the preset first flag bit has been reset. Determine whether the values of the preset first flag bit and the backup flag bit are equal; If the values of the preset first flag bit and the backup flag bit are equal, the next startup phase of the current startup phase is started.
5. The method according to claim 4, wherein, The method further includes: If the values of the preset first flag bit and the backup flag bit are not equal, determine whether the preset first flag bit has been reset; If it is determined that the preset first flag bit has been reset, the value of the backup flag bit is used to assign a value to the preset first flag bit; If it is determined that the preset first flag bit has not been reset, the next startup phase of the current startup phase is started.
6. The method according to claim 4, wherein, After determining that the first system has failed to start, the method further includes: The backup flag bit and the preset first flag bit are synchronized and updated from the first value to the second value.
7. The method according to claim 5, wherein, Determining whether the preset first flag has been reset includes: Obtain a preset second flag bit, wherein the preset second flag bit is used to indicate whether the first preset flag has been reset; Based on the preset second flag, determine whether the preset first flag has been reset.
8. The method according to claim 7, wherein, The preset second flag bit is set to a third value to indicate that the first preset identifier has been reset, and the preset second flag bit is set to a fourth value to indicate that the first preset identifier has not been reset. Determining whether the preset first flag has been reset based on the preset second flag includes: If the value of the preset second flag is a third value, it is determined that the first preset flag has been reset; If the value of the preset second flag is the fourth value, it is determined that the first preset flag has not been reset; After determining that the preset first flag has been reset, and assigning a value to the preset first flag using the value of the backup flag, the method further includes: The value of the preset second flag bit is updated from the third value to the fourth value.
9. The method according to claim 8, wherein, Before determining whether any of the multiple startup stages included in the first system fail during the startup process, the method further includes: The first system is activated when the preset first flag bit is set to the first value. If the preset first flag value is the second value, the second system is started. The method further includes: If the value of the preset first flag bit is neither the first value nor the second value, the value of the preset second flag bit is set to the third value.
10. The method according to any one of claims 1 to 9, wherein, The first system and the second system may be the same or different systems, and the first system and the second system share at least one of the plurality of startup phases.
11. A terminal, wherein, It includes a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements the method according to any one of claims 1 to 10.
12. A computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method according to any one of claims 1 to 10.
13. A computer program product comprising a computer program, wherein, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 10.