Sensor loading method and device, computer equipment and storage medium

By storing sensor configuration files in OpenBMC's baseboard management controller image and dynamically parsing and updating sensor configurations, it solves the problems of poor sensor management versatility and high maintenance costs in the existing technology, and achieves flexible and efficient sensor management.

CN119356741APending Publication Date: 2025-01-24INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411375234.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In the prior art, OpenBMC has poor versatility when managing sensors of different types of servers, and needs to adapt special configuration files to each server type, resulting in high maintenance costs and the configuration files cannot be changed in the mirror.

Method used

By pre-setting the sensor configuration files corresponding to each platform of the target server, and generating the corresponding baseboard management controller image, the sensor configuration files are stored in the sensor configuration path of the image. When the target server starts, it monitors the sensor configuration path of the baseboard management controller image, parses the sensor configuration file, generates a sensor list, and parses sensor data according to the list.

Benefits of technology

The dynamic update sensor configuration is realized, without upgrading OpenBMC, supporting multiple platforms and multiple rules of sensor configuration, improving the flexibility and timeliness of the sensor configuration, reducing the maintenance workload, and improving efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356741A_ABST
    Figure CN119356741A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a sensor loading method and device, computer equipment and a storage medium, and the method comprises the steps: starting a substrate management controller mirror image in response to a target server, and monitoring at least one sensor configuration file under a sensor configuration path of the substrate management controller mirror image; the sensor configuration file is used for indicating a configuration rule of a sensor under a specified platform; determining a target configuration file of the target server under the target platform in the at least one sensor configuration file; analyzing the target configuration file to generate a target sensor list; and analyzing the sensor data of the target server according to the target sensor list. According to the scheme, the workload of maintaining the sensor can be reduced, and the efficiency of loading and maintaining the sensor is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a sensor loading method, device, computer equipment and storage medium. Background Art

[0002] With the rapid development of cloud computing and big data technologies, data centers, as the key infrastructure supporting these technologies, are becoming increasingly large and complex. In this context, it is particularly important to ensure the reliability, stability and availability of data centers while the business volume surges, especially how OpenBMC (Open Baseboard Management Controller), the core out-of-band management unit of each server node in the data center, monitors and manages different types of sensors on different servers.

[0003] In the related art, when OpenBMC manages sensors of different servers, the different boards used by different types of servers limit the versatility of data interaction between OpenBMC and sensors of different servers. OpenBMC needs to adapt a set of corresponding configuration files according to the board specifications of each server. In this case, the configuration files can only be applied to a certain model, with poor versatility. In addition, the configuration files are compiled in the installer and cannot be changed in the image. As the types of servers continue to increase, configuration files need to be adapted separately for each type of server, which has high maintenance costs. Summary of the invention

[0004] In view of this, the present invention provides a sensor loading method, device, computer equipment and storage medium to solve the problems of poor versatility and difficult maintenance when loading sensors of different servers.

[0005] In a first aspect, the present invention provides a sensor loading method, the method comprising:

[0006] In response to the target server starting a baseboard management controller image, monitoring at least one sensor configuration file under a sensor configuration path of the baseboard management controller image; the sensor configuration file is used to indicate a configuration rule of a sensor under a specified platform;

[0007] Determining a target configuration file of the target server under a target platform in the at least one sensor configuration file;

[0008] Parsing the target configuration file to generate a target sensor list;

[0009] The sensor data of the target server is parsed according to the target sensor list.

[0010] A sensor loading method provided by the present invention has the following advantages:

[0011] The present invention pre-sets a sensor configuration file corresponding to each platform of the target server for indicating the configuration rules of the sensor under the specified platform, then generates a baseboard management controller image corresponding to the target server, and stores the sensor configuration files corresponding to each platform of the target server under the sensor configuration path of the baseboard management controller image. When the sensor loading function is realized, the baseboard management controller image can be started in response to the target server, at least one sensor configuration file under the sensor configuration path of the baseboard management controller image is monitored, and the target configuration file of the target server under the target platform is determined in at least one sensor configuration file, and then the target configuration file is parsed to generate a target sensor list, and finally the sensor data of the target server is parsed according to the target sensor list. Since the sensor configuration file will be installed in the baseboard management controller image, when the sensor configuration file is updated, the new sensor configuration file can be directly stored in the sensor configuration path of the baseboard management controller image, without upgrading OpenBMC, and dynamically updating the sensor. Since the sensor configuration file is generated based on the sensor configuration rules under the specified platform, the configuration rules of the sensor can be dynamically set according to the platform, thereby supporting the sensor configuration of multiple platforms and multiple rules, realizing the loading, monitoring and management of sensors on multiple platforms, and can also timely update the configuration rules of the sensor according to the needs, so as to improve the flexibility and timeliness of sensor configuration. Furthermore, the sensor of any platform corresponding to the target server can be dynamically loaded through the baseboard management controller image corresponding to the target server, which can greatly reduce the workload of maintaining the sensor and improve the efficiency of sensor loading and maintenance.

