Sensor data management method, device, computer equipment and storage medium

By configuring an independent data interface for each sensor and using three interfaces to obtain sensor type, name and data, the problem of performance degradation when a single interface acquires sensor data is solved, and efficient data query and storage are achieved.

CN119045918BActive Publication Date: 2025-02-14INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411528833.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-14
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

The prior art acquires sensor data through a single interface, resulting in performance degradation and slower response when the number of sensors increases or the recording time is extended.

Method used

The sensor type, sensor name and mapping relationship are obtained through three independent interfaces, as well as the target data of the target sensor, and an independent data interface is configured for each sensor to improve data query efficiency.

Benefits of technology

It improves the efficiency of sensor data query, improves user experience, adapts to specific needs and saves storage space, and solves the problems of poor performance and slow response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119045918B_ABST
    Figure CN119045918B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of server technology, and discloses a sensor data management method, device, computer equipment and storage medium, the method comprising: obtaining a sensor type in a sensor configuration file through a first interface, wherein the sensor configuration file is used to record the configuration information of the sensor; obtaining a sensor name of the sensor through a second interface, and determining a mapping relationship between the sensor type and the sensor name; obtaining target data of a target sensor in a sensor data file through a third interface, wherein the target sensor is determined according to the sensor type and the sensor name, the sensor data file is used to record the historical data of the sensor, and the target data is included in the historical data of the sensor; and displaying the sensor type, sensor name and target data. The present invention solves the problem of poor performance and slow response when obtaining and displaying sensor data through a single interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] The historical data of BMC (Baseboard Management Controller) sensors is very important for server management and maintenance. By analyzing historical data, abnormal changes in server temperature, voltage and other parameters can be discovered, so as to timely discover potential hardware failures of the server. In addition, long-term recorded sensor data can help identify trends in server performance degradation or precursors to failures. Sensor data can also be used to predict future resource requirements of the server, help with capacity planning, automatically adjust system configurations, and generate system health reports, so that technical support personnel can better understand the status of the server and take timely measures to solve problems and prevent failures.

[0003] Recording the data of BMC sensors is crucial to ensure the stable operation of the server and improve availability and reliability. However, in the process of managing sensor data, the historical data of all sensors is obtained through a single interface. When the number of sensors increases or the recording time is prolonged, the performance of the front-end calling this interface to display historical data decreases and the response becomes slow.

[0004] Therefore, the related technology has the problem of poor performance and slow response when acquiring sensor data through a single interface and acquiring and displaying sensor data. Summary of the invention

[0005] In view of this, the present invention provides a sensor data management method, apparatus, computer device and storage medium to solve the problem of poor performance and slow response when acquiring sensor data through a single interface and acquiring and displaying sensor data.

[0006] In a first aspect, the present invention provides a sensor data management method, comprising:

[0007] Obtaining a sensor type from a sensor configuration file through a first interface, wherein the sensor configuration file is used to record configuration information of the sensor;

[0008] Obtaining a sensor name of the sensor through the second interface, and determining a mapping relationship between the sensor type and the sensor name;

[0009] Obtaining target data of a target sensor in a sensor data file through a third interface, wherein the target sensor is determined according to a sensor type and a sensor name, the sensor data file is used to record historical data of the sensor, and the target data is included in the historical data of the sensor;

[0010] Displays sensor type, sensor name, mapping relationship, and target data.

[0011] The sensor data management method provided in this embodiment obtains the sensor type through the first interface, obtains the sensor names of all sensors under the sensor type through the second interface, and obtains the target data of the target sensor in the sensor data file through the third interface. An independent data interface is configured for each sensor to improve data query efficiency and improve user experience. The user can specify the target sensor by sensor type and sensor name, and then obtain the target data of the target sensor required by the user, thereby improving data query efficiency, improving user experience, adapting to specific needs and saving storage space, and facilitating fault analysis of sensor data. The problem of poor performance and slow response when obtaining and displaying sensor data through a single interface is solved.

[0012] In some optional implementations, before obtaining the sensor type in the sensor configuration file through the first interface, the method further includes:

[0013] Get the configuration information of the sensor;

[0014] Determining a preset number of attribute information of each sensor in the configuration information;

[0015] Generate a key-value pair corresponding to each attribute information and save the key-value pair to the sensor configuration file.

[0016] In this embodiment, a preset number of attribute information of each sensor is determined according to the configuration information of the sensor, a key-value pair corresponding to each attribute information is generated, and saved in the sensor configuration file. The user can adjust the configuration information of the sensor in the sensor configuration file to configure which sensor data can be recorded in the memory of the BMC when the server has no external storage card, and can also change the way of obtaining sensors from active acquisition to signal trigger mode to save system resources. In addition, flexible configuration options are provided in the sensor configuration file, which supports setting the sampling time and recording frequency for each sensor separately to meet specific needs and save storage space.

[0017] In some optional implementations, before acquiring the target data of the target sensor in the sensor data file through the third interface, the method further includes:

[0018] Get the target configuration information of the sensor in the sensor configuration file;

[0019] Determine whether there is an attribute value of a first preset attribute in the target configuration information, wherein the first preset attribute is used to determine a time interval for obtaining historical data;

[0020] If the attribute value of the first preset attribute exists, determining the time interval according to the attribute value of the first preset attribute;

[0021] According to the time interval, the historical data of the sensor is obtained from the message bus, and the historical data is written into a preset container, wherein the preset container is used to temporarily store the historical data.

[0022] In this embodiment, flexible configuration options are provided in the sensor configuration file. By configuring the attribute value of the first preset attribute, the sampling time and recording frequency for acquiring sensor data are modified to adapt to specific needs and save storage space.

[0023] In some optional implementations, after determining whether the target configuration information contains an attribute value of the first preset attribute, the method further includes:

[0024] If the attribute value does not exist, determining whether a data change signal is received, wherein the data change signal is sent by a signal trigger of the sensor when the data of the sensor changes;

[0025] If a data change signal is received, the historical data of the sensor is obtained from the message bus and the historical data is written into a preset container.

[0026] In this implementation, by not configuring the first preset attribute in the sensor configuration file, the sensor acquisition mode is changed from active acquisition to signal trigger mode, thereby saving system resources and having a simpler configuration method.

[0027] In some optional implementations, after writing the historical data into the preset container, the method further includes:

[0028] After a preset time, determine the maximum value, the minimum value, and the average value of the historical data in the preset container, and determine a first current time;

[0029] Determine whether there is a newly added directory, wherein the newly added directory is used to determine whether there is an external storage card;

[0030] If there is a newly added directory, write the maximum value, the minimum value, the average value and the first current time into a first data file under the newly added directory, wherein if there is a newly added directory, the first data file is a sensor data file;

[0031] If there is no newly added directory, the maximum value, the minimum value, the average value and the first current time are written into a second data file under a preset directory, wherein if there is no newly added directory, the second data file is a sensor data file.

[0032] In some optional implementations, obtaining historical data of the sensor from the message bus includes:

[0033] Obtain the sensor's path information, interface information, and attribute information in the sensor configuration file;

[0034] Acquire service information of the sensor through a first preset algorithm, path information, and interface information;

[0035] According to the second preset algorithm, service information, path information, interface information and attribute information, historical data of the sensor is obtained from the message bus.

[0036] In some optional implementations, before determining whether a newly added directory exists, the method further includes:

[0037] Determine whether the server has an external storage card;

[0038] If an external storage card exists, a new directory is generated in the external storage card, and a first data file is created in the new directory;

