Silk-screen serial number generation method, system and equipment and computer storage medium

By obtaining the enumeration results of the server processing unit port and combining the target traversal sequence and number generation method, the problem of poor flexibility in silk screen number generation in the prior art is solved, and flexible and accurate hard disk number generation is achieved, avoiding server function errors.

CN119576422AActive Publication Date: 2025-03-07INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411734734.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-07
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

The prior art has poor flexibility in generating silk screen serial numbers, and requires customization of the server's hard disk cables, resulting in low cable reuse and unchangeable configuration.

Method used

By obtaining the enumeration results of the server processing unit ports, the initial screen printing position information is generated, combined with the target traversal sequence and number generation method, the initial screen printing position information is traversed and the sequence value of the hard disk is generated, and the silk screen printing sequence information of the hard disk is finally generated.

Benefits of technology

It realizes the flexibility and accuracy of generating silk screen numbers without changing the BIOS enumeration order, and avoids server function errors caused by changing the enumeration order.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576422A_ABST
    Figure CN119576422A_ABST
Patent Text Reader

Abstract

The invention discloses a silk-screen serial number generation method, system and device and a computer storage medium, relates to the technical field of storage, is applied to a basic input and output system, and comprises the following steps: acquiring initial silk-screen position information generated after enumerating a processing unit port of a server; obtaining a target traversal sequence used for numbering the hard disks; obtaining a number generation mode for numbering the hard disk; traversing the initial silk-screen position information according to a target traversing sequence to obtain traversed silk-screen position information, and generating a serial number value of the hard disk according to a serial number generation mode; and generating silk-screen serial number information of the hard disk according to the traversal silk-screen position information and the serial number value. In the process of generating the silk-screen serial number information, the silk-screen serial number information of the hard disk is generated according to the traversal silk-screen position information and the serial number value, so that the result of the silk-screen serial number information can be changed after the target traversal sequence and the serial number generation mode are changed, and the required silk-screen serial number can be flexibly generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and more specifically, to a method, system, device and computer storage medium for generating a silk screen serial number. Background Art

[0002] In the process of using the server, in order to manage the hard disk, it is necessary to ensure that the hard disk numbering by the user is consistent with the hard disk numbering by the server. For example, the BIOS (Basic Input Output System) in the server can first enumerate the hard disks of the server, and the user can change the order of the hard disks in the server so that the order of the chassis silk screen is consistent with the order of BIOS enumeration. However, this method requires the customization of the hard disk cable of the server, the cable reuse rate is low, the configuration cannot be changed, and the flexibility of generating the silk screen serial number is poor.

[0003] In summary, how to flexibly generate silk screen serial numbers is a problem that needs to be solved urgently by those skilled in the art. Summary of the invention

[0004] The purpose of the present application is to provide a method for generating a silk screen serial number, which can solve the technical problem of how to flexibly generate a silk screen serial number to a certain extent. The present application also provides a silk screen serial number generating system, an electronic device and a computer readable storage medium.

[0005] In order to achieve the above objectives, this application provides the following technical solutions:

[0006] A method for generating a silk screen serial number, applied to a basic input and output system, comprising:

[0007] Obtain the initial silk screen position information generated after enumerating the processing unit ports of the server;

[0008] Get the target traversal order for numbering hard disks;

[0009] Get the number generation method used to number the hard disk;

[0010] Traversing the initial silk-screen position information according to the target traversal order to obtain the traversed silk-screen position information, and generating a serial number value of the hard disk according to the numbering generation method;

[0011] The silk screen serial number information of the hard disk is generated according to the traversal silk screen position information and the serial number value.

[0012] In an exemplary embodiment, the step of obtaining a target traversal order for numbering hard disks and obtaining a number generation method for numbering hard disks includes:

[0013] Accessing a preset memory through a system management bus protocol to obtain a target traversal sequence and a number generation method for numbering hard disks;

[0014] Wherein, the preset memory is mounted under the system management bus of the central processing unit.

[0015] In an exemplary embodiment, the accessing of a preset memory through a system management bus protocol to obtain a target traversal sequence and a number generation method for numbering hard disks includes:

[0016] Reading the flag information stored at the first address in the preset memory through the system management bus protocol;

[0017] In response to the flag information being valid, reading the selected information stored at the second address in the preset memory through the system management bus protocol;

[0018] In the preset memory, determining a third address corresponding to the selected information;

[0019] The third address in the preset memory is read through the system management bus protocol to obtain a target traversal sequence and a numbering generation method for numbering the hard disks.

[0020] In an exemplary embodiment, the step of obtaining a target traversal order for numbering hard disks includes:

[0021] Obtaining a target traversal order for numbering hard disks, the target traversal order comprising a central processing unit traversal order and a processing unit port traversal order;

[0022] The obtaining of a number generation method for numbering hard disks includes:

[0023] A numbering method for numbering hard disks is obtained, where the numbering method includes an independent numbering method or a unified numbering method.

[0024] In an exemplary embodiment, traversing the initial silk screen position information according to the target traversal order to obtain the traversed silk screen position information, and generating the serial number value of the hard disk according to the numbering generation method, includes:

[0025] In response to the numbering generation method being a unified numbering method, initializing the values ​​of a processor variable, a processing unit port variable, and a sequence number variable;

[0026] Detecting whether a processor variable is less than a first value, wherein the first value includes a total number of central processing units;

