Startup item management method and device, computer equipment and storage medium
By comparing and mapping the option names of the processor ports and startup items, adjusting the boot address of the boot sector or skipping unnecessary startup path allocation, the problem of inefficient disabling server startup items in the prior art is solved, and efficient startup item management is achieved.
Patent Information
- Application Number
- CN202411851897.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-16
AI Technical Summary
It is difficult to effectively disable multiple startup devices on the server in the prior art, especially when testing the PXE boot capability of a certain port, it is difficult to quickly and accurately identify the startup items corresponding to the port to be tested, resulting in high labor and time costs.
By obtaining the option name of the startup item to be disabled, comparing it with other option names in the startup item collection, adjusting the boot address of the boot sector or skipping unnecessary startup path allocation based on the mapping relationship between the processor port and the option name, to disable the target startup item.
It realizes saving manpower and time costs on the basis of ensuring the accuracy of disabling startup items, and improves the efficiency of startup items management.
Smart Images

Figure CN119806657A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a startup item management method, apparatus, computer equipment and storage medium. Background Art
[0002] Multiple boot devices are often installed on a server at the same time. The required target boot device is selected from the above multiple boot devices according to actual application requirements to enter different operating systems. In order to prevent accidental entry into the wrong operating system, the boot items corresponding to the remaining boot devices that are temporarily unused other than the target boot device need to be disabled to avoid 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 created startup item list, but neither of these two methods solves the startup problem of the PCIE (Peripheral Component Interconnect Express) port derived 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 the disk of a certain port or enter the disk of a certain port for debugging, etc., the current related technologies mainly close the disks with the same name one by one in sequence, or unplug other disks first, or put the disk of this port on other system disks that do not have the same information for operation, which takes a lot of time and effort. In addition, when testing the PXE (Preboot eXecution Environment) boot capability of a port, if there is an identical network card, it is difficult to quickly and accurately identify the startup item corresponding to the port to be tested. Summary of the invention
[0004] Based on this, 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 technical problems.
[0005] In a first aspect, a startup item management method is provided, the method comprising:
[0006] Obtain a first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with a second option name in the startup item set;
[0007] In response to the comparison being successful, determining a first processor port corresponding to the second option name based on a mapping relationship between the option name and the processor port, and adjusting a first boot address of a boot sector corresponding to a first target boot device connected to the first processor port based on the target identifier;
[0008] In response to the comparison failure, an identifier of a second boot address of a boot sector corresponding to the second target boot device is obtained, and in response to the identifier of the second boot address being the same as the target identifier, a second processor port connected to the second target boot device is skipped when allocating a boot path.
[0009] Optionally, in response to the identifier of the second boot address being different from the target identifier, the method further comprises:
[0010] Based on the basic input and output system, assigning a corresponding boot path to a second processor port connected to a second target boot device;
[0011] Based on the boot path, loading a boot program from an active partition of a second target boot device;
[0012] Based on the boot program, the operating system kernel is loaded and 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 is initialized, the startup item corresponding to the second target startup device is run to generate a user interface.
[0014] Optionally, 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:
[0015] Based on the basic input and output system, the running status of the server during power-on is detected;
[0016] In response to the running state of the server being normal and having been powered on, initializing the hardware device of the server, and determining a boot device connected to a processor of the server through a target interface protocol;
[0017] Based on the boot device, the memory address allocated to run the boot item.
[0018] Optionally, the method for generating a startup item set includes:
[0019] Using the first target file to store a text string in a user interface generated based on a startup item corresponding to a startup device, the text string is used to describe an option name corresponding to the startup item;
[0020] Using the second target file to store the certificate for verifying the digital signature and the layout path of the options corresponding to the startup item;
[0021] Associating the running program corresponding to the startup item with the third target file;
[0022] The first target file, the second target file, and the third target file are encapsulated to generate a set corresponding to the startup item.
[0023] Optionally, after generating the startup item set, the method further includes:
[0024] Based on the startup item set, determining a startup device corresponding to the startup item set and a processor port connected to the startup device;
[0025] The boot 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 a first boot address of a boot sector corresponding to a first target boot device connected to the first processor port based on the target identifier includes:
[0027] The boot addresses of the boot sectors corresponding to the first target boot device are all set as target identifiers, and the first target boot device is defined as a boot device without a boot function, so as to disable the boot item corresponding to the first target boot device.
[0028] Optionally, in response to the identifier of the second boot address being the same as the target identifier, when allocating the boot path, skipping the second processor port connected to the second target boot device includes:
[0029] When allocating a boot path, in response to the second processor port being a processor port connected to a 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 a boot function to disable the boot item corresponding to the second target boot device.
[0030] In a second aspect, a startup item management device is provided, the device comprising:
[0031] A data acquisition module, used to acquire a first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with a second option name in the startup item set;
[0032] a boot address adjustment module, configured to, in response to successful comparison, determine a first processor port corresponding to the second option name based on a mapping relationship between the option name and the processor port, and adjust a first boot address of a boot sector corresponding to a first target boot device connected to the first processor port based on a 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, and in response to the identifier of the second boot address being the same as the target identifier, skip the second processor port connected to the second target boot device when allocating the boot path.
[0034] In a third aspect, 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 implements the following steps when executing the computer program:
[0035] Obtain a first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with a second option name in the startup item set;
[0036] In response to the comparison being successful, determining a first processor port corresponding to the second option name based on a mapping relationship between the option name and the processor port, and adjusting a first boot address of a boot sector corresponding to a first target boot device connected to the first processor port based on the target identifier;
[0037] In response to the comparison failure, an identifier of a second boot address of a boot sector corresponding to the second target boot device is obtained, and in response to the identifier of the second boot address being the same as the target identifier, a second processor port connected to the second target boot device is skipped when allocating a boot path.
[0038] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0039] Obtain a first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with a second option name in the startup item set;
[0040] In response to the comparison being successful, determining a first processor port corresponding to the second option name based on a mapping relationship between the option name and the processor port, and adjusting a first boot address of a boot sector corresponding to a first target boot device connected to the first processor port based on the target identifier;
[0041] In response to the comparison failure, an identifier of a second boot address of a boot sector corresponding to the second target boot device is obtained, and in response to the identifier of the second boot address being the same as the target identifier, a second processor port connected to the second target boot device is skipped when allocating a boot path.
[0042] In a fifth aspect, a computer program product is provided, the computer program product comprising a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0043] Obtain a first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with a second option name in the startup item set;
[0044] In response to the comparison being successful, determining a first processor port corresponding to the second option name based on a mapping relationship between the option name and the processor port, and adjusting a first boot address of a boot sector corresponding to a first target boot device connected to the first processor port based on the target identifier;
[0045] In response to the comparison failure, an identifier of a second boot address of a boot sector corresponding to the second target boot device is obtained, and in response to the identifier of the second boot address being the same as the target identifier, a second processor port connected to the second target boot device is skipped when allocating a boot path.
[0046] The above-mentioned startup item management method, device, computer equipment and storage medium, the method includes: obtaining the first option name of the startup item to be disabled, comparing 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, determining the first processor port corresponding to the second option name, and based on the target identifier, adjusting the first boot address of the boot sector corresponding to the first target startup device connected to the first processor port; in response to a failed comparison, obtaining the identifier of the second boot address of the boot sector corresponding to the second target startup device, and in response to the identifier of the second boot address being the same as the target identifier, skipping the second processor port connected to the second target startup device when allocating the startup path. The present application is based on a double confirmation mechanism to determine the boot address that needs to be adjusted or the startup path allocation port that needs to be adjusted, and adjust it to disable the startup item corresponding to the startup device, thereby improving efficiency and saving manpower and time costs on the basis of ensuring the accuracy of disabling the startup item. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 An application environment diagram of a startup item management method in an embodiment;
[0048] Figure 2 A flowchart of a startup item management method in one embodiment;
[0049] Figure 3 is another flowchart of a startup item management method in one embodiment;
[0050] Figure 4 A schematic diagram of the overall structure between a CPU structure topology diagram and peripheral devices of a startup item management method in an embodiment;
[0051] Figure 5A schematic diagram of a flow chart of a method for generating a collection of startup item management methods in one embodiment;
[0052] Figure 6 is a structural block diagram of a startup item management device in an embodiment;
[0053] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0055] It should be understood that in the description of the present application, unless the context clearly requires otherwise, words such as "include", "comprises", and the like throughout the specification should be interpreted as including rather than being exclusive or exhaustive; that is, as including but not limited to.
[0056] It should also be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.
[0057] It should be noted that the terms "S1", "S2", etc. are only used for the purpose of describing the steps, and do not specifically refer to the order or sequence, nor are they used to limit the present application. They are only for the convenience of describing the method of the present application, and cannot be understood as indicating the order of the steps. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present application.
[0058] The characteristic of BIOS (Basic Input Output System) startup item is that it can manage the ability to load operating systems from different devices during the computer startup process; BIOS has two startup modes, namely UEFI (Unified Extensible Firmware Interface) mode and Legacy (traditional startup mode under BIOS) mode to manage the startup server. In these two startup modes, all startup devices can be classified into four startup types, namely: hard disk startup type, network card device startup type, optical drive disk startup type and other device types, such as USB (Universal Serial Bus) startup type. Different startup types can enable the server to enter the operating system (OS) through different media. System), according to the background technology, for disabling server startup items, in order to avoid the risk of entering the wrong operating system, the related technology realizes the disabling of server startup items by modifying the order of startup items or adjusting the created startup item list. Specifically, the disabling of server startup items is realized by modifying the order of startup items and then performing cyclic startup. For example, when the required target startup device is a network card device, the startup item order can be adjusted first, that is, the network card is set as the first startup item, and then the network card is turned on for polling, so as to realize cyclic startup of the single startup type of the network card, so as to avoid booting the wrong hard disk device or other startup device into the wrong operating system due to the failure of the network card startup, wherein each network card can be connected to the network through a network cable to boot For different operating systems, if you want to disable the startup items corresponding to some of the network cards, you can disable the network card and turn off the network card startup device to achieve this. The created startup item list is adjusted specifically by marking the disabled startup items to delete the disabled startup items in the startup item list, and then starting the startup items in the startup item list from which the disabled startup items have been deleted to achieve startup item disabling. However, although the related technologies have achieved the opening or closing of startup items, the problems described in the background technology still exist. For example, when testing the PXE boot capability of a port, either all network card PXE startup items are first closed, and then opened one by one to verify whether it is the port to be tested, or the boot of PXErom (a built-in BOOT ROM chip on the client computer network card) is closed, which is similar to removing the function of the network card. Although the purpose can be achieved, it also deviates from the original intention of startup item control.
[0059] To solve the above technical problems, the present application provides a startup item management method, apparatus, device and storage medium. Compared with the existing solution of confirming the option name from a uni file, the present application directly controls the boot address or boot path of the CPU direct-out port device boot sector to poll the specified CPU port device, and performs a method of double confirmation without configuring the path. This can effectively disable the startup item corresponding to the boot device, thereby improving efficiency and saving manpower and time costs while ensuring the accuracy of disabling the startup item.
[0060] The startup item management method provided in this application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the data processing platform set on the server 104 through the network, wherein the terminal 102 can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0061] In one embodiment, Figure 2-Figure 3 As shown, a startup item management method is provided, which is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0062] S1: Obtain a first option name of a startup item to be disabled, and compare the first option name of the startup item to be disabled with a second option name in a startup item set.
[0063] It should be noted that startup items refer to programs that are automatically loaded and run by the system when the computer is turned on. These programs are usually automatically started before or after the user logs in to provide specific functions or services when the operating system starts. The startup items to be disabled are determined by the startup item disable request issued by the user according to the needs. The startup device corresponding to the startup item is also called the boot device, which refers to the hardware device used to boot the operating system after the computer is turned on, such as SATA hard disk devices (serial hard disks), NVMe hard disk devices (solid-state hard disks), and PCIe hard disk devices composed of network cards and RAID cards (independent hard disk redundant array cards). These hardware devices are led out by the port group of the CPU, such as Figure 4As shown, the relationship between the structural topology of the CPU and the peripheral hardware devices is shown, wherein the CPU is divided into multiple x16 groups, which can be named P0, P1 and P2 respectively. These groups can be configured as SATA channel protocol or NVME device channel protocol or PCIE channel protocol respectively. PCIE devices include information devices such as network cards and raid cards that contain boot item FW; the option name of the boot item is the name corresponding to the option constructed based on the above-mentioned divided groups, such as P0 port boot option control, P1 port boot option control, etc. The boot item name can be used to describe its corresponding boot device, and comparing the first option name of the boot item to be disabled with the second option name in the boot item set refers to comparing the first option name of the boot item to be disabled with the option name of the boot item set corresponding to all boot items in the server.
[0064] In some specific embodiments, Figure 3 As shown, 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:
[0065] Based on the basic input and output system, the running status of the server during power-on is detected. The basic input and output system refers to the BIOS. When the user presses the power button, the server starts to power on. 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 running in a normal state and having been powered on, the server hardware devices (such as memory, CPU and PCIE devices, etc.) are initialized to set their basic parameters, and the boot device connected to the server processor is determined through the target interface protocol, that is, the connected hard disk device is identified through interface protocols such as SATA and PCIE, such as the connected SATA hard disk device is identified through the SATA interface protocol, the connected NVMe hard disk 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 item, that is, a memory address allocated to the boot item FW corresponding to the network card for execution.
[0068] In some specific implementations, the method for generating a startup item set includes:
[0069] Using the first target file to store a text string in a user interface generated based on a startup item corresponding to a startup device, the text string is used to describe an option name corresponding to the startup item, wherein the first target file is a UNI file, which is a file type used to implement a user interaction interface in UEFI development, and is mainly used for localization support;
[0070] Using the second target file to store the certificate for verifying the digital signature and the layout path of the options corresponding to the startup item, wherein the second target file refers to an SD file (a file in a flash card format);
[0071] Using the third target file to associate the running program corresponding to the startup item, wherein the third target file refers to the c file;
[0072] The first target file, the second target file, and the third target file are encapsulated to generate a set corresponding to the boot device, wherein the encapsulation operation is performed through a Make file.
[0073] Specifically, Figure 5 As shown, under BIOS setup (BIOS setup program), a new option for controlling and generating boot items corresponding to each CPU group P0, P1 and P2 is created, including the following steps: first, the text string in the display user interface is stored through the UNI file, and the UNI file can be dynamically loaded during the startup process. Therefore, the string of a specific language can be loaded as needed, without having to pre-load the strings of all languages. The control options are named P0 port boot option control, P1 port boot option control, etc., and so on. Based on this, the boot item names that can be seen in the BIOS setup interface can be confirmed; then, the certificate for verifying the digital signature and the layout path of the definition option under setup are stored through the SD file to ensure that only the signed firmware and operating system can load the boot item, and the position of the option under BIOS setup is also fixed; furthermore, the c file is used to associate the specific implementation function of the boot item, that is, the corresponding running program; finally, the Make file is used to encapsulate this function into a collection for easy calling during the startup process.
[0074] In some specific implementations, after generating the startup item set, the method further includes:
[0075] Based on the startup item set, determine the startup device corresponding to the startup item set and the processor port connected to the startup device, wherein the startup device corresponding to the startup item can be determined according to the option name in the startup item set, and each startup device is connected to a corresponding processor port, which is the CPU port;
[0076] The boot item set is associated with the corresponding processor port to generate a one-to-one mapping relationship.
[0077] In the above implementation, by performing a power-on self-test operation, the reliability of the system operation can be improved. By constructing a set corresponding to the startup items, it is used 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, so as to improve the processing efficiency of the startup item management request.
[0078] S2: In response to 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 belongs to a storage device and has corresponding sectors. The first sector of the hard disk is called the boot sector, which contains the master boot record (MBR) or the GUID partition table (GPT). The MBR contains a small code segment of a boot loader and partition table information. For a hard disk using a GPT partition table, the first sector contains GPT header information. A GPT hard disk usually contains an EFI system partition (ESP) for storing 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 the option name and the processor port 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 compared, the first processor port associated with it can be determined by the set corresponding to the second option name.
[0080] In some specific implementations, adjusting a first boot address of a boot sector corresponding to a first target boot device connected to a first processor port based on a target identifier includes:
[0081] The boot addresses of the boot sectors corresponding to the first target boot device are all set as target identifiers, and the first target boot device is defined as a boot device without a boot function, so as to disable the boot item 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 the 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, when the boot address is 0x7C00, 0x7C00 is adjusted to 000000 or 0, so that the first target boot device cannot boot the running program corresponding to the boot item to be disabled, that is, the first target boot device is changed 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 the startup item that needs to be disabled, the boot address of the boot sector of the corresponding startup device is directly adjusted to achieve the disabling of the startup item, which can further improve the execution efficiency of the startup item disabling operation.
[0084] S3: In response to the comparison failure, obtaining an identifier of a second boot address of a boot sector corresponding to the second target boot device, and in response to the identifier of the second boot address being the same as the target identifier, skipping a second processor port connected to the second target boot device when allocating a boot path.
[0085] It should be noted that, similar to the above steps, 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 have not been successfully matched with the first option name.
[0086] In some specific embodiments, in response to the identifier of the second boot address being the same as the target identifier, when allocating the boot path, skipping the second processor port connected to the second target boot device includes:
[0087] When allocating a boot path, in response to the second processor port being a processor port connected to a 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 a boot function to disable the boot item corresponding to the second target boot device.
[0088] Specifically, when the option name of the boot item corresponding to the second target boot device fails to be successfully compared with the first option name, the content of the boot sector of the second target boot device is loaded through the BIOS to extract the boot address corresponding to the boot sector. If the identifiers of the boot addresses are all target identifiers, that is, the boot address is 000000 or 0, indicating that the boot address will not jump to the corresponding boot path, then when the boot path assigned to the system polls the CPU port corresponding to the second target boot device, the boot path is not configured for it, thereby making the second target boot device become an ordinary boot device without boot function, thereby achieving the disabling of the boot item corresponding to the second target boot device.
[0089] In some embodiments, in response to the identifier of the second boot address being different from the target identifier, the method further comprises:
[0090] Based on the basic input and output system, assigning a corresponding boot path to a second processor port connected to a second target boot device;
[0091] Based on the boot path, loading a boot program from an active partition of a second target boot device;
[0092] Based on the boot program, the operating system kernel is loaded and 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 is initialized, the startup item corresponding to the second target startup device is run to generate a user interface.
[0094] Specifically, the boot program selects an active partition according to the partition table information, and loads the operating system-specific boot program (such as GRUB, Windows Boot Manager, etc.) from the active partition, that is, the BIOS loads the EFI boot program from the EFI system partition, the EFI system boot program is responsible for loading the core part of the operating system, and 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, the hardware drivers, including the hard disk driver, etc., are initialized. After the initialization operation is completed, the system services and applications are loaded, that is, the boot item corresponding to the second target boot device is run, and finally the user interface is presented; further, in the Windows system, the boot configuration information is stored in the BCD (Binary-Coded Decimal, binary file) file, which is located in the EFI system partition, and in the Linux system, the boot configuration information is stored in the / boot / grub / grub.cfg file, which is generated by GRUB. When a new device is detected, the operating system generates a corresponding boot item based on the configuration file of the boot item to ensure that the user can choose to start the corresponding boot item from these devices.
[0095] In the above implementation, a double confirmation mechanism is used, that is, a preliminary confirmation is made on whether the startup item of the startup device in the server needs to be disabled through the option name, and a further confirmation is made on whether the startup item of the startup device needs to be disabled through the boot address in the startup device, so as to avoid entering the wrong operating system, improve the accuracy of disabling the startup item, optimize the startup speed of the system, and when it is confirmed that the startup item is a startup item that does not need to be disabled, the running program corresponding to the startup item is executed to meet user needs and improve user experience.
[0096] In some embodiments, the method further comprises:
[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 disabled duration. The target time period can be set according to actual needs, such as one week, one month, etc.;
[0098] In response to detecting that the number of bans is greater than the first preset threshold within the target time period, the values corresponding to the number of bans and the ban duration are normalized, and a value is assigned to the time node to which the ban belongs based on expert experience, and the assigned value is normalized, wherein the assignment standard is that if the time node is on a weekday morning, a larger value is assigned, if it is on a weekday afternoon, a smaller value is assigned, and if it is on a weekend, the smallest value is assigned. The first preset threshold can be set according to actual needs, such as 50 times, etc., and the target time period is a time period within the target time period, such as one day, etc.;
[0099] The normalized value is input into the objective function to obtain the target value, where 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, X1, X2 and X3 are the number of bans, the value of the time node to which the ban belongs and the ban duration respectively;
[0100] In response to detecting that the target value is 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 the next time the server is restarted, without further confirmation of whether the startup item of the target startup device needs to be disabled, wherein the second preset threshold can be set according to actual needs.
[0101] In the above implementation, the startup items that can be directly disabled are marked by the above rules, so that there is no need to double-confirm the startup items when the system is running, which further improves the efficiency of startup item management.
[0102] In the above-mentioned startup item management method, the method includes: obtaining a first option name of the startup item to be disabled, and comparing the first option name of the startup item to be disabled with a second option name in the startup item set; in response to a successful comparison, determining the first processor port corresponding to the second option name based on a mapping relationship between the option name and the processor port, and adjusting the first boot address of the boot sector corresponding to the first target startup device connected to the first processor port based on the target identifier; in response to a failed comparison, obtaining an identifier of a second boot address of the boot sector corresponding to the second target startup device, and in response to the identifier of the second boot address being the same as the target identifier, skipping the second processor port connected to the second target startup device when allocating the startup path.
[0103] It should be understood that although Figure 2-Figure 5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-Figure 5At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed 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 part of the sub-steps or stages of other steps.
[0104] In one embodiment, Figure 6 As shown, a boot item management device is provided, including: a data acquisition module, a boot address adjustment module and a boot path allocation module, wherein:
[0105] A data acquisition module, used to acquire a first option name of the startup item to be disabled, and compare the first option name of the startup item to be disabled with a second option name in the startup item set;
[0106] a boot address adjustment module, configured to, in response to successful comparison, determine a first processor port corresponding to the second option name based on a mapping relationship between the option name and the processor port, and adjust a first boot address of a boot sector corresponding to a first target boot device connected to the first processor port based on a 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, and in response to the identifier of the second boot address being the same as the target identifier, skip the second processor port connected to the second target boot device when allocating the boot path.
[0108] As a preferred implementation, in the embodiment of the present invention, the device further includes a user interface generation module, and the user interface generation module is specifically used to:
[0109] Based on the basic input and output system, assigning a corresponding boot path to a second processor port connected to a second target boot device;
[0110] Based on the boot path, loading a boot program from an active partition of a second target boot device;
[0111] Based on the boot program, the operating system kernel is loaded and 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 is initialized, the startup item corresponding to the second target startup device is run to generate a user interface.
[0113] As a preferred implementation, in the embodiment of the present invention, the device further includes a system initialization module, and the system initialization module is specifically used for:
[0114] Based on the basic input and output system, the running status of the server during power-on is detected;
[0115] In response to the running state of the server being normal and having been powered on, initializing the hardware device of the server, and determining a boot device connected to a processor of the server through a target interface protocol;
[0116] Based on the boot device, the memory address allocated to run the boot item.
[0117] As a preferred implementation, in the embodiment of the present invention, the device further includes a set generation module, and the set generation module is specifically used for:
[0118] Using the first target file to store a text string in a user interface generated based on a startup item corresponding to a startup device, the text string is used to describe an option name corresponding to the startup item;
[0119] Using the second target file to store the certificate for verifying the digital signature and the layout path of the options corresponding to the startup item;
[0120] Associating the running program corresponding to the startup item with the third target file;
[0121] The first target file, the second target file, and the third target file are encapsulated to generate a set corresponding to the startup item.
[0122] As a preferred implementation, in the embodiment of the present invention, the set generation module is further used to:
[0123] Based on the startup item set, determining a startup device corresponding to the startup item set and a processor port connected to the startup device;
[0124] The boot item set is associated with the corresponding processor port to generate a one-to-one mapping relationship.
[0125] As a preferred implementation, in the embodiment of the present invention, the boot address adjustment module is specifically used for:
[0126] The boot addresses of the boot sectors corresponding to the first target boot device are all set as target identifiers, and the first target boot device is defined as a boot device without a boot function, so as to disable the boot item corresponding to the first target boot device.
[0127] As a preferred implementation, in the embodiment of the present invention, the startup path allocation module is specifically used for:
[0128] When allocating a boot path, in response to the second processor port being a processor port connected to a 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 a boot function to disable the boot item corresponding to the second target boot device.
[0129] For the specific definition of the startup item management device, please refer to the definition of the startup item management method above, which will not be repeated here. Each module in the above startup item management device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0130] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a startup item management method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0131] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[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 implements the following steps when executing the computer program:
[0133] S1: Obtain a first option name of a startup item to be disabled, and compare the first option name of the startup item to be disabled with a second option name in a startup item set;
[0134] S2: in response to the comparison being successful, determining a first processor port corresponding to the second option name based on a mapping relationship between the option name and the processor port, and adjusting a first boot address of a boot sector corresponding to a first target boot device connected to the first processor port based on the target identifier;
[0135] S3: In response to the comparison failure, obtaining an identifier of a second boot address of a boot sector corresponding to the second target boot device, and in response to the identifier of the second boot address being the same as the target identifier, skipping a second processor port connected to the second target boot device when allocating a boot path.
[0136] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0137] Based on the basic input and output system, assigning a corresponding boot path to a second processor port connected to a second target boot device;
[0138] Based on the boot path, loading a boot program from an active partition of a second target boot device;
[0139] Based on the boot program, the operating system kernel is loaded and 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 is initialized, the startup item corresponding to the second target startup device is run to generate a user interface.
[0141] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0142] Based on the basic input and output system, the running status of the server during power-on is detected;
[0143] In response to the running state of the server being normal and having been powered on, initializing the hardware device of the server, and determining a boot device connected to a processor of the server through a target interface protocol;
[0144] Based on the boot device, the memory address allocated to run the boot item.
[0145] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0146] Using the first target file to store a text string in a user interface generated based on a startup item corresponding to a startup device, the text string is used to describe an option name corresponding to the startup item;
[0147] Using the second target file to store the certificate for verifying the digital signature and the layout path of the options corresponding to the startup item;
[0148] Associating the running program corresponding to the startup item with the third target file;
[0149] The first target file, the second target file, and the third target file are encapsulated to generate a set corresponding to the startup item.
[0150] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0151] Based on the startup item set, determining a startup device corresponding to the startup item set and a processor port connected to the startup device;
[0152] The boot item set is associated with the corresponding processor port to generate a one-to-one mapping relationship.
[0153] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0154] The boot addresses of the boot sectors corresponding to the first target boot device are all set as target identifiers, and the first target boot device is defined as a boot device without a boot function, so as to disable the boot item corresponding to the first target boot device.
[0155] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0156] When allocating a boot path, in response to the second processor port being a processor port connected to a 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 a boot function to disable the boot item corresponding to the second target boot device.
[0157] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0158] S1: Obtain a first option name of a startup item to be disabled, and compare the first option name of the startup item to be disabled with a second option name in a startup item set;
[0159] S2: in response to the comparison being successful, determining a first processor port corresponding to the second option name based on a mapping relationship between the option name and the processor port, and adjusting a first boot address of a boot sector corresponding to a first target boot device connected to the first processor port based on the target identifier;
[0160] S3: In response to the comparison failure, obtaining an identifier of a second boot address of a boot sector corresponding to the second target boot device, and in response to the identifier of the second boot address being the same as the target identifier, skipping a second processor port connected to the second target boot device when allocating a boot path.
[0161] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0162] Based on the basic input and output system, assigning a corresponding boot path to a second processor port connected to a second target boot device;
[0163] Based on the boot path, loading a boot program from an active partition of a second target boot device;
[0164] Based on the boot program, the operating system kernel is loaded and 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 is initialized, the startup item corresponding to the second target startup device is run to generate a user interface.
[0166] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0167] Based on the basic input and output system, the running status of the server during power-on is detected;
[0168] In response to the running state of the server being normal and having been powered on, initializing the hardware device of the server, and determining a boot device connected to a processor of the server through a target interface protocol;
[0169] Based on the boot device, the memory address allocated to run the boot item.
[0170] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0171] Using the first target file to store a text string in a user interface generated based on a startup item corresponding to a startup device, the text string is used to describe an option name corresponding to the startup item;
[0172] Using the second target file to store the certificate for verifying the digital signature and the layout path of the options corresponding to the startup item;
[0173] Associating the running program corresponding to the startup item with the third target file;
[0174] The first target file, the second target file, and the third target file are encapsulated to generate a set corresponding to the startup item.
[0175] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0176] Based on the startup item set, determining a startup device corresponding to the startup item set and a processor port connected to the startup device;
[0177] The boot 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, the following steps are also implemented:
[0179] The boot addresses of the boot sectors corresponding to the first target boot device are all set as target identifiers, and the first target boot device is defined as a boot device without a boot function, so as to disable the boot item corresponding to the first target boot device.
[0180] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0181] When allocating a boot path, in response to the second processor port being a processor port connected to a 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 a boot function to disable the boot item 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, the computer program when executed by a processor implements the following steps:
[0183] S1: Obtain a first option name of a startup item to be disabled, and compare the first option name of the startup item to be disabled with a second option name in a startup item set;
[0184] S2: in response to the comparison being successful, determining a first processor port corresponding to the second option name based on a mapping relationship between the option name and the processor port, and adjusting a first boot address of a boot sector corresponding to a first target boot device connected to the first processor port based on the target identifier;
[0185] S3: In response to the comparison failure, obtaining an identifier of a second boot address of a boot sector corresponding to the second target boot device, and in response to the identifier of the second boot address being the same as the target identifier, skipping a second processor port connected to the second target boot device when allocating a boot path.
[0186] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0187] Based on the basic input and output system, assigning a corresponding boot path to a second processor port connected to a second target boot device;
[0188] Based on the boot path, loading a boot program from an active partition of a second target boot device;
[0189] Based on the boot program, the operating system kernel is loaded and 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 is initialized, the startup item corresponding to the second target startup device is run to generate a user interface.
[0191] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0192] Based on the basic input and output system, the running status of the server during power-on is detected;
[0193] In response to the running state of the server being normal and having been powered on, initializing the hardware device of the server, and determining a boot device connected to a processor of the server through a target interface protocol;
[0194] Based on the boot device, the memory address allocated to run the boot item.
[0195] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0196] Using the first target file to store a text string in a user interface generated based on a startup item corresponding to a startup device, the text string is used to describe an option name corresponding to the startup item;
[0197] Using the second target file to store the certificate for verifying the digital signature and the layout path of the options corresponding to the startup item;
[0198] Associating the running program corresponding to the startup item with the third target file;
[0199] The first target file, the second target file, and the third target file are encapsulated to generate a set corresponding to the startup item.
[0200] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0201] Based on the startup item set, determining a startup device corresponding to the startup item set and a processor port connected to the startup device;
[0202] The boot 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, the following steps are also implemented:
[0204] The boot addresses of the boot sectors corresponding to the first target boot device are all set as target identifiers, and the first target boot device is defined as a boot device without a boot function, so as to disable the boot item corresponding to the first target boot device.
[0205] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0206] When allocating a boot path, in response to the second processor port being a processor port connected to a 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 a boot function to disable the boot item corresponding to the second target boot device.
[0207] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database 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. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0208] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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 above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application.
Claims
1. A startup item management method, characterized in that: The method comprises: Obtaining a first option name of a startup item to be disabled, and comparing the first option name of the startup item to be disabled with a second option name in the startup item set; In response to the comparison being successful, determining a first processor port corresponding to the second option name based on a mapping relationship between option names and processor ports, and adjusting a first boot address of a boot sector corresponding to a first target boot device connected to the first processor port based on a target identifier; In response to the comparison failure, obtaining an identifier of a second boot address of a boot sector corresponding to a second target boot device, and in response to the identifier of the second boot address being the same as the target identifier, skipping a second processor port connected to the second target boot device when allocating a boot path.
2. The startup item management method according to claim 1, characterized in that: In response to the identifier of the second boot address being different from the target identifier, the method further comprises: Based on the basic input and output system, assigning a corresponding boot path to a second processor port connected to the second target boot device; Based on the boot path, loading a boot program from an active partition of the second target boot device; Based on the boot program, load the operating system kernel, and perform a decompression operation on the operating system kernel to obtain a target operating system kernel; Based on the target operating system kernel, a hardware driver is initialized, and after the hardware driver is initialized, a startup item corresponding to the second target startup device is run to generate a 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 and output system, the running status of the server during power-on is detected; In response to the running state of the server being normal and having been powered on, initializing the hardware device of the server, and determining a boot device connected to a processor of the server through a target interface protocol; Based on the boot device, a memory address for running the boot item is allocated.
4. The startup item management method according to claim 1, characterized in that: The method for generating a startup item set includes: Using the first target file to store a text string in a user interface generated based on a startup item corresponding to a startup device, the text string is used to describe an option name corresponding to the startup item; Using the second target file to store the certificate for verifying the digital signature and the layout path of the options corresponding to the startup item; Associating the running program corresponding to the startup item with the third target file; The first target file, the second target file and the third target file are encapsulated to generate a set corresponding to the startup item.
5. The startup item management method according to claim 4, characterized in that: After generating the startup item set, the method further includes: Based on the startup item set, determining a startup device corresponding to the startup item set and a processor port connected to the startup device; The boot item set is associated with the corresponding processor port to generate a one-to-one mapping relationship.
6. The startup item management method according to claim 1, characterized in that: Based on the target identifier, adjusting a first boot address of a boot sector corresponding to a first target boot device connected to the first processor port based on the target identifier includes: The boot addresses of the boot sectors corresponding to the first target boot device are all set as target identifiers, and the first target boot device is defined as a boot device without a boot function, so as to disable the boot item corresponding to the first target boot device.
7. The startup item management method according to claim 1, characterized in that: In response to the identifier of the second boot address being the same as the target identifier, when allocating a boot path, skipping a second processor port connected to the second target boot device comprises: When allocating a boot path, in response to the second processor port being 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 a boot function to disable the boot item corresponding to the second target boot device.
8. A startup item management device, characterized in that: The device comprises: A data acquisition module, used for acquiring a first option name of a startup item to be disabled, and comparing the first option name of the startup item to be disabled with a second option name in the startup item set; a boot address adjustment module, configured to, in response to successful comparison, determine a first processor port corresponding to the second option name based on a mapping relationship between option names and processor ports, and adjust a first boot address of a boot sector corresponding to a first target boot device connected to the first processor port based on a target identifier; The boot path allocation module is used to obtain an identifier of a second boot address of a boot sector corresponding to a second target boot device, and in response to the identifier of the second boot address being the same as the target identifier, skip a second processor port connected to the second target boot device when allocating a boot path.
9. 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, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
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
Startup item changing method and system and storage medium
CN113127076A
USB device identification method, terminal device and system
CN115729629A
Startup item disabling method and device, equipment and storage medium
CN117608691A
Cited By
Control method of high-speed serial extension equipment and electronic equipment
CN120848967A