Processing method and device and electronic equipment

Through the interaction between the first firmware management module and the second system management module, the function code of the NVME interface is consistent, and the problem of hot plug and unstable caused by inaccurate UEFI calculation function code is solved, and the stable hot plug and unstable function of the NVME interface is realized. .

CN119003402APending Publication Date: 2024-11-22LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411018000.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

UEFI has difficulty accurately calculating the root port function code of the NVME interface, resulting in unstable hot-swap function of the NVME interface.

Method used

The first firmware management module allocates communication channel parameters to the NVME interface and interacts with the second system management module to ensure that the function code is consistent with the function code assigned by the SMU, and directly obtains the function code assigned by the SMU to the NVME interface to ensure stable hot plugging sex.

Benefits of technology

The NVME interface's hot plug function stability is realized, and plugging and unplugging abnormalities caused by function code calculation errors are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003402A_ABST
    Figure CN119003402A_ABST
Patent Text Reader

Abstract

The invention discloses a processing method and device and electronic equipment, and belongs to the technical field of computers.The processing method comprises the steps that a first firmware management module executes target operation used for distributing communication channels for all target hardware interfaces of the electronic equipment, and communication channel distribution parameters generated for all the target hardware interfaces are obtained; the first firmware management module sends the communication channel distribution parameter generated for each target hardware interface to a second system management module of the electronic equipment, so that the second system management module outputs a corresponding function code for each target hardware interface based on the corresponding communication channel distribution parameter; the first firmware management module obtains function codes respectively output by the second system management module for each target hardware interface; wherein each function code corresponds to the corresponding target hardware interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and in particular, relates to a processing method, device and electronic device. Background Art

[0002] Hot plugging means "plugging while powered on". The hot plugging function allows users to remove and replace damaged hard disks, power supplies, boards and other components without shutting down the system or cutting off the power, so as to improve the system's ability to recover from failures / disasters in a timely manner.

[0003] In order to ensure the normal hot-swap function of the AMD NVME (NVM Express, non-volatile memory host controller interface specification) interface, the function code (function number) assigned by UEFI (Unified Extensible Firmware Interface) to the root port of the NVME interface must be the same as the function code assigned by the SMU (System Management Unit) in the CPU (Central Processing Unit) to the root port of the NVME interface. Otherwise, the hot-swap function of the NVME interface will become unstable.

[0004] At present, one implementation method for UEFI to allocate function codes to the root port of the NVME interface is to generate and allocate corresponding function codes for the root port of the NVME interface according to the rules for CPU SMU to calculate function codes given by AMD. However, the rules for CPU SMU to calculate function codes are relatively complex, and it is difficult for UEFI to calculate and generate function codes with 100% accuracy, so it is difficult to ensure that the function code allocated to the root port of the NVME interface is the same as the function code allocated by the SMU in the CPU, which can easily lead to instability in the hot-swap function of the NVME interface. Summary of the invention

[0005] To this end, this application discloses the following technical solutions:

[0006] A processing method, comprising:

[0007] The first firmware management module executes a target operation for respectively allocating communication channels to each target hardware interface of the electronic device, and obtains a communication channel allocation parameter generated for each target hardware interface;

[0008] The first firmware management module sends the communication channel allocation parameter generated for each target hardware interface to the second system management module of the electronic device, so that the second system management module outputs corresponding function codes for each target hardware interface based on the corresponding communication channel allocation parameter;

[0009] The first firmware management module obtains the function codes respectively output by the second system management module for the respective target hardware interfaces; wherein each function code corresponds to a corresponding target hardware interface.

[0010] Optionally, the first firmware management module is a unified extensible firmware interface of the electronic device; the first firmware management module executes a target operation for respectively allocating communication channels to each target hardware interface of the electronic device, and obtains a communication channel allocation parameter generated for each target hardware interface, including:

[0011] The unified extensible firmware interface performs a target operation for respectively allocating communication channels to each non-volatile memory host controller interface of the electronic device, and obtains at least one of a processor identifier and a communication channel identifier generated for each non-volatile memory host controller interface;

