System starting method and device, computer equipment and storage medium
By determining the status identifier and feature identifier during the system startup phase and selecting available system partitions for startup, the unreliability problems caused by file system corruption, incomplete software or bugs during the system startup process are solved, and a higher system startup is achieved reliability.
Patent Information
- Application Number
- CN202411580634.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-18
AI Technical Summary
During the startup process, existing systems are prone to fail to start normally due to file system corruption, incomplete system software code or bugs after upgrading, resulting in unstable system startup.
By determining the status identifier of the previous startup stage during the system startup stage, if the status identifier is startup failure, the failed system partition is determined based on the feature identifier, and the target system partition is selected from other system partitions for system startup, updating the status identifier and feature identifier to ensure the reliability of subsequent startup.
This method can avoid the system files of the failed system partition and reselect the available system partition for startup, thereby improving the reliability and stability of system startup.
Smart Images

Figure CN119473432A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular, to a system startup method, apparatus, computer equipment and storage medium. Background Art
[0002] After an electronic device is turned on, the system is started by the system files pre-configured in the device. The following situations are prone to occur when the system is started: In the first situation, sudden power outages, aging of storage chips, etc. cause file system damage, resulting in the system being unable to start normally; In the second situation, the system is powered off during the upgrade process, resulting in incomplete system software code, etc., resulting in the system being unable to start normally; In the third situation, the upgraded system software code itself has bugs (vulnerabilities), resulting in the system being unable to start after the upgrade.
[0003] Therefore, a system startup method with higher reliability is urgently needed. Summary of the invention
[0004] Embodiments of the present application provide a system startup method, apparatus, computer device, and storage medium.
[0005] In a first aspect of an embodiment of the present application, a system startup method is provided, which is applied to a system startup device, wherein the system startup device includes at least a plurality of system partitions, each of which is configured with a system file, and the method includes:
[0006] In the current system startup phase, determine the status identifier of the previous system startup phase;
[0007] If the status identifier is startup failure, determining the failed system partition where the system file called in the previous system startup phase is located according to the feature identifier;
[0008] Selecting other system partitions except the failed system partition from the system partitions as target system partitions in the current system startup phase;
[0009] The target system file in the target system partition is called to start the system, and after the system is successful, the state identifier of the current system startup phase is updated to startup success, and the characteristic identifier of the system partition used in the current system startup phase is updated to the target system partition.
[0010] In an optional embodiment of the present application, the current system startup phase is a BootROM phase, and the step of determining the failed system partition where the system file called in the previous system startup phase is located according to the feature identifier includes:
[0011] Performing a read operation on the status identifier, and determining the failed system partition according to a value of the status identifier;
[0012] Correspondingly, after the system is successfully started, the state identifier of the current system startup phase is updated to startup success, and the characteristic identifier of the system partition used in the current system startup phase is updated to the target system partition, including:
[0013] Performing a write operation on the status flag to update the status flag in the BootROM stage to startup success;
[0014] The characteristic identifier of the BootROM stage is updated to a first partition value corresponding to the target system partition.
[0015] In an optional embodiment of the present application, the system startup method further includes:
[0016] If the crc32 verification image fails in the BootROM stage, the characteristic identifier of the BootROM stage is updated to other system partitions except the target system partition.
[0017] In an optional embodiment of the present application, the current system startup phase is the startup bl1 phase, and the characteristic identifier of the system partition used in the current system startup phase is a non-target system partition; the method further includes:
[0018] If the system fails to start, the hardware timer is called to trigger a processor reset; wherein the processor reset calls the non-target system partition, and after the system starts successfully again, the characteristic identifier of the system partition used in the current system startup phase is modified to the target system partition.
[0019] In an optional embodiment of the present application, the current system startup phase is a uboot startup phase, and calling the target system file in the target system partition to start the system includes:
[0020] Call the kernel, dtb, and ramdisk in the target system partition to start uboot and jump to the linux address.
[0021] In an optional embodiment of the present application, the current system startup phase is a Linux, ramdisk startup phase, and the updating of the status identifier of the current system startup phase to a startup success, and the updating of the characteristic identifier of the system partition used in the current system startup phase to the target system partition, include:
[0022] A read operation is performed on the characteristic identifier, and a correction value of the state identifier is determined according to the value of the characteristic identifier.
[0023] In an optional embodiment of the present application, the system startup method further includes:
[0024] If the first startup duration of the current system startup phase is greater than the first preset threshold, or the second startup duration between the current moment and the system startup triggering moment is greater than the second preset threshold, the hardware timer is triggered to reset the processor.
[0025] According to a second aspect of an embodiment of the present application, a system startup device is provided, which is applied to a system startup device, wherein the system startup device includes at least a plurality of system partitions, each of which is configured with a system file, and the device includes:
[0026] A first determination module is used to determine the status identifier of the previous system startup phase in the current system startup phase;
[0027] A second determination module is used to determine the failed system partition where the system file called in the previous system startup phase is located according to the feature identifier if the status identifier is a startup failure;
[0028] A selection module, used for selecting other system partitions except the failed system partition from the system partitions as the target system partition in the current system startup phase;
[0029] The startup module is used to call the target system file in the target system partition to start the system, and after the system succeeds, update the status identifier of the current system startup stage to startup success, and update the feature identifier of the system partition used in the current system startup stage to the target system partition.
[0030] According to a third aspect of an embodiment of the present application, a computer device is provided, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above methods when executing the computer program.
[0031] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of any of the above methods when executed by a processor.
[0032] In the first aspect, the system startup method provided by the embodiment of the present application is applied to a system startup device, and the system startup device includes at least multiple system partitions, and each system partition is configured with a system file. In the current system startup phase, the status identifier of the previous system startup phase is determined; if the status identifier is a startup failure, the failed system partition where the system file called in the previous system startup phase is located is determined according to the feature identifier; other system partitions except the failed system partition are selected from each of the system partitions as the target system partition for the current system startup phase; in this way, the system files of the failed system partition used in the previous system startup phase can be avoided, and other system partitions except the failed system partition can be reselected as the target system partition for the current system startup phase as the system file partition for the current system startup, thereby ensuring that the current system startup phase can be started smoothly, thereby providing a system startup method with higher reliability.
[0033] On the second aspect, after the system startup method provided in the embodiment of the present application successfully calls the target system file in the target system partition to start the system, the status identifier of the current system startup stage is updated to a successful startup, and the characteristic identifier of the system partition used in the current system startup stage is updated to the target system partition, so that the subsequent system startup stage can continue to call the available target system partition, ensuring that the subsequent system startup stage can be started smoothly, thereby providing a system startup method with higher reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0035] Figure 1 A schematic diagram of an application scenario of a system startup method provided by an embodiment of the present application;
[0036] Figure 2 A flowchart of a system startup method provided by an embodiment of the present application;
[0037] Figure 3 A flow chart of the system startup method in the BootROM stage provided by one embodiment of the present application;
[0038] Figure 4 A flow chart of the system startup method in the bl1 stage provided by an embodiment of the present application;
[0039] Figure 5 A flow chart of the system startup method in the uboot stage provided by an embodiment of the present application;
[0040] Figure 6 A flow chart of the system startup method provided by an embodiment of the present application in the Linux and RAM disk stages;
[0041] Figure 7 An interactive diagram of a system startup device timeout process of a system startup method provided by an embodiment of the present application;
[0042] Figure 8 A schematic diagram of the structure of a system startup device provided in one embodiment of the present application;
[0043] Fig. 9 A schematic diagram of the computer device structure provided for one embodiment of the present application. DETAILED DESCRIPTION
[0044] In the process of implementing the present application, the inventors found that there is an urgent need for a system startup method with higher reliability.
[0045] In response to the above problems, embodiments of the present application provide a system startup method, apparatus, computer device and storage medium.
[0046] The solutions in the embodiments of the present application can be implemented using various computer languages, for example, the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0047] In order to make the technical solutions and advantages in the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0048] The following is a brief description of the application environment of the system startup method provided in the embodiment of the present application:
[0049] See also Figure 1The system startup method provided in the embodiment of the present application is applied to the system startup device, which includes: SOC ROM (System on a Chip read only memory) eMMC (Embedded Multi Media Card, a non-volatile memory device) and DDR (Double Data Rate Synchronous Dynamic Random Access Memory). The system startup includes at least four stages: BootROM stage, bl1 stage, uboot stage, linux stage, and ramdisk stage. In each startup stage, the corresponding system file needs to be called. Of course, the system startup can also include other startup stages, which will not be repeated here. Figure 1 As shown, the system files required for BootROM system startup are stored in the SOC ROM area and run in ROM; the system files for starting the bl1 stage, starting the uboot.bin stage, starting linux, and the ramdisk stage are stored in the eMMC, among which the system files for the bl1 stage are loaded and run in SRAM (Static Random-Access Memory), and the system files for the uboot.bin stage, linux, and ramdisk stages are loaded and run in DDR.
[0050] The system startup device in the embodiment of the present application includes at least a plurality of system partitions. In order to more clearly explain the system startup method provided in the embodiment of the present application, the following embodiment takes two system partitions as an example, for example, including a primary partition (characteristic identifier is recorded as 0) and a backup partition (characteristic identifier is recorded as 1). Among them, the SRAM address of the status identifier can be, for example, 0x20000004, the SRAM address of the characteristic identifier can be 0x20000008, and the status identifier is used to characterize the success or failure of the startup of each system startup stage, including two states of successful update (for example, recorded as 0) and failed update (for example, recorded as 1); the characteristic identifier is used to characterize the system partition, and each partition stores system files. As above, taking two system partitions as an example, the primary partition (characteristic identifier is recorded as 0), the backup partition (characteristic identifier is recorded as 1), and so on, is used to distinguish between each system partition.
[0051] In the embodiment of the present application, the startup stages involved in the status identification include: write operations in the bl1 stage and the Linux stage, and read operations in the BootROM stage. The startup stages involved in the feature identification include: write operations in the BootROM stage, and read operations in the BootROM stage, bl1, uboot stage, and Linux stage. At the same time, when the loading check bl1 fails in the Bootrom stage, another partition can be directly switched to load internally without relying on the watchdog (a watchdog timer is a hardware timer used to monitor the operating status of the system and take measures to restore normal operation when a fault or deadlock occurs; the main function of the watchdog is to regularly check whether the system is running normally, and trigger a reset operation when a problem occurs in the system to prevent the system from crashing or the program from running away) and the CPU (processor reset. The startup of other stages other than Bootrom relies on the watchdog and CPU reset to switch the backup partition. The feature identification and status identification are stored in the SRAM. The data will not be lost after the soft reset of the CPU. The data will be lost after the chip loses power. The main and standby startup methods use the soft reset of the CPU.
[0052] The following is a brief explanation of the English terms and computer terms involved in the embodiments of the present application:
[0053] watchdog: watchdogtimer, watchdog timer, is a hardware timer used to monitor the operating status of the system and take measures to restore normal operation when a fault or deadlock occurs; the main function of the watchdog is to regularly check whether the system is operating normally, and trigger a reset operation when a problem occurs in the system to prevent the system from crashing or the program from running away.
[0054] git: An open source distributed version control system that can effectively and efficiently handle version management from small to large projects.
[0055] CPU: Central Processing Unit is a chip inside the computer that is responsible for executing instructions and controlling the computer's operations.
[0056] BootROM: Boot Read-Only Memory, a read-only memory used to store the boot program.
[0057] bl1: bootloader1, BL1 is part of the secure boot process and is the firmware program that needs to be run in the next stage after bootrom is started.
[0058] bl1.bin: Unsigned bl1 boot firmware.
[0059] sign-bl1.bin: signed bl1 boot firmware.
[0060] uboot: Universal Boot Loader, a universal boot loader, is a bare metal code used to execute the boot kernel.
[0061] uboot.bin: uboot firmware.
[0062] kernel: core, usually refers to the core part of the operating system.
[0063] dtb: DeviceTree Blob, a binary file used to describe the data structure of hardware devices.
[0064] CMD: Command-Line Interface, a command line interface, is a command line tool that allows users to interact with the computer by typing commands.
[0065] crc32: 32bit Cyclic Redundancy Check, 32-bit cyclic redundancy check, is a verification algorithm used for data integrity checking.
[0066] Ramdisk: Also known as virtual memory disk or memory disk, it is a technology that simulates a part of computer memory (RAM) as a hard disk through software.
[0067] linux: is a UNIX-like operating system that is free to use and freely distributed.
[0068] SOC: System on a Chip, system-level chip, also known as system on chip.
[0069] eMMC: Embedded Multi Media Card, is a non-volatile storage device designed for embedded systems.
[0070] SRAM: Static Random-Access Memory.
[0071] DDR: Double Data Rate Synchronous Dynamic Random Access Memory, double data rate synchronous dynamic random access memory.
[0072] BootROM Code: An initialization code in the read-only memory (ROM) integrated on the chip, which is executed first after the system is powered on.
[0073] See also Figure 2 and Figure 3The following embodiments take the above-mentioned system startup device as the execution subject, and apply the method provided in the embodiment of the present application to the above-mentioned system startup device to start the system as an example for specific description. The system startup method provided in the embodiment of the present application includes the following steps 201-204:
[0074] Step 201, in the current system startup phase, determining the status identifier of the previous system startup phase;
[0075] Step 202: If the status identifier is startup failure, determine the failed system partition where the system file called in the previous system startup phase is located according to the feature identifier;
[0076] Step 203: Selecting other system partitions except the failed system partition from the system partitions as the target system partition in the current system startup phase;
[0077] Step 204, calling the target system file in the target system partition to start the system, and after the system succeeds, updating the status identifier of the current system startup phase to startup success, and updating the characteristic identifier of the system partition used in the current system startup phase to the target system partition.
[0078] In the first aspect, the system startup method provided by the embodiment of the present application is applied to a system startup device, and the system startup device includes at least multiple system partitions, and each system partition is configured with a system file. In the current system startup phase, the status identifier of the previous system startup phase is determined; if the status identifier is a startup failure, the failed system partition where the system file called in the previous system startup phase is located is determined according to the feature identifier; other system partitions except the failed system partition are selected from each of the system partitions as the target system partition for the current system startup phase; in this way, the system files of the failed system partition used in the previous system startup phase can be avoided, and other system partitions except the failed system partition can be reselected as the target system partition for the current system startup phase as the system file partition for the current system startup, thereby ensuring that the current system startup phase can be started smoothly, thereby providing a system startup method with higher reliability.
[0079] On the second aspect, after the system startup method provided in the embodiment of the present application successfully calls the target system file in the target system partition to start the system, the status identifier of the current system startup stage is updated to a successful startup, and the characteristic identifier of the system partition used in the current system startup stage is updated to the target system partition, so that the subsequent system startup stage can continue to call the available target system partition, ensuring that the subsequent system startup stage can be started smoothly, thereby providing a system startup method with higher reliability.
[0080] See also Figure 3 In an optional embodiment of the present application, the current system startup phase is the BootROM phase, and the above step 202, the step of determining the failed system partition where the system file called in the previous system startup phase is located according to the feature identifier, includes the following steps:
[0081] Performing a read operation on the status identifier, and determining the failed system partition according to a value of the status identifier;
[0082] like Figure 3 This is a startup flowchart of the BootROM stage (the main functions include initializing hardware, loading and starting the operating system or boot loader). In the BootROM stage, it is ensured that the processor fails to start in the BootROM stage, resulting in the inability to load and run the image of the next stage, and a feature identifier is provided for the next stage to indicate which system partition to select in the system partition in the next system startup stage.
[0083] like Figure 3 As shown, in the BootROM stage, the status flag is read, and the partition flag that needs to be loaded currently is determined according to the value of the status flag, such as the primary partition (partition 0).
[0084] Correspondingly, the above step 204, in which the status identifier of the current system startup phase is updated to startup success after the system is successfully started, and the characteristic identifier of the system partition used in the current system startup phase is updated to the target system partition, includes the following steps:
[0085] Performing a write operation on the status flag to update the status flag in the BootROM stage to startup success;
[0086] The characteristic identifier of the BootROM stage is updated to a first partition value corresponding to the target system partition.
[0087] like Figure 3 As shown, in the BootROM stage, the feature identifier is written and the feature identifier is used to record the partition mark currently loaded, such as partition 0 (primary partition).
[0088] The embodiment of the present application performs a read operation on the status identifier and determines the failed system partition according to the value of the status identifier, thereby facilitating the determination of the target system partition that can be called normally, thereby ensuring the normal startup of the BootROM stage; at the same time, after the system is updated successfully, a write operation is performed on the status identifier to update the status identifier of the BootROM stage to a successful startup; the feature identifier of the BootROM stage is updated to the first partition value corresponding to the target system partition, so that the next system startup stage can judge the startup state of the BootROM stage according to the status identifier, and judge the target system partition used in the BootROM stage according to the status identifier, thereby more accurately determining the system partition used in the next system startup stage, thereby ensuring that the entire system can be started smoothly with higher reliability.
[0089] Please continue to see Figure 3 In an optional embodiment of the present application, the system startup method further includes:
[0090] If the crc32 verification image fails in the BootROM stage, the characteristic identifier of the BootROM stage is updated to other system partitions except the target system partition.
[0091] like Figure 3 As shown, in the BootROM stage, if the crc32 image verification is successful, it will directly jump to the next startup stage, for example Figure 3 In the bl1.bin phase, the signature is verified and the jump to the bl1.bin phase is performed; if the crc32 verification image fails, the characteristic identifier is used to record another partition mark, such as partition 1, and partition 1 (backup partition) is loaded to facilitate the next startup phase to avoid the system partition used at that time and select other system partitions for startup. At the same time, it can also stop at the current CMD (Command-Line Interface) and wait for the operation and maintenance personnel to intervene.
[0092] See also Figure 4 In an optional embodiment of the present application, the current system startup phase is the startup bl1 phase, and the characteristic identifier of the system partition used in the current system startup phase is a non-target system partition; the method further includes:
[0093] If the system fails to start, the hardware timer is called to trigger the processor reset;
[0094] The processor resets and calls the non-target system partition, and after the system is successfully restarted, modifies the characteristic identifier of the system partition used in the current system startup phase to the target system partition.
[0095] See also Figure 4 , Figure 4 The flowchart for starting the bl1 stage ensures that the processor fails to start in the bl1 stage and cannot load and run the next stage, and modifies the status flag to indicate the startup process. Figure 4 As shown in Figure 1, a hardware timer (such as a watchdog) can be enabled in the bl1 stage. After the hardware timer is enabled, any boot failure caused by any reason will cause the hardware timer to time out and trigger a processor reset. After the processor is reset, the system file will be loaded from the new partition to continue the system boot. Figure 4 As shown, when the status identifier is written in the bl1 stage, the non-current partition (that is, the non-target system partition) is written. This is the other partition number (non-current partition) that needs to be started after the startup exception processor is reset; for example, if the target system partition feature identifier is partition 0 (target system partition), then the write feature identifier is partition 1 (non-target system partition). On the contrary, when the feature identifier is partition 1 (target system partition), then the write feature identifier is partition 0 (non-target system partition). If the CPU fails to start partition 0, the hardware timer is called to trigger the processor reset after the failure. After the processor is reset, the non-target system partition should be started; when the entire system is started, the status identifier will be corrected in the last stage, indicating that the system of the current partition is started normally, and this partition (target system partition) will still be loaded and run first after the system is reset. As shown Figure 4 As shown, in the bl1 stage, the characteristic identifier is read and the partition flag that needs to be loaded currently is determined according to the value of the characteristic identifier, such as partition 0 (primary partition) or partition 1 (backup partition).
[0096] In the event of a system startup failure, the embodiment of the present application calls a hardware timer to trigger a processor reset, wherein the processor reset calls the non-target system partition, and after the system successfully starts again, modifies the characteristic identifier of the system partition used in the current system startup phase to the target system partition.
[0097] See also Figure 5 In an optional embodiment of the present application, the current system startup phase is the uboot startup phase, and the target system file in the target system partition is called to start the system, including:
[0098] Call the kernel, dtb, and ramdisk in the target system partition to start uboot and jump to the linux address.
[0099] See also Figure 5 , Figure 5It is a system startup flow chart of the uboot stage, which starts uboot (Universal Boot Loader, a bare metal code used to execute the startup kernel) by calling the kernel (the core part of the system), dtb (DeviceTree Blob, a binary file used to describe the data structure of hardware devices), and ramdisk (also known as virtual memory disk or memory disk, which is a technology that simulates a part of computer memory (RAM) as a hard disk through software) in the target system partition, and jumps to the linux (a free to use and free dissemination UNIX-like operating system) address.
[0100] The embodiment of the present application determines the startup status of the previous startup stage through the status identifier in the uboot stage, thereby determining whether the system partition used in the previous startup stage can be used in the state, and determines the partition flag that currently needs to be loaded according to the feature identifier of the previous startup stage, such as partition 0 (primary partition), thereby ensuring that the current uboot stage can be started normally, and then ensuring the normal startup of the entire system, further improving the reliability of the system startup method provided by the embodiment of the present application.
[0101] See also Figure 6 The interactive flow chart of the Linux and ramdisk startup phases is shown in FIG. 1 . In an optional embodiment of the present application, the current system startup phase is the Linux and ramdisk startup phase. Then, in step 204, the state identifier of the current system startup phase is updated to indicate successful startup, and the characteristic identifier of the system partition used in the current system startup phase is updated to the target system partition, including:
[0102] A read operation is performed on the characteristic identifier, and a correction value of the state identifier is determined according to the value of the characteristic identifier.
[0103] The hardware timer can be turned off during the Linux and ramdisk startup phase to avoid triggering a processor reset and ensure a smooth startup of the Linux and ramdisk phases. Figure 6 As shown, at the end of the normal system startup, the status flag is written (correcting the write operation of the status flag in the bl1 stage, indicating that the normal startup is completed), and the current startup partition (i.e., the target system partition) is written, and the corresponding status flag is updated to normal startup or abnormal startup. If the current startup is completed normally, it means that the current partition system file (the system file of the target system partition) is normal, and when the system is reset normally, the system file of this target system partition is still loaded and run first. This solves the problem of the processor failing to start in the system stage and causing it to fail to run normally, and ensures the normal startup of the Linux and ramdisk stages.
[0104] See also Figure 7 , Figure 7 This is a diagram of the system startup device timeout process interaction. In an optional embodiment of the present application, the system startup method further includes:
[0105] If the first startup duration of the current system startup phase is greater than the first preset threshold, or the second startup duration between the current moment and the system startup triggering moment is greater than the second preset threshold, the hardware timer is triggered to reset the processor.
[0106] Among them, the second preset threshold can be the triggering duration of the hardware timer (such as watchdog), that is, when the second startup duration of the system started based on the system startup method provided in the embodiment of the present application is greater than the second preset threshold, for example, when the CPU is stuck or runs away during the mirror running in the entire system startup stage, the hardware timer is triggered to reset the processor when the system startup fails, so as to solve the problem that the processor cannot run normally and cannot be accessed after the system startup fails, and the system is restarted, thereby ensuring the reliability of the system startup.
[0107] At the same time, for each system startup phase, such as Figure 7 When starting up in the BootROM stage, bl1 stage, uboot stage, linux stage, and ramdisk stage in the above embodiments, the same method can be adopted, by comparing the first startup duration of each startup stage with each first preset threshold value, so as to trigger the hardware timer to reset the processor when the system startup fails, so as to solve the problem that the processor cannot run normally and cannot be accessed after the system startup fails, restart the system, and thus ensure the reliability of system startup.
[0108] Finally, after the system starts normally, turn off the hardware timer (such as watchdog) to prevent the hardware timer from being triggered autonomously and affecting the normal operation of the system.
[0109] The system startup device is used to start each system startup stage. During the system startup process, the clock frequencies of each system startup stage are different. The clock frequency is mainly controlled and output by a voltage-controlled oscillator output frequency control circuit. The voltage-controlled oscillator output frequency control circuit at least includes a voltage-controlled oscillator, a processor, and a phase-locked loop circuit. The control process of the clock frequency of each system startup stage at least includes:
[0110] The processor receives a specific fluctuation frequency signal sent by the voltage-controlled oscillator, and records the number of clocks of the specific fluctuation frequency signal;
[0111] The processor reads the clock quantity when the specific fluctuation frequency signal and the second pulse sent by the GPS receiver are phase-locked in the phase-locked loop circuit;
[0112] When the number of clocks does not meet a preset value, the processor adjusts the control voltage of the voltage-controlled oscillator based on the number of clocks to achieve control over the output frequency until the number of clocks meets the preset value.
[0113] In an optional embodiment of the present application, when the number of clocks does not meet a preset value, the processor adjusts the control voltage of the voltage-controlled oscillator based on the number of clocks to achieve control of the output frequency until the number of clocks meets the preset value, including:
[0114] When the clock quantity is greater than the preset value, the processor dynamically controls the control voltage of the voltage-controlled oscillator to decrease until the clock quantity meets the preset value;
[0115] When the clock quantity is less than the preset value, the processor dynamically controls the control voltage of the voltage-controlled oscillator to increase until the clock quantity meets the preset value.
[0116] In an optional embodiment of the present application, the above method further includes:
[0117] If the clock quantity meets the preset value, the processor determines that there is no phase deviation between the specific fluctuation frequency output by the voltage-controlled oscillator and the second pulse.
[0118] In an optional embodiment of the present application, when the specific fluctuation frequency signal and the second pulse emitted by the GPS receiver are phase-locked in the phase-locked loop circuit, the processor reads the clock quantity, including:
[0119] The processor performs phase locking on the specific fluctuation frequency signal and the second pulse emitted by the GPS receiver through the phase detector, loop filter, and target voltage-controlled oscillator in the phase-locked loop circuit, and reads the clock quantity to lock the specific fluctuation frequency;
[0120] The processor reads the clock quantity.
[0121] In an optional embodiment of the present application, the voltage-controlled oscillator output frequency control circuit further includes a GPS receiver, and the method further includes:
[0122] The GPS receiver receives GPS signals and sends pulse per second to the processor based on the onboard receiver.
[0123] In an optional embodiment of the present application, the voltage-controlled oscillator output frequency control circuit further includes a clock buffer, and the method further includes:
[0124] The clock buffer receives a specific fluctuation frequency signal sent by the voltage-controlled oscillator, copies the specific fluctuation frequency signal into multiple clocks with the same frequency and phase, and sends the multiple clocks to the processor and the phase-locked loop circuit respectively.
[0125] In an optional embodiment of the present application, the processor includes a counting deviation calculation module and an output frequency adjustment module, the counting deviation calculation module is used to detect the deviation between the clock number and the preset value, and the output frequency adjustment module is used to adjust the control voltage of the voltage-controlled oscillator based on the clock number to achieve control of the output frequency when the clock number does not meet the preset value, until the clock number meets the preset value.
[0126] It should be understood that, although the various steps in the flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0127] See also Figure 8 An embodiment of the present application provides a system startup device 800, which is applied to a system startup device, wherein the system startup device includes at least a plurality of system partitions, each of which is configured with a system file, and the device 800 includes:
[0128] A first determining module 810 is used to determine the state identifier of the previous system startup phase in the current system startup phase;
[0129] The second determination module 820 is used to determine the failed system partition where the system file called in the previous system startup phase is located according to the feature identifier if the status identifier is startup failure;
[0130] A selection module 830, configured to select other system partitions except the failed system partition from the system partitions as target system partitions in the current system startup phase;
[0131] The startup module 840 is used to call the target system file in the target system partition to start the system, and after the system succeeds, update the status identifier of the current system startup stage to startup success, and update the characteristic identifier of the system partition used in the current system startup stage to the target system partition.
[0132] In an optional embodiment of the present application, the current system startup stage is the BootROM stage, and the second determination module 820 is specifically used to perform a read operation on the status identifier and determine the failed system partition according to the value of the status identifier; correspondingly, the startup module 840 is specifically used to perform a write operation on the status identifier to update the status identifier of the BootROM stage to successful startup; and update the feature identifier of the BootROM stage to the first partition value corresponding to the target system partition.
[0133] In an optional embodiment of the present application, the selection module 830 is also used to update the feature identifier of the BootROM stage to other system partitions except the target system partition if the crc32 verification image fails in the BootROM stage.
[0134] In an optional embodiment of the present application, the current system startup stage is the startup bl1 stage, and the characteristic identifier of the system partition used in the current system startup stage is a non-target system partition; the startup module 840 is also used to call the hardware timer to trigger a processor reset if the system startup fails; wherein the processor reset calls the non-target system partition, and after the system successfully starts again, modifies the characteristic identifier of the system partition used in the current system startup stage to the target system partition.
[0135] In an optional embodiment of the present application, the current system startup phase is the uboot startup phase, and the startup module 840 is specifically used to call the kernel, dtb, and ramdisk in the target system partition to start uboot and jump to the linux address.
[0136] In an optional embodiment of the present application, the current system startup phase is a Linux and ramdisk startup phase, and the startup module 840 is specifically used to read the feature identifier and determine the correction value of the status identifier according to the value of the feature identifier.
[0137] In an optional embodiment of the present application, the startup module 840 is also used to trigger the hardware timer to reset the processor if the first startup duration of the current system startup phase is greater than the first preset threshold, or the second startup duration between the current moment and the system startup trigger moment is greater than the second preset threshold.
[0138] For the specific definition of the system startup device 800, please refer to the definition of the system startup method above, which will not be repeated here. Each module in the system startup device 800 can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0139] In one embodiment, a computer device is provided, the internal structure diagram of which can be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a system startup method as described above is implemented. It includes: a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, any step in the system startup method as described above is implemented.
[0140] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any step in the above system startup method can be implemented.
[0141] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0142] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0143] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0144] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0145] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0146] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A system startup method, characterized in that: Applied to a system boot device, the system boot device includes at least a plurality of system partitions, each of which is configured with a system file, the method includes: In the current system startup phase, determine the status identifier of the previous system startup phase; If the status identifier is startup failure, determining the failed system partition where the system file called in the previous system startup phase is located according to the feature identifier; Selecting other system partitions except the failed system partition from the system partitions as target system partitions in the current system startup phase; The target system file in the target system partition is called to start the system, and after the system is successful, the state identifier of the current system startup phase is updated to startup success, and the characteristic identifier of the system partition used in the current system startup phase is updated to the target system partition.
2. The system startup method according to claim 1, characterized in that: The current system startup phase is the BootROM phase, and the determining, according to the feature identifier, of the failed system partition where the system file called in the previous system startup phase is located includes: Performing a read operation on the status identifier, and determining the failed system partition according to a value of the status identifier; Correspondingly, after the system is successfully started, the state identifier of the current system startup phase is updated to startup success, and the characteristic identifier of the system partition used in the current system startup phase is updated to the target system partition, including: Performing a write operation on the status flag to update the status flag in the BootROM stage to startup success; The characteristic identifier of the BootROM stage is updated to a first partition value corresponding to the target system partition.
3. The system startup method according to claim 2, characterized in that: The method further comprises: If the crc32 verification image fails in the BootROM stage, the characteristic identifier of the BootROM stage is updated to other system partitions except the target system partition.
4. The system startup method according to claim 1, characterized in that: The current system startup phase is the startup bl1 phase, and the characteristic identifier of the system partition used in the current system startup phase is a non-target system partition; the method further includes: If the system fails to start, the hardware timer is called to trigger a processor reset; wherein the processor reset calls the non-target system partition, and after the system starts successfully again, the characteristic identifier of the system partition used in the current system startup phase is modified to the target system partition.
5. The system startup method according to claim 1, characterized in that: The current system startup phase is the uboot startup phase, and the target system file in the target system partition is called to start the system, including: Call the kernel, dtb, and ramdisk in the target system partition to start uboot and jump to the linux address.
6. The system startup method according to claim 1, characterized in that: The current system startup phase is a Linux and RAM disk startup phase, and the state identifier of the current system startup phase is updated to indicate successful startup, and the characteristic identifier of the system partition used in the current system startup phase is updated to the target system partition, including: A read operation is performed on the characteristic identifier, and a correction value of the state identifier is determined according to the value of the characteristic identifier.
7. The system startup method according to claim 1, characterized in that: The method further comprises: If the first startup duration of the current system startup phase is greater than the first preset threshold, or the second startup duration between the current moment and the system startup triggering moment is greater than the second preset threshold, the hardware timer is triggered to reset the processor.
8. A system startup device, characterized in that: Applied to a system startup device, the system startup device includes at least a plurality of system partitions, each of which is configured with a system file, and the device includes: A first determination module is used to determine the status identifier of the previous system startup phase in the current system startup phase; A second determination module is used to determine the failed system partition where the system file called in the previous system startup phase is located according to the feature identifier if the status identifier is a startup failure; A selection module, used for selecting other system partitions except the failed system partition from the system partitions as the target system partition in the current system startup phase; The startup module is used to call the target system file in the target system partition to start the system, and after the system succeeds, update the status identifier of the current system startup stage to startup success, and update the feature identifier of the system partition used in the current system startup stage to the target system partition.
9. A computer device comprising: The method comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Firmware loading method and device, electronic equipment and storage medium
CN120179321A