CN109960678B - Naming processing method and computer processing device - Google Patents

Naming processing method and computer processing device Download PDF

Info

Publication number
CN109960678B
CN109960678B CN201910254419.2A CN201910254419A CN109960678B CN 109960678 B CN109960678 B CN 109960678B CN 201910254419 A CN201910254419 A CN 201910254419A CN 109960678 B CN109960678 B CN 109960678B
Authority
CN
China
Prior art keywords
naming
information
physical location
hardware device
hardware
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
CN201910254419.2A
Other languages
Chinese (zh)
Other versions
CN109960678A (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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201910254419.2A priority Critical patent/CN109960678B/en
Publication of CN109960678A publication Critical patent/CN109960678A/en
Application granted granted Critical
Publication of CN109960678B publication Critical patent/CN109960678B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • G06F13/4081Live connection to bus, e.g. hot-plugging

Abstract

The method and the device provide that naming information corresponding to physical position information of hardware equipment is stored in at least one field of a preset data structure table, on the basis, after the hardware equipment is scanned, the physical position information of the physical position where the hardware equipment is located is obtained, the naming information corresponding to the physical position information is obtained from the data structure table, and finally the hardware equipment is named based on the naming information. Therefore, in the application, the naming of the hardware device is related to the physical position of the hardware device, once the physical position of the hardware device is determined, the naming of the hardware device is fixed immediately, so that the hardware device in the same physical position cannot obtain different naming due to hot plug of the hardware device.

Description

Naming processing method and computer processing device
Technical Field
The present application belongs to the technical field of hardware management, and in particular, to a naming processing method and a computer processing apparatus.
Background
When an operating system of a computer or a server is started or when a hardware device (such as an nvme disk, a network card and the like) is subjected to hot plug in the running process, the operating system can automatically scan the hardware device mounted on a PCI/PCIe (peripheral component interconnect standard/high-speed serial computer expansion bus standard) bus of a system and call a corresponding device driver.
After the hardware device mounted on the PCI/PCIe bus is scanned and the driver thereof is called, the scanned hardware device is further named based on the scanning order, taking scanning a plurality of nvme disks as an example, each nvme disk is generally named nvme [0], nvme [1] … nvme [ n ] respectively according to the scanning order (nvme [ x ] in practical application is only partial information in the name of the nvme disk, and the name also includes related information of a disk name space and a disk partition, which is not described in detail herein). The hardware device names obtained by the naming mode are obviously related to the scanning sequence of each device when PCI/PCIe is scanned, for the hot-plug devices such as the nvme disk, the names of the devices inserted into the same slot when hot-plug occurs may be different from the names of the devices before the slot is hot-plugged, for example, the nvme disk named nvme [1] on the slot A and the nvme disk named nvme [3] on the slot B are unplugged simultaneously, if an nvme disk is inserted into the slot B again, the newly inserted disk on the slot B will be named nvme [1], and the new names are changed from the names of the nvme [3] on the nvme disk on the slot B before hot-plug.
For example, if some program/programs of the system have related location codes (access operations such as data read/write to a disk are implemented by locating a storage location of the disk) for the nvme disk on slot B in the above example based on the disk name, when the name of the nvme disk on slot B before and after hot plug is changed from nvme [3] to nvme [1], the programs cannot be accurately located to a required disk based on the location codes (including the disk name nvme [3] still before hot plug), and further cause an error in data access to the disk on slot B. Therefore, the naming mode in the prior art has the defect that the hot plug of the device cannot be well supported, and once the naming of the disk devices on the same slot is changed before and after the hot plug, a part of programs in the system may not perform normal data access on the devices on the slot.
Disclosure of Invention
In view of the above, an object of the present application is to provide a naming method and a computer processing apparatus, which are used to implement that the names of devices at the same physical location before and after hot plug are unchanged, so as to better support hot plug of the devices and ensure normal use of the hot plug devices by a system.
Therefore, the invention discloses the following technical scheme:
a naming process method, comprising:
after scanning hardware equipment, acquiring physical position information of a physical position where the hardware equipment is located;
acquiring naming information corresponding to the physical location information from a predetermined data structure table; wherein at least one field in the data structure table stores naming information corresponding to physical location information of a hardware device;
naming the hardware device based on the naming information.
Preferably, the acquiring physical location information of the physical location where the hardware device is located includes:
and acquiring the slot identification of the slot where the hardware equipment is located and the bus identification of the bus where the slot is located.
Preferably, the above method, wherein the obtaining naming information corresponding to the physical location information from a predetermined data structure table includes:
reading a named key value corresponding to the slot identification and the bus identification from the at least one field of the data structure table; the named key value includes one or more of the slot identification, the bus identification, a slot attribute, and a hardware device identification.
Preferably, the naming of the hardware device based on the naming information includes:
naming the hardware equipment by utilizing the naming key value according to a preset naming rule;
and replacing the original name distributed to the hardware equipment by the system according to the scanning sequence by using the hardware equipment name obtained based on the naming key value.
Preferably, before the acquiring the physical location information of the physical location where the hardware device is located, the method further includes:
after a basic input and output system is started, acquiring first physical position information of each physical position for placing hardware equipment or acquiring second physical position information of each physical position supporting hot plugging of the hardware equipment;
matching corresponding naming information for the first physical location information or the second physical location information;
writing the corresponding relationship between the first physical location information or the second physical location information and the naming information into the at least one field of the data structure table.
Preferably, the method further includes, after the hardware device is scanned, before the physical location information of the physical location where the hardware device is located is acquired, the method further includes:
and determining whether the hardware equipment and/or the physical position of the hardware equipment has the attribute of supporting hot plug, and if so, triggering and executing the operation of acquiring the physical position information of the physical position of the hardware equipment.
A computer processing apparatus, comprising:
a memory for storing at least one set of instructions;
a processor for invoking and executing the set of instructions in the memory, by executing the set of instructions:
after scanning hardware equipment, acquiring physical position information of a physical position where the hardware equipment is located;
acquiring preset naming information corresponding to the physical location information from a preset data structure table; wherein at least one field in the data structure table stores naming information corresponding to physical location information of a hardware device;
naming the hardware device based on the naming information.
In the above apparatus, preferably, the processor obtains the physical location information of the physical location where the hardware device is located, and specifically includes: acquiring a slot identifier of a slot in which the hardware equipment is positioned and a bus identifier of a bus in which the slot is positioned;
the processor obtains naming information corresponding to the physical location information from a predetermined data structure table, and specifically includes: reading a named key value corresponding to the slot identification and the bus identification from the at least one field of the data structure table; the named key value comprises one or more of the slot identifier, the bus identifier, a slot attribute and a hardware device identifier;
the processor names the hardware device based on the naming information, and specifically includes: naming the hardware equipment by utilizing the naming key value according to a preset naming rule; and replacing the original name distributed to the hardware equipment by the system according to the scanning sequence by using the hardware equipment name obtained based on the naming key value.
Preferably, in the above apparatus, before the processor acquires the physical location information of the physical location where the hardware device is located, the processor is further configured to:
after a basic input and output system is started, acquiring first physical position information of each physical position for placing hardware equipment or acquiring second physical position information of each physical position supporting hot plugging of the hardware equipment;
matching corresponding naming information for the first physical location information or the second physical location information;
writing the corresponding relationship between the first physical location information or the second physical location information and the naming information into the at least one field of the data structure table.
Preferably, in the above apparatus, after the processor scans the hardware device, before acquiring the physical location information of the physical location where the hardware device is located, the processor is further configured to:
and determining whether the hardware equipment and/or the physical position of the hardware equipment has the attribute of supporting hot plug, and if so, triggering and executing the operation of acquiring the physical position information of the physical position of the hardware equipment.
According to the scheme, the naming processing method and the computer processing device provided by the application store the naming information corresponding to the physical position information of the hardware equipment in at least one field of the preset data structure table, on the basis, after the hardware equipment is scanned, the physical position information of the physical position where the hardware equipment is located is obtained, the naming information corresponding to the physical position information is obtained from the data structure table, and finally the scanned hardware equipment is named based on the naming information corresponding to the physical position information. Therefore, in the application, the naming of the hardware device is related to the physical position of the hardware device, once the physical position of the hardware device is determined, the naming of the hardware device is fixed immediately, so that the hardware device in the same physical position cannot obtain different naming due to hot plug of the hardware device, namely the naming of the device in the same physical position before and after the hot plug is unchanged.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flowchart of a naming processing method according to a first embodiment of the present application;
FIG. 2 is a schematic flow chart of a second embodiment of a preprocessing process of the naming processing method provided in the present application;
fig. 3 is a schematic flowchart of a third embodiment of a naming processing method provided in the present application;
fig. 4 is a schematic flowchart of a fourth embodiment of a naming processing method provided in the present application;
fig. 5 is a schematic structural diagram of a fifth embodiment of a computer processing apparatus provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to realize that the naming of the device at the same physical position before and after hot plug is unchanged, so as to better support the hot plug of the device and ensure the normal use of the hot plug device by the system, the present application provides a naming processing method and a computer processing apparatus, which can be applied to but not limited to computer devices such as notebook computers, desktop computers, all-in-one machines, etc., or servers in environments such as local area network/cloud, etc., and the naming processing method and the computer processing apparatus of the present application will be described in detail through specific embodiments below.
Example one
Referring to fig. 1, it is a flowchart of a first embodiment of a naming processing method provided in the present application, and in this embodiment, as shown in fig. 1, the naming processing method includes the following steps:
step 101, after scanning the hardware device, acquiring physical location information of a physical location where the hardware device is located.
When the operating system of the computer or the server starts or hot-swaps the hardware device in the running process, the hardware device mounted on the PCI/PCIe bus of the system is automatically scanned and the corresponding device driver is called (so that the scanned hardware device is available for the system).
Correspondingly, in this embodiment, the physical location information of the physical location where the hardware device is located may be obtained specifically when an operating system of the computer or the server is started and after the hardware device is scanned; or, in the operating process of the operating system of the computer or the server, after the hardware device is scanned, the physical location information of the physical location where the hardware device is located may be obtained.
The hardware device may be, for example and without limitation, an nvme disk, a network card, or other devices.
The physical location where the hardware device is located may be, but is not limited to, a location provided on a PCI/PCIe bus of a computer or a server for placing and plugging the hardware device, such as a disk slot, a network card slot, and the like.
The physical location information of the physical location of the hardware device correspondingly may include but is not limited to: location information of physical slots on a PCI/PCIe bus of a computer or server.
102, acquiring naming information corresponding to the physical position information from a preset data structure table; wherein at least one field in the data structure table stores naming information corresponding to physical location information of a hardware device.
In order to overcome the defect that the normal use of partial programs to hot-plug equipment in a system is influenced due to the fact that the naming of hardware equipment in the same physical position before and after hot-plug is possibly changed in the mode of naming the hardware equipment based on the scanning sequence in the prior art, the technical idea of naming the hardware equipment based on the physical position information of the physical position where the hardware equipment is located is provided.
Based on the technical idea, the naming information corresponding to the physical position information of the hardware equipment is stored in at least one field of a preset data structure table in advance, the naming information is related to the physical position information of the physical position of the hardware equipment, and once the physical position of the hardware equipment is determined, the corresponding naming information is fixed immediately.
The naming information corresponding to the physical location information of the hardware device may include, but is not limited to, key value information such as a naming key and/or a keyword related to the physical location information of the hardware device, so as to support subsequent naming of the hardware device scanned from the physical location based on the naming key or keyword related to the physical location information of the hardware device.
Therefore, after the hardware device is scanned and the physical location information of the physical location where the hardware device is located is obtained, the naming information corresponding to the physical location information, such as the naming keyword and/or the keyword related to the scanned physical location information of the hardware device, can be further obtained from at least one field of the predetermined data structure table.
Step 103, naming the hardware device based on the naming information.
Finally, the scanned hardware device can be named based on the obtained naming information related to the physical position information of the hardware device. Illustratively, the name of the scanned nvme disk can be based on the obtained information such as the name keyword and/or the keyword related to the slot information of the nvme disk.
According to the above scheme, the naming processing method of this embodiment proposes that naming information corresponding to physical location information of a hardware device is stored in at least one field of a predetermined data structure table, and on this basis, after the hardware device is scanned, the physical location information of the physical location where the hardware device is located is obtained, and naming information corresponding to the physical location information is obtained from the data structure table, and finally, the scanned hardware device is named based on the naming information corresponding to the physical location information. Therefore, in the application, the naming of the hardware device is related to the physical position of the hardware device, once the physical position of the hardware device is determined, the naming of the hardware device is fixed immediately, so that the hardware device in the same physical position cannot obtain different naming due to hot plug of the hardware device, namely the naming of the device in the same physical position before and after the hot plug is unchanged.
Example two
The naming processing method needs to be based on that naming information corresponding to the physical location information of the hardware device is stored in at least one field of a predetermined data structure table in advance, and therefore, referring to fig. 2, in this embodiment, the naming processing method may further include the following preprocessing processes:
step 201, after the basic input/output system is started, obtaining first physical location information of each physical location for placing the hardware device or obtaining second physical location information of each physical location supporting hot plugging of the hardware device.
In order to support naming of a hardware device based on physical location information of the hardware device after scanning the hardware device, after a Basic Input Output System (BIOS) of a computer or a server is started, as a possible implementation manner, first physical location information of each physical location in the computer or the server where the hardware device can be placed, specifically, for example, physical location information of each disk slot and each network card slot on a PCI/PCIe bus in the computer or the server, may be obtained, so as to provide a basis for determination and storage of naming information corresponding to the physical location information.
In a system of devices such as computers or servers, the physical locations where hardware devices can be placed include two types: one is a physical location supporting hot plug of a device, such as a pci slot provided on the U.2 front panel of a device such as a computer or a server, and the other is a physical location not supporting hot plug of a device, such as a pci slot on the motherboard of a device such as a computer or a server.
For the second physical location, since it does not support hot plug of the hardware device, after the naming operation performed on the hardware device in the physical location is completed when the system is started, the hardware device will not be hot plugged in and out in the whole running process of the subsequent system, and correspondingly, the hardware device will not be renamed again, so that the naming of the hardware device in the physical location is fixed and unchanged in the whole running process of the system.
The obtained physical location information of each physical location is mainly used for supporting the name invariance of the devices at the same physical location before and after hot plug when naming the hardware device, and the second physical location does not have the problem of inconsistent device names before and after hot plug because the second physical location does not support hot plug of the devices, so that preferably, after a basic input and output system of the device such as a computer or a server is started, only the second physical location information of each physical location supporting hot plug of the hardware device can be obtained, and the physical location information of each physical location not supporting hot plug of the hardware device is not obtained any more. For example, the physical location information of the pci slot provided by the front panel is obtained U.2, but the physical location information of the pci slot on the motherboard is not obtained any more.
The first physical location information or the second physical location information may include, but is not limited to, slot identifiers of physical slots of devices such as a computer or a server, and bus identifiers of buses where the slots are located; the slot identifier may be information that can be used to identify the slot, such as a slot ID (Identity, Identity number), a slot number, and the like, and the bus identifier may be information that can be used to uniquely identify a bus where the slot is located, such as a pci bus number, and the like. The integration of physical position information such as slot identification and bus identification of a bus where the slot is located can uniquely identify a physical position.
Step 202, matching corresponding naming information for the first physical location information or the second physical location information.
The naming information may include, but is not limited to, key value information such as a naming key and/or a keyword related to the first physical location information or the second physical location information.
Specifically, taking the example that the first physical location information or the second physical location information includes, for example, a slot identifier and a bus identifier of a bus where the slot is located, the naming information may include, but is not limited to, one or more of the following information: the method comprises the steps of slot ID, slot attribute, the number of the pcie bus where the slot is located, hardware equipment identification and related description information of the hardware equipment.
The slot attribute may be, for example, an attribute of whether the slot supports hot plug, a bandwidth supported by the slot, or the like; the hardware device identifier may include, but is not limited to, a pcie device number (a pcie device number allocated to a hardware device on a slot as a pcie device), and/or a device number of a specific device type (for example, if the slot is an nvme disk slot, the number is a nvme disk number allocated to an nvme disk on the slot).
The description information related to the hardware device may be, but is not limited to, whether the nvme disk is connected to the system through a slot provided on the front panel of U.2, or connected to the system through a pci slot on the motherboard, or the like.
Step 203, writing the corresponding relationship between the first physical location information or the second physical location information and the naming information into the at least one field of the data structure table.
After the first physical location information or the second physical location information is matched with the naming information, the naming information is further written into at least one field of the preset data structure table, after the data writing from the naming information to the at least one field of the preset data structure table is completed, the method can support the subsequent utilization of the physical location information of the scanned hardware equipment to acquire the naming information related to the physical location information, and further name the scanned hardware equipment based on the acquired naming information.
For example, in this embodiment, the naming information related to the physical location information (the first physical location information or the second physical location information) of the hardware device is specifically written and stored in at least one field of an SMBIOS (system Management BIOS) data structure table in the BIOS, optionally, one or more of the information of the slot id, the slot attribute, the pci bus number of the located pci bus, and the pci device number may be written and stored in a type9 field of the SMBIOS data structure table, and one or more of the information of the device number of the specific device type belonging to the above, the related description information of the hardware device, and the like may be written in a type41 field of the SMBIOS data structure table.
The type9 and type41 fields of the SMBIOS data structure table are extension fields provided by the SMBIOS data structure table and can be used for storing customized data information.
It should be noted that, the above-mentioned manner of writing and storing the related naming information into the corresponding field of the data structure table is only an exemplary but non-limiting description provided in this embodiment for clearly illustrating the solution of the present application, and when the present application is implemented specifically, the above-mentioned manner of writing the naming information provided in this embodiment is not limited, as long as the naming information corresponding to the physical location information of the hardware device can be successfully written and stored when the BIOS is started, and further, the subsequent naming of the hardware device based on the naming information can be supported.
In this embodiment, by writing the naming information related to the physical location information of the hardware device into at least one field of the predetermined data structure table, it can be supported to subsequently utilize the scanned physical location information of the hardware device to obtain the naming information related to the physical location information, and further utilize the obtained naming information to name the scanned hardware device. Because the naming of the hardware equipment is related to the physical position of the hardware equipment, once the physical position of the hardware equipment is determined, the naming is fixed immediately, the hardware equipment in the same physical position cannot obtain different naming due to hot plug of the hardware equipment, namely, the naming of the equipment in the same physical position before and after hot plug is unchanged, the hot plug of the equipment can be better supported, and the normal use of the system to the hot plug equipment is ensured.
EXAMPLE III
In this embodiment, a specific implementation process of the naming processing method is further provided, and referring to a flowchart of the naming processing method shown in fig. 3, in this embodiment, the naming processing method may be implemented through the following processing processes:
step 301, after the hardware device is scanned, acquiring a slot identifier of a slot where the hardware device is located and a bus identifier of a bus where the slot is located.
After the hardware device is scanned, the physical location information may be, but is not limited to, a slot identifier of a slot where the hardware device is located and a bus identifier of a bus where the slot is located. Specifically, for example, a slot ID of a disk slot where the nvme disk is located and a pci number of a pci bus where the slot is located are obtained, so as to uniquely identify the physical location where the scanned hardware device is located based on the physical location information.
Step 302, reading a naming key value corresponding to the slot identification and the bus identification from the at least one field of the data structure table.
After the physical location information, such as the slot identifier of the hardware device and the bus identifier of the bus where the hardware device is located, is obtained, the naming key value corresponding to the physical location information may be further read from the at least one field of the data structure table. Taking the example that the naming information corresponding to the physical location information is written into the type9 and type41 fields of the SMBIOS data structure table of the BIOS in the preprocessing stage, the naming key value required for naming the hardware device can be specifically read from the type9 and/or type41 fields of the SMBIOS data structure table.
The read naming key value may include a naming key and/or a key word corresponding to the physical location information of the slot identifier and the bus identifier, specifically, for example, one or more of the slot ID, the slot attribute, the pci bus number of the located pci bus, the pci device number, the device number of the specific device type, the related description information of the hardware device, and the like, which are stored in the fields of type9 and type41 of the SMBIOS data structure table.
In specific implementation of the present application, the program code of the renaming service provided by the BIOS may be modified, for example, the program code of the BIOS name (hardware interface may be renamed according to information provided by the system BIOS) is specifically modified, and a function code of "reading naming information from corresponding fields, such as type9 and type11, of the SMBIOS data structure table according to the physical location information of the hardware device" is added to the program code of the renaming service, such as the BIOS name, so as to implement a function of obtaining the naming information required by the hardware device by reading the data structure table.
And 303, naming the hardware equipment by using the naming key value according to a preset naming rule.
The naming rule may include, but is not limited to, naming structure, combination order of each naming key value in naming, and naming format information such as value format requirements.
After obtaining one or more naming key values in a slot ID, a slot attribute, a pcie bus number of a located pcie bus, a pcie device number, a device number of a specific device type, related description information of hardware devices and the like corresponding to the physical position information of the hardware devices, organizing the naming keys according to a naming format required by a rule based on a preset naming rule, and finally generating hardware device names corresponding to the physical position information of the scanned hardware devices.
Illustratively, the application modifies a naming rule file (such as a 71-BIOS default name. rule file) of the BIOS in advance, and writes rule information of the formulated naming rule into the naming rule file of the BIOS, so as to support subsequent naming of the hardware device based on the naming rule. Subsequently, after the hardware device is scanned and the physical location information of the hardware device is acquired, the naming information corresponding to the physical address information can be read from the corresponding fields of type9, type11 and the like of the data structure table of the SMBIOS by using the renaming service (BIOS) of the BIOS, and the required naming rule can be read from the naming rule file (71-BIOS name. rules file), on the basis, the read naming information can be further organized based on the naming rule, and finally the hardware device name corresponding to the physical location information of the hardware device is obtained.
In the prior art, when naming a scanned hardware device, the naming information often includes some other information related to the hardware device besides the dynamic number information allocated to the hardware device based on the scanning order, such as nvme [1], nvme [3], and the like.
In practical implementation of the present application, in order to facilitate a user to know more hardware related information such as a disk naming space, a disk partition, and the like based on a hardware device name, the original naming information may be compatible when the hardware device is scanned and named based on the method of the present application, that is, on the basis of obtaining the above naming key value, the original naming information generated by a system (generally, a system kernel) for the hardware device may be obtained together (based on the reasons of authority or system recovery performance, and the like, the original naming function of the system is preferably not removed when the present application is implemented, that is, the system may still name the hardware device based on the original naming logic), and a new name is generated for the hardware device by combining the above naming key value and the original naming information provided by the system for the hardware device.
Taking nvme disk as an example, the naming format after the scheme of the application is compatible with the original naming information is assumed as follows: nvme < subsystem > p < bus > s < slot > n < namespace > [ p < part > ] [ h < homeplug > ], wherein nvme < subsystem > represents a dynamic number allocated to a disk in an original name, p < bus > represents a bus number of a bus where a disk slot is located, s < slot > represents a slot ID of the located slot, n < namespace > represents a namespace of the disk, p < part > represents a partition of the disk, and h < homeplug > represents whether the located slot has an attribute supporting hot plug. Then, based on the naming format, when the nvme disk is scanned, the name illustratively generated for it may be: nvme0p88s0n1p1_ h0, nvme1p86s0n1p1 and the like, wherein "p 1_ h 0" indicates that the slot in which the disk is located has the property of supporting hot plug, and "p 1" indicates that the slot in which the disk is located does not have the property of supporting hot plug; it should be noted that although some dynamic information in the original name is compatible in the name, since the name includes fixed name information that can uniquely identify the physical location of the slot ID, the bus number of the bus where the slot ID is located, and the like, the disk can be correctly positioned based on the fixed name information before and after hot plug.
And 304, replacing the original name distributed to the hardware equipment by the system according to the scanning sequence by using the hardware equipment name obtained based on the naming key value.
As described above, based on the reasons of authority or system recovery performance, the original naming function of the system is not generally removed when the present application is implemented, that is, the system can still name the hardware device based on its original naming logic.
In a specific implementation, the program code of the renaming service rename _ device of the system may be modified to support the replacement of the original name generated by the system with the generated name corresponding to the physical location information of the hardware device.
According to the embodiment, the hardware device is named based on the physical position information of the hardware device, so that the name of the hardware device is related to the physical position of the hardware device, once the physical position of the hardware device is determined, the name of the hardware device is fixed, the names of the devices in the same physical position before and after hot plug can be ensured to be unchanged, the hot plug of the devices is better supported, and the normal use of the system for the hot plug devices is ensured; in addition, according to the embodiment, when the hardware device is named based on the physical location information of the hardware device, the original name provided for the hardware device by the compatible system can be provided, so that a user can conveniently obtain more related information of the hardware device through the name of the hardware device.
Example four
Referring to the flowchart of the naming processing method shown in fig. 4, before the step 101 of acquiring the physical location information of the physical location where the hardware device is located, the method may further include the following processing procedures:
step 101', determining whether the physical location of the hardware device and/or the hardware device has the attribute of supporting hot plug, and if so, triggering to execute the operation of acquiring the physical location information of the physical location of the hardware device.
Some slots or hardware interfaces in devices such as a computer or a server have a property of supporting hot plug, such as a pci slot provided on the U.2 front panel of the system, while other portions do not have a property of supporting hot plug, such as a pci slot on the system motherboard.
Similarly, some hardware devices in the devices such as the computer or the server have an attribute of supporting hot plug, such as the nvme disk, the network card, and the like, so that after the hardware devices having the attribute of supporting hot plug, such as the nvme disk, the network card, and the like, are inserted into the physical location having the attribute of supporting hot plug, such as the pci slot provided by the U.2 front panel, the hardware devices can subsequently support the user to perform hot plug on the hardware devices based on actual requirements; meanwhile, part of hardware devices do not have the attribute of supporting hot plug, such as a display card (or at least part of display card) and the like, and for the hardware devices which do not have the attribute of supporting hot plug, no matter which physical position of the system the hardware devices are plugged into, the hardware devices do not have the requirement of renaming the hardware devices in the running process of the system, and the problem of inconsistent naming before and after hot plug due to hot plug is solved.
In view of this, optionally, after scanning the hardware device, it may first be determined whether the hardware device and/or the physical location where the hardware device is located has the hot plug support attribute.
The method includes determining whether the hardware device has an attribute supporting hot plug, for example, when a hardware device is scanned, specifically obtaining drive information (such as a device drive name, a version number, and the like) of the device from a related system file (such as a sysfs system file), and identifying whether the device is a device supporting hot plug based on the drive information, further, assuming that the obtained device drive information includes an nvme device drive name, determining that the scanned hardware device is an nvme device, and further determining that the scanned hardware device has an attribute supporting hot plug because the nvme device supports hot plug. Determining whether the physical position of the hardware device has an attribute of supporting hot plug, exemplarily, detecting the type of the physical position, if the physical position of the hardware device is detected to be a pci slot provided by U.2 front panel, determining that the physical position of the hardware device has the attribute of supporting hot plug, otherwise, if the physical position of the hardware device is detected to be a pci slot on the main panel, determining that the physical position of the hardware device does not have the attribute of supporting hot plug.
Once it is determined that the hardware device and/or the physical location where the hardware device is located does not have the attribute of supporting hot plug, the original name generated by the system for the hardware device is directly adopted without executing the process of naming based on the physical location information provided by the scheme of the application; otherwise, if it is determined that the hardware device and/or the physical location where the hardware device is located has the attribute of supporting hot plug, the processing procedure of the scheme of the application may be triggered to name the hardware device based on the physical location information of the hardware device.
In this embodiment, after the hardware device is scanned, by first determining whether the hardware device and/or the physical location where the hardware device is located has the attribute of supporting hot plug, and triggering the processing flow of the scheme of the present application to name the hardware device based on the physical location information of the hardware device if the hardware device and/or the physical location where the hardware device is located has the attribute of supporting hot plug, and not triggering the processing flow of the scheme of the present application if the hardware device is not located, the processing workload of the system when the hardware device is named based on the physical location information of the hardware device can be reduced, and the execution time consumption of the naming processing process of the system is reduced.
EXAMPLE five
Corresponding to the above naming processing method, the present application also discloses a computer processing apparatus, which may be but not limited to be applied to a computer device such as a notebook, a desktop, a kiosk, etc., or a server in an environment such as a local area network/cloud, etc., referring to a schematic structural diagram of the computer processing apparatus shown in fig. 5, the computer processing apparatus includes:
a memory 501 for storing at least one set of instructions;
a processor 502 for invoking and executing the set of instructions in the memory, by executing the set of instructions:
after scanning hardware equipment, acquiring physical position information of a physical position where the hardware equipment is located;
acquiring preset naming information corresponding to the physical location information from a preset data structure table; wherein at least one field in the data structure table stores naming information corresponding to physical location information of a hardware device;
naming the hardware device based on the naming information.
When the operating system of the computer or the server starts or hot-swaps the hardware device in the running process, the hardware device mounted on the PCI/PCIe bus of the system is automatically scanned and the corresponding device driver is called (so that the scanned hardware device is available for the system).
Correspondingly, in this embodiment, the physical location information of the physical location where the hardware device is located may be obtained specifically when an operating system of the computer or the server is started and after the hardware device is scanned; or, in the operating process of the operating system of the computer or the server, after the hardware device is scanned, the physical location information of the physical location where the hardware device is located may be obtained.
The hardware device may be, for example and without limitation, an nvme disk, a network card, or other devices.
The physical location where the hardware device is located may be, but is not limited to, a location provided on a PCI/PCIe bus of a computer or a server for placing and plugging the hardware device, such as a disk slot, a network card slot, and the like.
The physical location information of the physical location of the hardware device correspondingly may include but is not limited to: location information of physical slots on a PCI/PCIe bus of a computer or server.
In order to overcome the defect that the normal use of partial programs to hot-plug equipment in a system is influenced due to the fact that the naming of hardware equipment in the same physical position before and after hot-plug is possibly changed in the mode of naming the hardware equipment based on the scanning sequence in the prior art, the technical idea of naming the hardware equipment based on the physical position information of the physical position where the hardware equipment is located is provided.
Based on the technical idea, the naming information corresponding to the physical position information of the hardware equipment is stored in at least one field of a preset data structure table in advance, the naming information is related to the physical position information of the physical position of the hardware equipment, and once the physical position of the hardware equipment is determined, the corresponding naming information is fixed immediately.
The naming information corresponding to the physical location information of the hardware device may include, but is not limited to, key value information such as a naming key and/or a keyword related to the physical location information of the hardware device, so as to support subsequent naming of the hardware device scanned from the physical location based on the naming key or keyword related to the physical location information of the hardware device.
Therefore, after the hardware device is scanned and the physical location information of the physical location where the hardware device is located is obtained, the naming information corresponding to the physical location information, such as the naming keyword and/or the keyword related to the scanned physical location information of the hardware device, can be further obtained from at least one field of the predetermined data structure table.
Finally, the scanned hardware device can be named based on the obtained naming information related to the physical position information of the hardware device. Illustratively, the name of the scanned nvme disk can be based on the obtained information such as the name keyword and/or the keyword related to the slot information of the nvme disk.
According to the above scheme, the computer processing apparatus of this embodiment proposes that naming information corresponding to physical location information of a hardware device is stored in at least one field of a predetermined data structure table, and on this basis, after the hardware device is scanned, the physical location information of the physical location where the hardware device is located is obtained, and naming information corresponding to the physical location information is obtained from the data structure table, and finally, the scanned hardware device is named based on the naming information corresponding to the physical location information. Therefore, in the application, the naming of the hardware device is related to the physical position of the hardware device, once the physical position of the hardware device is determined, the naming of the hardware device is fixed immediately, so that the hardware device in the same physical position cannot obtain different naming due to hot plug of the hardware device, namely the naming of the device in the same physical position before and after the hot plug is unchanged.
EXAMPLE six
The naming process of the hardware device by the processor 502 in the computer processing apparatus needs to be based on that the naming information corresponding to the physical location information of the hardware device is stored in at least one field of a predetermined data structure table in advance, and therefore, in this embodiment, the processor 502 may further perform the following pre-processing processes before naming the hardware device:
after a basic input and output system is started, acquiring first physical position information of each physical position for placing hardware equipment or acquiring second physical position information of each physical position supporting hot plugging of the hardware equipment;
matching corresponding naming information for the first physical location information or the second physical location information;
writing the corresponding relationship between the first physical location information or the second physical location information and the naming information into the at least one field of the data structure table.
In order to support naming of a hardware device based on physical location information of the hardware device after scanning the hardware device, after a Basic Input Output System (BIOS) of a computer or a server is started, as a possible implementation manner, first physical location information of each physical location in the computer or the server where the hardware device can be placed, specifically, for example, physical location information of each disk slot and each network card slot on a PCI/PCIe bus in the computer or the server, may be obtained, so as to provide a basis for determination and storage of naming information corresponding to the physical location information.
In a system of devices such as computers or servers, the physical locations where hardware devices can be placed include two types: one is a physical location supporting hot plug of a device, such as a pci slot provided on the U.2 front panel of a device such as a computer or a server, and the other is a physical location not supporting hot plug of a device, such as a pci slot on the motherboard of a device such as a computer or a server.
For the second physical location, since it does not support hot plug of the hardware device, after the naming operation performed on the hardware device in the physical location is completed when the system is started, the hardware device will not be hot plugged in and out in the whole running process of the subsequent system, and correspondingly, the hardware device will not be renamed again, so that the naming of the hardware device in the physical location is fixed and unchanged in the whole running process of the system.
The obtained physical location information of each physical location is mainly used for supporting the name invariance of the devices at the same physical location before and after hot plug when naming the hardware device, and the second physical location does not have the problem of inconsistent device names before and after hot plug because the second physical location does not support hot plug of the devices, so that preferably, after a basic input and output system of the device such as a computer or a server is started, only the second physical location information of each physical location supporting hot plug of the hardware device can be obtained, and the physical location information of each physical location not supporting hot plug of the hardware device is not obtained any more. For example, the physical location information of the pci slot provided by the front panel is obtained U.2, but the physical location information of the pci slot on the motherboard is not obtained any more.
The first physical location information or the second physical location information may include, but is not limited to, slot identifiers of physical slots of devices such as a computer or a server, and bus identifiers of buses where the slots are located; the slot identifier may be information that can be used to identify the slot, such as a slot ID (Identity, Identity number), a slot number, and the like, and the bus identifier may be information that can be used to uniquely identify a bus where the slot is located, such as a pci bus number, and the like. The integration of physical position information such as slot identification and bus identification of a bus where the slot is located can uniquely identify a physical position.
The naming information may include, but is not limited to, key value information such as a naming key and/or a keyword related to the first physical location information or the second physical location information.
Specifically, taking the example that the first physical location information or the second physical location information includes, for example, a slot identifier and a bus identifier of a bus where the slot is located, the naming information may include, but is not limited to, one or more of the following information: the method comprises the steps of slot ID, slot attribute, the number of the pcie bus where the slot is located, hardware equipment identification and related description information of the hardware equipment.
The slot attribute may be, for example, an attribute of whether the slot supports hot plug, a bandwidth supported by the slot, or the like; the hardware device identifier may include, but is not limited to, a pcie device number (a pcie device number allocated to a hardware device on a slot as a pcie device), and/or a device number of a specific device type (for example, if the slot is an nvme disk slot, the number is a nvme disk number allocated to an nvme disk on the slot).
The description information related to the hardware device may be, but is not limited to, whether the nvme disk is connected to the system through a slot provided on the front panel of U.2, or connected to the system through a pci slot on the motherboard, or the like.
After the first physical location information or the second physical location information is matched with the naming information, the naming information is further written into at least one field of the preset data structure table, after the data writing from the naming information to the at least one field of the preset data structure table is completed, the method can support the subsequent utilization of the physical location information of the scanned hardware equipment to acquire the naming information related to the physical location information, and further name the scanned hardware equipment based on the acquired naming information.
For example, in this embodiment, the naming information related to the physical location information (the first physical location information or the second physical location information) of the hardware device is specifically written and stored in at least one field of an SMBIOS (system Management BIOS) data structure table in the BIOS, optionally, one or more of the information of the slot id, the slot attribute, the pci bus number of the located pci bus, and the pci device number may be written and stored in a type9 field of the SMBIOS data structure table, and one or more of the information of the device number of the specific device type belonging to the above, the related description information of the hardware device, and the like may be written in a type41 field of the SMBIOS data structure table.
The type9 and type41 fields of the SMBIOS data structure table are extension fields provided by the SMBIOS data structure table and can be used for storing customized data information.
It should be noted that, the above-mentioned manner of writing and storing the related naming information into the corresponding field of the data structure table is only an exemplary but non-limiting description provided in this embodiment for clearly illustrating the solution of the present application, and when the present application is implemented specifically, the above-mentioned manner of writing the naming information provided in this embodiment is not limited, as long as the naming information corresponding to the physical location information of the hardware device can be successfully written and stored when the BIOS is started, and further, the subsequent naming of the hardware device based on the naming information can be supported.
In this embodiment, by writing the naming information related to the physical location information of the hardware device into at least one field of the predetermined data structure table, it can be supported to subsequently utilize the scanned physical location information of the hardware device to obtain the naming information related to the physical location information, and further utilize the obtained naming information to name the scanned hardware device. Because the naming of the hardware equipment is related to the physical position of the hardware equipment, once the physical position of the hardware equipment is determined, the naming is fixed immediately, the hardware equipment in the same physical position cannot obtain different naming due to hot plug of the hardware equipment, namely, the naming of the equipment in the same physical position before and after hot plug is unchanged, the hot plug of the equipment can be better supported, and the normal use of the system to the hot plug equipment is ensured.
EXAMPLE seven
This embodiment will further provide a specific implementation process of naming the hardware device by the processor 502 in the computer processing apparatus, where the processor 502 may implement naming the hardware device by performing the following processes:
after scanning the hardware equipment, acquiring a slot identifier of a slot where the hardware equipment is located and a bus identifier of a bus where the slot is located;
reading a named key value corresponding to the slot identification and the bus identification from the at least one field of the data structure table;
naming the hardware equipment by utilizing the naming key value according to a preset naming rule;
and replacing the original name distributed to the hardware equipment by the system according to the scanning sequence by using the hardware equipment name obtained based on the naming key value.
After the hardware device is scanned, the physical location information may be, but is not limited to, a slot identifier of a slot where the hardware device is located and a bus identifier of a bus where the slot is located. Specifically, for example, a slot ID of a disk slot where the nvme disk is located and a pci number of a pci bus where the slot is located are obtained, so as to uniquely identify the physical location where the scanned hardware device is located based on the physical location information.
After the physical location information, such as the slot identifier of the hardware device and the bus identifier of the bus where the hardware device is located, is obtained, the naming key value corresponding to the physical location information may be further read from the at least one field of the data structure table. Taking the example that the naming information corresponding to the physical location information is written into the type9 and type41 fields of the SMBIOS data structure table of the BIOS in the preprocessing stage, the naming key value required for naming the hardware device can be specifically read from the type9 and/or type41 fields of the SMBIOS data structure table.
The read naming key value may include a naming key and/or a key word corresponding to the physical location information of the slot identifier and the bus identifier, specifically, for example, one or more of the slot ID, the slot attribute, the pci bus number of the located pci bus, the pci device number, the device number of the specific device type, the related description information of the hardware device, and the like, which are stored in the fields of type9 and type41 of the SMBIOS data structure table.
In specific implementation of the present application, the program code of the renaming service provided by the BIOS may be modified, for example, the program code of the BIOS name (hardware interface may be renamed according to information provided by the system BIOS) is specifically modified, and a function code of "reading naming information from corresponding fields, such as type9 and type11, of the SMBIOS data structure table according to the physical location information of the hardware device" is added to the program code of the renaming service, such as the BIOS name, so as to implement a function of obtaining the naming information required by the hardware device by reading the data structure table.
The naming rule may include, but is not limited to, naming structure, combination order of each naming key value in naming, and naming format information such as value format requirements.
After obtaining one or more naming key values in a slot ID, a slot attribute, a pcie bus number of a located pcie bus, a pcie device number, a device number of a specific device type, related description information of hardware devices and the like corresponding to the physical position information of the hardware devices, organizing the naming keys according to a naming format required by a rule based on a preset naming rule, and finally generating hardware device names corresponding to the physical position information of the scanned hardware devices.
Illustratively, the application modifies a naming rule file (such as a 71-BIOS default name. rule file) of the BIOS in advance, and writes rule information of the formulated naming rule into the naming rule file of the BIOS, so as to support subsequent naming of the hardware device based on the naming rule. Subsequently, after the hardware device is scanned and the physical location information of the hardware device is acquired, the naming information corresponding to the physical address information can be read from the corresponding fields of type9, type11 and the like of the data structure table of the SMBIOS by using the renaming service (BIOS) of the BIOS, and the required naming rule can be read from the naming rule file (71-BIOS name. rules file), on the basis, the read naming information can be further organized based on the naming rule, and finally the hardware device name corresponding to the physical location information of the hardware device is obtained.
In the prior art, when naming a scanned hardware device, the naming information often includes some other information related to the hardware device besides the dynamic number information allocated to the hardware device based on the scanning order, such as nvme [1], nvme [3], and the like.
In practical implementation of the present application, in order to facilitate a user to know more hardware related information such as a disk naming space, a disk partition, and the like based on a hardware device name, the original naming information may be compatible when the hardware device is scanned and named based on the method of the present application, that is, on the basis of obtaining the above naming key value, the original naming information generated by a system (generally, a system kernel) for the hardware device may be obtained together (based on the reasons of authority or system recovery performance, and the like, the original naming function of the system is preferably not removed when the present application is implemented, that is, the system may still name the hardware device based on the original naming logic), and a new name is generated for the hardware device by combining the above naming key value and the original naming information provided by the system for the hardware device.
Taking nvme disk as an example, the naming format after the scheme of the application is compatible with the original naming information is assumed as follows: nvme < subsystem > p < bus > s < slot > n < namespace > [ p < part > ] [ h < homeplug > ], wherein nvme < subsystem > represents a dynamic number allocated to a disk in an original name, p < bus > represents a bus number of a bus where a disk slot is located, s < slot > represents a slot ID of the located slot, n < namespace > represents a namespace of the disk, p < part > represents a partition of the disk, and h < homeplug > represents whether the located slot has an attribute supporting hot plug. Then, based on the naming format, when the nvme disk is scanned, the name illustratively generated for it may be: nvme0p88s0n1p1_ h0, nvme1p86s0n1p1 and the like, wherein "p 1_ h 0" indicates that the slot in which the disk is located has the property of supporting hot plug, and "p 1" indicates that the slot in which the disk is located does not have the property of supporting hot plug; it should be noted that although some dynamic information in the original name is compatible in the name, since the name includes fixed name information that can uniquely identify the physical location of the slot ID, the bus number of the bus where the slot ID is located, and the like, the disk can be correctly positioned based on the fixed name information before and after hot plug.
As described above, based on the reasons of authority or system recovery performance, the original naming function of the system is not generally removed when the present application is implemented, that is, the system can still name the hardware device based on its original naming logic.
In a specific implementation, the program code of the renaming service rename _ device of the system may be modified to support the replacement of the original name generated by the system with the generated name corresponding to the physical location information of the hardware device.
According to the embodiment, the hardware device is named based on the physical position information of the hardware device, so that the name of the hardware device is related to the physical position of the hardware device, once the physical position of the hardware device is determined, the name of the hardware device is fixed, the names of the devices in the same physical position before and after hot plug can be ensured to be unchanged, the hot plug of the devices is better supported, and the normal use of the system for the hot plug devices is ensured; in addition, according to the embodiment, when the hardware device is named based on the physical location information of the hardware device, the original name provided for the hardware device by the compatible system can be provided, so that a user can conveniently obtain more related information of the hardware device through the name of the hardware device.
Example eight
In this embodiment, before acquiring the physical location information of the physical location where the hardware device is located, the processor 502 in the computer processing apparatus may further perform the following processing:
and determining whether the hardware equipment and/or the physical position of the hardware equipment has the attribute of supporting hot plug, and if so, triggering and executing the operation of acquiring the physical position information of the physical position of the hardware equipment.
Some slots or hardware interfaces in devices such as a computer or a server have a property of supporting hot plug, such as a pci slot provided on the U.2 front panel of the system, while other portions do not have a property of supporting hot plug, such as a pci slot on the system motherboard.
Similarly, some hardware devices in the devices such as the computer or the server have an attribute of supporting hot plug, such as the nvme disk, the network card, and the like, so that after the hardware devices having the attribute of supporting hot plug, such as the nvme disk, the network card, and the like, are inserted into the physical location having the attribute of supporting hot plug, such as the pci slot provided by the U.2 front panel, the hardware devices can subsequently support the user to perform hot plug on the hardware devices based on actual requirements; meanwhile, part of hardware devices do not have the attribute of supporting hot plug, such as a display card (or at least part of display card) and the like, and for the hardware devices which do not have the attribute of supporting hot plug, no matter which physical position of the system the hardware devices are plugged into, the hardware devices do not have the requirement of renaming the hardware devices in the running process of the system, and the problem of inconsistent naming before and after hot plug due to hot plug is solved.
In view of this, optionally, after scanning the hardware device, it may first be determined whether the hardware device and/or the physical location where the hardware device is located has the hot plug support attribute.
The method includes determining whether the hardware device has an attribute supporting hot plug, for example, when a hardware device is scanned, specifically obtaining drive information (such as a device drive name, a version number, and the like) of the device from a related system file (such as a sysfs system file), and identifying whether the device is a device supporting hot plug based on the drive information, further, assuming that the obtained device drive information includes an nvme device drive name, determining that the scanned hardware device is an nvme device, and further determining that the scanned hardware device has an attribute supporting hot plug because the nvme device supports hot plug. Determining whether the physical position of the hardware device has an attribute of supporting hot plug, exemplarily, detecting the type of the physical position, if the physical position of the hardware device is detected to be a pci slot provided by U.2 front panel, determining that the physical position of the hardware device has the attribute of supporting hot plug, otherwise, if the physical position of the hardware device is detected to be a pci slot on the main panel, determining that the physical position of the hardware device does not have the attribute of supporting hot plug.
Once it is determined that the hardware device and/or the physical location where the hardware device is located does not have the attribute of supporting hot plug, the original name generated by the system for the hardware device is directly adopted without executing the process of naming based on the physical location information provided by the scheme of the application; otherwise, if it is determined that the hardware device and/or the physical location where the hardware device is located has the attribute of supporting hot plug, the processing procedure of the scheme of the application may be triggered to name the hardware device based on the physical location information of the hardware device.
In this embodiment, after the hardware device is scanned, by first determining whether the hardware device and/or the physical location where the hardware device is located has the attribute of supporting hot plug, and triggering the processing flow of the scheme of the present application to name the hardware device based on the physical location information of the hardware device if the hardware device and/or the physical location where the hardware device is located has the attribute of supporting hot plug, and not triggering the processing flow of the scheme of the present application if the hardware device is not located, the processing workload of the system when the hardware device is named based on the physical location information of the hardware device can be reduced, and the execution time consumption of the naming processing process of the system is reduced.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other.
For convenience of description, the above system or apparatus is described as being divided into various modules or units by function, respectively. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments of the present application.
Finally, it is further noted that, herein, relational terms such as first, second, third, fourth, and the like may be 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. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A naming process method, comprising:
after scanning hardware equipment, acquiring physical position information of a physical position where the hardware equipment is located;
acquiring naming information corresponding to the physical location information from a predetermined data structure table; wherein at least one field in the data structure table stores naming information corresponding to physical location information of a hardware device;
naming the hardware device based on the naming information;
wherein the naming the hardware device based on the naming information comprises:
acquiring original naming information generated for the hardware equipment by the system based on original naming logic of the system when the hardware equipment is scanned by the system so as to retain the original naming logic of the system and support complete recovery of original naming functions of the system, wherein the original naming information is related to the scanning sequence of the hardware equipment by the system;
and combining the naming information corresponding to the physical position information and the original naming information to generate a new name for the hardware equipment, and replacing the original name corresponding to the original naming information.
2. The method of claim 1, wherein the obtaining physical location information of a physical location where the hardware device is located comprises:
and acquiring the slot identification of the slot where the hardware equipment is located and the bus identification of the bus where the slot is located.
3. The method of claim 2, wherein the obtaining naming information corresponding to the physical location information from a predetermined data structure table comprises:
reading a named key value corresponding to the slot identification and the bus identification from the at least one field of the data structure table; the named key value includes one or more of the slot identification, the bus identification, a slot attribute, and a hardware device identification.
4. The method of claim 3, the naming the hardware device based on the naming information comprising:
naming the hardware equipment by using the naming key value and the original naming information according to a preset naming rule;
and replacing the original name distributed to the hardware equipment by the system according to the scanning sequence by using the hardware equipment name obtained based on the name key value and the original name information.
5. The method according to any one of claims 1 to 4, further comprising, before the obtaining of the physical location information of the physical location where the hardware device is located:
after a basic input and output system is started, acquiring first physical position information of each physical position for placing hardware equipment or acquiring second physical position information of each physical position supporting hot plugging of the hardware equipment;
matching corresponding naming information for the first physical location information or the second physical location information;
writing the corresponding relationship between the first physical location information or the second physical location information and the naming information into the at least one field of the data structure table.
6. The method according to any one of claims 1 to 4, further comprising, after the hardware device is scanned, before the obtaining of the physical location information of the physical location where the hardware device is located, the step of:
and determining whether the hardware equipment and/or the physical position of the hardware equipment has the attribute of supporting hot plug, and if so, triggering and executing the operation of acquiring the physical position information of the physical position of the hardware equipment.
7. A computer processing apparatus, comprising:
a memory for storing at least one set of instructions;
a processor for invoking and executing the set of instructions in the memory, by executing the set of instructions:
after scanning hardware equipment, acquiring physical position information of a physical position where the hardware equipment is located;
acquiring preset naming information corresponding to the physical location information from a preset data structure table; wherein at least one field in the data structure table stores naming information corresponding to physical location information of a hardware device;
naming the hardware device based on the naming information;
wherein the processor naming the hardware device based on the naming information comprises:
acquiring original naming information generated by a system for hardware equipment based on the naming logic of the system when the hardware equipment is scanned by the system, so as to retain the original naming logic of the system and support the complete recovery of the original naming function of the system, wherein the original naming information is related to the scanning sequence of the hardware equipment by the system;
and combining the naming information corresponding to the physical position information and the original naming information to generate a new name for the hardware equipment, and replacing the original name corresponding to the original naming information.
8. The apparatus of claim 7, wherein the processor obtains physical location information of a physical location where the hardware device is located, and specifically includes: acquiring a slot identifier of a slot in which the hardware equipment is positioned and a bus identifier of a bus in which the slot is positioned;
the processor obtains naming information corresponding to the physical location information from a predetermined data structure table, and specifically includes: reading a named key value corresponding to the slot identification and the bus identification from the at least one field of the data structure table; the named key value comprises one or more of the slot identifier, the bus identifier, a slot attribute and a hardware device identifier;
the processor names the hardware device based on the naming information, and specifically includes: naming the hardware equipment by using the naming key value and the original naming information according to a preset naming rule; and replacing the original name distributed to the hardware equipment by the system according to the scanning sequence by using the hardware equipment name obtained based on the name key value and the original name information.
9. The apparatus of claim 7 or 8, wherein the processor, prior to obtaining the physical location information of the physical location of the hardware device, is further configured to:
after a basic input and output system is started, acquiring first physical position information of each physical position for placing hardware equipment or acquiring second physical position information of each physical position supporting hot plugging of the hardware equipment;
matching corresponding naming information for the first physical location information or the second physical location information;
writing the corresponding relationship between the first physical location information or the second physical location information and the naming information into the at least one field of the data structure table.
10. The apparatus according to claim 7 or 8, wherein the processor, after scanning the hardware device and before acquiring the physical location information of the physical location where the hardware device is located, is further configured to:
and determining whether the hardware equipment and/or the physical position of the hardware equipment has the attribute of supporting hot plug, and if so, triggering and executing the operation of acquiring the physical position information of the physical position of the hardware equipment.
CN201910254419.2A 2019-03-31 2019-03-31 Naming processing method and computer processing device Active CN109960678B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910254419.2A CN109960678B (en) 2019-03-31 2019-03-31 Naming processing method and computer processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910254419.2A CN109960678B (en) 2019-03-31 2019-03-31 Naming processing method and computer processing device

Publications (2)

Publication Number Publication Date
CN109960678A CN109960678A (en) 2019-07-02
CN109960678B true CN109960678B (en) 2021-08-17

Family

ID=67025412

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910254419.2A Active CN109960678B (en) 2019-03-31 2019-03-31 Naming processing method and computer processing device

Country Status (1)

Country Link
CN (1) CN109960678B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110796329A (en) * 2019-09-02 2020-02-14 西安交大捷普网络科技有限公司 Asset transaction monitoring method
CN112685085A (en) * 2020-12-29 2021-04-20 联想(北京)有限公司 Device naming method and device
CN115878529A (en) * 2021-09-26 2023-03-31 华为技术有限公司 Method and device for distributing PCIE equipment identification and related equipment
CN114064133A (en) * 2021-11-02 2022-02-18 联想(北京)有限公司 Hardware information processing method and device and storage system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106657433A (en) * 2016-11-15 2017-05-10 郑州云海信息技术有限公司 Method and device for naming physical network card in multi-network card environment
CN106933509A (en) * 2017-02-17 2017-07-07 联想(北京)有限公司 The processing method and electronic equipment of a kind of disk number
CN108647169A (en) * 2018-05-14 2018-10-12 杭州宏杉科技股份有限公司 A kind of hot plug processing method and processing device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107247672A (en) * 2017-05-03 2017-10-13 深圳市同泰怡信息技术有限公司 Pass through the method for udev and expander relevant interface hyperdisks

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106657433A (en) * 2016-11-15 2017-05-10 郑州云海信息技术有限公司 Method and device for naming physical network card in multi-network card environment
CN106933509A (en) * 2017-02-17 2017-07-07 联想(北京)有限公司 The processing method and electronic equipment of a kind of disk number
CN108647169A (en) * 2018-05-14 2018-10-12 杭州宏杉科技股份有限公司 A kind of hot plug processing method and processing device

Also Published As

Publication number Publication date
CN109960678A (en) 2019-07-02

Similar Documents

Publication Publication Date Title
CN109960678B (en) Naming processing method and computer processing device
US8650442B2 (en) Programming in a simultaneous multi-threaded processor environment
US5748980A (en) System for configuring a computer system
RU2434269C2 (en) Multiprotocol portable storage device
CN100407151C (en) System and method for managing multiple hot plug operations
US7363434B2 (en) Method, system, and computer-readable medium for updating memory devices in a multi-processor computer system
US9239725B2 (en) System and method for installing an OS via a network card supporting PXE
US20150186161A1 (en) Platform system, method for changing support hardware configuration of universal extensible firmware interface basic input output system and computer program product
KR100764921B1 (en) Virtual rom for device enumeration
US10754737B2 (en) Boot assist metadata tables for persistent memory device updates during a hardware fault
US6298427B1 (en) Method and apparatus for mapping hard disk partitions and block devices to logical drives in a computer system
CN113835644B (en) Complete machine migration method, device, equipment and storage medium
CN106462442B (en) System and method for loading virtual machine
CN112527328A (en) System cloning method, device, electronic equipment and computer readable storage medium
CN114385089B (en) Cross addressing-based dynamic bank storage method and device and electronic equipment
US20060047858A1 (en) ROM scan memory expander
US8209443B2 (en) System and method for identifying lost/stale hardware in a computing system
US20080004857A1 (en) Restoring base configuration on software testing computer
CN112905381B (en) Method, device, equipment and medium for acquiring stack frame information in call stack
US20080281992A1 (en) Method for detecting order of attached devices and computer readable storage media storing program thereof
US5732280A (en) Method and apparatus for dynamically assigning programmable option select identifiers
US6493822B1 (en) Foreign drive determination and drive letter conflict resolution
CN108776577A (en) Disk management method, device, electronic equipment and storage medium
JP3022837B2 (en) Service function providing device and providing method
JP2002024024A (en) Method and system for performing adapater configuration routine by using different operation mode

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