[0027] In response to the processor variable being less than the first value, detecting whether the processing unit port variable is less than a second value, wherein the second value includes a total number of processing unit ports of a single central processing unit;

[0028] In response to the processing unit port variable being less than the second value, a central processing unit that has not been traversed is selected as the processor to be traversed according to the central processing unit traversal order; a processing unit port that has not been traversed is selected from the processors to be traversed according to the processing unit port traversal order, and the initial silk screen position information of the selected processing unit port is used as the traversal silk screen position information, and the serial number value of the hard disk is generated according to the hard disk type and the serial number variable on the selected processing unit port, and the selected processing unit port is marked as traversed; the value of the serial number variable is increased, and the value of the processing unit port variable is increased; and the step of detecting whether the processing unit port variable is less than the second value is returned to be executed;

[0029] In response to the processing unit port variable being equal to the second value, marking the processor to be traversed as traversed, increasing the value of the processor variable, and returning to execute the step of detecting whether the processor variable is less than the first value;

[0030] In response to the processor variable being greater than the first value, the process ends.

[0031] In an exemplary embodiment, traversing the initial silk screen position information according to the target traversal order to obtain the traversed silk screen position information, and generating the serial number value of the hard disk according to the numbering generation method, includes:

[0032] In response to the number generation method being an independent number generation method, initializing the value of the position variable;

[0033] Check if the location variable is less than the area quantity value;

[0034] In response to the position variable being less than the region quantity value, initializing the values ​​of the processor variable, the processing unit port variable, and the sequence number variable; detecting whether the processor variable is less than a first value, the first value comprising a total number of central processing units;

[0035] In response to the processor variable being less than the first value, detecting whether the processing unit port variable is less than a second value, wherein the second value includes a total number of processing unit ports of a single central processor;

[0036] In response to the processing unit port variable being less than the second value, a central processing unit that has not been traversed is selected as the processor to be traversed according to the central processing unit traversal order; a processing unit port that has not been traversed is selected from the processor to be traversed according to the processing unit port traversal order; if the selected processing unit port is in the area corresponding to the position variable, the initial silk screen position information of the selected processing unit port is used as the traversal silk screen position information, and the serial number value of the hard disk is generated according to the hard disk type and serial number variable on the selected processing unit port, the selected processing unit port is marked as traversed, the value of the serial number variable is increased, and the value of the processing unit port variable is increased; if the selected processing unit port is not in the area corresponding to the position variable, the value of the processing unit port variable is increased; return to execute the step of detecting whether the processing unit port variable is less than the second value;

[0037] In response to the processing unit port variable being equal to the second value, marking the processor to be traversed as traversed, increasing the value of the processor variable, and returning to execute the step of detecting whether the processor variable is less than the first value;

[0038] In response to the processor variable being greater than the first value, the value of the position variable is increased, and the process returns to the step of detecting whether the position variable is less than the area quantity value;

[0039] In response to the position variable being equal to the zone quantity value, the process ends.

[0040] In an exemplary embodiment, after generating the silk screen serial number information of the hard disk according to the traversal silk screen position information and the serial number value, the method further includes:

[0041] The silk screen serial number information is synchronized to the baseboard management controller.

[0042] A silk screen serial number generation system, applied to a basic input and output system, comprising:

[0043] A first acquisition module is used to acquire initial silk-screen position information generated after enumerating the processing unit ports of the server;

[0044] The second acquisition module is used to acquire a target traversal order for numbering hard disks;

[0045] A third acquisition module is used to acquire a number generation method for numbering hard disks;

[0046] A first traversal module is used to traverse the initial silk screen position information according to the target traversal order to obtain the traversal silk screen position information, and generate a serial number value of the hard disk according to the numbering generation method;

[0047] The first generating module is used to generate the silk screen serial number information of the hard disk according to the traversal silk screen position information and the serial number value.

[0048] An electronic device, comprising:

[0049] Memory for storing computer programs;

[0050] A processor is used to implement the steps of any of the above-mentioned methods for generating silk screen serial numbers when executing the computer program.

[0051] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned methods for generating a silk-screen serial number are implemented.

[0052] A silk-screen serial number generation method provided by the present application is applied to a basic input-output system, and obtains initial silk-screen position information generated after enumerating the processing unit ports of a server; obtains a target traversal sequence for numbering hard disks; obtains a number generation method for numbering hard disks; traverses the initial silk-screen position information according to the target traversal sequence to obtain the traversal silk-screen position information, and generates a serial number value of the hard disk according to the number generation method; generates the silk-screen serial number information of the hard disk according to the traversal silk-screen position information and the serial number value. The present application generates the silk-screen serial number information only after obtaining the initial silk-screen position information generated after enumerating the processing unit port of the server, and does not change the enumeration order of the BIOS, thereby ensuring the stability of the enumeration order and avoiding the server function error caused by the change of the enumeration order; and in the process of generating the silk-screen serial number information, since the traversal silk-screen position information is determined according to the target traversal order, the serial number value of the hard disk is determined according to the numbering generation method, and the silk-screen serial number information of the hard disk is generated according to the traversal silk-screen position information and the serial number value, after changing the target traversal order and the numbering generation method, the result of the silk-screen serial number information can be changed, thereby controlling the BIOS to flexibly generate the required silk-screen serial number. A silk-screen serial number generation system, electronic device and computer-readable storage medium provided by the present application also solve the corresponding technical problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0054] Figure 1 A flowchart of a method for generating a silk screen serial number provided in an embodiment of the present application;