[0039] If the external memory card does not exist, a second data file is created in a preset directory.

[0040] In this embodiment, depending on whether the server has an external storage card, a data file is created in a newly added directory or a preset directory, and the acquired sensor data is subsequently serialized into the data file, so that regardless of whether the server has an external storage card, the user can choose to record the historical data of each sensor, and the user is allowed to configure which sensor data can be recorded in the BMC's memory when there is no external storage card.

[0041] In some optional implementations, writing the maximum value, the minimum value, the average value, and the first current time into the first data file in the newly added directory includes:

[0042] determining a second current time;

[0043] Determine whether there is first data to be deleted in the first data file, wherein the first data to be deleted is data corresponding to a first intermediate time, and the first intermediate time is a first current time whose interval with the second current time is greater than a first preset threshold;

[0044] Deleting the first data to be deleted in the first data file, and writing the maximum value, the minimum value, the average value and the first current time into the first data file;

[0045] The maximum value, the minimum value, the average value and the first current time are written into the second data file in the preset directory, including:

[0046] determining a second current time;

[0047] Determine whether there is second data to be deleted in the second data file, wherein the second data to be deleted is data corresponding to a second intermediate time, and the second intermediate time is a first current time whose interval with the second current time is greater than a second preset threshold;

[0048] Deleting the second data to be deleted in the second data file, and writing the maximum value, the minimum value, the average value and the first current time into the second data file;

[0049] Determine whether the attribute value of the second preset attribute of the historical data in the second data file is a preset value;

[0050] If the attribute value of the second preset attribute is a preset value, the historical data in the second data file is recorded in the memory of the baseboard management controller.

[0051] In this embodiment, by setting the first preset threshold and the second preset threshold respectively, the data in the first data file whose interval with the second current time exceeds the first preset threshold is deleted, and the data in the second data file whose interval with the second current time exceeds the second preset threshold is deleted, so as to control the amount of historical data recorded in the first data file and the second data file, and save storage space. In addition, the user can set which sensor data is recorded in the memory of the BMC when there is no external storage card by configuring the attribute value of the second preset attribute.

[0052] In some optional embodiments, the method further comprises:

[0053] Determine the preset path, where the data under the preset path will not be cleared by the initialization script;

[0054] The paths of the first data file and the second data file are configured as preset paths.

[0055] In this embodiment, by configuring the paths of the first data file and the second data file to be preset paths, the initialization script is prevented from clearing the data of the first data file and the second data file. The function of restoring factory settings is improved to ensure that historical data is retained for subsequent analysis.

[0056] In some optional implementations, acquiring target data of the target sensor in the sensor data file through the third interface includes:

[0057] calling a third preset algorithm through a third interface;

[0058] Filtering target data from the sensor data file according to a third preset algorithm, the sensor type, and the sensor name;

[0059] Deserialize the target data into the memory of the baseboard management controller.

[0060] In some optional implementations, the sensor type, sensor name, mapping relationship, and target data are displayed, including:

[0061] Create a display page corresponding to the sensor type;

[0062] According to the sensor type to which the sensor corresponding to the sensor name belongs, determine the display page corresponding to the sensor name, and display the sensor name and the mapping relationship on the corresponding display page;

[0063] Determine the target display page based on the sensor type and sensor name corresponding to the target data;

[0064] Use the target display page to display target data.

[0065] In this embodiment, a display page corresponding to the sensor type is created, and the display page is used to display each sensor type, the sensor name under each sensor type, and the acquired target data, so that the user can analyze the target data and better understand the status of the server.

[0066] In some optional implementations, using a target display page to display target data includes:

[0067] Get the start time and end time of the data to be displayed in the target display page;

[0068] The data whose first current time in the target data is between the start time and the end time is used as the data to be displayed;

[0069] Use the target display page to display the data to be displayed.

[0070] In this embodiment, by setting the start time and end time of the data to be displayed in the target display page, the target data is filtered, and the data of a certain period of time in the target data is used as the data to be displayed, so that users can query sensor data according to their needs.

[0071] In a second aspect, the present invention provides a sensor data management device, comprising:

[0072] A first acquisition module, configured to acquire a sensor type from a sensor configuration file through a first interface, wherein the sensor configuration file is used to record configuration information of the sensor;

[0073] A second acquisition module, used to acquire a sensor name of the sensor through a second interface, and determine a mapping relationship between the sensor type and the sensor name;

[0074] A third acquisition module is used to acquire target data of a target sensor in a sensor data file through a third interface, wherein the target sensor is determined according to a sensor type and a sensor name, the sensor data file is used to record historical data of the sensor, and the target data is included in the historical data of the sensor;

[0075] The display module is used to display sensor type, sensor name, mapping relationship and target data.

[0076] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the sensor data management method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0077] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the sensor data management method of the first aspect or any corresponding embodiment thereof.

[0078] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the sensor data management method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0080] Figure 1 is a flow chart of a sensor data management method according to an embodiment of the present invention;

[0081] Figure 2 is an interactive flow chart of a process of acquiring sensor data and a process of displaying sensor data according to an embodiment of the present invention;

[0082] Figure 3 is a flow chart showing sensor historical data according to an embodiment of the present invention;

[0083] Figure 4 is a structural block diagram of a sensor data management device according to an embodiment of the present invention;

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

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

[0086] Recording the historical data of BMC sensors is essential to ensure the stable operation of the server and improve the availability and reliability. With these sensor data, administrators can better understand the status of the server and take timely measures to solve problems and prevent failures. For example, by analyzing sensor data, abnormal changes in the temperature, voltage and other parameters of the server can be found, so as to timely discover potential hardware failures in the server. In addition, long-term recorded sensor data can help identify trends in server performance degradation or precursors to failures. Data such as CPU (Central Processing Unit) usage and memory occupancy in sensor data can help evaluate the load and resource allocation of the server, and can also predict future resource requirements and help with capacity planning. Determining the power consumption trend of the server through sensor data can determine energy-saving strategies and reduce energy consumption. Based on sensor data, more accurate maintenance plans can be formulated to avoid unnecessary downtime. Based on sensor data, the historical load pattern of the server can be determined and the server system configuration can be automatically adjusted to improve performance and efficiency. Various temperature data in sensor data can be used to adjust fan speed and reduce noise levels. System health reports are generated regularly based on sensor data. Administrators use this health report to review the system status and provide detailed system operation records to technical support personnel for troubleshooting.

[0087] In the current process of managing sensor data, although the function of recording sensor historical data can be realized and displayed on the front end, when the server does not have an external storage card, only the historical data of the air inlet sensor can be obtained and recorded, and it cannot be expanded to other sensors, and it is impossible to configure which sensor data can be recorded in the BMC memory. The sampling time of all sensor data is fixed, for example: once every 10 seconds, and the recording time is fixed to once every hour. The sampling time and recording time cannot be configured separately for different sensors. The historical data of all sensors are obtained through a single interface. When the number of sensors increases or the recording time is extended, the performance of the front end calling this interface to display historical data degrades and the response becomes slow. When restoring the BMC factory settings, the historical data of all sensors will be cleared, resulting in the inability to use historical data for fault analysis. In addition, the current solution frequently obtains sensor data, resulting in excessive consumption of server system resources. High-frequency data reading increases the burden of network communication and processing, which may cause delays or data loss. For a large number of sensors, this frequent polling mechanism will cause significant performance bottlenecks.

