Sensor information management method, device, system, storage medium and program product
Through the communication between the metadata storage mapping unit and the data management process of the sensor information management unit, the problems of sensor information being unable to be dynamically adjusted and multi-protocol information being out of sync are solved, and the dynamic update of sensor information and synchronization between multiple protocols are achieved.
Patent Information
- Application Number
- CN202510865350.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-06-26
AI Technical Summary
Sensor information cannot be adjusted dynamically, and information between multiple protocols is not synchronized.
The metadata storage mapping unit communicates with the data management process of the sensor information management unit to achieve dynamic update of sensor information and synchronization between multiple protocols. Information update files are used to store sensor information pairs and are updated based on target update parameters. The metadata storage mapping unit serves as the information update medium between multiple protocols.
It realizes the dynamic update of sensor information and information synchronization between multiple protocols, avoids the modification of the underlying configuration files, and improves the flexibility and consistency of sensor information management.
Smart Images

Figure CN120429199B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a sensor information management method, device, system, storage medium, and program product. Background Art
[0002] As a management device for embedded systems, the BMC (Baseboard Management Controller) needs to monitor the hardware status of the system, such as sensor data, in real time. However, the static naming rules for sensors solidify information such as sensor names during compilation, requiring modifications to the underlying configuration files. After these modifications, the system must be restarted and the configuration files loaded to synchronize the sensor information in memory, making it impossible to dynamically modify sensor information. Furthermore, for multi-protocol applications, since multiple protocols use independent data loading paths and caching mechanisms, when sensor information on one side is updated, the other protocols are unaware of the updated information, resulting in cross-protocol information asynchrony. Therefore, a sensor information management method is needed to achieve dynamic updates of sensor information and synchronization between multiple protocols. Summary of the Invention
[0003] The present application provides a sensor information management method, device, system, storage medium and program product to at least solve the problems in related technologies such as the inability to dynamically adjust sensor information and the lack of synchronization between multiple protocols.
[0004] The present application provides a sensor information management method, which is applied to a metadata storage mapping unit. The metadata storage mapping unit communicates with a data management process of each sensor information management unit. The data management process communicates with a server management interface and a storage area of the sensor information management unit.
[0005] The sensor information management method includes:
[0006] Acquire a target update parameter of a target sensor, wherein the target update parameter is sent by at least one sensor information management unit;
[0007] Based on the target update parameters, an information update file in the metadata storage mapping unit is searched and parameter information of the target sensor in the information update file is updated, wherein the information update file is used to store sensor information pairs of each sensor, and the sensor information pairs are used to represent the mapping relationship between the object path and parameter information of the sensor.
[0008] The present application also provides a sensor information management method, which is applied to a data management process of at least one sensor information management unit, wherein the data management process communicates with a metadata storage mapping unit and a server management interface and a storage area of the sensor information management unit in which it is located;
[0009] The sensor information management method includes:
[0010] In response to the information modification instruction sent by the corresponding server management interface, the information modification instruction is parsed to obtain the target update parameter of the target sensor;
[0011] Call the name update method and pass the target update parameters to the metadata storage mapping unit.
[0012] The present application also provides a sensor information management device, which is applied to a metadata storage mapping unit. The metadata storage mapping unit communicates with a data management process of each sensor information management unit, and the data management process communicates with a server management interface and a storage area of the sensor information management unit respectively;
[0013] The sensor information management device includes:
[0014] An update parameter acquisition module, configured to acquire a target update parameter of a target sensor, wherein the target update parameter is sent by at least one sensor information management unit;
[0015] The parameter information update module is used to search the information update file in the metadata storage mapping unit based on the target update parameter and update the parameter information of the target sensor in the information update file, wherein the information update file is used to store sensor information pairs of each sensor, and the sensor information pairs are used to represent the mapping relationship between the object path and parameter information of the sensor.
[0016] The present application also provides a sensor information management device, which is applied to a data management process of at least one sensor information management unit, wherein the data management process communicates with a metadata storage mapping unit and a server management interface and a storage area of the sensor information management unit in which it is located;
[0017] The sensor information management device includes:
[0018] a modification instruction parsing module, configured to respond to an information modification instruction sent by a corresponding server management interface, parse the information modification instruction, and obtain target update parameters of the target sensor;
[0019] The update parameter transfer module is used to call the name update method and transfer the target update parameters to the metadata storage mapping unit.
[0020] The present application also provides a sensor information management system, comprising: a metadata storage mapping unit and at least one sensor information management unit;
[0021] The metadata storage mapping unit communicates with the data management process of each sensor information management unit, and the data management process communicates with the server management interface and storage area of the sensor information management unit respectively;
[0022] a data management process of at least one sensor information management unit, configured to respond to an information modification instruction sent by a corresponding server management interface, parse the information modification instruction, obtain target update parameters of the target sensor, and call a name update method to pass the target update parameters to the metadata storage mapping unit;
[0023] The metadata storage mapping unit is used to obtain target update parameters, search in an information update file in the metadata storage mapping unit based on the target update parameters, and update the parameter information of the target sensor in the information update file, wherein the information update file is used to store sensor information pairs of each sensor, and the sensor information pairs are used to represent the mapping relationship between the object path and parameter information of the sensor.
[0024] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any one of the above-mentioned sensor information management methods when executing the computer program.
[0025] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned sensor information management methods are implemented.
[0026] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned sensor information management methods when executed by a processor.
[0027] This application utilizes an information update file to store sensor information pairs and updates them based on target update parameters. This allows for recording and storing sensor information updates without modifying the underlying configuration file, thereby achieving dynamic updates of sensor information. Furthermore, a metadata storage mapping unit is used to receive target update parameters of a target sensor obtained by at least one sensor information management unit, thereby utilizing the metadata storage mapping unit and its information update file as an information update medium between sensor information management units across multiple protocols, thereby achieving synchronization of sensor information updates across multiple protocols. This resolves the technical issues of sensor information not being able to be dynamically adjusted and information being out of sync across multiple protocols, achieving the technical benefits of dynamic updates of sensor information and synchronization across multiple protocols. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0029] Figure 1 This is a schematic diagram of the architecture of a sensor information management system in the related art;
[0030] Figure 2 This is a schematic diagram of the architecture of a sensor information management system provided by an embodiment of the present application;
[0031] Figure 3 This is a flow chart of a sensor information management method provided in an embodiment of the present application;
[0032] Figure 4 is a flow chart of another sensor information management method provided in an embodiment of the present application;
[0033] Figure 5 This is a flow chart of another sensor information management method provided in an embodiment of the present application;
[0034] Figure 6 1 is a flow chart of another sensor information management method provided in an embodiment of the present application;
[0035] Figure 7 This is a flow chart of a sensor information management method provided in an embodiment of the present application;
[0036] Figure 8 is a flow chart of another sensor information management method provided in an embodiment of the present application;
[0037] Figure 9This is a flow chart of another sensor information management method provided in an embodiment of the present application;
[0038] Figure 10 is a schematic diagram of a specific embodiment of a sensor information management method provided in an embodiment of the present application;
[0039] Figure 11 This is a schematic diagram of the structure of a sensor information management device provided in an embodiment of the present application;
[0040] Figure 12 This is a schematic diagram of the structure of a sensor information management device provided in an embodiment of the present application;
[0041] Figure 13 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0043] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0044] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0045] In related technologies, static naming rules are usually used to manage sensor information, and information such as the sensor name is solidified during compilation. The sensor information needs to be modified from the underlying configuration file. After the modification, the system needs to be restarted and the configuration file needs to be loaded to synchronize the sensor information in the memory in order to realize the modification of the sensor information. Therefore, the sensor information cannot be modified dynamically.
[0046] For example, with the Redfish protocol, at system startup, sensor entity information, such as the sensor's object path, name, and property definitions, is loaded from a preset JSON configuration file. This information is then updated to the DiscreteSensorList and ThresholdSensorList property lists on the DBus (Desktop Bus). When a user requests sensor data through the Redfish API, the server component directly reads these two property lists from DBus to obtain and display the sensor entity information. Related technical solutions for the Redfish protocol only support one-way reading of sensor information and cannot dynamically modify sensor information during runtime. For the IPMI (Intelligent Platform Management Interface) protocol, during the firmware compilation phase, the sensor configuration YAML file is converted into an STL (Standard Template Library) data structure and statically injected into the memory corresponding to the IPMI protocol's backend service, namely the IPmid process. However, because the YAML file is not loaded into the BMC's Flash memory chip, dynamic modification of sensor information during runtime is not possible.
[0047] At the same time, for multi-protocol application scenarios, Figure 1 This is a schematic diagram of the architecture of a sensor information management system in related technology. Figure 1 Taking the Redfish protocol and IPMI protocol as examples, multiple protocols use independent data loading paths and cache mechanisms. When one side triggers a local cache update due to a hardware status change, such as sensor plugging and unplugging, the other side cannot perceive the information update, resulting in inconsistent sensor entity information across protocols.
[0048] Based on this, the present application provides, on one hand, a sensor information management method for use in a metadata storage mapping unit, comprising: obtaining target update parameters for a target sensor, wherein the target update parameters are sent by at least one sensor information management unit; searching an information update file in the metadata storage mapping unit based on the target update parameters, and updating the parameter information of the target sensor in the information update file, wherein the information update file is used to store sensor information pairs for each sensor, and the sensor information pairs are used to represent the mapping relationship between the sensor's object path and parameter information. On the other hand, a sensor information management method is also provided for use in a data management process of at least one sensor information management unit, comprising: responding to an information modification instruction sent by a corresponding server management interface, parsing the information modification instruction to obtain the target update parameters for the target sensor; and invoking a name update method to transmit the target update parameters to the metadata storage mapping unit. Simultaneously, the metadata storage mapping unit communicates with the data management processes of each sensor information management unit, and the data management processes respectively communicate with the server management interface and storage area of the sensor information management unit. Through the above method, on the one hand, information update files are used to store sensor information pairs and the sensor information pairs therein are updated based on target update parameters. Without modifying the underlying configuration files, the updates of sensor information can be recorded and stored, thereby realizing dynamic updates of sensor information. On the other hand, a metadata storage mapping unit is used to receive the target update parameters of the target sensor obtained by at least one sensor information management unit, thereby using the metadata storage mapping unit and its information update file as information update media between sensor information management units of multiple protocols, thereby realizing synchronization of sensor information updates between multiple protocols.
[0049] Figure 2 This is a schematic diagram of the architecture of a sensor information management system provided by an embodiment of the present application. The sensor information management method provided by an embodiment of the present application can be applied to Figure 1 In the sensor information management system shown in FIG. Figure 2 As shown, the sensor information management system includes: a metadata storage mapping unit and at least one sensor information management unit. The metadata storage mapping unit communicates with the data management process of each sensor information management unit, and the data management process communicates with the server management interface and storage area of the sensor information management unit.
[0050] Among them, at least one sensor information management unit is used to respond to the information modification instruction sent by the corresponding server management interface, parse the information modification instruction, obtain the target update parameter of the target sensor, and call the name update method to pass the target update parameter to the metadata storage mapping unit; the metadata storage mapping unit is used to obtain the target update parameter of the target sensor, search the information update file based on the target update parameter, and update the parameter information of the target sensor in the information update file, wherein the information update file is used to store the sensor information pair of each sensor, and the sensor information pair is used to characterize the mapping relationship between the object path of the sensor and the parameter information.
[0051] At least one sensor information management unit is a unit that stores and manages sensor data corresponding to different protocols. The metadata storage mapping unit is independent of the sensor information management unit and serves as a transmission medium for sensor update information between sensor information management units. It receives target update parameters sent by all sensor information management units in the sensor information management system, thereby responding to and modifying sensor parameter updates issued by various protocols within the metadata storage mapping unit. Furthermore, the metadata storage mapping unit can synchronize sensor parameter updates corresponding to any sensor information management unit, i.e., any protocol, to all sensor information management units, i.e., all protocols, through communication interactions with various sensor information management units, thereby achieving synchronization of sensor information updates across multiple protocols.
[0052] In addition, the metadata storage mapping unit obtains metadata from the sensor configuration file during its initialization phase, namely, the preset sensor configuration rules and entity information, etc., extracts the relevant parameter information of the sensor based on the metadata and performs corresponding processing to obtain sensor information pairs that can correspond one-to-one with each sensor and store them in the information update file set internally, which is consistent with the initial parameter information of the sensor stored in each sensor information management unit, so that the initial parameter information of the sensor can be used as the basis for searching and matching when the sensor parameter information is updated, and the parameter information that needs to be modified and updated can be determined and modified.
[0053] In an optional embodiment, as Figure 2 As shown in the figure, each sensor information management unit can be divided into a server management interface, a storage area, and an underlying configuration file. The server management interface, storage area, and configuration file interact with each other through the data management process. The server management interface serves as the application layer, interacting with users; the storage area serves as the data layer, storing the sensor information corresponding to each sensor information management unit; and the configuration file serves as the configuration layer, providing the initial configuration of each sensor. Figure 2Taking the Redfish protocol and IPMI protocol shown in the example, the sensor information management unit using the Redfish protocol has a configuration file that is a JSON file, a storage area that is a Sensor Cache, and a server management interface that is a Redfish web page; the sensor information management unit using the IPMI protocol has a configuration file that is a YAML file, a storage area that is an IPmid Cache, and a server management interface that is an IPMITool.
[0054] In one optional embodiment, within each sensor information management unit, a storage area obtains sensor information for each sensor based on a configuration file. A server management interface queries the storage area and returns the sensor information. Information synchronization between sensor information management units is achieved through a metadata storage mapping unit. Memory mapping technology is used to synchronize data between the metadata storage mapping unit's information update file (update-sensors) and the storage areas of each sensor information management unit.
[0055] It should be noted that Figure 2 The Redfish protocol and the IPMI protocol are used as examples, but those skilled in the art know that more protocols or other protocols can be used in the sensor information management system, and the specific adjustments are made according to actual application requirements. In this application, there is no specific limitation on the number and type of protocols used.
[0056] In one aspect, embodiments of the present application provide a sensor information management method that can be used in a metadata storage mapping unit in the aforementioned sensor information management system, wherein the metadata storage mapping unit communicates with a data management process of each sensor information management unit, and the data management process communicates with a server management interface and a storage area of the sensor information management unit. Figure 3 This is a flow chart of a sensor information management method provided by an embodiment of the present application. Figure 3 As shown, the process includes the following steps:
[0057] Step S301: Acquire target update parameters of a target sensor.
[0058] In an embodiment of the present application, a target sensor is a sensor whose parameter information needs to be modified and updated by the user. The target update parameters of the target sensor are used by the metadata storage mapping unit and the sensor information management unit in the sensor information management system to locate and update the relevant information of the target sensor during the interaction and information update process. The target update parameters are sent by at least one sensor information management unit. If there are multiple sensor information management units in the sensor information management system, each of these sensor information management units can send the target update parameters to the metadata storage mapping unit. The metadata storage mapping unit, as a data processing unit independent of the sensor information management units, can obtain the sensor update parameters of all sensor information management units, thereby implementing cross-protocol sensor information updates based on the metadata storage mapping unit.
[0059] Step S302 : searching the information update file in the metadata storage mapping unit based on the target update parameter, and updating the parameter information of the target sensor in the information update file.
[0060] In an embodiment of the present application, an information update file (update-sensors file) is a file used by the metadata storage mapping unit to store updated parameter information of all sensors; the information update file is used to store sensor information pairs of each sensor, and the sensor information pairs are used to represent the mapping relationship between the object path and parameter information of the sensor, so that the metadata storage mapping unit can search according to the object path and locate the sensor information pair of the target sensor stored in the information update file.
[0061] In an embodiment of the present application, an information update file is searched based on a target update parameter to locate a sensor information pair of a target sensor in the information update file; then, based on the information update of the target sensor indicated by the target update parameter, the sensor information pair of the target sensor is modified and updated, thereby completing the update of the information update file.
[0062] In an optional embodiment, the information update file not only stores the updated parameter information of all sensors, but also stores the initial parameter information of all sensors; in the initial case, that is, after the original storage mapping unit is initialized, the sensor information pairs in the information update file are sensor information pairs constructed by the initial parameter information of all sensors in the system, so that the metadata storage mapping unit can synchronize or recover data from the information update file to each sensor information management unit.
[0063] In an optional embodiment, the sensor information management method further includes an initialization process for the metadata storage mapping unit, specifically as follows: in response to the initialization of the metadata storage mapping unit, a sensor information pair is determined based on the sensor configuration file, and the sensor information pair is stored in an information update file. The initialization of the metadata storage mapping unit is performed when the system is first started, or it can also be performed when the information update file does not exist; the sensor configuration file is a configuration file solidified during the firmware compilation phase, which contains initial parameter information for each sensor. By initializing the metadata storage mapping unit, the initial sensor information pair is stored in the information update file to synchronize the initial configuration of the sensor in the information update file. This allows, on the one hand, to accurately locate the sensor information pair of the target sensor in the information update file when the sensor information is updated, and on the other hand, facilitates data synchronization or data recovery from the information update file to each sensor information management unit.
[0064] The sensor information management method provided in the embodiments of the present application, on the one hand, uses information update files to store sensor information pairs and updates the sensor information pairs therein based on target update parameters. This allows recording and storing updates of sensor information without modifying the underlying configuration files, thereby achieving dynamic updates of sensor information. On the other hand, a metadata storage mapping unit is used to receive target update parameters of a target sensor obtained by at least one sensor information management unit, thereby using the metadata storage mapping unit and its information update file as an information update medium between sensor information management units of multiple protocols, thereby achieving synchronization of sensor information updates between multiple protocols.
[0065] In this embodiment, a sensor information management method is provided, which can be used in the metadata storage mapping unit in the above-mentioned sensor information management system. The metadata storage mapping unit communicates with the data management process of each sensor information management unit, and the data management process communicates with the server management interface and storage area of the sensor information management unit. Figure 4 This is a flow chart of another sensor information management method provided by an embodiment of the present application. Figure 4 As shown, the process includes the following steps:
[0066] Step S401: Obtain target update parameters of the target sensor. Figure 3 Step S301 of the illustrated embodiment will not be described in detail here.
[0067] Step S402: searching an information update file based on the target update parameters, and updating the parameter information of the target sensor in the information update file.
[0068] In this embodiment of the present application, the target update parameters include parameter update information and path information of the target sensor. The parameter update information represents the updated parameter information of the target sensor, which can be any sensor information that the user wants to modify, such as the sensor name, attributes, etc. The path information represents the object path of the target sensor.
[0069] Accordingly, step S402 includes:
[0070] Step S4021: Based on the path information, search and match the object path of the sensor information pair to determine the target information pair corresponding to the target sensor.
[0071] In the embodiment of the present application, based on the path information, the object path in the sensor information pair stored in the information update file is searched and matched, and the sensor information pair whose object path is consistent with the path information is determined and used as the target information pair corresponding to the target sensor.
[0072] Step S4022: Update the target information pair based on the target update parameter.
[0073] In the embodiment of the present application, based on the target update parameter, the parameter information in the target information pair is updated and replaced with the parameter update parameter.
[0074] In an optional embodiment, the sensor information pairs are stored in the information update file in the form of key-value pairs. The object path is used as the key of the key-value pair, and the parameter information is used as the value of the key-value pair, thereby forming a mapping relationship between the object path and the parameter information. For example, if the parameter information is the name of the sensor, the sensor information pair can be stored in the following manner:
[0075] "key": " / com / otrd / sensors / temperature / CPU0_Temp",
[0076] "value": "CPU0_Temp_New"
[0077] In this example, / com / otrd / sensors / temperature / CPU0_Temp is the object path of the sensor, and CPU0_Temp_New is the name of the sensor. In this example, it is the updated name of the sensor.
[0078] In an optional implementation, in order to improve data security, the sensor information pairs stored in the information update file may be encrypted. In this case, when the target information pairs are updated based on the target update parameters, the data needs to be encrypted at the same time.
[0079] In an optional embodiment, in order to reduce the storage volume of the information update file and improve the efficiency of storage resource utilization, the sensor information can be stored in the information update file in a binary format, thereby eliminating redundant characters and reducing the storage volume.
[0080] In an optional embodiment, based on the above processing of the sensor information pair, the above step S4022, updating the target information pair based on the target update parameter, may include the following steps:
[0081] Step a1: Construct a key-value pair based on the path information and parameter update information.
[0082] In step a1, the path information is used as the key of a key-value pair, and the parameter update information is used as the value of the key-value pair, and a key-value pair is constructed between the path information and the parameter update information.
[0083] Step a2: Process the key-value pairs to obtain information pairs to be updated.
[0084] In step a2, the key-value pairs are processed to obtain the information pairs to be updated, which are the information pairs that should be stored in the information update file after the parameters of the target sensor are updated. The data processing of the key-value pairs includes binary serialization and encryption.
[0085] In step a2, data processing is performed on the key-value pairs to obtain the information pairs to be updated, including: serializing the key-value pairs to obtain serialized data; and encrypting the serialized data to obtain the information pairs to be updated. The serialization of the key-value pairs is based on binary format serialization, eliminating redundant characters in the key-value pairs, such as quotation marks and commas. Cereal library binary storage can be used as a binary format serialization method to achieve smooth migration between different firmware versions, avoiding compatibility issues with traditional binary configuration files and eliminating the need to re-adapt sensor naming conventions when upgrading firmware versions. The encryption of the serialized data can include various encryption algorithms such as AES and RSA.
[0086] Step a3: Replace the target information pair with the information pair to be updated.
[0087] In step a3, the target information pair is replaced with the information pair to be updated, thereby modifying and updating the data corresponding to the target sensor in the information update file.
[0088] The sensor information management method provided in the embodiment of the present application, on the one hand, uses the object path as the key of the key-value pair and the parameter information as the value of the key-value pair, thereby forming a mapping relationship between the object path and the parameter information, and searches and matches the object path of the sensor information pair based on the path information to determine the target information pair corresponding to the target sensor, thereby ensuring that the sensor information pair corresponding to the target sensor can be accurately updated when the information update file is modified and updated, and updates the target information pair based on the target update parameters to ensure that the user's modification of the parameter information of the target sensor is synchronized to the information update file; on the other hand, when storing the sensor information pair, the key-value pair is serialized in binary format to reduce the storage volume and improve the efficiency of storage resource utilization, and the serialized data is encrypted using an encryption algorithm to improve data security.
[0089] In this embodiment, a sensor information management method is provided, which can be used in the metadata storage mapping unit in the above-mentioned sensor information management system. The metadata storage mapping unit communicates with the data management process of each sensor information management unit, and the data management process communicates with the server management interface and storage area of the sensor information management unit. Figure 5 This is a flow chart of another sensor information management method provided by an embodiment of the present application, such as Figure 5 As shown, the process includes the following steps:
[0090] Step S501: Obtain target update parameters of the target sensor. Figure 3 Step S301 of the illustrated embodiment will not be described in detail here.
[0091] Step S502: Search the information update file in the metadata storage mapping unit based on the target update parameter, and update the parameter information of the target sensor in the information update file. Figure 3 Step S302 of the illustrated embodiment will not be described in detail here.
[0092] Step S503: Based on the path information, search and match the object path of the sensor information pair to determine the positioning information of the target sensor.
[0093] In the embodiment of the present application, the positioning information is used to locate the storage location of the parameter information of the target sensor, that is, it is used for the sensor information management unit to locate the storage location of the parameter information of the target sensor in its corresponding storage area.
[0094] In an embodiment of the present application, based on the path information, the object path of the sensor information pair is searched and matched, the parameter information corresponding to the target sensor is determined, and a parameter that can uniquely locate the storage location of the parameter information of the target sensor is selected from the parameter information corresponding to the target sensor and used as the positioning information.
[0095] In an optional embodiment, positioning information can be selected from the parameter information before the update in the target information pair to ensure the consistency of the positioning information in the unupdated data of each unit in the sensor information management system, so that the positioning information can be used to accurately find and locate the storage position of the target sensor in the storage area corresponding to the sensor information management unit, avoiding the use of updated parameter information as positioning information, which may result in the inability to locate or positioning errors when searching and locating the storage position of the target sensor in the storage area corresponding to the sensor information management unit.
[0096] In an optional implementation, the name of the target sensor before updating may be selected as the positioning information.
[0097] Step S504: Generate and broadcast a sensor update signal based on the positioning information and parameter update information.
[0098] In an embodiment of the present application, a sensor update signal (UpdateSensorInfo signal) is generated based on the positioning information and the parameter update information, so that the sensor update signal carries the positioning information and the parameter update information; at the same time, the sensor update signal is broadcast to the DBus bus, so that at least one sensor information management unit in the sensor information management system can monitor the sensor update signal, so that the sensor information management unit obtains the positioning information and the parameter update information, so that the sensor information management unit can update the parameter information of the target sensor in its corresponding storage area according to the positioning information and the parameter update information, thereby realizing synchronization of sensor information updates between multiple protocols.
[0099] The sensor information management method provided in the embodiment of the present application searches and matches the object path of the sensor information pair based on the path information, determines the positioning information of the target sensor, thereby ensuring the consistency of the positioning information in the unupdated data of each unit in the sensor information management system, and can accurately search and locate the storage location of the target sensor in the storage area corresponding to the sensor information management unit using the positioning information; at the same time, a sensor update signal is generated and broadcast based on the positioning information and parameter update information, so that the sensor information management unit can monitor the sensor update signal, thereby obtaining the positioning information and parameter update information, thereby enabling the sensor information management unit to update the parameter information of the target sensor in its corresponding storage area according to the positioning information and parameter update information, thereby achieving synchronization of sensor information updates between multiple protocols.
[0100] In this embodiment, a sensor information management method is provided, which can be used in the metadata storage mapping unit in the above-mentioned sensor information management system. The metadata storage mapping unit communicates with the data management process of each sensor information management unit, and the data management process communicates with the server management interface and storage area of the sensor information management unit. Figure 6 This is a flow chart of another sensor information management method provided by an embodiment of the present application. Figure 6 As shown, the process includes the following steps:
[0101] Step S601: Obtain target update parameters of the target sensor. Figure 3 Step S301 of the illustrated embodiment will not be described in detail here.
[0102] Step S602: Search the information update file in the metadata storage mapping unit based on the target update parameter, and update the parameter information of the target sensor in the information update file. Figure 3 Step S302 of the illustrated embodiment will not be described in detail here.
[0103] Step S603: In response to the clear instruction for the system storage area, the information update file is stored in the temporary file storage area.
[0104] In an embodiment of the present application, when the system performs a factory reset or firmware upgrade, the system generates a clear instruction for the system storage area and clears the data in the system storage area. At this time, the metadata storage mapping unit responds to the clear instruction and stores the information update file in the temporary file storage area, that is, in the / tmp memory file system. The temporary file storage area is located in the data clearing whitelist. The data clearing whitelist is a whitelist for system factory reset and firmware upgrade. When the system is restored to factory settings or the firmware is upgraded, the data of the files in the data clearing whitelist will not be cleared. The information update file is stored in the temporary file storage area to prevent the data in the information update file from being cleared.
[0105] In an optional implementation, a file system mount hook function may be used to mount the information update file into a temporary file storage area.
[0106] Step S604: in response to the completion of clearing the system storage area, the information update file is restored to the storage area corresponding to the metadata storage mapping unit.
[0107] In an embodiment of the present application, after the system storage area is cleared, or after the system completes factory reset or firmware upgrade and reconfigures the system, that is, after the file system is remounted, the metadata storage mapping unit generates a response and restores the information update file from the temporary file storage area to the storage area corresponding to the metadata storage mapping unit, thereby realizing persistent storage of the information update file.
[0108] In an optional implementation, a file system mount hook function may be used to restore the information update file to the storage area corresponding to the metadata storage mapping unit.
[0109] In an optional embodiment, part of the storage area in the system's non-volatile storage area can be used as the storage area corresponding to the metadata storage mapping unit to achieve persistent storage of data in the information update file after power failure, ensuring that the sensor's parameter information update can be persistently stored in the information update file.
[0110] In an optional embodiment, after step S604, the method further includes restoring the sensor parameter information to the storage area corresponding to each sensor information management unit. Specifically, based on the sensor information pairs in the information update file, the sensor parameter information is restored to the storage area corresponding to each sensor information management unit. Memory mapping technology can be used to synchronize the parameter information corresponding to the sensor information pairs in the information update file to the storage area corresponding to each sensor information management unit. Furthermore, during data recovery, a CRC32 checksum can be used to verify data integrity and improve the reliability of sensor information updates and synchronization.
[0111] It should be noted that in the above Figure 6 In the illustrated embodiment, when the system is restored to factory settings or the firmware is upgraded, the system restarts and enters the initialization phase, and each sensor information management unit is also initialized and configured. In related technologies, the initialization and configuration of each sensor information management unit is achieved by relying on the configuration file of its corresponding protocol. That is, after the initialization and configuration are completed, the sensor parameter information stored in the storage area of each sensor information management unit is consistent with the underlying configuration file. In the sensor information management method provided in the embodiment of the present application, when each sensor information management unit is initialized and configured, the information update file restores the sensor parameter information to the storage area corresponding to each sensor information management unit through memory mapping. The sensor parameter information stored in the storage area corresponding to each sensor information management unit is consistent with the information update file. That is, after the initialization and configuration are completed, the updated sensor parameter information is stored in the storage area of each sensor information management unit. This achieves the persistence of the sensor parameter information after the firmware update or factory reset, avoiding the configuration rollback problem caused by a full disk erase.
[0112] The sensor information management method provided in the embodiment of the present application stores the information update file in a temporary file storage area when the system performs factory reset or firmware upgrade to prevent the data in the information update file from being cleared. After the system storage area is cleared, the information update file is restored from the temporary file storage area to the storage area corresponding to the metadata storage mapping unit, thereby realizing persistent storage of the information update file; at the same time, based on the sensor information pairs in the information update file, the parameter information of the sensor is restored to the storage area corresponding to each sensor information management unit, so that when each sensor information management unit is initialized and configured, the parameter information of the sensor stored in the storage area corresponding to each sensor information management unit is kept consistent with the information update file, thereby realizing persistent retention of the sensor parameter information after firmware update or factory reset, avoiding configuration rollback problems caused by full disk erasure.
[0113] On the other hand, an embodiment of the present application further provides a sensor information management method that can be used in a data management process of at least one sensor information management unit in the above-mentioned sensor information management system, wherein the data management process communicates with the metadata storage mapping unit and the server management interface and storage area of the sensor information management unit. Figure 7 This is a flow chart of a sensor information management method provided by an embodiment of the present application. Figure 7 As shown, the process includes the following steps:
[0114] Step S701: In response to an information modification instruction sent by a corresponding server management interface, the information modification instruction is parsed to obtain target update parameters of a target sensor.
[0115] In an embodiment of the present application, a user sends an information modification instruction through the service management interface of the application layer for external interaction in the sensor information management unit to instruct modification of the parameter information of the target sensor; wherein the information modification instruction includes at least the metadata storage mapping unit used in the sensor information management system and the sensor information management unit for locating and updating the relevant information of the target sensor during the interaction and information update process, that is, the target update parameters.
[0116] In an embodiment of the present application, after any sensor information management unit in the sensor information management system receives an information modification instruction through the corresponding server management interface, it responds to the received information modification instruction, parses the information modification instruction to obtain relevant information indicating the positioning and update of the target sensor, and obtains the target update parameters.
[0117] In an optional embodiment, the server management interface serves as an interface for external interaction and is responsible for sending the user's modification instructions to the sensor information management unit, as well as sending information transmitted externally by the sensor information management unit to the user, such as returning the sensor information that the user wants to view; data processing such as parsing of information modification instructions and interaction with the metadata storage mapping unit can be performed by the data management process in the sensor information management unit.
[0118] Step S702: calling the name update method and passing the target update parameters to the metadata storage mapping unit.
[0119] In the embodiment of the present application, after the target update parameters are parsed, the name update method is called to pass the target update parameters to the metadata storage mapping unit. The name update method can be the UpdateSensorName method in DBus.
[0120] In an optional embodiment, each sensor information management unit in the sensor information management system has its own external server management interface and data management process, with the server management interface and data management process corresponding one to one. Upon receiving an information modification instruction at the server management interface of a sensor information management unit, its corresponding data management process parses the instruction to obtain target update parameters and then calls a name update method to pass the target update parameters to the metadata storage mapping unit. Consequently, in the sensor information management system, modifications to sensor parameter information corresponding to any protocol can be fed back to the metadata storage mapping unit, allowing the metadata storage mapping unit to serve as an information update medium between sensor information management units of multiple protocols, thereby achieving synchronization of sensor information updates across multiple protocols.
[0121] In an optional embodiment, the sensor information management method also includes an initialization process for the sensor information management unit, specifically as follows: in response to the initialization of the sensor information management unit, determining the parameter information of the sensor based on the sensor configuration file, and storing the parameter information in the corresponding storage area; registering a signal processing function to monitor the sensor update signal.
[0122] The sensor information management unit is initialized every time the system starts up, and is also initialized when the system is restored to factory settings or the firmware is upgraded. The sensor configuration file is a configuration file solidified during the firmware compilation phase, which contains the initial parameter information of each sensor. The configuration files corresponding to the sensor information management units of different protocols are also different. For example, the configuration file corresponding to the Redfish protocol is the all_sensors configuration initialized at runtime, and the configuration file corresponding to the IPMI protocol is a YAML configuration file solidified at compile time. The configuration file corresponding to the Redfish protocol is a JSON format file, and the sensor information configuration in this configuration file can be as follows:
[0123] {
[0124] "ThresholdSensors": [
[0125] " / com / otrd / sensors / temperature / CPU0_Temp"
[0126] ],
[0127] "DiscreteSensors": [ ]
[0129] }
[0130] The configuration file corresponding to the IPMI protocol is a YAML format file. The sensor information configuration in this configuration file can be as follows:
[0131] bExp: 0
[0132] entityID: 3
[0133] entityInstance: 0
[0134] interfaces:
[0135] com.otrd.Sensor.Value:
[0136] Value:
[0137] Offsets: 255:
[0139] Type: double
[0140] path: / com / otrd / sensors / temperature / CPU0_Temp
[0141] sensorName: CPU0_Temp
[0142] serviceInterface: org.freedesktop.DBus.Properties
[0143] unit: com.otrd.Sensor.Value.Unit.DegreesC
[0144] Among them, each sensor information management unit monitors the sensor update signal (UpdateSensorInfo signal) by registering a signal processing function, so that it can obtain the sensor update signal when the metadata storage mapping unit broadcasts the sensor update signal, thereby enabling each sensor information management unit to synchronously update the parameter information of the sensor in its corresponding storage area according to the sensor update signal.
[0145] In an optional embodiment, to further enhance the persistent storage capabilities of sensor parameter information, during the initialization of the sensor information management unit, the metadata storage mapping unit's information update file may be queried to determine whether updated sensor parameter information exists. If so, the updated sensor parameter information is synchronized directly to the corresponding storage area of the sensor information management unit during the initialization phase. Specifically, in response to the initialization of the sensor information management unit, the metadata storage mapping unit's information update file is queried. If the information update file exists, the sensor parameter information is stored in the corresponding storage area based on the information update file. If the information update file does not exist, initial sensor parameter information is obtained and stored in the corresponding storage area. If the information update file exists, the sensor information pairs in the information update file are binary deserialized to obtain plaintext key-value pairs. Based on the plaintext key-value pairs, the object paths of all sensors are traversed and the sensor parameter information is batch-injected into the corresponding storage area using atomic transactions. During this process, a mutex lock may be employed to ensure cache consistency when multiple processes concurrently access the information update file. In this way, the update of the sensor parameter information can dynamically cover the original factory settings and take effect immediately during operation.
[0146] It should be noted that, corresponding to the above Figure 6In the illustrated embodiment, when the system first boots up and enters the initialization phase, both the metadata storage mapping unit and the sensor information management unit are initialized. At this point, no information update file exists, so the metadata storage mapping unit and the sensor information management unit each load sensor parameter information based on the configuration file. Upon subsequent system restart, the information update file already exists, and the sensor information management unit synchronizes the sensor parameter information in its corresponding storage area based on the information update file, enabling the sensor parameter information update to dynamically overwrite the factory default settings and take immediate effect during runtime. When the system is restored to factory settings or the firmware is upgraded, the information update file restores the sensor parameter information to the storage area corresponding to each sensor information management unit through memory mapping, enabling the sensor parameter information to be persistently retained after the firmware update or factory reset, avoiding configuration rollback issues caused by a full disk erase. Thus, data synchronization between the metadata storage mapping unit and each sensor information management unit in the sensor information management system is achieved under different circumstances.
[0147] The sensor information management method provided in the embodiments of the present application, on the one hand, transmits target update parameters to a metadata storage mapping unit via a name update method. The metadata storage mapping unit then receives the target update parameters of a target sensor obtained by at least one sensor information management unit, thereby using the metadata storage mapping unit and its information update file as an information update medium between sensor information management units of multiple protocols, thereby achieving synchronization of sensor information updates across multiple protocols. Furthermore, during the initialization of the sensor information management unit, if an information update file exists, data synchronization is performed on the corresponding storage area of the sensor information management unit based on the information update file, thereby achieving dynamic overwriting of the original factory settings for sensor parameter information updates and immediate effect during runtime.
[0148] In this embodiment, a sensor information management method is provided, which can be used in a data management process of at least one sensor information management unit in the above-mentioned sensor information management system, wherein the data management process communicates with a metadata storage mapping unit and a server management interface and a storage area of the sensor information management unit. Figure 8 This is a flow chart of another sensor information management method provided by an embodiment of the present application. Figure 8 As shown, the process includes the following steps:
[0149] Step S801: In response to an information modification instruction sent by a corresponding server management interface, the information modification instruction is parsed to obtain target update parameters of a target sensor.
[0150] In this embodiment of the present application, the target update parameters include parameter update information and path information of the target sensor. The parameter update information represents the updated parameter information of the target sensor, which can be any sensor information that the user wants to modify, such as the sensor name, attributes, etc. The path information represents the object path of the target sensor.
[0151] In an optional implementation, the parsing of the information modification instruction may be completed by a data management process in the sensor information management unit.
[0152] Accordingly, step S801 includes:
[0153] Step S8011: parse the information modification instruction to obtain parameter update information and positioning information of the target sensor.
[0154] In an embodiment of the present application, the information modification instruction is parsed to obtain parameter information representing the updated target sensor, which is used as parameter update information, and parameter information for positioning the target sensor is obtained, which is used as positioning information.
[0155] It should be noted that in this embodiment and the above Figure 5 In the embodiments shown, positioning information is involved. The positioning information used by the sensor information management unit in this embodiment is Figure 5 In the embodiment shown, the positioning information used by the metadata storage mapping unit may not be information of the same parameter type. For example, in this embodiment, the sensor name is used as the positioning information. Figure 5 In the illustrated embodiment, sensor attributes are used as positioning information. Furthermore, the positioning information used in this embodiment can be determined based on information modification instructions input by the user, i.e., the parameters of the positioning target sensor input by the user can be used as positioning information. The parameter attributes of the positioning information used can vary between different sensor information management units. Within the same sensor information management unit, different information modification instructions received can also correspond to different positioning information, thereby enabling flexible configuration of sensor information updates.
[0156] Step S8012: Based on the positioning information, search in the storage area corresponding to the sensor information management unit to obtain the path information of the target sensor.
[0157] In an embodiment of the present application, based on the positioning information, a search is performed in the storage area corresponding to the sensor information management unit to locate the relevant information of the target sensor in the storage area corresponding to the sensor information management unit, and the path information of the target sensor is extracted therefrom.
[0158] Thus, the parameter update information of the target sensor is obtained through the above step S8011, the path information of the target sensor is obtained through the above step S8012, and finally the target update parameter is obtained.
[0159] Step S802: Call the name update method and pass the target update parameters to the metadata storage mapping unit. Figure 7 Step S702 of the illustrated embodiment will not be described in detail here.
[0160] The sensor information management method provided in an embodiment of the present application obtains parameter update information and positioning information based on parsing the information modification instruction. Based on the positioning information, a search is performed in the storage area corresponding to the sensor information management unit to obtain the path information of the target sensor, thereby obtaining the target update parameters, and a name update method is called to pass the target update parameters to the metadata storage mapping unit, thereby ensuring that the metadata storage mapping unit can accurately locate the target information pair of the target sensor in the information update file according to the path information, and update the target information pair based on the parameter update information.
[0161] In this embodiment, a sensor information management method is provided, which can be used in a data management process of at least one sensor information management unit in the above-mentioned sensor information management system, wherein the data management process communicates with a metadata storage mapping unit and a server management interface and a storage area of the sensor information management unit. Figure 9 This is a flow chart of another sensor information management method provided by an embodiment of the present application, such as Figure 9 As shown, the process includes the following steps:
[0162] Step S901: In response to the information modification instruction sent by the corresponding server management interface, the information modification instruction is parsed to obtain the target update parameters of the target sensor. Figure 7 Step S701 of the illustrated embodiment will not be described in detail here.
[0163] Step S902: Call the name update method and pass the target update parameters to the metadata storage mapping unit. Figure 7 Step S702 of the illustrated embodiment will not be described in detail here.
[0164] Step S903: Acquire parameter update information and positioning information based on monitoring the sensor update signal.
[0165] In this embodiment of the present application, the data management process in each sensor information management unit monitors the sensor update signal (UpdateSensorInfo signal). When the metadata storage mapping unit broadcasts the sensor update signal to the DBus bus, each sensor information management unit obtains the parameter update information and positioning information carried in the sensor update signal.
[0166] Step S904: determining a target storage location of the target sensor in a storage area corresponding to the sensor information management unit based on the positioning information.
[0167] In an embodiment of the present application, based on the positioning information, the storage area corresponding to the sensor information management unit is searched to determine the parameter information stored in the storage area corresponding to the sensor information management unit of the target sensor, thereby locating the target storage position of the target sensor in the storage area corresponding to the sensor information management unit.
[0168] Step S905: store the parameter update information in the target storage location.
[0169] In an embodiment of the present application, parameter update information is used to replace the parameter information of the target sensor stored in the target storage location, thereby storing the parameter update information in the target storage location; wherein, since the storage area stores multiple types of parameter information of the sensor, when storing the parameter update information, only the parameter information corresponding to the parameter update information is replaced, and other parameter information of the target sensor is not modified.
[0170] The sensor information management method provided in an embodiment of the present application obtains target update parameters based on monitoring the sensor update signal broadcast by the metadata storage mapping unit, so that the sensor information management unit can update the parameter information of the target sensor in its corresponding storage area according to the positioning information and parameter update information, thereby realizing synchronization of sensor information updates between multiple protocols.
[0171] In a specific embodiment, the sensor information management unit includes at least a first management unit and a second management unit, each corresponding to a different protocol; the first management unit corresponds to the IPMI protocol, and the second management unit corresponds to the Redfish protocol. Accordingly, the storage areas corresponding to the first management unit and the second management unit have different data structures. The storage area corresponding to the first management unit, namely, the IPmid Cache, has a shared memory-based data structure, namely, an STL (Standard Template Library) structure; the storage area corresponding to the second management unit, namely, the Sensor Cache, has a hash table-based attribute list structure, including two attribute lists: the ThresholdSensorList attribute list and the DiscreteSensorList attribute list.
[0172] In a specific embodiment, the sensor information management method provided in the embodiment of the present application is further explained by taking the Redfish protocol and the IPMI protocol as examples. Figure 10 is a schematic diagram of a specific embodiment of a sensor information management method provided in an embodiment of the present application, such as Figure 10 As shown in the figure, the sensor information management unit for the IPMI protocol uses IPMITool as the server management interface and the Ipmid process as the backend service data management process, with the corresponding storage area being the Ipmid Cache. The sensor information management unit for the Redfish protocol uses the Redfish webpage as the server management interface and the Sensor Monitor process as the backend service data management process, with the corresponding storage area being the Sensor Cache. The server management interfaces, namely IPMITool and the Redfish webpage, can directly read data from the corresponding storage areas to obtain and display the sensor information required by the user.
[0173] To update sensor information on the IPMI protocol side, users send in-band (KCS) or out-of-band (NetIpmid) set commands (Set commands) through IPMITool to the sensor information management unit corresponding to the IPMI protocol. To update sensor information on the Redfish protocol side, users submit a JSON-formatted request (for example, {"Name": "CPU0_Temp_New"}) through the Redfish webpage's doPatch method to the sensor information management unit corresponding to the Redfish protocol. Regardless of which side issues the information modification command, the information modification command contains the target sensor's parameter information to be updated (i.e., parameter update information), such as the updated sensor name and attributes, as well as the parameter information used to locate the target sensor (i.e., location information), such as the original sensor name.
[0174] After receiving the information modification instruction, the sensor information management unit on either side parses the instruction to obtain the parameter update information and location information contained therein. Then, based on the location information, it searches the corresponding storage area to locate the parameter information of the target sensor stored in the storage area, thereby obtaining the object path of the target sensor as path information. It then calls the name update method (UpdateSensorName method) to pass the parameter update information and path information as target update parameters to the metadata storage mapping unit. The parsing of the information modification instruction, the search for the storage area, the acquisition of the path information, and the invocation of the name update method can be performed by the data management process in the sensor information management unit, namely, the Ipmid process for the IPMI protocol and the Sensor Monitor process for the Redfish protocol.
[0175] After receiving the target update parameters, the metadata storage mapping unit updates the information update file (update-sensors file) based on the target update parameters and generates and broadcasts a sensor update signal (UpdateSensorInfo signal) based on the target update parameters. Specifically, the path information in the target update parameters is used as the key of a key-value pair, and the parameter update information is used as the value of the key-value pair. The key-value pair is atomized using Cereal binary serialization and encrypted using an encryption algorithm. The encrypted data is stored in the information update file, replacing the original parameter information of the target sensor in the information update file. Simultaneously, a sensor update signal (UpdateSensorInfo signal) is generated and broadcast based on the target update parameters.
[0176] At the same time, the data management process in the sensor information management unit for each protocol monitors sensor update signals. When a sensor update signal is detected, the data management process (i.e., the Ipmid process and the Sensor Monitor process) searches the corresponding storage areas (i.e., the IpmidCache and Sensor Cache, respectively) based on the target update parameters carried in the sensor update signal, locates the storage location of the target sensor's parameter information, and updates the parameter update information to the corresponding storage location through a lock-free queue, thus achieving synchronization of sensor information updates across multiple protocols.
[0177] The sensor information management method provided in an embodiment of the present application, on the one hand, is applied to a metadata storage mapping unit and includes: obtaining target update parameters of a target sensor, wherein the target update parameters are sent by at least one sensor information management unit; searching an information update file in the metadata storage mapping unit based on the target update parameters, and updating the parameter information of the target sensor in the information update file, wherein the information update file is used to store sensor information pairs for each sensor, and the sensor information pairs are used to represent the mapping relationship between the sensor's object path and parameter information. On the other hand, the method is applied to at least one sensor information management unit and includes: responding to an information modification instruction sent by a corresponding server management interface, parsing the information modification instruction to obtain the target update parameters of the target sensor; and calling a name update method to pass the target update parameters to the metadata storage mapping unit. Simultaneously, the metadata storage mapping unit communicates with the data management process of each sensor information management unit, and the data management process communicates with the server management interface and storage area of the sensor information management unit. Through the above method, on the one hand, information update files are used to store sensor information pairs and the sensor information pairs therein are updated based on target update parameters. Without modifying the underlying configuration files, the updates of sensor information can be recorded and stored, thereby realizing dynamic updates of sensor information. On the other hand, a metadata storage mapping unit is used to receive the target update parameters of the target sensor obtained by at least one sensor information management unit, thereby using the metadata storage mapping unit and its information update file as information update media between sensor information management units of multiple protocols, thereby realizing synchronization of sensor information updates between multiple protocols.
[0178] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0179] An embodiment of the present application also provides a sensor information management device, which is applied to a metadata storage mapping unit, wherein the metadata storage mapping unit communicates with the data management process of each sensor information management unit, and the data management process communicates with the server management interface and storage area of the sensor information management unit respectively. Figure 11 This is a schematic diagram of the structure of a sensor information management device provided in an embodiment of the present application. Figure 11 As shown, the device includes:
[0180] An update parameter acquisition module 1101 is configured to acquire a target update parameter of a target sensor, wherein the target update parameter is sent by at least one sensor information management unit;
[0181] The parameter information update module 1102 is used to search the information update file in the metadata storage mapping unit based on the target update parameters and update the parameter information of the target sensor in the information update file, wherein the information update file is used to store sensor information pairs for each sensor, and the sensor information pairs are used to represent the mapping relationship between the object path of the sensor and the parameter information.
[0182] In an optional embodiment, the target update parameters include parameter update information and path information of the target sensor;
[0183] The parameter update information is used to represent the updated parameter information of the target sensor, and the path information is used to represent the object path of the target sensor.
[0184] In an optional implementation, the parameter information updating module 1102 includes:
[0185] An object path search unit, configured to search and match the object path of the sensor information pair based on the path information, and determine the target information pair corresponding to the target sensor;
[0186] The information pair updating unit is used to update the target information pair based on the target update parameter.
[0187] In an optional implementation, the information pair updating unit includes:
[0188] A key-value pair construction subunit is used to construct a key-value pair based on path information and parameter update information;
[0189] The data processing subunit is used to process the key-value pairs to obtain the information pairs to be updated;
[0190] The information pair replacement subunit is used to replace the target information pair with the information pair to be updated.
[0191] In an optional embodiment, the data processing subunit includes:
[0192] The serialization processing submodule is used to serialize the key-value pairs to obtain serialized data;
[0193] The encryption submodule is used to encrypt the serialized data to obtain the information pair to be updated.
[0194] In an optional embodiment, the device further includes:
[0195] a positioning information determination module, configured to search and match the object path of the sensor information pair based on the path information, and determine the positioning information of the target sensor, wherein the positioning information is used to locate the storage location of the parameter information of the target sensor;
[0196] The update signal broadcast module is used to generate and broadcast the sensor update signal based on the positioning information and parameter update information.
[0197] In an optional embodiment, the device further includes:
[0198] A file storage module is configured to store the information update file in a temporary file storage area in response to a clear instruction for the system storage area, wherein the temporary file storage area is located in a data clearing whitelist;
[0199] The file restoration module is configured to restore the information update file to the storage area corresponding to the metadata storage mapping unit in response to completion of clearing the system storage area.
[0200] In an optional embodiment, the device further includes:
[0201] The information recovery module is used to restore the sensor parameter information to the storage area corresponding to each sensor information management unit based on the sensor information pairs in the information update file.
[0202] In an optional embodiment, the device further includes:
[0203] The initialization module is configured to, in response to initialization of the metadata storage mapping unit, determine a sensor information pair based on the sensor configuration file and store the sensor information pair in an information update file.
[0204] An embodiment of the present application also provides a sensor information management device, which is applied to a data management process of at least one sensor information management unit, wherein the data management process communicates with a metadata storage mapping unit and a server management interface and a storage area of the sensor information management unit. Figure 12 This is a schematic diagram of the structure of a sensor information management device provided in an embodiment of the present application. Figure 12 As shown, the device includes:
[0205] The modification instruction parsing module 1201 is configured to respond to the information modification instruction sent by the corresponding server management interface, parse the information modification instruction, and obtain the target update parameters of the target sensor;
[0206] The update parameter transfer module 1202 is used to call the name update method and transfer the target update parameters to the metadata storage mapping unit.
[0207] In an optional embodiment, the target update parameters include parameter update information and path information of the target sensor;
[0208] Modify the instruction parsing module 1201, including:
[0209] A modification instruction parsing unit is used to parse the information modification instruction to obtain parameter update information and positioning information of the target sensor;
[0210] The path information search unit is used to search the storage area corresponding to the sensor information management unit based on the positioning information to obtain the path information of the target sensor.
[0211] In an optional embodiment, the device further includes:
[0212] An update signal monitoring module is used to obtain parameter update information and positioning information based on monitoring the sensor update signal;
[0213] a storage position positioning module, configured to determine a target storage position of the target sensor in a storage area corresponding to the sensor information management unit based on the positioning information;
[0214] The update information storage module is used to store the parameter update information in the target storage location.
[0215] In an optional embodiment, the device further includes:
[0216] an initialization module, configured to, in response to initialization of the sensor information management unit, determine parameter information of the sensor based on the sensor configuration file and store the parameter information in a corresponding storage area;
[0217] The processing function registration module is used to register the signal processing function to monitor the sensor update signal.
[0218] In an optional embodiment, the device further includes:
[0219] An update file query module is used to initialize the sensor information management unit and query the information update file of the metadata storage mapping unit;
[0220] A parameter information storage module, configured to store the parameter information of the sensor in a corresponding storage area based on the information update file if the information update file exists;
[0221] The parameter information storage module is further configured to obtain initial parameter information of the sensor if no information update file exists, and store the initial parameter information in a corresponding storage area.
[0222] In an optional embodiment, the sensor information management unit includes at least a first management unit and a second management unit, and the first management unit and the second management unit correspond to different protocols respectively;
[0223] The storage area corresponding to the first management unit has a data structure based on a shared memory;
[0224] The data structure of the storage area corresponding to the second management unit is a property list based on a hash table.
[0225] For the description of the features in the embodiment corresponding to the sensor information management device, please refer to the relevant description of the embodiment corresponding to the sensor information management method, and will not be repeated here.
[0226] The embodiment of the present application also provides an electronic device, such as Figure 13 As shown, it includes a memory 10 and a processor 20. The memory 10 stores a computer program, and the processor 20 is configured to run the computer program to execute the steps in any of the above-mentioned sensor information management method embodiments.
[0227] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned sensor information management method embodiments when running.
[0228] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0229] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned sensor information management method embodiments are implemented.
[0230] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned sensor information management method embodiments are implemented.
[0231] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0232] The above is a detailed introduction to a sensor information management method provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.
Claims
1. A sensor information management method, characterized in that: Applied to the metadata storage mapping unit, the metadata storage mapping unit communicates with the data management process of each sensor information management unit, and the data management process communicates with the server management interface and storage area of the sensor information management unit respectively; The sensor information management method includes: Obtaining a target update parameter of a target sensor, wherein the target update parameter is sent by at least one of the sensor information management units, and the at least one sensor information management unit is a unit that stores and manages sensor data corresponding to different protocols; Searching an information update file in the metadata storage mapping unit based on the target update parameter, and updating the parameter information of the target sensor in the information update file, wherein the information update file is used to store sensor information pairs of each sensor, and the sensor information pairs are used to represent a mapping relationship between an object path and parameter information of the sensor; the target update parameter includes parameter update information and path information of the target sensor; wherein the parameter update information is used to represent the updated parameter information of the target sensor, and the path information is used to represent the object path of the target sensor; Based on the path information, searching and matching the object path of the sensor information pair to determine the location information of the target sensor, wherein the location information is used to locate the storage location of the parameter information of the target sensor, and the location information is a parameter in the parameter information corresponding to the target sensor that uniquely locates the storage location of the parameter information of the target sensor; A sensor update signal is generated and broadcast based on the positioning information and the parameter update information.
2. The sensor information management method according to claim 1, wherein: The searching the information update file in the metadata storage mapping unit based on the target update parameter and updating the parameter information of the target sensor in the information update file includes: Based on the path information, searching and matching the object path of the sensor information pair to determine the target information pair corresponding to the target sensor; The target information pair is updated based on the target update parameter.
3. The sensor information management method according to claim 2, wherein: The updating of the target information pair based on the target update parameter includes: Constructing a key-value pair based on the path information and the parameter update information; Performing data processing on the key-value pairs to obtain information pairs to be updated; The target information pair is replaced with the information pair to be updated.
4. The sensor information management method according to claim 3, wherein: The step of processing the key-value pairs to obtain the information pairs to be updated includes: Serializing the key-value pairs to obtain serialized data; The serialized data is encrypted to obtain the information pair to be updated.
5. The sensor information management method according to claim 1, wherein: Also includes: In response to a clear instruction for the system storage area, storing the information update file in a temporary file storage area, wherein the temporary file storage area is located in a data clearing whitelist; In response to completion of clearing the system storage area, the information update file is restored to the storage area corresponding to the metadata storage mapping unit.
6. The sensor information management method according to claim 5, characterized in that: After restoring the information update file to the storage area corresponding to each of the sensor information management units, the method further includes: Based on the sensor information pairs in the information update file, the parameter information of the sensor is restored to the storage area corresponding to each of the sensor information management units.
7. The sensor information management method according to claim 1, wherein: Also includes: In response to initialization of the metadata storage mapping unit, a sensor information pair is determined based on a sensor configuration file, and the sensor information pair is stored in the information update file.
8. A sensor information management method, characterized in that: A data management process is applied to at least one sensor information management unit, wherein at least one of the sensor information management units is a unit for storing and managing sensor data corresponding to different protocols, and the data management process communicates with a metadata storage mapping unit and a server management interface and storage area of the sensor information management unit; The sensor information management method includes: In response to an information modification instruction sent by a corresponding server management interface, the information modification instruction is parsed to obtain target update parameters of the target sensor; the target update parameters include parameter update information and path information of the target sensor; Calling a name update method to pass the target update parameter to the metadata storage mapping unit; Based on monitoring the sensor update signal, parameter update information and positioning information are acquired, wherein the positioning information is a parameter that uniquely locates a storage location of the parameter information of the target sensor in the parameter information corresponding to the target sensor; determining, based on the positioning information, a target storage location of the target sensor in a storage area corresponding to the sensor information management unit; The parameter update information is stored in the target storage location.
9. The sensor information management method according to claim 8, characterized in that: The step of parsing the information modification instruction to obtain target update parameters of the target sensor includes: parsing the information modification instruction to obtain the parameter update information and positioning information of the target sensor; Based on the positioning information, a search is performed in a storage area corresponding to the sensor information management unit to obtain the path information of the target sensor.
10. The sensor information management method according to claim 8, wherein: Also includes: In response to initialization of the sensor information management unit, determining parameter information of the sensor based on the sensor configuration file, and storing the parameter information in a corresponding storage area; Register a signal processing function to listen for sensor update signals.
11. The sensor information management method according to claim 8, wherein: Also includes: In response to initialization of the sensor information management unit, querying the information update file of the metadata storage mapping unit; If the information update file exists, storing the sensor parameter information in a corresponding storage area based on the information update file; If the information update file does not exist, initial parameter information of the sensor is obtained and stored in a corresponding storage area.
12. The sensor information management method according to claim 8, wherein: The sensor information management unit includes at least a first management unit and a second management unit, wherein the first management unit and the second management unit correspond to different protocols respectively; The data structure of the storage area corresponding to the first management unit is a data structure based on shared memory; The data structure of the storage area corresponding to the second management unit is an attribute list based on a hash table.
13. A sensor information management device, characterized in that: Applied to the metadata storage mapping unit, the metadata storage mapping unit communicates with the data management process of each sensor information management unit, and the data management process communicates with the server management interface and storage area of the sensor information management unit respectively; The sensor information management device includes: an update parameter acquisition module, configured to acquire a target update parameter of a target sensor, wherein the target update parameter is sent by at least one sensor information management unit, and at least one of the sensor information management units is a unit for storing and managing sensor data corresponding to different protocols; a parameter information updating module, configured to search an information updating file in the metadata storage mapping unit based on the target update parameter, and update the parameter information of the target sensor in the information updating file, wherein the information updating file is used to store sensor information pairs of each sensor, the sensor information pairs being used to represent a mapping relationship between an object path and parameter information of the sensor; the target update parameter including the parameter update information and path information of the target sensor; wherein the parameter update information is used to represent the updated parameter information of the target sensor, and the path information is used to represent the object path of the target sensor; Based on the path information, searching and matching the object path of the sensor information pair to determine the location information of the target sensor, wherein the location information is used to locate the storage location of the parameter information of the target sensor, and the location information is a parameter in the parameter information corresponding to the target sensor that uniquely locates the storage location of the parameter information of the target sensor; A sensor update signal is generated and broadcast based on the positioning information and the parameter update information.
14. A sensor information management device, characterized in that: A data management process is applied to at least one sensor information management unit, wherein at least one of the sensor information management units is a unit for storing and managing sensor data corresponding to different protocols, and the data management process communicates with a metadata storage mapping unit and a server management interface and storage area of the sensor information management unit; The sensor information management device includes: a modification instruction parsing module, configured to respond to an information modification instruction sent by a corresponding server management interface, parse the information modification instruction, and obtain target update parameters of the target sensor; the target update parameters include parameter update information and path information of the target sensor; An update parameter transfer module, configured to call a name update method and transfer the target update parameters to a metadata storage mapping unit; Based on monitoring the sensor update signal, parameter update information and positioning information are acquired, wherein the positioning information is a parameter that uniquely locates a storage location of the parameter information of the target sensor in the parameter information corresponding to the target sensor; determining, based on the positioning information, a target storage location of the target sensor in a storage area corresponding to the sensor information management unit; The parameter update information is stored in the target storage location.
15. A sensor information management system, characterized in that: include: a metadata storage mapping unit and at least one sensor information management unit; The metadata storage mapping unit communicates with the data management process of each sensor information management unit, and the data management process communicates with the server management interface and storage area of the sensor information management unit respectively; The data management process of the at least one sensor information management unit is configured to respond to an information modification instruction sent by a corresponding server management interface, parse the information modification instruction, obtain target update parameters of the target sensor, and call a name update method to pass the target update parameters to the metadata storage mapping unit; The metadata storage mapping unit is configured to obtain the target update parameters, perform a search in an information update file in the metadata storage mapping unit based on the target update parameters, and update parameter information of the target sensor in the information update file, wherein the information update file is configured to store sensor information pairs of each sensor, and the sensor information pairs are configured to represent a mapping relationship between an object path and parameter information of the sensor.
16. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the sensor information management method according to any one of claims 1 to 7 or 8 to 12 are implemented.
17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the sensor information management method according to any one of claims 1 to 7 or 8 to 12 are implemented.
Citation Information
Patent Citations
Configuration file management method, device and equipment and storage medium
CN111651405A
Information configuration method and device, computer equipment and storage medium
CN117348919A