[0055] Figure 2 It is a schematic diagram of port numbering and traversal order;

[0056] Figure 3 A schematic diagram of the data format for BIOS to read the preset memory through the system management bus protocol;

[0057] Figure 4 A flowchart with unified numbering;

[0058] Figure 5 It is an independently numbered flowchart;

[0059] Figure 6 A schematic diagram of the structure of a silk screen serial number generation system provided in an embodiment of the present application;

[0060] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0061] Figure 8 Another structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0063] See also Figure 1 , Figure 1 A flowchart of a method for generating a silk screen serial number provided in an embodiment of the present application.

[0064] A method for generating a silk screen serial number provided in an embodiment of the present application, applied to a basic input and output system, may include the following steps:

[0065] Step S101: obtaining initial silk-screen position information generated after enumerating the processing unit ports of the server.

[0066] In actual applications, when the BIOS identifies the server's processing unit port (PE Port), it will enumerate the processing unit port according to the set enumeration order. In order to ensure that the BIOS enumeration order remains unchanged, this application needs to generate a silk screen serial number based on the enumeration result after the BIOS completes the enumeration, that is, it is necessary to obtain the initial silk screen position information generated after the server's processing unit port is enumerated. The initial silk screen position information is used to record the location information of the enumerated hard disk. The initial silk screen position information can be composed of the CPU (Central Processing Unit, central processing unit) number, the processing unit port number and the position of the hard disk on the processing unit port. For example, the type of the initial silk screen position information can be CPU1_PE1_EF, etc., which is used to indicate that the hard disk is located at the location of the EF port of PE1 in CPU1. The relationship between the CPU and PE and the port division method on the PE can be flexibly determined according to actual needs. In addition, the hard disk of this application can be an NVME (NonVolatile Memory Host Controller Interface Specification, non-volatile memory host controller interface specification) disk, etc.

[0067] Step S102: Obtain a target traversal order for numbering hard disks.

[0068] Step S103: Acquire a numbering method for numbering hard disks.

[0069] In actual applications, after obtaining the initial silk-screen position information generated after enumerating the processing unit port of the server, since the initial silk-screen position information represents the information of the port where the hard disk is located on the server, the BIOS can manage the hard disk according to the initial silk-screen position information, and thus generate the silk-screen serial number of the hard disk according to the initial silk-screen position information. In this process, considering the user's hardware planning for the server motherboard, the installation position of the hard disk on the motherboard has been determined. At this time, in order to make the silk-screen serial number generated by the BIOS compatible with the installation position of the hard disk by the user, the BIOS needs to ensure that the silk-screen serial number generated is consistent with the numbering result of the hard disk by the user. To this end, the BIOS needs to obtain the target traversal sequence for numbering the hard disk and obtain the numbering generation method for numbering the hard disk, so as to traverse the hard disk according to the target traversal sequence and generate the serial number value of the traversed hard disk according to the numbering generation method. In this way, the required serial number value can be flexibly generated by adjusting the target traversal sequence and the numbering generation method. Taking three hard disks as an example, assuming that the first hard disk is traversed first, then the second hard disk is traversed, and finally the third hard disk is traversed, and the numbering generation method is 1, then 2, and then 3, then the serial number values ​​of the three hard disks are 1, 2, and 3 respectively. If only the target traversal sequence is changed to traverse the second hard disk first, then the first hard disk, and finally the third hard disk, the serial number values ​​of the three hard disks will be changed to 2, 1, and 3.

[0070] In specific application scenarios, the user also identifies the hard disk with the help of the hard disk number, that is, the user will also number the hard disk. If the hard disk numbering result of the user is inconsistent with the hard disk numbering result of the BIOS, when the BIOS detects a hard disk abnormality, it is difficult for the user to directly find the corresponding hard disk according to the hard disk number of the BIOS to operate. Therefore, how to convey the user's hard disk numbering plan to the BIOS so that the BIOS numbering of the hard disk is consistent with the user's hard disk numbering is a difficulty that needs to be overcome. In this process, considering that the BIOS can interact with the CPU and the CPU can mount the memory, the target traversal sequence and numbering generation method for hard disk numbering can be written into this memory, and then the BIOS reads the corresponding information. That is, in the process of obtaining the target traversal sequence for hard disk numbering and obtaining the numbering generation method for hard disk numbering, the BIOS can access the preset memory through the system management bus (System Management Bus, SMBUS) protocol to obtain the target traversal sequence and numbering generation method for hard disk numbering; and the preset memory is mounted under the system management bus of the central processing unit, for example, the preset memory is mounted under the system management bus of the central processing unit through a bidirectional two-wire synchronous serial bus. The type of the preset memory may be determined according to scenario requirements, for example, the preset memory may be an EEPROM (Electrically Erasable Programmable readonly memory).