[0088] Based on the above content, an embodiment of the present invention provides a sensor data management method, which records the sensor historical data of OpenBMC, and draws the sensor historical data into a curve and displays it on the front end. Allow users to configure which sensor data can be recorded in the BMC memory when there is no external storage card. Provide flexible configuration options, support setting the sampling time and recording frequency for each sensor separately to adapt to specific needs and save storage space. Configure an independent data interface for each sensor to improve data query efficiency and improve user experience. Improve the function of restoring factory settings to ensure that historical data is retained for subsequent analysis. Actively obtain all sensor data and change it to signal trigger mode. When the value of each sensor changes, the signal change will be received to update the sensor data. In order to achieve the effect of improving data query efficiency, improving user experience, adapting to specific needs and saving storage space, the sensor data is saved to facilitate fault analysis of the sensor data.

[0089] According to an embodiment of the present invention, a sensor data management embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer device with data processing capabilities, such as a computer, a server, etc., and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0090] In this embodiment, a sensor data management method is provided, which can be used in the above-mentioned computer device. Figure 1 is a flow chart of a sensor data management method according to an embodiment of the present invention. Figure 1As shown, the process includes the following steps:

[0091] Step S101: Obtain a sensor type in a sensor configuration file through a first interface, wherein the sensor configuration file is used to record configuration information of the sensor.

[0092] Specifically, this embodiment develops a new process history-record, through which sensor data is collected and recorded in a sensor data file. In addition, three methods are added to the history-record process, namely, getSensorType method, getSensorNamesBySensorType method and collectHistoryData method, wherein the getSensorType method is used to obtain all sensor types (sensor type) in the sensor configuration file; the getSensorNamesBySensorType method is used to return the sensor names (sensor name) of all sensors under the sensor type according to the parameters of a determined sensor type; the collectHistoryData method is used to deserialize all sensor data recorded in the sensor data file into the memory of the BMC. In addition, the memory has the characteristic of losing data when power is lost, so when the BMC is restarted or powered on again, the collectHistoryData method will deserialize the sensor data in the sensor data file into the memory.

[0093] In this embodiment, three new redfish interfaces are added in redfish. The implementation of the redfish interface is implemented by the bmcweb process. The bmcweb process is used to display sensor data on the front end. Redfish is a standard interface specification for managing and monitoring servers and related infrastructure. The three redfish interfaces are: interface 1, interface 2, and interface 3.

[0094] The getSensorType method is called through the first interface (such as interface 1) to obtain all sensor types (sensor type) in the sensor configuration file, such as voltage, temperature, occupancy, power, etc. In this embodiment, the configuration information of all sensors is recorded in the sensor configuration file.

[0095] The above process is as follows Figure 2As shown, the getSensorType method, getSensorNamesBySensorType method, and collectHistoryData method are created in the bmcweb process; in the bmcweb process, the redfish interface 1 calls the getSensorType method to return all sensor types.

[0096] Step S102: acquiring a sensor name of the sensor through the second interface, and determining a mapping relationship between the sensor type and the sensor name.

[0097] Specifically, the getSensorNamesBySensorType method is called through the second interface (such as interface 2), sensors belonging to the same category are put together according to the sensor type, the sensor names of all sensors under the sensor type are obtained, and the mapping relationship between the sensor type and the sensor name is determined. For example, the sensor type is temperature, and the sensor names include TEMPsensor1, TEMPsensor2, etc. The mapping relationship includes TEMPsensor1 corresponding to temperature, that is, the sensor type of the sensor named TEMPsensor1 is temperature, and TEMPsensor2 corresponds to temperature, that is, the sensor type of the sensor named TEMPsensor2 is temperature.

[0098] The above process is as follows Figure 2 As shown, redfish interface 2 calls getSensorNamesBySensorType to put sensors of the same type together according to the sensor type.

[0099] Step S103, obtaining target data of the target sensor in the sensor data file through the third interface, wherein the target sensor is determined according to the sensor type and the sensor name, the sensor data file is used to record the historical data of the sensor, and the target data is included in the historical data of the sensor.

[0100] Specifically, the historical data of the sensor is the sensor data. CollectHistoryData is called through the third interface (such as interface 3), the target sensor is determined according to the sensor type and sensor name, and the sensor data of a sensor under a certain sensor type is filtered out in the sensor data file according to the sensor type and sensor name. For example, the sensor type of the target sensor is voltage, and the sensor name of the target sensor is Vsensor1. The sensor data of the target sensor, i.e., the target data, is filtered out in the sensor data file according to voltage and Vsensor1. It should be noted that the user can specify the target sensor by specifying the sensor type and sensor name of the sensor, and then obtain the target data of the target sensor through the third interface.

[0101] The above process is as follows Figure 2 As shown, redfish interface 3 calls collectHistoryData to filter out the historical data of a sensor under a certain sensor type according to the passed-in sensor type and sensor name.

[0102] Step S104, displaying sensor type, sensor name, mapping relationship and target data.

[0103] Specifically, the server front end displays the sensor type, sensor name, and target data. For example, the front end creates a page (table) on which the sensor type, sensor name, mapping relationship, and target data are displayed. In addition, the user can select a sensor name in a drop-down box in a table page to specify the target sensor.

[0104] The sensor data management method provided in this embodiment obtains the sensor type through the first interface, obtains the sensor names of all sensors under the sensor type through the second interface, and obtains the target data of the target sensor in the sensor data file through the third interface. An independent data interface is configured for each sensor to improve data query efficiency and improve user experience. The user can specify the target sensor by sensor type and sensor name, and then obtain the target data of the target sensor required by the user, thereby improving data query efficiency, improving user experience, adapting to specific needs and saving storage space, and facilitating fault analysis of sensor data. The problem of poor performance and slow response when obtaining and displaying sensor data through a single interface is solved.

[0105] In some optional implementations, before obtaining the sensor type in the sensor configuration file through the first interface, the method further includes:

[0106] Get the configuration information of the sensor;

[0107] Determining a preset number of attribute information of each sensor in the configuration information;

[0108] Generate a key-value pair corresponding to each attribute information and save the key-value pair to the sensor configuration file.

[0109] Specifically, this embodiment adds a sensor configuration file called historyRecordConfig.json. The sensor configuration file consists of an array containing multiple objects, each of which is a sensor configuration. Each sensor configuration consists of multiple key-value pairs, each of which represents a sensor attribute information. In the sensor configuration file, by default, only the name and path of the sensor need to be configured, and other attributes can be configured as default values ​​in the code.

[0110] Get the configuration information of all sensors, and determine the preset number of attribute information of each sensor in the configuration information, such as the name of the sensor, path information (path), interface information (interface), property_name (attribute name), property_type (attribute information), read_period (read interval), write_period (write interval), sensor_type (sensor type), isRecordToBMCOnNoTF (whether data should be recorded in BMC memory), etc.