[0012] In an optional embodiment, the method further includes:

[0013] If a change in the sensor configuration file is detected during the operation of the baseboard management controller image, the target configuration file is re-determined and parsed in the at least one sensor configuration file.

[0014] In an optional implementation, parsing the target configuration file to generate a target sensor list includes:

[0015] Verify whether the target configuration file is legal according to preset file rules;

[0016] If it is legal, the target configuration file is parsed to generate a target sensor list.

[0017] In an optional embodiment, the method further includes:

[0018] If the target configuration file is not legal, the system waits until a legal target configuration file is obtained, and then parses the legal target configuration file to generate the target sensor list.

[0019] In an optional embodiment, the method further includes:

[0020] In response to a data display command input by a user, the sensor data of the target server is displayed.

[0021] In an optional embodiment, the method further includes:

[0022] Get sensor configuration rules;

[0023] Generate a target sensor configuration file according to the sensor configuration rule and the sensor of the target server;

[0024] A baseboard management controller image corresponding to the sensor of the target server is created, and a target sensor configuration file is saved in a sensor configuration path of the baseboard management controller image.

[0025] In an optional implementation, generating a target sensor configuration file according to the sensor configuration rule and the sensor of the target server includes:

[0026] For any candidate sensor of the target server, determine whether the candidate sensor is a sensor corresponding to the specified platform;

[0027] If yes, then generating a starting position of the candidate sensor data according to the type of the candidate sensor; the starting position is used to indicate the data position of the candidate sensor in the target server;

[0028] According to the type of the candidate sensor, the sensor data length of the candidate sensor is set; the sensor data length is used to indicate the number of bytes of data to be read from the starting position;

[0029] For the candidate sensor, a unique identifier is set; the unique identifier is used to indicate a unique number of the candidate sensor;

[0030] For the candidate sensor, a sensor address is set; the sensor address is used to indicate a data source of the candidate sensor;

[0031] For the candidate sensor, initial configuration data is set; the initial configuration data is used to initialize the candidate sensor;

[0032] The target sensor configuration file is generated according to the starting position, the sensor data length, the unique identifier, the sensor address and the initial configuration data.

[0033] In a second aspect, the present invention provides a sensor loading device, the device comprising:

[0034] A monitoring module, configured to monitor at least one sensor configuration file under a sensor configuration path of the baseboard management controller image in response to the target server starting the baseboard management controller image; the sensor configuration file is used to indicate a configuration rule of a sensor under a specified platform;

[0035] A configuration file determination module, configured to determine a target configuration file of the target server under a target platform from the at least one sensor configuration file;

[0036] A configuration parsing module is used to parse the target configuration file and generate a target sensor list;

[0037] The list parsing module is used to parse the sensor data of the target server according to the target sensor list.

[0038] The sensor loading device provided by the present invention has the following advantages:

[0039] The present invention pre-sets a sensor configuration file corresponding to each platform of the target server for indicating the configuration rules of the sensor under the specified platform, then generates a baseboard management controller image corresponding to the target server, and stores the sensor configuration files corresponding to each platform of the target server under the sensor configuration path of the baseboard management controller image. When the sensor loading function is realized, the baseboard management controller image can be started in response to the target server, at least one sensor configuration file under the sensor configuration path of the baseboard management controller image is monitored, and the target configuration file of the target server under the target platform is determined in at least one sensor configuration file, and then the target configuration file is parsed to generate a target sensor list, and finally the sensor data of the target server is parsed according to the target sensor list. Since the sensor configuration file will be installed in the baseboard management controller image, when the sensor configuration file is updated, the new sensor configuration file can be directly stored in the sensor configuration path of the baseboard management controller image, without upgrading OpenBMC, and dynamically updating the sensor. Since the sensor configuration file is generated based on the sensor configuration rules under the specified platform, the configuration rules of the sensor can be dynamically set according to the platform, thereby supporting the sensor configuration of multiple platforms and multiple rules, realizing the loading, monitoring and management of sensors on multiple platforms, and can also timely update the configuration rules of the sensor according to the needs, so as to improve the flexibility and timeliness of sensor configuration. Furthermore, the sensor of any platform corresponding to the target server can be dynamically loaded through the baseboard management controller image corresponding to the target server, which can greatly reduce the workload of maintaining the sensor and improve the efficiency of sensor loading and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 A sensor loading flow chart in the related art is shown;

