Electronic equipment starting method and device, equipment and storage medium
By detecting the clock data of the electronic device and the processor replacement status, and obtaining and using backup configuration parameters to start the electronic device, the problem of configuration reset after processor replacement is solved, and the configuration parameters recovery and user experience are improved.
Patent Information
- Application Number
- CN202411580488.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-03-28
AI Technical Summary
When the user removes or replaces the processor from the electronic device and starts the electronic device again, the configuration content such as startup sequence, security settings, and user custom settings will be reset to the default value, causing the user to need to reset it.
By detecting the clock data in the first memory of the electronic device, determining the fault status of the electronic device and the processor replacement status, obtaining the corresponding configuration parameters, and starting the electronic device using the backup configuration parameters to avoid losing the previous configuration.
Ensure that when the user starts the electronic device again after changing the processor, he can restore the previous configuration parameters, avoiding the user's reset, and improving the accuracy and user experience of electronic device startup.
Smart Images

Figure CN119718455A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a method, device, equipment and storage medium for starting an electronic device. Background Art
[0002] With the rapid development of science and technology, people are using electronic devices more and more frequently and relying on them more and more, and their functional requirements are becoming more and more refined and intelligent. This trend has made the effectiveness and accuracy of electronic devices during the startup process one of the important indicators to measure their performance.
[0003] Currently, when a user removes or replaces a processor from an electronic device for maintenance or upgrading purposes and then starts the electronic device again, the configuration contents of the electronic device startup, such as the startup sequence, security settings, user-defined settings, etc., will be reset to default values, requiring the user to readjust the settings of the electronic device after starting the electronic device. Summary of the invention
[0004] Embodiments of the present application provide a method, apparatus, device, and storage medium for starting an electronic device.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for starting an electronic device, comprising: determining a fault state of the electronic device by detecting clock data in a first memory of the electronic device; based on the clock data, obtaining a first configuration parameter required for starting the electronic device; based on the first configuration parameter, determining a replacement state of a first processor of the electronic device; when it is determined that the replacement state of the first processor is replaced and the fault state of the electronic device is no fault, obtaining a second configuration parameter required for starting the electronic device; the second configuration parameter is backup data of a third configuration parameter; the third configuration parameter is a configuration parameter used when the first processor is not replaced; the first processor is used to participate in the generation of clock data; and the electronic device is started based on the second configuration parameter.
[0007] It can be understood that the configuration parameters used when the electronic device is started are jointly determined by the fault state of the electronic device and the replacement state of the first memory of the electronic device. On the one hand, the fault state of the electronic device is determined by detecting the clock data in the first memory of the electronic device; based on the first configuration parameter, the replacement state of the first processor of the electronic device is determined; based on this, it is beneficial to improve the accuracy of determining the fault state of the electronic device and the replacement state of the first memory; on the other hand, the first configuration parameter is determined according to the clock data in the first memory of the electronic device, that is, whether the clock data in the first memory exists, the corresponding first configuration parameter is different, based on this, the flexibility of starting the electronic device in multiple scenarios is ensured; when it is determined that the replacement state of the first processor is replaced and the fault state of the electronic device is not faulty, the second configuration parameter pre-backed up by the electronic device before the first processor is replaced is used to start, avoiding the loss of the previous configuration parameters, so that when the user starts the electronic device again after replacing the first processor, the electronic device can restore the previous configuration parameters, avoiding the user to re-set the electronic device.
[0008] In a second aspect, an embodiment of the present application provides a starting device for an electronic device, comprising: a determination module, used to determine the fault state of the electronic device by detecting clock data in a first memory of the electronic device; and, based on the first configuration parameter, determine the replacement state of the first processor of the electronic device; an acquisition module, used to acquire the first configuration parameter required for starting the electronic device based on the clock data; and, when it is determined that the replacement state of the first processor is replaced and the fault state of the electronic device is no fault, acquire the second configuration parameter required for starting the electronic device; the second configuration parameter is backup data of the third configuration parameter; the third configuration parameter is the configuration parameter used when the first processor is not replaced; the first processor is used to participate in the generation of clock data; and a starting module, used to start the electronic device based on the second configuration parameter.
[0009] In a third aspect, an embodiment of the present application provides a startup device for an electronic device, comprising a memory and a processor, wherein the memory is used to store executable data instructions; when the processor is used to execute the executable data instructions stored in the memory, the steps in the above method are implemented.
[0010] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work, among which:
[0012] Figure 1 One of the flowcharts of a method for starting an electronic device provided in an embodiment of the present application;
[0013] Figure 2 A second flowchart of a method for starting an electronic device provided in an embodiment of the present application;
[0014] Figure 3 A third flowchart of a method for starting an electronic device provided in an embodiment of the present application;
[0015] Figure 4 A fourth flowchart of a method for starting an electronic device provided in an embodiment of the present application;
[0016] Figure 5 A fifth flowchart of a method for starting an electronic device provided in an embodiment of the present application;
[0017] Figure 6 A schematic diagram of a flow chart of an exemplary method for starting an electronic device provided in an embodiment of the present application;
[0018] Figure 7 A schematic diagram of the structure of a starting device of an electronic device provided in an embodiment of the present application;
[0019] Figure 8 A hardware entity schematic diagram of a startup device of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0021] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0022] It should be pointed out that the terms "first\second\third" involved in the embodiments of the present application are merely to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0023] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as the general understanding of those skilled in the art in the field to which the embodiments of the present application belong. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0024] In the related art, for highly integrated electronic devices, the clock circuit (RTC) is usually integrated into the system-level chip of the electronic device. While such a design improves the integration, it also causes a potential problem: when the user removes or replaces the processor of the electronic device for maintenance or upgrading purposes and then starts the electronic device again, the configuration content of the electronic device startup, such as the startup sequence, security settings, user-defined settings, etc., will be reset to the default values, requiring the user to re-adjust the settings of the electronic device.
[0025] The inventor of the present application has studied and analyzed this problem and found that: highly integrated electronic devices usually integrate the clock circuit into the system-level chip of the electronic device, and the processor in the system-level chip participates in the power supply of the RTC. When the user removes or replaces the processor in the system-level chip from the motherboard of the electronic device for maintenance or upgrade needs, the RTC circuit loses power supply, thereby affecting the state of the RTC in the system-level chip. When the electronic device is restarted after the processor is replaced, the electronic device loses the direct connection or synchronization mechanism with the clock circuit, and then loses the system date, time and user settings previously stored therein, so that the system information, security settings and user settings of the electronic device will be reset to the default values when the electronic device is restarted, so that the user needs to re-set and adjust the electronic device. Based on this, when the electronic device is restarted after the processor is replaced, the configuration parameters before the processor is replaced cannot be used.
[0026] The following is an illustrative introduction to the startup method, apparatus, device and storage medium of the electronic device provided in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application.
[0027] In the embodiments of the present application, Figure 1One of the flowcharts of a method for starting an electronic device provided in an embodiment of the present application, the method may include S101 to S105:
[0028] S101, determining a fault state of the electronic device by detecting clock data in a first memory of the electronic device;
[0029] In some embodiments, the electronic device may fail or be abnormal when in use, or the first processor related to the clock circuit in the electronic device may be replaced due to user behavior. Therefore, each time the electronic device is started, the failure state of the electronic device and the replacement state of the first processor are checked to determine the configuration parameters for starting the electronic device.
[0030] In the embodiment of the present application, the first memory is not limited. In short, it is a memory in the electronic device that can be used to store clock data of the electronic device.
[0031] In some embodiments, the first memory has a user-defined storage area, and the clock data is stored in the user-defined storage area. That is, the first memory can read the clock data of the electronic device and store the clock data in the user-defined area in the first memory.
[0032] It should be noted that the clock data is data generated with the participation of the first processor in the electronic device. If the first processor is replaced, the clock data generated with the participation of the first processor will be lost.
[0033] In the embodiment of the present application, the first memory is used to store clock data required for the normal operation of the electronic device, and the fault state of the electronic device is determined based on whether the clock data exists.
[0034] In some embodiments, the fault state refers to a fault in which clock data in a complementary metal oxide semiconductor (CMOS) of the electronic device is lost when the electronic device encounters unexpected damage or some components experience abnormal power failure or short circuit.
[0035] Exemplarily, the fault state of the electronic device may be that the CMOS battery is damaged or the CMOS is short-circuited.
[0036] In some embodiments, the fault state includes the electronic device having a fault state and the electronic device not having a fault state.
[0037] In some embodiments, when the electronic device is started, the clock data in the first memory is first detected to determine the state of the CMOS in the electronic device. When the clock data is detected in the first memory, the CMOS state in the electronic device is determined to be normal, and then the fault state of the electronic device is determined to be a non-fault state; when the clock data is detected in the first memory, the CMOS state in the electronic device is determined to be abnormal, and then the fault state of the electronic device is determined to be a fault state.
[0038] It should be noted that when some abnormality or failure occurs in the electronic device, the clock data in the CMOS is lost. The clock data in the first memory is read from the CMOS. Therefore, if the clock data in the CMOS is lost, the clock data in the first memory does not exist. If the clock data in the CMOS exists, the first memory can read and store the clock data from the CMOS.
[0039] In some embodiments, regardless of whether the first processor of the electronic device is replaced, when the electronic device is restarted, as long as the electronic device is powered on and the CMOS battery of the electronic device is properly installed, the system management controller of the electronic device can be initialized when the electronic device starts to ensure that it can interact normally with the system and other hardware components.
[0040] S102: Based on the clock data, obtain a first configuration parameter required to start the electronic device.
[0041] In the embodiment of the present application, the first configuration parameter is a parameter required to start the electronic device, for example, the startup configuration, system information, hardware monitoring and user settings of the electronic device.
[0042] In an embodiment of the present application, regardless of whether there is clock data in the first memory, it is necessary to obtain the first configuration parameters required to start the electronic device. The purpose of obtaining the first configuration parameters is to enable the electronic device to normally boot the Unified Extensible Firmware Interface (UEFI) for startup.
[0043] In some embodiments, if there is clock data in the first memory, it is determined that the electronic device has not failed, the data in the CMOS of the electronic device is normal, and the data in the CMOS can be used as the configuration parameters required to start the electronic device. Therefore, the data in the CMOS is determined as the first configuration parameter.
[0044] In some embodiments, if there is no clock data in the first memory, it is determined that a failure has occurred in the electronic device and the data in the CMOS of the electronic device may have been damaged or lost. Therefore, the electronic device must not use the abnormal data in the CMOS as the configuration parameters required to start the electronic device. The electronic device will reconfigure the data in the CMOS and determine the reconfigured data as the first configuration parameters required to start the electronic device.
[0045] S103: Determine a replacement status of a first processor of the electronic device based on the first configuration parameter.
[0046] In an embodiment of the present application, the electronic device may include at least one processor, and the first processor is a core component of the electronic device, responsible for executing instructions in a computer program, including arithmetic operations, logical operations, etc. And the first processor participates in the generation of clock data of the electronic device. That is, when the first processor of the electronic device is removed or replaced, the electronic device will not be able to obtain clock data.
[0047] In the embodiment of the present application, the replacement status of the first processor includes that the first processor is replaced and that the first processor is not replaced.
[0048] In some embodiments, after determining the first configuration parameter in CMOS, the electronic device enters UEFI boot. During the boot process, UEFI checks the first configuration parameter in CMOS and other memory states in CMOS. The first configuration parameter has a flag bit that can indicate whether the first processor of the electronic device has been replaced. Whether the first processor of the electronic device has been replaced is determined based on the flag bit.
[0049] S104: when it is determined that the replacement state of the first processor is replaced and the fault state of the electronic device is not faulty, obtaining a second configuration parameter required to start the electronic device;
[0050] The second configuration parameter is backup data of the third configuration parameter; the third configuration parameter is a configuration parameter used when the first processor is not replaced; the first processor is used to participate in the generation of clock data;
[0051] S105: Start the electronic device based on the second configuration parameter.
[0052] In an embodiment of the present application, when the first processor of the electronic device has not been replaced, the configuration parameter used when the electronic device is started is the third configuration parameter; at this time, if the first processor of the electronic device is replaced, the electronic device is started again after the replacement is completed. At this time, the electronic device uses the second configuration parameter to start, and the second configuration parameter is the backup data of the third configuration parameter, and the data content of the second configuration parameter is the same as that of the third configuration parameter.
[0053] It should be noted that when the electronic device is running, it will continuously back up the third configuration parameters currently used to start the electronic device, and back up the third configuration parameters as second configuration parameters and store them in a certain memory of the electronic device. When the first processor of the electronic device is replaced and the electronic device is started again, the electronic device reads the backed-up second configuration parameters to start.
[0054] In some embodiments, the second configuration parameter is stored in a UCM (UNIT CONTROL MODULE, storage table file) of the electronic device, where the UCM is a table mainly used to store customized settings of UEFI. When it is determined that the replacement state of the first processor is replaced and the fault state of the electronic device is not faulty, the second configuration parameter required to start the electronic device is read from the UCM, and the electronic device is started based on the second configuration parameter.
[0055] It can be understood that the configuration parameters used when the electronic device is started are jointly determined by the fault state of the electronic device and the replacement state of the first memory of the electronic device. On the one hand, the fault state of the electronic device is determined by detecting the clock data in the first memory of the electronic device; based on the first configuration parameter, the replacement state of the first processor of the electronic device is determined; based on this, it is beneficial to improve the accuracy of determining the fault state of the electronic device and the replacement state of the first memory; on the other hand, the first configuration parameter is determined according to the clock data in the first memory of the electronic device, that is, whether the clock data in the first memory exists, the corresponding first configuration parameter is different, based on this, the flexibility of starting the electronic device in multiple scenarios is ensured; when it is determined that the replacement state of the first processor is replaced and the fault state of the electronic device is not faulty, the second configuration parameter pre-backed up by the electronic device before the first processor is replaced is used to start, avoiding the loss of the previous configuration parameters, so that when the user starts the electronic device again after replacing the first processor, the electronic device can restore the previous configuration parameters, avoiding the user to re-set the electronic device.
[0056] In some embodiments, S103 may include S201:
[0057] S201. Detect a first flag bit in a first configuration parameter through a first interface of an electronic device to determine a replacement status of a first processor.
[0058] In the embodiment of the present application, the first interface is not limited. In short, it is an interface that can configure parameters of the electronic device when it is started.
[0059] In the embodiment of the present application, the first flag bit is not limited. In short, it is a flag bit that can indicate whether the first processor in the electronic device has been replaced.
[0060] Exemplarily, when the first flag bit is 1, it indicates that the first processor in the electronic device has been replaced; when the first flag bit is 0, it indicates that the first processor in the electronic device has not been replaced.
[0061] In some embodiments, the electronic device uses UEFI as the first interface to start up, and uses UEFI to detect the first flag bit in the first configuration parameter to determine the replacement status of the first processor.
[0062] It is understandable that setting a first flag bit in the first configuration parameter that can characterize whether the first processor has been replaced, and detecting the first flag bit through the first interface to determine the replacement status of the first processor effectively improves the accuracy of detecting whether the first processor has been replaced.
[0063] In some embodiments, S102 may include S301:
[0064] S301. When detecting that clock data exists, determine the third configuration parameter as the first configuration parameter.
[0065] In the embodiment of the present application, the third configuration parameter is a configuration parameter used when the first processor is not replaced.
[0066] In an embodiment of the present application, the first configuration parameter is a configuration parameter for guiding UEFI to start the electronic device. Depending on whether the clock data in the first memory exists, the parameter content of the first configuration parameter is different. When the clock data is detected to exist, the third configuration parameter stored in the CMOS is determined as the first configuration parameter.
[0067] In some embodiments, when clock data exists in the first memory, it is determined that the CMOS state is normal, indicating that no abnormality or failure has occurred in the electronic device. Therefore, the third configuration parameter stored in the CMOS is correct and valid. At this time, the third configuration parameter is determined as the first configuration parameter for starting the electronic device.
[0068] In some embodiments, once the system boots to UEFI, UEFI checks the CMOS state to ensure that the third configuration parameter therein is not damaged or lost. If the third configuration parameter in CMOS is valid (i.e., not cleared or damaged), the electronic device will continue the boot process, and the UEFIPOS T (Power-On Self-Test) process will remain unchanged. This means that the electronic device can load the operating system normally and continue to run.
[0069] It can be understood that by detecting whether the clock data exists, the content of the first configuration parameter is determined, so that the UEFI can be booted normally. When the clock data exists, there is no need to reconfigure the parameters. The existing third configuration parameter is determined as the first configuration parameter for UEFI booting and then starting the electronic device. The startup configuration parameters are not changed, so that the electronic device has the same configuration content as the last time after startup, avoiding frequent changes of startup configuration parameters and improving the stability of the startup of the electronic device.
[0070] In some embodiments, Figure 2 As shown, S101 may include S401 and S402:
[0071] S401, detecting clock data in a first memory of an electronic device, and if it is determined that the clock data in the first memory exists, determining that a third configuration parameter stored in a second memory is not cleared;
[0072] S402: When it is determined that the third configuration parameter stored in the second memory is not cleared, determine that no failure occurs in the electronic device.
[0073] In the embodiment of the present application, the second memory is not limited, and in short, it is a memory that can store the third configuration parameters.
[0074] In some embodiments, the second memory may be CMOS.
[0075] In some embodiments, the clock data in the first memory of the electronic device is detected. If the clock data in the first memory exists, it means that the state of the CMOS of the electronic device is normal, and the third configuration parameter stored in the CMOS is correct and valid. Therefore, the third configuration parameter does not need to be cleared, and the electronic device can continue to use the third configuration parameter for UEFI booting and startup. Based on this, it can also be determined that the electronic device has not failed, and can be started using the third configuration parameter at the last startup (when the first processor has not been replaced).
[0076] It can be understood that by detecting the clock data in the first memory of the electronic device, when it is determined that the clock data in the first memory exists, it is determined that the third configuration parameter stored in the second memory has not been cleared, and then it is determined that the electronic device has not failed, thereby improving the accuracy of judging whether the electronic device has failed.
[0077] In some embodiments, S104 may include S501:
[0078] S501. When it is determined that the replacement status of the first processor is replaced and the fault status of the electronic device is not faulty, access a third memory through a first interface of the electronic device to obtain a second configuration parameter; the third memory is used to back up the configuration parameters used to start the electronic device when the first processor is not replaced.
[0079] In the embodiment of the present application, the third memory is not limited. In short, it is a memory that can back up the configuration parameters used to start the electronic device when the first processor is not replaced.
[0080] In an embodiment of the present application, based on determining that the fault state of the electronic device is not a fault, if the replacement state of the first processor of the electronic device is replaced, that is, the first processor has been replaced at this time, the electronic device uses the first interface to access the third memory.
[0081] In some embodiments, UCM is used as a third storage to back up a third configuration parameter, and the third configuration parameter is a configuration parameter used to start the electronic device when the first processor is not replaced. The backup data of the third configuration parameter stored in UCM is the second configuration parameter. The electronic device uses UEFI to access the second configuration parameter in UCM.
[0082] It can be understood that when it is determined that the replacement status of the first processor is replaced and the fault status of the electronic device is no fault, the third memory is accessed through the first interface of the electronic device to obtain the backup data when the first processor is not replaced, that is, the second configuration parameters, to ensure that the original configuration content is not lost after the electronic device is started again.
[0083] In some embodiments, Figure 3 As shown, S102 may include S601 to S603:
[0084] S601: When the detection clock data does not exist, determine that the third configuration parameter stored in the second memory of the electronic device is cleared;
[0085] S602: if it is determined that the third configuration parameter is cleared, obtain a fourth configuration parameter for starting the electronic device;
[0086] The fourth configuration parameter is different from the third configuration parameter. The fourth configuration parameter is a preset configuration parameter for starting the electronic device, and the third configuration parameter is a configuration parameter modified based on the fourth configuration parameter according to the usage requirements of the electronic device.
[0087] In the embodiment of the present application, the fourth configuration parameter is not limited, and in short, it is a preset configuration parameter for starting the electronic device.
[0088] Exemplarily, the fourth configuration parameter is an initialization parameter set for the electronic device when it leaves the factory. When the electronic device is started using the fourth configuration parameter, the startup configuration, system information, hardware monitoring and user settings of the electronic device are restored to the initialization settings.
[0089] In an embodiment of the present application, clock data in the first memory of the electronic device is detected. If the clock data does not exist, it is determined that the CMOS state is abnormal, and the third configuration parameters stored in the CMOS may be partially damaged or invalid. At this time, the abnormal third configuration parameters in the CMOS can no longer be used, and the third configuration parameters in the CMOS need to be cleared.
[0090] In some embodiments, the third configuration parameter in the second memory is cleared using the first interface.
[0091] In some embodiments, when it is determined that the third configuration parameter is cleared, the fourth configuration parameter is loaded into the second memory using the first interface.
[0092] S603: Determine the fourth configuration parameter as the first configuration parameter.
[0093] In the embodiment of the present application, the fourth configuration parameter is loaded into the second memory, and then the fourth configuration parameter is read, and the fourth configuration parameter is determined as the first configuration parameter for starting the electronic device.
[0094] It can be understood that when the detection clock data does not exist, the third configuration parameter stored in the second memory is cleared, the fourth configuration parameter for starting the electronic device is obtained, and the electronic device is started using the fourth configuration parameter, thereby avoiding startup abnormalities caused by the electronic device continuing to use the possibly abnormal third configuration parameter for startup, thereby ensuring the safety of the startup of the electronic device.
[0095] In some embodiments, S602 may include S701 to S703:
[0096] S701: when it is determined that the third configuration parameter is cleared, clear the third configuration parameter stored in the second memory through the first interface;
[0097] S702, loading a fourth configuration parameter into the second memory through the first interface;
[0098] S703: Access the second memory through the first interface to obtain a fourth configuration parameter.
[0099] In some embodiments, the first interface may be UEFI. When it is determined that the third configuration parameter is cleared, the third configuration parameter in the second memory is cleared using UEFI, so that all data in the second memory is cleared.
[0100] In some embodiments, after clearing the third configuration parameter in the second memory using UEFI, the fourth configuration parameter is loaded into the second memory using UEFI, so that the fourth configuration parameter is stored in the second memory. The fourth configuration parameter in the second memory is read through UEFI so as to start the electronic device using the fourth configuration parameter.
[0101] It can be understood that when it is determined that the third configuration parameter is cleared, the third configuration parameter stored in the second memory is cleared through the first interface, so that the third configuration parameter that may be abnormal in the second memory is cleared; the fourth configuration parameter is loaded to the second memory through the first interface, ensuring that the data stored in the second memory is a safe and valid fourth configuration parameter, thereby ensuring the safety of starting up the electronic device.
[0102] In some embodiments, Figure 4 As shown, the method may further include S801 and S802:
[0103] S801: when it is determined that the replacement state of the first processor is not replaced and the failure state of the electronic device is not failed, obtain a third configuration parameter for starting the electronic device;
[0104] S802: Start the electronic device based on the third configuration parameter.
[0105] In an embodiment of the present application, when the fault state of the electronic device is that no fault has occurred, if further detection determines that the first processor of the electronic device has not been replaced, then the electronic device has not changed compared to the last time it was started, and the third configuration parameter used for starting the electronic device is also normal, therefore, the electronic device continues to use the third configuration parameter to start the electronic device.
[0106] It can be understood that when it is determined that the replacement status of the first processor is not replaced and the fault status of the electronic device is that no fault has occurred, the third configuration parameter is continued to be used to start the electronic device, thereby avoiding abnormal startup of the electronic device caused by frequent replacement of the startup configuration parameters, and ensuring the stability of the startup of the electronic device.
[0107] In some embodiments, Figure 5 As shown, the method may further include S901 and S902:
[0108] S901: when it is determined that the replacement state of the first processor is not replaced and the failure state of the electronic device is failure, obtain a fourth configuration parameter for starting the electronic device;
[0109] S902: Start the electronic device based on the fourth configuration parameter.
[0110] In an embodiment of the present application, when the fault state of the electronic device is a fault, if further detection determines that the first processor of the electronic device has not been replaced, the startup parameters are determined mainly based on the fault state of the electronic device. Since it has been determined that the electronic device has failed or is abnormal, the third configuration parameter that may be damaged is no longer used for startup, and instead the fourth configuration parameter is obtained to start the electronic device.
[0111] It can be understood that by judging the fault state of the electronic device and the replacement state of the first processor, when it is determined that the replacement state of the first processor is not replaced and the fault state of the electronic device is a fault, the fourth configuration parameter is obtained to start the electronic device, thereby avoiding the electronic device from starting with the third configuration parameter that may be damaged, thereby ensuring the safety of starting the electronic device.
[0112] The startup method of the electronic device described above is described below in conjunction with an application embodiment. However, it should be noted that this embodiment is only for better illustrating the present application and does not constitute an improper limitation on the present application.
[0113] Below, taking a computer as an example, an exemplary application of the embodiment of the present application in this application scenario will be explained.
[0114] The present application provides a method for starting an electronic device. Figure 6 The schematic diagram of the operation flow and data flow of the method is shown in FIG. 1 . The method may include: S1001 to S1004:
[0115] S1001. Initialize the system management controller (ACC).
[0116] In the embodiment of the present application, after the AC power of the computer is turned on, the computer starts up. The ACC serves as the system management controller of the computer. When the system starts up, the ACC will be initialized to ensure that it can interact normally with the system and other hardware components.
[0117] When the system AC power is connected and the CMOS battery is installed, the ACC starts to initialize. It is a system management controller that is responsible for monitoring the hardware status of the server, performing power management tasks, etc. When the system starts, the ACC will be initialized to ensure that it can interact normally with the system and other hardware components.
[0118] S1002, check whether there is clock data in the user memory (User Static Random Access Memory, USER SRAM) (ie, an example of the first memory), if there is, go to S1003; if not, go to S1004.
[0119] In the embodiment of the present application, USER RAM is used to store the computer's clock data. After the system AC power is turned on and ACC is initialized, the system will check the clock data in USER SRAM and determine whether the clear state of CMOS is valid based on whether there is clock data in USER SRAM.
[0120] S1003: Boot UEFI normally (ie, an example of the first interface).
[0121] S1004: Confirm that the clearing state of CMOS (ie, an example of the second memory) is valid.
[0122] In the embodiment of the present application, if the system checks the clock data in the USER SRAM and the clock data does not exist in the USER SRAM, it indicates that the computer may have experienced an abnormal situation, such as a failure or accidental damage. Since the clock data is part of the configuration information in the CMOS memory, if this data is lost or invalid, the computer system needs to clear all the data in the CMOS memory.
[0123] S1005. Clear CMOS content using UEFI.
[0124] In the embodiment of the present application, when confirming that the clearing state of CMOS is valid, the computer clears the data in CMOS (ie, an example of the third configuration parameter) through UEFI, thereby clearing all the data in CMOS.
[0125] S1006: Use UEFI configuration to load a default value (ie, an example of the fourth configuration parameter).
[0126] In an embodiment of the present application, after clearing all data in CMOS, the UEFI configuration is used to load default values, and the default values are the initial startup parameters preset when the computer leaves the factory.
[0127] S1007, using UEFI to detect whether the CMOS status meets the preset status, if so, proceed to S1008; if not, proceed to S1009.
[0128] In the embodiment of the present application, the preset state is a state in which the first processor has not been replaced and the electronic device is not faulty.
[0129] In the embodiment of the present application, the preset state is that the computer has not only replaced the CPU but also the computer's CMOS has not been cleared. By using UEFI to detect the CMOS state, four detection results can be obtained. The first is that the computer has not only replaced the CPU but also the computer's CMOS has not been cleared (preset state); the second is that the computer has not replaced the CPU and the computer's CMOS has not been cleared; the third is that the computer has replaced the CPU and the computer's CMOS has also been cleared; the fourth is that the computer has not replaced the CPU and the computer's CMOS has not been cleared.
[0130] S1008: Activate UCM (ie, an example of the third memory) to restore UEFI settings and start.
[0131] In an embodiment of the present application, UEFI detects whether the CMOS status meets the preset status, which indicates that not only the CPU of the computer has been replaced but also the CMOS of the computer has not been cleared. That is to say, while ensuring that there is no abnormality in the computer, the only change in the computer is that the CPU has been replaced. At this time, the backup data in the UCM (i.e., an example of the second configuration parameter) is read for UEFI settings, and the computer is started.
[0132] S1009. Keep UEFIPOST unchanged and start.
[0133] In the embodiment of the present application, UEFIPOST refers to UEFI Power-On Self-Test (UEFIPOST). If the UEFI detects that the CMOS status does not meet the preset status, it does not meet the conditions for booting using the backup data. At this time, the computer performs a power-on self-test and boots according to the configuration data currently obtained by UEFI.
[0134] In the embodiment of the present application, when the CPU of the computer has not been replaced and the CMOS of the computer has not been cleared, the state of the computer has not changed at all. Therefore, the parameters configured by UEFI are the parameters of the last startup of the computer.
[0135] When the CPU of a computer is replaced and the CMOS of the computer is cleared, the CMOS is cleared, so the default values are loaded into the CMOS, and the computer is started using the default values.
[0136] When the CPU of the computer has not been replaced, but the CMOS of the computer has been cleared, at this time, the CMOS has been cleared, so the default values are loaded into the CMOS, and the computer starts using the default values.
[0137] In the embodiment of the present application, the computer clock data is stored in USER RAM, and before the computer is started, the computer checks the clock data in USER SRAM, and judges whether the clear state of CMOS is valid according to whether the clock data exists in USER SRAM, thereby judging whether the computer has been abnormal or failed, and then determining whether the data in CMOS is loaded as the default value, or whether the CMOS data at the last computer startup is maintained, thereby improving the accuracy of the data in CMOS; on the other hand, by judging whether the CMOS state is the preset state, on the basis of ensuring that the computer is normal, if the computer has replaced the CPU, the backup data pre-stored in UCM is read, so that UEFI uses the backup data to start the computer, and avoids resetting the system date, time and configuration content to the default value when the computer system is restarted. The accuracy and effectiveness of system startup are effectively improved.
[0138] The present application embodiment provides a starting device 700 of an electronic device, such as Figure 7 As shown, the starting device 700 of the electronic device includes:
[0139] The determination module 701 is used to determine the fault state of the electronic device by detecting the clock data in the first memory of the electronic device; and determine the replacement state of the first processor of the electronic device based on the first configuration parameter;
[0140] The acquisition module 702 is used to acquire a first configuration parameter required for starting the electronic device based on the clock data; and, when it is determined that the replacement state of the first processor is replaced and the fault state of the electronic device is not faulty, acquire a second configuration parameter required for starting the electronic device; the second configuration parameter is backup data of the third configuration parameter; the third configuration parameter is a configuration parameter used when the first processor is not replaced; the first processor is used to participate in the generation of the clock data;
[0141] The startup module 703 is used to start the electronic device based on the second configuration parameter.
[0142] In some embodiments, the determination module 701 is further configured to detect a first flag bit in the first configuration parameter through a first interface of the electronic device to determine a replacement status of the first processor.
[0143] In some embodiments, the determination module 701 is further configured to determine the third configuration parameter as the first configuration parameter when the clock data is detected to exist.
[0144] In some embodiments, the determination module 701 is further used to detect clock data in a first memory of the electronic device, and when it is determined that the clock data in the first memory exists, determine that the third configuration parameter stored in the second memory of the electronic device has not been cleared; and,
[0145] When it is determined that the third configuration parameter stored in the second memory is not cleared, it is determined that no failure occurs in the electronic device.
[0146] In some embodiments, the acquisition module 702 is also used to access the third memory through the first interface of the electronic device to obtain the second configuration parameters when it is determined that the replacement status of the first processor is replaced and the fault status of the electronic device is not faulty; the third memory is used to back up the configuration parameters used to start the electronic device when the first processor is not replaced.
[0147] In some embodiments, the determination module 701 is further configured to determine that the third configuration parameter stored in the second memory of the electronic device is cleared when the detection clock data does not exist;
[0148] The acquisition module 702 is further configured to acquire a fourth configuration parameter for starting the electronic device when it is determined that the third configuration parameter is cleared;
[0149] The determination module 701 is further configured to determine the fourth configuration parameter as the first configuration parameter.
[0150] In some embodiments, the electronic device startup device 700 further includes a clearing module 704 and a loading module 705:
[0151] A clearing module 704, configured to clear the third configuration parameter stored in the first memory through the first interface when it is determined that the third configuration parameter is cleared;
[0152] A loading module 705, configured to load the fourth configuration parameter to the second memory through the first interface;
[0153] The acquisition module 702 is further configured to access the second memory through the first interface to acquire a fourth configuration parameter.
[0154] In some embodiments, the acquisition module 702 is further configured to acquire a third configuration parameter for starting the electronic device when it is determined that the replacement state of the first processor is not replaced and the failure state of the electronic device is not failed;
[0155] The startup module 703 is further configured to start the electronic device based on the third configuration parameter.
[0156] In some embodiments, the acquisition module 702 is further configured to acquire a fourth configuration parameter for starting the electronic device when it is determined that the replacement state of the first processor is not replaced and the failure state of the electronic device is failure;
[0157] The startup module 703 is further configured to start the electronic device based on the fourth configuration parameter.
[0158] It can be understood that the configuration parameters used when the electronic device is started are jointly determined by the fault state of the electronic device and the replacement state of the first memory of the electronic device. On the one hand, the fault state of the electronic device is determined by detecting the clock data in the first memory of the electronic device; based on the first configuration parameter, the replacement state of the first processor of the electronic device is determined; the effectiveness of determining the fault state of the electronic device and the replacement state of the first memory is ensured. On the other hand, the first configuration parameter is determined according to the clock data in the first memory of the electronic device, that is, whether the clock data in the first memory exists, the corresponding first configuration parameter is different, based on this, the flexibility of starting the electronic device in multiple scenarios is ensured; when it is determined that the replacement state of the first processor is replaced and the fault state of the electronic device is not faulty, the second configuration parameter pre-backed up by the electronic device before the first processor is replaced is used to start, avoiding the loss of the previous configuration parameters, so that when the user starts the electronic device again after replacing the first processor, the electronic device can restore the previous system information and user settings, improving the user experience and improving the accuracy and effectiveness of the electronic device startup.
[0159] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided in the embodiment of the present application can be used to execute the method described in the above method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0160] It should be noted that in the embodiment of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.
[0161] The present application embodiment provides a startup device of an electronic device, such as Figure 8 As shown, the hardware entity of the startup device 800 of the electronic device includes: a processor 801 and a memory 803, the memory stores a computer program that can be run on the processor, and the processor implements the steps in the startup method of the electronic device when executing the program.
[0162] It should be noted that the processor 801 generally controls the overall operation of the boot device 800 of the electronic device. The memory 803 is configured to store instructions and applications executable by the processor 801, and can also cache data to be processed or processed by each module in the processor 801 and the boot device 800 of the electronic device (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM). The boot device of the electronic device may also include: a communication interface 802; the communication interface 802 enables the boot device of the electronic device to communicate with other terminals or servers through a network. Data transmission can be carried out between the processor 801, the communication interface 802 and the memory 803 through the bus 804.
[0163] Based on the foregoing embodiments, the modules included in the starting device of the electronic device provided in the embodiments of the present application, as well as the units included in each module, etc., can be implemented by a processor in a computer device; of course, they can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0164] The embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, all steps in the startup method of an electronic device are implemented. The computer-readable storage medium can be transient or non-transient.
[0165] It should be noted here that the description of the various embodiments above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. The description of the above device and storage medium embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the device and storage medium embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0166] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the serial number of each step / process mentioned above does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The serial numbers of the embodiments of the present application mentioned above are for description only and do not represent the advantages and disadvantages of the embodiments.
[0167] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0168] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. The above are only implementation methods of this application, but the protection scope of this application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered within the protection scope of this application.
Claims
1. A method for starting an electronic device, the method comprising: Determining a fault state of the electronic device by detecting clock data in a first memory of the electronic device; Based on the clock data, obtaining a first configuration parameter required to start the electronic device; Based on the first configuration parameter, determining a replacement status of a first processor of the electronic device; When it is determined that the replacement state of the first processor is replaced and the fault state of the electronic device is not faulty, obtaining a second configuration parameter required for starting the electronic device; the second configuration parameter is backup data of a third configuration parameter; the third configuration parameter is a configuration parameter used when the first processor is not replaced; the first processor is used to participate in the generation of the clock data; The electronic device is started based on the second configuration parameter.
2. The method according to claim 1, wherein determining the replacement status of the first processor of the electronic device based on the first configuration parameter comprises: The first flag bit in the first configuration parameter is detected through the first interface of the electronic device to determine the replacement status of the first processor.
3. The method according to claim 1 or 2, wherein the acquiring, based on the clock data, a first configuration parameter required to start the electronic device comprises: In a case where it is detected that the clock data exists, the third configuration parameter is determined as the first configuration parameter.
4. The method according to claim 1, wherein determining the fault state of the electronic device by detecting clock data in the first memory of the electronic device comprises: Detecting clock data in a first memory of the electronic device, and determining that a third configuration parameter stored in a second memory of the electronic device has not been cleared when determining that the clock data in the first memory exists; When it is determined that the third configuration parameter stored in the second memory is not cleared, it is determined that no failure occurs in the electronic device.
5. The method according to claim 1, wherein when it is determined that the replacement state of the first processor is replaced and the fault state of the electronic device is not faulty, obtaining a second configuration parameter required to start the electronic device comprises: When it is determined that the replacement status of the first processor is replaced and the fault status of the electronic device is not faulty, a third memory is accessed through the first interface of the electronic device to obtain the second configuration parameters; the third memory is used to back up the configuration parameters used to start the electronic device when the first processor is not replaced.
6. The method according to claim 1, wherein acquiring a first configuration parameter required for starting the electronic device based on the clock data comprises: In the case of detecting that the clock data does not exist, determining that the third configuration parameter stored in the second memory of the electronic device is cleared; In the case where it is determined that the third configuration parameter is cleared, obtaining a fourth configuration parameter for starting the electronic device; wherein the fourth configuration parameter is different from the third configuration parameter, the fourth configuration parameter is a preset configuration parameter for starting the electronic device, and the third configuration parameter is a configuration parameter modified based on the fourth configuration parameter according to the use requirements of the electronic device; The fourth configuration parameter is determined as the first configuration parameter.
7. The method according to claim 6, wherein when it is determined that the third configuration parameter is cleared, obtaining a fourth configuration parameter for starting the electronic device comprises: In a case where it is determined that the third configuration parameter is cleared, clearing the third configuration parameter stored in the first memory through the first interface; Loading the fourth configuration parameter to the second memory via the first interface; The second memory is accessed through the first interface to obtain the fourth configuration parameter.
8. The method according to claim 1, further comprising: When it is determined that the replacement state of the first processor is not replaced and the fault state of the electronic device is not faulty, acquiring the third configuration parameter for starting the electronic device; The electronic device is started based on the third configuration parameter.
9. The method according to claim 6, further comprising: When it is determined that the replacement state of the first processor is not replaced and the fault state of the electronic device is faulty, acquiring the fourth configuration parameter for starting the electronic device; The electronic device is started based on the fourth configuration parameter.
10. A starting device for an electronic device, the device comprising: A determination module, configured to determine a fault state of the electronic device by detecting clock data in a first memory of the electronic device; and, based on the first configuration parameter, determining a replacement status of a first processor of the electronic device; an acquisition module, configured to acquire, based on the clock data, a first configuration parameter required for starting the electronic device; and, in the case where it is determined that the replacement state of the first processor is replaced and the failure state of the electronic device is not failed, acquire a second configuration parameter required for starting the electronic device; the second configuration parameter is backup data of a third configuration parameter; the third configuration parameter is a configuration parameter used when the first processor is not replaced; the first processor is used to participate in the generation of the clock data; A startup module is used to start the electronic device based on the second configuration parameter.