[0111] Generate key-value pairs corresponding to each property information. For example: "name": "Outlet_Temp"; "path": " / xyz / openbmc_project / sensors / temperature / Outlet_Temp"; "interface": "xyz.openbmc_project.Sensor.Value"; "property_name": "Value"; "property_type": "double"; "read_period": 10; "write_period": 3600; "sensor_type": "temperature"; "isRecordToBMCOnNoTF": true. Among them, the first key-value pair is the property value of the sensor; the second key-value pair is the path of the sensor, through which the sensor reading value can be obtained from the dbus; the third key-value pair is the interface; the fourth key-value pair is the property_name, that is, the name of the property whose sensor data needs to be obtained; the fifth key-value pair is the property_type, which indicates the type of the property value, such as integer, Boolean, floating point, etc. The read_period attribute of the sixth key-value pair indicates the time interval for obtaining the sensor data through the get-property method. 10 means obtaining sensor data from the dbus once every 10 seconds (if this attribute is configured, it means actively obtaining data from the dbus every 10 seconds). 1 sensor data, do not configure this attribute, indicating signal trigger mode); the write_period attribute of the 7th key-value pair indicates the time to record sensor data into the file, 3600 means 3600 seconds, that is, 1 hour to record data into the file; the sensor_type attribute of the 8th key-value pair indicates which type the sensor belongs to, and sensor_type is obtained by separating the second to last word of the path attribute; the isRecordToBMCOnNoTF attribute of the 9th key-value pair is true, indicating that when there is no external storage card, the data of the sensor needs to be recorded into the memory of the BMC, and false means that when there is no external storage card, the data of the sensor does not need to be recorded into the memory of the BMC. It should be noted that dbus (Desktop Bus) is a message bus system, mainly used for inter-process communication (IPC). In addition, different attributes can be configured for each sensor, and different sampling times and different recording times can be configured. The sensors of key concern are configured with shorter recording times to the file, and the sensors of non-key concern are configured with longer recording times to the file, saving space.

[0112] It should be noted that in this embodiment, the attribute values ​​of the interface and property of the sensor are the same or different. You only need to write the attribute values ​​of the interface and property into the sensor configuration file. If you want to continue to add other sensor data, you can continue to add related attributes in the sensor configuration file. According to actual needs, you can add other attributes in the sensor configuration file.

[0113] In this embodiment, a preset number of attribute information of each sensor is determined according to the configuration information of the sensor, a key-value pair corresponding to each attribute information is generated, and saved in the sensor configuration file. The user can adjust the configuration information of the sensor in the sensor configuration file to configure which sensor data can be recorded in the memory of the BMC when the server has no external storage card, and can also change the way of obtaining sensors from active acquisition to signal trigger mode to save system resources. In addition, flexible configuration options are provided in the sensor configuration file, which supports setting the sampling time and recording frequency for each sensor separately to meet specific needs and save storage space.

[0114] In some optional implementations, before acquiring the target data of the target sensor in the sensor data file through the third interface, the method further includes:

[0115] Get the target configuration information of the sensor in the sensor configuration file;

[0116] Determine whether there is an attribute value of a first preset attribute in the target configuration information, wherein the first preset attribute is used to determine a time interval for obtaining historical data;

[0117] If the attribute value of the first preset attribute exists, determining the time interval according to the attribute value of the first preset attribute;

[0118] According to the time interval, the historical data of the sensor is obtained from the message bus, and the historical data is written into a preset container, wherein the preset container is used to temporarily store the historical data.

[0119] Specifically, the target configuration information of the sensor is obtained in the sensor configuration file (historyRecordConfig.json). The target configuration information represents the configuration information of each sensor, including the name of each sensor, path information (path), interface information (interface), property_name (property name), property_type (property type) and other information.

[0120] The first preset attribute, for example, the read_period attribute, determines whether there is an attribute value of the first preset attribute in the target configuration information. If it exists, it means that the user has configured the read_period attribute in the historyRecordConfig.json file, and the time interval for obtaining historical data needs to be determined according to the configured read_period attribute value. If it does not exist, it means that the user has not configured the read_period attribute, and the default mode for obtaining sensor historical data is the signal trigger mode.

[0121] If there is an attribute value of the first preset attribute, the time interval is determined according to the attribute value of the first preset attribute. For example, if the attribute value of read_period is 10 seconds, the time interval is 10 seconds.

[0122] The message bus is for example: dbus. The preset container is for example: vector, where vector is a container in C++ used to store data. According to the time interval, the historical data of the sensor is obtained from the message bus and written into the preset container.

[0123] The above process is as follows Figure 2 As shown, the history-record process reads the historyRecordConfig.json configuration file.

[0124] In this embodiment, flexible configuration options are provided in the sensor configuration file. By configuring the attribute value of the first preset attribute, the sampling time and recording frequency for acquiring sensor data are modified to adapt to specific needs and save storage space.

[0125] In some optional implementations, after determining whether the target configuration information contains an attribute value of the first preset attribute, the method further includes:

[0126] If the attribute value does not exist, determining whether a data change signal is received, wherein the data change signal is sent by a signal trigger of the sensor when the data of the sensor changes;

[0127] If a data change signal is received, the historical data of the sensor is obtained from the message bus and the historical data is written into a preset container.

[0128] Specifically, the first preset attribute is, for example, the read_period attribute. It is determined whether the attribute value of the first preset attribute exists in the target configuration information. If not, it means that the user has not configured the read_period attribute. The default mode for obtaining sensor historical data is the signal trigger mode. A signal trigger is configured for each sensor, and the signal trigger is implemented by the match method of C++.

[0129] When the sensor data changes, the sensor signal trigger will send a data change signal. When the history-record process receives the data change signal, it means that the sensor data has changed. It obtains the sensor's historical data from the message bus and writes the historical data into a preset container, such as a vector.

[0130] In this implementation, by not configuring the first preset attribute in the sensor configuration file, the sensor acquisition mode is changed from active acquisition to signal trigger mode, thereby saving system resources and having a simpler configuration method.

[0131] In some optional implementations, after writing the historical data into the preset container, the method further includes:

[0132] After a preset time, determine the maximum value, the minimum value, and the average value of the historical data in the preset container, and determine a first current time;

[0133] Determine whether there is a newly added directory, wherein the newly added directory is used to determine whether there is an external storage card;

[0134] If there is a newly added directory, write the maximum value, the minimum value, the average value and the first current time into a first data file under the newly added directory, wherein if there is a newly added directory, the first data file is a sensor data file;

[0135] If there is no newly added directory, the maximum value, the minimum value, the average value and the first current time are written into a second data file under a preset directory, wherein if there is no newly added directory, the second data file is a sensor data file.

[0136] Specifically, the preset time is, for example, 3600 seconds, 4800 seconds, or other time that meets actual needs. The preset time can be modified by modifying the attribute value of the write_period attribute in the sensor configuration file.

[0137] After a preset time, the maximum value, minimum value and average value of all historical data in a preset container (vector) are calculated, and a first current time is determined, which represents the time when the maximum value, minimum value and average value are written into the first data file or the second data file.

[0138] This embodiment adds a new writeSensorValue method, which serializes the maximum value, minimum value, and average value together with the first current time into a data file. It should be noted that serializing data into a file means converting the data in the memory into a persistent format and saving it to a file. Serialization is the process of converting a data structure or object state into a format that can be stored or transmitted. Typically, the serialized data can be in text or binary form for easy storage, transmission, and recovery.

[0139] An example of a new directory is: / tf-card / histroyRecord. An example of a preset directory is: / histroyRecord. Determine whether there is a new directory. The new directory is generated when there is an external storage card on the server. Therefore, if there is a new directory, it means that there is an external storage card on the server. WriteSensorValue writes the maximum value, minimum value, average value and the first current time to the first data file under the new directory, for example: serialized to / tf-card / histroyRecord / data.json. If there is no new directory, it means that the server does not have an external storage card. WriteSensorValue writes the maximum value, minimum value, average value and the first current time to the second data file under the preset directory, for example: serialized to / histroyRecord / data.json. The file names of the first data file and the second data file are both data.json. The first data file and the second data file represent data.json files in different directories.