[0012] Among them, the processor identifier generated for each non-volatile memory host controller interface is used to indicate the processor to which each non-volatile memory host controller interface is connected based on the allocated communication channel; the target operation is used to allocate communication channels for each non-volatile memory host controller interface on a preset connection line; the communication channel identifier generated for each non-volatile memory host controller interface is used to indicate the communication channel allocated to each non-volatile memory host controller interface on the preset connection line.

[0013] Optionally, the first firmware management module sends the communication channel allocation parameter generated for each target hardware interface to the second system management module of the electronic device, so that the second system management module outputs corresponding function codes for each target hardware interface based on the corresponding communication channel allocation parameter, including:

[0014] The unified extensible firmware interface sends at least one of the processor identifier and the communication channel identifier generated for each non-volatile memory host controller interface to the system management unit in the central processor of the electronic device, so that the system management unit generates and outputs a corresponding function code for the root port of each non-volatile memory host controller interface according to at least one of the corresponding processor identifier and the communication channel identifier through a preset generation rule.

[0015] Optionally, when a function code needs to be output for a corresponding target hardware interface, the input data of the second system management module includes a communication channel allocation parameter corresponding to the corresponding target hardware interface, and the output data includes the input communication channel allocation parameter and the determined function code;

[0016] The first firmware management module obtains the function code output by the second system management module for each of the target hardware interfaces, including:

[0017] For each of the target hardware interfaces, the first firmware management module matches at least part of the communication channel allocation parameters generated for the target hardware interface based on the target operation with output data when the second system management module outputs function codes for each target hardware interface;

[0018] The first firmware management module obtains a function code in the output data that matches the at least part of the communication channel allocation parameters as the function code of the target hardware interface.

[0019] Optionally, after the first firmware management module obtains the function codes respectively output by the second system management module for the respective target hardware interfaces, the method further includes:

[0020] The first firmware management module performs corresponding hot plug processing on the target hardware based on identification information of the corresponding target hardware interface in response to a hot plug event on the target hardware occurring at the corresponding target hardware interface;

[0021] The identification information of the corresponding target hardware interface is generated based on the function code of the corresponding target hardware interface.

[0022] Optionally, the first firmware management module performs a target operation for respectively allocating communication channels to each target hardware interface of the electronic device, including:

[0023] The first firmware management module executes a target operation for respectively allocating communication channels to each target hardware interface of the electronic device during a preset stage of the power-on self-test process of the electronic device.

[0024] Optionally, the preset stage is earlier than the driver execution environment stage in the power-on self-test process of the electronic device;

[0025] After the first firmware management module obtains the function codes respectively output by the second system management module for each target hardware interface, the method further includes:

[0026] The first firmware management module performs path control on each target hardware interface based on identification information corresponding to each target hardware interface during the driver execution environment stage of the electronic device power-on self-test process;

[0027] The identification information corresponding to each target hardware interface is generated based on the function code of the target hardware interface.

[0028] Optionally, before the first firmware management module executes the target operation for respectively allocating communication channels to each target hardware interface of the electronic device, the method further includes:

[0029] The first firmware management module obtains the attributes of each hardware interface on the electronic device to trigger the target operation for a target hardware interface having the target attributes.

[0030] A processing device, comprising:

[0031] The allocation unit is used to: execute a target operation for respectively allocating communication channels to each target hardware interface of the electronic device, and obtain a communication channel allocation parameter generated for each target hardware interface;

[0032] a sending unit, configured to send the communication channel allocation parameter generated for each target hardware interface to a second system management module of the electronic device, so that the second system management module outputs corresponding function codes for each target hardware interface based on the corresponding communication channel allocation parameter;

[0033] The acquisition unit is used to obtain the function codes generated and outputted by the second system management module for each target hardware interface respectively; wherein each function code corresponds to a corresponding target hardware interface.

[0034] An electronic device, comprising:

[0035] A first firmware management module for providing an interface between the operating system and hardware of the electronic device;

[0036] A second system management module having system management functions;

[0037] The first firmware management module is also used to execute any of the processing methods described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are merely 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.

[0039] Figure 1 It is a flow chart of the processing method provided by this application;

[0040] Figure 2 It is another flow chart of the processing method provided by the present application;

[0041] Figure 3 It is another flow chart of the processing method provided by this application;