[0071] In a specific application scenario, information related to the hard disk numbering can be stored at each address of the preset memory. For example, a flag bit can be set at the head address to indicate whether the hard disk numbering information in the preset memory is valid, so that the BIOS can continue to access the preset memory to obtain the hard disk numbering information when the flag bit information is valid, and end the reading of the preset memory when the flag bit is invalid; and various types of hard disk numbering information can be stored at each address of the preset memory, and a specific address can be set to store the hard disk numbering information that is effective this time. In this way, the user only needs to adjust the specific address information to flexibly select the required hard disk numbering information, avoiding the process of repeatedly writing the hard disk numbering information to the preset memory. At this time, the preset memory The storage content can be as shown in Table 1; accordingly, when the BIOS accesses the preset memory through the system management bus protocol to obtain the target traversal order and numbering method for numbering the hard disk, the flag information stored at the first address in the preset memory can be read through the system management bus protocol; in response to the flag information being valid, the selection information stored at the second address in the preset memory is read through the system management bus protocol, and the selection information is used to select the storage address of the effective hard disk numbering information; in the preset memory, the third address corresponding to the selection information is determined; the third address in the preset memory is read through the system management bus protocol to obtain the target traversal order and numbering method for numbering the hard disk.

[0072] Table 1 Address information of preset memory

[0073]

[0074] In Table 1, Area0 of the preset memory is used to store flag information; Area1 is used to store the number of types of hard disk numbering information, such as a total of 10 sets of numbering schemes are reserved; Area2 stores information representing the numbering rules of the front and rear windows, that is, whether the front and rear windows are numbered independently or uniformly; Area3 stores information representing the order of priority scanning of CPUs, which can use 8 bytes, and the CPU priority is determined according to Offset, supporting up to 8 CPUs; Area4 stores information representing the order of priority scanning of PE Ports, which can use 6 bytes, and the PE Port priority is determined according to Offset. Correspondingly, in the process of obtaining the target traversal order for numbering the hard disk, the BIOS can obtain the target traversal order for numbering the hard disk. The target traversal order includes the central processing unit traversal order and the processing unit port traversal order. The central processing unit traversal order is the order in which the central processing unit is traversed, such as first traversing CPU4, then traversing CPU0, then traversing CPU2, etc. The processing unit port traversal order is the order in which the processing unit ports in the central processing unit are traversed. Assuming that there are 6 PEs in a single central processing unit, the processing unit port traversal order can be PE4 first, then PE0, then PE2, etc. At this time, the corresponding port numbering can be as follows Figure 2 As shown; in the process of obtaining the numbering method for numbering the hard disk, the numbering method for numbering the hard disk can be obtained. The numbering method includes an independent numbering method or a unified numbering method. Independent numbering means that the hard disks in each area need to be numbered independently. The unified numbering method means that all hard disks use a set of numbers. Taking the front window and the rear window of the server as an example, when the unified numbering is used, the hard disk serial numbers in the front window are 0, 1, 2...9, and the hard disk serial numbers in the rear window are 10, 11...; when the independent numbering is used, the hard disk serial numbers in the front window are 0, 1, 2...9, and the hard disk serial numbers in the rear window are 0, 1, 2...9.

[0075] It should be noted that the data format of the preset memory read by the BIOS through the system management bus protocol can be flexibly determined according to specific scenarios, for example, Figure 3 As shown, Device Address indicates the device address of the preset memory, and the two-byte Word Address is a 16-bit offset, which can be the offset of the content stored in the preset memory. All offset contents can be read out using a For loop plus 1; Data indicates the actual content read out.

[0076] Step S104: traverse the initial silk-screen position information according to the target traversal order to obtain the traversed silk-screen position information, and generate the serial number value of the hard disk according to the numbering generation method.

[0077] Step S105: Generate the silk-screen serial number information of the hard disk according to the traversal silk-screen position information and the serial number value.

[0078] In actual applications, after obtaining the target traversal order and numbering method for numbering the hard disk, the BIOS can traverse the initial silk-screen position information according to the target traversal order to obtain the traversal silk-screen position information, and generate the serial number value of the hard disk according to the numbering method. At this time, the position and serial number value of the hard disk on the server are known, and the silk-screen serial number information of the hard disk can be generated according to the traversal silk-screen position information and the serial number value. For example, the silk-screen serial number information can be obtained by combining the two in a manner such that the traversal silk-screen position information of the hard disk is in front and the serial number value is in the back. For example, the silk-screen serial number information can be CPU1_PE1_EF_NVME0, etc., where 0 is the serial number value of the hard disk, NVME represents the type of the hard disk, and the method for identifying the hard disk type can be determined according to actual needs.

[0079] In practical applications, a traversal bit can be set for each central processing unit and processing unit, and the traversal bit can be used to represent whether the object is traversed. In this way, when traversing the initial silk-screen position information according to the target traversal order to obtain the traversal silk-screen position information, and generating the serial number value of the hard disk according to the numbering generation method, you can first select a central processing unit that has not been traversed as the processor to be traversed according to the traversal bit and the central processing unit traversal order, and then select a processing unit that has not been traversed as the processing unit to be traversed according to the traversal order of the processing unit port, traverse the port of the processing unit to be traversed, use the initial silk-screen position information of the traversed port as the traversal silk-screen position information, and generate the serial number value of the hard disk installed on the traversal port according to the numbering generation method; after completing the traversal of all ports of the processing unit to be traversed, the traversal bit of the processing unit to be traversed can be set to traversed, and after completing the traversal of all processing units in the processor to be traversed, the traversal bit of the processor to be traversed can be set to traversed. In this way, whether each central processing unit and processing unit has been traversed can be accurately recorded by the traversal bit. The BIOS only needs to combine the traversal bit to accurately traverse the initial silk screen position information of the corresponding port according to the central processing unit traversal order and the processing unit port traversal order, and can accurately generate the serial number value of the hard disk on the port, avoiding confusion in the generated hard disk serial number value due to missing port traversal, thereby improving the accuracy of the generation of the hard disk serial number value.

