Configuration method and device of sensors of a server, storage medium and electronic device
By comparing the sensor configuration file with the BMC memory verification information in the server, the correctness of the sensor configuration file is ensured, thus solving the problem of low sensor configuration efficiency and achieving efficient and accurate sensor configuration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2023-11-29
- Publication Date
- 2026-06-26
AI Technical Summary
In existing technologies, the configuration efficiency of server sensors is low, requiring developers to manually fill in multiple configuration files, which are difficult to write and prone to errors.
By obtaining the target sensor's configuration file and comparing it with the verification information in the Baseboard Management Controller (BMC) memory, it is determined whether to allow updating the sensor's configuration information, and updates are only performed after confirmation that it is correct.
It improves the accuracy and efficiency of sensor configuration, avoids incorrect configuration, and reduces the number of configuration files and the difficulty of writing them.
Smart Images

Figure CN117743082B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a method and apparatus for configuring sensors on a server, a storage medium, and an electronic device. Background Technology
[0002] Servers are equipped with various sensors. In related technologies, sensor configuration is often achieved by storing sensor configuration information in .conf configuration files. The code parses the .conf file, reads the corresponding key-value pairs, and then parses the corresponding sensor attribute values based on the data. Essentially, each sensor requires a configuration file, or a .yaml configuration file is used to store the sensor's configuration information. The .yaml file stores information such as the sensor's I2C (Inter-Integrated Circuit) information, threshold information, and sensor type name. Each configuration file stores information for a specific type of sensor.
[0003] Both methods in the related technologies require developers to fill in configuration files again based on hardware information. The BMC has many sensors mounted, and some data needs to be calculated again, which takes a lot of time. There are many .conf configuration files, and they are divided into different paths (the paths involve the machine's I2C nodes). YAML configuration files are difficult for inexperienced people to write and are prone to errors. It is understandable that configuring a sensor in the related technologies requires writing many configuration files, and the configuration files are difficult to write. It is also understandable that the configuration efficiency of the server in the related technologies is low. Summary of the Invention
[0004] This application provides a method and apparatus for configuring sensors on a server, a storage medium, and an electronic device, to at least solve the problem of low configuration efficiency of sensors on servers in related technologies.
[0005] According to one embodiment of this application, a method for configuring a sensor on a server is provided, comprising: obtaining a target configuration file of a target sensor on the server, wherein the target configuration file includes target configuration information of the target sensor; determining whether it is permissible to use the target configuration file to update the configuration information of the target sensor based on first verification information in the target configuration file and second verification information of the target sensor stored in a first storage space in the memory of a baseboard management controller (BMC); and updating the configuration information of the target sensor to the target configuration information included in the target configuration file if it is determined that it is permissible to use the target configuration file to update the configuration information of the target sensor.
[0006] In an exemplary embodiment, determining whether to allow updating the configuration information of the target sensor using the target configuration file based on the first verification information in the target configuration file and the second verification information of the target sensor stored in the first storage space in the memory of the baseboard management controller (BMC) includes: extracting the target interface identifier of the target interface included in the target configuration file and the first sensor identifier of the target sensor, wherein the first verification information includes the target interface identifier and the first sensor identifier; obtaining the second sensor identifier from a first storage location in the first storage space through the target interface indicated by the target interface identifier, wherein the second verification information includes the second sensor identifier, a set of interfaces and a set of storage locations in the first storage space are pre-set, and one of the interfaces in the set of interfaces is used to obtain the sensor identifier at a corresponding storage location in the first storage space; and determining whether to allow updating the configuration information of the target sensor using the target configuration file based on the first sensor identifier and the second sensor identifier.
[0007] In one exemplary embodiment, determining whether to allow updating the configuration information of the target sensor using the target configuration file based on the first sensor identifier and the second sensor identifier includes: if the first sensor identifier and the second sensor identifier are the same, determining that updating the configuration information of the target sensor using the target configuration file is allowed.
[0008] In an exemplary embodiment, updating the configuration information of the target sensor to the target configuration information included in the target configuration file includes: updating the configuration information of the target sensor stored in the first storage space to the target configuration information included in the target configuration file, wherein the first storage space is used to store sensor identifiers with corresponding relationships and configuration information of the sensors represented by the sensor identifiers, and the sensor identifiers with corresponding relationships and configuration information of the sensors represented by the sensor identifiers include the sensor identifiers of the target sensor with corresponding relationships and the configuration information of the target sensor.
[0009] In an exemplary embodiment, updating the configuration information of the target sensor stored in the first storage space to the target configuration information included in the target configuration file includes at least one of the following: when the configuration information of the target sensor includes a first parameter and the target configuration information includes a target threshold, updating the value of the first parameter stored in the first storage space to the target threshold, wherein the value of the first parameter is used to represent a threshold of data that the target sensor is allowed to acquire; when the configuration information of the target sensor includes a second parameter and the target configuration information includes a target bus address, updating the value of the second parameter stored in the first storage space to the target bus address, wherein the value of the second parameter is used to represent the bus address of the bus corresponding to the target sensor, and different bus addresses of the bus correspond to the second storage space in the memory of the BMC. In different storage locations within the BMC, the target sensor is configured to, upon acquiring initial data from the server, store the initial data in the second storage location of the second storage space within the BMC's memory via the target bus address. The target bus address and the second storage location have a corresponding relationship. When the target sensor's configuration information includes a third parameter and the target configuration information includes a target scaling factor, the value of the third parameter stored in the first storage space is updated to the target scaling factor. The value of the third parameter represents the scaling factor of the target sensor. The target scaling factor is used to determine the target data acquired by the target sensor by multiplying the acquired data by the target scaling factor when the BMC acquires data from the corresponding storage location in the second storage space via the bus address represented by the value of the second parameter.
[0010] In an exemplary embodiment, updating the value of the first parameter stored in the first storage space to the target threshold includes at least one of the following: when the first parameter includes a standard parameter and the target threshold includes a first threshold, updating the value of the standard parameter to the first threshold, wherein the value of the standard parameter represents a standard value of data of the target type acquired by the target sensor from the server, and the type of the target data is the target type; when the first parameter includes a minimum alarm parameter and the target threshold includes a second threshold, updating the value of the minimum alarm parameter to the second threshold, wherein the type of the target data is the target type. The alarm minimum parameter is used to represent the minimum alarm value of the target type data of the server acquired by the target sensor. The BMC is configured to generate a first alarm message when the target data is less than the minimum alarm value, and the first alarm message is used to represent the target data being less than the minimum alarm value. If the first parameter includes an alarm maximum parameter and the target threshold includes a third threshold, the value of the alarm maximum parameter is updated to the third threshold, wherein the type of the target data is the target type, and the value of the alarm maximum parameter is used to represent the maximum alarm value of the target type data of the server acquired by the target sensor. The BMC is configured to generate a second alarm message when the target data is greater than the maximum alarm value, the second alarm message indicating that the target data is greater than the maximum alarm value; when the first parameter includes a minimum error parameter and the target threshold includes a fourth threshold, the value of the minimum error parameter is updated to the fourth threshold, wherein the type of the target data is the target type, the value of the minimum error parameter representing the minimum error value of the target type data of the server acquired by the target sensor, and the BMC is configured to generate a first error message when the target data is less than the minimum error value, the first error message being used to... This indicates that the target data is less than the minimum error value, or that the target data is abnormal; when the first parameter includes a maximum error parameter and the target threshold includes a fifth threshold, the value of the maximum error parameter is updated to the fifth threshold, wherein the type of the target data is the target type, and the value of the maximum error parameter is used to represent the maximum error value of the target type data of the server acquired by the target sensor, and the BMC is set to generate second error information when the target data is greater than the maximum error value, the second error information being used to indicate that the target data is greater than the maximum error value, or that the target data is abnormal.
[0011] In an exemplary embodiment, after updating the configuration information of the target sensor to the target configuration information included in the target configuration file, the method further includes: during the operation of the server, acquiring initial data of the server through the target sensor and storing the initial data in a second storage space in the memory of the BMC; when the target bus address and target scaling factor included in the target configuration information are acquired from the first storage space in the memory of the BMC, and the initial data is acquired from the second storage space through the target bus address, determining the product of the initial data and the target scaling factor as the target data acquired by the target sensor; when the target threshold included in the target configuration information is acquired from the first storage space in the memory of the BMC, determining whether to generate a prompt message based on the target data and the target threshold.
[0012] In an exemplary embodiment, determining whether to generate a prompt message based on the target data and the target threshold includes at least one of the following: generating a first alarm message when the target threshold includes a second threshold, the minimum alarm parameter is the value of the second threshold, and the target data is less than the second threshold; wherein the type of the target data is a target type, the minimum alarm parameter represents the minimum alarm value of the target type data of the server acquired by the target sensor, and the first alarm message indicates that the target data is less than the minimum alarm value; generating a second alarm message when the target threshold includes a third threshold, the maximum alarm parameter is the value of the third threshold, and the target data is greater than the third threshold; wherein the type of the target data is the target type, the maximum alarm parameter represents the maximum alarm value of the target type data of the server acquired by the target sensor, and the second alarm message indicates that the target data is greater than the second threshold. The alarm maximum value is specified; when the target threshold includes a fourth threshold, the minimum error parameter is the fourth threshold, and the target data is less than the fourth threshold, a first error message is generated, wherein the type of the target data is the target type, the minimum error parameter is used to represent the minimum error value of the target type data of the server acquired by the target sensor, and the first error message is used to indicate that the target data is less than the minimum error value, or that the target data is abnormal; when the target threshold includes a fifth threshold, the maximum error parameter is the fifth threshold, and the target data is greater than the fifth threshold, a second error message is generated, wherein the type of the target data is the target type, the maximum error parameter is used to represent the maximum error value of the target type data of the server acquired by the target sensor, and the second error message is used to indicate that the target data is greater than the maximum error value, or that the target data is abnormal.
[0013] According to another embodiment of this application, a sensor configuration device for a server is provided, comprising: a first acquisition module, configured to acquire a target configuration file of a target sensor on the server, wherein the target configuration file includes target configuration information of the target sensor; a first determination module, configured to determine whether it is permissible to use the target configuration file to update the configuration information of the target sensor based on first verification information in the target configuration file and second verification information of the target sensor stored in a first storage space in the memory of a baseboard management controller (BMC); and an update module, configured to update the configuration information of the target sensor to the target configuration information included in the target configuration file if it is determined that it is permissible to use the target configuration file to update the configuration information of the target sensor.
[0014] 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.
[0015] 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.
[0016] This application allows for the configuration of server sensors. When configuring sensor information, the system first checks the verification information in the configuration file and the sensor's verification information stored in the BMC memory to determine if updating the sensor information using the configuration file is permitted. If updating the sensor configuration information using the configuration file is permitted, it indicates that the configuration file is correct for the sensor. In this case, the sensor's configuration information is updated to the information included in the configuration file. This method avoids configuring the sensor with incorrect information and allows updating the sensor configuration information using only a single configuration file. Therefore, it solves the problem of low configuration efficiency for server sensors, thereby improving the overall efficiency of server sensor configuration. Attached Figure Description
[0017] Figure 1 This is a hardware structure block diagram of a server device for configuring sensors in a server according to an embodiment of this application.
[0018] Figure 2 This is a flowchart of a method for configuring sensors on a server according to an embodiment of this application;
[0019] Figure 3This is a schematic diagram illustrating an optional determination of whether to allow updating the configuration information of a target sensor using a target profile, according to an embodiment of this application.
[0020] Figure 4 This is a schematic diagram of an optional target configuration file according to an embodiment of this application;
[0021] Figure 5 This is a schematic diagram of an optional method for configuring sensors on a server according to an embodiment of this application;
[0022] Figure 6 This is a structural block diagram of a sensor configuration device for a server according to an embodiment of this application. Detailed Implementation
[0023] The embodiments of this application will be described in detail below with reference to the accompanying drawings and examples.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0025] The methods and 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 for a method of configuring sensors on a server, according to an embodiment of this application. 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 sensor configuration method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and may also include 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] First, the technical terms used in the various embodiments of this application are explained as follows:
[0029] systemd: Represents various system startup and operation-related objects as different types of units and provides the ability to handle dependencies between different units.
[0030] systemd represents various system startup and runtime-related objects as different types of units and provides the ability to handle dependencies between different units. Most units are statically defined in unit files, but a small number are dynamically generated: some come from other traditional configuration files (for compatibility), while others dynamically come from system state or programmable runtime state. Units can be in an active, inactive, activating, or deactivating state. There is also a special failed state, meaning the unit has failed in some way (returning an error code upon exit, process crash, operation timeout, or triggering a startup frequency limit). When entering a failed state, the cause of the failure is logged for future troubleshooting. It's important to note that different units may also have their own different "sub-states," but they are all mapped to one of the five states mentioned above.
[0031] System initialization involves many tasks. It requires starting background services, such as the SSH service; it also requires configuration tasks, such as mounting file systems. Each step in this process is abstracted by systemd as a configuration unit. You can think of a service as a configuration unit, a mount point as a configuration unit, the configuration of a swap partition as a configuration unit, and so on. A service is one type, representing a background service process.
[0032] service: A type of unit in systemd that represents a background service process.
[0033] D-bus: Data Bus, is a low-latency, low-overhead, and highly available IPC mechanism.
[0034] D-Bus is an advanced inter-process communication mechanism released under the GPL license. Its primary use is to provide communication between processes in the Linux desktop environment, while also passing Linux desktop environment and Linux kernel events as messages to processes. The core concept of D-Bus is a bus; registered processes can receive or send messages through the bus, and processes can also register to wait for kernel events, such as network state changes or shutdown commands. D-Bus is adopted by most Linux distributions, and developers can use it to implement various complex inter-process communication tasks.
[0035] BMC: Baseboard Management Controller.
[0036] CSV (Comma-Separated Values) is a simple and practical file format used to store and represent various types of data, including text and numbers. CSV files typically have the .csv extension. A key characteristic of this file format is that the data within the file is separated by commas, presented in a tabular format.
[0037] This embodiment provides a method for configuring sensors on a server. Figure 2 This is a flowchart of a method for configuring sensors on a server according to an embodiment of this application, as shown below. Figure 2 As shown, the process includes the following steps:
[0038] Step S202: Obtain the target configuration file of the target sensor on the server, wherein the target configuration file includes the target configuration information of the target sensor;
[0039] Step S204: Based on the first verification information in the target configuration file and the second verification information of the target sensor stored in the first storage space in the memory of the baseboard management controller (BMC), determine whether it is allowed to use the target configuration file to update the configuration information of the target sensor.
[0040] Step S206: If it is determined that updating the configuration information of the target sensor using the target configuration file is permitted, the configuration information of the target sensor is updated to the target configuration information included in the target configuration file.
[0041] By following the steps described above, when configuring the server's sensor configuration information, the system first checks the verification information in the configuration file and the sensor's verification information stored in the BMC memory to determine whether updating the sensor information using the configuration file is allowed. If updating the sensor's configuration information using the configuration file is allowed, it indicates that the configuration file is the correct one for the sensor. In this case, the sensor's configuration information is updated to the information included in the configuration file. This method avoids configuring the sensor with incorrect configuration information and allows updating the sensor's configuration information using only one configuration file. Therefore, it solves the problem of low configuration efficiency for server sensors, thereby improving the overall efficiency of sensor configuration on the server.
[0042] The entity performing the above steps can be a server, but is not limited to this.
[0043] In the technical solution provided in step S202 above, one or more sensors may be deployed on the server, and each sensor may be used to acquire data from the corresponding server. The types of server data acquired by each sensor may be the same or different. For example, sensor 1 is used to acquire voltage type data of the server, sensor 2 is used to acquire voltage type data of the server, and sensor 3 is used to acquire voltage type data of the server.
[0044] Optionally, in this embodiment, the target configuration file may include, but is not limited to, a table file, such as a CSV file. The target configuration file may also be, but is not limited to, a file that does not require secondary compilation and can be directly interpreted by the code layer in the BMC. The format of the target configuration file is not limited in the various embodiments of this application; for example, the target configuration file may be, but is not limited to, a CSV file. In this way, when configuring the server's sensors, the configuration file does not need to be recompiled; instead, it is directly parsed, improving the readability of the configuration file.
[0045] Optionally, in this embodiment, the target configuration file may include, but is not limited to, configuration information of one or more sensors on the server. If the target configuration file includes configuration information of multiple sensors, the configuration information of the multiple sensors may be updated through the target configuration file in the following ways: Based on the sensor identifiers of the sensors included in the target configuration file, the target configuration file is split into a set of configuration files, wherein each configuration file in the set includes configuration information of the corresponding sensor in the set of sensors on the server; the set of configuration files is copied to the code configuration directory for use, so that the configuration information of the set of sensors is updated to the configuration information included in the corresponding configuration file in the set of configuration files.
[0046] Optionally, in this embodiment, the configuration information of a group of sensors can be updated in the following manner, but not limited to: determining whether it is allowed to use a set of configuration files to update the configuration information of a group of sensors based on the first set of verification information in a set of configuration files and the second set of verification information of a group of sensors stored in the first storage space in the memory of the baseboard management controller (BMC); if it is determined that it is allowed to use the i-th configuration file in a set of configuration files to update the configuration information of the i-th sensor in the group of sensors, the configuration information of the i-th sensor is updated to the configuration information included in the i-th configuration file, where i is a positive integer greater than or equal to 1.
[0047] Optionally, in this embodiment, the sensor configuration information may include, but is not limited to, the storage location of the server data acquired by the sensor (e.g., the storage location in the memory of the BMC), the threshold for allowing the sensor to acquire server data, the scaling factor of the server data acquired by the sensor, and the storage location of the sensor configuration information in the first storage space, etc.
[0048] In the technical solution provided in step S204 above, in order to improve the accuracy of updating the configuration information of the sensor and avoid using an incorrect configuration file to update the configuration information of the sensor, for example, using the configuration file corresponding to sensor 2 to update sensor 1, it is possible, but not limited to, to determine whether it is allowed to use the target configuration file to update the configuration information of the target sensor based on the verification information in the configuration file and the verification information of the sensor stored in the memory of the BMC.
[0049] Optionally, in this embodiment, the first storage space in the memory of the BMC may, but is not limited to, store sensors and verification information with corresponding relationships. Each sensor has corresponding verification information, and it is understood that the verification information corresponding to each sensor is different.
[0050] Optionally, in this embodiment, the first storage space may include, but is not limited to, physical storage space in the memory of the BMC, or virtual storage space in the memory of the BMC, or storage space implemented by software, such as storage space implemented based on D-bus, etc. This application does not limit this.
[0051] In one exemplary embodiment, whether to allow updating the configuration information of the target sensor using the target configuration file can be determined, but is not limited to, by: extracting the target interface identifier of the target interface and the first sensor identifier of the target sensor included in the target configuration file, wherein the first verification information includes the target interface identifier and the first sensor identifier; obtaining a second sensor identifier from a first storage location in the first storage space through the target interface indicated by the target interface identifier, wherein the second verification information includes the second sensor identifier, a set of interfaces and a set of storage locations in the first storage space are pre-set, one of the interfaces in the set of interfaces is used to obtain the sensor identifier at a corresponding storage location in the first storage space; and determining whether to allow updating the configuration information of the target sensor using the target configuration file based on the first sensor identifier and the second sensor identifier.
[0052] Optionally, in this embodiment, the first sensor identifier of the target sensor included in the first verification information may include, but is not limited to, the sensor name, sensor ID, sensor manufacturer, name of the server where the sensor is located, ID of the server where the sensor is located, location of the server where the sensor is located, and manufacturer of the server where the sensor is located, etc. The first sensor identifier may be, but is not limited to, an identifier in the form of key-value pairs, or the first sensor identifier may include, but is not limited to, at least one of letters, numbers, and strings, etc., and this application does not impose any limitations on this.
[0053] For example, the first verification information can be, but is not limited to, the data stored under the probe in the target configuration file. Its data format can be, but is not limited to, "dbus interface: (key value: value data)," where the dbus interface is equivalent to the target interface identifier, and the key and value data are the first sensor identifier. For example, "xyz.openbmc_project.FruDevice('BOARD_MANUFACTURER': 'A')", where FruDevice is the dbus interface identifier (equivalent to the target interface identifier), 'BOARD_MANUFACTURER' is the key value indicating the manufacturer of the motherboard on the server where the sensor is located, and 'A' is the value data, identifying the manufacturer of the motherboard on the server where the sensor is located as manufacturer A.
[0054] Optionally, in this embodiment, the data format of the second sensor identifier is the same as that of the first sensor identifier. If the data of the second sensor identifier is too large, then the second sensor identifier may be stored in multiple storage locations in the first storage space, but is not limited to. The second sensor identifier may be obtained from multiple storage locations in the first storage space through the target interface indicated by the target interface identifier, but is not limited to. The second verification information includes the second sensor identifier. A set of interfaces and a set of storage locations in the first storage space are pre-set to correspond to each other. One of the interfaces in the set of interfaces is used to obtain the sensor identifiers in the corresponding multiple storage locations in the first storage space.
[0055] In one exemplary embodiment, whether to allow updating the configuration information of a target sensor using a target profile can be determined, but is not limited to, based on a first sensor identifier and a second sensor identifier, in the following manner: if the first sensor identifier and the second sensor identifier are the same, it is determined that updating the configuration information of the target sensor using the target profile is allowed.
[0056] Optionally, in this embodiment, if the first sensor identifier and the second sensor identifier are different, it is determined that the target configuration file is not allowed to update the configuration information of the target sensor. In this case, it can be indicated that the target configuration file is not a file used to update the configuration information of the target sensor, that is, the target configuration file has an error.
[0057] Optionally, in this embodiment, it can be determined whether the first sensor identifier and the second sensor identifier are the same by means of, but not limited to, the following: if the first sensor identifier includes a first key-value pair and the second sensor identifier includes a second key-value pair, it can be determined whether the first key-value pair and the second key-value pair are the same.
[0058] For example, the first sensor identifier includes: 'BOARD_ID': 'SX203456', and the second sensor identifier includes: 'BOARD_ID': 'SX242346', where BOARD_ID represents the motherboard ID of the server where the sensor is located. It is possible, but not limited to, comparing whether the motherboard ID "SX203456" included in the first sensor identifier is the same as the motherboard ID "SX242346" included in the second sensor identifier. In this embodiment, the first sensor identifier and the second sensor identifier are different.
[0059] Figure 3 This is a schematic diagram illustrating an optional method for determining whether to allow updating the configuration information of a target sensor using a target configuration file, according to an embodiment of this application. Figure 3 As shown, the target interface identifier (e.g., interface identifier 3) and the first sensor identifier (e.g., sensor identifier 4) of the target interface included in the target configuration file are extracted, wherein the first verification information includes the target interface identifier and the first sensor identifier.
[0060] The second sensor identifier (e.g., sensor identifier 3) is obtained from the first storage location (e.g., storage location 3) in the first storage space through the target interface (e.g., interface 3) indicated by the target interface identifier (e.g., interface 3). The second verification information includes the second sensor identifier. A set of interfaces (e.g., interface 1, interface 2, and interface 3) and a set of storage locations (e.g., storage location 1, storage location 2, and storage location 3) in the first storage space are pre-set. Interface 1 is used to obtain sensor identifier 1 at the corresponding storage location 1 in the first storage space, and interface 2 is used to obtain sensor identifier 2 at the corresponding storage location 2 in the first storage space.
[0061] If the first sensor identifier (e.g., sensor identifier 4) and the second sensor identifier are the same (e.g., sensor identifier 3), it is determined that updating the configuration information of the target sensor using the target profile is permitted.
[0062] In the technical solution provided in step S206 above, if it is determined that updating the configuration information of the target sensor using the target configuration file is not allowed, the configuration information of the target sensor is refused to be updated to the target configuration information included in the target configuration file.
[0063] Optionally, in this embodiment, after updating the configuration information of the target sensor to the target configuration information included in the target configuration file, the configuration information of the target sensor may also be updated to reference configuration information in the following ways, but not limited to: during the operation of the target sensor according to the target configuration information, obtaining the reference configuration file of the target sensor on the server, wherein the reference configuration file includes reference configuration information of the target sensor; determining whether it is allowed to use the reference configuration file to update the configuration information of the target sensor based on the third verification information in the reference configuration file and the second verification information of the target sensor stored in the first storage space in the memory of the baseboard management controller (BMC); if it is determined that it is allowed to use the reference configuration file to update the configuration information of the target sensor, updating the target configuration information of the target sensor to the reference configuration information included in the reference configuration file.
[0064] In this way, when there are abnormalities in the configuration information or when the sensor configuration information needs to be updated again, the configuration file in the BMC can be directly replaced. For example, during the sensor debugging process, the configuration file can be directly replaced or modified, and the systemd service can be restarted to update the sensor configuration, thus improving the efficiency of sensor debugging.
[0065] In one exemplary embodiment, the configuration information of the target sensor may be updated to the target configuration information included in the target configuration file in the following manner, but not limited to: updating the configuration information of the target sensor stored in the first storage space to the target configuration information included in the target configuration file, wherein the first storage space is used to store sensor identifiers with corresponding relationships and configuration information of the sensors represented by the sensor identifiers, the sensor identifiers with corresponding relationships and configuration information of the sensors represented by the sensor identifiers including the sensor identifiers of the target sensor with corresponding relationships and the configuration information of the target sensor.
[0066] Optionally, in this embodiment, the first storage space may, but is not limited to, store sensor identifiers and configuration information represented by multiple sensors on the server. It is understood that after updating the configuration information of a sensor, the configuration information corresponding to the sensor identifier of that sensor stored in the first storage space may, but is not limited to, also be updated.
[0067] Optionally, in this embodiment, after updating the configuration information of the target sensor to the reference configuration information, the target configuration information of the target sensor stored in the first storage space may be updated to the reference configuration information included in the reference configuration file, but is not limited to. The first storage space is used to store sensor identifiers with corresponding relationships and the configuration information of the sensors represented by the sensor identifiers. The sensor identifiers with corresponding relationships and the configuration information of the sensors represented by the sensor identifiers include the sensor identifiers of the target sensor with corresponding relationships and the configuration information of the target sensor.
[0068] In one exemplary embodiment, updating the configuration information of the target sensor stored in the first storage space to the target configuration information included in the target configuration file may include, but is not limited to, at least one of the following methods:
[0069] Method 1: When the configuration information of the target sensor includes a first parameter and the target configuration information includes a target threshold, the value of the first parameter stored in the first storage space is updated to the target threshold, wherein the value of the first parameter is used to represent the threshold of data that the target sensor is allowed to acquire.
[0070] Method 2: When the configuration information of the target sensor includes a second parameter and the target configuration information includes a target bus address, the value of the second parameter stored in the first storage space is updated to the target bus address. The value of the second parameter represents the bus address of the bus corresponding to the target sensor. Different bus addresses correspond to different storage locations in the second storage space of the BMC's memory. The target sensor is configured to store the initial data obtained from the server in the second storage location in the second storage space of the BMC's memory through the target bus address. The target bus address and the second storage location have a corresponding relationship.
[0071] Method 3: When the configuration information of the target sensor includes a third parameter and the target configuration information includes a target scaling factor, the value of the third parameter stored in the first storage space is updated to the target scaling factor. The value of the third parameter represents the scaling factor of the target sensor. The target scaling factor is used to determine the target data obtained by the target sensor by multiplying the obtained data by the target scaling factor when the BMC obtains data from the corresponding storage location in the second storage space through the bus address represented by the value of the second parameter.
[0072] Optionally, in this embodiment, the target configuration file may include, but is not limited to, first verification information and target configuration information. Figure 4 This is a schematic diagram of an optional target configuration file according to an embodiment of this application, such as... Figure 4 As shown, the target configuration file may include, but is not limited to, first verification information and target configuration information. The first verification information includes information recorded under probe, and the target configuration information includes data recorded under type, sensor_num, bus, addr, devicestandard_value, warning_value, err_value, factor, and description.
[0073] The target configuration file can be configured in a format that is not limited to the sensor spec (Sensor Specification) and previous configurations (YAML), for example, the target configuration file is in the form of a CSV file, where the first line contains sensor attribute description information.
[0074] Probe is a set of rules used to detect a given entity. If the definition requires specifying the data source (if a value exists, it will be parsed), the data format is: "dbus interface: (key value: value data)" and the data example is: "xyz.openbmc_project.FruDevice('BOARD_MANUFACTURER': 'INSPUR')").
[0075] Type: This indicates the type of sensor, which may include, but is not limited to, ADC (analog to digital converter), PSU (PC power supply unit), voltage, current, FAN (wind speed), and temp (temperature).
[0076] sensor_num, a count of 0, 1, 2, 3..., starts counting from 0 when the target configuration file includes configuration and verification information for multiple sensors. For example, if the target configuration file includes configuration information for sensor 1, the sensor_num count is 0; if the target configuration file includes configuration information for sensor 2, the sensor_num count is 1, and so on. This will not be elaborated further.
[0077] Bus is the I2C bus used to record the data acquired by the sensor and is equivalent to the target bus. For example, if the value of bus is 2, it means that the sensor data acquired by the sensor is stored on I2C bus 2.
[0078] Addr is used to record the I2C address of the I2C bus where the data acquired by the sensor is stored; it is equivalent to the target bus address.
[0079] Device is used to record the location of the sensor deployed on the server, such as which board the sensor belongs to, for example, the BMC sensor, the SMB sensor, the CPU sensor, and the PSU sensor, etc.
[0080] standard_value is equivalent to the first threshold, for example, 3.3.
[0081] The warning_value_* (warning threshold) includes Warnig_value_min (equivalent to the second threshold, for example, 3.069) and Warnig_value_max (equivalent to the third threshold, for example, 3.531).
[0082] err_value* (error threshold), including err_value_min (equivalent to the fourth threshold, for example, 2.97) and err_value_max (equivalent to the fifth threshold, for example, 3.63).
[0083] The factor is used to record the scaling factor after reading the value from the I2C node. It is equivalent to the target scaling factor, which can be greater than, less than or equal to 1, etc.
[0084] The description is used to record notes or comments; it is optional.
[0085] Optionally, in this embodiment, the second storage space may be used, but is not limited to, for storing the initial data of the server acquired by the sensor, and the second storage location may be, but is not limited to, the storage location in the second storage space of the BMC memory corresponding to the target bus address. For example, the storage location in the second storage space of the BMC memory corresponding to I2C bus 2 and address 50.
[0086] In one exemplary embodiment, updating the value of the first parameter stored in the first storage space to the target threshold may include, but is not limited to, at least one of the following methods:
[0087] Method 1: When the first parameter includes a standard parameter and the target threshold includes a first threshold, the value of the standard parameter is updated to the first threshold. The value of the standard parameter is used to represent the standard value of the target type data of the server acquired by the target sensor, and the type of the target data is the target type.
[0088] Optionally, in this embodiment, the value of the standard parameter is used to represent the standard value of the target type data of the server acquired by the target sensor. The standard value may include, but is not limited to, the rated value of the acquired target type data. For example, when the server fan is running normally, the speed of the server fan acquired by the sensor should be 100 r / min. It should be noted that different types of data may have, but are not limited to, corresponding standard values.
[0089] Method 2: When the first parameter includes a minimum alarm parameter and the target threshold includes a second threshold, the value of the minimum alarm parameter is updated to the second threshold. The type of the target data is the target type, and the value of the minimum alarm parameter represents the minimum alarm value of the target type data of the server acquired by the target sensor. The BMC is configured to generate a first alarm message when the target data is less than the minimum alarm value. The first alarm message indicates that the target data is less than the minimum alarm value.
[0090] Method 3: When the first parameter includes a maximum alarm parameter and the target threshold includes a third threshold, the value of the maximum alarm parameter is updated to the third threshold. Here, the type of the target data is the target type, and the value of the maximum alarm parameter is used to represent the maximum alarm value of the target type data of the server acquired by the target sensor. The BMC is set to generate a second alarm message when the target data is greater than the maximum alarm value. The second alarm message is used to indicate that the target data is greater than the maximum alarm value.
[0091] Optionally, in this embodiment, different types of data may, but are not limited to, have corresponding maximum and minimum alarm values. The BMC may, but is not limited to, generate corresponding alarm information when the target data is greater than the maximum alarm value or less than the minimum alarm value. It is understood that the configuration information of the sensor itself may be abnormal, causing the BMC to generate alarm information when it should not, or the components of the server on which the sensor is deployed may be abnormal. In this way, timely alarms are achieved when the data acquired by the sensor from the server is abnormal, improving the efficiency of prompting the BMC to detect abnormal data acquired by the sensor.
[0092] Method 4: When the first parameter includes a minimum error parameter and the target threshold includes a fourth threshold, the value of the minimum error parameter is updated to the fourth threshold. The type of the target data is the target type, and the value of the minimum error parameter represents the minimum error value of the target type data acquired by the target sensor from the server. The BMC is configured to generate first error information when the target data is less than the minimum error value. The first error information indicates that the target data is less than the minimum error value, or that the target data is abnormal.
[0093] Method 5: When the first parameter includes a maximum error parameter and the target threshold includes a fifth threshold, the value of the maximum error parameter is updated to the fifth threshold. The type of the target data is the target type, and the value of the maximum error parameter represents the maximum error value of the target type data acquired by the target sensor from the server. The BMC is configured to generate second error information when the target data is greater than the maximum error value. The second error information indicates that the target data is greater than the maximum error value, or that the target data is abnormal.
[0094] Optionally, in this embodiment, the importance of the error report may be, but is not limited to, higher than the importance of the alarm; the second threshold may be, but is not limited to, greater than the fourth threshold; and the third threshold may be, but is less than the fifth threshold. For example, when the target data is greater than the maximum alarm value, or when the target data is less than the minimum alarm value, the target data may only be slightly less than the standard value, or the target data may only be slightly greater than the standard value. However, when the target data is greater than the maximum error report value, or when the target data is less than the minimum error report value, the target data is already much less than the standard value, or the target data is already much greater than the standard value.
[0095] In an exemplary embodiment, after updating the configuration information of the target sensor to the target configuration information included in the target configuration file, the method further includes: during the operation of the server, acquiring initial data of the server through the target sensor and storing the initial data in a second storage space in the memory of the BMC; when the target bus address and target scaling factor included in the target configuration information are obtained from the first storage space in the memory of the BMC, and the initial data is obtained from the second storage space through the target bus address, the product of the initial data and the target scaling factor is determined as the target data acquired by the target sensor; when the target threshold included in the target configuration information is obtained from the first storage space in the memory of the BMC, a decision is made on whether to generate a prompt message based on the target data and the target threshold.
[0096] Optionally, in this embodiment of the application, the initial data of the server obtained by the target sensor may not be the actual data of the server. In such a case, the product of the initial data and the target scaling factor can be determined as the target data obtained by the target sensor. The target scaling factor can be greater than, equal to or less than 1. Then the target data can be greater than, equal to or less than the initial data.
[0097] In one exemplary embodiment, determining whether to generate a prompt message based on target data and a target threshold can be achieved, but is not limited to, through at least one of the following:
[0098] In scenario one, if the target threshold includes a second threshold, the minimum alarm parameter is the value of the second threshold, and the target data is less than the second threshold, a first alarm message is generated. Here, the type of the target data is a target type, the value of the minimum alarm parameter is used to represent the minimum alarm value of the target type data of the server obtained by the target sensor, and the first alarm message is used to indicate that the target data is less than the minimum alarm value.
[0099] Scenario 2: When the target threshold includes a third threshold, the maximum alarm parameter is the third threshold, and the target data is greater than the third threshold, a second alarm message is generated. The type of the target data is the target type, the maximum alarm parameter is used to represent the maximum alarm value of the target type data of the server obtained by the target sensor, and the second alarm message is used to indicate that the target data is greater than the maximum alarm value.
[0100] Optionally, in this embodiment, the BMC may, but is not limited to, generate a first alarm message when the target data is less than the second threshold, and may, but is not limited to, generate a second alarm message when the target data is greater than the second threshold. It is understood that in such cases, it may be that a component of the server on which the sensor is deployed has malfunctioned.
[0101] Scenario 3: When the target threshold includes a fourth threshold, the minimum error parameter is the fourth threshold, and the target data is less than the fourth threshold, a first error message is generated. The type of the target data is the target type, the minimum error parameter represents the minimum error value of the target type data acquired by the target sensor from the server, and the first error message indicates that the target data is less than the minimum error value, or that the target data is abnormal.
[0102] Scenario 4: If the target threshold includes a fifth threshold, the maximum error parameter is the fifth threshold, and the target data is greater than the fifth threshold, a second error message is generated. The type of the target data is the target type, the maximum error parameter represents the maximum error value of the target type data acquired by the target sensor from the server, and the second error message indicates that the target data is greater than the maximum error value, or that the target data is abnormal.
[0103] Optionally, in this embodiment, the BMC may, but is not limited to, generate a first error message when the target data is less than a fourth threshold, and may, but is not limited to, generate a second error message when the target data is greater than a fifth threshold. It is understood that in such cases, it may be that a component of the server on which the sensor is deployed has malfunctioned, or that the data acquired by the sensor from the server has malfunctioned, for example, due to damage to the sensor.
[0104] Optionally, in this embodiment, when the target data is abnormal, the updated configuration file of the target sensor on the server can be obtained, but is not limited to, during the operation of the target sensor according to the target configuration information. The updated configuration file includes the updated configuration information of the target sensor. Based on the fourth verification information in the updated configuration file and the second verification information of the target sensor stored in the first storage space in the memory of the baseboard management controller (BMC), it is determined whether it is allowed to use the updated configuration file to update the configuration information of the target sensor. If it is determined that it is allowed to use the updated configuration file to update the configuration information of the target sensor, the target configuration information of the target sensor is updated to the updated configuration information included in the updated configuration file.
[0105] To better understand the server sensor configuration method in the embodiments of this application, the process of the server sensor configuration method in the embodiments of this application will be explained and described below in conjunction with optional embodiments, which may be applied to the embodiments of this application but is not limited to them.
[0106] Figure 5 This is a schematic diagram of an optional server sensor configuration method according to an embodiment of this application, as shown below. Figure 5 As shown, sensors 1 to 3 and a BMC may be deployed on server 202, but are not limited to this. The memory of the BMC may include, but is not limited to, a first storage space. In this case, the configuration information of the sensors may be configured through, but is not limited to, the following steps.
[0107] In step S501, engineers can, but are not limited to, fill in the data in the form, which will then be supplemented by firmware developers. The form is then imported into the configuration file. The tabular format requires minimal technical expertise and is easy to understand. Code-level processing is then performed.
[0108] Step S502: Add a systemd service unit. After the device is powered on, start the unit to execute the sensor configuration handler (check_sensor).
[0109] In step S503, the check_sensor handler first loads the configuration. When loading the sensor, it first searches the sensor_configs directory and traverses and parses all configuration files (e.g., CSV files) in the directory. If the traversal and parsing are complete, it generates a flag file usr / share / sensors_configs / probe_file.json, which indicates that all CSV files in the directory have been traversed and parsed.
[0110] Step S504: Confirm probe data. If there is any, check whether there is second verification information (e.g., key and value data) on its dbus (equivalent to the first storage space). If they do not correspond (equivalent to updating the target sensor's configuration information to the target configuration information included in the target configuration file when it is determined that the target configuration information is not allowed to be updated using the target configuration file), then do not parse other data in that line (equivalent to target configuration information).
[0111] Step S505: Interpret other data and determine if it is permissible to update the configuration information of the target sensor using the target configuration file. Then, update the configuration information of the target sensor to the target configuration information included in the target configuration file.
[0112] Step S506: Based on the bus and addr in the target configuration information, find the driver node (equivalent to the second storage space) of the sensor data (equivalent to the initial data). If not found, the sensor value is N / A.
[0113] Step S507: After reading the sensor data from the second storage space, perform data scaling calculation. For example, determine the target data by multiplying the sensor data and the target scaling factor.
[0114] In step S508, the sensor value (equivalent to target data) and other configuration data are saved to the corresponding dbus interface (equivalent to the first storage location in the first storage space).
[0115] Step S509: If the device (e.g., BMC) restarts, there is no need for a second traversal because of the existence of the probe_file.json file. The target configuration information in the cache of dbus data (equivalent to the storage location in the first storage space) is directly loaded.
[0116] In step S510, the probe_file.json file stores the names of the loaded sensors, making it easy to query which sensors have been loaded.
[0117] In step S511, during the debugging process, you can directly replace or modify the target configuration file, then delete the probe_file.json file, and restart the systemd service to load the sensor configuration (equivalent to the target configuration information) and read the sensor data.
[0118] The method in this embodiment uses a single configuration file (e.g., a .csv file) for everything from hardware information to importing into the code and then interpreting sensor attributes during device startup, making the configuration file easier to interpret. Adding a sensor configuration requires obtaining hardware information (sensor attributes), generating a configuration file based on the sensor information, and then interpreting the configuration file at the code level. The interpreted data and the read sensor values are cached in the BMC's memory. The device sensor value is read based on the sensor attributes (generated sensor path) and compared with the sensor attribute value (e.g., a target threshold). Normally, the sensor is within the threshold range; in case of an anomaly, an alarm is triggered if the threshold is exceeded. The configuration file (e.g., a .csv file) is similar to a spreadsheet when opened in Windows. The spreadsheet information is predefined based on the sensor attribute values. When the EE engineer generates the sensor spec, the corresponding configuration file is generated according to predetermined rules. The BMC firmware developer renames or splits multiple sensor configuration files based on the spreadsheet information and directly copies them to the code configuration directory for use. The code interprets and loads the configuration from the CSV file according to predetermined rules.
[0119] This approach saves development time and reduces labor costs. Furthermore, resources are readily available, eliminating the need for additional scripts to generate configuration files. The configuration files can also be used with spreadsheet applications, making them easier to interpret. Formulas can be directly defined within the spreadsheet to calculate expected values, making the process extremely convenient.
[0120] 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.
[0121] This embodiment also provides a sensor configuration device for a server, which is used to implement the above embodiments and preferred embodiments; details already described 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 device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0122] Figure 6 This is a structural block diagram of a sensor configuration device for a server according to an embodiment of this application, such as... Figure 6 As shown, the device includes:
[0123] The first acquisition module 602 is used to acquire the target configuration file of the target sensor on the server, wherein the target configuration file includes the target configuration information of the target sensor;
[0124] The first determining module 604 is used to determine whether it is permissible to use the target configuration file to update the configuration information of the target sensor based on the first verification information in the target configuration file and the second verification information of the target sensor stored in the first storage space in the memory of the baseboard management controller (BMC).
[0125] The update module 606 is used to update the configuration information of the target sensor to the target configuration information included in the target configuration file when it is determined that updating the configuration information of the target sensor using the target configuration file is allowed.
[0126] In this embodiment, when configuring the sensor configuration information of a server, the system first determines whether updating the sensor information using the configuration file is allowed based on the verification information in the configuration file and the sensor's verification information stored in the BMC memory. If updating the sensor configuration information using the configuration file is allowed, it indicates that the configuration file is the correct configuration file for the sensor. In this case, the sensor configuration information is updated to the configuration information included in the configuration file. This method avoids configuring the sensor with incorrect configuration information and allows updating the sensor configuration information using only one configuration file. Therefore, it solves the problem of low configuration efficiency for server sensors, thereby improving the overall configuration efficiency of server sensors.
[0127] In one exemplary embodiment, the first determining module includes:
[0128] An extraction unit is used to extract the target interface identifier of the target interface and the first sensor identifier of the target sensor included in the target configuration file, wherein the first verification information includes the target interface identifier and the first sensor identifier;
[0129] An acquisition unit is configured to acquire a second sensor identifier from a first storage location in the first storage space through the target interface indicated by the target interface identifier, wherein the second verification information includes the second sensor identifier, and a set of interfaces and a set of storage locations in the first storage space are pre-set to correspond to each other, wherein one of the interfaces in the set of interfaces is used to acquire the sensor identifier at a corresponding storage location in the first storage space.
[0130] The determining unit is configured to determine, based on the first sensor identifier and the second sensor identifier, whether it is permissible to use the target configuration file to update the configuration information of the target sensor.
[0131] In one exemplary embodiment, the determining unit is configured to:
[0132] If the first sensor identifier and the second sensor identifier are the same, it is determined that the target configuration file can be used to update the configuration information of the target sensor.
[0133] In one exemplary embodiment, the update module includes:
[0134] An update unit is configured to update the configuration information of the target sensor stored in the first storage space to the target configuration information included in the target configuration file. The first storage space is used to store sensor identifiers with corresponding relationships and configuration information of the sensors represented by the sensor identifiers. The sensor identifiers with corresponding relationships and configuration information of the sensors represented by the sensor identifiers include the sensor identifiers of the target sensors with corresponding relationships and the configuration information of the target sensors.
[0135] In one exemplary embodiment, the updating unit is used for at least one of the following:
[0136] When the configuration information of the target sensor includes a first parameter and the target configuration information includes a target threshold, the value of the first parameter stored in the first storage space is updated to the target threshold, wherein the value of the first parameter is used to represent the threshold of data that the target sensor is allowed to acquire;
[0137] When the configuration information of the target sensor includes a second parameter and the target configuration information includes a target bus address, the value of the second parameter stored in the first storage space is updated to the target bus address. The value of the second parameter is used to represent the bus address of the bus corresponding to the target sensor. Different bus addresses of the bus correspond to different storage locations in the second storage space of the BMC's memory. The target sensor is configured to store the initial data obtained from the server in the second storage location in the second storage space of the BMC's memory through the target bus address. The target bus address and the second storage location have a corresponding relationship.
[0138] When the configuration information of the target sensor includes a third parameter and the target configuration information includes a target scaling factor, the value of the third parameter stored in the first storage space is updated to the target scaling factor. The value of the third parameter is used to represent the scaling factor of the target sensor. The target scaling factor is used to determine the target data obtained by the target sensor by multiplying the obtained data by the target scaling factor when the BMC obtains data from the corresponding storage location in the second storage space through the bus address represented by the value of the second parameter.
[0139] In one exemplary embodiment, the updating unit is used for at least one of the following:
[0140] When the first parameter includes a standard parameter and the target threshold includes a first threshold, the value of the standard parameter is updated to the first threshold, wherein the value of the standard parameter is used to represent the standard value of the target type data of the server acquired by the target sensor, and the type of the target data is the target type;
[0141] When the first parameter includes a minimum alarm parameter and the target threshold includes a second threshold, the value of the minimum alarm parameter is updated to the second threshold. The type of the target data is the target type. The value of the minimum alarm parameter is used to represent the minimum alarm value of the target type data of the server acquired by the target sensor. The BMC is set to generate a first alarm message when the target data is less than the minimum alarm value. The first alarm message is used to indicate that the target data is less than the minimum alarm value.
[0142] When the first parameter includes a maximum alarm parameter and the target threshold includes a third threshold, the value of the maximum alarm parameter is updated to the third threshold. Here, the type of the target data is the target type, and the value of the maximum alarm parameter is used to represent the maximum alarm value of the target type data of the server acquired by the target sensor. The BMC is set to generate a second alarm message when the target data is greater than the maximum alarm value. The second alarm message is used to indicate that the target data is greater than the maximum alarm value.
[0143] When the first parameter includes a minimum error parameter and the target threshold includes a fourth threshold, the value of the minimum error parameter is updated to the fourth threshold. Here, the type of the target data is the target type, and the value of the minimum error parameter is used to represent the minimum error value of the target type data of the server acquired by the target sensor. The BMC is set to generate a first error message when the target data is less than the minimum error value. The first error message is used to indicate that the target data is less than the minimum error value, or that the target data is abnormal.
[0144] When the first parameter includes a maximum error parameter and the target threshold includes a fifth threshold, the value of the maximum error parameter is updated to the fifth threshold. Here, the type of the target data is the target type, and the value of the maximum error parameter is used to represent the maximum error value of the target type data of the server acquired by the target sensor. The BMC is set to generate second error information when the target data is greater than the maximum error value. The second error information is used to indicate that the target data is greater than the maximum error value, or that the target data is abnormal.
[0145] In one exemplary embodiment, the device further includes:
[0146] The second acquisition module is used to acquire the initial data of the server through the target sensor during the operation of the server after the configuration information of the target sensor is updated to the target configuration information included in the target configuration file, and store the initial data in the second storage space in the memory of the BMC.
[0147] The second determining module is used to determine the product of the initial data and the target scaling factor as the target data obtained by the target sensor when the target bus address and target scaling factor are obtained from the first storage space in the memory of the BMC and the initial data are obtained from the second storage space through the target bus address.
[0148] The third determining module is used to determine whether to generate a prompt message based on the target data and the target threshold when the target threshold included in the target configuration information is obtained from the first storage space in the memory of the BMC.
[0149] In one exemplary embodiment, the third determining module includes at least one of the following:
[0150] The first generation unit is configured to generate a first alarm message when the target threshold includes a second threshold, the minimum alarm parameter is the value of the second threshold, and the target data is less than the second threshold. The target data is of type target, the minimum alarm parameter is used to represent the minimum alarm value of the target type data of the server obtained by the target sensor, and the first alarm message is used to indicate that the target data is less than the minimum alarm value.
[0151] The second generation unit is used to generate second alarm information when the target threshold includes a third threshold, the maximum alarm parameter is the third threshold, and the target data is greater than the third threshold. The target data is of the target type, the maximum alarm parameter is used to represent the maximum alarm value of the target type data of the server obtained by the target sensor, and the second alarm information is used to indicate that the target data is greater than the maximum alarm value.
[0152] The third generation unit is configured to generate first error information when the target threshold includes a fourth threshold, the minimum error parameter is the fourth threshold, and the target data is less than the fourth threshold. The target data is of the target type, the minimum error parameter is used to represent the minimum error value of the target type data of the server obtained by the target sensor, and the first error information is used to indicate that the target data is less than the minimum error value, or that the target data is abnormal.
[0153] The fourth generation unit is configured to generate second error information when the target threshold includes a fifth threshold, the maximum error parameter is the fifth threshold, and the target data is greater than the fifth threshold. The target data is of the target type, the maximum error parameter represents the maximum error value of the target type data acquired by the target sensor from the server, and the second error information indicates that the target data is greater than the maximum error value, or that the target data is abnormal.
[0154] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0155] 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.
[0156] 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.
[0157] 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.
[0158] 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.
[0159] 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.
[0160] 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 those presented here, 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.
[0161] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A method for configuring sensors on a server, characterized in that, include: Obtain the target configuration file of the target sensor on the server, wherein the target configuration file includes the target configuration information of the target sensor; Based on the first verification information in the target configuration file and the second verification information of the target sensor stored in the first storage space in the memory of the baseboard management controller (BMC), it is determined whether it is permissible to use the target configuration file to update the configuration information of the target sensor. If it is determined that updating the configuration information of the target sensor is permitted using the target configuration file, the configuration information of the target sensor is updated to the target configuration information included in the target configuration file; The step of determining whether to allow updating the configuration information of the target sensor using the target configuration file, based on the first verification information in the target configuration file and the second verification information of the target sensor stored in the first storage space in the memory of the baseboard management controller (BMC), includes: Extract the target interface identifier of the target interface and the first sensor identifier of the target sensor from the target configuration file, wherein the first verification information includes the target interface identifier and the first sensor identifier; The second sensor identifier is obtained from the first storage location in the first storage space through the target interface indicated by the target interface identifier, wherein the second verification information includes the second sensor identifier, and a set of interfaces and a set of storage locations in the first storage space are pre-set to correspond to each other, and one of the interfaces in the set of interfaces is used to obtain the sensor identifier at the corresponding storage location in the first storage space. Based on the first sensor identifier and the second sensor identifier, determine whether it is permissible to use the target configuration file to update the configuration information of the target sensor; The method further includes, after updating the configuration information of the target sensor to the target configuration information included in the target configuration file: During the operation of the server, initial data of the server is acquired through the target sensor and stored in the second storage space in the memory of the BMC; When the target bus address and target scaling factor included in the target configuration information are obtained from the first storage space in the memory of the BMC, and the initial data is obtained from the second storage space through the target bus address, the product of the initial data and the target scaling factor is determined as the target data obtained by the target sensor. If the target threshold included in the target configuration information is obtained from the first storage space in the memory of the BMC, it is determined whether to generate a prompt message based on the target data and the target threshold.
2. The method according to claim 1, characterized in that, The step of determining whether to allow updating the configuration information of the target sensor using the target configuration file based on the first sensor identifier and the second sensor identifier includes: If the first sensor identifier and the second sensor identifier are the same, it is determined that the target configuration file can be used to update the configuration information of the target sensor.
3. The method according to claim 1, characterized in that, The step of updating the configuration information of the target sensor to the target configuration information included in the target configuration file includes: The configuration information of the target sensor stored in the first storage space is updated to the target configuration information included in the target configuration file. The first storage space is used to store sensor identifiers with corresponding relationships and the configuration information of the sensors represented by the sensor identifiers. The sensor identifiers with corresponding relationships and the configuration information of the sensors represented by the sensor identifiers include the sensor identifiers of the target sensors with corresponding relationships and the configuration information of the target sensors.
4. The method according to claim 3, characterized in that, Updating the configuration information of the target sensor stored in the first storage space to the target configuration information included in the target configuration file includes at least one of the following: When the configuration information of the target sensor includes a first parameter and the target configuration information includes a target threshold, the value of the first parameter stored in the first storage space is updated to the target threshold, wherein the value of the first parameter is used to represent the threshold of data that the target sensor is allowed to acquire; When the configuration information of the target sensor includes a second parameter and the target configuration information includes a target bus address, the value of the second parameter stored in the first storage space is updated to the target bus address. The value of the second parameter is used to represent the bus address of the bus corresponding to the target sensor. Different bus addresses of the bus correspond to different storage locations in the second storage space of the BMC's memory. The target sensor is configured to store the initial data obtained from the server in the second storage location of the second storage space of the BMC's memory through the target bus address. The target bus address and the second storage location have a corresponding relationship. When the configuration information of the target sensor includes a third parameter and the target configuration information includes a target scaling factor, the value of the third parameter stored in the first storage space is updated to the target scaling factor. The value of the third parameter is used to represent the scaling factor of the target sensor. The target scaling factor is used to determine the target data obtained by the target sensor by multiplying the obtained data by the target scaling factor when the BMC obtains data from the corresponding storage location in the second storage space through the bus address represented by the value of the second parameter.
5. The method according to claim 4, characterized in that, Updating the value of the first parameter stored in the first storage space to the target threshold includes at least one of the following: When the first parameter includes a standard parameter and the target threshold includes a first threshold, the value of the standard parameter is updated to the first threshold, wherein the value of the standard parameter is used to represent the standard value of the target type data of the server acquired by the target sensor, and the type of the target data is the target type; When the first parameter includes a minimum alarm parameter and the target threshold includes a second threshold, the value of the minimum alarm parameter is updated to the second threshold. The type of the target data is the target type. The value of the minimum alarm parameter is used to represent the minimum alarm value of the target type data of the server acquired by the target sensor. The BMC is set to generate a first alarm message when the target data is less than the minimum alarm value. The first alarm message is used to indicate that the target data is less than the minimum alarm value. When the first parameter includes a maximum alarm parameter and the target threshold includes a third threshold, the value of the maximum alarm parameter is updated to the third threshold. Here, the type of the target data is the target type, and the value of the maximum alarm parameter is used to represent the maximum alarm value of the target type data of the server acquired by the target sensor. The BMC is set to generate a second alarm message when the target data is greater than the maximum alarm value. The second alarm message is used to indicate that the target data is greater than the maximum alarm value. When the first parameter includes a minimum error parameter and the target threshold includes a fourth threshold, the value of the minimum error parameter is updated to the fourth threshold. Here, the type of the target data is the target type, and the value of the minimum error parameter is used to represent the minimum error value of the target type data of the server acquired by the target sensor. The BMC is set to generate a first error message when the target data is less than the minimum error value. The first error message is used to indicate that the target data is less than the minimum error value, or that the target data is abnormal. When the first parameter includes a maximum error parameter and the target threshold includes a fifth threshold, the value of the maximum error parameter is updated to the fifth threshold. Here, the type of the target data is the target type, and the value of the maximum error parameter is used to represent the maximum error value of the target type data of the server acquired by the target sensor. The BMC is set to generate second error information when the target data is greater than the maximum error value. The second error information is used to indicate that the target data is greater than the maximum error value, or that the target data is abnormal.
6. The method according to claim 1, characterized in that, The step of determining whether to generate a prompt message based on the target data and the target threshold includes at least one of the following: When the target threshold includes a second threshold, the minimum alarm parameter is set to the second threshold, and the target data is less than the second threshold, a first alarm message is generated. The type of the target data is a target type, the minimum alarm parameter is used to represent the minimum alarm value of the target type data of the server obtained by the target sensor, and the first alarm message is used to indicate that the target data is less than the minimum alarm value. When the target threshold includes a third threshold, the maximum alarm parameter is the third threshold, and the target data is greater than the third threshold, a second alarm message is generated. The type of the target data is the target type, the maximum alarm parameter is used to represent the maximum alarm value of the target type data of the server obtained by the target sensor, and the second alarm message is used to indicate that the target data is greater than the maximum alarm value. When the target threshold includes a fourth threshold, the minimum error parameter is the fourth threshold, and the target data is less than the fourth threshold, a first error message is generated. The type of the target data is the target type. The minimum error parameter represents the minimum error value of the target type data acquired by the target sensor from the server. The first error message indicates that the target data is less than the minimum error value, or that the target data is abnormal. When the target threshold includes a fifth threshold, the maximum error parameter is set to the fifth threshold, and the target data is greater than the fifth threshold, a second error message is generated. The type of the target data is the target type. The maximum error parameter represents the maximum error value of the target type data acquired by the target sensor from the server. The second error message indicates that the target data is greater than the maximum error value, or that the target data is abnormal.
7. A sensor configuration device for a server, characterized in that, include: The first acquisition module is used to acquire the target configuration file of the target sensor on the server, wherein the target configuration file includes the target configuration information of the target sensor; The first determining module is used to determine whether to allow the target sensor's configuration information to be updated using the target configuration file, based on the first verification information in the target configuration file and the second verification information of the target sensor stored in the first storage space in the memory of the baseboard management controller (BMC). An update module is used to update the configuration information of the target sensor to the target configuration information included in the target configuration file when it is determined that updating the configuration information of the target sensor using the target configuration file is permitted. The first determining module includes: An extraction unit is used to extract the target interface identifier of the target interface and the first sensor identifier of the target sensor included in the target configuration file, wherein the first verification information includes the target interface identifier and the first sensor identifier; An acquisition unit is configured to acquire a second sensor identifier from a first storage location in the first storage space through the target interface indicated by the target interface identifier, wherein the second verification information includes the second sensor identifier, and a set of interfaces and a set of storage locations in the first storage space are pre-set to correspond to each other, wherein one of the interfaces in the set of interfaces is used to acquire the sensor identifier at a corresponding storage location in the first storage space. The determining unit is configured to determine, based on the first sensor identifier and the second sensor identifier, whether it is permissible to use the target configuration file to update the configuration information of the target sensor; The device further includes: The second acquisition module is used to acquire the initial data of the server through the target sensor during the operation of the server after the configuration information of the target sensor is updated to the target configuration information included in the target configuration file, and store the initial data in the second storage space in the memory of the BMC. The second determining module is used to determine the product of the initial data and the target scaling factor as the target data obtained by the target sensor when the target bus address and target scaling factor are obtained from the first storage space in the memory of the BMC and the initial data are obtained from the second storage space through the target bus address. The third determining module is used to determine whether to generate a prompt message based on the target data and the target threshold when the target threshold included in the target configuration information is obtained from the first storage space in the memory of the BMC.
8. 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 method described in any one of claims 1 to 6.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 6.