[0042] Figure 4 It is a composition structure diagram of the processing device provided by this application;

[0043] Figure 5 It is a structural diagram of the electronic device provided in this application. DETAILED DESCRIPTION

[0044] 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.

[0045] The embodiments of the present application provide a processing method, device and electronic device for ensuring the stability of the hot-swap function of a target hardware interface such as an NVME interface. The disclosed processing method can be applied to, but not limited to, electronic devices in many general or special computing device environments or configurations, such as personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor devices, etc.

[0046] See also Figure 1 The method flow chart shown in the figure shows that the processing method provided by the embodiment of the present application at least includes the following processing steps:

[0047] Step 101: The first firmware management module executes a target operation for respectively allocating communication channels to each target hardware interface of the electronic device, and obtains a communication channel allocation parameter generated for each target hardware interface.

[0048] Optionally, the first firmware management module is a unified extensible firmware interface of the electronic device, namely, UEFI, and the target hardware interface is a non-volatile memory host controller interface of the electronic device, namely, an NVME interface, such as an AMD NVME interface.

[0049] The target operation may specifically be a target operation executed by UEFI for respectively allocating communication channels to each NVME interface of the electronic device, such as a bifurcation operation.

[0050] The first firmware management module such as UEFI allocates channel parameters for each target hardware interface generated through target operation, including but not limited to at least one of a processor identifier and a communication channel identifier.

[0051] In this step, the first firmware management module can perform a target operation for respectively allocating communication channels to each target hardware interface of the electronic device at a preset stage during the electronic device power-on self-test process. The preset stage is earlier than the driver execution environment (DXE) stage during the electronic device power-on self-test process.

[0052] In the case where the first firmware management module is UEFI and the target hardware interface is an NVME interface, UEFI can obtain at least one of the processor identifier and the communication channel identifier generated for each NVME interface by executing a target operation, such as a bifurcation operation, for respectively allocating communication channels to each NVME interface of the electronic device.

[0053] The processor identifier generated for each NVME interface is used to indicate the processor to which each NVME interface is connected based on the allocated communication channel, such as the connected CPU (Central Processing Unit).

[0054] The target operation may be specifically used to allocate communication channels for each NVME interface on a preset connection line, and the preset connection line may be, but is not limited to, a PCIE (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) connection line.

[0055] The communication channel identifier generated for each NVME interface is used to indicate the communication channel allocated to each NVME interface on the preset connection line.

[0056] Optionally, the communication channel identifier may further include a communication channel start number and a communication channel end number, and the communication channel start number and the communication channel end number generated for each NVME interface are respectively used to indicate the start communication channel and the end communication channel of each communication channel allocated for each NVME interface on the preset connection line. The communication channel start number and the communication channel end number corresponding to each NVME interface respectively indicate the start communication channel, the end communication channel, and the communication channel whose corresponding number is between the start number and the end number, which are all communication channels allocated to the NVME interface.

[0057] However, it is not limited to this. In actual applications, the communication channel identifier generated for each NVME interface may also include the enumeration result of the communication channel numbers of each communication channel allocated to each NVME interface. As long as the communication channel allocated to each NVME interface can be effectively identified, it is within the protection scope of the embodiments of the present application.

[0058] Step 102: The first firmware management module sends the communication channel allocation parameter generated for each target hardware interface to the second system management module of the electronic device, so that the second system management module outputs corresponding function codes for each target hardware interface based on the corresponding communication channel allocation parameter.

[0059] After the first firmware management module obtains the communication channel allocation parameters generated for each target hardware interface by executing the target operation, the communication channel allocation parameters generated for each target hardware interface are sent to the second system management module of the electronic device. After the second system management module receives the communication channel allocation parameters corresponding to each target hardware interface, it outputs corresponding function codes for each target hardware interface based on the corresponding communication channel allocation parameters.

[0060] The second system management module may generate a corresponding function code for each target hardware interface using a generation rule according to the communication channel allocation parameters corresponding to each target hardware interface, or may directly allocate (i.e., directly allocate without performing a generation operation) a corresponding function code for each target hardware interface using an allocation rule, and there is no limitation on this. Whether the function code is obtained based on the generation method or the function code is obtained based on the direct allocation method, it can be regarded as the function code allocated by the second system management module to the target hardware interface.