[0140] It should be noted that if there is a new directory, it means that the server has an external storage card, and the first data file is a sensor data file; if there is no new directory, it means that the server has an external storage card, and the second data file is a sensor data file.

[0141] In some optional implementations, obtaining historical data of the sensor from the message bus includes:

[0142] Obtain the sensor's path information, interface information, and attribute information in the sensor configuration file;

[0143] Acquire service information of the sensor through a first preset algorithm, path information, and interface information;

[0144] According to the second preset algorithm, service information, path information, interface information and attribute information, historical data of the sensor is obtained from the message bus.

[0145] Specifically, the path information (path), interface information (interface), and property information (property_type) of the sensor are obtained in the sensor configuration file.

[0146] The first preset algorithm, for example, may call an algorithm of the GetObject method of systemd, where the GetObject method is used to obtain information about a management object.

[0147] The GetObject method of systemd is called through the first preset algorithm to pass the path information and interface information of the sensor. The first parameter returned by the GetObject method is the service where the sensor is located, that is, the service information of the sensor.

[0148] The second preset algorithm is, for example, an algorithm that can call the get-property method of busctl, and the message bus is, for example, a dubs bus. With the service, path, interface, and property, the get-property method is called using the second preset algorithm to obtain the historical data of the sensor from the dbus bus.

[0149] It should be noted that you can get the value of a property by calling the get-property method of busctl. For example, if you want to get the value of the total power consumption (Total_Power), use the following method: busctl get-propertyxyz.openbmc_project.VirtualSensor / xyz / openbmc_project / sensors / power / Total_Power xyz.openbmc_project.Sensor.ValueValue d 217.125. Wherein, busctl is a command line tool for debugging D-Bus, which provides a series of commands for enumerating service object structures, viewing bus connections, obtaining service status, obtaining interface attribute information, and calling interface methods; xyz.openbmc_project.VirtualSensor is the attribute value of service, / xyz / openbmc_project / sensors / power / Total_Power is the attribute value of path, xyz.openbmc_project.Sensor.Value is the attribute value of interface, Value is the attribute value of the property to be obtained, d 217.125 is the return value of the command, and d represents the double type. Therefore, to obtain the value of a property through the get-property method, it is necessary to provide the attribute value of the property to be obtained, the attribute value of the interface, the attribute value of the path, and the attribute value of the service. In this embodiment, the attribute value of the property is the same as the attribute value of the interface, but the attribute value of the path is different from the attribute value of the service.

[0150] The above process is as follows Figure 2 As shown, the history-record process calls the GetObject method to obtain the service of a sensor; according to the configuration file and the passed-in service, get-property obtains the sensor data from dbus, and writeSensorValue serializes the data into a json file.

[0151] In some optional implementations, before determining whether a newly added directory exists, the method further includes:

[0152] Determine whether the server has an external storage card;

[0153] If an external storage card exists, a new directory is generated in the external storage card, and a first data file is created in the new directory;

[0154] If the external memory card does not exist, a second data file is created in a preset directory.

[0155] Specifically, the BMC will automatically check whether the server has an external storage card when it starts. If the server has an external storage card, a new directory is generated in the external storage card. If the new directory is generated, it means there is an external storage card, otherwise it means there is no external storage card. For example, the new directory is / tf-card / histroyRecord, and the first data file created in the new directory is / tf-card / histroyRecord / data.json.

[0156] The preset directory is, for example, / histroyRecord. If there is no external storage card, a second data file is created in the preset directory, for example, / histroyRecord / data.json.

[0157] In this embodiment, depending on whether the server has an external storage card, a data file is created in a newly added directory or a preset directory, and the acquired sensor data is subsequently serialized into the data file, so that regardless of whether the server has an external storage card, the user can choose to record the historical data of each sensor, and the user is allowed to configure which sensor data can be recorded in the BMC's memory when there is no external storage card.

[0158] In some optional implementations, writing the maximum value, the minimum value, the average value, and the first current time into the first data file in the newly added directory includes:

[0159] determining a second current time;

[0160] Determine whether there is first data to be deleted in the first data file, wherein the first data to be deleted is data corresponding to a first intermediate time, and the first intermediate time is a first current time whose interval with the second current time is greater than a first preset threshold;

[0161] Deleting the first data to be deleted in the first data file, and writing the maximum value, the minimum value, the average value and the first current time into the first data file;

[0162] The maximum value, the minimum value, the average value and the first current time are written into the second data file in the preset directory, including:

[0163] determining a second current time;

[0164] Determine whether there is second data to be deleted in the second data file, wherein the second data to be deleted is data corresponding to a second intermediate time, and the second intermediate time is a first current time whose interval with the second current time is greater than a second preset threshold;

[0165] Deleting the second data to be deleted in the second data file, and writing the maximum value, the minimum value, the average value and the first current time into the second data file;

[0166] Determine whether the attribute value of the second preset attribute of the historical data in the second data file is a preset value;

[0167] If the attribute value of the second preset attribute is a preset value, the historical data in the second data file is recorded in the memory of the baseboard management controller.

[0168] Specifically, this embodiment uses the above-mentioned history-record process to collect sensor data and record the data into a data file.

[0169] The first data file can record 10 years of historical data. Depending on the storage situation of the external memory card, the recording period of the first data file can be further increased. The second data file can record 1 year of historical data. When the first data file and the second data file have recorded the corresponding years of historical data, when recording historical data again, the first-in-first-out feature of the queue will be adopted to pop out the earliest data and then record the latest data.

[0170] The process of writing the maximum value, minimum value, average value and the first current time into the first data file includes: determining the second current time. The first preset threshold is, for example, 10 years. Determine whether there is a first intermediate time in the first data file whose interval with the second current time is greater than the first preset threshold. If so, use the data corresponding to the first intermediate time as the first data to be deleted. After deleting the first data to be deleted in the first data file, write the maximum value, minimum value, average value and the first current time into the first data file. At this time, there is a new directory, indicating that the server has an external storage card. When there is an external storage card, the BMC will ignore the isRecordToBMCOnNoTF (whether the data should be recorded in the BMC memory) attribute in the sensor configuration file (historyRecordConfig.json), and the BMC will record all configured sensor data in historyRecordConfig.json.

[0171] The process of writing the maximum value, minimum value, average value and the first current time into the second data file includes: determining the second current time. The second preset threshold is, for example, 1 year. Determine whether there is a second intermediate time in the second data file whose interval with the second current time is greater than the second preset threshold. If so, use the data corresponding to the second intermediate time as the second data to be deleted. After deleting the second data to be deleted in the second data file, write the maximum value, minimum value, average value and the first current time into the second data file. At this time, there is no new directory, which means that there is no external storage card on the server. The BMC (baseboard management controller) needs to determine which historical data to record into the memory of the baseboard management controller according to the isRecordToBMCOnNoTF (whether the data should be recorded in the BMC memory) attribute in the sensor configuration file (historyRecordConfig.json).

[0172] The second preset attribute is, for example, the isRecordToBMCOnNoTF attribute. The isRecordToBMCOnNoTF attribute has an attribute value of true, which means that when there is no external storage card, the data of the sensor needs to be recorded in the memory of the BMC. The attribute value is false, which means that when there is no external storage card, the data of the sensor does not need to be recorded in the memory of the BMC. Determine whether the attribute value of the second preset attribute of the historical data in the second data file is a preset value, such as true. If the attribute value of the second preset attribute is a preset value, record the historical data in the second data file in the memory of the baseboard management controller.