[0080] In a specific application scenario, in the process of traversing the initial silk screen position information according to the target traversal order, obtaining the traversal silk screen position information, and generating the serial number value of the hard disk according to the numbering generation method, in response to the numbering generation method being a unified numbering method, all hard disks can be directly numbered, such as Figure 4 As shown:

[0081] Initialize the values ​​of processor variables, processing unit port variables and sequence number variables, for example, initialize all these values ​​to 1;

[0082] Detecting whether a processor variable is less than a first value, the first value comprising a total number of central processing units;

[0083] In response to the processor variable being less than a first value, detecting whether the processing unit port variable is less than a second value, the second value comprising a total number of processing unit ports of a single central processing unit;

[0084] In response to the processing unit port variable being less than the second value, a central processing unit that has not been traversed is selected as the processor to be traversed according to the central processing unit traversal order; a processing unit port that has not been traversed is selected from the processors to be traversed according to the processing unit port traversal order, and the initial silk screen position information of the selected processing unit port is used as the traversal silk screen position information, and the serial number value of the hard disk is generated according to the hard disk type and serial number variable on the selected processing unit port, such as combining the hard disk type and serial number variable as the serial number value of the hard disk, etc., and the selected processing unit port is marked as traversed; the value of the serial number variable is increased, such as by 1, and the value of the processing unit port variable is increased, such as by 1; return to the step of executing the detection whether the processing unit port variable is less than the second value;

[0085] In response to the processing unit port variable being equal to the second value, marking the processor to be traversed as traversed, increasing the value of the processor variable, for example, by 1, and returning to execute the step of detecting whether the processor variable is less than the first value;

[0086] In response to the processor variable being greater than the first value, ending.

[0087] In a specific application scenario, in the process of traversing the initial silk screen position information according to the target traversal order, obtaining the traversal silk screen position information, and generating the serial number value of the hard disk according to the numbering generation method, in response to the numbering generation method being an independent numbering method, it is necessary to independently number the hard disks in each area. At this time, the hard disks can be numbered according to the area type, such as Figure 5 As shown:

[0088] Initialize the value of the position variable, for example, to 1. The position variable is used to represent the information of the area where the hard disk is located. For example, the front window of the server can be represented by 0, and the back window of the server can be represented by 1.

[0089] Check if the location variable is less than the region number value, which is the number of server regions that need to be numbered independently;

[0090] In response to the position variable being less than the region quantity value, initializing the values ​​of the processor variable, the processing unit port variable, and the sequence number variable, such as initializing these values ​​to 1;

[0091] Detecting whether a processor variable is less than a first value, the first value comprising a total number of central processing units;

[0092] In response to the processor variable being less than a first value, detecting whether the processing unit port variable is less than a second value, the second value comprising a total number of processing unit ports of a single central processing unit;

[0093] In response to the processing unit port variable being less than the second value, a central processing unit that has not been traversed is selected as the processor to be traversed according to the central processing unit traversal order; a processing unit port that has not been traversed is selected from the processor to be traversed according to the processing unit port traversal order; if the selected processing unit port is in the area corresponding to the position variable, the initial silk screen position information of the selected processing unit port is used as the traversal silk screen position information, and the serial number value of the hard disk is generated according to the hard disk type and serial number variable on the selected processing unit port, the selected processing unit port is marked as traversed, the value of the serial number variable is increased, for example, by 1, and the value of the processing unit port variable is increased, for example, by 1; if the selected processing unit port is not in the area corresponding to the position variable, the value of the processing unit port variable is increased, for example, by 1; return to execute the step of detecting whether the processing unit port variable is less than the second value;

[0094] In response to the processing unit port variable being equal to the second value, marking the processor to be traversed as traversed, increasing the value of the processor variable, for example, by 1, and returning to execute the step of detecting whether the processor variable is less than the first value;

[0095] In response to the processor variable being greater than the first value, the value of the position variable is increased, for example, by 1, and the process returns to the step of detecting whether the position variable is less than the value of the number of regions;

[0096] In response to the position variable being equal to the zone quantity value, then ending.

[0097] From this implementation process, it can be seen that in the process of independently numbering the hard disks, the present application initializes the serial number variable of the hard disk in the area to 0 after determining the corresponding area according to the position variable, so that the serial number value of the hard disk in each area is generated from 0, which lays a good foundation for realizing the independent numbering of the hard disks in each area; and in the process of independently numbering the hard disks in each area, the initial silk-screen position information of the selected processing unit port is used as the traversal silk-screen position information, and the serial number value of the hard disk is generated according to the hard disk type and the serial number variable on the selected processing unit port. After marking the selected processing unit port as traversed, the value of the serial number variable is increased, and the value of the processing unit port variable is increased; and when the selected processing unit port is not in the area corresponding to the position variable, only the value of the processing unit port variable is increased, and the value of the serial number variable is not increased, so that the next hard disk belonging to this area will still use the previous serial number variable to generate the serial number value, ensuring the continuity of the hard disk serial number value in the same area, and achieving the effect of stable numbering of the hard disks in the same area.