[0061] Optionally, the second system management module is a SMU in the CPU of the electronic device.

[0062] In this step, the UEFI may specifically send communication channel allocation parameters such as at least one of the processor identifier and the communication channel identifier generated for each NVME interface to the SMU in the CPU of the electronic device, so that the SMU can output corresponding function codes for each NVME interface based on the received communication channel allocation parameters.

[0063] In an optional implementation, the SMU can generate and output a corresponding function code for the root port of each NVME interface according to communication channel allocation parameters such as at least one of the corresponding processor identification and communication channel identification by preset generation rules. In this implementation, the SMU uses the communication channel allocation parameters such as at least one of the processor identification and communication channel identification corresponding to each NVME interface as a basis for generating a function code for the root port of the NVME interface, and uses corresponding generation rules such as a generation algorithm to generate a corresponding function code for the NVME interface.

[0064] Taking the communication channel allocation parameters corresponding to each NVME interface including the processor identification, the communication channel starting number and the communication channel ending number as an example, UEFI sends the above three parameters corresponding to each NVME interface to the SMU in the CPU of the electronic device. The SMU generates a corresponding function code for each NVME interface operation based on the three parameters corresponding to each NVME interface, that is, based on the processor identification, the communication channel starting number and the communication channel ending number, using generation rules such as a generation algorithm.

[0065] But not limited to this, in other optional implementations, for each NVME interface that receives the corresponding communication channel allocation parameters, the SMU can also directly allocate instead of generating a corresponding function code for each NVME interface according to the allocation rules. For example, the SMU pre-stores multiple function codes, and after receiving the communication channel allocation parameters of each NVME interface, reads a corresponding number of function codes in sequence from the pre-stored multiple function codes, allocates the read function codes to the function codes of each NVME interface in a one-to-one manner, and outputs the allocation result.

[0066] The input data of the second system management module includes the communication channel allocation parameters corresponding to the corresponding target hardware interface, and the output data includes the input communication channel allocation parameters and the determined function code. For example, the input data of the SMU includes the processor identifier, the communication channel start number and the communication channel end number corresponding to each NVME interface, and the output parameters include the processor identifier, the communication channel start number and the communication channel end number corresponding to each NVME interface, and the function code generated or directly allocated for each NVME interface.

[0067] In the output data, the function code output by the second system management module for each target hardware interface is associated with the communication channel allocation parameter corresponding to the target hardware interface, so that the function code generated or directly allocated for each target hardware interface corresponds to the target hardware interface.

[0068] For example, in the output data of the SMU, the function code generated or directly assigned by the SMU for each NVME interface is associated with the processor identifier, the communication channel start number and the communication channel end number corresponding to the NVME interface, so that the function code generated or directly assigned for each NVME interface corresponds to the NVME interface.

[0069] Step 103: The first firmware management module obtains the function codes output by the second system management module for the respective target hardware interfaces; wherein each function code corresponds to a corresponding target hardware interface.

[0070] Optionally, the second system management module may specifically send its output data for each target hardware interface to the first firmware management module. For each target hardware interface, the first firmware management module may match at least part of the communication channel allocation parameters corresponding to the target hardware interface with the output data when the second system management module outputs a function code for each target hardware interface, and obtain the function code in the output data that matches the at least part of the communication channel allocation parameters as the function code of the target hardware interface.

[0071] Taking the first firmware management module as UEFI and the second system management module as SMU as an example, illustratively, SMU can generate or directly assign the output data for each NVME interface, such as processor identification, communication channel starting number, communication channel ending number and function code, and send them to UEFI. More specifically, for example, when sent to the register of UEFI, UEFI can use the communication channel allocation parameters such as processor identification, communication channel starting number, communication channel ending number and so on corresponding to each NVME interface as indexes, and match the function code corresponding to each NVME interface from the stored data in the register.

[0072] In actual applications, not limited to the above-mentioned implementation modes, in other implementation modes, the second system management module can also directly transmit the output data to the corresponding cache area outside the first firmware management module, and the first firmware management module uses the communication channel allocation parameters corresponding to each target hardware interface as an index to determine and obtain the function code corresponding to each target hardware interface from the cache area.