[0173] In this embodiment, by setting the first preset threshold and the second preset threshold respectively, the data in the first data file whose interval with the second current time exceeds the first preset threshold is deleted, and the data in the second data file whose interval with the second current time exceeds the second preset threshold is deleted, so as to control the amount of historical data recorded in the first data file and the second data file, and save storage space. In addition, the user can set which sensor data is recorded in the memory of the BMC when there is no external storage card by configuring the attribute value of the second preset attribute.

[0174] In some optional embodiments, the method further comprises:

[0175] Determine the preset path, where the data under the preset path will not be cleared by the initialization script;

[0176] The paths of the first data file and the second data file are configured as preset paths.

[0177] Specifically, the initialization script is, for example, the init script. The init script refers to a series of initialization scripts that run during the Linux system startup process. They are responsible for initializing system services and processes. When upgrading the BMC firmware or restoring the BMC factory settings, the init script will be used to clear the contents of the rw partition. The rw partition is used to store BMC variable data and user configurations, such as various log information, newly created users and passwords, etc.

[0178] Therefore, in order to prevent the historical data of the sensor from being cleared when the BMC is upgraded or restored to factory settings, the paths of the first data file and the second data file need to be configured.

[0179] Determine the preset path, which is the default reserved path. The data under the preset path will not be cleared by the initialization script. Configure the path of the first data file and the second data file to the preset path, for example: configure / histroyRecord / data.json and / tf-card / histroyRecord / data.json as the default reserved path, so that when the BMC is upgraded or restored to factory settings, the historical data in the first data file and the second data file will not be cleared.

[0180] In this embodiment, by configuring the paths of the first data file and the second data file to be preset paths, the initialization script is prevented from clearing the data of the first data file and the second data file. The function of restoring factory settings is improved to ensure that historical data is retained for subsequent analysis.

[0181] In some optional implementations, acquiring target data of the target sensor in the sensor data file through the third interface includes:

[0182] calling a third preset algorithm through a third interface;

[0183] Filtering target data from the sensor data file according to a third preset algorithm, the sensor type, and the sensor name;

[0184] Deserialize the target data into the memory of the baseboard management controller.

[0185] Specifically, the third preset algorithm is called through the third interface (such as interface 3), and the third preset algorithm is, for example, an algorithm capable of executing the collectHistoryData method. The third preset algorithm executes the collectHistoryData method, determines the target sensor according to the sensor type and the sensor name, and filters out the sensor data of a certain sensor under a certain sensor type in the sensor data file according to the sensor type and the sensor name. For example, if the sensor type of the target sensor is voltage and the sensor name of the target sensor is Vsensor1, the sensor data of the target sensor, i.e., the target data, is filtered out in the sensor data file according to the voltage and Vsensor1.

[0186] In addition, collectHistoryData deserializes the target data into the memory of the BMC (Baseboard Management Controller). And, because the memory has the characteristic of losing data when power is off, when the BMC is restarted or powered on again, collectHistoryData will deserialize the historical data in the sensor data file into the memory of the BMC.

[0187] The above process is as follows Figure 2 As shown, the collectHistoryData method deserializes from the JSON file into memory.

[0188] In some optional implementations, the sensor type, sensor name, mapping relationship, and target data are displayed, including:

[0189] Create a display page corresponding to the sensor type;

[0190] According to the sensor type to which the sensor corresponding to the sensor name belongs, determine the display page corresponding to the sensor name, and display the sensor name and the mapping relationship on the corresponding display page;

[0191] Determine the target display page based on the sensor type and sensor name corresponding to the target data;

[0192] Use the target display page to display target data.

[0193] Specifically, according to all sensor types returned by the getSensorType method, create a display page (table page) corresponding to each sensor type. For example, the sensor types returned by getSensorType include voltage, temperature, utilization, power, etc., so the corresponding table pages of voltage, temperature, utilization, and power are created on the front end as display pages.

[0194] According to the getSensorNamesBySensorType method, the sensor names of all sensors under a certain sensor type can be obtained. The sensor names of the same sensor type need to be put together and displayed on the corresponding display page. Therefore, according to the sensor type to which the sensor name corresponds, the display page corresponding to the sensor name is determined. For example, if the sensor name is Vsensor1 and the sensor type is voltage, the corresponding display page is the voltage table page. The sensor name is displayed on the corresponding display page, and the mapping relationship between the sensor name and the sensor type is displayed on the corresponding display page. For example, the voltage table page will show that the sensor type is voltage, and that Vsensor1 corresponds to voltage, that is, Vsensor1 is the name of the sensor whose sensor type is voltage.

[0195] Determine the target display page based on the sensor type and sensor name corresponding to the target data. For example, if the target data is voltage data, the sensor type corresponding to the target data is voltage, and the sensor name is Vsensor1, then the target display page is the voltage table page. Use the target display page to display the target data, for example, draw the target as a curve and display it on the target display page at the front end.

[0196] In this embodiment, a display page corresponding to the sensor type is created, and the display page is used to display each sensor type, the sensor name under each sensor type, and the acquired target data, so that the user can analyze the target data and better understand the status of the server.

[0197] In some optional implementations, using a target display page to display target data includes:

[0198] Get the start time and end time of the data to be displayed in the target display page;

[0199] The data whose first current time in the target data is between the start time and the end time is used as the data to be displayed;

[0200] Use the target display page to display the data to be displayed.

[0201] Specifically, in each display page (table page), there are start time boxes and end time boxes that can be filtered. The start time box can be used to set the start time of the data to be displayed, and the end time box can be used to set the end time of the data to be displayed. For example, the front end only displays the historical data of the sensor within the preset time period by default, and the preset time period is, for example, the last 24 hours. At this time, the end time of the end time box is the current BMC time, which changes with the change of the current BMC time. The start time is the end time minus 24 hours, which will also change with the change of the end time. Therefore, even with the change of time, the front end can only display 24 hours of historical data by default.

[0202] You can set different start and end times by operating the start time box and the end time box, and use the data whose first current time in the target data is between the start and end time as the data to be displayed. You can filter the target data, use the data of a certain period of time in the target data as the data to be displayed, and display these data to be displayed on the target display page. In addition, you can also download and save the data to be displayed locally.

[0203] It should be noted that the above-mentioned operation of displaying the data to be displayed is implemented by the webui process. The webui (Web User Interface) process refers to the process responsible for providing the Web user interface in a computer system, server, network device or other hardware device.

[0204] The above process is as follows Figure 3 As shown, the webui process calls redfish interface 1 to create the corresponding table page, and calls interface 2 to group sensors of the same sensor type. The front end displays the historical data of the last 24 hours by default. In a table page, select the drop-down box and select the sensor name. Call redfish interface 3 to obtain the historical data of a certain sensor name.

[0205] In this embodiment, by setting the start time and end time of the data to be displayed in the target display page, the target data is filtered, and the data of a certain period of time in the target data is used as the data to be displayed, so that users can query sensor data according to their needs.

[0206] In some optional implementations, after the target data of the target sensor is acquired in step S103, it is possible to determine whether the server has a fault based on the target data, and determine a fault handling strategy after determining that a fault has occurred. The specific process includes steps A1 to A5.

[0207] Step A1, create a target data analysis module and a fault handling module.

[0208] Step A2: The target data analysis module determines whether the sensor data in the target data exceeds the set threshold, and determines whether there are abnormal keywords in the BMC log and whether the server has a downtime.