[0098] It should be noted that when the selected processing unit port is not in the area corresponding to the position variable, the selected processing unit port may not be marked as traversed. In this way, after the position variable is changed, the processing unit port can continue to be traversed. Of course, the selected processing unit port can also be marked as traversed, but after changing the position variable, all traversal bits need to be reset so that the processing unit port can continue to be traversed.

[0099] In actual applications, after the BIOS generates the silk-screen serial number information of the hard disk according to the traversal of the silk-screen position information and the serial number value, it can also synchronize the silk-screen serial number information to the baseboard management controller and the BIOS's own setting interface, so as to apply the silk-screen serial number information to manage the hard disk accordingly.

[0100] A silk-screen serial number generation method provided by the present application is applied to a basic input-output system, and obtains initial silk-screen position information generated after enumerating the processing unit ports of a server; obtains a target traversal sequence for numbering hard disks; obtains a number generation method for numbering hard disks; traverses the initial silk-screen position information according to the target traversal sequence to obtain the traversal silk-screen position information, and generates a serial number value of the hard disk according to the number generation method; generates the silk-screen serial number information of the hard disk according to the traversal silk-screen position information and the serial number value. The present application generates the silk-screen serial number information only after obtaining the initial silk-screen position information generated after enumerating the processing unit ports of the server, and does not change the enumeration order of the BIOS, thereby ensuring the stability of the enumeration order and avoiding server function errors caused by changes in the enumeration order; and in the process of generating the silk-screen serial number information, since the traversal silk-screen position information is determined according to the target traversal order, the serial number value of the hard disk is determined according to the numbering generation method, and the silk-screen serial number information of the hard disk is generated according to the traversal silk-screen position information and the serial number value, the result of the silk-screen serial number information can be changed after changing the target traversal order and the numbering generation method, so that the BIOS can be controlled to flexibly generate the required silk-screen serial number.

[0101] See also Figure 6 , Figure 6 A structural schematic diagram of a silk screen serial number generation system provided in an embodiment of the present application.

[0102] A silk screen serial number generation system provided in an embodiment of the present application is applied to a basic input and output system and may include:

[0103] The first acquisition module 101 is used to acquire initial silk-screen position information generated after enumerating the processing unit ports of the server;

[0104] The second acquisition module 102 is used to acquire a target traversal order for numbering hard disks;

[0105] The third acquisition module 103 is used to acquire a number generation method for numbering hard disks;

[0106] The first traversal module 104 is used to traverse the initial silk screen position information according to the target traversal order, obtain the traversal silk screen position information, and generate the serial number value of the hard disk according to the numbering generation method;

[0107] The first generating module 105 is used to generate the silk screen serial number information of the hard disk according to the traversal silk screen position information and the serial number value.

[0108] A silk screen serial number generation system provided in an embodiment of the present application is applied to a basic input and output system, and the second acquisition module and the third acquisition module may include:

[0109] A first access unit is used to access a preset memory through a system management bus protocol to obtain a target traversal sequence and a number generation method for numbering hard disks;

[0110] The preset memory is mounted under the system management bus of the central processing unit.

[0111] A silk-screen serial number generation system provided by an embodiment of the present application is applied to a basic input and output system, and a first access unit can be used to: read flag information stored at a first address in a preset memory through a system management bus protocol; in response to the flag information being valid, read selection information stored at a second address in the preset memory through a system management bus protocol; in the preset memory, determine a third address corresponding to the selection information; read the third address in the preset memory through the system management bus protocol to obtain a target traversal order and number generation method for numbering hard disks.

[0112] A silk screen serial number generation system provided in an embodiment of the present application is applied to a basic input and output system, and the second acquisition module may include:

[0113] A first acquisition unit, used for acquiring a target traversal order for numbering hard disks, the target traversal order including a central processing unit traversal order and a processing unit port traversal order;

[0114] The third acquisition module may include:

[0115] The second acquisition unit is used to acquire a number generation method for numbering the hard disks, where the number generation method includes an independent numbering method or a unified numbering method.

[0116] An embodiment of the present application provides a system for generating a silk screen serial number, which is applied to a basic input and output system. The first traversal module may include:

[0117] A first initialization unit, configured to initialize the values ​​of the processor variable, the processing unit port variable, and the sequence number variable in response to the number generation method being a unified number generation method;

[0118] A first detection unit is used to detect whether a processor variable is less than a first value, wherein the first value includes the total number of central processing units; in response to the processor variable being less than the first value, the processing unit port variable is detected to be less than a second value, wherein the second value includes the total number of processing unit ports of a single central processing unit; in response to the processing unit port variable being less than the second value, a central processing unit that has not been traversed is selected as a processor to be traversed according to the central processing unit traversal order; in accordance with the processing unit port traversal order, a processing unit port that has not been traversed is selected from the processor to be traversed, and the initial silk screen position information of the selected processing unit port is used as the traversal silk screen position information, and a serial number value of the hard disk is generated according to the hard disk type and serial number variable on the selected processing unit port, and the selected processing unit port is marked as traversed; the value of the serial number variable is increased, and the value of the processing unit port variable is increased; and the step of detecting whether the processing unit port variable is less than the second value is returned to be executed; in response to the processing unit port variable being equal to the second value, the processor to be traversed is marked as traversed, the value of the processor variable is increased, and the step of detecting whether the processor variable is less than the first value is returned to be executed; in response to the processor variable being greater than the first value, the process ends.