[0073] On the basis of obtaining the function code corresponding to each target hardware interface, the first firmware management module can subsequently perform the required applications in the electronic device based on the function code corresponding to each target hardware interface, such as applications related to hot plugging of target hardware interfaces such as NVME interfaces.

[0074] In the known technology, the function code assigned by UEFI to the root port of the NVME interface is for the purpose of performing related applications in UEFI based on the function code corresponding to the root port of the NVME interface, such as applications related to the hot plug of the NVME interface. In order to ensure the normal hot plug function of the AMD NVME interface, it is essentially required that the function code of the root port of the NVME interface used by UEFI is the same as the function code assigned by the SMU to the root port of the NVME interface. The applicant has found that electronic devices do not forcibly require UEFI to assign function codes to the root port of the NVME interface, as long as UEFI can obtain the function codes of the root ports of each NVME interface and ensure that the obtained function codes are the same as the function codes assigned by the SMU to the root port of the NVME interface.

[0075] Based on this, in the processing method of the embodiment of the present application, the first firmware management module such as UEFI no longer executes the operation of generating function codes for the root ports of target hardware interfaces such as NVME interfaces. Instead, by designing the interaction logic between the first firmware management modules such as UEFI and the second system management modules such as SMU, the first firmware management modules such as UEFI directly obtain and use the function codes assigned to the target hardware interfaces by the second system management modules such as SMU, thereby ensuring that the function codes of each target hardware interface obtained by the first firmware management modules such as UEFI are the same as the function codes assigned to each target hardware interface by the second system management modules such as SMU, thereby ensuring the stability of the hot-swap function of the target hardware interfaces such as NVME interfaces.

[0076] In an alternative embodiment, see Figure 2 As shown in the processing method flow chart, the processing method provided by the present application may further include the following processing after step 103:

[0077] Step 104: In response to a hot-plug event of the target hardware occurring at the corresponding target hardware interface, the first firmware management module performs corresponding hot-plug processing on the target hardware based on identification information of the corresponding target hardware interface.

[0078] The identification information of the corresponding target hardware interface is generated based on the function code of the corresponding target hardware interface.

[0079] The type of the target hardware matches the target hardware interface. If the target hardware interface is an NVME interface, the target hardware may be an NVME device such as an NVME disk.

[0080] Taking the first firmware management module as UEFI and the target hardware interface as NVME interface as an example, UEFI can generate an identifier of the NVME interface based on the function code corresponding to the root port of the NVME interface. Optionally, the function code corresponding to the root port of the NVME interface can be used as a component of the identification string of the NVME interface (for example, as a subsegment in the identification string of the NVME interface) to generate a corresponding identifier for the NVME interface.

[0081] On this basis, UEFI detects a hot plug event of the NVME interface, and in response to detecting a hot plug event of the NVME device occurring at the corresponding NVME interface, performs hot plug processing corresponding to the hot plug event on the NVME device based on the identification information of the NVME interface.

[0082] For example, if it is detected that an NVME disk is inserted into a certain NVME interface, the inserted NVME disk is identified based on the identification information of the NVME interface, and the corresponding drive letter is displayed on the disk interface of the electronic device; if it is detected that an NVME disk on a certain NVME interface is unplugged, the unplugged NVME disk is identified based on the identification information of the NVME interface, and the drive letter of the NVME disk is revoked on the disk interface of the electronic device, etc.

[0083] Since the present application designs the interaction logic between the first firmware management modules such as UEFI and the second system management modules such as SMU, the function codes allocated to the target hardware interfaces by the second system management modules such as SMU are directly obtained and used in the first firmware management modules such as UEFI, thereby ensuring that the function codes of the various target hardware interfaces obtained by the first firmware management modules such as UEFI are the same as the function codes allocated to the various target hardware interfaces by the second system management modules such as SMU, and correspondingly ensuring the stability of the hot-swap functions of the target hardware interfaces such as the NVME interface, and when a hot-swap event occurs to the target hardware interfaces such as the NVME interface, abnormal phenomena such as inability to be recognized will not occur.

[0084] In an alternative embodiment, see Figure 3 As shown in the processing method flow chart, the processing method provided by the present application may further include the following processing after step 103:

[0085] Step 105 : The first firmware management module performs path control on each target hardware interface based on identification information corresponding to each target hardware interface during the driver execution environment phase of the electronic device power-on self-test process.

[0086] The identification information corresponding to each target hardware interface is generated based on the function code of the target hardware interface.

[0087] In the case where the first firmware management module is UEFI and the target hardware interface is an NVME interface, UEFI can generate an identifier of the NVME interface based on the function code corresponding to the root port of the NVME interface. The generation process can be found in the description of the above embodiment and will not be repeated here.

[0088] In this embodiment, UEFI can specifically perform path control on each NVME interface during the driver execution environment stage of the electronic device's power-on self-test process based on the identification information corresponding to each NVME interface. By performing path control on each NVME interface, control of hardware installed on each NVME interface, such as an NVME disk, is achieved.

[0089] In this embodiment, during the power-on self-test process of the electronic device, UEFI performs path control on each NVME interface based on identification information corresponding to each NVME interface, so as to help the user quickly locate the required files or directories while protecting the security of the files when using the electronic device.

[0090] In an optional embodiment, the processing method provided by the present application may further include the following processing before step 101: the first firmware management module obtains the attributes of each hardware interface on the electronic device to trigger the target operation for the target hardware interface with the target attributes.

[0091] Optionally, the attribute of the hardware interface includes the interface type of the hardware interface, and the target attribute may be the target interface type of the hardware interface. In this embodiment, the target interface type is set to NVME.

[0092] Taking the hardware interface as a hard disk / disk interface as an example, specifically, in the preset stage during the power-on self-test process of the electronic device, UEFI first obtains the interface type of each hard disk / disk interface, such as NVME, SATA (Serial ATA), etc., and triggers the target operation only for the NVME type hard disk / disk interface, so as to obtain the function code output by the root port of the SMU as the NVME interface in UEFI based on the target operation and its subsequent steps (such as steps 102-103). For other types of interfaces such as SATA interfaces, it is not necessary to trigger the target operation, and accordingly it is not necessary to execute the subsequent steps of the target operation (such as steps 102-103).

[0093] It is easy to understand that for other types of interfaces, such as SATA interfaces, they can be managed according to the management policies adapted by the other types of interfaces.

[0094] In addition, UEFI can also save the type, slot number and other attribute information of hardware interfaces such as disk / hard disk interfaces, so that it can be displayed when users query their attributes later, making it easier for users to view.

[0095] This embodiment obtains the attributes of each hardware interface on the electronic device in the first firmware management module such as UEFI, and triggers the target operation for the target hardware interface with the target attributes, thereby avoiding the execution of meaningless operations on the hardware interface without target attributes, thereby further improving the processing efficiency and reducing the time consumption.

[0096] Corresponding to the above processing method, the present application embodiment also provides a processing device, whose composition structure is as follows: Figure 4 As shown, including:

[0097] The allocation unit 401 is used to: perform a target operation for respectively allocating communication channels to each target hardware interface of the electronic device, and obtain a communication channel allocation parameter generated for each target hardware interface;

[0098] The sending unit 402 is used to send the communication channel allocation parameter generated for each target hardware interface to the second system management module of the electronic device, so that the second system management module outputs the corresponding function code for each target hardware interface based on the corresponding communication channel allocation parameter;

[0099] The acquisition unit 403 is used to obtain the function codes generated and outputted by the second system management module for each target hardware interface respectively; wherein each function code corresponds to a corresponding target hardware interface.

[0100] In an optional implementation, the allocation unit 401 is specifically used to: perform a target operation for respectively allocating communication channels to each non-volatile memory host controller interface of the electronic device, and obtain at least one of a processor identifier and a communication channel identifier generated for each non-volatile memory host controller interface;

[0101] Among them, the processor identifier generated for each non-volatile memory host controller interface is used to indicate the processor to which each non-volatile memory host controller interface is connected based on the allocated communication channel; the target operation is used to allocate communication channels for each non-volatile memory host controller interface on a preset connection line; the communication channel identifier generated for each non-volatile memory host controller interface is used to indicate the communication channel allocated to each non-volatile memory host controller interface on the preset connection line.

[0102] In an optional embodiment, the sending unit 402 is specifically used to: send at least one of the processor identifier and the communication channel identifier generated for each non-volatile memory host controller interface to the system management unit in the central processor of the electronic device, so that the system management unit generates and outputs a corresponding function code for the root port of each non-volatile memory host controller interface according to at least one of the corresponding processor identifier and the communication channel identifier according to a preset generation rule.

[0103] In an optional implementation, when a function code needs to be output for a corresponding target hardware interface, the input data of the second system management module includes a communication channel allocation parameter corresponding to the corresponding target hardware interface, and the output data includes the input communication channel allocation parameter and the determined function code;

[0104] The acquisition unit 403 is specifically used for:

[0105] For each of the target hardware interfaces, matching at least a portion of the communication channel allocation parameters generated for the target hardware interface based on the target operation with output data when the second system management module outputs a function code for each target hardware interface;

[0106] A function code in the output data that matches the at least part of the communication channel allocation parameter is obtained as the function code of the target hardware interface.

[0107] In an optional implementation manner, the device further includes a hot-swap processing unit, configured to:

[0108] After obtaining the function codes respectively output by the second system management module for the respective target hardware interfaces, in response to a hot plug event of the target hardware occurring at the corresponding target hardware interface, performing corresponding hot plug processing on the target hardware based on the identification information of the corresponding target hardware interface;

[0109] The identification information of the corresponding target hardware interface is generated based on the function code of the corresponding target hardware interface.

[0110] In an optional implementation manner, the allocation unit 401 is specifically configured to: at a preset stage during the power-on self-test process of the electronic device, execute a target operation for respectively allocating communication channels to each target hardware interface of the electronic device.

[0111] In an optional implementation manner, the preset stage is earlier than the driver execution environment stage in the power-on self-test process of the electronic device; the above-mentioned device includes a path control unit, which is used to:

[0112] After obtaining the function codes respectively output by the second system management module for the target hardware interfaces, in the driver execution environment stage during the power-on self-test process of the electronic device, path control is performed on the target hardware interfaces based on the identification information respectively corresponding to the target hardware interfaces, wherein the identification information corresponding to each target hardware interface is generated based on the function code of the target hardware interface.

[0113] In an optional implementation manner, the above device further includes an attribute identification unit, which is used to:

[0114] Before executing the target operation for respectively allocating communication channels to each target hardware interface of the electronic device, the attributes of each hardware interface on the electronic device are obtained to trigger the target operation for the target hardware interface having the target attributes.

[0115] In addition, the present application also provides an electronic device, the composition structure of which is as follows: Figure 5 As shown, including:

[0116] A first firmware management module 501 for providing an interface between the operating system and hardware of the electronic device, and a second system management module 502 having a system management function.

[0117] In addition, the electronic device may also include but is not limited to other components such as processors, memories, graphics cards, and cameras.

[0118] Among them, the first firmware management module 501 can be used to execute the processing method provided by any of the method embodiments above, so as to ensure the stability of the hot-swap function of the target hardware interface such as the NVME interface by executing the processing method provided by the embodiment of the present application.

[0119] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0120] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0121] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or the part that makes a creative contribution can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application or some parts of the embodiments.

[0122] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth are 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 statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0123] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A processing method comprising: The first firmware management module executes a target operation for respectively allocating communication channels to each target hardware interface of the electronic device, and obtains a communication channel allocation parameter generated for each target hardware interface; The first firmware management module sends the communication channel allocation parameter generated for each target hardware interface to the second system management module of the electronic device, so that the second system management module outputs corresponding function codes for each target hardware interface based on the corresponding communication channel allocation parameter; The first firmware management module obtains the function codes respectively output by the second system management module for the respective target hardware interfaces; wherein each function code corresponds to a corresponding target hardware interface.