[0209] Step A3: the target data analysis module determines whether the CPU, memory and hard disk usage of each server in the target data exceeds the corresponding usage threshold.

[0210] Step A4, the target data analysis module determines whether there is an abnormality in the operating system log, and when an abnormality occurs, determines whether the abnormality is a repairable abnormality or an unrepairable abnormality.

[0211] Step A5: The fault processing module determines the type of fault information and determines the corresponding fault processing strategy.

[0212] Specifically, when the fault information is that the server is down, the fault handling module searches for the server downtime handling strategy, and calls the BMC restful interface through the server session to power on and off the server and restart it. When the fault information is that the temperature sensor data exceeds the temperature threshold, the fault handling module searches for the temperature sensor fault handling strategy, and calls the BMC restful interface through the server session to automatically increase the fan speed. When the fault information is that the CPU, memory, and hard disk usage exceeds the corresponding usage threshold, the fault handling module searches for the hardware usage overlimit handling strategy, logs in to the operating system through ssh to forcibly kill the abnormal process with excessive resource utilization, and limits the CPU frequency to protect the server hardware. When the fault information is that the server operating system crashes, the fault handling module automatically installs the operating system through the PXE interface. When the fault information is a BMC error, the fault handling module refreshes the BMC firmware or restores the BMC factory settings through the KCS interface. When the fault information is that the server hard disk is damaged, the fault handling module searches for the hard disk replacement control strategy, and outputs an alarm message to indicate the replacement of the damaged hard disk. When there is no processing strategy in the fault handling resource pool for the fault information, the fault handling module automatically notifies the server operation and maintenance personnel by phone or text message.

[0213] In this embodiment, by analyzing the target data, determining whether the server has a fault, and determining the fault handling strategy after determining that the fault has occurred, large-scale server cluster management is achieved, the server operation status is monitored in real time, server faults are repaired in time, the normal operation of the server is ensured, and the human monitoring cost is reduced. In addition, the method design principle is reliable, the structure is simple, and it has a very broad application prospect.

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

[0215] This embodiment provides a sensor data management device, such as Figure 4 As shown, including:

[0216] A first acquisition module 401 is used to acquire a sensor type in a sensor configuration file through a first interface, wherein the sensor configuration file is used to record configuration information of the sensor;

[0217] A second acquisition module 402, configured to acquire a sensor name of the sensor through a second interface, and determine a mapping relationship between a sensor type and a sensor name;

[0218] A third acquisition module 403 is used to acquire target data of a target sensor in a sensor data file through a third interface, wherein the target sensor is determined according to a sensor type and a sensor name, the sensor data file is used to record historical data of the sensor, and the target data is included in the historical data of the sensor;

[0219] The display module 404 is used to display the sensor type, sensor name, mapping relationship and target data.

[0220] In some optional implementations, before obtaining the sensor type in the sensor configuration file through the first interface, the apparatus is configured to:

[0221] Get the configuration information of the sensor;

[0222] Determining a preset number of attribute information of each sensor in the configuration information;

[0223] Generate a key-value pair corresponding to each attribute information and save the key-value pair to the sensor configuration file.

[0224] In some optional implementations, before acquiring the target data of the target sensor in the sensor data file through the third interface, the apparatus is further configured to:

[0225] Get the target configuration information of the sensor in the sensor configuration file;

[0226] Determine whether there is an attribute value of a first preset attribute in the target configuration information, wherein the first preset attribute is used to determine a time interval for obtaining historical data;

[0227] If the attribute value of the first preset attribute exists, determining the time interval according to the attribute value of the first preset attribute;

[0228] According to the time interval, the historical data of the sensor is obtained from the message bus, and the historical data is written into a preset container, wherein the preset container is used to temporarily store the historical data.

[0229] In some optional implementations, after determining whether the attribute value of the first preset attribute exists in the target configuration information, the device is further configured to:

[0230] If the attribute value does not exist, determining whether a data change signal is received, wherein the data change signal is sent by a signal trigger of the sensor when the data of the sensor changes;

[0231] If a data change signal is received, the historical data of the sensor is obtained from the message bus and the historical data is written into a preset container.

[0232] In some optional implementations, after writing the historical data into the preset container, the device is further configured to:

[0233] After a preset time, determine the maximum value, the minimum value, and the average value of the historical data in the preset container, and determine a first current time;

[0234] Determine whether there is a newly added directory, wherein the newly added directory is used to determine whether there is an external storage card;

[0235] If there is a newly added directory, write the maximum value, the minimum value, the average value and the first current time into a first data file under the newly added directory, wherein if there is a newly added directory, the first data file is a sensor data file;

[0236] If there is no newly added directory, the maximum value, the minimum value, the average value and the first current time are written into a second data file under a preset directory, wherein if there is no newly added directory, the second data file is a sensor data file.

[0237] In some optional implementations, the device obtains historical data of the sensor from the message bus, including:

[0238] Obtain the sensor's path information, interface information, and attribute information in the sensor configuration file;

[0239] Acquire service information of the sensor through a first preset algorithm, path information, and interface information;

[0240] According to the second preset algorithm, service information, path information, interface information and attribute information, historical data of the sensor is obtained from the message bus.

[0241] In some optional implementations, before determining whether a newly added directory exists, the device is further configured to:

[0242] Determine whether the server has an external storage card;

[0243] If an external storage card exists, a new directory is generated in the external storage card, and a first data file is created in the new directory;

[0244] If the external memory card does not exist, a second data file is created in a preset directory.

[0245] In some optional implementations, the device writes the maximum value, the minimum value, the average value, and the first current time into a first data file in a newly added directory, including:

[0246] determining a second current time;

[0247] Determine whether there is first data to be deleted in the first data file, wherein the first data to be deleted is data corresponding to a first intermediate time, and the first intermediate time is a first current time whose interval with the second current time is greater than a first preset threshold;

[0248] Deleting the first data to be deleted in the first data file, and writing the maximum value, the minimum value, the average value and the first current time into the first data file;

[0249] The device writes the maximum value, the minimum value, the average value and the first current time into a second data file in a preset directory, including:

[0250] determining a second current time;

[0251] Determine whether there is second data to be deleted in the second data file, wherein the second data to be deleted is data corresponding to a second intermediate time, and the second intermediate time is a first current time whose interval with the second current time is greater than a second preset threshold;

[0252] Deleting the second data to be deleted in the second data file, and writing the maximum value, the minimum value, the average value and the first current time into the second data file;

[0253] Determine whether the attribute value of the second preset attribute of the historical data in the second data file is a preset value;

[0254] If the attribute value of the second preset attribute is a preset value, the historical data in the second data file is recorded in the memory of the baseboard management controller.

[0255] In some optional embodiments, the device method further comprises:

[0256] Determine the preset path, where the data under the preset path will not be cleared by the initialization script;

[0257] The paths of the first data file and the second data file are configured as preset paths.

[0258] In some optional implementations, the third acquisition module 403 acquires the target data of the target sensor in the sensor data file through the third interface, including:

[0259] calling a third preset algorithm through a third interface;

[0260] Filtering target data from the sensor data file according to a third preset algorithm, the sensor type, and the sensor name;

[0261] Deserialize the target data into the memory of the baseboard management controller.

[0262] In some optional implementations, the display module 404 displays the sensor type, sensor name, mapping relationship and target data, including:

[0263] Create a display page corresponding to the sensor type;

[0264] According to the sensor type to which the sensor corresponding to the sensor name belongs, determine the display page corresponding to the sensor name, and display the sensor name and the mapping relationship on the corresponding display page;

[0265] Determine the target display page based on the sensor type and sensor name corresponding to the target data;

[0266] Use the target display page to display target data.

[0267] In some optional implementations, the display module 404 displays the target data using the target display page, including:

[0268] Get the start time and end time of the data to be displayed in the target display page;

[0269] The data whose first current time in the target data is between the start time and the end time is used as the data to be displayed;

[0270] Use the target display page to display the data to be displayed.

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

[0272] The sensor data management device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0273] The embodiment of the present invention also provides a computer device having the above Figure 4 The sensor data management device shown.

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

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

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

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

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

[0279] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

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

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

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

Claims

1. A sensor data management method, characterized in that: The method comprises: Obtaining a sensor type from a sensor configuration file through a first interface, wherein the sensor configuration file is used to record configuration information of the sensor; Acquire a sensor name of the sensor through a second interface, and determine a mapping relationship between the sensor type and the sensor name; Obtain target configuration information of the sensor in the sensor configuration file; determine whether there is an attribute value of a first preset attribute in the target configuration information, wherein the first preset attribute is used to determine a time interval for obtaining historical data of the sensor; if there is an attribute value of the first preset attribute, determine the time interval according to the attribute value of the first preset attribute; according to the time interval, obtain the historical data of the sensor from a message bus, and write the historical data into a preset container, wherein the preset container is used to temporarily store the historical data; Acquire target data of a target sensor in a sensor data file through a third interface, wherein the target sensor is determined according to the sensor type and the sensor name, the sensor data file is used to record the historical data of the sensor, and the target data is included in the historical data of the sensor; The sensor type, the sensor name, the mapping relationship, and the target data are displayed.

2. The method according to claim 1, characterized in that Before acquiring the sensor type in the sensor configuration file through the first interface, the method further includes: Obtaining configuration information of the sensor; Determining a preset number of attribute information of each of the sensors in the configuration information; Generate a key-value pair corresponding to each attribute information, and save the key-value pair to the sensor configuration file.

3. The method according to claim 1, characterized in that After determining whether the target configuration information contains an attribute value of the first preset attribute, the method further includes: If the attribute value of the first preset attribute does not exist, determining whether a data change signal is received, wherein the data change signal is sent by a signal trigger of the sensor when the data of the sensor changes; If the data change signal is received, the historical data of the sensor is acquired from the message bus, and the historical data is written into a preset container.

4. The method according to claim 1 or 3, characterized in that: After writing the historical data into a preset container, the method further includes: After a preset time, determining a maximum value, a minimum value, and an average value of the historical data in the preset container, and determining a first current time; Determining whether there is a newly added directory, wherein the newly added directory is used to determine whether there is an external storage card; If the newly added directory exists, write the maximum value, the minimum value, the average value, and the first current time into a first data file under the newly added directory, wherein if the newly added directory exists, the first data file is the sensor data file; If the newly added directory does not exist, the maximum value, the minimum value, the average value and the first current time are written into a second data file under a preset directory, wherein if the newly added directory does not exist, the second data file is the sensor data file.

5. The method according to claim 1 or 3, characterized in that: The acquiring the historical data of the sensor from the message bus includes: Acquire path information, interface information, and attribute information of the sensor in the sensor configuration file; Acquire the service information of the sensor through a first preset algorithm, the path information and the interface information; The historical data of the sensor is acquired from the message bus according to a second preset algorithm, the service information, the path information, the interface information and the attribute information.

6. The method according to claim 4, characterized in that Before determining whether a newly added directory exists, the method further includes: Determine whether the server has an external storage card; If the external memory card exists, generating the newly added directory in the external memory card, and creating the first data file under the newly added directory; If the external memory card does not exist, the second data file is created in the preset directory.

7. The method according to claim 4, characterized in that The step of writing the maximum value, the minimum value, the average value, and the first current time into the first data file in the newly added directory includes: determining a second current time; Determine whether there is first data to be deleted in the first data file, wherein the first data to be deleted is data corresponding to a first intermediate time, and the first intermediate time is a first current time whose interval with the second current time is greater than a first preset threshold; deleting the first data to be deleted in the first data file, and writing the maximum value, the minimum value, the average value, and the first current time into the first data file; The step of writing the maximum value, the minimum value, the average value, and the first current time into a second data file in a preset directory includes: determining the second current time; Determine whether there is second data to be deleted in the second data file, wherein the second data to be deleted is data corresponding to a second intermediate time, and the second intermediate time is a first current time whose interval with the second current time is greater than a second preset threshold; deleting the second data to be deleted in the second data file, and writing the maximum value, the minimum value, the average value, and the first current time into the second data file; Determine whether the attribute value of the second preset attribute of the historical data in the second data file is a preset value; If the attribute value of the second preset attribute is the preset value, the historical data in the second data file is recorded in the memory of the baseboard management controller.

8. The method according to claim 6, characterized in that The method further comprises: Determine a preset path, wherein the data under the preset path will not be cleared by the initialization script; The paths of the first data file and the second data file are configured as the preset paths.

9. The method according to claim 1, characterized in that: The step of acquiring target data of the target sensor in the sensor data file through the third interface includes: Calling a third preset algorithm through the third interface; Filtering the target data in the sensor data file according to the third preset algorithm, the sensor type, and the sensor name; The target data is deserialized into the memory of the baseboard management controller.

10. The method according to claim 1, characterized in that The displaying of the sensor type, the sensor name, the mapping relationship and the target data includes: Create a display page corresponding to the sensor type; According to the sensor type to which the sensor corresponding to the sensor name belongs, determining a display page corresponding to the sensor name, and displaying the sensor name and the mapping relationship on the corresponding display page; Determine a target display page according to the sensor type and the sensor name corresponding to the target data; The target data is displayed using the target display page.

11. The method according to claim 10, characterized in that The using the target display page to display the target data includes: Obtain the start time and end time of the data to be displayed in the target display page; taking data of the target data whose first current time is between the start time and the end time as data to be displayed; The target display page is used to display the data to be displayed.

12. A sensor data management device, characterized in that: The device comprises: A first acquisition module, configured to acquire a sensor type from a sensor configuration file through a first interface, wherein the sensor configuration file is used to record configuration information of the sensor; A second acquisition module, used for acquiring a sensor name of the sensor through a second interface, and determining a mapping relationship between the sensor type and the sensor name; A third acquisition module is used to acquire target data of a target sensor in a sensor data file through a third interface, wherein the target sensor is determined according to the sensor type and the sensor name, the sensor data file is used to record historical data of the sensor, and the target data is included in the historical data of the sensor; before acquiring the target data of the target sensor in the sensor data file through the third interface, it also includes: acquiring target configuration information of the sensor in the sensor configuration file; judging whether there is an attribute value of a first preset attribute in the target configuration information, wherein the first preset attribute is used to determine a time interval for acquiring historical data of the sensor; if there is an attribute value of the first preset attribute, determining the time interval according to the attribute value of the first preset attribute; acquiring the historical data of the sensor from a message bus according to the time interval, and writing the historical data into a preset container, wherein the preset container is used to temporarily store the historical data; A display module is used to display the sensor type, the sensor name, the mapping relationship and the target data.

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

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

Citation Information

Patent Citations

  • Remote monitoring system and method based on IPMI

    CN115834623A

  • Method and system for automatically adapting BMC firmware to mainboard sensor

    CN116820432A