[0119] An embodiment of the present application provides a system for generating a silk screen serial number, which is applied to a basic input and output system. The first traversal module may include:

[0120] A second initialization unit, configured to initialize the value of the position variable in response to the number generation method being an independent number generation method;

[0121] The second detection unit is used to detect whether the position variable is less than the region quantity value; in response to the position variable being less than the region quantity value, the values ​​of the processor variable, the processing unit port variable and the sequence number variable are initialized; the processor variable is detected to be less than a first value, the first value including the total number of central processors; in response to the processor variable being less than the first value, the processing unit port variable is detected to be less than a second value, the second value including the total number of processing unit ports of a single central processor; in response to the processing unit port variable being less than the second value, a central processor that has not been traversed is selected as the processor to be traversed according to the central processor traversal order; a processing unit port that has not been traversed is selected from the processor to be traversed according to the processing unit port traversal order; if the selected processing unit port is in the region corresponding to the position variable, the initial value of the selected processing unit port is selected. The silk-screen position information is used as the traversal silk-screen position information, and the serial number value of the hard disk is generated according to the hard disk type and serial number variable on the selected processing unit port, the selected processing unit port is marked as traversed, the value of the serial number variable is increased, and the value of the processing unit port variable is increased. If the selected processing unit port is not in the area corresponding to the position variable, the value of the processing unit port variable is increased; return to execute the step of detecting whether the processing unit port variable is less than the second value; in response to the processing unit port variable being equal to the second value, the processor to be traversed is marked as traversed, the value of the processor variable is increased, and return to execute the step of detecting whether the processor variable is less than the first value; in response to the processor variable being greater than the first value, the value of the position variable is increased, and return to execute the step of detecting whether the position variable is less than the area quantity value; in response to the position variable being equal to the area quantity value, end.

[0122] A silk screen serial number generation system provided in an embodiment of the present application is applied to a basic input and output system and may further include:

[0123] The first synchronization module is used for synchronizing the silk screen serial number information to the baseboard management controller after the first generation module generates the silk screen serial number information of the hard disk according to the traversal silk screen position information and the serial number value.

[0124] The present application also provides an electronic device and a computer-readable storage medium, both of which have the corresponding effects of the method for generating a silk-screen serial number provided in the embodiment of the present application. Figure 7 , Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0125] An electronic device provided in an embodiment of the present application includes a memory 201 and a processor 202. The memory 201 stores a computer program. When the processor 202 executes the computer program, the steps of the silk screen serial number generation method described in any of the above embodiments are implemented.

[0126] See also Figure 8 , another electronic device provided in the embodiment of the present application may also include: an input port 203 connected to the processor 202, for transmitting commands input from the outside to the processor 202; a display unit 204 connected to the processor 202, for displaying the processing results of the processor 202 to the outside; a communication module 205 connected to the processor 202, for realizing communication between the electronic device and the outside. The display unit 204 can be a display panel, a laser scanning display, etc.; the communication method adopted by the communication module 205 includes but is not limited to mobile high-definition link technology (Mobile High-Definition Link, MHL), Universal Serial Bus (Universal Serial Bus, USB), High-Definition Multimedia Interface (High-DefinitionMultimedia Interface, HDMI), wireless connection: wireless fidelity technology (WIreless Fidelity, WiFi), Bluetooth communication technology, low-power Bluetooth communication technology, and communication technology based on IEEE802.11s.

[0127] An embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the method for generating a silk screen serial number described in any of the above embodiments are implemented.

[0128] The computer-readable storage medium involved in this application includes random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs (Compact Disc Read-Only Memory), or any other form of storage medium known in the technical field.

[0129] A computer program product provided in an embodiment of the present application includes a computer program / instruction, which, when executed by a processor, implements the steps of the method for generating a silk screen serial number as described in any of the above embodiments.

[0130] For the description of the relevant parts of the silk-screen serial number generation system, electronic device and computer-readable storage medium provided in the embodiment of the present application, please refer to the detailed description of the corresponding parts in the silk-screen serial number generation method provided in the embodiment of the present application, which will not be repeated here. In addition, the parts of the above technical solutions provided in the embodiment of the present application that are consistent with the corresponding technical solutions in the prior art are not described in detail to avoid excessive elaboration.

[0131] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0132] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating a silk screen serial number, characterized in that: Applicable to basic input and output systems, including: Obtain the initial silk screen position information generated after enumerating the processing unit ports of the server; Get the target traversal order for numbering hard disks; Get the number generation method used to number the hard disk; Traversing the initial silk-screen position information according to the target traversal order to obtain the traversed silk-screen position information, and generating a serial number value of the hard disk according to the numbering generation method; The silk screen serial number information of the hard disk is generated according to the traversal silk screen position information and the serial number value.

2. The method according to claim 1, characterized in that: The step of obtaining a target traversal order for numbering the hard disks and obtaining a number generation method for numbering the hard disks includes: Accessing a preset memory through a system management bus protocol to obtain a target traversal sequence and a number generation method for numbering hard disks; Wherein, the preset memory is mounted under the system management bus of the central processing unit.