2. The processing method according to claim 1, wherein the first firmware management module is a unified extensible firmware interface of the electronic device; the first firmware management module performs a target operation for respectively allocating communication channels to each target hardware interface of the electronic device, and obtains a communication channel allocation parameter generated for each target hardware interface, including: The unified extensible firmware interface performs a target operation for respectively allocating communication channels to each non-volatile memory host controller interface of the electronic device, and obtains at least one of a processor identifier and a communication channel identifier generated for each non-volatile memory host controller interface; Among them, the processor identifier generated for each non-volatile memory host controller interface is used to indicate the processor to which each non-volatile memory host controller interface is connected based on the allocated communication channel; the target operation is used to allocate communication channels for each non-volatile memory host controller interface on a preset connection line; the communication channel identifier generated for each non-volatile memory host controller interface is used to indicate the communication channel allocated to each non-volatile memory host controller interface on the preset connection line.

3. The processing method according to claim 2, wherein the first firmware management module sends the communication channel allocation parameter generated for each target hardware interface to the second system management module of the electronic device, so that the second system management module outputs corresponding function codes for each target hardware interface based on the corresponding communication channel allocation parameter, comprising: The unified extensible firmware interface sends at least one of the processor identifier and the communication channel identifier generated for each non-volatile memory host controller interface to the system management unit in the central processor of the electronic device, so that the system management unit generates and outputs a corresponding function code for the root port of each non-volatile memory host controller interface according to at least one of the corresponding processor identifier and the communication channel identifier through a preset generation rule.

4. The processing method according to claim 1, when it is necessary to output a function code for a corresponding target hardware interface, the input data of the second system management module includes a communication channel allocation parameter corresponding to the corresponding target hardware interface, and the output data includes the input communication channel allocation parameter and the determined function code; The first firmware management module obtains the function code output by the second system management module for each of the target hardware interfaces, including: For each of the target hardware interfaces, the first firmware management module matches at least part of the communication channel allocation parameters generated for the target hardware interface based on the target operation with output data when the second system management module outputs function codes for each target hardware interface; The first firmware management module obtains a function code in the output data that matches the at least part of the communication channel allocation parameters as the function code of the target hardware interface.

5. The processing method according to claim 1, after the first firmware management module obtains the function codes respectively output by the second system management module for the respective target hardware interfaces, further comprising: The first firmware management module performs corresponding hot plug processing on the target hardware based on identification information of the corresponding target hardware interface in response to a hot plug event on the target hardware occurring at the corresponding target hardware interface; The identification information of the corresponding target hardware interface is generated based on the function code of the corresponding target hardware interface.

6. The processing method according to claim 1, wherein the first firmware management module performs a target operation for respectively allocating communication channels to each target hardware interface of the electronic device, comprising: The first firmware management module executes a target operation for respectively allocating communication channels to each target hardware interface of the electronic device during a preset stage of the power-on self-test process of the electronic device.

7. The processing method according to claim 6, wherein the preset stage is earlier than the driver execution environment stage in the power-on self-test process of the electronic device; After the first firmware management module obtains the function codes respectively output by the second system management module for each target hardware interface, the method further includes: The first firmware management module performs path control on each target hardware interface based on identification information corresponding to each target hardware interface during the driver execution environment stage of the electronic device power-on self-test process; The identification information corresponding to each target hardware interface is generated based on the function code of the target hardware interface.

8. The processing method according to claim 1, before the first firmware management module executes the target operation for respectively allocating communication channels to each target hardware interface of the electronic device, further comprising: The first firmware management module obtains the attributes of each hardware interface on the electronic device to trigger the target operation for a target hardware interface having the target attributes.

9. A processing device comprising: The allocation unit is used to: execute a target operation for respectively allocating communication channels to each target hardware interface of the electronic device, and obtain a communication channel allocation parameter generated for each target hardware interface; a sending unit, configured to send the communication channel allocation parameter generated for each target hardware interface to a second system management module of the electronic device, so that the second system management module outputs corresponding function codes for each target hardware interface based on the corresponding communication channel allocation parameter; The acquisition unit is used to obtain the function codes generated and outputted by the second system management module for each target hardware interface respectively; wherein each function code corresponds to a corresponding target hardware interface.

10. An electronic device, comprising: A first firmware management module for providing an interface between the operating system and hardware of the electronic device; A second system management module having system management functions; The first firmware management module is also used to execute the processing method according to any one of claims 1-8.