Server software and hardware adaptation method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202510717990.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2045-05-29
AI Technical Summary
[0004]本申请实施例提供了一种服务器软硬件的适配方法、装置、电子设备、存储介质,以至少解决相关技术中无法实现软件层和硬件层进行匹配时的解耦,导致服务器升级过程复杂,效率低的问题
[0010]通过本申请,在管理平台识别到分布式存储系统存在硬件调整的情况下,获取所述分布式存储系统调整的目标硬件的硬件信息,其中,所述管理平台用于管理所述分布式存储系统中不同服务器的软硬件适配数据;根据所述硬件信息从预设适配层数据库中确定所述目标硬件对应的配置信息;基于所述配置信息对所述分布式存储系统进行适配。采用上述技术方案,解决了无法实现软件层和硬件层进行匹配时的解耦,导致服务器升级过程复杂,效率低的问题。进而,通过获取目标硬件信息,从适配层数据库中匹配配置数据来更新与目标硬件信息对应的配置参数,实现对新硬件的快速适配和管理,确保系统中各服务器软硬件协调一致。
Smart Images

Figure CN120631260B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of distributed storage system technology, and more specifically, to a method, apparatus, electronic device, and storage medium for adapting server hardware and software. Background Technology
[0002] In recent years, with the rapid development of cloud computing, big data, and the Internet of Things (IoT) technologies, the demand for distributed storage systems has been growing, becoming a core infrastructure supporting modern data-intensive applications. However, the tight coupling between software and hardware in traditional storage systems makes software updates and debugging complex and cumbersome when facing equipment iterations, topology changes, or specific customer requirements. In particular, when storage servers need to be upgraded to new hardware platforms or adapted to equipment from different vendors, the software layer usually requires large-scale refactoring and adaptation, which not only increases development costs but also extends system deployment time. Therefore, finding a solution that can effectively decouple software and hardware and improve system adaptability and maintenance efficiency has become a key issue that urgently needs to be addressed in the field of distributed storage system design.
[0003] There is currently no effective solution to the problem that the inability to decouple the software and hardware layers in related technologies leads to complex and inefficient server upgrade processes. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, and storage medium for adapting server software and hardware, so as to at least solve the problem in related technologies where decoupling cannot be achieved when matching the software layer and the hardware layer is not possible, resulting in a complex and inefficient server upgrade process.
[0005] According to one embodiment of this application, a server hardware and software adaptation method is provided, comprising: when a management platform identifies that a distributed storage system has undergone hardware adjustments, obtaining hardware information of the target hardware being adjusted in the distributed storage system, wherein the management platform is used to manage hardware and software adaptation data of different servers in the distributed storage system; determining configuration information corresponding to the target hardware from a preset adaptation layer database based on the hardware information; and adapting the distributed storage system based on the configuration information.
[0006] According to another embodiment of this application, a server hardware and software adaptation device is provided, comprising: an acquisition module, configured to acquire hardware information of the target hardware of the distributed storage system when the management platform identifies that there is a hardware adjustment in the distributed storage system, wherein the management platform is used to manage hardware and software adaptation data of different servers in the distributed storage system; a determination module, configured to determine the configuration information corresponding to the target hardware from a preset adaptation layer database based on the hardware information; and an adaptation module, configured to adapt the distributed storage system based on the configuration information.
[0007] According to yet another embodiment of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and the computer program is configured to perform the steps in any of the above method embodiments when it is run.
[0008] According to yet another embodiment of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0009] According to yet another embodiment of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0010] This application addresses the issue of hardware adjustments being detected in a distributed storage system by a management platform. The platform acquires hardware information of the target hardware being adjusted, and manages software and hardware compatibility data for different servers within the distributed storage system. Based on this hardware information, the platform determines configuration information corresponding to the target hardware from a pre-defined adaptation layer database. The distributed storage system is then adapted based on this configuration information. This technical solution solves the problem of complex and inefficient server upgrades caused by the inability to decouple software and hardware layers for matching. Furthermore, by acquiring the target hardware information and matching configuration data from the adaptation layer database to update the configuration parameters corresponding to the target hardware information, rapid adaptation and management of new hardware are achieved, ensuring consistent software and hardware across all servers in the system. Attached Figure Description
[0011] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a hardware structure block diagram of a server device for a server hardware and software adaptation method according to an embodiment of this application.
[0013] Figure 2 This is a flowchart of a server hardware and software adaptation method according to an embodiment of this application;
[0014] Figure 3 This is a flowchart of a software-hardware adaptation layer method in a storage system according to an embodiment of this application;
[0015] Figure 4 This is a flowchart of a hardware device information collection process according to an embodiment of this application;
[0016] Figure 5 This is a schematic diagram of a hard disk style example according to an embodiment of this application;
[0017] Figure 6 This is a schematic diagram of a network port example according to an embodiment of this application;
[0018] Figure 7 This is a schematic diagram of a power supply example according to an embodiment of this application;
[0019] Figure 8 This is a schematic diagram of a fan example according to an embodiment of this application;
[0020] Figure 9 This is a structural block diagram of a server hardware and software adaptation device according to an embodiment of this application;
[0021] Figure 10 This is a computer system architecture block diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0023] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0024] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] As an optional implementation, the method embodiments provided in this application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure block diagram of a server device according to an embodiment of the server hardware and software adaptation method of this application. For example... Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The server device may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the server equipment described above. For example, the server equipment may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0026] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the server hardware and software adaptation method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the server device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0027] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the server device. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0028] This embodiment provides a method for adapting server software and hardware. Figure 2 This is a flowchart of a server hardware and software adaptation method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps:
[0029] Step S202: When the management platform detects that there is a hardware adjustment in the distributed storage system, it obtains the hardware information of the target hardware of the distributed storage system being adjusted. The management platform is used to manage the software and hardware adaptation data of different servers in the distributed storage system.
[0030] Step S204: Determine the configuration information corresponding to the target hardware from the preset adaptation layer database based on the hardware information;
[0031] Step S206: Adapt the distributed storage system based on the configuration information.
[0032] The above method, when the management platform detects hardware adjustments in the distributed storage system, obtains the hardware information of the target hardware being adjusted. The management platform manages the software and hardware adaptation data of different servers in the distributed storage system. Based on the hardware information, it determines the configuration information corresponding to the target hardware from a preset adaptation layer database. The distributed storage system is then adapted based on this configuration information. This technical solution solves the problem of complex and inefficient server upgrades caused by the inability to decouple the software and hardware layers during matching. Furthermore, by obtaining the target hardware information and matching configuration data from the adaptation layer database to update the configuration parameters corresponding to the target hardware information, rapid adaptation and management of new hardware is achieved, ensuring consistent software and hardware across all servers in the system.
[0033] In an exemplary embodiment, before determining the configuration information corresponding to the target hardware from a preset adaptation layer database based on the hardware information, the method further includes: establishing an adaptation layer service for the distributed storage system, wherein the adaptation layer service includes at least: a hardware device information collection service, a hardware topology management service, and a device style information service; and collecting information from the distributed storage system based on the adaptation layer service to obtain a target information set.
[0034] Optionally, the hardware device information collection service is responsible for periodically collecting hardware status information, such as power status, fan speed, CPU (Central Processing Unit) temperature, and memory usage, using commands like `ipmitool sensor`, and storing this information in memory. The hardware topology management service, upon system startup, automatically identifies and records the server's topology information into a new configuration file by reading configuration files and calling hardware commands like `sg_ses` and `sg_inq`, including the number and type of RAID cards and expansion cards, as well as the connection methods of the hard drives. The device style information service includes the style and location information of hardware devices, recording this information in the configuration file. Information collection begins after the adaptation layer service framework starts. The hardware device information collection service periodically checks the hardware status, the hardware topology management service automatically updates the topology structure, and the device style information service ensures that all hardware is displayed consistently and intuitively on the interface. Finally, all collected hardware device information, topology information, and style information are aggregated into a target information set and stored in the adaptation layer database.
[0035] Through the above process, hardware upgrades can be easily completed without affecting software services. Furthermore, the efficient operation of the adaptation layer service allows for real-time monitoring of hardware status and early warning of potential hardware failures, thereby ensuring the stable and efficient operation of the distributed storage system.
[0036] In an exemplary embodiment, the hardware device information collection service is implemented in the following manner: when the software service corresponding to the management platform is running, the interface of the management platform is called according to a preset target period to obtain target hardware information of the hardware devices contained in the distributed storage system; the target hardware information is parsed according to the hardware information format corresponding to different models; and a first information set for supporting the hardware device information collection service is generated by the parsing and processing results.
[0037] Optionally, the method for collecting hardware device information varies depending on the hardware platform. Different hardware platforms require different hardware commands for acquiring device information. Specifically, hardware information collection consists of three parts: the software service corresponding to the management platform, the software-hardware adaptation layer interface, and the adaptation layer service. After the software service corresponding to the management platform starts, it periodically calls the software-hardware adaptation layer interface to obtain the latest hardware information. When the software-hardware decoupling service in the adaptation layer service starts, it synchronously starts the periodic collection service, periodically calling the `ipmitool sensor` hardware command to obtain the status information of hardware devices such as power supply, fan, CPU, and memory. The acquired information is immediately processed and stored in memory. External services can retrieve the hardware information in memory using the `getsensorinfo` command and obtain the hardware device attribute information according to different regular expression matching rules for different models. The hardware device status information and hardware device attribute information constitute the first information set of the hardware device information collection service.
[0038] In summary, the above implementation method achieves unified collection and management of information from different hardware platforms through periodic calls and intelligent parsing, effectively improving the flexibility and efficiency of hardware monitoring. At the same time, it enhances the maintainability and scalability of the system through software and hardware decoupling, and simplifies the integrated processing of hardware information from multiple platforms.
[0039] In an exemplary embodiment, the hardware topology management service is implemented by: obtaining the target topology features that the distributed storage system needs to meet after hardware adjustments; parsing multiple historical topology configuration files corresponding to the distributed storage system, and determining multiple historical topology features of the distributed storage system based on the parsing results; matching the target topology features and the multiple historical topology features; and generating a second information set to support the hardware topology management service based on the matching results.
[0040] Optionally, the hardware topology management service needs to collect characteristics of the target server's hardware after adjustments, such as the model and quantity of new RAID cards, and the quantity and model of newly added expansion cards. It reads and parses the storage system's historical topology configuration file to obtain information on each hardware configuration change, including the usage of different RAID cards and expansion cards and their corresponding hardware commands. By comparing the target topology characteristics with multiple historical topology characteristics, it finds the closest hardware configuration pattern. Based on the matched historical topology characteristics, a second information set is generated to support the hardware topology management service. This set contains all information about the new hardware configuration, such as the location of the RAID cards, the PCI addresses of the expansion cards, and the correspondence between the SAS (Serial Attached SCSI) addresses of the new hard drives and their logical slots. This information is stored in the configuration file as the basis for the execution of the hardware topology management service; for example, hard drive slot adaptation and hard drive light management obtain relevant information from the aforementioned configuration file.
[0041] In summary, by accurately acquiring the target topology features and matching them with historical topology configuration files, the system recovery speed after hardware adjustments is accelerated, and the accuracy and consistency of hardware information are ensured, thereby improving the overall stability and operational efficiency of the distributed storage system.
[0042] In one exemplary embodiment, the device style information service is implemented by: obtaining a set of device names of hardware devices in the distributed server and device element styles corresponding to different hardware devices; configuring an interface rendering strategy based on the set of device names and the device element styles; and generating a third information set to support the device style information service according to the interface rendering strategy.
[0043] Optionally, the device style information service needs to collect the names and corresponding style information of all hardware devices, including power supplies, fans, hard drives, and network ports. For different hardware models, the style information may include icons, color codes, shapes, and specific visual effects, such as animations or flashing effects, to indicate device status or alarms. Based on the acquired set of device names and device element styles, a detailed interface rendering strategy is developed. For example, power supplies are set to be displayed at the bottom of the interface, with a red icon indicating a warning status and a green icon indicating a normal status. Hard drives are arranged sequentially at the top of the interface according to their physical location on the server, and different colors are used to distinguish between idle, in use, and faulty statuses. Finally, a third information set is generated according to the interface rendering strategy and recorded in a configuration file. This third information set contains the style information, location information, and status display rules for all hardware devices. The configuration file of the third information set serves as the basis for executing the device style information service, ensuring that both newly added hardware and updated hardware styles are accurately applied to the user interface.
[0044] With the above implementation, whenever new hardware is added to the system, or existing hardware needs to update its style information, only the configuration file needs to be modified or added, without requiring any changes to the existing user interface code. This method greatly simplifies the system maintenance and upgrade process, ensuring that hardware changes have minimal impact on the user interface.
[0045] In an exemplary embodiment, adapting the distributed storage system based on the configuration information includes: determining historical hardware device information, historical hardware topology information, and historical device style information corresponding to the distributed storage system; performing a first adaptation operation on the historical hardware device information according to the hardware device information contained in the configuration information to obtain target hardware device information; wherein, the first adaptation operation includes: updating attribute information and status information in the historical hardware device information according to the adaptation logic corresponding to the hardware device information; performing a second adaptation operation on the historical hardware topology information according to the hardware topology information contained in the configuration information to obtain target hardware topology information; wherein, the second adaptation operation includes: updating the disk logical slot number in the historical hardware topology information and the correspondence between the disk drive letter and the disk logical slot number in the storage system according to the adaptation logic corresponding to the device style information; performing a third adaptation operation on the historical device style information according to the device style information contained in the configuration information to obtain target device style information; wherein, the third adaptation operation includes: updating the mapping relationship between hardware device icons and locations in the historical device style information according to the adaptation logic corresponding to the device style information.
[0046] Optionally, if the distributed storage system was initially configured with an Intel Xeon E5 processor and was later upgraded to an Intel Xeon Scalable series processor, the management platform will recognize the CPU type change during the hardware device information update process. The adaptation layer will update the CPU core count, frequency, power consumption, and other information in the historical hardware device information according to the new hardware specifications. Simultaneously, it will adjust the CPU's real-time status information, such as current workload and temperature, to reflect the characteristics and operating status of the new hardware. In this way, the upper-layer software can recognize and adapt to the new hardware through the adaptation layer without requiring any manual changes to settings, achieving a seamless upgrade.
[0047] Optionally, in a distributed storage system, the initial hardware configuration maps disk drive letters to slot numbers as follows: / dev / sdb1 corresponds to slot 1, and / dev / sdc1 corresponds to slot 2. Subsequently, the system undergoes a hardware upgrade, adding new hard drive expansion cards, changing the topology. Upon startup, the adaptation layer automatically adjusts the logical slot numbers of the disks based on the latest configuration information. For example, it maps new disk drive letters to slot numbers, such as / dev / sdd1 corresponding to slot 17, and updates existing drive letter-slot number mappings to adapt to the new topology. This step ensures that the storage software can correctly handle data access requests, guaranteeing data consistency and integrity even if the hardware layout changes.
[0048] Optionally, in its initial state, the distributed storage system's management interface displays a simple floor plan, with the power icon located at the upper left, the fan icon at the lower right, and the hard drive icons arranged in slot order. After a hardware upgrade, it was discovered that the new power module design and fan layout differed from the previous one. During the third adaptation operation, the adaptation layer automatically adjusted the icon and position mapping relationship based on the device style information recorded in the configuration file. The new power module icon was placed in the lower left corner, which better reflects the actual layout; the fan icons were rearranged according to the new layout; and the hard drive icons were reassigned according to the new logical slot numbers. This update makes the management interface more accurately reflect the physical layout of the hardware, facilitating maintenance personnel to quickly identify and handle hardware-related events, and improving the accuracy and efficiency of maintenance work.
[0049] In summary, the above embodiments, by introducing an adaptation layer, avoid the problems of low adaptation efficiency and increased workload caused by the original hardware adaptation process, which required separately pulling software branches for adaptation work and then merging them into the corresponding software version after adaptation. The implementation of the above three adaptation operations significantly improves the hardware adaptability, topology management efficiency, and user interface friendliness of the distributed storage system.
[0050] In an exemplary embodiment, after adapting the distributed storage system based on the configuration information, the method further includes: performing storage verification on the adapted distributed storage system and generating a verification result; if the verification result indicates successful verification, sending first information to the management platform, wherein the first information carries confirmation information that the distributed storage system has been successfully adapted; and if the verification result indicates failed verification, sending second information to the management platform, wherein the second information carries fault information indicating that the distributed storage system has failed to adapt.
[0051] Optionally, a distributed storage system originally configured with 8 RAID cards, each supporting 8 hard drive slots, for a total of 64 hard drives. During digital transformation, to improve storage capacity and data processing speed, it was decided to introduce new hardware configurations, including replacing the RAID cards with 16 hard drive cards and optimizing the performance of the software and hardware adaptation layer. After the adaptation process is completed, the distributed storage system undergoes storage verification, including: simulating actual data read and write operations to test the data read and write speeds under the new hardware configuration; and comparing performance metrics such as latency and throughput with the data before adaptation through performance tests to ensure improved system performance. If all tests pass, a confirmation message indicating successful adaptation of the distributed storage system is sent to the management platform. If any test fails, a fault message indicating adaptation failure is sent to the management platform.
[0052] In summary, the above implementation methods can effectively ensure that the distributed storage system can maintain efficient and stable operation even after hardware upgrades or changes.
[0053] To facilitate understanding of the implementation methods of this application, relevant scenarios are explained below, but these explanations do not limit the scope of this application.
[0054] In related technologies, the tight coupling between software and hardware makes software updates and debugging complex and cumbersome when facing equipment iterations, topology changes, or specific customer needs. In particular, when storage servers need to be upgraded to new hardware platforms or adapted to equipment from different vendors, the software layer usually requires large-scale reconstruction and adaptation, which not only increases development costs but also extends system launch time.
[0055] To avoid the aforementioned problems, as an optional implementation, this application proposes a software-hardware adaptation layer method for a storage system. By introducing a software-hardware adaptation layer located between the system's software management layer and hardware device layer, it acts as a bridge between the two, enabling unified collection of hardware information, topology management, and standardized presentation of device views. The adaptation layer parses and processes device information from different hardware platforms, such as power supplies, fans, CPUs, and memory, using specific hardware commands to obtain inherent and dynamic device information and cache it for efficient access by upper-layer software. Simultaneously, the adaptation layer is also responsible for collecting hardware topology characteristics, such as the number and type of RAID cards, the number of expansion cards, and hard drive connection methods, forming a topology configuration file. This allows upper-layer software to perform necessary hardware operations without needing to concern itself with complex hardware details. Furthermore, a device style information module stores the appearance and location information of the devices for visual display and maintenance of the software interface. In this way, this application not only significantly improves the speed and flexibility of adapting to new models but also reduces maintenance costs and simplifies the problem localization process, thereby greatly enhancing the adaptability and stability of the storage system in the face of diverse hardware environments.
[0056] As an optional real-time method, Figure 3 This is a flowchart of a software-hardware adaptation layer method in a storage system according to an embodiment of this application, specifically including the following steps:
[0057] Step 1: Hardware device information collection.
[0058] Optionally, the method for collecting hardware device information varies depending on the hardware platform. Different hardware platforms require different hardware commands for acquiring device information. Specifically, the collection of hardware device information consists of the following three parts, as detailed in the process below. Figure 4 As shown, Figure 4 This is a flowchart of a hardware device information collection process according to an embodiment of this application.
[0059] Part 1: Management Software Performance Service. After starting, the management software performance service periodically calls the software hardware adaptation layer interface to obtain the latest hardware information.
[0060] Part Two: Adaptation Layer Services. When the adaptation layer's hardware-software decoupling service starts, a periodic data acquisition service is started simultaneously. This service periodically calls the `ipmitool sensor` hardware command to obtain status information from hardware devices such as power supply, fans, CPU, and memory. The acquired information is immediately processed and stored in memory. External services can retrieve the hardware information in memory using the `get sensor info` command.
[0061] Part Three: Software-Hardware Adaptation Layer Interface. This interface obtains attribute information of hardware devices such as power supplies, fans, CPUs, and memory. Specifically, it includes:
[0062] (1) Power Information: First, obtain the hardware information in memory, and then obtain the power information according to the different regular expression matching rules for different models. The commands for obtaining power version, serial number, model, and type information are shown in Table 1.
[0063] Table 1: Power Information Acquisition Command Table.
[0064] Bai'ao model ipmitool fru
[0065] (2) Fan Information: First, obtain the hardware information in memory, and then obtain the fan information according to the different regular expression matching rules for different models. The commands for obtaining the information are shown in Table 2.
[0066] Table 2: Command table for obtaining fan information.
[0067] HAM model FAN[0-9]_R|F_Speed ipmitool raw 0x3c 0x2e slot Bai'ao model FAN[0-9]_Speed ipmitool raw 0x3e 0x2a 0xcc 0xcb 0x00 slot
[0068] (3) CPU Information: First, obtain the hardware information in memory, and then obtain the CPU information according to the different regular expression matching rules for different machine models. The commands for obtaining the information are shown in Table 3.
[0069] Table 3: CPU Information Table.
[0070] HAM model CPU[d+]_Status PVCCIN_CPU Bai'ao model CPU[d+]_Status P1V8
[0071] (4) Memory Information: First, obtain the hardware information in the memory of the software decoupling service, and then obtain the device memory information according to different regular expression matching rules for different models. The acquisition commands are shown in Table 4.
[0072] Table 4: Aircraft type command table.
[0073] HAM model CPU[0-9]_C[a-zA-Z0-9] Bai'ao model CPU[0-9]_C[AD]D[0-9]_Status
[0074] Step Two: Hardware Topology Information Acquisition. Hardware topology information acquisition primarily involves collecting and recording hardware topology information. First, the topology configuration file is read, and hardware commands are used to collect hardware topology characteristics (number of RAID cards, RAID card type, number of expansion cards, etc.). Then, the topology structure is located in the adapted topology file and recorded in a new configuration file. Subsequent hard drive bay adaptation and hard drive LED management will obtain the corresponding information from this configuration file. Details are as follows:
[0075] (1) Slot adaptation.
[0076] Optionally, the topology collection structure is shown in Table 5.
[0077] Table 5: Topology collection structure.
[0078]
[0079] Optionally, the hard drive bay adaptation includes the following steps:
[0080] Step 1: Obtain the hard drive slot information on the expansion card using the command `sg_ses`, and then map it to the logical slot based on the actual recorded topology information. The command format is as follows:
[0081] sg_ses -p 0x0a / dev / sgxx;
[0082] Device slot number: 13;
[0083] SAS address:0x56c92bf004ef730d.
[0084] The above command retrieves the mapping between SAS addresses and slots. Here, 13 represents the physical hard drive slot. Combining this with the actual device topology, the final mapping between SAS addresses and logical slots is obtained, as shown below:
[0085] SAS address: 0x56c92bf004ef730d;
[0086] Slots: 11.
[0087] Step 2: Use the hardware command `sg_inq` to obtain the mapping between hard drive letters and SAS addresses. The command format is as follows:
[0088] sg_inq--page=0x83 / dev / sdxx;
[0089] SAS address: 0x56c92bf004ef730d.
[0090] Step 3: Associate the results from Step 1 and Step 2 using SAS addresses to obtain the relationship between drive letters and slots, as shown below:
[0091] Drive letter: / dev / sdxx;
[0092] Slots: 11.
[0093] Optionally, the `sg_ses` command is used to interact with SES (SCSI Enclosure Services) devices. SES is a standard interface used to manage hard disk arrays and other devices in a storage system. The `sg_ses` command can communicate with SES devices by sending commands and receiving responses.
[0094] Optionally, the `sg_inq` command is a command-line tool used to query SCSI device information, typically used in Linux systems. Detailed information about a device is obtained by sending the `SCSI INQUIRY` command to that device. SCSI (Small Computer System Interface) is a standard used for communication between computers and external devices such as hard drives, tape drives, and optical drives.
[0095] Optionally, PCIe is a high-speed serial computer expansion bus standard.
[0096] Optionally, SAS (Serial Attached SCSI) is a high-speed interconnect technology that uses a serial bus. By physically connecting via a serial bus, it transmits SCSI protocol standard commands over the link. SAS is widely used in servers and storage arrays, primarily for connecting hard drives and hard drive enclosures.
[0097] Optionally, the SAS address is a 64-bit identifier. A SAS address is configured for each device element within the device.
[0098] It should be noted that since many RAID cards only come with 8 hard drive interfaces natively, when more hard drives need to be connected, an expansion card is a better choice. You can use the original RAID card to connect more hard drives without occupying the limited PCIe lanes, which is both economical and flexible.
[0099] (2) Hard drive indicator light management. The hard drive indicator lights include a positioning light and a fault light. Two configuration files are involved. One of them records the hardware command information used by a specific model, as shown in Table 6 below.
[0100] Table 6: Hardware Command Information Table.
[0101]
[0102] Optionally, in Table 7, the hardware commands require the backplane number and slot number information for a specific hard drive. This information should be recorded in a separate configuration file, as shown in Table 7 below.
[0103] Table 7: Backplate Number and Slot Number Information Table.
[0104] Hard drive 1 0x00 0x00 Hard drive 2 0x00 0x01 hard disk n 0x01 0x00
[0105] Optionally, the hard drive light management command corresponding to a certain hard drive can be directly matched from Tables 6 and 7 above, and finally the command is encapsulated in the adapter layer to manage the hard drive light.
[0106] Step 3: Device Style Information Collection. Device style information includes the style and location information of the hardware devices. Since physical device styles vary widely, the style or location information of the corresponding physical devices will be adjusted each time a new device or model is introduced. Therefore, this information is recorded in a configuration file, and the adaptation layer returns this information to the interface for managing the rendering of the interface devices. The overall configuration information is shown in Table 8 below.
[0107] Table 8: Configuration information table for the management interface.
[0108] Hard drive 1 / device / style / disk1.png view: / front1 position:[0,0] Hard drive 2 / device / style / disk1.png view: / front1 position:[10,0] Network Port 1 / device / style / port1.png view: / back1 position:[5,0] Power supply 1 / device / style / power1.png view: / back1 position:[15,15] Fan 1 / device / style / fan1.png view: / back1 position:[20,20]
[0109] The first column displays the device name, including power supply, fan, hard drive, network port, etc.; the second column displays the device element style; and the third column displays the device's position information on the background image. The `view` field indicates whether the device is in the front or back view of the background image, and `position` represents the device's position on the background image, with values representing its distance in pixels from the left and top borders of the background image. This information is used for rendering on the background image.
[0110] Optional, such as Figure 5 As shown, Figure 5 This is a schematic diagram of a hard disk style example according to an embodiment of this application. Specifically, the hard disk style example is / device / style / disk1.png.
[0111] Optional, such as Figure 6 As shown, Figure 6 This is a schematic diagram of a network port example according to an embodiment of this application. Specifically, the network port example is / device / style / port1.png.
[0112] Optional, such as Figure 7 As shown, Figure 7 This is a schematic diagram of a power supply example according to an embodiment of this application. Specifically, the power supply example is / device / style / power1.png.
[0113] Optional, such as Figure 8 As shown, Figure 8 This is a schematic diagram of a fan example according to an embodiment of this application. Specifically, the fan example is / device / style / fan1.png:
[0114] Optionally, each adaptation process only requires maintaining a configuration file and adding new images in the adaptation layer to complete the device view style adaptation. The upper software layer calls a unified interface to obtain the configuration file and renders the interface of device elements according to the configuration file, facilitating subsequent maintenance and expansion.
[0115] It's important to note that while the adaptation layer uses caching to store hardware information to reduce the need for repeated hardware device queries, it's crucial to ensure the consistency between cached data and the actual hardware state. Inappropriate caching strategies or malfunctioning data update mechanisms can lead to inconsistencies between the software and hardware state information. Decisions based on this inconsistency can result in abnormal system behavior, such as incorrect device status indications, impacting user judgment and overall system performance.
[0116] In summary, by adding an adaptation layer service between the software and hardware layers, upper-layer software can request hardware information through a unified interface. When the adaptation layer starts, a periodic data acquisition service is simultaneously launched, periodically calling hardware commands to obtain hardware information and storing it in memory. Based on the instruction formats and regular expression matching rules of different device models, the hardware information in memory is parsed and processed to obtain hardware device information. Hardware topology information is collected and recorded in a configuration file. Physical information of hard drive slots is obtained through hardware commands and mapped to logical slot information using the topology structure in the configuration file. The style information and position coordinates of device elements are recorded in the configuration file for use by upper-layer software. By adding an adaptation layer between the software and hardware, hardware adaptation can be performed directly by modifying code in the adaptation layer, thus solving the problem of inconsistent development cycles between software and hardware versions. For customer-customized models, adaptation does not require development on the existing software version; adaptation only needs to be performed in the adaptation layer. After development, only the adaptation layer software package needs to be upgraded, facilitating subsequent management and maintenance without affecting the overall software version. Hardware compatibility issues are easier to pinpoint, eliminating the need for multiple module personnel to work together on the location; only the caregiver in the adaptation layer needs to be located, saving R&D manpower and improving R&D efficiency.
[0117] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0118] This embodiment also provides a server hardware and software adaptation system for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0119] Figure 9 This is a structural block diagram of a server hardware and software adaptation device according to an embodiment of this application, such as... Figure 9 As shown, the device includes:
[0120] The acquisition module 92 is used to acquire the hardware information of the target hardware of the distributed storage system when the management platform identifies that there is a hardware adjustment in the distributed storage system. The management platform is used to manage the software and hardware adaptation data of different servers in the distributed storage system.
[0121] The determination module 94 is used to determine the configuration information corresponding to the target hardware from a preset adaptation layer database based on the hardware information.
[0122] The adaptation module 96 is used to adapt the distributed storage system based on the configuration information.
[0123] Using the aforementioned device, when the management platform detects hardware adjustments in the distributed storage system, it acquires the hardware information of the target hardware being adjusted. The management platform manages the software and hardware adaptation data of different servers in the distributed storage system. Based on the hardware information, it determines the configuration information corresponding to the target hardware from a preset adaptation layer database. The distributed storage system is then adapted based on this configuration information. This technical solution solves the problem of complex and inefficient server upgrades caused by the inability to decouple the software and hardware layers during matching. Furthermore, by acquiring the target hardware information and matching configuration data from the adaptation layer database to update the configuration parameters corresponding to the target hardware information, rapid adaptation and management of new hardware is achieved, ensuring consistent software and hardware across all servers in the system.
[0124] In an exemplary embodiment, the above-described apparatus further includes: a data acquisition module, configured to establish an adaptation layer service for the distributed storage system before determining the configuration information corresponding to the target hardware from a preset adaptation layer database based on the hardware information, wherein the adaptation layer service includes at least: a hardware device information acquisition service, a hardware topology management service, and a device style information service; and to acquire information from the distributed storage system based on the adaptation layer service to obtain a target information set.
[0125] In an exemplary embodiment, the acquisition module is further configured to, when the software service corresponding to the management platform is running, call the interface of the management platform according to a preset target period to obtain target hardware information of the hardware devices contained in the distributed storage system; parse the target hardware information according to the hardware information format corresponding to different models; and generate a first information set for supporting the hardware device information acquisition service through the parsing and processing results.
[0126] In an exemplary embodiment, the acquisition module is further configured to acquire the target topology features that the distributed storage system needs to meet after hardware adjustments; parse multiple historical topology configuration files corresponding to the distributed storage system, and determine multiple historical topology features of the distributed storage system based on the parsing results; match the target topology features and the multiple historical topology features; and generate a second information set to support the hardware topology management service based on the matching results.
[0127] In an exemplary embodiment, the acquisition module is further configured to acquire a set of device names of hardware devices in the distributed server and device element styles corresponding to different hardware devices; configure an interface rendering strategy based on the set of device names and the device element styles; and generate a third information set to support the device style information service according to the interface rendering strategy.
[0128] In an exemplary embodiment, the adaptation module is further configured to determine historical hardware device information, historical hardware topology information, and historical device style information corresponding to the distributed storage system; perform a first adaptation operation on the historical hardware device information according to the hardware device information contained in the configuration information to obtain target hardware device information; wherein, the first adaptation operation includes: updating attribute information and status information in the historical hardware device information according to the adaptation logic corresponding to the hardware device information; performing a second adaptation operation on the historical hardware topology information according to the hardware topology information contained in the configuration information to obtain target hardware topology information; wherein, the second adaptation operation includes: updating the disk logical slot number in the historical hardware topology information and the correspondence between the disk drive letter and the disk logical slot number in the storage system according to the adaptation logic corresponding to the device style information; performing a third adaptation operation on the historical device style information according to the device style information contained in the configuration information to obtain target device style information; wherein, the third adaptation operation includes: updating the mapping relationship between hardware device icon and location in the historical device style information according to the adaptation logic corresponding to the device style information.
[0129] In an exemplary embodiment, the above apparatus further includes: a verification module, configured to adapt the distributed storage system based on the configuration information, perform storage verification on the adapted distributed storage system, and generate a verification result; if the verification result indicates successful verification, send first information to the management platform, wherein the first information carries confirmation information that the distributed storage system has been successfully adapted; if the verification result indicates failed verification, send second information to the management platform, wherein the second information carries fault information indicating that the distributed storage system has failed to adapt.
[0130] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0131] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0132] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0133] Optionally, Figure 10 This is a computer system architecture block diagram of an electronic device according to an embodiment of this application. For example... Figure 10 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 802 or programs loaded from storage section 808 into random access memory (RAM). The random access memory 803 also stores various programs and data required for system operation. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output interface 805 (I / O interface) is also connected to the bus 804.
[0134] The following components are connected to the input / output interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a local area network card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the storage section 808 as needed.
[0135] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0136] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0137] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0138] The embodiments described herein also provide a computer program that includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in any of the above method embodiments.
[0139] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0140] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those 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 this application.
[0141] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than that described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0142] The foregoing has provided a detailed description of the server hardware and software adaptation system, method, medium, electronic device, and program product provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for adapting server hardware and software, characterized in that, include: When the management platform detects that there is a hardware adjustment in the distributed storage system, it obtains the hardware information of the target hardware of the distributed storage system being adjusted. The management platform is used to manage the software and hardware adaptation data of different servers in the distributed storage system. Based on the hardware information, the configuration information corresponding to the target hardware is determined from the preset adaptation layer database; The distributed storage system is adapted based on the configuration information. The adaptation of the distributed storage system based on the configuration information includes: Determine the historical hardware device information, historical hardware topology information, and historical device style information corresponding to the distributed storage system; The first adaptation operation is performed on the historical hardware device information based on the hardware device information contained in the configuration information to obtain the target hardware device information; The first adaptation operation includes: updating the attribute information and status information in the historical hardware device information according to the adaptation logic corresponding to the hardware device information; A second adaptation operation is performed on the historical hardware topology information based on the hardware topology information contained in the configuration information to obtain the target hardware topology information; The second adaptation operation includes: updating the disk logical slot number in the historical hardware topology information and the correspondence between the disk drive letter and the disk logical slot number in the storage system according to the adaptation logic corresponding to the device style information; A third adaptation operation is performed on the historical device style information based on the device style information contained in the configuration information to obtain the target device style information; The third adaptation operation includes updating the mapping relationship between hardware device icons and positions in the historical device style information according to the adaptation logic corresponding to the device style information.
2. The server hardware and software adaptation method according to claim 1, characterized in that, Before determining the configuration information corresponding to the target hardware from the preset adaptation layer database based on the hardware information, the method further includes: An adaptation layer service is established for the distributed storage system, wherein the adaptation layer service includes at least: hardware device information acquisition service, hardware topology management service, and device style information service; The distributed storage system is used to collect information based on the adaptation layer service to obtain a target information set.
3. The server hardware and software adaptation method according to claim 2, characterized in that, The hardware device information collection service is implemented in the following ways, including: When the software service corresponding to the management platform is running, the interface of the management platform is called according to the preset target period to obtain the target hardware information of the hardware devices contained in the distributed storage system. The target hardware information is parsed and processed according to the hardware information format corresponding to different models; The parsing and processing results generate a first information set used to support the information collection service of the hardware device.
4. The server hardware and software adaptation method according to claim 2, characterized in that, The hardware topology management service is implemented in the following ways: Obtain the target topology features that the distributed storage system needs to meet after hardware adjustments; The system parses multiple historical topology configuration files corresponding to the distributed storage system and determines multiple historical topology features of the distributed storage system based on the parsing results. Match the target topological feature with the multiple historical topological features; A second information set is generated based on the matching results to support the hardware topology management service.
5. The server hardware and software adaptation method according to claim 2, characterized in that, The device style information service is implemented in the following ways, including: Obtain the set of device names of hardware devices in the distributed server and the device element styles corresponding to different hardware devices; Configure the interface rendering strategy based on the set of device names and the style of device elements; A third information set is generated based on the interface rendering strategy to support the device style information service.
6. The server hardware and software adaptation method according to claim 1, characterized in that, After adapting the distributed storage system based on the configuration information, the method further includes: Perform storage verification on the adapted distributed storage system and generate verification results; If the verification result indicates successful verification, a first message is sent to the management platform, wherein the first message carries confirmation information that the distributed storage system has been successfully adapted. If the verification result indicates that the verification failed, a second message is sent to the management platform, wherein the second message carries fault information indicating that the distributed storage system failed to adapt.
7. A server hardware and software adaptation device, characterized in that, include: The acquisition module is used to acquire the hardware information of the target hardware of the distributed storage system when the management platform identifies that there is a hardware adjustment in the distributed storage system. The management platform is used to manage the software and hardware adaptation data of different servers in the distributed storage system. The determination module is used to determine the configuration information corresponding to the target hardware from a preset adaptation layer database based on the hardware information. An adaptation module is used to adapt the distributed storage system based on the configuration information; The adaptation module is also used to determine the historical hardware device information, historical hardware topology information, and historical device style information corresponding to the distributed storage system; The first adaptation operation is performed on the historical hardware device information based on the hardware device information contained in the configuration information to obtain the target hardware device information; The first adaptation operation includes: updating the attribute information and status information in the historical hardware device information according to the adaptation logic corresponding to the hardware device information; A second adaptation operation is performed on the historical hardware topology information based on the hardware topology information contained in the configuration information to obtain the target hardware topology information; The second adaptation operation includes: updating the disk logical slot number in the historical hardware topology information and the correspondence between the disk drive letter and the disk logical slot number in the storage system according to the adaptation logic corresponding to the device style information; A third adaptation operation is performed on the historical device style information based on the device style information contained in the configuration information to obtain the target device style information; The third adaptation operation includes updating the mapping relationship between hardware device icons and positions in the historical device style information according to the adaptation logic corresponding to the device style information.
8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the server hardware / software adaptation method as described in any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the server hardware and software adaptation method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
System and method for automatically discovering cloud environment equipment
CN111597012A
Adaptation method and device for storage management software and storage system, equipment and medium
CN115129261A
Distributed storage hardware equipment modularization adaptation method and device, equipment and medium
CN116774938A