3. The method according to claim 2, characterized in that The method of accessing the preset memory through the system management bus protocol to obtain the target traversal sequence and number generation method for numbering the hard disks includes: Reading the flag information stored at the first address in the preset memory through the system management bus protocol; In response to the flag information being valid, reading the selected information stored at the second address in the preset memory through the system management bus protocol; In the preset memory, determining a third address corresponding to the selected information; The third address in the preset memory is read through the system management bus protocol to obtain a target traversal sequence and a numbering generation method for numbering the hard disks.

4. The method according to claim 1, characterized in that The step of obtaining a target traversal sequence for numbering hard disks includes: Obtaining a target traversal order for numbering hard disks, the target traversal order comprising a central processing unit traversal order and a processing unit port traversal order; The obtaining of a number generation method for numbering hard disks includes: A numbering method for numbering hard disks is obtained, where the numbering method includes an independent numbering method or a unified numbering method.

5. The method according to claim 4, characterized in that The traversing the initial silk screen position information according to the target traversal order to obtain the traversed silk screen position information, and generating the serial number value of the hard disk according to the numbering generation method, includes: In response to the numbering generation method being a unified numbering method, initializing the values ​​of a processor variable, a processing unit port variable, and a sequence number variable; Detecting whether a processor variable is less than a first value, wherein the first value includes a total number of central processing units; In response to the processor variable being less than the first value, detecting whether the processing unit port variable is less than a second value, wherein the second value includes a total number of processing unit ports of a single central processing unit; In response to the processing unit port variable being less than the second value, a central processing unit that has not been traversed is selected as the processor to be traversed according to the central processing unit traversal order; a processing unit port that has not been traversed is selected from the processors to be traversed according to the processing unit port traversal order, and the initial silk screen position information of the selected processing unit port is used as the traversal silk screen position information, and the serial number value of the hard disk is generated according to the hard disk type and the serial number variable on the selected processing unit port, and the selected processing unit port is marked as traversed; the value of the serial number variable is increased, and the value of the processing unit port variable is increased; and the step of detecting whether the processing unit port variable is less than the second value is returned to be executed; In response to the processing unit port variable being equal to the second value, marking the processor to be traversed as traversed, increasing the value of the processor variable, and returning to execute the step of detecting whether the processor variable is less than the first value; In response to the processor variable being greater than the first value, the process ends.

6. The method according to claim 4, characterized in that The traversing the initial silk screen position information according to the target traversal order to obtain the traversed silk screen position information, and generating the serial number value of the hard disk according to the numbering generation method, includes: In response to the number generation method being an independent number generation method, initializing the value of the position variable; Check if the location variable is less than the area quantity value; In response to the position variable being less than the region quantity value, initializing the values ​​of the processor variable, the processing unit port variable, and the sequence number variable; detecting whether the processor variable is less than a first value, the first value comprising a total number of central processing units; In response to the processor variable being less than the first value, detecting whether the processing unit port variable is less than a second value, wherein the second value includes a total number of processing unit ports of a single central processor; In response to the processing unit port variable being less than the second value, a central processing unit that has not been traversed is selected as the processor to be traversed according to the central processing unit traversal order; a processing unit port that has not been traversed is selected from the processor to be traversed according to the processing unit port traversal order; if the selected processing unit port is in the area corresponding to the position variable, the initial silk screen position information of the selected processing unit port is used as the traversal silk screen position information, and the serial number value of the hard disk is generated according to the hard disk type and serial number variable on the selected processing unit port, the selected processing unit port is marked as traversed, the value of the serial number variable is increased, and the value of the processing unit port variable is increased; if the selected processing unit port is not in the area corresponding to the position variable, the value of the processing unit port variable is increased; return to execute the step of detecting whether the processing unit port variable is less than the second value; In response to the processing unit port variable being equal to the second value, marking the processor to be traversed as traversed, increasing the value of the processor variable, and returning to execute the step of detecting whether the processor variable is less than the first value; In response to the processor variable being greater than the first value, the value of the position variable is increased, and the process returns to the step of detecting whether the position variable is less than the area quantity value; In response to the position variable being equal to the zone quantity value, the process ends.

7. The method according to claim 1, characterized in that After generating the silk screen serial number information of the hard disk according to the traversal silk screen position information and the serial number value, the method further includes: The silk screen serial number information is synchronized to the baseboard management controller.

8. A silk screen serial number generation system, characterized in that: Applicable to basic input and output systems, including: A first acquisition module is used to acquire initial silk-screen position information generated after enumerating the processing unit ports of the server; A second acquisition module is used to acquire a target traversal order for numbering hard disks; A third acquisition module is used to acquire a number generation method for numbering hard disks; A first traversal module is used to traverse the initial silk screen position information according to the target traversal order to obtain the traversal silk screen position information, and generate a serial number value of the hard disk according to the numbering generation method; The first generating module is used to generate the silk screen serial number information of the hard disk according to the traversal silk screen position information and the serial number value.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, used to implement the steps of the method for generating a silk screen serial number as claimed in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for generating a silk-screen serial number according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • PCIE (Peripheral Component Interface Express) equipment link state monitoring and alarming method, device and equipment and readable medium

    CN113448810A

  • Hard disk slot position and signal lamp number determination method and system and related assembly

    CN113849380A

  • Hard disk serial number identification method and device

    CN116166855A

  • Hard disk screen printing distribution method and device, computer equipment and medium

    CN117077221A

  • Cloud platform NVMe hard disk positioning method and device, equipment and medium

    CN118689744A