[0042] Figure 2 A multi-platform sensor loading flow chart in the related art is shown;

[0043] Figure 3 It is a flow chart of a sensor loading method provided by an embodiment of the present invention;

[0044] Figure 4 is a schematic flow chart of another sensor loading method provided by an embodiment of the present invention;

[0045] Figure 5 is a sensor loading flow chart provided by an embodiment of the present invention;

[0046] Figure 6 is a structural block diagram of a sensor loading device according to an embodiment of the present invention;

[0047] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0049] With the rapid development of cloud computing and big data technologies, data centers, as key infrastructure supporting these technologies, are becoming increasingly large and complex. In this context, it is particularly important to ensure the reliability, stability and availability of data centers while the business volume surges, especially how OpenBMC (Open Baseboard Management Controller), the core out-of-band management unit of each server node in the data center, monitors and manages different types of sensors on different servers. OpenBMC is a management device in open source embedded systems that is responsible for monitoring and managing server hardware, including sensor monitoring such as temperature, fan speed, and power status.

[0050] In the related art, when OpenBMC manages sensors of different servers, the different boards used by different types of servers limit the versatility of OpenBMC's data interaction with sensors of different servers. OpenBMC needs to adapt a set of corresponding configuration files according to the board specifications of each server. In this case, the configuration files can only be applied to a certain model, with poor versatility. In addition, the configuration files are compiled in the installer and cannot be changed in the image. As the types of servers continue to increase, if it is necessary to adapt the configuration files separately for each type of server, the maintenance cost is very high. When a sensor is updated, all adapted configuration files need to be updated and OpenBMC needs to be upgraded, which is likely to introduce new problems and make maintenance difficult.

[0051] Figure 1 The sensor loading flow chart in the related technology is shown. The user first adapts the corresponding sensor according to the porting guide of each server, and updates the SDR file (Sensor Data Repository) in YAML format, and then precompiles it, generates a sensor list according to the SDR file, and then installs the sensor list into the BMC image. When the sensor needs to be loaded, the sensor is loaded according to the sensor list through the sensor monitoring process of the BMC image and updated to the Dbus bus, and finally the sensor status is read and displayed through the Intelligent Platform Management Interface (IPMI) or Redfish. Figure 2The multi-platform sensor loading flow chart in the related technology is shown. For each of the multiple platforms, OpenBMC generates the corresponding SDR YAML configuration file according to the adaptation guide, and pre-compiles the sensor source file sensor.cpp, and then generates the BMC image for the platform. The BMC image starts and updates the sensor data to Dbus, and then displays the sensor status through IPMI or Redfish. However, the configuration file in YAML format will not be installed to the BMC image. When the sensor configuration needs to be updated, the BMC image must be recompiled and upgraded, and the BMC image types corresponding to different types of servers are also different, and the versatility is poor. And when there are only a few sensor connections that are inconsistent between the boards used by multiple types of servers, configuring the sensors for each type of server separately will cause a lot of duplication of work, increasing maintenance costs.

[0052] To solve the above problems, an embodiment of the present invention provides a sensor loading embodiment. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system (computer device) including a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0053] In this embodiment, a sensor loading method is provided, which can be used for notebook computers, desktop computers, servers, etc. Figure 3 FIG. 1 is a flow chart of a sensor loading method provided by an embodiment of the present invention. Figure 3 As shown, the process includes the following steps.

[0054] The specific steps are as follows:

[0055] Step S301 : in response to a target server starting a baseboard management controller image, monitoring at least one sensor configuration file under a sensor configuration path of the baseboard management controller image.

[0056] The target server is one of the multiple types of servers that are connected to the computer device executing the present invention, and the target server may include multiple platforms. The baseboard management controller image (BMC image) is pre-configured with corresponding sensor configuration files according to multiple platforms corresponding to the multiple types of servers and stored in the sensor configuration path. The sensor configuration file is used to indicate the configuration rules of the sensor under the specified platform, such as the number, category, measured data, etc. of the sensor.

