CN112540889B - Method, device, equipment and medium for adjusting hard disk starting sequence in user mode - Google Patents

Method, device, equipment and medium for adjusting hard disk starting sequence in user mode Download PDF

Info

Publication number
CN112540889B
CN112540889B CN202011529562.7A CN202011529562A CN112540889B CN 112540889 B CN112540889 B CN 112540889B CN 202011529562 A CN202011529562 A CN 202011529562A CN 112540889 B CN112540889 B CN 112540889B
Authority
CN
China
Prior art keywords
hard disk
tested
identifier
starting
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011529562.7A
Other languages
Chinese (zh)
Other versions
CN112540889A (en
Inventor
吴明桓
梁灿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Guoke Microelectronics Co ltd
Original Assignee
Jiangsu Guoke Microelectronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Guoke Microelectronics Co ltd filed Critical Jiangsu Guoke Microelectronics Co ltd
Priority to CN202011529562.7A priority Critical patent/CN112540889B/en
Publication of CN112540889A publication Critical patent/CN112540889A/en
Application granted granted Critical
Publication of CN112540889B publication Critical patent/CN112540889B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a method, a device, equipment and a medium for adjusting the starting sequence of a hard disk in a user mode, wherein the method comprises the following steps: acquiring a hard disk test instruction input by a user in a user state; determining whether a first starting item corresponding to a target hard disk to be tested exists in the test host or not based on the first disk character; if the first starting item corresponding to the target hard disk to be tested does not exist in the test host, the first starting item corresponding to the target hard disk to be tested is created; adding a first startup item identifier of a first startup item corresponding to a target hard disk to be tested to a first position of a UEFI Boot Order of a test host, and adding a second startup item identifier corresponding to a hard disk storing a main program to a second position of the UEFI Boot Order, wherein the first position is in front of the second position so as to start the target hard disk to be tested before starting the hard disk storing the test main program. Thus, the starting sequence of the hard disk can be adjusted in a user mode.

Description

Method, device, equipment and medium for adjusting hard disk starting sequence in user mode
Technical Field
The present application relates to the field of hard disk testing technologies, and in particular, to a method, an apparatus, a device, and a medium for adjusting a hard disk startup sequence in a user mode.
Background
The PC (Personal Computer ) now has two modes of startup, legacy BIOS (Basic Input Output System ) and UEFI (Unified Extensible Firmware Interface, unified extensible firmware interface) BIOS modes. UEFI is compatible with old Legacy BIOS as a new BIOS technology. For the traditional Legacy mode, the BIOS interface during the startup process can adjust the startup sequence, but cannot be adjusted by the user program after the startup is completed. And interfaces that UEFI provides to the system include Boot Services (Boot Services) and run-time Services (run Services). The run time Services include reading and writing UEFI system variables, and the Boot Order is one of the system variables. However, when the test is started in the existing Boot Order, the directly read starting Order can cause that the test disc fails and cannot be switched back to the hard disc storing the test main program, so that the hard disc test is terminated, and the reliability of the test hard disc is reduced.
Disclosure of Invention
Therefore, the present application aims to provide a method, apparatus, device, and medium for adjusting a hard disk start sequence in a user mode, which can adjust a hard disk start sequence in a user mode, so that after a hard disk failure is tested, the hard disk can be switched back to a hard disk storing a main program for testing, and the reliability of the hard disk is improved. The specific scheme is as follows:
in a first aspect, the present application discloses a method for adjusting a hard disk start sequence in a user mode, which is applied to a test host, wherein an operating system of the test host is installed by using UEFI and GPT modes, and the method includes:
obtaining a hard disk test instruction input by a user in a user state, wherein the hard disk test instruction comprises a first identifier of a target hard disk to be tested, and the first identifier is an identifier of the target hard disk to be tested in an operating system of the test host;
determining whether a first starting item corresponding to the target hard disk to be tested exists in the test host based on the first disk character;
if the first starting item corresponding to the target hard disk to be tested does not exist in the test host, the first starting item corresponding to the target hard disk to be tested is created;
adding a first starting item identifier of a first starting item corresponding to the hard disk to be tested of the target to a first position of a UEFI Boot Order of the test host, and adding a second starting item identifier to a second position of the UEFI Boot Order, wherein the second starting item identifier is an identifier of a second starting item corresponding to the hard disk storing the test main program in the test host, and the first position is before the second position so as to start the hard disk to be tested of the target before starting the hard disk storing the test main program.
Optionally, after determining whether the first startup item corresponding to the target hard disk to be tested exists in the test host based on the first identifier, the method further includes:
if a first starting item corresponding to the target hard disk to be tested exists in the test host, determining a third position of a first starting item identifier of the first starting item in a UEFI Boot Order of the test host and a fourth position of a second starting item identifier of a second starting item corresponding to the hard disk storing the test main program in the UEFI Boot Order;
judging whether the third position is before the fourth position;
if not, the first starting item identification is moved to the position before the fourth position, so that the target hard disk to be tested is started before the hard disk storing the test main program is started.
Optionally, the determining, based on the first identifier, whether a first start item corresponding to the target hard disk to be tested exists in the test host includes:
determining a target global unique identifier corresponding to the first identifier;
and determining whether a first starting item corresponding to the target global unique identifier exists in the test host computer or not so as to determine whether the first starting item corresponding to the target hard disk to be tested exists or not.
Optionally, the determining the target globally unique identifier corresponding to the first identifier includes:
and reading the target globally unique identifier from the 3 rd LBA of the target hard disk to be tested by using the first identifier.
Optionally, the determining whether the first startup item corresponding to the target globally unique identifier exists in the test host, so as to determine whether the first startup item corresponding to the target hard disk to be tested exists, includes:
traversing all the starting items on the test host to obtain information of each starting item on the test host, wherein the information of each starting item comprises a global unique identifier corresponding to each starting item;
and determining whether a first startup item corresponding to the target global unique identifier exists in the test host based on the information of each startup item so as to determine whether the first startup item corresponding to the target hard disk to be tested exists.
Optionally, before the adding the second startup identifier to the second location of the UEFI Boot Order, the method further includes:
and determining a second starting item corresponding to the hard disk storing the test main program based on a second drive sign of the hard disk storing the test main program so as to determine the second starting item identification of the second starting item.
In a second aspect, the present application discloses a device for adjusting a hard disk start sequence in a user mode, which is applied to a test host, wherein an operating system of the test host is installed by using UEFI and GPT modes, and the device comprises:
the system comprises an instruction acquisition module, a test host computer and a control module, wherein the instruction acquisition module is used for acquiring a hard disk test instruction input by a user in a user state, wherein the hard disk test instruction comprises a first disk character of a target hard disk to be tested, and the first disk character is an identification of the target hard disk to be tested in an operating system of the test host computer;
the starting item determining module is used for determining whether a first starting item corresponding to the target hard disk to be tested exists in the test host or not based on the first identifier;
the starting item creation module is used for creating a first starting item corresponding to the target hard disk to be tested when the first starting item corresponding to the target hard disk to be tested does not exist in the test host;
the hard disk start sequence adjusting module is used for adding a first start item identifier of a first start item corresponding to the hard disk to be tested to a first position of a UEFI Boot Order of the test host, and adding a second start item identifier to a second position of the UEFI Boot Order, wherein the second start item identifier is an identifier of a second start item corresponding to the hard disk storing the test main program in the test host, and the first position is before the second position so as to start the hard disk to be tested before starting the hard disk storing the test main program.
Optionally, the start item determining module is configured to:
determining a target global unique identifier corresponding to the first identifier;
and determining whether a first starting item corresponding to the target global unique identifier exists in the test host computer or not so as to determine whether the first starting item corresponding to the target hard disk to be tested exists or not.
In a third aspect, the present application discloses a test host comprising:
a memory and a processor;
wherein the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the method for adjusting the starting sequence of the hard disk in the user mode disclosed in the foregoing.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the method for dynamically adjusting the starting sequence of a hard disk disclosed in the foregoing.
It can be seen that, firstly, a hard disk test instruction input by a user in a user state is obtained, wherein the hard disk test instruction comprises a first identifier of a target hard disk to be tested, the first identifier is an identifier of the target hard disk to be tested in an operating system of the test host, then, based on the first identifier, whether a first starting item corresponding to the target hard disk to be tested exists in the test host is determined, if the first starting item corresponding to the target hard disk to be tested does not exist in the test host, the first starting item corresponding to the target hard disk to be tested is created, then, a first starting item identifier of the first starting item corresponding to the target hard disk to be tested is added to a first position of a UEFI Boot Order of the test host, and a second starting item identifier is added to a second position of the UEFI Boot Order of the test host, wherein the second starting item identifier is an identifier of a second starting item corresponding to the hard disk of the test host program stored in the test host, and the first position is before the second position is reached, so that the target hard disk to be tested is started before the main program to be tested is started. Therefore, when a hard disk test instruction which is input by a user in a user state and used for testing a target hard disk to be tested is obtained, whether a first starting item corresponding to the target hard disk to be tested exists in the test host is determined based on a first identifier of the target hard disk to be tested, if the first starting item does not exist, the first starting item is created, then a first starting item identification of the first starting item is added to a first position of a UEFI Boot Order of the test host, and a second starting item identification of a second starting item corresponding to a hard disk storing a test main program is added to a second position after the first position of the UEFI Boot Order. Therefore, the position of the start item identifier corresponding to the hard disk to be tested in the UEFI Boot Order is located before the start item identifier corresponding to the hard disk storing the main program to be tested, and when the hard disk to be tested fails, the hard disk to be tested can be started in sequence, so that the start sequence of the hard disk can be adjusted in a user mode, when the hard disk to be tested fails, the start item identifier can be switched back to the hard disk storing the main program to be tested, the subsequent hard disk test can be performed, and the reliability of the hard disk to be tested can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for adjusting the starting sequence of a hard disk in a user mode;
FIG. 2 is a flowchart of a method for adjusting a start sequence of a hard disk in a user mode according to the present application;
FIG. 3 is a schematic diagram of a device for adjusting the starting sequence of a hard disk in a user mode according to the present application;
fig. 4 is a schematic diagram of a test host according to the present disclosure.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Referring to fig. 1, an embodiment of the present application discloses a method for adjusting a hard disk start sequence in a user mode, which is applied to a test host, wherein an operating system of the test host is installed by using UEFI and GPT modes, and the method includes:
step S11: obtaining a hard disk test instruction input by a user in a user state, wherein the hard disk test instruction comprises a first identifier of a target hard disk to be tested, and the first identifier is an identifier of the target hard disk to be tested in an operating system of the test host.
In a specific implementation process, the test host needs to acquire a hard disk test instruction input by a user in a user state, wherein the hard disk test instruction includes a first identifier of a target hard disk to be tested, and the first identifier is an identifier of the target hard disk to be tested in an operating system of the test host. The number of the target hard disks to be tested may be greater than or equal to 1. When the number of the target hard disks to be tested is greater than 1, the test sequence of each target hard disk to be tested can be configured.
Step S12: and determining whether a first starting item corresponding to the target hard disk to be tested exists in the test host or not based on the first identifier.
After the hard disk testing instruction is obtained, whether a first starting item corresponding to the target hard disk to be tested exists in the testing host or not is further determined based on the first identifier. Specifically, a target global unique identifier corresponding to the first identifier may be determined; and determining whether a first starting item corresponding to the target global unique identifier exists in the test host computer or not so as to determine whether the first starting item corresponding to the target hard disk to be tested exists or not. Wherein the target globally unique identifier is a globally unique identifier (GUID, globally Unique Identifier) corresponding to the first identifier.
Wherein determining the target global unique identifier corresponding to the first identifier comprises: and reading the target globally unique identifier from the 3 rd LBA (Logical Block Address ) of the target hard disk to be tested by utilizing the first identifier. According to the partition definition of GPT (GUID Partition Table, globally unique identification partition table), the first LBA is LBA0, namely MBR (Master Boot Record, master boot record MBR) partition table, the second LBA is LBA1, the GPT header is stored, the third LAB is LBA2-33, and the position of LBA2-33 stores the partition table entry. GPT partition tables represent partitions in a simple and straightforward manner. The first 16 bytes of a partition entry are the partition type, the next 16 bytes are the partition unique GUID, which refers to the partition itself, followed by the 64-bit LBA numbers at the beginning and end of the partition, and the name and attribute of the partition.
Determining whether a first startup item corresponding to the target global unique identifier exists in the test host, so as to determine whether the first startup item corresponding to the target hard disk to be tested exists, includes: traversing all the starting items on the test host to obtain information of each starting item on the test host, wherein the information of each starting item comprises a global unique identifier corresponding to each starting item; and determining whether a first startup item corresponding to the target global unique identifier exists in the test host based on the information of each startup item so as to determine whether the first startup item corresponding to the target hard disk to be tested exists. The information of each boot item includes a corresponding globally unique identifier, so that it can be determined whether the target globally unique identifier is included, if so, the first boot item is indicated to exist, the boot item including the target globally unique identifier is determined to be the first boot item, and if not, the first boot item is indicated to not exist in the test host.
Step S13: if the first starting item corresponding to the target hard disk to be tested does not exist in the test host, the first starting item corresponding to the target hard disk to be tested is created.
If the first starting item corresponding to the target hard disk to be tested does not exist in the test host, the first starting item corresponding to the target hard disk to be tested is created. That is, the first startup item corresponding to the target hard disk to be tested does not exist in the test host, so the first startup item corresponding to the target hard disk to be tested needs to be created.
Step S14: adding a first starting item identifier of a first starting item corresponding to the hard disk to be tested of the target to a first position of a UEFI Boot Order of the test host, and adding a second starting item identifier to a second position of the UEFI Boot Order, wherein the second starting item identifier is an identifier of a second starting item corresponding to the hard disk storing the test main program in the test host, and the first position is before the second position so as to start the hard disk to be tested of the target before starting the hard disk storing the test main program.
After the first startup item is created, a first startup item identifier of a first startup item corresponding to the target hard disk to be tested is further required to be added to a first position of a UEFI Boot Order of the test host, and a second startup item identifier is added to a second position of the UEFI Boot Order, wherein the second startup item identifier is an identifier of a second startup item corresponding to a hard disk storing a test main program in the test host, and the first position is before the second position so as to start the target hard disk to be tested before starting the hard disk storing the test main program.
And the UEFI Boot Order of the test host represents the starting sequence of the hard disk, the hard disk corresponding to each starting item identifier is sequentially started according to the front-to-back sequence of each starting item identifier of the UEFI Boot Order, and the operating system installation test is performed on each hard disk. The first starting item identifier corresponding to the target hard disk to be tested is located before the second starting item identifier corresponding to the hard disk storing the main program to be tested, so that even if the target hard disk to be tested fails, the target hard disk to be tested is cut back to the hard disk storing the main program to be tested. The Boot item identifier of each Boot item may be used for Boot sequence number representation, for example, boot001, boot002, boot003, etc.
It can be seen that, firstly, a hard disk test instruction input by a user in a user state is obtained, wherein the hard disk test instruction comprises a first identifier of a target hard disk to be tested, the first identifier is an identifier of the target hard disk to be tested in an operating system of the test host, then, based on the first identifier, whether a first starting item corresponding to the target hard disk to be tested exists in the test host is determined, if the first starting item corresponding to the target hard disk to be tested does not exist in the test host, the first starting item corresponding to the target hard disk to be tested is created, then, a first starting item identifier of the first starting item corresponding to the target hard disk to be tested is added to a first position of a UEFI Boot Order of the test host, and a second starting item identifier is added to a second position of the UEFI Boot Order of the test host, wherein the second starting item identifier is an identifier of a second starting item corresponding to the hard disk of the test host program stored in the test host, and the first position is before the second position is reached, so that the target hard disk to be tested is started before the main program to be tested is started. Therefore, when a hard disk test instruction which is input by a user in a user state and used for testing a target hard disk to be tested is obtained, whether a first starting item corresponding to the target hard disk to be tested exists in the test host is determined based on a first identifier of the target hard disk to be tested, if the first starting item does not exist, the first starting item is created, then a first starting item identification of the first starting item is added to a first position of a UEFI Boot Order of the test host, and a second starting item identification of a second starting item corresponding to a hard disk storing a test main program is added to a second position after the first position of the UEFI Boot Order. Therefore, the position of the start item identifier corresponding to the hard disk to be tested in the UEFI Boot Order is located before the start item identifier corresponding to the hard disk storing the main program to be tested, and when the hard disk to be tested fails, the hard disk to be tested can be started in sequence, so that the start sequence of the hard disk can be adjusted in a user mode, when the hard disk to be tested fails, the start item identifier can be switched back to the hard disk storing the main program to be tested, the subsequent hard disk test can be performed, and the reliability of the hard disk to be tested can be improved.
Referring to fig. 2, an embodiment of the present application discloses a specific method for adjusting a hard disk start sequence in a user mode, which is applied to a test host, where an operating system of the test host is installed by using UEFI and GPT modes, and the method includes:
step S21: obtaining a hard disk test instruction input by a user in a user state, wherein the hard disk test instruction comprises a first identifier of a target hard disk to be tested, and the first identifier is an identifier of the target hard disk to be tested in an operating system of the test host.
Step S22: and determining whether a first starting item corresponding to the target hard disk to be tested exists in the test host or not based on the first identifier.
Step S23: if the first starting item corresponding to the target hard disk to be tested does not exist in the test host, the first starting item corresponding to the target hard disk to be tested is created.
The specific implementation process of step S21 to step S23 may refer to the disclosure in the foregoing embodiment, and will not be described herein.
Step S24: adding a first starting item identifier of a first starting item corresponding to the hard disk to be tested of the target to a first position of a UEFI Boot Order of the test host, and adding a second starting item identifier to a second position of the UEFI Boot Order, wherein the second starting item identifier is an identifier of a second starting item corresponding to the hard disk storing the test main program in the test host, and the first position is before the second position so as to start the hard disk to be tested of the target before starting the hard disk storing the test main program.
After the first startup item is created, a first startup item identifier of a first startup item corresponding to the target hard disk to be tested is further required to be added to a first position of a UEFI Boot Order of the test host, and a second startup item identifier is added to a second position of the UEFI Boot Order, wherein the second startup item identifier is an identifier of a second startup item corresponding to a hard disk storing a test main program in the test host, and the first position is before the second position so as to start the target hard disk to be tested before starting the hard disk storing the test main program.
For example, a first Boot item identifier (i.e., a Boot sequence number) corresponding to the target to-be-tested hard disk may be placed in byte0-1 (each sequence number occupies two bytes), and a second Boot item identifier (i.e., a Boot sequence number) corresponding to the hard disk where the test main program is located may be placed in byte2-3, where other Boot sequence numbers not belonging to the target to-be-tested hard disk and the hard disk storing the test main program are sequentially moved backwards.
Before the second startup item identifier is added to the second position of the UEFI Boot Order, the method further comprises: and determining a second starting item corresponding to the hard disk storing the test main program based on a second drive sign of the hard disk storing the test main program so as to determine the second starting item identification of the second starting item.
That is, the second startup item identifier needs to be determined before the second startup item identifier is added to the second location of the UEFI Boot Order. The specific determining process is the same as that of the foregoing embodiment, in which whether the first start-up item corresponding to the target hard disk to be tested exists in the test host is determined based on the first identifier.
Step S25: if the first starting item corresponding to the target hard disk to be tested exists in the test host, determining a third position of a first starting item identifier of the first starting item in a UEFI Boot Order of the test host and a fourth position of a second starting item identifier of the second starting item corresponding to the hard disk storing the test main program in the UEFI Boot Order.
If the first starting item corresponding to the target hard disk to be tested exists in the test host, determining a third position of a first starting item identifier of the first starting item in a UEFI Boot Order of the test host and a fourth position of a second starting item identifier of the second starting item corresponding to the hard disk storing the test main program in the UEFI Boot Order.
That is, if the first startup item already exists in the test host, it is further required to determine whether the location of the first startup item identifier in the UEFI Boot Order is before the location of the second startup item identifier corresponding to the hard disk of the test host program. It is necessary to obtain a third position of the first Boot item identification in the UEFI Boot Order and a fourth position of the second Boot item identification in the UEFI Boot Order.
Step S26: and judging whether the third position is before the fourth position.
It will be appreciated that after the third and fourth positions are determined, it is also necessary to determine whether the third position is before the fourth position. It is also possible to determine whether the target hard disk to be tested can be started before the hard disk of the test main program is stored.
Step S27: if not, the first starting item identification is moved to the position before the fourth position, so that the target hard disk to be tested is started before the hard disk storing the test main program is started.
If not, the first boot item identification needs to be moved to the fourth position before the target hard disk to be tested is started before the hard disk storing the test main program is started. If so, no movement process may be required.
Referring to fig. 3, an embodiment of the present application discloses a device for adjusting a hard disk start sequence in a user mode, which is characterized in that the device is applied to a test host, wherein an operating system of the test host is installed by using UEFI and GPT modes, and the device includes:
the instruction obtaining module 11 is configured to obtain a hard disk test instruction input by a user in a user state, where the hard disk test instruction includes a first identifier of a target hard disk to be tested, and the first identifier is an identifier of the target hard disk to be tested in an operating system of the test host;
the starting item determining module 12 is configured to determine whether a first starting item corresponding to the target hard disk to be tested exists in the test host based on the first identifier;
the starting item creating module 13 is configured to create a first starting item corresponding to the target to-be-tested hard disk when the first starting item corresponding to the target to-be-tested hard disk does not exist in the test host;
the hard disk start sequence adjustment module 14 is configured to add a first start item identifier of a first start item corresponding to the target hard disk to be tested to a first location of a UEFI Boot Order of the test host, and add a second start item identifier to a second location of the UEFI Boot Order, where the second start item identifier is an identifier of a second start item corresponding to a hard disk storing a test main program in the test host, and the first location is before the second location, so that the target hard disk to be tested is started before the hard disk storing the test main program is started.
It can be seen that, firstly, a hard disk test instruction input by a user in a user state is obtained, wherein the hard disk test instruction comprises a first identifier of a target hard disk to be tested, the first identifier is an identifier of the target hard disk to be tested in an operating system of the test host, then, based on the first identifier, whether a first starting item corresponding to the target hard disk to be tested exists in the test host is determined, if the first starting item corresponding to the target hard disk to be tested does not exist in the test host, the first starting item corresponding to the target hard disk to be tested is created, then, a first starting item identifier of the first starting item corresponding to the target hard disk to be tested is added to a first position of a UEFI Boot Order of the test host, and a second starting item identifier is added to a second position of the UEFI Boot Order of the test host, wherein the second starting item identifier is an identifier of a second starting item corresponding to the hard disk of the test host program stored in the test host, and the first position is before the second position is reached, so that the target hard disk to be tested is started before the main program to be tested is started. Therefore, when a hard disk test instruction which is input by a user in a user state and used for testing a target hard disk to be tested is obtained, whether a first starting item corresponding to the target hard disk to be tested exists in the test host is determined based on a first identifier of the target hard disk to be tested, if the first starting item does not exist, the first starting item is created, then a first starting item identification of the first starting item is added to a first position of a UEFI Boot Order of the test host, and a second starting item identification of a second starting item corresponding to a hard disk storing a test main program is added to a second position after the first position of the UEFI Boot Order. Therefore, the position of the start item identifier corresponding to the hard disk to be tested in the UEFI Boot Order is located before the start item identifier corresponding to the hard disk storing the main program to be tested, and when the hard disk to be tested fails, the hard disk to be tested can be started in sequence, so that the start sequence of the hard disk can be adjusted in a user mode, when the hard disk to be tested fails, the start item identifier can be switched back to the hard disk storing the main program to be tested, the subsequent hard disk test can be performed, and the reliability of the hard disk to be tested can be improved.
In some specific embodiments, the device for adjusting the starting sequence of the hard disk in the user mode further includes:
the position adjustment module is used for determining a third position of a first starting item identifier of the first starting item in a UEFI Boot Order of the test host and a fourth position of a second starting item identifier of the second starting item corresponding to the hard disk storing the test main program in the UEFI Boot Order if the first starting item corresponding to the target hard disk to be tested exists in the test host; judging whether the third position is before the fourth position; if not, the first starting item identification is moved to the position before the fourth position, so that the target hard disk to be tested is started before the hard disk storing the test main program is started.
In some specific embodiments, the initiation item determination module 12 is configured to:
determining a target global unique identifier corresponding to the first identifier;
and determining whether a first starting item corresponding to the target global unique identifier exists in the test host computer or not so as to determine whether the first starting item corresponding to the target hard disk to be tested exists or not.
In some specific embodiments, the initiation item determination module 12 is configured to:
and reading the target globally unique identifier from the 3 rd LBA of the target hard disk to be tested by using the first identifier.
In some specific embodiments, the initiation item determination module 12 is configured to:
traversing all the starting items on the test host to obtain information of each starting item on the test host, wherein the information of each starting item comprises a global unique identifier corresponding to each starting item;
and determining whether a first startup item corresponding to the target global unique identifier exists in the test host based on the information of each startup item so as to determine whether the first startup item corresponding to the target hard disk to be tested exists.
In some specific embodiments, the start-up item determination module 12 is further configured to:
and determining a second starting item corresponding to the hard disk storing the test main program based on a second drive sign of the hard disk storing the test main program so as to determine the second starting item identification of the second starting item.
Referring to fig. 4, a schematic structural diagram of a test host 20 according to an embodiment of the present application is shown, an operating system of the test host 20 is installed by using UEFI and GPT, and the test host 20 may implement the method steps for adjusting the starting sequence of the hard disk in the user mode disclosed in the foregoing embodiment.
In general, the test host 20 in the present embodiment includes: a processor 21 and a memory 22.
Processor 21 may include one or more processing cores, such as a four-core processor, an eight-core processor, or the like, among others. The processor 21 may be implemented using at least one hardware selected from DSP (digital signal processing ), FPGA (field-programmable gate array, field programmable array), PLA (programmable logic array ). The processor 21 may also comprise a main processor, which is a processor for processing data in an awake state, also called CPU (central processing unit ); a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a GPU (graphics processing unit, image processor) for taking care of rendering and drawing of images that the display screen is required to display. In some embodiments, the processor 21 may include an AI (artificial intelligence ) processor for processing computing operations related to machine learning.
Memory 22 may include one or more computer-readable storage media, which may be non-transitory. Memory 22 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 22 is at least used for storing a computer program 221, where the computer program, after being loaded and executed by the processor 21, can implement the method steps for dynamically adjusting the starting sequence of the hard disk disclosed in any of the foregoing embodiments.
In some embodiments, the test host 20 may further include a display 23, an input/output interface 24, a communication interface 25, a sensor 26, a power supply 27, and a communication bus 28.
Those skilled in the art will appreciate that the configuration shown in fig. 4 is not limiting of the test host 20 and may include more or fewer components than shown.
Further, the embodiment of the application also discloses a computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to implement the method for dynamically adjusting the starting sequence of the hard disk in any one of the above embodiments.
The specific process of the method for adjusting the starting sequence of the hard disk in the user mode may refer to the corresponding content disclosed in the foregoing embodiment, and will not be described herein again.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a list of processes, methods, articles, or apparatus that comprises other elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The method, the device, the equipment and the medium for adjusting the starting sequence of the hard disk in the user mode are described in detail, and specific examples are applied to the principle and the implementation mode of the method, the device, the equipment and the medium for adjusting the starting sequence of the hard disk in the user mode, and the description of the above examples is only used for helping to understand the method and the core idea of the method; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (9)

1. The method for adjusting the starting sequence of the hard disk in the user mode is characterized by being applied to a test host, wherein an operating system of the test host is installed by using a UEFI mode and a GPT mode, and the method comprises the following steps:
obtaining a hard disk test instruction input by a user in a user state, wherein the hard disk test instruction comprises a first identifier of a target hard disk to be tested, and the first identifier is an identifier of the target hard disk to be tested in an operating system of the test host;
determining whether a first starting item corresponding to the target hard disk to be tested exists in the test host based on the first disk character;
if the first starting item corresponding to the target hard disk to be tested does not exist in the test host, the first starting item corresponding to the target hard disk to be tested is created;
adding a first starting item identifier of a first starting item corresponding to the hard disk to be tested of the target to a first position of a UEFI Boot Order of the test host, and adding a second starting item identifier to a second position of the UEFI Boot Order, wherein the second starting item identifier is an identifier of a second starting item corresponding to the hard disk storing the test main program in the test host, and the first position is before the second position so as to start the hard disk to be tested of the target before starting the hard disk storing the test main program;
after determining whether a first starting item corresponding to the target hard disk to be tested exists in the test host based on the first identifier, the method further comprises the following steps:
if a first starting item corresponding to the target hard disk to be tested exists in the test host, determining a third position of a first starting item identifier of the first starting item in a UEFI Boot Order of the test host and a fourth position of a second starting item identifier of a second starting item corresponding to the hard disk storing the test main program in the UEFI Boot Order;
judging whether the third position is before the fourth position;
if not, the first starting item identification is moved to the position before the fourth position, so that the target hard disk to be tested is started before the hard disk storing the test main program is started.
2. The method for adjusting a boot sequence of a hard disk in a user mode according to claim 1, wherein the determining, based on the first identifier, whether a first boot item corresponding to the target hard disk to be tested exists in the test host includes:
determining a target global unique identifier corresponding to the first identifier;
and determining whether a first starting item corresponding to the target global unique identifier exists in the test host computer or not so as to determine whether the first starting item corresponding to the target hard disk to be tested exists or not.
3. The method for dynamically adjusting a start-up sequence of a hard disk according to claim 2, wherein determining the target globally unique identifier corresponding to the first identifier comprises:
and reading the target globally unique identifier from the 3 rd LBA of the target hard disk to be tested by using the first identifier.
4. The method for adjusting a boot sequence of a hard disk in a user mode according to claim 2, wherein the determining whether the first boot item corresponding to the target globally unique identifier exists in the test host to determine whether the first boot item corresponding to the target hard disk to be tested exists includes:
traversing all the starting items on the test host to obtain information of each starting item on the test host, wherein the information of each starting item comprises a global unique identifier corresponding to each starting item;
and determining whether a first startup item corresponding to the target global unique identifier exists in the test host based on the information of each startup item so as to determine whether the first startup item corresponding to the target hard disk to be tested exists.
5. The method for adjusting the Boot sequence of the hard disk in the user mode according to claim 1, wherein before adding the second Boot item identifier to the second location of the UEFI Boot Order, further comprises:
and determining a second starting item corresponding to the hard disk storing the test main program based on a second drive sign of the hard disk storing the test main program so as to determine the second starting item identification of the second starting item.
6. The device for adjusting the starting sequence of the hard disk in the user mode is applied to a test host, wherein an operating system of the test host is installed by using a UEFI mode and a GPT mode, and the device comprises the following components:
the system comprises an instruction acquisition module, a test host computer and a control module, wherein the instruction acquisition module is used for acquiring a hard disk test instruction input by a user in a user state, wherein the hard disk test instruction comprises a first disk character of a target hard disk to be tested, and the first disk character is an identification of the target hard disk to be tested in an operating system of the test host computer;
the starting item determining module is used for determining whether a first starting item corresponding to the target hard disk to be tested exists in the test host or not based on the first identifier;
the starting item creation module is used for creating a first starting item corresponding to the target hard disk to be tested when the first starting item corresponding to the target hard disk to be tested does not exist in the test host;
the hard disk starting sequence adjusting module is used for adding a first starting item identifier of a first starting item corresponding to the hard disk to be tested to a first position of a UEFI Boot Order of the test host and adding a second starting item identifier to a second position of the UEFI Boot Order, wherein the second starting item identifier is an identifier of a second starting item corresponding to the hard disk storing the test main program in the test host, and the first position is before the second position so as to start the hard disk to be tested before starting the hard disk storing the test main program;
the device for adjusting the starting sequence of the hard disk in the user mode further comprises:
the position adjustment module is used for determining a third position of a first starting item identifier of the first starting item in a UEFI Boot Order of the test host and a fourth position of a second starting item identifier of the second starting item corresponding to the hard disk storing the test main program in the UEFI Boot Order when the first starting item corresponding to the target hard disk to be tested exists in the test host; judging whether the third position is before the fourth position; if not, the first starting item identification is moved to the position before the fourth position, so that the target hard disk to be tested is started before the hard disk storing the test main program is started.
7. The device for adjusting a start-up sequence of a hard disk in a user mode according to claim 6, wherein the start-up item determining module is configured to:
determining a target global unique identifier corresponding to the first identifier;
and determining whether a first starting item corresponding to the target global unique identifier exists in the test host computer or not so as to determine whether the first starting item corresponding to the target hard disk to be tested exists or not.
8. A test host comprising:
a memory and a processor;
wherein the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the method for adjusting the start-up sequence of the hard disk in the user mode according to any one of claims 1 to 5.
9. A computer readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the method of user-wise adjusting the start-up sequence of a hard disk according to any one of claims 1 to 5.
CN202011529562.7A 2020-12-22 2020-12-22 Method, device, equipment and medium for adjusting hard disk starting sequence in user mode Active CN112540889B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011529562.7A CN112540889B (en) 2020-12-22 2020-12-22 Method, device, equipment and medium for adjusting hard disk starting sequence in user mode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011529562.7A CN112540889B (en) 2020-12-22 2020-12-22 Method, device, equipment and medium for adjusting hard disk starting sequence in user mode

Publications (2)

Publication Number Publication Date
CN112540889A CN112540889A (en) 2021-03-23
CN112540889B true CN112540889B (en) 2023-08-15

Family

ID=75017120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011529562.7A Active CN112540889B (en) 2020-12-22 2020-12-22 Method, device, equipment and medium for adjusting hard disk starting sequence in user mode

Country Status (1)

Country Link
CN (1) CN112540889B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105354122A (en) * 2015-12-07 2016-02-24 浪潮电子信息产业股份有限公司 Function test optimization method of dual-use hard disk backplane of server
CN107220153A (en) * 2017-06-28 2017-09-29 济南浪潮高新科技投资发展有限公司 A kind of calculator memory switching card test method and device based on UEFI
CN108008914A (en) * 2016-10-27 2018-05-08 华为技术有限公司 The method, apparatus and ARM equipment of disk management in a kind of ARM equipment
CN109117195A (en) * 2018-07-27 2019-01-01 郑州云海信息技术有限公司 A kind of method, device and equipment of UEFI mode adjustment boot sequence
CN110018856A (en) * 2019-04-03 2019-07-16 中电科技(北京)有限公司 The method that dynamic modifies UEFI boot sequence
CN111459740A (en) * 2020-04-14 2020-07-28 深圳忆联信息系统有限公司 Master-slave disk serial test method and device for solid state disk and computer equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI526934B (en) * 2013-06-11 2016-03-21 聯想企業解決方案(新加坡)有限公司 Method, apparatus, and computer program product for booting an information handling system
CN109656627A (en) * 2018-12-18 2019-04-19 广东浪潮大数据研究有限公司 Starting method, activation system and the relevant apparatus of hard disk in a kind of BIOS

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105354122A (en) * 2015-12-07 2016-02-24 浪潮电子信息产业股份有限公司 Function test optimization method of dual-use hard disk backplane of server
CN108008914A (en) * 2016-10-27 2018-05-08 华为技术有限公司 The method, apparatus and ARM equipment of disk management in a kind of ARM equipment
CN107220153A (en) * 2017-06-28 2017-09-29 济南浪潮高新科技投资发展有限公司 A kind of calculator memory switching card test method and device based on UEFI
CN109117195A (en) * 2018-07-27 2019-01-01 郑州云海信息技术有限公司 A kind of method, device and equipment of UEFI mode adjustment boot sequence
CN110018856A (en) * 2019-04-03 2019-07-16 中电科技(北京)有限公司 The method that dynamic modifies UEFI boot sequence
CN111459740A (en) * 2020-04-14 2020-07-28 深圳忆联信息系统有限公司 Master-slave disk serial test method and device for solid state disk and computer equipment

Also Published As

Publication number Publication date
CN112540889A (en) 2021-03-23

Similar Documents

Publication Publication Date Title
CN101650660B (en) Booting a computer system from central storage
JP4842432B2 (en) System and method for providing functions to system BIOS
US9395919B1 (en) Memory configuration operations for a computing device
US10606677B2 (en) Method of retrieving debugging data in UEFI and computer system thereof
US8180930B2 (en) Information processing device, and device initialization method in the information processing device
US7921230B2 (en) USB devices pre-configuration for KVM switch
CN110502881B (en) Method, system and storage medium for dynamically modifying read-only attribute of android system
CN112506745B (en) Memory temperature reading method and device and computer readable storage medium
US20120060023A1 (en) Methods for booting an operating system using non-volatile memory
US10795606B2 (en) Buffer-based update of state data
US20040225874A1 (en) Method for reduced BIOS boot time
US8881174B2 (en) Computing device and function module management method
CN114461691A (en) Control method and device of state machine, electronic equipment and storage medium
CN112667442B (en) Control method, device and equipment based on nonvolatile memory device starting system
US6986035B2 (en) Modular bios for detecting resources of a system and reporting information about the resources during two separate phases
CN116501415B (en) Command execution method and device, electronic equipment and computer readable storage medium
CN116627513B (en) Method and device for starting boot of computer
CN112540889B (en) Method, device, equipment and medium for adjusting hard disk starting sequence in user mode
CN109145241B (en) Browser and content display management method of browser
CN110327626B (en) Virtual server creation method and device
CN110333901A (en) The title update method of storage device
TWI733157B (en) Method and system for accelerating startup embedded system
CN116841657A (en) Interface function calling method and device
CN115509620A (en) Method and device for determining module to be updated
CN117873441A (en) Method, device, equipment and medium for determining customization options

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant