Processing method and electronic equipment
By comparing the plug-in information of the target port, determining the changed functional equipment and adjusting its resource possession, the problem of insufficient resources in the electronic device system is solved and the startup efficiency and user experience are improved.
Patent Information
- Application Number
- CN202411304459.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-01-07
AI Technical Summary
When electronic devices replace functional equipment or adjust working modes, it may lead to insufficient system resources, affecting the normal opening of the equipment, and the existing solutions are time-consuming and inconvenient to operate, affecting the user experience.
By obtaining plug-in information of the target port, comparing current and historical information, determining the changing functional devices, and adjusting them according to their resource possession, including disconnecting communication connections and stopping system resource allocation, to ensure that system resources do not exceed the threshold.
It improves the resource management efficiency of electronic devices when starting up, avoids the problem of insufficient system resources, simplifies user operations, and improves user experience.
Smart Images

Figure CN119271400A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of system resource management, and in particular to a processing method and an electronic device. Background Art
[0002] At present, the ports set on the motherboard of electronic devices are plugged into different types of functional devices, such as graphics cards, network cards, sound cards, and so on. The functional devices plugged into the ports will occupy certain system resources to realize the corresponding functions. During the use of electronic devices, different functional devices may be replaced on the ports, or the working modes of the functional devices may be adjusted. The functional devices will occupy more system resources, which may cause the problem of insufficient system resources, and thus make the electronic device unable to start normally. The existing solution usually stops turning on the electronic device and checks the functional devices of each port. The operation is time-consuming and inconvenient, affecting the user experience. Summary of the invention
[0003] Embodiments of the present application provide a processing method and an electronic device.
[0004] On the one hand, an embodiment of the present application provides a processing method, including:
[0005] Acquire first plugging information, where the first plugging information is plugging information corresponding to a functional device plugged into a target port, the target port is set on a body of the electronic device, and the first plugging information is obtained by reading a first firmware of the electronic device;
[0006] Determining whether the amount of system resources of the electronic device is less than a first threshold;
[0007] When the amount of system resources of the electronic device is less than the first threshold, determining the target functional device corresponding to the target port that has changed in the first plug information according to the acquired change information of the first plug information, and adjusting the amount of resources occupied by the target functional device;
[0008] The change information of the first plugging information is obtained based on the comparison between the first plugging information of the electronic device started this time and the historical first plugging information.
[0009] Optionally, determining, according to the acquired change information of the first plug information, a target functional device corresponding to a target port that has changed in the first plug information includes:
[0010] Based on the change information of the first plugging information, acquiring identification information and / or configuration information of the functional device plugged into the target port through the second firmware of the electronic device;
[0011] Based on the identification information and / or configuration information of the functional device plugged into the target port, a functional device whose identification information has changed or a functional device whose configuration information has changed among the functional devices plugged into the target port is determined as the target functional device.
[0012] Optionally, the method further includes:
[0013] The historical first plugging information is that each time the electronic device is successfully started, the first plugging information is obtained and the first plugging information is saved in the baseboard management controller as at least a part of the historical first plugging information;
[0014] The second firmware compares the current first plugging information with the first plugging information acquired when the electronic device was last turned on to determine whether the current first plugging information has changed.
[0015] Optionally, the obtaining the first plug information includes:
[0016] The number and identification information of the target port and the identification information of the functional device corresponding to the target port plugged with the functional device are obtained.
[0017] Optionally, the method further includes:
[0018] In the case where identification information of a new functional device is obtained, it is indicated that the target port is plugged with a new functional device, and the functional device is determined as the target functional device corresponding to the target port that has changed in the first plug information; or
[0019] When the configuration information or working mode of the functional device changes, the resource occupancy required by the functional device representing the target port plug-in changes, and the functional device is determined as the target functional device corresponding to the changed target port in the first plug-in information.
[0020] Optionally, the adjusting the resource occupancy of the target functional device includes:
[0021] After determining the target functional device corresponding to the target port that has changed in the first plug information, the communication connection of the target port corresponding to the target functional device is disconnected to stop allocating system resources to the target functional device.
[0022] Optionally, the body of the electronic device is provided with a plurality of groups of root ports, each group of root ports is provided with at least one target port, and the method further comprises:
[0023] Comparing the current first plugging information corresponding to each group of root ports with the first plugging information corresponding to the group of root ports acquired when the electronic device was last turned on, to determine whether the current first plugging information corresponding to the group of root ports has changed;
[0024] If the current first plugging information corresponding to the group of root ports changes, it is determined that there is a target port in the group of root ports whose first plugging information changes.
[0025] Optionally, the method further includes:
[0026] If there is a target port in any group of root ports that has changed in the first plug-in information, and the resource occupancy required for the functional device plugged into the target port has changed, the communication connection of the target port is disconnected, and the communication connection of the ports in the group of root ports except the target port is maintained.
[0027] On the other hand, an embodiment of the present application further provides an electronic device, including:
[0028] an acquisition module, configured to acquire first plugging information, wherein the first plugging information is plugging information corresponding to a functional device plugged into a target port, the target port is provided on a body of the electronic device, and the first plugging information is obtained by reading a first firmware of the electronic device;
[0029] A determination module, configured to determine whether the amount of system resources of the electronic device is less than a first threshold;
[0030] a processing module, configured to determine, when the amount of system resources of the electronic device is less than the first threshold, a target functional device corresponding to the target port that has changed in the first plug information according to the acquired change information of the first plug information, and adjust the amount of resources occupied by the target functional device;
[0031] The change information of the first plugging information is obtained based on the comparison between the first plugging information of the electronic device started this time and the historical first plugging information.
[0032] An embodiment of the present application further provides another electronic device, including a memory and a processor, wherein the memory stores an executable program, and the processor executes the executable program to implement the steps of the above method. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the present application or 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 some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0034] Figure 1 A flowchart of a processing method according to an embodiment of the present application;
[0035] Figure 2 For the embodiments of this application Figure 1 A flowchart of an embodiment of step S300;
[0036] Figure 3 Another flow chart of the processing method of an embodiment of the present application;
[0037] Figure 4 A structural block diagram of an electronic device according to an embodiment of the present application;
[0038] Figure 5 This is a structural block diagram of another electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0039] Various aspects and features of the present application are described herein with reference to the accompanying drawings.
[0040] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.
[0041] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0042] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.
[0043] It should also be understood that although the present application has been described with reference to some specific examples, those skilled in the art will be able to readily implement many other equivalent forms of the present application.
[0044] The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
[0045] Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments applied for are merely examples of the present application, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that obscure the present application. Therefore, the specific structural and functional details applied for herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present application in a variety of ways with substantially any suitable detailed structure.
[0046] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present application.
[0047] Figure 1 A flowchart of a processing method according to an embodiment of the present application is shown. A processing method according to an embodiment of the present application is provided, such as Figure 1 As shown, including:
[0048] S100, obtaining first plugging information, where the first plugging information is plugging information corresponding to a functional device plugged into a target port, the target port is set on a body of an electronic device, and the first plugging information is obtained by reading a first firmware of the electronic device;
[0049] The processing method of this embodiment can be applied to an electronic device, and the electronic device can be an electronic device having a target port, for example, the electronic device can be a desktop computer or a laptop computer. The target port is set on the motherboard of the electronic device, and the target port can be used to plug in a functional device, for example, the target port can be a PCIe interface or an NVMe interface, which is used to connect the functional device to the electronic device. The functional device can be different types of input / output devices, for example, the functional device includes at least one of the following: a graphics card, a sound card, a network card, a video card, a RAID card, and an NVMe expansion card.
[0050] In this embodiment, after the electronic device is started, it will obtain the first plug-in information, which is the plug-in information corresponding to the functional device plugged into the target port. Specifically, the first plug-in information may include: the number and identification information of each target port, and the identification information of the functional device corresponding to the target port plugged with the functional device. For example, the PCIe interface numbered 1 is plugged with a graphics card, the PCIe interface numbered 2 is plugged with a RAID card, and the PCIe interface numbered 3 has no device plugged in. The number and identification information of the above PCIe interface, and the identification information of the functional device corresponding to the PCIe interface plugged with the functional device can be determined as the first plug-in information. The first plug-in information can be obtained by reading the first firmware of the electronic device, and the first firmware can be a field programmable gate array (FPGA). After the electronic device is turned on, the first plug-in information can be obtained by reading the FPGA.
[0051] S200, determining whether the amount of system resources of the electronic device is less than a first threshold;
[0052] In this embodiment, for the functional device plugged into the target port, the electronic device will allocate system resources to the functional device so that the functional device can operate. Specifically, system resources can be allocated to the functional device according to the properties and working mode of the functional device. The system resources include at least one of the following: memory space, storage space corresponding to input / output operations, and bus number. After starting the electronic device and obtaining the first plug-in information, it is determined whether the amount of system resources of the electronic device is less than the first threshold. If the amount of system resources of the electronic device is not less than the first threshold, it indicates that the system resources occupied by the functional device plugged into the target port will not affect the normal operation of the electronic device; if the amount of system resources of the electronic device is less than the first threshold, it indicates that the functional device plugged into the target port occupies too many system resources, and the electronic device may not be able to operate normally.
[0053] S300, when the amount of system resources of the electronic device is less than the first threshold value, determine the target functional device corresponding to the target port that has changed in the first plug information according to the acquired change information of the first plug information, and adjust the resource occupancy of the target functional device; wherein the change information of the first plug information is obtained based on the comparison between the first plug information started this time and the historical first plug information of the electronic device.
[0054] In this embodiment, when the amount of system resources of the electronic device is less than the first threshold, it indicates that the functional device plugged into the target port occupies too many system resources, which may affect the normal operation of the electronic device. According to the change information of the first plug information obtained, the target functional device corresponding to the target port that has changed in the first plug information can be determined. The target functional device can be a newly added device or a device with a changed configuration in the functional device plugged into the target port. The target functional device occupies additional system resources, which affects the normal operation of the electronic device. The change information of the first plug information can be obtained based on the comparison between the first plug information started by the electronic device this time and the historical first plug information. Specifically, the first plug information of the electronic device when it is started this time can be obtained, and the historical first plug information of the electronic device when it was last started can be obtained, and the first plug information of the electronic device when it is started this time can be compared with the historical first plug information to obtain the change information of the first plug information, and then the target functional device corresponding to the target port that has changed in the first plug information can be determined. After determining the target functional device, the resource occupation of the target functional device can be adjusted to reduce the resource occupation of the target functional device, or the system resource allocation to the target functional device can be stopped, so that the electronic device can operate normally.
[0055] For example, when the electronic device was started last time, the PCIe interface numbered 1 was plugged with a graphics card, the PCIe interface numbered 2 was plugged with a RAID card, and the PCIe interface numbered 3 had no device plugged in. The number and identification information of the above PCIe interface, and the identification information of the functional device corresponding to the PCIe interface plugged with the functional device are the first historical plug-in information; when the electronic device is started this time, the PCIe interface numbered 1 is plugged with a graphics card, the PCIe interface numbered 2 is plugged with a RAID card, and the PCIe interface numbered 3 is plugged with a video card. The number and identification information of the above PCIe interface, and the identification information of the functional device corresponding to the PCIe interface plugged with the functional device are the first plug-in information of the electronic device started this time. After comparing the first plug-in information of the electronic device started this time with the first historical plug-in information, it can be determined that the change information of the first plug-in information comes from the PCIe interface numbered 3, that is, the target functional device corresponding to the target port that has changed in the first plug-in information is the video card plugged in the PCIe interface numbered 3. The resource occupation of the video card plugged into the PCIe interface numbered 3 may be reduced, or system resource allocation to the video card plugged into the PCIe interface numbered 3 may be stopped.
[0056] The present application obtains the first plugging information each time the electronic device is started in the above manner. When the system resource amount of the electronic device is less than the first threshold, the first plugging information of the electronic device started this time is compared with the historical first plugging information to obtain the change information of the first plugging information, and then the target functional device corresponding to the target port that has changed in the first plugging information is determined, and the resource occupancy of the target functional device is adjusted, so that the electronic device can operate normally without affecting the normal operation of other devices plugged into the target port, the operation is convenient, and the user experience is improved.
[0057] In one embodiment of the present application, Figure 2 As shown, the determining, according to the acquired change information of the first plug information, the target functional device corresponding to the target port that has changed in the first plug information includes:
[0058] S310, based on the change information of the first plug information, obtaining identification information and / or configuration information of the functional device plugged into the target port through the second firmware of the electronic device;
[0059] In this embodiment, after obtaining the change information of the first plug information, it can be determined that there is a target functional device in the functional device plugged into the target port. According to the change information of the first plug information, the process of determining the target functional device corresponding to the target port that has changed in the first plug information can firstly obtain the identification information and / or configuration information of the functional device plugged into the target port through the second firmware of the electronic device based on the change information of the first plug information, and the second firmware can be a unified extensible firmware interface (UEFI). Specifically, each time the electronic device is started, the identification information and / or configuration information of all the functional devices plugged into the target port can be obtained through UEFI, and then the target functional device can be determined based on the identification information and / or configuration information of the functional device plugged into the target port. For example, the identification information and / or configuration information of all the functional devices plugged into the PCIe interface can be obtained through UEFI, and then the target functional device can be determined based on the identification information and / or configuration information of the functional device plugged into the PCIe interface.
[0060] S320: Based on the identification information and / or configuration information of the functional device plugged into the target port, determine a functional device whose identification information has changed or a functional device whose configuration information has changed among the functional devices plugged into the target port as the target functional device.
[0061] In this embodiment, after obtaining the identification information and / or configuration information of the functional device plugged into the target port, it can be determined whether the identification information and / or configuration information of the functional device plugged into the target port has changed based on the identification information and / or configuration information of the functional device plugged into the target port. If the identification information and / or configuration information of the functional device plugged into the target port has changed, a functional device whose identification information has changed or a functional device whose configuration information has changed among the functional devices plugged into the target port can be determined as a target functional device.
[0062] For example, when the electronic device was last started, a graphics card was plugged into PCIe interface No. 1, a RAID card was plugged into PCIe interface No. 2, and no device was plugged into PCIe interface No. 3. When the electronic device is started this time, a graphics card is plugged into PCIe interface No. 1, a RAID card is plugged into PCIe interface No. 2, and a video card is plugged into PCIe interface No. 3. The identification information and / or configuration information of all functional devices plugged into the PCIe interface can be obtained through UEFI, and it is determined that the identification information of the video card plugged into PCIe interface No. 3 is the newly added identification information relative to the last time the electronic device was started. Therefore, the video card plugged into PCIe interface No. 3 is the target functional device. Alternatively, when the electronic device is started this time, the PCIe interface numbered 1 is connected to a graphics card, the PCIe interface numbered 2 is connected to a RAID card, and the PCIe interface numbered 3 has no device connected. The identification information and / or configuration information of the functional devices connected to all the PCIe interfaces can be obtained through UEFI, and it is determined that the configuration information of the graphics card connected to the PCIe interface numbered 1 has changed compared to the last time the electronic device was started. Therefore, the graphics card connected to the PCIe interface numbered 1 is the target functional device.
[0063] In one embodiment of the present application, the method further includes:
[0064] The historical first plugging information is that each time the electronic device is successfully started, the first plugging information is obtained and the first plugging information is saved in the baseboard management controller as at least a part of the historical first plugging information;
[0065] The second firmware compares the current first plugging information with the first plugging information acquired when the electronic device was last turned on to determine whether the current first plugging information has changed.
[0066] In this embodiment, each time the electronic device is successfully started, the first plugging information is obtained and the first plugging information is saved in the baseboard management controller BMC, and the first plugging information is saved in the baseboard management controller as at least a part of the historical first plugging information. Specifically, the historical first plugging information can be the first plugging information obtained when the electronic device was successfully started last time, or it can be the first plugging information obtained when the electronic device was successfully started each time before. For example, after the electronic device is successfully started and the current first plugging information is saved, the current first plugging information can be used as the historical first plugging information when the electronic device is started next time.
[0067] After starting the electronic device and obtaining the first plugging information of the electronic device when it is started this time and the historical first plugging information of the electronic device when it was last started, the second firmware UEFI compares the current first plugging information with the first plugging information obtained when the electronic device was last started, and determines whether the current first plugging information has changed. That is, each time the electronic device is started, the second firmware UEFI compares the current first plugging information with the historical first plugging information when the electronic device was last started. Specifically, the identification information and / or configuration information of the functional devices plugged into all the current target ports can be compared with the identification information and / or configuration information of the functional devices plugged into all the target ports when the electronic device was last started through UEFI, thereby determining whether the identification information and / or configuration information of the functional devices plugged into the current target ports has changed.
[0068] In one embodiment of the present application, the obtaining of the first plug information includes:
[0069] The number and identification information of the target port and the identification information of the functional device corresponding to the target port plugged with the functional device are obtained.
[0070] In this embodiment, each time the electronic device is started, the number and identification information of the target port, as well as the identification information of the functional device corresponding to the target port with the functional device plugged in, are obtained by reading the first firmware FPGA. Specifically, the number and identification information of all target ports can be obtained, including the number and identification information of the target port with the functional device plugged in, and the number and identification information of the target port without the functional device plugged in; and the identification information of the functional device corresponding to the target port with the functional device plugged in is obtained. The identification information of the target port can be the ID information of each target port, that is, the unique identification information; the identification information of the functional device can be the ID information of the functional device, that is, the unique identification information corresponding to each functional device.
[0071] In one embodiment of the present application, the method further includes:
[0072] In the case where identification information of a new functional device is obtained, it is indicated that the target port is plugged with a new functional device, and the functional device is determined as the target functional device corresponding to the target port that has changed in the first plug information; or
[0073] When the configuration information or working mode of the functional device changes, the resource occupancy required by the functional device representing the target port plug-in changes, and the functional device is determined as the target functional device corresponding to the changed target port in the first plug-in information.
[0074] In this embodiment, the current first plug-in information is compared with the first plug-in information obtained when the electronic device was last started. After determining that the current first plug-in information has changed, when the identification information of the new functional device is obtained, it is characterized that the new functional device is plugged into the target port, that is, the change information of the first plug-in information is the identification information of the functional device, and the functional device can be determined as the target functional device corresponding to the target port that has changed in the first plug-in information.
[0075] For example, when the electronic device was last started, the PCIe interface numbered 1 was plugged with a graphics card, the PCIe interface numbered 2 was plugged with a RAID card, and the PCIe interface numbered 3 had no device plugged in. When the electronic device is started this time, the PCIe interface numbered 1 is plugged with a graphics card, the PCIe interface numbered 2 is plugged with a RAID card, and the PCIe interface numbered 3 is plugged with a video card. After comparing the current first plug-in information with the first plug-in information obtained when the electronic device was last started, the change information representing the first plug-in information is the acquisition of identification information of a new functional device, that is, the identification information of the video card plugged into the PCIe interface numbered 3 is the newly added identification information relative to the last time the electronic device was started, and therefore, the video card plugged into the PCIe interface numbered 3 is the target functional device.
[0076] For another example, when the electronic device was last started, the PCIe interface numbered 1 was plugged with a graphics card, the PCIe interface numbered 2 was plugged with a RAID card, and the PCIe interface numbered 3 had no device plugged in. When the electronic device is started this time, the PCIe interface numbered 1 is plugged with a network card, the PCIe interface numbered 2 is plugged with a RAID card, and the PCIe interface numbered 3 is plugged with a video card. After comparing the current first plug-in information with the first plug-in information obtained when the electronic device was last started, the change information representing the first plug-in information is that the identification information of the new functional device is obtained, that is, the identification information of the network card plugged into the PCIe interface numbered 1 is the identification information that has changed relative to the last time the electronic device was started, and the identification information of the video card plugged into the PCIe interface numbered 3 is the identification information newly added relative to the last time the electronic device was started. Therefore, the network card plugged into the PCIe interface numbered 1 and the video card plugged into the PCIe interface numbered 3 are the target functional devices.
[0077] The current first plug-in information is compared with the first plug-in information obtained when the electronic device was last started, and after determining that the current first plug-in information has changed, when the configuration information or the working mode of the functional device has changed, the resource occupancy required to represent the functional device plugged in the target port has changed, that is, the change information of the first plug-in information is the configuration information of the functional device, and the functional device can be determined as the target functional device corresponding to the target port that has changed in the first plug-in information.
[0078] For example, when the electronic device was started last time and this time, the PCIe interface numbered 1 was connected to a graphics card, the PCIe interface numbered 2 was connected to a RAID card, and the PCIe interface numbered 3 had no device connected. After comparing the current first plug-in information with the first plug-in information obtained when the electronic device was last started, the change information of the first plug-in information is characterized by the acquisition of new configuration information of the functional device, that is, the configuration information of the graphics card connected to the PCIe interface numbered 1 has changed compared to the last time the electronic device was started. Therefore, the graphics card connected to the PCIe interface numbered 1 is the target functional device.
[0079] For another example, when the electronic device was last started and this time, a graphics card was plugged into the PCIe interface numbered 1, a RAID card was plugged into the PCIe interface numbered 2, and no device was plugged into the PCIe interface numbered 3. After comparing the current first plug-in information with the first plug-in information obtained when the electronic device was last started, the change information representing the first plug-in information is the configuration information corresponding to different working modes of the same functional device, that is, the working modes of the graphics card plugged into the PCIe interface numbered 1 and the RAID card plugged into the PCIe interface numbered 2 have changed compared to the last time the electronic device was started. Therefore, the graphics card plugged into the PCIe interface numbered 1 and the RAID card plugged into the PCIe interface numbered 2 are the target functional devices.
[0080] In one embodiment of the present application, when the identification information of a new functional device is obtained and the configuration information or working mode of the original functional device has changed, it is characterized that a new functional device is plugged into the target port, and the resource occupancy rate required by the functional device plugged into the target port has changed, and the new functional device and the functional device whose configuration information or working mode has changed are determined as the target functional device corresponding to the target port whose configuration information or working mode has changed in the first plug information. In this case, the resource occupancy of the new functional device can be reduced first, or the system resource allocation to the new functional device can be stopped first. If the system resources are still insufficient after the resource occupancy of the new functional device is reduced or the system resource allocation to the new functional device is stopped, the resource occupancy of the functional device whose configuration information or working mode has changed can be reduced, or the system resource allocation to the functional device whose configuration information or working mode has changed can be stopped.
[0081] For example, when the electronic device was last started, the PCIe interface numbered 1 was plugged with a graphics card, the PCIe interface numbered 2 was plugged with a RAID card, and the PCIe interface numbered 3 had no device plugged in. When the electronic device is started this time, the PCIe interface numbered 1 is plugged with a graphics card, the PCIe interface numbered 2 is plugged with a RAID card, and the PCIe interface numbered 3 is plugged with a video card. After comparing the current first plug-in information with the first plug-in information obtained when the electronic device was last started, the configuration information of the graphics card plugged into the PCIe interface numbered 1 has changed relative to the last time the electronic device was started, and the identification information of the video card plugged into the PCIe interface numbered 3 is the newly added identification information relative to the last time the electronic device was started, and the graphics card plugged into the PCIe interface numbered 1 and the video card plugged into the PCIe interface numbered 3 are target functional devices. System resource allocation for the video card plugged into the PCIe interface numbered 3 can be stopped first, and if the system resources are still insufficient, system resource allocation for the graphics card plugged into the PCIe interface numbered 1 can be stopped.
[0082] In one embodiment of the present application, the adjusting the resource occupancy of the target functional device includes:
[0083] After determining the target functional device corresponding to the target port that has changed in the first plug information, disconnect the communication connection of the target port corresponding to the target functional device to stop allocating system resources to the target functional device.
[0084] In this embodiment, when the electronic device is started this time, the current first plug-in information is compared with the first plug-in information obtained when the electronic device was started last time, and it is determined that the current first plug-in information has changed. After determining the target functional device corresponding to the target port that has changed in the first plug-in information, the resource occupancy of the target functional device can be adjusted. Specifically, the communication connection of the target port corresponding to the target functional device can be disconnected to stop allocating system resources to the target functional device. The target functional device does not occupy system resources, and the normal operation of the electronic device can be guaranteed.
[0085] In one embodiment of the present application, the electronic device body is provided with multiple groups of root ports, and each group of root ports is provided with at least one target port, such as Figure 3 As shown, the method also includes:
[0086] S400, comparing the current first plugging information corresponding to each group of root ports with the first plugging information corresponding to the group of root ports obtained when the electronic device was last turned on, to determine whether the current first plugging information corresponding to the group of root ports has changed;
[0087] In this embodiment, the mainboard of the electronic device may be provided with multiple groups of root ports, each group of root ports may be provided with one target port or multiple target ports, and each time the electronic device is started, the current first plugging information corresponding to each group of root ports may be compared with the first plugging information corresponding to the group of root ports obtained when the electronic device was last started, to determine whether the current first plugging information corresponding to the group of root ports has changed. Specifically, the identification information and / or configuration information of the functional devices plugged into all the target ports included in each group of root ports may be compared with the identification information and / or configuration information of the functional devices plugged into all the target ports included in each group of root ports when the electronic device was last started, to further determine whether the identification information and / or configuration information of the functional devices plugged into all the target ports included in each group of root ports has changed.
[0088] S500: If the current first plugging information corresponding to the group of root ports has changed, determine that there is a target port in the group of root ports whose first plugging information has changed.
[0089] In this embodiment, after comparing the current first plugging information corresponding to each group of root ports with the first plugging information corresponding to the group of root ports obtained when the electronic device was last turned on, if the current first plugging information corresponding to the group of root ports has changed, it is determined that there is a target port in the group of root ports whose first plugging information has changed. That is, among the functional devices plugged into the target ports included in the group of root ports, there is a functional device whose identification information and / or configuration information has changed.
[0090] For example, the mainboard of the electronic device is provided with three groups of root ports, the first group of root ports includes PCIe interface numbered 1, PCIe interface numbered 2, and PCIe interface numbered 3; the second group of root ports includes PCIe interface numbered 4; the third group of root ports includes PCIe interface numbered 5, NVMe interface numbered 6, and NVMe interface numbered 7. When the electronic device was last started, PCIe interface numbered 1 in the first group of root ports was plugged with a graphics card, PCIe interface numbered 2 was plugged with a RAID card, and PCIe interface numbered 3 had no device plugged in; PCIe interface numbered 4 in the second group of root ports had no device plugged in; PCIe interface numbered 5 in the third group of root ports had no device plugged in, NVMe interface numbered 6 had no device plugged in, and NVMe interface numbered 7 had an NVMe expansion card plugged in. When the electronic device is started this time, the PCIe interface numbered 1 is connected to a graphics card, the PCIe interface numbered 2 is connected to a RAID card, and the PCIe interface numbered 3 is connected to a video card; there is no device connected to the PCIe interface numbered 4 in the second group of root ports; there is no device connected to the PCIe interface numbered 5 in the third group of root ports, there is a network card connected to the NVMe interface numbered 6, and there is an NVMe expansion card connected to the NVMe interface numbered 7. After comparing the current first plug-in information with the first plug-in information obtained when the electronic device was last started, the identification information of the video card plugged into the PCIe interface numbered 3 in the first group of root ports, and the identification information of the network card plugged into the NVMe interface numbered 6 in the third group of root ports are newly added identification information relative to the last time the electronic device was started, the video card plugged into the PCIe interface numbered 1 in the first group of root ports and the network card plugged into the NVMe interface numbered 6 in the third group of root ports are target functional devices, and the PCIe interface numbered 1 in the first group of root ports and the NVMe interface numbered 6 in the third group of root ports are target ports where the first plug-in information changes.
[0091] In one embodiment of the present application, the user can be reminded to perform the required operations on the target port and the functional device through a preset processing mechanism based on the first plug information obtained each time the electronic device is started. Specifically, the preset processing mechanism may include: level 0, when the system resources are insufficient, reminding the user which group of root ports' first plug information has changed; level 1, when the first plug information has changed, notifying the user that the identification information or configuration information of the target functional device plugged into the target port has changed, and notifying the user of the target functional device that needs to be shut down; level 2, shutting down the target functional device corresponding to the target port that has changed in the first plug information based on level 1.
[0092] In one embodiment of the present application, the method further includes:
[0093] If there is a target port in any group of root ports that has changed in the first plug-in information, and the resource occupancy required for the functional device plugged into the target port has changed, the communication connection of the target port is disconnected, and the communication connection of the ports in the group of root ports except the target port is maintained.
[0094] In this embodiment, when the electronic device is started this time, after comparing the current first plug-in information corresponding to each group of root ports with the first plug-in information corresponding to the group of root ports obtained when the electronic device was turned on last time, if there is a target port in any group of root ports that has changed in the first plug-in information, it represents that the resource occupancy required for the functional device plugged in the target port has changed, that is, the functional device plugged in the target port is the target functional device corresponding to the target port whose first plug-in information has changed, and it is necessary to adjust the resource occupancy of the target functional device plugged in the target port. Specifically, the communication connection of the target port can be disconnected to stop allocating system resources to the target functional device, while maintaining the communication connection of the ports in the group of root ports except the target port, so as to ensure the normal operation of the electronic device and enable the functional devices other than the target functional device to operate normally.
[0095] Based on the same inventive concept, the second aspect of the present application also provides an electronic device corresponding to a processing method. Since the principle of solving the problem by the electronic device in the present application is similar to the above-mentioned processing method of the present application, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0096] Figure 4 The schematic diagram of the structure of the electronic device provided in the embodiment of the present application is shown, which may include:
[0097] an acquisition module, configured to acquire first plugging information, wherein the first plugging information is plugging information corresponding to a functional device plugged into a target port, the target port is provided on a body of the electronic device, and the first plugging information is obtained by reading a first firmware of the electronic device;
[0098] A determination module, configured to determine whether the amount of system resources of the electronic device is less than a first threshold;
[0099] a processing module, configured to determine, when the amount of system resources of the electronic device is less than the first threshold, a target functional device corresponding to the target port that has changed in the first plug information according to the acquired change information of the first plug information, and adjust the amount of resources occupied by the target functional device;
[0100] The change information of the first plugging information is obtained based on the comparison between the first plugging information of the electronic device started this time and the historical first plugging information.
[0101] In one embodiment of the present application, the acquisition module is further configured as follows:
[0102] Based on the change information of the first plugging information, acquiring identification information and / or configuration information of the functional device plugged into the target port through the second firmware of the electronic device;
[0103] Based on the identification information and / or configuration information of the functional device plugged into the target port, a functional device whose identification information has changed or a functional device whose configuration information has changed among the functional devices plugged into the target port is determined as the target functional device.
[0104] In one embodiment of the present application, the determination module is further configured to:
[0105] The historical first plugging information is that each time the electronic device is successfully started, the first plugging information is obtained and the first plugging information is saved in the baseboard management controller as at least a part of the historical first plugging information;
[0106] The second firmware compares the current first plugging information with the first plugging information acquired when the electronic device was last turned on to determine whether the current first plugging information has changed.
[0107] In one embodiment of the present application, the acquisition module is further configured as follows:
[0108] The number and identification information of the target port and the identification information of the functional device corresponding to the target port plugged with the functional device are obtained.
[0109] In one embodiment of the present application, the determination module is further configured to:
[0110] In the case where identification information of a new functional device is obtained, it is indicated that the target port is plugged with a new functional device, and the functional device is determined as the target functional device corresponding to the target port that has changed in the first plug information; or
[0111] When the configuration information or working mode of the functional device changes, the resource occupancy required by the functional device representing the target port plug-in changes, and the functional device is determined as the target functional device corresponding to the changed target port in the first plug-in information.
[0112] In one embodiment of the present application, the processing module is further configured to:
[0113] After determining the target functional device corresponding to the target port that has changed in the first plug information, the communication connection of the target port corresponding to the target functional device is disconnected to stop allocating system resources to the target functional device.
[0114] In one embodiment of the present application, the determination module is further configured to:
[0115] Comparing the current first plugging information corresponding to each group of root ports with the first plugging information corresponding to the group of root ports acquired when the electronic device was last turned on, to determine whether the current first plugging information corresponding to the group of root ports has changed;
[0116] If the current first plugging information corresponding to the group of root ports changes, it is determined that there is a target port in the group of root ports whose first plugging information changes.
[0117] In one embodiment of the present application, the processing module is further configured to:
[0118] If there is a target port in any group of root ports that has changed in the first plug-in information, and the resource occupancy required for the functional device plugged into the target port has changed, the communication connection of the target port is disconnected, and the communication connection of the ports in the group of root ports except the target port is maintained.
[0119] Based on the same inventive concept, Figure 5 As shown, this embodiment also includes an electronic device, including:
[0120] A memory for storing executable programs;
[0121] The processor is used to execute the executable program to implement the above method.
[0122] Since the principle of solving the problem by the electronic device in the present application is similar to the above-mentioned method in the present application, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0123] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.
Claims
1. A processing method comprising: Acquire first plugging information, where the first plugging information is plugging information corresponding to a functional device plugged into a target port, the target port is set on a body of the electronic device, and the first plugging information is obtained by reading a first firmware of the electronic device; Determining whether the amount of system resources of the electronic device is less than a first threshold; When the amount of system resources of the electronic device is less than the first threshold, determining the target functional device corresponding to the target port that has changed in the first plug information according to the acquired change information of the first plug information, and adjusting the amount of resources occupied by the target functional device; The change information of the first plugging information is obtained based on the comparison between the first plugging information of the electronic device started this time and the historical first plugging information.
2. The method according to claim 1, wherein determining the target functional device corresponding to the target port that has changed in the first plug information according to the acquired change information of the first plug information comprises: Based on the change information of the first plugging information, acquiring identification information and / or configuration information of the functional device plugged into the target port through the second firmware of the electronic device; Based on the identification information and / or configuration information of the functional device plugged into the target port, a functional device whose identification information has changed or a functional device whose configuration information has changed among the functional devices plugged into the target port is determined as the target functional device.
3. The method according to claim 1, further comprising: The historical first plugging information is that each time the electronic device is successfully started, the first plugging information is obtained and the first plugging information is saved in the baseboard management controller as at least a part of the historical first plugging information; The second firmware compares the current first plugging information with the first plugging information acquired when the electronic device was last turned on to determine whether the current first plugging information has changed.
4. The method according to claim 1, wherein obtaining the first plug-in information comprises: The number and identification information of the target port and the identification information of the functional device corresponding to the target port plugged with the functional device are obtained.
5. The method according to claim 2, further comprising: In the case where identification information of a new functional device is obtained, it is indicated that the target port is plugged with a new functional device, and the functional device is determined as the target functional device corresponding to the target port that has changed in the first plug information; or When the configuration information or working mode of the functional device changes, the resource occupancy required by the functional device representing the target port plug-in changes, and the functional device is determined as the target functional device corresponding to the changed target port in the first plug-in information.
6. The method according to claim 1, wherein adjusting the resource occupation of the target functional device comprises: After determining the target functional device corresponding to the target port that has changed in the first plug information, disconnect the communication connection of the target port corresponding to the target functional device to stop allocating system resources to the target functional device.
7. The method according to claim 1, wherein: The electronic device body is provided with a plurality of groups of root ports, each group of root ports is provided with at least one target port, and the method further comprises: Comparing the current first plugging information corresponding to each group of root ports with the first plugging information corresponding to the group of root ports acquired when the electronic device was last turned on, to determine whether the current first plugging information corresponding to the group of root ports has changed; If the current first plugging information corresponding to the group of root ports changes, it is determined that there is a target port in the group of root ports whose first plugging information changes.
8. The method according to claim 7, further comprising: If there is a target port in any group of root ports that has changed in the first plug-in information, and the resource occupancy required for the functional device plugged into the target port has changed, the communication connection of the target port is disconnected, and the communication connection of the ports in the group of root ports except the target port is maintained.
9. An electronic device, comprising: an acquisition module, configured to acquire first plugging information, wherein the first plugging information is plugging information corresponding to a functional device plugged into a target port, the target port is provided on a body of the electronic device, and the first plugging information is obtained by reading a first firmware of the electronic device; A determination module, configured to determine whether the amount of system resources of the electronic device is less than a first threshold; a processing module, configured to determine, when the amount of system resources of the electronic device is less than the first threshold, a target functional device corresponding to the target port that has changed in the first plug information according to the acquired change information of the first plug information, and adjust the amount of resources occupied by the target functional device; The change information of the first plugging information is obtained based on the comparison between the first plugging information of the electronic device started this time and the historical first plugging information.
10. An electronic device, comprising: A memory for storing executable programs; A processor, configured to execute the executable program to implement the method according to any one of claims 1 to 8.