[0057] Step S302: determining a target configuration file of the target server under a target platform in at least one sensor configuration file.

[0058] A target configuration file corresponding to the target server under the target platform is searched in at least one sensor configuration file under the sensor configuration path, for example, a corresponding identifier is pre-set for the sensor of each platform corresponding to each type of server, and the search is performed by matching the identifier. The target platform is one of the multiple platforms included in the target server. The target configuration file indicates the configuration rules of the sensor of the target server under the target platform.

[0059] Step S303: parse the target configuration file and generate a target sensor list.

[0060] After obtaining the target configuration file, the target configuration file can be parsed, the sensor configuration rules contained in the target configuration file can be read, and a target sensor list corresponding to the sensors of the target server under the target platform can be generated. The target sensor list contains sensor data blocks corresponding to each sensor under the target platform, and each sensor data block can be arranged in the order of the number of each sensor.

[0061] Step S304: parsing sensor data of the target server according to the target sensor list.

[0062] The target sensor list contains various information about the sensor, such as sensor number, category, path, data type, etc. The sensor data of the target server can be parsed according to the target sensor list to obtain the sensor data of the target server under the target platform. After obtaining the sensor data, the sensor data can also be displayed through GUI, Redfish, IPMI, etc. according to needs.

[0063] The sensor loading method provided in this embodiment pre-sets a sensor configuration file corresponding to each platform of the target server for indicating the configuration rules of the sensor under the specified platform, then generates a baseboard management controller image corresponding to the target server, and stores the sensor configuration files corresponding to each platform of the target server under the sensor configuration path of the baseboard management controller image. When implementing the sensor loading function, the baseboard management controller image can be started in response to the target server, at least one sensor configuration file under the sensor configuration path of the baseboard management controller image can be monitored, and the target configuration file of the target server under the target platform can be determined in at least one sensor configuration file, and then the target configuration file is parsed to generate a target sensor list, and finally the sensor data of the target server is parsed according to the target sensor list. Since the sensor configuration file will be installed in the baseboard management controller image, when the sensor configuration file is updated, the new sensor configuration file can be directly stored in the sensor configuration path of the baseboard management controller image, without upgrading OpenBMC, to achieve dynamic update of sensors. Since the sensor configuration file is generated based on the sensor configuration rules under the specified platform, the sensor configuration rules can be dynamically set according to the platform, thereby supporting sensor configurations of multiple platforms and multiple rules, realizing the loading, monitoring and management of sensors on multiple platforms, and updating the sensor configuration rules in a timely manner according to needs, improving the flexibility and timeliness of sensor configuration. In addition, the baseboard management controller image corresponding to the target server can dynamically load the sensor of any platform corresponding to the target server, which can greatly reduce the workload of maintaining sensors and improve the efficiency of sensor loading and maintenance.

[0064] In this embodiment, a sensor loading method is provided, which can be used for notebook computers, desktop computers, servers, etc. Figure 4 FIG. 1 is a flow chart of another sensor loading method provided by an embodiment of the present invention. Figure 4 As shown, the process includes the following steps.

[0065] The specific steps are as follows:

[0066] Step S401, obtaining sensor configuration rules.

[0067] The sensor configuration rule is a general configuration rule template pre-set according to the needs, which can configure sensors of multiple platforms corresponding to various types of servers. When new needs arise, the sensor configuration rule can be updated. By setting a general sensor configuration rule that can be adjusted according to the platform, it is possible to configure sensors of multiple platforms under the premise of concise and clear rules, reduce the workload of subsequent sensor loading and management, and improve the flexibility and efficiency of sensor loading and management.

[0068] Optionally, the sensor configuration rule is used to indicate the starting position of the sensor, the sensor data length, the unique identifier, the sensor address, and the initial configuration data.

[0069] Step S402: Generate a target sensor configuration file according to the sensor configuration rule and the sensor of the target server.

[0070] Specifically, the above step S402 includes:

[0071] S4021: For any candidate sensor of the target server, determine whether the candidate sensor is a sensor corresponding to the designated platform.

[0072] That is to say, it is necessary to first confirm which of the multiple platforms corresponding to the target server the candidate sensor belongs to, so as to confirm the platform, function type, data address, number, etc. of the candidate sensor.

[0073] S4022: If yes, generate a starting position of the candidate sensor data according to the type of the candidate sensor.

[0074] The starting position is used to indicate the data position of the candidate sensor in the target server, such as the starting position or offset of the sensor data of the candidate sensor corresponding to the target platform in the device memory or register of the target server.

[0075] S4023: Set the sensor data length of the candidate sensor according to the type of the candidate sensor.

[0076] The sensor data length is used to indicate the number of bytes of data to be read from the starting position, so as to read the complete sensor data of the candidate sensor.

[0077] S4024: Set a unique identifier for the candidate sensor.

[0078] The unique identifier is used to indicate the unique number of the candidate sensor. A general numbering rule can be set to assign specific numbers to sensors of each platform corresponding to each type of server, such as using different first letters to distinguish server types and using different numbers to sort sensors of the same type.

[0079] S4025: Set a sensor address for the candidate sensor.

[0080] The sensor address is used to indicate the data source of the candidate sensor, for example, the address of the sensor data of the candidate sensor in the device memory or register of the target server. Corresponding sensor addresses can also be set for sensors of different platforms corresponding to the target server.

[0081] S4026: Set initial configuration data for the candidate sensor.

[0082] The initial configuration data is used to initialize the candidate sensor. The initial configuration data may be predefined data values ​​and configuration data. When the candidate server is initialized, the initial value of the candidate server is set by the initial configuration data.

[0083] S4027, generating the target sensor configuration file according to the starting position, sensor data length, unique identifier, sensor address and initial configuration data.

[0084] After setting the starting position, sensor data length, unique identifier, sensor address and initial configuration data, a configuration block corresponding to the candidate sensor can be generated according to the starting position, sensor data length, unique identifier, sensor address and initial configuration data.

[0085] Further, repeat steps S3021 to S3027 to generate a configuration block corresponding to each candidate sensor in the target server, and then divide the candidate servers according to the platforms where they are located to generate a target sensor configuration file corresponding to each platform of the target server, and then generate a target sensor configuration file corresponding to each platform of each of the multiple servers, thereby realizing the configuration of sensors on multiple servers and multiple platforms, so as to realize the loading and management of sensors on multiple servers and multiple platforms in subsequent steps.

[0086] Step S403: Create a baseboard management controller image corresponding to the sensor of the target server, and save the target sensor configuration file in the sensor configuration path of the baseboard management controller image.

[0087] The baseboard management controller image can be set in units of target servers and installed in the target server, so that the computer device executing the present invention can monitor and manage the sensors in the target server through the baseboard management controller image set in the target server. The sensor configuration files of multiple platforms corresponding to the target server are all set in the baseboard management controller image of the target server. The sensor configuration path is also set in the target server, and under the sensor configuration path, the next level sensor configuration path can also be set for each platform of the target server, that is, the sensor configuration files corresponding to the sensors of the target platform are stored in the next level sensor configuration path corresponding to the target platform.

[0088] By setting the sensor configuration files of multiple platforms corresponding to the target server in the baseboard management controller image of the target server, it is possible to load sensors on any of the multiple platforms of the target server through one baseboard management controller image, thereby improving the flexibility of the solution and the efficiency of managing sensors.

[0089] Repeat step S403 to generate a baseboard management controller image corresponding to each server in the multiple servers.

[0090] Step S404 , in response to the target server starting the baseboard management controller image, monitoring at least one sensor configuration file under the sensor configuration path of the baseboard management controller image.

[0091] A sensor configuration file is used to indicate the configuration rules of sensors under a specified platform.

[0092] After the baseboard management controller image corresponding to each server in the multiple servers is generated through steps S401 to S403, the sensor data of the corresponding server can be loaded through the baseboard management controller image. The target server is any one of the multiple servers. When the sensor in the target server needs to be loaded, an instruction to start the baseboard management controller image can be sent to the target server, and in response to the action of the target server starting the baseboard management controller image, at least one sensor configuration file under the sensor configuration path of the baseboard management controller image corresponding to the target server is started to be monitored.

[0093] Step S405: determining a target configuration file of the target server under a target platform in at least one sensor configuration file.

[0094] That is, when it is necessary to load the sensor of the target server under the target platform, it is necessary to first determine the target configuration file corresponding to the sensor under the target platform.

[0095] Optionally, the sensor configuration files under the sensor configuration paths corresponding to multiple platforms in the target server are traversed, and when the target configuration file corresponding to the target platform is found, a soft connection (Symbolic Link) corresponding to the target platform is established, and the sensor configuration file under the sensor configuration path corresponding to the target platform can be accessed through the soft connection with the target platform.

[0096] Step S406: parsing the target configuration file to generate a target sensor list.

[0097] Specifically, the above step S406 includes:

[0098] Step S4061: Verify whether the target configuration file is legal according to a preset file rule.

[0099] The preset file rules can be used to indicate the rules of the grammatical structure, data type, nested structure, character encoding, uniqueness constraint, etc. of the configuration file. Verifying whether the target configuration file is legal means verifying whether the target configuration file can be parsed and whether it complies with the preset file rules. When the target configuration file can be parsed and complies with the preset file rules, the target configuration file is determined to be legal.

[0100] Step S4062: If legal, parse the target configuration file and generate a target sensor list.

[0101] Optionally, the target sensor list includes a configuration block corresponding to any sensor of the multiple sensors under the target platform, wherein the configuration block corresponding to the target sensor includes parameters of the target sensor. The parameters of the target sensor include at least a function type, a function type identifier, a sensor type, a sensor path, a sensor interface type, a reading type, a reading multiplier, a reading offset, a reading value, a user identifier, a user logic unit number, a scale factor indicator value, a reading scale factor, a reading unit, and a sensor name. Among them, the function type is used for the category of the function implemented by the target sensor; the function type identifier is used to indicate the number of the target sensor in the sensor of the same function type; the sensor type is used to indicate the specification of the target sensor; the sensor path is used to indicate the path or position of the target sensor in the target server; the sensor interface type is used to indicate the type of communication interface supported by the target sensor; the reading type is used to indicate the type of data read by the target sensor; the reading multiplier is used to indicate the reading multiplier of the target sensor, which is used to scale the original reading; the reading offset is used to offset the reading of the target sensor; the reading value is the original reading of the target sensor; the user identifier is used to indicate the owner of the target sensor, such as indicating the target server; the user logical unit number is used to indicate the logical unit number related to the owner of the target sensor, which is used to further identify the ownership of the target sensor; the scale factor indicator value is used to indicate whether the target sensor contains a reading scale factor; the reading scale factor is used to indicate the specific value of the reading scale factor; the reading unit is used to indicate the unit of the target sensor reading; the sensor name is used to describe or identify the target sensor. By setting the configuration block corresponding to the sensor, the parameters of each sensor can be set in a targeted manner, thereby improving the accuracy and efficiency of sensor loading.

[0102] Optionally, if the target configuration file is illegal, wait until a legal target configuration file is obtained, parse the legal target configuration file to generate the target sensor list. For example, when monitoring the sensors corresponding to at least one platform of the target server, if it is detected that the target configuration file of the target platform is illegal, skip the target configuration file of the target platform, obtain the configuration file corresponding to the next platform and parse it. If only the target platform is monitored, wait until the target configuration file of the target platform is legal before parsing the target configuration file. When it is detected that the target configuration file is illegal, a corresponding log file can also be generated to record the illegality of the target configuration file for reference when repairing the target configuration file later.

[0103] Step S407: parsing the sensor data of the target server according to the target sensor list.

[0104] Parse the target sensor list to obtain the sensor data of the target platform corresponding to the target server, and then obtain the sensor data of any platform corresponding to the target server according to the above steps.

[0105] Step S408: In response to the data display command input by the user, the sensor data of the target server is displayed.

[0106] When a data display command is received, the sensor data of the target sensor is obtained through the above steps according to the target server information specified in the data display command to display the sensor data.

[0107] In actual application scenarios, servers, platforms, sensors, etc. may be updated, so the corresponding sensor configuration files also need to be updated, causing the sensor configuration files to change. Optionally, if a change in the sensor configuration file is detected during the operation of the baseboard management controller image, the target configuration file is re-determined and parsed in the at least one sensor configuration file, that is, steps S401 to S403 are re-executed to update the new sensor configuration file and save it in the sensor configuration path of the baseboard management controller image, and then step S405 is executed to determine the target configuration file, and then parsed through subsequent steps. By running the baseboard management controller image, the sensors of each platform corresponding to the target server can be monitored at the same time, and the sensor configuration file can be updated in time when the sensor configuration file changes, and the new target configuration file can be re-determined and parsed, thereby improving the timeliness of sensor loading, and there is no need to upgrade OpenBMC when updating, avoiding various problems that may be caused by upgrading OpenBMC, improving the flexibility of the solution, and reducing maintenance costs.

[0108] Exemplarily, the format of the sensor configuration file is JSON. Figure 5 FIG. 1 is a flow chart of sensor loading provided by an embodiment of the present invention. Figure 5 As shown, first, a sensor configuration file (JSON) is set for each platform of the target server, and one platform corresponds to one sensor configuration file. Then, the sensor configuration file is stored in EEPROM (Electrically Erasable Programmable Read-Only Memory). Then, a baseboard management controller image corresponding to the target server is generated based on the sensor configuration files of each platform. The computer device executing the present invention can parse the EEPROM of the target server according to the baseboard management controller image to monitor each sensor configuration file under the sensor configuration path of the baseboard management controller image, and then determine the target configuration file and parse it to obtain the sensor data corresponding to each platform. The sensor data can also be displayed through IPMI SDR and Redfish.

[0109] In this embodiment, a sensor loading device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0110] This embodiment provides a sensor loading device, such as Figure 6 As shown, it includes: a monitoring module 601, a configuration file determination module 602, a configuration parsing module 603, and a list parsing module 604.

[0111] The monitoring module 601 is used for monitoring at least one sensor configuration file under the sensor configuration path of the baseboard management controller image in response to the target server starting the baseboard management controller image; the sensor configuration file is used to indicate the configuration rules of the sensor under the specified platform;

[0112] A configuration file determining module 602 is used to determine a target configuration file of the target server under a target platform from the at least one sensor configuration file;

[0113] The configuration parsing module 603 is used to parse the target configuration file and generate a target sensor list;

[0114] The list parsing module 604 is used to parse the sensor data of the target server according to the target sensor list.

[0115] In an optional embodiment, the device further includes a file monitoring module, which is used to:

[0116] If a change in the sensor configuration file is detected during the operation of the baseboard management controller image, the target configuration file is re-determined and parsed in the at least one sensor configuration file.

[0117] In an optional embodiment, the configuration parsing module 603 is specifically configured to:

[0118] Verify whether the target configuration file is legal according to the preset file rules;

[0119] If it is legal, the target configuration file is parsed to generate a target sensor list.

[0120] In an optional embodiment, the configuration parsing module 603 is further configured to:

[0121] If the target configuration file is not legal, the system waits until a legal target configuration file is obtained, and then parses the legal target configuration file to generate the target sensor list.

[0122] In an optional embodiment, the device further comprises a display module, which is used to:

[0123] In response to a data display command input by a user, the sensor data of the target server is displayed.

[0124] In an optional embodiment, the device further includes a configuration generation module, configured to:

[0125] Get sensor configuration rules;

[0126] Generate a target sensor configuration file according to the sensor configuration rule and the sensor of the target server;

[0127] Create a baseboard management controller image corresponding to the sensor of the target server, and save the target sensor configuration file in the sensor configuration path of the baseboard management controller image.

[0128] In an optional embodiment, the configuration generation module is further configured to:

[0129] For any candidate sensor of the target server, determine whether the candidate sensor is a sensor corresponding to the specified platform;

[0130] If yes, then generating a starting position of the candidate sensor data according to the type of the candidate sensor; the starting position is used to indicate the data position of the candidate sensor in the target server;

[0131] According to the type of the candidate sensor, the sensor data length of the candidate sensor is set; the sensor data length is used to indicate the number of bytes of data to be read from the starting position;

[0132] For the candidate sensor, a unique identifier is set; the unique identifier is used to indicate a unique number of the candidate sensor;

[0133] For the candidate sensor, a sensor address is set; the sensor address is used to indicate the data source of the candidate sensor;

[0134] For the candidate sensor, initial configuration data is set; the initial configuration data is used to initialize the candidate sensor;

[0135] The target sensor configuration file is generated according to the starting position, the sensor data length, the unique identifier, the sensor address and the initial configuration data.

[0136] The sensor loading device in this embodiment is presented in the form of a functional module, where the module refers to an application specific integrated circuit (ASIC), a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0137] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0138] A sensor loading device provided by an embodiment of the present invention pre-sets a sensor configuration file corresponding to each platform of a target server for indicating the configuration rules of a sensor under a specified platform, then generates a baseboard management controller image corresponding to the target server, and stores the sensor configuration files corresponding to each platform of the target server under the sensor configuration path of the baseboard management controller image. When implementing the sensor loading function, the baseboard management controller image can be started in response to the target server, at least one sensor configuration file under the sensor configuration path of the baseboard management controller image can be monitored, and the target configuration file of the target server under the target platform can be determined in at least one sensor configuration file, and then the target configuration file is parsed to generate a target sensor list, and finally the sensor data of the target server is parsed according to the target sensor list. Since the sensor configuration file will be installed in the baseboard management controller image, when the sensor configuration file is updated, the new sensor configuration file can be directly stored in the sensor configuration path of the baseboard management controller image, without upgrading OpenBMC, to achieve dynamic update of sensors. Since the sensor configuration file is generated based on the sensor configuration rules under the specified platform, the sensor configuration rules can be dynamically set according to the platform, thereby supporting sensor configurations of multiple platforms and multiple rules, realizing the loading, monitoring and management of sensors on multiple platforms, and updating the sensor configuration rules in a timely manner according to needs, improving the flexibility and timeliness of sensor configuration. In addition, the baseboard management controller image corresponding to the target server can dynamically load the sensor of any platform corresponding to the target server, which can greatly reduce the workload of maintaining sensors and improve the efficiency of sensor loading and maintenance.

[0139] The embodiment of the present invention also provides a computer device having the above Figure 6 The sensor loading device shown.

[0140] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.

[0141] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0142] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0143] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0144] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0145] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.

[0146] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0147] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0148] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0149] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the invention.

Claims

1. A sensor loading method, characterized in that: The method comprises: In response to the target server starting a baseboard management controller image, monitoring at least one sensor configuration file under a sensor configuration path of the baseboard management controller image; the sensor configuration file is used to indicate a configuration rule of a sensor under a specified platform; Determining a target configuration file of the target server under a target platform in the at least one sensor configuration file; Parsing the target configuration file to generate a target sensor list; The sensor data of the target server is parsed according to the target sensor list.

2. The method according to claim 1, characterized in that The method further comprises: If a change in the sensor configuration file is detected during the operation of the baseboard management controller image, the target configuration file is re-determined and parsed in the at least one sensor configuration file.

3. The method according to claim 1, characterized in that The step of parsing the target configuration file and generating a target sensor list includes: Verify whether the target configuration file is legal according to preset file rules; If it is legal, the target configuration file is parsed to generate a target sensor list.

4. The method according to claim 3, characterized in that The method further comprises: If the target configuration file is not legal, the system waits until a legal target configuration file is obtained, and then parses the legal target configuration file to generate the target sensor list.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: In response to a data display command input by a user, the sensor data of the target server is displayed.

6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Get sensor configuration rules; Generate a target sensor configuration file according to the sensor configuration rule and the sensor of the target server; A baseboard management controller image corresponding to the sensor of the target server is created, and a target sensor configuration file is saved in a sensor configuration path of the baseboard management controller image.

7. The method according to claim 6, characterized in that Generate a target sensor configuration file according to the sensor configuration rule and the sensor of the target server, including: For any candidate sensor of the target server, determine whether the candidate sensor is a sensor corresponding to the specified platform; If yes, then generating a starting position of the candidate sensor data according to the type of the candidate sensor; the starting position is used to indicate the data position of the candidate sensor in the target server; According to the type of the candidate sensor, the sensor data length of the candidate sensor is set; the sensor data length is used to indicate the number of bytes of data to be read from the starting position; For the candidate sensor, a unique identifier is set; the unique identifier is used to indicate a unique number of the candidate sensor; For the candidate sensor, a sensor address is set; the sensor address is used to indicate a data source of the candidate sensor; For the candidate sensor, initial configuration data is set; the initial configuration data is used to initialize the candidate sensor; The target sensor configuration file is generated according to the starting position, the sensor data length, the unique identifier, the sensor address and the initial configuration data.

8. A sensor loading device, characterized in that: The device comprises: A monitoring module, configured to monitor at least one sensor configuration file under a sensor configuration path of the baseboard management controller image in response to the target server starting the baseboard management controller image; the sensor configuration file is used to indicate a configuration rule of a sensor under a specified platform; A configuration file determination module, configured to determine a target configuration file of the target server under a target platform from the at least one sensor configuration file; A configuration parsing module is used to parse the target configuration file and generate a target sensor list; The list parsing module is used to parse the sensor data of the target server according to the target sensor list.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the sensor loading method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the sensor loading method according to any one of claims 1 to 7.