Startup item management method and apparatus, computer device, and storage medium
By comparing the mapping relationship between boot item names and processor ports and adjusting the boot sector address, the problems of long boot item disabling time and high manpower costs in the existing technology are solved, and the accuracy and efficiency are improved.
Patent Information
- Application Number
- CN202411851897.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-12-16
AI Technical Summary
Existing technologies for disabling server startup items, especially those related to CPU PCIe ports, suffer from time-consuming processes, high labor costs, and difficulty in accurately identifying the ports to be tested, particularly when there are multiple similar network cards or system disks.
By comparing the option name of the boot item to be disabled with the boot item set, adjusting the boot address of the boot sector based on the processor port mapping relationship, and using a double confirmation mechanism to determine whether to disable the boot item, the accuracy and efficiency of the disabling are ensured.
This approach achieves the goal of saving manpower and time costs while ensuring the accuracy of startup item disabling, improving the efficiency of startup item management, and ensuring the accuracy of startup item disabling and system startup speed.
Smart Images

Figure CN119806657B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a startup item management method, apparatus, computer device, and storage medium. Background Technology
[0002] Servers often have multiple boot devices installed simultaneously. Based on actual application needs, the desired target boot device is selected from these multiple boot devices to enter different operating systems. To prevent accidental entry into the wrong operating system, the boot entries of other boot devices that are not currently in use need to be disabled, thereby avoiding the risk of entering the wrong operating system.
[0003] Related technologies disable server startup items by modifying the order of startup items or adjusting the list of created startup items. However, neither of these methods solves the startup problem for PCIe (Peripheral Component Interconnect Express) ports originating from the CPU (Central Processing Unit). For example, if there are multiple similar network cards or system disks, and the user only wants to keep a disk on a specific port or access that port for debugging, current technologies mainly involve disabling disks with the same name one by one in sequence, removing other disks first, or placing the disk on a different system disk without the same information. This requires a lot of time and effort. In addition, when testing the PXE (Preboot Execution Environment) boot capability of a port, if there are identical network cards, it is difficult to quickly and accurately identify the startup item corresponding to the port under test. Summary of the Invention
[0004] Therefore, it is necessary to provide a startup item management method, device, computer equipment, and storage medium that can save manpower and time costs while ensuring the accuracy of startup item disabling, in order to address the above-mentioned technical problems.
[0005] Firstly, a startup item management method is provided, the method including:
[0006] Get the first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with the second option name in the startup item set;
[0007] In response to a successful comparison, based on the mapping relationship between the option name and the processor port, the first processor port corresponding to the second option name is determined, and based on the target identifier, the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port is adjusted;
[0008] In response to a comparison failure, the identifier of the second boot address of the boot sector corresponding to the second target boot device is obtained. In response to the second boot address identifier being the same as the target identifier, the second processor port connected to the second target boot device is skipped when allocating the boot path.
[0009] Optionally, in response to the identifier of the second boot address being different from the target identifier, the method further includes:
[0010] Based on the basic input / output system, a corresponding boot path is assigned to the second processor port connected to the second target boot device;
[0011] Based on the boot path, load the bootloader from the active partition of the second target boot device;
[0012] Based on the bootloader, the operating system kernel is loaded, and the operating system kernel is decompressed to obtain the target operating system kernel;
[0013] Based on the target operating system kernel, the hardware driver is initialized, and after the hardware driver initialization is complete, the boot entry corresponding to the second target boot device is run to generate the user interface.
[0014] Optionally, before obtaining the first option name of the startup item to be disabled and comparing it with the second option name in the startup item set, the method further includes:
[0015] Based on the basic input / output system, the operating status of the server during the power-on process is detected;
[0016] In response to the server's normal operating status and power-on completion, the server's hardware devices are initialized, and the boot device connected to the server's processor is determined through the target interface protocol.
[0017] Based on the boot device, allocate memory addresses for running the boot entry.
[0018] Optionally, methods for generating the set of startup items include:
[0019] The first target file stores the text string in the user interface generated based on the corresponding startup item of the startup device. The text string is used to describe the option name corresponding to the startup item.
[0020] The layout path for the certificate and startup option used to verify the digital signature is stored in the second target file;
[0021] Use a third-party object file to associate the startup item with the corresponding executable program;
[0022] The first, second, and third target files are encapsulated to generate a set corresponding to the startup items.
[0023] Optionally, after generating the set of startup items, the method may also include:
[0024] Based on the set of boot items, determine the boot device corresponding to the set of boot items, as well as the processor port connected to the boot device;
[0025] The startup item set is associated with the corresponding processor port to generate a one-to-one mapping relationship.
[0026] Optionally, based on the target identifier, adjusting the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port includes:
[0027] Set the boot address of the boot sector corresponding to the first target boot device to the target identifier, and define the first target boot device as a boot device without boot function, so as to disable the boot entry corresponding to the first target boot device.
[0028] Optionally, in response to the second boot address having the same identifier as the target identifier, skipping the second processor port connected to the second target boot device when allocating the boot path includes:
[0029] When allocating a boot path, in response to the fact that the second processor port is a processor port connected to the second target boot device, no boot path is allocated to the second processor port, and the second target boot device is defined as a boot device without boot function, so as to disable the boot entry corresponding to the second target boot device.
[0030] Secondly, a startup item management device is provided, the device comprising:
[0031] The data acquisition module is used to obtain the first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with the second option name in the startup item set;
[0032] The boot address adjustment module is used to respond to a successful comparison, determine the first processor port corresponding to the second option name based on the mapping relationship between the option name and the processor port, and adjust the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port based on the target identifier.
[0033] The boot path allocation module is used to obtain the identifier of the second boot address of the boot sector corresponding to the second target boot device. In response to the fact that the identifier of the second boot address is the same as the target identifier, the second processor port connected to the second target boot device is skipped when allocating the boot path.
[0034] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0035] Get the first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with the second option name in the startup item set;
[0036] In response to a successful comparison, based on the mapping relationship between option names and processor ports, the first processor port corresponding to the second option name is determined, and based on the target identifier, the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port is adjusted;
[0037] In response to a comparison failure, the identifier of the second boot address of the boot sector corresponding to the second target boot device is obtained. In response to the second boot address identifier being the same as the target identifier, the second processor port connected to the second target boot device is skipped when allocating the boot path.
[0038] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0039] Get the first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with the second option name in the startup item set;
[0040] In response to a successful comparison, based on the mapping relationship between option names and processor ports, the first processor port corresponding to the second option name is determined, and based on the target identifier, the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port is adjusted;
[0041] In response to a comparison failure, the identifier of the second boot address of the boot sector corresponding to the second target boot device is obtained. In response to the second boot address identifier being the same as the target identifier, the second processor port connected to the second target boot device is skipped when allocating the boot path.
[0042] Fifthly, a computer program product is provided, comprising a computer program that, when executed by a processor, performs the following steps:
[0043] Get the first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with the second option name in the startup item set;
[0044] In response to a successful comparison, based on the mapping relationship between option names and processor ports, the first processor port corresponding to the second option name is determined, and based on the target identifier, the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port is adjusted;
[0045] In response to a comparison failure, the identifier of the second boot address of the boot sector corresponding to the second target boot device is obtained. In response to the second boot address identifier being the same as the target identifier, the second processor port connected to the second target boot device is skipped when allocating the boot path.
[0046] The aforementioned boot item management method, apparatus, computer device, and storage medium include: obtaining a first option name of the boot item to be disabled; comparing the first option name of the boot item to be disabled with a second option name in a set of boot items; in response to a successful comparison, determining the first processor port corresponding to the second option name based on the mapping relationship between the option name and the processor port; adjusting the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port based on a target identifier; in response to a failed comparison, obtaining the identifier of the second boot address of the boot sector corresponding to the second target boot device; in response to the second boot address identifier being the same as the target identifier, skipping the second processor port connected to the second target boot device when allocating the boot path. This application, based on a dual confirmation mechanism, determines the boot address or boot path allocation port that needs to be adjusted and adjusts it to disable the boot item corresponding to the boot device, thereby improving efficiency and saving manpower and time costs while ensuring the accuracy of boot item disabling. Attached Figure Description
[0047] Figure 1 This is an application environment diagram of the startup item management method in one embodiment;
[0048] Figure 2 This is a flowchart illustrating a startup item management method in one embodiment;
[0049] Figure 3 This is another flowchart illustrating the startup item management method in one embodiment;
[0050] Figure 4 This is a schematic diagram of the overall structure between the CPU topology and peripheral devices in a startup item management method of one embodiment;
[0051] Figure 5This is a schematic diagram of the collection generation method of the startup item management method in one embodiment;
[0052] Figure 6 This is a structural block diagram of the startup item management device in one embodiment;
[0053] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0055] It should be understood that, in the description of this application, unless the context explicitly requires it, words such as "including" or "comprising" throughout the specification should be interpreted as including rather than exclusive or exhaustive; that is, meaning "including but not limited to".
[0056] It should also be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0057] It should be noted that the terms "S1," "S2," etc., are used only for descriptive purposes and do not specifically refer to the order or sequence, nor are they intended to limit this application. They are merely for the convenience of describing the method of this application and should not be construed as indicating the sequential order of the steps. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0058] The BIOS (Basic Input Output System) boot entry is characterized by its ability to manage the loading of the operating system from different devices during the computer's boot process. The BIOS has two boot modes: UEFI (Unified Extensible Firmware Interface) mode and Legacy mode (traditional boot mode under BIOS). In these two modes, all boot devices can be categorized into four boot types: hard drive boot, network card boot, optical drive / disk boot, and other device types such as USB (Universal Serial Bus) boot. Different boot types enable the server to enter the operating system (OS) through different media. According to background technology, to avoid the risk of entering an incorrect operating system, disabling server startup items involves modifying the order of startup items or adjusting the created startup item list. Specifically, disabling server startup items is achieved by modifying the order of startup items and then performing a loop startup. For example, when the target boot device is a network card, the startup item order can be adjusted first, setting the network card as the first boot item, and then enabling the network card for polling. This achieves a loop startup of this single boot type, the network card, to avoid booting an incorrect hard drive or other boot device into an incorrect operating system due to network card startup failure. Each network card can be connected to the network via a network cable for booting. Different operating systems can disable certain network card boot entries by disabling the network card itself, thus shutting down the network card's boot device. This involves adjusting the boot entry list by marking disabled boot entries for deletion, and then enabling the previously disabled entries. However, while these technologies enable or disable boot entries, they still suffer from the problems described in the background. For example, when testing the PXE boot capability of a port, one might first disable all network card PXE boot entries and then open them one by one to verify if it's the port being tested, or disable the PXErom (a built-in BOOT ROM chip on the client computer's network card), effectively removing the network card's function. While this achieves the goal, it deviates from the original intention of boot entry control.
[0059] To address the aforementioned technical problems, this application provides a boot item management method, apparatus, device, and storage medium. Compared to existing schemes that confirm option names from uni files, this application uses a method that directly controls the boot address or boot path of the CPU-output port device's boot sector to perform double confirmation without configuring the path when polling the specified CPU port device. This effectively disables boot items corresponding to the boot device, thereby improving efficiency and saving manpower and time costs while ensuring the accuracy of boot item disabling.
[0060] The startup item management method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with a data processing platform set on server 104 via a network. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Server 104 can be implemented as a standalone server or a server cluster consisting of multiple servers.
[0061] In one embodiment, such as Figures 2-3 As shown, a startup item management method is provided, which can be applied to... Figure 1 Taking the terminal in the example, the explanation includes the following steps:
[0062] S1: Obtain the first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with the second option name in the startup item set.
[0063] It should be noted that startup items refer to programs that the system automatically loads and runs when the computer boots up. These programs typically start automatically before or after the user logs in to provide specific functions or services when the operating system starts. Startup items to be disabled are determined by user requests to disable them. The boot device corresponding to a startup item is also called a boot device, which refers to the hardware device used to boot the operating system after the computer is turned on, such as SATA hard drives (serial ATA hard drives), NVMe hard drives (solid-state drives), and PCIe hard drives composed of network cards and RAID cards (redundant array cards). These hardware devices are brought out by the CPU's port group, such as... Figure 4The diagram shows the CPU's topology and its relationship to peripheral hardware devices. The CPU is internally divided into multiple x16 groups, designated P0, P1, and P2. These groups can be configured with SATA, NVMe, or PCIe protocols, respectively. PCIe devices include network cards and RAID cards, which contain bootable firmware. The boot option names are the names corresponding to the options built based on these group divisions, such as P0 port boot option control and P1 port boot option control. These names describe the corresponding boot device. Comparing the first option name of the bootable device to be disabled with the second option name in the boot option set means comparing the first option name of the bootable device to be disabled with the option names of all boot options in the server's boot option set.
[0064] In some specific implementations, such as Figure 3 As shown, before obtaining the first option name of the startup item to be disabled and comparing it with the second option name in the startup item set, the method further includes:
[0065] Based on the basic input / output system, the operating status of the server during the power-on process is detected. The basic input / output system refers to the BIOS. When the user presses the power button, the server starts to supply power. The CPU first reads the BIOS program in the ROM chip on the motherboard. The BIOS performs a power-on self-test (POST) operation to check whether the hardware devices in the server are normal.
[0066] In response to the server's normal operating status and power-on completion, the server's hardware devices (such as memory, CPU, and PCIe devices) are initialized to set their basic parameters. The boot device connected to the server's processor is determined through the target interface protocol, that is, the connected hard drive device is identified through interface protocols such as SATA and PCIe. For example, the connected SATA hard drive device is identified through the SATA interface protocol, the connected NVMe hard drive device is identified through the PCIe interface protocol, and the network card device can also be identified through the PCIe interface protocol.
[0067] Based on the boot device, a memory address is allocated for running the boot entry, that is, the memory address allocated to the boot entry FW corresponding to the network card.
[0068] In some specific implementations, the method for generating the set of startup items includes:
[0069] The first target file stores the text strings generated in the user interface based on the boot item corresponding to the boot device. The text strings are used to describe the option names corresponding to the boot item. The first target file is a UNI file. UNI files are a file type used in UEFI development to implement user interaction interfaces, mainly for localization support.
[0070] The layout path of the certificate and startup option used to verify the digital signature is stored in the second target file, where the second target file refers to the SD file (a file in flash memory card format);
[0071] The executable program corresponding to the startup item is associated with a third object file, where the third object file refers to a C file;
[0072] The first, second, and third target files are packaged to generate a set corresponding to the boot device. The packaging operation is performed through the Make file.
[0073] Specifically, such as Figure 5 As shown, creating options under BIOS setup (BIOS setup program) to generate boot entries for each CPU group P0, P1, and P2 includes the following steps: First, store the text strings displayed in the user interface using a UNI file. UNI files can be dynamically loaded during the boot process, so strings for specific languages can be loaded as needed, without having to preload strings for all languages. Name the control options P0 port boot option control, P1 port boot option control, and so on. Based on this, the boot entry names visible in the BIOS setup interface can be confirmed. Next, store the certificate used to verify the digital signature and the layout path of the defined options under setup using an SD file to ensure that only signed firmware and operating systems can load the boot entry, and also fix the position of the options under BIOS setup. Then, use a C file to associate the specific implementation function of the boot entry, i.e., the corresponding executable program. Finally, use a Make file to encapsulate this function into a collection for easy calling during the boot process.
[0074] In some specific implementations, after generating the set of startup items, the method further includes:
[0075] Based on the set of boot items, the boot device corresponding to the set of boot items and the processor port connected to the boot device are determined. The boot device corresponding to the boot item can be determined according to the option name in the set of boot items. Each boot device is connected to a corresponding processor port, which is the CPU port.
[0076] The startup item set is associated with the corresponding processor port to generate a one-to-one mapping relationship.
[0077] In the above implementation, the reliability of system operation can be improved by performing a power-on self-test operation. By constructing a set corresponding to startup items, it is possible to determine whether the startup item corresponding to the startup device is a startup item that needs to be disabled, and then determine the corresponding disabling operation, thereby improving the processing efficiency of startup item management requests.
[0078] S2: In response to a successful comparison, based on the mapping relationship between the option name and the processor port, determine the first processor port corresponding to the second option name, and based on the target identifier, adjust the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port.
[0079] It should be noted that the boot device is a storage device and has corresponding sectors. The first sector of the hard drive is called the boot sector, which contains the Master Boot Record (MBR) or GUID Partition Table (GPT). The MBR contains a small piece of code for a boot loader and partition table information. For hard drives using GPT partition tables, the first sector contains GPT header information. GPT hard drives usually contain an EFI system partition (ESP) to store the boot loader. The EFI boot loader in the ESP (such as bootmgfw.efi) will be loaded and executed. The target identifier is generally 0. The mapping relationship between option names and processor ports can be determined by the mapping relationship generated by the boot item set and the corresponding processor port in step S1. When the first option name and the second option name are successfully matched, the first processor port associated with the second option name can be determined through the set corresponding to the second option name.
[0080] In some specific implementations, adjusting the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port, based on the target identifier, includes:
[0081] Set the boot address of the boot sector corresponding to the first target boot device to the target identifier, and define the first target boot device as a boot device without boot function, so as to disable the boot entry corresponding to the first target boot device.
[0082] Specifically, when it is detected that the boot item corresponding to the first target boot device is a boot item to be disabled, the boot address of the boot sector corresponding to the first target boot device is set to 0. For example, if the boot address is 0x7C00, 0x7C00 is adjusted to 000000 or 0, so that the first target boot device cannot boot and execute the running program corresponding to the boot item to be disabled, that is, the first target boot device is turned into an ordinary boot device without boot function, thereby achieving the disabling of the boot item corresponding to the first target boot device.
[0083] In the above implementation, for startup items that need to be disabled, the boot address of the boot sector of the corresponding boot device can be directly adjusted to disable the startup item, which can further improve the execution efficiency of startup item disabling operation.
[0084] S3: In response to the comparison failure, obtain the identifier of the second boot address of the boot sector corresponding to the second target boot device. In response to the second boot address identifier being the same as the target identifier, skip the second processor port connected to the second target boot device when allocating the boot path.
[0085] It should be noted that, similar to the steps above, the target identifier is 0, the processor port refers to the CPU port, and the second target boot device refers to the boot device corresponding to other option names that did not match the first option name.
[0086] In some specific implementations, in response to the second boot address having the same identifier as the target identifier, skipping the second processor port connected to the second target boot device when allocating the boot path includes:
[0087] When allocating a boot path, in response to the fact that the second processor port is a processor port connected to the second target boot device, no boot path is allocated to the second target boot device port, and the second target boot device is defined as a boot device without boot function, so as to disable the boot entry corresponding to the second target boot device.
[0088] Specifically, when the option name of the boot entry corresponding to the second target boot device fails to match the first option name, the BIOS loads the contents of the boot sector of the second target boot device to extract the boot address corresponding to the boot sector. If the identifier of the boot address is the target identifier, that is, the boot address is 000000 or 0, it means that the boot address will not jump to the corresponding boot path. Then, when the boot path allocated to the system polls the CPU port corresponding to the second target boot device, no boot path is configured for it, thereby turning the second target boot device into a normal boot device without boot function, and thus disabling the boot entry corresponding to the second target boot device.
[0089] In some specific implementations, the identifier responding to the second boot address is different from the target identifier, and the method further includes:
[0090] Based on the basic input / output system, a corresponding boot path is assigned to the second processor port connected to the second target boot device;
[0091] Based on the boot path, load the bootloader from the active partition of the second target boot device;
[0092] Based on the bootloader, the operating system kernel is loaded, and the operating system kernel is decompressed to obtain the target operating system kernel;
[0093] Based on the target operating system kernel, the hardware driver is initialized, and after the hardware driver initialization is complete, the boot entry corresponding to the second target boot device is run to generate the user interface.
[0094] Specifically, the bootloader selects an active partition based on the partition table information and loads an operating system-specific bootloader (such as GRUB, Windows Boot Manager, etc.) from the active partition. That is, the BIOS loads the EFI bootloader from the EFI system partition. The EFI system bootloader is responsible for loading the core of the operating system, while the operating system boot loader is responsible for loading the operating system kernel (such as the Linux kernel, Windows kernel, etc.). After loading the operating system kernel, hardware drivers, including hard drive drivers, are initialized. After initialization, system services and applications are loaded, i.e., the boot entry corresponding to the second target boot device is run, ultimately presenting the user interface. Furthermore, in Windows systems, boot configuration information is stored in a BCD (Binary-Coded Decimal) file located in the EFI system partition. In Linux systems, boot configuration information is stored in the ` / boot / grub / grub.cfg` file, generated by GRUB. When a new device is detected, the operating system generates the corresponding boot entry based on the boot entry configuration file to ensure that users can choose to boot from these devices.
[0095] In the above implementation, a dual confirmation mechanism is used: firstly, the boot item of the boot device in the server needs to be disabled by using the option name; and secondly, the boot item of the boot device needs to be disabled by using the boot address in the boot device. This avoids entering the wrong operating system, improves the accuracy of boot item disabling, optimizes the system boot speed, and when the boot item is confirmed to be a boot item that does not need to be disabled, the corresponding running program is executed to meet user needs and improve the user experience.
[0096] In some specific implementations, the method further includes:
[0097] Based on the target time period, obtain the number of times the startup item of the target startup device is disabled, the time node when it is disabled, and the duration of the disabling. The target time period can be set according to actual needs, such as one week or one month.
[0098] In response to the detection that the number of times a device is disabled exceeds a first preset threshold within a target time period, the values corresponding to the number of times a device is disabled and the duration of the disabling are normalized. Based on expert experience, the time node to which the device is disabled is assigned a value, and this value is normalized. The assignment standard is that if the time node is a weekday morning, the value is larger; if it is a weekday afternoon, the value is smaller; and if it is a weekend, the value is smallest. The first preset threshold can be set according to actual needs, such as 50 times. The target time period is a time period within a target time cycle, such as a day.
[0099] The normalized value is input into the objective function to obtain the target value. The objective function can be a linear function, such as Y = aX1 + bX2 + cX3, where Y is the target value, a, b and c are weight coefficients, and X1, X2 and X3 are the number of times the function is disabled, the time node to which the function is disabled, and the duration of the disable, respectively.
[0100] When a target value is detected to be greater than a second preset threshold, the startup item of the target startup device is marked so that the startup item can be directly disabled when the server restarts next time, without further confirmation of whether the startup item of the target startup device needs to be disabled. The second preset threshold can be set according to actual needs.
[0101] In the above implementation, startup items that can be directly disabled by marking them with the above rules eliminate the need for double confirmation of the startup item during system operation, further improving the efficiency of startup item management.
[0102] The above-mentioned boot item management method includes: obtaining the first option name of the boot item to be disabled; comparing the first option name of the boot item to be disabled with the second option name in the boot item set; in response to a successful comparison, determining the first processor port corresponding to the second option name based on the mapping relationship between the option name and the processor port; adjusting the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port based on the target identifier; in response to a failed comparison, obtaining the identifier of the second boot address of the boot sector corresponding to the second target boot device; in response to the second boot address identifier being the same as the target identifier, skipping the second processor port connected to the second target boot device when allocating the boot path.
[0103] It should be understood that, although Figures 2-5 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figures 2-5At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0104] In one embodiment, such as Figure 6 As shown, a startup item management device is provided, including: a data acquisition module, a boot address adjustment module, and a startup path allocation module, wherein:
[0105] The data acquisition module is used to obtain the first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with the second option name in the startup item set;
[0106] The boot address adjustment module is used to respond to a successful comparison, determine the first processor port corresponding to the second option name based on the mapping relationship between the option name and the processor port, and adjust the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port based on the target identifier.
[0107] The boot path allocation module is used to obtain the identifier of the second boot address of the boot sector corresponding to the second target boot device. In response to the fact that the identifier of the second boot address is the same as the target identifier, the second processor port connected to the second target boot device is skipped when allocating the boot path.
[0108] In a preferred embodiment of the present invention, the device further includes a user interface generation module, which is specifically used for:
[0109] Based on the basic input / output system, a corresponding boot path is assigned to the second processor port connected to the second target boot device;
[0110] Based on the boot path, load the bootloader from the active partition of the second target boot device;
[0111] Based on the bootloader, the operating system kernel is loaded, and the operating system kernel is decompressed to obtain the target operating system kernel;
[0112] Based on the target operating system kernel, the hardware driver is initialized, and after the hardware driver initialization is complete, the boot entry corresponding to the second target boot device is run to generate the user interface.
[0113] In a preferred embodiment of the present invention, the device further includes a system initialization module, which is specifically used for:
[0114] Based on the basic input / output system, the operating status of the server during the power-on process is detected;
[0115] In response to the server's normal operating status and power-on completion, the server's hardware devices are initialized, and the boot device connected to the server's processor is determined through the target interface protocol.
[0116] Based on the boot device, allocate memory addresses for running the boot entry.
[0117] In a preferred embodiment of the present invention, the apparatus further includes a set generation module, which is specifically used for:
[0118] The first target file stores the text string in the user interface generated based on the corresponding startup item of the startup device. The text string is used to describe the option name corresponding to the startup item.
[0119] The layout path for the certificate and startup option used to verify the digital signature is stored in the second target file;
[0120] Use a third-party object file to associate the startup item with the corresponding executable program;
[0121] The first, second, and third target files are encapsulated to generate a set corresponding to the startup items.
[0122] In a preferred embodiment of the present invention, the set generation module is further configured to:
[0123] Based on the set of boot items, determine the boot device corresponding to the set of boot items, as well as the processor port connected to the boot device;
[0124] The startup item set is associated with the corresponding processor port to generate a one-to-one mapping relationship.
[0125] In a preferred embodiment of the present invention, the boot address adjustment module is specifically used for:
[0126] Set the boot address of the boot sector corresponding to the first target boot device to the target identifier, and define the first target boot device as a boot device without boot function, so as to disable the boot entry corresponding to the first target boot device.
[0127] In a preferred embodiment of the present invention, the startup path allocation module is specifically used for:
[0128] When allocating a boot path, in response to the fact that the second processor port is a processor port connected to the second target boot device, no boot path is allocated to the second processor port, and the second target boot device is defined as a boot device without boot function, so as to disable the boot entry corresponding to the second target boot device.
[0129] For specific limitations regarding the startup item management device, please refer to the limitations of the startup item management method above, which will not be repeated here. Each module in the aforementioned startup item management device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0130] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a startup item management method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0131] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0132] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0133] S1: Obtain the first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with the second option name in the startup item set;
[0134] S2: In response to a successful comparison, based on the mapping relationship between the option name and the processor port, determine the first processor port corresponding to the second option name, and adjust the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port based on the target identifier;
[0135] S3: In response to the comparison failure, obtain the identifier of the second boot address of the boot sector corresponding to the second target boot device. In response to the second boot address identifier being the same as the target identifier, skip the second processor port connected to the second target boot device when allocating the boot path.
[0136] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0137] Based on the basic input / output system, a corresponding boot path is assigned to the second processor port connected to the second target boot device;
[0138] Based on the boot path, load the bootloader from the active partition of the second target boot device;
[0139] Based on the bootloader, the operating system kernel is loaded, and the operating system kernel is decompressed to obtain the target operating system kernel;
[0140] Based on the target operating system kernel, the hardware driver is initialized, and after the hardware driver initialization is complete, the boot entry corresponding to the second target boot device is run to generate the user interface.
[0141] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0142] Based on the basic input / output system, the operating status of the server during the power-on process is detected;
[0143] In response to the server's normal operating status and power-on completion, the server's hardware devices are initialized, and the boot device connected to the server's processor is determined through the target interface protocol.
[0144] Based on the boot device, allocate memory addresses for running the boot entry.
[0145] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0146] The first target file stores the text string in the user interface generated based on the corresponding startup item of the startup device. The text string is used to describe the option name corresponding to the startup item.
[0147] The layout path for the certificate and startup option used to verify the digital signature is stored in the second target file;
[0148] Use a third-party object file to associate the startup item with the corresponding executable program;
[0149] The first, second, and third target files are encapsulated to generate a set corresponding to the startup items.
[0150] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0151] Based on the set of boot items, determine the boot device corresponding to the set of boot items, as well as the processor port connected to the boot device;
[0152] The startup item set is associated with the corresponding processor port to generate a one-to-one mapping relationship.
[0153] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0154] Set the boot address of the boot sector corresponding to the first target boot device to the target identifier, and define the first target boot device as a boot device without boot function, so as to disable the boot entry corresponding to the first target boot device.
[0155] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0156] When allocating a boot path, in response to the fact that the second processor port is a processor port connected to the second target boot device, no boot path is allocated to the second processor port, and the second target boot device is defined as a boot device without boot function, so as to disable the boot entry corresponding to the second target boot device.
[0157] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0158] S1: Obtain the first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with the second option name in the startup item set;
[0159] S2: In response to a successful comparison, based on the mapping relationship between the option name and the processor port, determine the first processor port corresponding to the second option name, and adjust the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port based on the target identifier;
[0160] S3: In response to the comparison failure, obtain the identifier of the second boot address of the boot sector corresponding to the second target boot device. In response to the second boot address identifier being the same as the target identifier, skip the second processor port connected to the second target boot device when allocating the boot path.
[0161] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0162] Based on the basic input / output system, a corresponding boot path is assigned to the second processor port connected to the second target boot device;
[0163] Based on the boot path, load the bootloader from the active partition of the second target boot device;
[0164] Based on the bootloader, the operating system kernel is loaded, and the operating system kernel is decompressed to obtain the target operating system kernel;
[0165] Based on the target operating system kernel, the hardware driver is initialized, and after the hardware driver initialization is complete, the boot entry corresponding to the second target boot device is run to generate the user interface.
[0166] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0167] Based on the basic input / output system, the operating status of the server during the power-on process is detected;
[0168] In response to the server's normal operating status and power-on completion, the server's hardware devices are initialized, and the boot device connected to the server's processor is determined through the target interface protocol.
[0169] Based on the boot device, allocate memory addresses for running the boot entry.
[0170] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0171] The first target file stores the text string in the user interface generated based on the corresponding startup item of the startup device. The text string is used to describe the option name corresponding to the startup item.
[0172] The layout path for the certificate and startup option used to verify the digital signature is stored in the second target file;
[0173] Use a third-party object file to associate the startup item with the corresponding executable program;
[0174] The first, second, and third target files are encapsulated to generate a set corresponding to the startup items.
[0175] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0176] Based on the set of boot items, determine the boot device corresponding to the set of boot items, as well as the processor port connected to the boot device;
[0177] The startup item set is associated with the corresponding processor port to generate a one-to-one mapping relationship.
[0178] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0179] Set the boot address of the boot sector corresponding to the first target boot device to the target identifier, and define the first target boot device as a boot device without boot function, so as to disable the boot entry corresponding to the first target boot device.
[0180] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0181] When allocating a boot path, in response to the fact that the second processor port is a processor port connected to the second target boot device, no boot path is allocated to the second processor port, and the second target boot device is defined as a boot device without boot function, so as to disable the boot entry corresponding to the second target boot device.
[0182] In one embodiment, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, performs the following steps:
[0183] S1: Obtain the first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with the second option name in the startup item set;
[0184] S2: In response to a successful comparison, based on the mapping relationship between the option name and the processor port, determine the first processor port corresponding to the second option name, and adjust the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port based on the target identifier;
[0185] S3: In response to the comparison failure, obtain the identifier of the second boot address of the boot sector corresponding to the second target boot device. In response to the second boot address identifier being the same as the target identifier, skip the second processor port connected to the second target boot device when allocating the boot path.
[0186] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0187] Based on the basic input / output system, a corresponding boot path is assigned to the second processor port connected to the second target boot device;
[0188] Based on the boot path, load the bootloader from the active partition of the second target boot device;
[0189] Based on the bootloader, the operating system kernel is loaded, and the operating system kernel is decompressed to obtain the target operating system kernel;
[0190] Based on the target operating system kernel, the hardware driver is initialized, and after the hardware driver initialization is complete, the boot entry corresponding to the second target boot device is run to generate the user interface.
[0191] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0192] Based on the basic input / output system, the operating status of the server during the power-on process is detected;
[0193] In response to the server's normal operating status and power-on completion, the server's hardware devices are initialized, and the boot device connected to the server's processor is determined through the target interface protocol.
[0194] Based on the boot device, allocate memory addresses for running the boot entry.
[0195] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0196] The first target file stores the text string in the user interface generated based on the corresponding startup item of the startup device. The text string is used to describe the option name corresponding to the startup item.
[0197] The layout path for the certificate and startup option used to verify the digital signature is stored in the second target file;
[0198] Use a third-party object file to associate the startup item with the corresponding executable program;
[0199] The first, second, and third target files are encapsulated to generate a set corresponding to the startup items.
[0200] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0201] Based on the set of boot items, determine the boot device corresponding to the set of boot items, as well as the processor port connected to the boot device;
[0202] The startup item set is associated with the corresponding processor port to generate a one-to-one mapping relationship.
[0203] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0204] Set the boot address of the boot sector corresponding to the first target boot device to the target identifier, and define the first target boot device as a boot device without boot function, so as to disable the boot entry corresponding to the first target boot device.
[0205] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0206] When allocating a boot path, in response to the fact that the second processor port is a processor port connected to the second target boot device, no boot path is allocated to the second processor port, and the second target boot device is defined as a boot device without boot function, so as to disable the boot entry corresponding to the second target boot device.
[0207] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0208] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0209] The embodiments described above are merely examples of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application.
Claims
1. A startup item management method, characterized in that, The method includes: Obtain the first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with the second option name in the startup item set; In response to a successful comparison, based on the mapping relationship between the option name and the processor port, the first processor port corresponding to the second option name is determined, and based on the target identifier, the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port is adjusted; In response to a comparison failure, the identifier of the second boot address of the boot sector corresponding to the second target boot device is obtained. In response to the second boot address identifier being the same as the target identifier, the second processor port connected to the second target boot device is skipped when allocating the boot path. Adjusting the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port based on the target identifier includes: Set the boot address of the boot sector corresponding to the first target boot device to the target identifier, and define the first target boot device as a boot device without boot function, so as to disable the boot item corresponding to the first target boot device; In response to the fact that the identifier of the second boot address is the same as the target identifier, skipping the second processor port connected to the second target boot device when allocating the boot path includes: When allocating a boot path, in response to the fact that the second processor port is a processor port connected to the second target boot device, no boot path is allocated to the second processor port, and the second target boot device is defined as a boot device without boot function, so as to disable the boot entry corresponding to the second target boot device.
2. The startup item management method according to claim 1, characterized in that, In response to the fact that the identifier of the second boot address is different from the target identifier, the method further includes: Based on the basic input / output system, a corresponding boot path is assigned to the second processor port connected to the second target boot device; Based on the boot path, load the bootloader from the active partition of the second target boot device; Based on the bootloader, the operating system kernel is loaded, and the operating system kernel is decompressed to obtain the target operating system kernel; Based on the target operating system kernel, the hardware driver is initialized, and after the hardware driver initialization is completed, the boot entry corresponding to the second target boot device is run to generate the user interface.
3. The startup item management method according to claim 1, characterized in that, Before obtaining the first option name of the startup item to be disabled and comparing the first option name of the startup item to be disabled with the second option name in the startup item set, the method further includes: Based on the basic input / output system, the operating status of the server during the power-on process is detected; In response to the server being in a normal operating state and having completed power-on, the server's hardware devices are initialized, and the boot device connected to the server's processor is determined through the target interface protocol. Based on the boot device, a memory address is allocated for running the boot item.
4. The startup item management method according to claim 1, characterized in that, Methods for generating the startup item set include: The first target file stores the text string in the user interface generated based on the startup item corresponding to the startup device, and the text string is used to describe the option name corresponding to the startup item; The layout path for the certificate and startup option used to verify the digital signature is stored in the second target file; Use a third-party object file to associate the startup item with the corresponding executable program; The first target file, the second target file, and the third target file are encapsulated to generate the set corresponding to the startup item.
5. The startup item management method according to claim 4, characterized in that, After generating the set of startup items, the method further includes: Based on the set of startup items, determine the startup device corresponding to the set of startup items, and the processor port connected to the startup device; The set of startup items is associated with the corresponding processor ports to generate a one-to-one mapping relationship.
6. A startup item management device for implementing the startup item management method as described in claim 1, characterized in that, The device includes: The data acquisition module is used to acquire the first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with the second option name in the startup item set; The boot address adjustment module is used to respond to a successful comparison, determine the first processor port corresponding to the second option name based on the mapping relationship between the option name and the processor port, and adjust the first boot address of the boot sector corresponding to the first target boot device connected to the first processor port based on the target identifier. The boot path allocation module is used to obtain the identifier of the second boot address of the boot sector corresponding to the second target boot device. In response to the fact that the identifier of the second boot address is the same as the target identifier, the second processor port connected to the second target boot device is skipped when allocating the boot path.
7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Method and device for forbidding self-starting of startup project
CN102999343A
Method and device for filtering starting items of operation system
CN107944264A