Method and apparatus for starting configuration of system database
By dynamically configuring the memory space of the startup system database by detecting server hardware information, the problem of insufficient memory for the startup system database is solved, improving the rationality of memory space configuration and user experience.
Patent Information
- Application Number
- CN202511208751.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-27
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-08-27
AI Technical Summary
In the server's startup system database, an unreasonable memory space configuration leads to frequent memory shortage errors, affecting the user experience.
By detecting the hardware device information of the target hardware devices connected to the server, and configuring an appropriate amount of memory space for the startup system database based on the hardware device information, the memory space is ensured to meet the needs of the current connection.
The issue of unreasonable database memory space configuration during system startup has been resolved, avoiding insufficient memory and improving the user experience.
Smart Images

Figure CN120723340B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a configuration method and device of starting system database. BACKGROUND
[0002] With the continuous progress of science and technology, server products are widely used due to their strong computing power, strong security, compatibility, timeliness and other advantages. In the related art, when using the server product, the starting system options can be changed in the starting system interface of the server or through the command line tool to adapt to the needs of various running environments. However, when changing the starting system options through the above-mentioned manner, it is found that there is a probability of prompting an error of insufficient memory space of the starting system database, which affects the user experience. SUMMARY
[0003] The present application provides a configuration method and device of starting system database to at least solve the problem of unreasonable configuration of the memory space of the starting system database in the related art.
[0004] The present application provides a method of starting system database, comprising: starting a server; detecting hardware device information of a target hardware device connected to the server, wherein the hardware device information is used to indicate the data situation to be stored in the starting system database of the server, and the starting system database is used to provide data for the running of the starting system of the server; and configuring memory space for the starting system database according to the hardware device information, wherein the memory space is used to store data for the starting system database.
[0005] The present application also provides a configuration device of starting system database, comprising: a starting module configured to start a server; a detection module configured to detect hardware device information of a target hardware device connected to the server, wherein the hardware device information is used to indicate the data situation to be stored in the starting system database of the server, and the starting system database is used to provide data for the running of the starting system of the server; and a configuration module configured to configure memory space for the starting system database according to the hardware device information, wherein the memory space is used to store data for the starting system database.
[0006] The present application also provides an electronic device, comprising: a memory configured to store a computer program; and a processor configured to implement the steps of the above-mentioned any one configuration method of starting system database when executing the computer program.
[0007] The present application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps of the above-mentioned any one configuration method of starting system database.
[0008] The application further provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the configuration methods of the startup system database.
[0009] According to the application, after the startup server, the hardware device information of the target hardware device connected to the server is detected, and since the hardware device information is used to indicate the data to be stored in the startup system database of the server, the memory space of the startup system database is configured according to the hardware device information, which can ensure that the memory space of the startup system database is configured to meet the current connection condition of the server, and thus the technical problem of unreasonable configuration of the memory space of the startup system database in the related art can be solved, and the technical effects of improving the rationality of the memory space configuration of the startup system database and avoiding the insufficient memory space of the startup system database can be achieved. BRIEF DESCRIPTION OF DRAWINGS
[0010] In order to more clearly illustrate the embodiments of the application, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0011] Figure 1 is a hardware structure block diagram of the configuration of the startup system database of the embodiments of the application;
[0012] Figure 2 is a flowchart of the configuration method of the startup system database according to the embodiments of the application;
[0013] Figure 3 is a schematic diagram of a user interface database configuration method according to an embodiment of the application Figure 1 ;
[0014] Figure 4 is a schematic diagram of a user interface database configuration method according to an embodiment of the application Figure 2 ;
[0015] Figure 5 is a structure block diagram of a configuration device of a startup system database according to an embodiment of the application. DETAILED DESCRIPTION
[0016] The technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only some of the embodiments of the application, not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the application.
[0017] It should be noted that in the description of the present application, the term "comprising", "containing" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such a process, method, article or device. The terms "first", "second" and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0018] In order for those skilled in the art to better understand the present application, the present application will be further described in detail below in conjunction with the drawings and specific embodiments.
[0019] In the related art, when using a server product, the startup system options can be changed in the startup system interface of the server or through a command line tool to adapt to the needs of various running environments. However, for servers with many external network cards or devices, it is observed that when the startup system option file is exported for the first time using the command line tool, the problem of insufficient memory of the startup system database will be reported with a certain probability. This error may occur every time the server is started for the first time, which greatly affects the user experience.
[0020] The solution adopted in the related art is generally to change the fixed default value written in the startup system code after encountering the error, but this method is very cumbersome, and the fixed default value changed this time may still cause errors during the next server startup process, resulting in poor customer experience.
[0021] To solve the above problems, the present application provides a more flexible and reasonable startup system database configuration method for configuring the memory space of the startup system database.
[0022] In conjunction with the specific application environment architecture or specific hardware architecture on which the startup system database configuration method depends, the specific application environment architecture or specific hardware architecture is described here.
[0023] The method embodiments provided in the embodiments of the present application can be executed in a server or similar computing device. Taking the case of running on a server, Figure 1 is a hardware structure block diagram of the configuration of the startup system database of the embodiments of the present application. As Figure 1 shown, the server can include one or more ( Figure 1The server 100 can include one or more processors 102 (which can include, but are not limited to, a central processing unit (CPU)), a memory 104, a computing device 106 (which can include, but is not limited to, a graphics processing unit (GPU), a microcontroller unit (MCU), a complex programmable logic device (CPLD), a field programmable gate array (FPGA), and / or the like), a storage 108 (which can include, but is not limited to, a hard disk module, a hard disk backplane, a redundant array of independent disks (RAID), and / or the like), a transmission device 110 (which can include, but is not limited to, a network interface controller (NIC)), and / or the like. Those skilled in the art can understand that Figure 1 The structure shown is only schematic, and does not limit the structure of the server described above. For example, the server can further include more or fewer components than those shown in the figure, or have a different configuration than that shown in the figure. Figure 1 For example, the server can further include more or fewer components than those shown in the figure, or have a different configuration than that shown in the figure. Figure 1 For example, the server can further include more or fewer components than those shown in the figure, or have a different configuration than that shown in the figure.
[0024] The server described above further includes various system firmware, such as firmware for starting a system, which can be, but is not limited to, used to load and start the server by a starting system, which can be, but is not limited to, including a basic input / output system (BIOS) or a unified extensible firmware interface (UEFI), and the configuration method of the starting system database in the embodiments of the present application can be, but is not limited to, executed by the starting system. In some examples, the storage 108 can further include storage that is remotely arranged relative to the processor 102, and these remote storages can be connected to the server device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0025] The transmission device 110 is used to receive or send data via a network. Specific examples of the network can include a wired / wireless network provided by a communication provider of the server. In one example, the transmission device 110 includes a network interface controller (NIC), which can communicate with the Internet through a connected network device. In one example, the transmission device 110 can be a radio frequency (RF) module, which is used to communicate with the Internet in a wireless manner.
[0026] The embodiments of the present application provide a configuration method of a starting system database, which is described in detail in combination with an execution flow of the configuration method of the starting system database.
[0027] In the embodiments, a configuration method of a starting system database is provided, Figure 2is a flowchart of a configuration method of a startup system database according to an embodiment of the present application, as shown in the figure, the method comprises the following steps: Figure 2
[0028] Step S202, starting a server;
[0029] Step S204, detecting hardware device information of a target hardware device connected to the server, wherein the hardware device information is used to indicate a data condition to be stored in a startup system database of the server, and the startup system database is used to provide data for running of a startup system of the server;
[0030] Step S206, configuring memory space for the startup system database according to the hardware device information, wherein the memory space is used to store data for the startup system database.
[0031] Through the above steps, after starting the server, the hardware device information of the target hardware device connected to the server is detected. Since the hardware device information is used to indicate the data condition to be stored in the startup system database of the server, and the memory space is configured for the startup system database according to the hardware device information, it can be ensured that the memory space configured for the startup system database meets the current connection condition of the server. Therefore, the technical problem of unreasonable configuration of the memory space of the startup system database in the related art can be solved, and the technical effects of improving the rationality of the memory space configuration of the startup system database and avoiding the situation of insufficient memory space of the startup system database can be achieved.
[0032] Optionally, in the embodiment, the memory space is configured for the startup system database according to the data condition of the target hardware device connected to the server to be stored in the startup system database of the server. Compared with the way of changing the fixed default value written in the startup system code after encountering an error, the scheme provided in the present application can configure the memory space for the startup system database to adapt to the current connection condition of the server, and the error of insufficient memory space of the startup system database will not occur during the running of the server, thereby improving the user experience.
[0033] Optionally, in the embodiment, the startup system of the server can refer to, but is not limited to, a series of firmware programs and software that are first run after the server is powered on. The startup system of the server can be responsible for, but is not limited to, initializing hardware resources, detecting hardware states, loading an operating system kernel, and completing the process of booting the entire operating system. The startup system of the server can include, but is not limited to, BIOS (Basic Input / Output System, Basic Input / Output System) or UEFI (Unified Extensible Firmware Interface, Unified Extensible Firmware Interface).
[0034] Optionally, in the embodiment, the startup system database can be but is not limited to used for providing data for the running of the startup system of the server. For example, the startup system database can be but is not limited to including an ACPI table (Advanced Configuration and Power Interface table), and the ACPI table can be but is not limited to storing detailed information about the hardware configuration of the server, in particular, data related to power management, such as power management events, power state information, battery information, thermal management data, etc. Through these data, the startup system can effectively control the power state of the server, ensure the correct behavior of the hardware in different working modes (such as standby, hibernate), and also support dynamic adjustment of CPU frequency and voltage, to achieve energy saving and performance optimization. The startup system database can also be but is not limited to including an HII database (Human Interface Infrastructure Database), and the HII database can be but is not limited to providing the running of the startup system with user interface element definitions including strings, forms, fonts and images, and also providing dynamic configuration data and interaction support.
[0035] Optionally, in the embodiment, the startup system database can be but is not limited to initially stored in the startup system image, and the startup system image can be but is not limited to stored in the flash memory of the motherboard of the server. During the startup process of the server, the startup system can be but is not limited to record the startup system database into the memory for use at runtime.
[0036] In the embodiment provided in step S202, the startup server can be but is not limited to referring to starting the server in various ways, which can be but is not limited to including starting the server by pressing the power-on button of the server, or remotely starting the server through the network, or setting an automatic startup option in the server firmware, such as automatic startup through a schedule or event triggering, etc.
[0037] In the embodiment provided in step S204, the target hardware device can be but is not limited to a hardware device externally connected to the server, or the target hardware device can be but is not limited to a hardware device internally built-in and externally connected to the server.
[0038] Optionally, in the embodiment, the hardware device built-in can be but is not limited to a hardware device required to meet the basic functions of the server, such as the aforementioned processor and memory, and the hardware device externally connected can be but is not limited to a hardware device required to further expand the functions of the server in the case of implementing the basic functions of the server, such as the aforementioned computing device, storage device and transmission device.
[0039] Optionally, in the embodiment, the built-in hardware device can be but is not limited to being directly welded to the server motherboard or installed through a special interface directly connected to the motherboard. The built-in hardware device can be but is not limited to being a basic component of the server, and the built-in hardware device can be but is not limited to directly determining the basic capability and performance level of the server. The external hardware device can be but is not limited to being connected through an expansion slot or an external interface of the server, and the external hardware device can be but is not limited to being used to enhance the function or improve the performance of the server, such as increasing storage capacity, improving network bandwidth, etc.
[0040] Optionally, in the embodiment, the built-in hardware device can be but is not limited to including a central processing unit, a memory, a power supply unit, etc.; and the external hardware device can be but is not limited to including a network adapter, various storage devices, various expansion cards, etc.
[0041] Optionally, in the embodiment, the hardware device information can be but is not limited to being used to indicate the data situation of the target hardware device to be stored in the startup system database of the server. The hardware device information can be but is not limited to including device identification information of the target hardware device, and the device identification information can be but is not limited to being used to identify the specific type and model of the target hardware device. The specific type and model of the target hardware device can be but is not limited to being used to estimate the data situation of the target hardware device to be stored in the startup system database of the server. Alternatively, the hardware device information can be but is not limited to including a driver program version and a file size. The file size of the driver program directly determines the required memory space of the startup system database, and a larger driver program file requires more database storage space.
[0042] Optionally, in the embodiment, the hardware device information of the target hardware device connected to the server can be but is not limited to including: in the process of starting the server, using the enumeration mechanism of a PCI (Peripheral Component Interconnect) bus to detect all connected PCI devices and / or using a USB (Universal Serial Bus) and SMUSB (System Management Bus) enumeration mechanism to read device descriptor information, etc., to determine the type and function of the hardware device, and then searching for an estimated data amount corresponding to the device type of each hardware device from the hardware device types and data amounts having a corresponding relationship. After determining the estimated data amount of all target hardware devices connected to the server, the total data requirement amount is obtained by summation, and the hardware device information is obtained.
[0043] In the embodiment provided in step S206, configuring the memory space for the startup system database according to the hardware device information can include but is not limited to: configuring the memory space for the startup system database to be equal to or slightly larger than the data amount indicated by the hardware device information. Specifically, in the case where both the hardware devices built-in on the server and the hardware devices connected to the server are regarded as the target hardware devices, the memory space for the startup system database can be configured to be equal to or slightly larger than the data amount indicated by the hardware device information, for example, in the case where the hardware device information is used to indicate that the data amount of the data to be stored into the startup system database of the server is 5 MB (Megabyte), the memory space for the startup system database can be configured to be 5 MB or 6 MB, and 1 MB of redundant space is set on the basis of meeting the storage requirement of 5 MB. In the case where only the hardware devices connected to the server are regarded as the target hardware devices, the memory space for the startup system database can be configured to be equal to or slightly larger than the backup storage amount, wherein the backup storage amount is equal to the sum of the data amount indicated by the hardware device information and the initial storage amount, and the initial storage amount can be but is not limited to the storage amount set by the server designer for the hardware devices built-in on the server when designing the server, and the initial storage amount can be but is not limited to the storage amount that can meet the storage requirement of the hardware devices built-in on the server to store data into the startup system database, for example, in the case where the hardware device information is used to indicate that the data amount of the data to be stored into the startup system database of the server is 5 MB, and the initial storage amount is 4 MB, the memory space for the startup system database can be configured to be 9 MB or 10 MB, and 1 MB of redundant space is set on the basis of meeting the storage requirement of 9 MB.
[0044] As an optional implementation, the hardware device information of the target hardware devices connected to the server can be detected by the following manner: detecting the target device types of the target hardware devices; extracting the data amount information from each target hardware device according to the target device type to obtain the target data amount information corresponding to each target hardware device, wherein the target data amount information is used to indicate the data amount of the data to be stored into the startup system database by the corresponding target hardware device; and calculating the hardware device information according to the target data amount information.
[0045] Optionally, in the embodiment, the target device type can but is not limited to represent a specific classification of the connected hardware devices on the server, and the difference of the target device type can but is not limited to determine the way of data extraction and processing and the specific requirement of database memory space configuration when the system is started and interacts with different types of hardware devices. Different types of hardware devices can but are not limited to need to use different functions or methods to obtain their data volume information. For example, the drive information, capacity, firmware version and other parameters of the storage device (such as SATA (Serial Advanced Technology Attachment) hard disk, SSD (Solid State Drive), RAID (Redundant Array of Independent Disks) card) can but are not limited to be extracted through a specific storage device driver interface (such as a driver function using the NVMe (Non-Volatile Memory Express) protocol) to obtain its data volume information. Alternatively, the data volume information of network adapter (such as Ethernet card, fiber card, wireless network card) and other devices can but is not limited to be obtained through the API (Application Programming Interface) provided by the network device driver.
[0046] Optionally, in the embodiment, the data volume information can but is not limited to be extracted from each target hardware device according to the target device type in the order of discovering the target hardware device. For example, the system can but is not limited to discover device A first, then discover device B, and then discover device C, wherein device A and device C belong to the same device type, and device B belongs to another device type. The data volume information can but is not limited to be extracted from device A, device B and device C in the order of discovering device A, device B and device C according to the information extraction method corresponding to the device type.
[0047] Optionally, in the embodiment, calculating the hardware device information according to the target data volume information can but is not limited to include calculating the sum of the data volume indicated by the target data volume information corresponding to each target hardware device to obtain the hardware device information.
[0048] Optionally, in the embodiment, the calculation of the hardware device information according to the target data amount information can further include, but is not limited to, calculating the sum of the data amounts indicated by the target data amount information corresponding to each target hardware device, and then amplifying the calculated sum to a certain extent to obtain the hardware device information. The amplification extent can be related to the memory usage of the server, and can be greater when the memory usage of the server is relatively idle to provide more fault tolerance space, and can be smaller when the memory usage of the server is relatively busy to avoid affecting other operations of the server while ensuring fault tolerance space.
[0049] Optionally, in the embodiment, the configuration method of the startup system database can be applied to the first startup of the startup system, or can be applied to other rounds of startup after the first startup of the startup system. In the case of application to other rounds of startup, compared with directly using the space size of the memory space to be configured for the startup system database determined during the last startup, the solution of the present application is more flexible and can effectively avoid the situation of insufficient memory space of the startup system database in any startup round.
[0050] Through the above, by detecting the type of the target hardware device and extracting the data amount information (i.e., the target data amount information) according to the device type, the startup system can more accurately calculate the memory space requirement of the startup system database, avoiding startup failure or hardware device management abnormality caused by insufficient memory. This method can adapt to the dynamic changes of the server hardware configuration, ensuring that the server can be started smoothly and run efficiently even in a complex and variable hardware environment.
[0051] As an optional implementation, the target data amount information corresponding to each target hardware device can be obtained by extracting the data amount information from each target hardware device according to the target device type in the following manner: searching for a target control function corresponding to the target device type from the device types and control functions having a corresponding relationship, wherein the control function is used to control the hardware device of the corresponding device type; calling the target control function to send a target control instruction to the target hardware device, wherein the target control instruction is used to control the target hardware device to feed back the data amount of the running information of the target hardware device; and receiving the device data amount returned by the target hardware device in response to the target control instruction to obtain the target data amount information.
[0052] Optionally, in the embodiment, different device types can have corresponding control functions, and an instruction can be sent to each target hardware device by calling the control function corresponding to the device type of each target hardware device to require each target hardware device to report the device data amount, i.e., the data amount of the data to be stored in the startup system database.
[0053] Optionally, in the embodiment, the running information of the NVMe storage device can be read by the function "fetchNVMeDriverInfoSize" including the device identification, firmware status, namespace information, etc. in the case that the target device type of the target hardware device is of the NVMe type.
[0054] Optionally, in the embodiment, the size of the drive information of the network adapter (such as Ethernet card, wireless network card) can be obtained by the function "queryNetworkDriverSize" including the storage requirement of the drive version, configuration parameter, MAC address (Media Access Control Address, media access control address) and other information in the case that the target device type of the target hardware device is of the network card type.
[0055] Optionally, in the embodiment, the size of the drive information of the SATA storage controller or device can be obtained by the function "getSATAControllerInfoSize" including the storage space requirement of the firmware version, device status, etc. in the case that the target device type of the target hardware device is of the SATA type.
[0056] Through the above, by accurately matching the device type and the specific control function, the access of various hardware devices can be intelligently responded, the exact data amount required for dynamically adjusting and obtaining the running information of the target hardware device is obtained, and the memory allocation of the starting system database is optimized, thereby avoiding the problems of resource waste or deficiency caused by preset memory fixation.
[0057] As an optional implementation, the target device type of the target hardware device can be detected by the following manners: detecting the target device type of the target hardware device directly connected to the server; detecting whether an expander is connected to the server; detecting the reference device type of a target hardware device connected to the expander in the case that the expander is detected to be connected to the server; and determining the target device types of all the target hardware devices connected to the expander as the reference device type.
[0058] Optionally, in the embodiment, the target device type of the target hardware device directly connected to the server can be detected first and then whether the expander is connected to the server is detected, or whether the expander is connected to the server can be detected first and then the target device type of the target hardware device directly connected to the server is detected, or the target device type of the target hardware device directly connected to the server and whether the expander is connected to the server can be detected at the same time, which is not limited in the application.
[0059] Optionally, in the embodiment, the target device type of the target hardware device directly connected to the server can be detected by the following manner, but not limited to: the starting system can traverse all available PCIe slots by using the enumeration capability of the PCIe (Peripheral Component Interconnect Express) bus, collect the device information on each slot, and read the device descriptor of each detected PCIe device, analyze the device ID (Identification), subsystem ID, vendor ID and other fields provided by the firmware, and identify the device type by these information, such as whether it is a SATA device, an NVMe device, a network adapter or other type of device.
[0060] Optionally, in the embodiment, the extender can also be referred to as a riser card or a riser board. The extender can be used to increase the hardware connection capability of the server and provide additional device interfaces.
[0061] Optionally, in the embodiment, whether the extender is connected to the server can be detected by the following manner, but not limited to: the starting system checks the link state of each slot when initializing the PCIe bus, and identifies whether there is an extender device, which can be detected by detecting the link activation and speed level of a specific PCIe device.
[0062] Optionally, in the embodiment, since the device types of the hardware devices connected to the same extender are the same, when it is detected that the server is connected to the extender, the device type of all the target hardware devices connected to the extender can be confirmed by detecting the device type of one target hardware device connected to the extender.
[0063] Through the above, when it is detected that the server is connected to the extender, the device type of all the target hardware devices connected to the extender can be determined by detecting the device type of one target hardware device connected to the extender, which effectively reduces the number of times of detecting the type of the target hardware device connected to the server, saves the operation resources of the starting system and saves the operation time.
[0064] As an optional implementation, after detecting the target device type of the target hardware device directly connected to the server, the device set can be divided by the following manner, but not limited to: the target hardware device directly connected to the server is divided into one or more target device sets according to the target device type.
[0065] Optionally, in the embodiment, the target hardware devices of the same device type connected to the server directly can be classified into a target device set, so as to improve the speed of extracting the data amount information from the target hardware devices.
[0066] As an optional implementation, after the target device type of all the target hardware devices connected to the extender is determined as the reference device type, the device set can be classified by the following manner: all the target hardware devices connected to the extender are classified into the reference device set.
[0067] Optionally, in the embodiment, since the target hardware devices connected to one extender are target hardware devices of the same device type, all the target hardware devices connected to the extender can be classified into one device set.
[0068] Optionally, in the embodiment, the reference device set can include all the target hardware devices connected to the extender. For example, the server connects device D and device E through the extender, and connects device F and device G directly, wherein device D, device E and device F are of the same device type, and device G is of another device type; then device D and device E can be classified into one reference device set, device F is classified into target device set A, and device G is classified into target device set B.
[0069] Optionally, in the embodiment, after the target device set and the reference device set are classified according to the direct connection and the connection through the extender, the reference device set and the target device set in which the target hardware devices are of the same device type can be merged to obtain a merged device set. For example, in the above case that the server connects device D and device E through the extender, and connects device F and device G directly, wherein device D, device E and device F are of the same device type, and device G is of another device type, the target device set A and the reference device set can be merged into one merged device set.
[0070] As an optional implementation, the data amount information can be extracted from the target hardware devices according to the target device type by the following manner: the target hardware devices in each device set are traversed according to the target device set and / or the reference device set; and the data amount information is extracted from the currently traversed target hardware device according to the target device type.
[0071] Optionally, in the embodiment, the server can traverse the target hardware devices in the order of the target device set, the reference device set, and the merged device set. The server can extract the data volume information from the target hardware device according to the target device type.
[0072] Optionally, in the embodiment, the server can traverse the target hardware devices in the order of the target device set, the reference device set, and the merged device set. The server can extract the data volume information from the target hardware device according to the target device type.
[0073] By the above, the target hardware devices of the same device type are grouped into a device set, and the target hardware devices in each device set are traversed according to the device set, which can avoid the problems of slow speed and error-prone caused by the interlaced calling of different control functions.
[0074] As an optional implementation, the server can detect the target device type of the target hardware device by the following way: extracting the type information from the connection information of the target hardware device, wherein the connection information is the information provided by the target hardware device to the server when the target hardware device establishes a connection with the server; identifying the device type indicated by the type information to obtain the target device type.
[0075] Optionally, in the embodiment, the server can identify all the hardware devices connected directly or indirectly through an expander during the startup process by the PCIe enumeration mechanism. When the hardware device establishes a connection with the server, the hardware device can send its device descriptor through the bus, and the device descriptor can be a standardized data packet including the device identification, type, function, and manufacturer information. The connection information can refer to the device descriptor registered by the hardware device on the PCIe bus. The type information can be extracted from the device descriptor by reading specific fields, such as the device ID, subsystem ID, vendor ID, device BDF (Bus-Device-Function) number, etc., which can carry the basic type information of the hardware device.
[0076] Optionally, in the embodiment, the starting system can, but is not limited to, according to the extracted type information, refer to the preset device type correspondence table to identify the specific device type, for example, the combination of device ID, subsystem ID, and vendor ID can explicitly indicate that it is a network adapter, a storage controller, or other types of hardware devices.
[0077] Through the above steps, the type of each hardware device can be accurately identified, which provides detailed data basis for subsequent adaptive configuration of the starting system database memory, and ensures that the server can provide stable and efficient services when facing diversified hardware environments.
[0078] As an optional implementation, the hardware device information of the target hardware device connected to the server can be detected in the following manner: detecting whether an external hardware device is connected to the server; in the case that an external hardware device is detected to be connected to the server, detecting the hardware device information of the external hardware device connected to the server according to the number of external hardware devices, wherein the target hardware device includes the external hardware device; in the case that no external hardware device is detected to be connected to the server, configuring the starting system database with a memory space conforming to the default storage amount.
[0079] Optionally, in the embodiment, the starting system can, but is not limited to, first detect whether an external hardware device (i.e., the aforementioned external hardware device) is connected to the server, in the case that no external hardware device is detected to be connected to the server, it is confirmed that the risk of insufficient memory of the starting system database is very small, and the starting system database is directly configured with a memory space conforming to the default storage amount; in the case that an external hardware device is detected to be connected to the server, it is necessary to further judge the risk of insufficient memory of the starting system database according to the number of external hardware devices.
[0080] Optionally, in the embodiment, the risk degree of the data amount of the data to be stored into the startup system database causing insufficient memory of the startup system database can be roughly judged according to the device quantity of the external hardware devices, or the risk degree of the data amount of the data to be stored into the startup system database causing insufficient memory of the startup system database can also be roughly judged in combination with the device types of the external hardware devices and the device quantities of different types of hardware devices, for example, the data amount average of the hardware devices of each device type to be stored into the startup system database can be set, the device quantity of each device type is calculated and multiplied by the data amount average of the hardware devices of each device type, and then the sum is obtained to get the estimated total data amount of the data to be stored into the startup system database, which is compared with the extra storage amount, and in the case that the estimated total data amount is greater than or equal to the extra storage amount, it is determined that the risk of the data amount of the data to be stored into the startup system database causing insufficient memory of the startup system database is relatively high, and the operation of detecting the hardware device information of the external hardware devices connected to the server needs to be performed to more accurately obtain the storage requirement amount of the data to be stored into the startup system database, and in the case that the estimated total data amount is less than the extra storage amount, it is determined that the risk of the data amount of the data to be stored into the startup system database causing insufficient memory of the startup system database is relatively low, and the reference storage amount memory space is configured for the startup system database, and the reference storage amount is the sum of the default storage amount and the extra storage amount.
[0081] Through the above, the server connected external hardware devices are first detected, and in the case that no external hardware devices are connected, the default storage amount memory space is directly allocated, which avoids performing too many unnecessary operations in the case that the risk of the data amount of the data to be stored into the startup system database causing insufficient memory of the startup system database is very small, saves the operation resources and operation time of the startup system, and reduces the startup time of the server.
[0082] As an optional implementation, the hardware device information of the external hardware devices connected to the server can be detected according to the device quantity of the external hardware devices in the following manner: the device quantity is compared with the quantity threshold value, the hardware device information of the external hardware devices connected to the server is detected in the case that the device quantity is greater than or equal to the quantity threshold value, and the memory space conforming to the reference storage amount is configured for the startup system database in the case that the device quantity is less than the quantity threshold value, wherein the reference storage amount is the sum of the default storage amount and the extra storage amount.
[0083] Through the above, in the case that the number of devices is less than the number threshold, the memory space conforming to the reference storage amount is directly configured for the starting system, so that in the case that the data amount of the data to be stored in the starting system database causes the risk of insufficient memory of the starting system database to be small, unnecessary operations are avoided, the operation resources and operation time of the starting system are saved, and the time consumed for starting the server is reduced.
[0084] As an optional implementation, the memory space of the starting system database can be configured according to the hardware device information in the following manner: the target storage amount of the starting system database is determined according to the hardware device information; and the memory space conforming to the target storage amount is configured for the starting system database.
[0085] Optionally, in this embodiment, the target storage amount of the starting system database can be determined according to the hardware device information, and the target storage amount can at least meet the storage requirements of the hardware devices connected to the server in the starting system database.
[0086] Optionally, in this embodiment, the memory space conforming to the target storage amount configured for the starting system database can include the memory space with the size of the target storage amount, or the memory space larger than the size of the target storage amount.
[0087] As an optional implementation, the target storage amount of the starting system database can be determined according to the hardware device information in the following manner: the data amount indicated by the hardware device information is compared with the additional storage amount; in the case that the data amount indicated by the hardware device information is greater than or equal to the additional storage amount, the sum of the data amount indicated by the hardware device information and the default storage amount is calculated to obtain the target storage amount; and in the case that the data amount indicated by the hardware device information is less than the additional storage amount, the reference storage amount is determined as the target storage amount, wherein the reference storage amount is the sum of the default storage amount and the additional storage amount.
[0088] Optionally, in this embodiment, in the case that the target hardware device only includes the external hardware device, the default storage amount can be set for the storage requirements of the built-in hardware device in the starting system database, so that the data amount indicated by the hardware device information can be compared with the additional storage amount, and whether the reference storage amount can meet the storage requirements of all the hardware devices connected to the server in the starting system database can be determined by determining whether the additional storage amount can meet the storage requirements of the external hardware device in the starting system database.
[0089] Optionally, in the embodiment, in the case that the target hardware devices include both external hardware devices and built-in hardware devices, the default storage amount can be but is not limited to a reserved storage space, and can be but is not limited to determined by comparing the data amount indicated by the hardware device information with the additional storage amount to determine whether the additional storage amount can meet the storage requirements of all hardware devices connected to the server in starting the system database. In the case that the additional storage amount can meet the storage requirements of all hardware devices connected to the server in starting the system database, the sum of the additional storage amount and the default storage amount can be but is not limited to determined as the target storage amount, and a certain reserved space is reserved in the case that the additional storage amount meets the storage requirements of all hardware devices connected to the server in starting the system database.
[0090] Through the above, it is ensured that the memory allocation in starting the system database is not only based on the actual requirements of the current hardware devices, but also considers the pre-set additional storage amount threshold. When the data amount requirement indicated by the hardware device information exceeds the set additional storage amount threshold, the sum of the default storage amount and the actual requirement amount of the hardware devices is added to obtain the target storage amount, so as to effectively cope with the high memory consumption scenario when there are many devices. Conversely, if the data amount requirement indicated by the hardware device information is lower than the additional storage amount threshold, the sum of the default storage amount and the additional storage amount is used as the target storage amount, which ensures that there is sufficient buffer space even in a complex device environment, avoiding the problem of limited functions caused by tight memory resources.
[0091] As an optional implementation, the target storage amount of the system database can be but is not limited to determined according to the hardware device information in the following manner: the sum of the data amount indicated by the hardware device information and the default storage amount is calculated to obtain a candidate storage amount; the candidate storage amount is compared with a reference storage amount, wherein the reference storage amount is the sum of the default storage amount and the additional storage amount; in the case that the candidate storage amount is greater than or equal to the additional storage amount, the candidate storage amount is determined as the target storage amount; and in the case that the candidate storage amount is less than the additional storage amount, the reference storage amount is determined as the target storage amount.
[0092] Optionally, in the embodiment, in the case that the target hardware devices only include external hardware devices, the default storage amount can be but is not limited to set for the storage requirements of the built-in hardware devices in starting the system database, and therefore, the reference storage amount can be but is not limited to determined by comparing the candidate storage amount with the reference storage amount to determine whether the reference storage amount can meet the storage requirements of all hardware devices connected to the server in starting the system database.
[0093] Optionally, in the embodiment, in the case that the target hardware devices include both external hardware devices and built-in hardware devices, the default storage amount can be but is not limited to a reserved storage space, and can be but is not limited to determined by comparing the candidate storage amount with the reference storage amount to determine whether the reference storage amount can meet the storage requirements of all hardware devices connected to the server in starting the system database.
[0094] Through the above, a more dynamic and flexible memory allocation strategy is proposed. The sum of the data amount indicated by the hardware device information and the default storage amount is calculated to obtain a candidate storage amount. Then the candidate storage amount is compared with the reference storage amount (i.e. the default storage amount plus the additional storage amount). If the candidate storage amount exceeds or equals the additional storage amount, it indicates that the existing device configuration has a high demand for memory. At this time, the candidate storage amount is directly used as the target storage amount to meet the high-intensity workload. If the candidate storage amount is less than the additional storage amount, it indicates that the current device configuration has a low demand for memory. The system then adopts a more conservative strategy, using the reference storage amount as the target storage amount, which can not only guarantee sufficient memory space, but also avoid excessive allocation of resources, embodying the economy and efficiency of resource utilization.
[0095] As an optional implementation, the memory space conforming to the target storage amount can be configured for the starting system database in the following manner, but is not limited thereto: the target storage amount is written into a target storage location in a target storage of the server, wherein the target storage location is used to store database parameters for the starting system database; in the case that the server is started to the configuration stage of the starting system database, the target storage amount is read from the target storage location; and the memory space conforming to the target storage amount is allocated for the starting system database.
[0096] Optionally, in the embodiment, the target storage can be, but is not limited to, an NVRAM (Non-Volatile Random Access Memory, non-volatile random access memory). The NVRAM is a type of memory that can retain internal data even after power is disconnected. In the server architecture, the NVRAM can be, but is not limited to, used to store the starting system configuration settings.
[0097] Optionally, in the embodiment, the NVRAM used to store the starting system configuration information can be, but is not limited to, directly integrated in the flash memory of the starting system.
[0098] Optionally, in the embodiment, the target storage location can be, but is not limited to, a specific address range or segment in the NVRAM, which can be, but is not limited to, specially allocated for storing the target storage amount value of the starting system database. This location is predefined in the NVRAM and can be, but is not limited to, marked and configured by the initialization code of the starting system. The setting of the target storage location should fully consider the data read-write efficiency and protection, avoid conflict with other critical configuration information, and also ensure its easy access to quickly read the database size information during the server startup process.
[0099] Optionally, in the embodiment, the determined target storage amount can be written into a target storage location, and in the case that the server is started to a configuration phase of the starting system database, the target storage amount can be read from the target storage location as a basis for allocating memory space for the starting system database.
[0100] As an optional implementation, the starting system database can include, but is not limited to, a user interface database, the server can be started by, but is not limited to, starting the server and running the starting system, and the hardware device information of the target hardware device connected to the server can be detected by, but is not limited to, detecting the hardware device information of the external hardware device connected to the server in the case that the starting system runs to a driver execution environment phase, wherein the target hardware device includes the external hardware device.
[0101] Optionally, in the embodiment, the starting system database can include, but is not limited to, a user interface database. The user interface database, namely, the HII Database, is a full name of Human Interface Infrastructure Database, which is a database used for storing user interface configuration data and state information in a modern BIOS (Basic Input Output System) / UEFI (Unified Extensible Firmware Interface) firmware system. In a server and other UEFI-based computer systems, the HII Database plays a vital role, which not only manages the presentation of the BIOS setting interface, but also is responsible for storing the changes made by the user to the settings and the driver information of various hardware devices in the system.
[0102] Optionally, in the embodiment, the hardware device information of the external hardware device connected to the server can be detected, but is not limited to, when the system is started to the driver execution environment stage (i.e. the DXE (Driver Execution Environment) stage). The way of detecting the hardware device information of the external hardware device connected to the server can be, but is not limited to, extracting the data amount information from the target hardware device according to the device type in sequence, determining the hardware device information according to the data amount information, or can be, but is not limited to, dividing the plurality of external hardware devices into one or more device sets according to the device type and the connection form (i.e. direct connection or connection through the extender) of the external hardware device and the server, traversing the target hardware device in each device set according to the device set, extracting the data amount information from the target hardware device currently traversed according to the device type, and determining the hardware device information according to the data amount information.
[0103] Optionally, in the embodiment, Figure 3 is a configuration method of a user interface database according to an embodiment of the present application Figure 1 . As Figure 3 shown, in order to prevent the SCE (Setup Control Environment) tool from reporting errors when the user first starts the server, causing the customer to have a bad user experience, the HIIDatabase in the BIOS (or UEFI) can be, but is not limited to, adaptively adjusted according to the type and number of devices inserted into the server. The HIIDATASIZE (i.e. target data amount information) of different devices can be, but is not limited to, calculated respectively, and the sum (i.e. the data amount indicated by the hardware device information) obtained by adding the calculated values can be stored in the NVRAM (i.e. target memory). The database configuration value (i.e. additional storage amount) written in the code and the calculated device value (i.e. the data amount indicated by the hardware device information) are compared, and the BIOS system dynamically selects the database memory size to be used to ensure the normal operation of the server tool.
[0104] As an optional implementation, the memory space of the startup system database can be configured according to the hardware device information in the following way: determining the data storage amount of the user interface database according to the hardware device information; writing the data storage amount into the target configuration item of the user interface database in the configuration item of the startup system; reading the data storage amount from the target configuration item; and allocating the memory space conforming to the data storage amount to the user interface database.
[0105] Optionally, in the embodiment, the starting system can but is not limited to include a plurality of configuration items, which can but are not limited to be stored on the target storage corresponding to the starting system, and each configuration item can but is not limited to be used for configuring various parameters and environment settings in the starting process of the starting system, such as device driver loading sequence, system service enable state, hardware resource allocation, etc., wherein the target configuration item of the user interface database can but is not limited to be used for configuring the memory space size of the user interface database, and the target configuration item can but is not limited to be stored on the target storage location of the target storage.
[0106] As an optional implementation, the data storage amount of the user interface database can be determined according to the hardware device information in the following manner: comparing the data amount indicated by the hardware device information with an additional storage amount, wherein the additional storage amount is an additional storage amount added for the user interface database each time the server is started; in the case where the data amount indicated by the hardware device information is greater than or equal to the additional storage amount, calculating the sum of the data amount indicated by the hardware device information and a default storage amount to obtain the data storage amount, wherein the default storage amount is a storage amount of data to be stored in the user interface database from the built-in hardware device of the server; and in the case where the data amount indicated by the hardware device information is less than the additional storage amount, determining a reference storage amount as the data storage amount, wherein the reference storage amount is the sum of the default storage amount and the additional storage amount.
[0107] Optionally, in the embodiment, the additional storage amount can but is determined by an operation and maintenance personnel according to historical error conditions and connection conditions of the external hardware device.
[0108] Optionally, in the embodiment, the connection condition of the built-in hardware device (i.e., the built-in hardware device mentioned above) to the server generally does not change, and therefore, the default storage amount corresponding to the built-in hardware device can but is set, so as to simplify the operation process of detecting the hardware device information and determining the data storage amount of the user interface database, and shorten the starting time of the server.
[0109] As an optional implementation, the data storage amount of the user interface database can be determined according to the hardware device information in the following manner: calculating the sum of the data amount indicated by the hardware device information and a default storage amount to obtain a candidate storage amount, wherein the default storage amount is a storage amount of data to be stored in the user interface database from the built-in hardware device of the server; comparing the candidate storage amount with a reference storage amount, wherein the reference storage amount is the sum of the default storage amount and an additional storage amount, and the additional storage amount is an additional storage amount added for the user interface database each time the server is started; in the case where the candidate storage amount is greater than or equal to the additional storage amount, determining the candidate storage amount as the data storage amount; and in the case where the candidate storage amount is less than the additional storage amount, determining the reference storage amount as the data storage amount.
[0110] Optionally, in the present embodiment, Figure 4 is a configuration method of a user interface database according to an embodiment of the present application Figure 2 As Figure 4 shown, the user interface database can be configured by a mechanism of adapting the HIIdatabase according to an external device under the BIOS system, but is not limited thereto, and the method comprises the following steps:
[0111] S1, in the server boot process, first detect whether there is a device plugged in (i.e. whether there is a connection to an external hardware device), if there is no device plugged in, then directly enter the system using the SCE tool;
[0112] S2, if a large number of devices are detected to be in a connected state, the BIOS first reads the default HIIDATASIZE (i.e. target configuration item) stored in the NVRAM (i.e. target storage) and records it as hiidatasizedefault (i.e. default storage amount);
[0113] S3, in the POST (Power-On Self Test) process, the BIOS first acquires the size of the HIIDATASIZE (i.e. target configuration item) existing in the NVRAM (i.e. target storage), at this time the value acquired is hiidatasizedefault (i.e. default storage amount) + hiidatasizeextra (i.e. extra storage amount) (the value of the target configuration item is modified after the default storage amount is acquired when a large number of devices are detected to be in a connected state), named hiidatasizefirst (i.e. reference storage amount), stored in HiidataBufferAddress1 (an address in the NVRAM);
[0114] S4, poll the types of external devices in the complex server, if the device type is NVME disk, calculate the driver information size (i.e. target data amount information) it needs to generate and set it as hiidatasize2 (i.e. target data amount information corresponding to NVMe type), if the device type is a network card, calculate the driver information size (i.e. target data amount information) it needs to generate and set it as hiidatasize3 (i.e. target data amount information corresponding to the network card), and so on for different types of devices, record the datasize (i.e. target data amount information corresponding to different types) of different types of devices;
[0115] S5, find out if there are external hardware devices or cascaded hardware devices connected to the riser card (i.e. expander), if yes, calculate the hiidatasize (i.e. target data amount information) of the riser card (i.e. expander) according to the driver information size (i.e. target data amount information) generated by these devices;
[0116] S6, BIOS sums up the calculated device driver information size (i.e. target data amount information) one by one, hiidatasizeDevice (i.e. candidate storage amount) = hiidatasizedefault+hiidatasize2+hiidatasize3+hiidatasize4+...
[0117] S7, store the hiidatasizeDevice calculated in S6 into the HiidataBufferAddress2 (a storage address in NVRAM);
[0118] S8, compare the hiidatasizeDevice value obtained in BIOS with the hiidatasizefirst value;
[0119] S9, if the hiidatasizeDevice value is greater than the hiidatasizefirst value, it means that the set hiidatasizeextra space is too small, then store the hiidatasizeDevice value into the NVRAM (i.e. target storage location of target storage device / target configuration item) for the first time boot allocation;
[0120] S10, if the hiidatasizeDevice value is less than the hiidatasizefirst value, in order to avoid the influence of the actual size by the hot plug device during the first time boot, at this time, the hiidatasizefirst can be stored into the NVRAM for the first time refresh BIOS boot allocation.
[0121] Through the above adaptive allocation of HIIdatabase mechanism, for users, for servers with more external network cards or devices, the problem of probability reporting of insufficient HIIdatabase memory will not occur when using SCE tool to export BIOS option file for the first time boot, which improves the user experience and avoids fatal customer complaint problems.
[0122] Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software on a general hardware platform as necessary, and of course can also be realized by hardware, but in many cases the former is a better embodiment.
[0123] The embodiments of the present application also provide a configuration device of a startup system database, Figure 5 is a structural block diagram of a configuration device of a startup system database according to an embodiment of the present application, as Figure 5 shown, the device comprises:
[0124] The startup module 502 is configured to start the server.
[0125] The detection module 504 is configured to detect hardware device information of a target hardware device connected to the server, wherein the hardware device information is used to indicate a data condition to be stored in a startup system database of the server, and the startup system database is used to provide data for running of a startup system of the server.
[0126] The configuration module 506 is configured to configure a memory space for the startup system database according to the hardware device information, wherein the memory space is used to store data for the startup system database.
[0127] Through the above device, after starting the server, the hardware device information of the target hardware device connected to the server is detected, since the hardware device information is used to indicate the data condition to be stored in the startup system database of the server, and the memory space is configured for the startup system database according to the hardware device information, it can be ensured that the memory space configured for the startup system database meets the current connection condition of the server, thus the technical problem of unreasonable configuration of the memory space for the startup system database in the related art can be solved, and the technical effects of improving the rationality of the memory space configuration for the startup system database and avoiding the situation of insufficient memory space of the startup system database can be achieved.
[0128] Optionally, the detection module comprises: a first detection unit configured to detect a target device type of the target hardware device; an extraction unit configured to extract data amount information from each target hardware device according to the target device type to obtain target data amount information corresponding to each target hardware device, wherein the target data amount information is used to indicate a data amount of data to be stored in the startup system database by the corresponding target hardware device; and a calculation unit configured to calculate the hardware device information according to the target data amount information.
[0129] Optionally, the extraction unit is further configured to: search for a target control function corresponding to a target device type from the device types and the control functions having the corresponding relationship, wherein the control function is used to control a hardware device of the corresponding device type; invoke the target control function to send a target control instruction to the target hardware device, wherein the target control instruction is used to control the target hardware device to feed back a data volume of running information of the target hardware device; and receive the device data volume returned by the target hardware device in response to the target control instruction to obtain the target data volume information.
[0130] Optionally, the first detection unit is further configured to: detect a target device type of a target hardware device directly connected to the server; detect whether an extender is connected to the server; in a case where it is detected that the extender is connected to the server, detect a reference device type of a target hardware device connected to the extender; and determine the target device types of all the target hardware devices connected to the extender as the reference device type.
[0131] Optionally, after detecting the target device type of the target hardware device directly connected to the server, the first detection unit is further configured to: divide the target hardware device directly connected to the server into one or more target device sets according to the target device type.
[0132] Optionally, after determining the target device types of all the target hardware devices connected to the extender as the reference device type, the first detection unit is further configured to: divide all the target hardware devices connected to the extender into the reference device set.
[0133] Optionally, the extraction unit is further configured to: traverse the target hardware devices in each device set according to the target device set and / or the reference device set; and extract the data volume information from the currently traversed target hardware device according to the target device type.
[0134] Optionally, the first detection unit is further configured to: extract type information from connection information of the target hardware device, wherein the connection information is information provided by the target hardware device to the server when the target hardware device establishes a connection with the server; and identify a device type indicated by the type information to obtain the target device type.
[0135] Optionally, the detection module further includes: a second detection unit configured to detect whether an external hardware device is connected to the server; a third detection unit configured to, in a case where it is detected that the external hardware device is connected to the server, detect hardware device information of the external hardware device connected to the server according to a device quantity of the external hardware device, wherein the target hardware device includes the external hardware device; and a first configuration unit configured to, in a case where it is detected that the external hardware device is not connected to the server, configure, for the start system database, an internal memory space conforming to a default storage volume.
[0136] Optionally, the third detection unit is further configured to: compare the number of devices with the number threshold; in a case that the number of devices is greater than or equal to the number threshold, detect the hardware device information of the external hardware device connected to the server; and in a case that the number of devices is less than the number threshold, configure the memory space conforming to the reference storage amount for the startup system database, wherein the reference storage amount is a sum of the default storage amount and the additional storage amount.
[0137] Optionally, the configuration module comprises: a first determination unit configured to determine the target storage amount of the startup system database according to the hardware device information; and a second configuration unit configured to configure the memory space conforming to the target storage amount for the startup system database.
[0138] Optionally, the first determination unit is further configured to: compare the data amount indicated by the hardware device information with the additional storage amount; in a case that the data amount indicated by the hardware device information is greater than or equal to the additional storage amount, calculate a sum of the data amount indicated by the hardware device information and the default storage amount to obtain the target storage amount; and in a case that the data amount indicated by the hardware device information is less than the additional storage amount, determine the reference storage amount as the target storage amount, wherein the reference storage amount is a sum of the default storage amount and the additional storage amount.
[0139] Optionally, the first determination unit is further configured to: calculate a sum of the data amount indicated by the hardware device information and the default storage amount to obtain a candidate storage amount; compare the candidate storage amount with the reference storage amount, wherein the reference storage amount is a sum of the default storage amount and the additional storage amount; in a case that the candidate storage amount is greater than or equal to the additional storage amount, determine the candidate storage amount as the target storage amount; and in a case that the candidate storage amount is less than the additional storage amount, determine the reference storage amount as the target storage amount.
[0140] Optionally, the second configuration unit is further configured to: write the target storage amount into a target storage location in a target memory of the server, wherein the target storage location is used to store the database parameters for the startup system database; in a case that the server is started to the configuration stage of the startup system database, read the target storage amount from the target storage location; and allocate the memory space conforming to the target storage amount for the startup system database.
[0141] Optionally, the startup system database comprises a user interface database; the startup module comprises a startup unit configured to start the server and run the startup system; and the detection module comprises a fourth detection unit configured to: in a case that the startup system is run to the driver execution environment stage, detect the hardware device information of the external hardware device connected to the server, wherein the target hardware device comprises the external hardware device.
[0142] Optionally, the configuration module comprises: a second determination unit configured to determine the data storage amount of the user interface database according to the hardware device information; a writing unit configured to write the data storage amount into a target configuration item of the user interface database in the configuration item of the starting system; a reading unit configured to read the data storage amount from the target configuration item; and an allocation unit configured to allocate a memory space conforming to the data storage amount to the user interface database.
[0143] Optionally, the second determination unit is further configured to: compare the data amount indicated by the hardware device information with an additional storage amount, wherein the additional storage amount is an additional storage amount added to the user interface database each time the server is started; in a case where the data amount indicated by the hardware device information is greater than or equal to the additional storage amount, calculate a sum of the data amount indicated by the hardware device information and a default storage amount to obtain the data storage amount, wherein the default storage amount is a storage amount of data to be stored into the user interface database by the built-in hardware device of the server; and in a case where the data amount indicated by the hardware device information is less than the additional storage amount, determine a reference storage amount as the data storage amount, wherein the reference storage amount is a sum of the default storage amount and the additional storage amount.
[0144] Optionally, the second determination unit is further configured to: calculate a sum of the data amount indicated by the hardware device information and a default storage amount to obtain a candidate storage amount, wherein the default storage amount is a storage amount of data to be stored into the user interface database by the built-in hardware device of the server; compare the candidate storage amount with a reference storage amount, wherein the reference storage amount is a sum of the default storage amount and an additional storage amount, and the additional storage amount is an additional storage amount added to the user interface database each time the server is started; in a case where the candidate storage amount is greater than or equal to the additional storage amount, determine the candidate storage amount as the data storage amount; and in a case where the candidate storage amount is less than the additional storage amount, determine the reference storage amount as the data storage amount.
[0145] The description of the features in the embodiment of the configuration apparatus of the starting system database can be referred to the related description of the embodiment of the configuration method of the starting system database, which will not be repeated here.
[0146] The embodiment of the present application further provides an electronic device, comprising a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned embodiments of the configuration method of the starting system database.
[0147] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is configured to execute the steps in any of the above-mentioned embodiments of the configuration method of the starting system database when running.
[0148] In an example embodiment, the computer readable storage medium described above can include, but is not limited to, a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0149] Embodiments of the present application also provide a computer program product, which comprises a computer program, and the computer program, when executed by a processor, implements the steps in any of the embodiments of the configuration method for starting a system database.
[0150] Embodiments of the present application also provide another computer program product, which comprises a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the steps in any of the embodiments of the configuration method for starting a system database.
[0151] The skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in general terms. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. The skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0152] The above describes in detail the configuration method and device for starting a system database provided by the present application. The principles and implementation modes of the present application are described by applying specific examples in this paper, and the above description of the examples is only applicable to help understand the method of the present application and its core idea. It should be pointed out that for the ordinary skilled in the art, without departing from the principles of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A method for configuring a system database for startup, characterized in that, include: Start the server; The hardware device information of the target hardware device connected to the server is detected, wherein the hardware device information is used to indicate the data to be stored in the startup system database of the server, and the startup system database is used to provide data for the operation of the startup system of the server; Configure memory space for the startup system database according to the hardware device information, wherein the memory space is used to store data for the startup system database; The startup system database includes: a user interface database; The startup server includes: starting the server and running the startup system; The detection of hardware device information of the target hardware device connected to the server includes: when the startup system runs to the driver execution environment stage, detecting the hardware device information of the external hardware device connected to the server, wherein the target hardware device includes the external hardware device; The step of configuring memory space for the startup system database based on the hardware device information includes: determining the data storage volume of the user interface database based on the hardware device information; writing the data storage volume into the target configuration item of the user interface database in the configuration items of the startup system; reading the data storage volume from the target configuration item; and allocating memory space for the user interface database that matches the data storage volume. Determining the data storage volume of the user interface database based on the hardware device information includes: The data volume indicated by the hardware device information is compared with the additional storage volume, wherein the additional storage volume is the additional storage volume added to the user interface database each time the server is started; if the data volume indicated by the hardware device information is greater than or equal to the additional storage volume, the data storage volume is calculated by summing the data volume indicated by the hardware device information with the default storage volume, wherein the default storage volume is the storage volume of the data to be stored in the user interface database by the server's built-in hardware device; if the data volume indicated by the hardware device information is less than the additional storage volume, a reference storage volume is determined as the data storage volume, wherein the reference storage volume is the sum of the default storage volume and the additional storage volume; Alternatively, the candidate storage amount can be obtained by calculating the sum of the data amount indicated by the hardware device information and the default storage amount, wherein the default storage amount is the storage amount of data to be stored in the user interface database by the server's built-in hardware device; the candidate storage amount is compared with the reference storage amount, wherein the reference storage amount is the sum of the default storage amount and the additional storage amount, the additional storage amount being the additional storage amount added to the user interface database each time the server is started; if the candidate storage amount is greater than or equal to the additional storage amount, the candidate storage amount is determined as the data storage amount; if the candidate storage amount is less than the additional storage amount, the reference storage amount is determined as the data storage amount.
2. The method according to claim 1, characterized in that, The detection of hardware device information of the target hardware device connected to the server includes: Detect the target device type of the target hardware device; Data volume information is extracted from each of the target hardware devices according to the target device type to obtain target data volume information corresponding to each target hardware device, wherein the target data volume information is used to indicate the amount of data to be stored in the startup system database of the corresponding target hardware device; The hardware device information is calculated based on the target data volume information.
3. The method according to claim 2, characterized in that, The step of extracting data volume information from each of the target hardware devices according to the target device type to obtain the target data volume information corresponding to each of the target hardware devices includes: The target control function corresponding to the target device type is found from the corresponding device types and control functions, wherein the control function is used to control the hardware device of the corresponding device type; The target control function is invoked to send a target control instruction to the target hardware device, wherein the target control instruction is used to control the amount of data that the target hardware device feeds back on the operation information of the target hardware device; Receive the amount of device data returned by the target hardware device in response to the target control command, and obtain the target data amount information.
4. The method according to claim 2, characterized in that, The target device type for detecting the target hardware device includes: Detect the target device type of the target hardware device that is directly connected to the server; Detect whether the extender is connected to the server; If the extender is detected to be connected to the server, the reference device type of a target hardware device connected to the extender is detected. The target device type of all target hardware devices connected to the extender is determined as the reference device type.
5. The method according to claim 4, characterized in that, After detecting the target device type of the target hardware device directly connected to the server, the method further includes: dividing the target hardware device directly connected to the server into one or more target device sets according to the target device type; After determining the target device type of all the target hardware devices connected to the extender as the reference device type, the method further includes: classifying all the target hardware devices connected to the extender into a reference device set; The step of extracting data volume information from each of the target hardware devices according to the target device type includes: traversing the target hardware devices in each device set according to the target device set and / or the reference device set; and extracting the data volume information from the currently traversed target hardware device according to the target device type.
6. The method according to claim 2, characterized in that, The target device type for detecting the target hardware device includes: Type information is extracted from the connection information of the target hardware device, wherein the connection information is the information provided by the target hardware device to the server when establishing a connection with the server; Identify the device type indicated by the type information to obtain the target device type.
7. The method according to claim 1, characterized in that, The detection of hardware device information of the target hardware device connected to the server includes: Detect whether an external hardware device is connected to the server; If an external hardware device is detected connected to the server, the hardware device information of the external hardware device connected to the server is detected according to the number of the external hardware devices, wherein the target hardware device includes the external hardware device. If no external hardware device is connected to the server, configure memory space for the startup system database that meets the default storage amount.
8. The method according to claim 7, characterized in that, The step of detecting the hardware device information of the external hardware devices connected to the server based on the number of external hardware devices includes: Compare the number of devices with the quantity threshold; If the number of devices is greater than or equal to the number threshold, the hardware device information of the external hardware devices connected to the server is detected. If the number of devices is less than the number threshold, a memory space that meets the reference storage amount is configured for the startup system database, wherein the reference storage amount is the sum of the default storage amount and the additional storage amount.
9. A configuration device for starting a system database, characterized in that, include: The startup module is used to start the server; The detection module is used to detect the hardware device information of the target hardware device connected to the server, wherein the hardware device information is used to indicate the data status to be stored in the startup system database of the server, and the startup system database is used to provide data for the operation of the server's startup system; A configuration module is used to configure memory space for the startup system database according to the hardware device information, wherein the memory space is used to store data for the startup system database; The startup system database includes: a user interface database; The startup module includes: a startup unit, used to start the server and run the startup system; The detection module includes a fourth detection unit, used to detect the hardware device information of the external hardware device connected to the server when the startup system runs to the driver execution environment stage, wherein the target hardware device includes the external hardware device; The configuration module includes: a second determining unit, configured to determine the data storage volume of the user interface database based on the hardware device information; a writing unit, configured to write the data storage volume into the target configuration item of the user interface database in the configuration items of the startup system; a reading unit, configured to read the data storage volume from the target configuration item; and allocate memory space for the user interface database that conforms to the data storage volume. The second determining unit is further configured to: compare the data volume indicated by the hardware device information with the additional storage volume, wherein the additional storage volume is the additional storage volume added to the user interface database each time the server is started; if the data volume indicated by the hardware device information is greater than or equal to the additional storage volume, calculate the sum of the data volume indicated by the hardware device information and the default storage volume to obtain the data storage volume, wherein the default storage volume is the storage volume of data to be stored in the user interface database by the server's built-in hardware device; if the data volume indicated by the hardware device information is less than the additional storage volume, determine a reference storage volume as the data storage volume, wherein the reference storage volume is the sum of the default storage volume and the additional storage volume; Alternatively, the second determining unit is further configured to: calculate the sum of the data amount indicated by the hardware device information and the default storage amount to obtain a candidate storage amount, wherein the default storage amount is the storage amount of data to be stored in the user interface database by the server's built-in hardware device; compare the candidate storage amount with a reference storage amount, wherein the reference storage amount is the sum of the default storage amount and an additional storage amount, the additional storage amount being the additional storage amount added to the user interface database each time the server is started; if the candidate storage amount is greater than or equal to the additional storage amount, determine the candidate storage amount as the data storage amount; if the candidate storage amount is less than the additional storage amount, determine the reference storage amount as the data storage amount.
10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the configuration method for starting a system database as described in any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the configuration method for starting the system database as described in any one of claims 1 to 8.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the configuration method for starting the system database as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Memory resource allocation method, device and equipment
CN110399217A