A multi-project BMC sensor configuration management method and device
By using the method of matching image files and hardware information in server management, sensor configuration information is automatically loaded, which solves the problem of sensor configuration complexity for different machine models and projects, and improves configuration efficiency and accuracy.
Patent Information
- Application Number
- CN202211388662.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-07
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-11-07
AI Technical Summary
In server management, sensor configurations for different machine models and projects need to be manually retrieved and modified one by one, resulting in complex operations, low efficiency and low accuracy.
After the device is powered on, the compiled configuration file is read from the image file, and the sensor attribute configuration information is automatically loaded by matching the configuration information indication field with the hardware information to avoid manual configuration one by one.
The sensor configuration process is simplified, operational efficiency and accuracy are improved, and manual errors are reduced.
Smart Images

Figure CN115967618B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of server management, and in particular to a method and device for managing BMC sensor configuration for multiple projects. Background Art
[0002] A baseboard management controller (BMC) is a service processor that can obtain the physical status of a server, computer, or other hardware device with the help of sensors.
[0003] In the related art, when operators adapt sensors for baseboard management controllers, they need to manually perform configuration retrieval and configuration modification again according to different machine models and different projects.
[0004] Because different machine models and different projects may have the same configuration when adapting the sensor, manual configuration retrieval and modification one by one is complicated, inefficient and inaccurate. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a multi-project BMC sensor configuration management method and device, which can solve the problem that when performing sensor adaptation, different machine models and different projects may have the same configuration, and manual configuration retrieval and modification are performed one by one, which is complicated, inefficient and inaccurate.
[0006] In a first aspect, an embodiment of the present application provides a multi-project BMC sensor configuration management method, the method comprising:
[0007] After the device is powered on, if it is determined that the sensor configuration is not loaded, then read each configuration file from the image file; wherein each configuration file is compiled into the same image file, the configuration file includes sensor attribute configuration information and a configuration information indication field, and the parameter of the configuration information indication field includes first hardware information for distinguishing the device;
[0008] For each configuration file, obtaining first hardware information of the configuration information indication field, and obtaining second hardware information of the device;
[0009] When the first hardware information matches the second hardware information, the sensor attribute configuration information is obtained and loaded.
[0010] In a second aspect, an embodiment of the present application provides a multi-project BMC sensor configuration management device, the device comprising:
[0011] A traversal module, configured to read each configuration file from the image file after the device is powered on, if it is determined that the sensor configuration is not loaded; wherein each configuration file is compiled into the same image file, and the configuration file includes sensor attribute configuration information and a configuration information indication field, and the parameter of the configuration information indication field includes first hardware information for distinguishing the device;
[0012] An acquisition module, configured to acquire, for each configuration file, the first hardware information of the configuration information indication field and the second hardware information of the device;
[0013] A loading module is used to obtain the sensor attribute configuration information for loading when the first hardware information matches the second hardware information.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0016] In an embodiment of the present application, after the device is powered on, if it is determined that the sensor configuration is not loaded, each configuration file is read from the image file, wherein each configuration file is compiled into the same image file, and the configuration file includes sensor attribute configuration information and a configuration information indication field, and the parameters of the configuration information indication field include first hardware information for distinguishing the device, and for each configuration file, the first hardware information of the configuration information indication field is obtained, and the second hardware information of the device is obtained, and when the first hardware information and the second hardware information match, the sensor attribute configuration information is obtained for loading. The device of this method obtains a matching configuration file by retrieving the configuration information indication field, and then loads the matching configuration file, without manually retrieving and modifying the configuration one by one, and the operation is relatively simple, more efficient and accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flowchart of the steps of a multi-project BMC sensor configuration management method provided by an embodiment of the present application;
[0018] Figure 2 is a block diagram of a multi-project BMC sensor configuration management device provided in an embodiment of the present application;
[0019] Figure 3An electronic device provided by an embodiment of the present application;
[0020] Figure 4 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0022] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or at least two. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0023] The following describes in detail the BMC sensor configuration management method for multiple projects provided by the embodiment of the present application through specific embodiments and application scenarios in conjunction with the accompanying drawings.
[0024] The following is an introduction to the terms involved in the embodiments of the present disclosure:
[0025] BMC (Baseboard Management Controller): A baseboard management controller is a service processor that can monitor the physical status of a server, computer, or other hardware device with the help of sensors. The baseboard management controller is part of the intelligent platform management interface. It is embedded in the main circuit board or motherboard of the device or computer to be monitored. It can help remotely monitor a large number of servers or devices, and can perform firmware upgrades, view machine devices, and other operations on the machine when the machine is not turned on.
[0026] FRU (Field Replace Unit): Field replaceable units are replaceable parts used in computers, servers and other equipment, which can usually be replaced directly and quickly, such as motherboards, power supplies, fans, etc. Users can obtain information such as the manufacturer and product number of the component by reading FRU. On the server motherboard, there is usually a memory to store the motherboard FRU information, which can be read through the BMC.
[0027] DBUS (Desktop Bus): Data bus is a low-latency, low-overhead, high-availability inter-process communication mechanism provided by the freedesktop.org project and released under the GPL license (General Public License). The main purpose of DBUS is to provide communication for processes in the Linux desktop environment. The main concept is the bus. Registered processes can receive or pass messages through the bus. Processes can also register and wait for kernel event responses, such as waiting for network status changes or the computer to issue a shutdown command. DBUS has been adopted by most Linux distributions, and developers can use DBUS to implement various complex inter-process communication tasks.
[0028] Configuration file: A configuration file is a computer file that can configure parameters and initial settings for some computer programs, that is, a file that configures different objects differently. Configuration files are essentially files that contain information required for the successful operation of the program. The information is structured in a specific way, is user-configurable, and is usually stored in a plain text file.
[0029] JSON (JavaScript Object Notation): JSON is a lightweight data exchange format. It is based on the specifications developed by the European Computer Association and uses a text format that is completely independent of programming languages to store and represent data. JSON has a concise and clear hierarchical structure and is an ideal data exchange language that is easy to read, write, machine parse, and generate.
[0030] Image file: An image file is actually a series of specific files that are made into a single file in a certain format to facilitate users to download and use, such as a beta version of an operating system, game, etc. Many files can be generated into an image file. Common image file formats include ISO, BIN, IMG, TAO, DAO, CIF, and FCD.
[0031] Reference Figure 1 , Figure 1 A flowchart of a multi-project BMC sensor configuration management method provided by an embodiment of the present application is shown. Figure 1As shown, the specific steps include:
[0032] Step 101, after the device is powered on, if it is determined that the sensor configuration is not loaded, read each configuration file from the image file; wherein each configuration file is compiled into the same image file, and the configuration file includes sensor attribute configuration information and a configuration information indication field, and the parameters of the configuration information indication field include first hardware information for distinguishing the device.
[0033] When the device is powered on, the BMC can run, collect various sensor information on electronic devices such as servers, and provide it to the upper-level operation and maintenance network management software. Configuration files of sensors of the same type will be compiled into the same image file, so it is necessary to read each configuration file from the image file. For example, configuration file 1, configuration file 2, and configuration file 3 are all 3v3 ADC type sensors, then the three configuration files will be compiled into the same image file. The device in the embodiment of the present application can be a server, computer, tablet computer, and other electronic devices that can perform BMC configuration management.
[0034] The sensor attribute configuration information may include a sensor name (SensorName), an i2c bus (Inter-Integrated Circuit, Bus), a mounted i2c address (Addr), a node index (Index), a sensor type (SensorType), sensor attribute information (Properties), a severe high alarm value (CRITHI), a severe low alarm value (CRITLO), a high alarm value (WARNHI), a low alarm value (WARNLO), a scaling factor (ScaleFactor), etc., and the embodiments of the present application do not specifically limit this.
[0035] The configuration information indication field is a field added to the configuration file in advance and used as identification information. The device can determine the items that need to be configured based on the configuration information indication field, and then parse other information in the configuration file, such as sensor attribute configuration information, after finding the items that need to be configured. This can improve the efficiency of multi-item configuration and reduce the mistakes of manual traversal of configuration files.
[0036] The first hardware information is used to distinguish projects, or to distinguish different machines or components, so it is required to be fixed, cannot be easily modified, and can be publicly read. Therefore, the first hardware information can be the FRU data information of the BMC motherboard, such as the manufacturer, product number and other information of the component. In the embodiment of the present application, it can be the motherboard product name (BOARD_PRODUCT_NAME). By comparing the first hardware information with the device hardware information, it can be determined whether the project needs to be configured.
[0037] Step 102: For each configuration file, obtain the first hardware information of the configuration information indication field, and obtain the second hardware information of the device.
[0038] In the embodiment of the present application, the second hardware information is the hardware information of the device itself or the project. When the data of the first hardware information matches the data of the second hardware information, that is, the first hardware information is consistent with the second hardware information, indicating that the device or project is consistent, the project continues to be configured. Therefore, it is necessary to first obtain the first hardware information and the second hardware information according to the configuration information indication field.
[0039] Step 103: When the first hardware information and the second hardware information match, the sensor attribute configuration information is obtained and loaded.
[0040] When the first hardware information matches the second hardware information, that is, the first hardware information and the second hardware information are consistent, and the project matches the configuration file type, the sensor property configuration information can be loaded. The sensor property information (Properties) in the sensor property configuration information in the configuration file is loaded into the device memory for caching, and the configuration is updated according to the sensor property information (Properties), and the updated sensor property information (Properties) is updated to the data bus, completing the loading of the sensor property configuration information, which is convenient for the project or device to run.
[0041] Optionally, the configuration information indication field includes: a data field and a type field; the data field is used to search for the second hardware information, and the type field is used to determine a method for searching for the second hardware information.
[0042] In the embodiment of the present application, the data field may be a field named "ProbeData". ProbeData is a field in a string format, which contains data for distinguishing different items or a path for finding the data, and can be used to distinguish different items. The information contained in ProbeData is usually fixed, cannot be easily modified, and can be publicly read. For example, the FRU information of the BMC motherboard is public hardware information that will not be easily changed.
[0043] The type field can be a field named "ProbeType", and the content of ProbeType is integer data, which expresses the way to interpret the ProbeData path information, that is, the way to find the second hardware information. In the embodiment of the present application, the type field can be 1 or 2. When ProbeType is 1, it means that the ProbeData field stores the data information of the DBUS interface and the FRU on the DBUS; when ProbeType is 2, it means that the ProbeData data stores the file path name and the data information of the FRU on the DBUS. In the embodiment of the present application, different ProbeType values can also be set according to different expressions of the ProbeData path information.
[0044] An example of a configuration file provided in an embodiment of the present application is as follows:
[0045]
[0046]
[0047] It can be seen that the sensor name in the configuration file is "SYS_3V3", the i2c bus value is 0, the mounted i2c address value is 0, the node index value is 1, the sensor type is ADC (analog to digital converter), the sensor attribute information includes severe high alarm value, severe low alarm value, high alarm value, low alarm value, and the scaling factor is 1. The ProbeType value of the configuration file is 2, and the ProbeData stores the file path name " / etc / fru / baseboard.bin" and the data information of the FRU on the DBUS 'BOARD_PRODUCT_NAME':'BMC_DEF'.
[0048] Optionally, the configuration file is a JSON format file, and the parameters of the configuration information indication field include preset characters, and the preset characters are used to mark the position of the second hardware information;
[0049] JSON format files record data in the name / value format. The "ProbeType" and "ProbeData" in the configuration information indication field in the embodiment of the present application are names in the JSON format; the parameters in the configuration information indication field are values in the JSON format. It is easy for a device to access and obtain file data in the JSON format. The device can obtain data through dot notation or symbols such as brackets.
[0050] For example, the following is an example of a configuration information indication field provided in an embodiment of the present application:
[0051] {
[0052] "ProbeData":"xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME':'BMC'})",
[0053] "ProbeType":1
[0054] }
[0055] It can be seen that for the configuration information indication field in the JSON file format, if you want to interpret the data field of the configuration information indication field, after the device finds the data field "ProbeData" position, you can start from the first position of the value of the "ProbeData" field until the left bracket "(" is retrieved in the field value, and then read out all the values before the left bracket "(", that is, the file data "xyz.openbmc_project.FruDevice".
[0056] The preset character is the location of the second hardware information stored in the data field, which can be a path or interface for finding data to distinguish items. Specifically, it can be a DBUS interface or file path name stored in the ProbeData field. The following is another configuration file example provided in an embodiment of the present application:
[0057]
[0058] It can be seen that the sensor name in the configuration file is "CPU_3V3", the i2c bus value is 0, the mounted i2c address value is 0, the node index value is 1, the sensor type is ADC (analog to digital converter), the sensor attribute information includes severe high alarm value, severe low alarm value, high alarm value, low alarm value, and the scaling factor is 0.4. The ProbeType value of the configuration file is 1, and the parameters of the configuration information indication field include the preset characters, that is, the DBUS interface "xyz.openbmc_project.FruDevice" saved in ProbeData. The hardware information of the device or project can be obtained through this DBUS interface.
[0059] The step 102 includes:
[0060] Sub-step 1021, when the type field meets the first condition, obtaining the second hardware information through the data bus interface information in the preset character.
[0061] In the embodiment of the present application, the type field meets the first condition, that is, the value of ProbeType is 1, and the preset character in the parameter of the configuration information indication field is the data bus interface information for storing the second hardware information. The second hardware information under the interface can be obtained from the DBUS through the data bus interface information.
[0062] Sub-step 1022, when the type field meets the second condition, obtaining the second hardware information through the path information in the preset characters.
[0063] In the embodiment of the present application, the type field meets the second condition, that is, the value of ProbeType is 2, and the preset characters in the parameter of the configuration information indication field are the path information of the file storing the second hardware information. The second hardware information in the file under the file path can be obtained through the file path information.
[0064] Optionally, before step 102, the method further includes:
[0065] Step 104, find out whether the configuration information indication field exists, and if it does not exist, discard the configuration.
[0066] The configuration information indication field is a field added to the configuration file in advance, which can be all files that need to be configured selected by the staff or user. If the configuration information indication field does not exist, it means that the configuration file is not a file that needs to be configured, and the configuration is discarded.
[0067] Optionally, the step 103 includes:
[0068] Sub-step 1031, obtaining the i2c bus, i2c address and node index in the sensor attribute configuration information.
[0069] Sub-step 1032, searching for a driver node according to the i2c bus, i2c address and node index.
[0070] A driver node is a special file created by a device. All device communications are implemented through the driver node. The driver node records the location and information of the hardware device, such as a device corresponding to a certain ID connected to a certain interface. In Linux, all devices are stored in the / dev directory as files and are accessed through files. The driver node is the Linux kernel's abstraction of the device, which allows users to communicate with the kernel for hardware, read and write devices, and perform other operations.
[0071] The embodiment of the present application does not specifically limit the method of searching for a driver node through an i2c bus, an i2c address, and a node index.
[0072] Sub-step 1033: if the driver node exists, continue loading.
[0073] Sub-step 1034: if the driver node does not exist, discard the configuration.
[0074] There are two possibilities for the situation where the driver node does not exist. One is that the hardware information of the device is consistent with the hardware information of the configuration file, but the device does not have this sensor. The other is that the hardware information of the device is consistent with the device information of the configuration file, and the device also has this sensor and needs to load the configuration file, but the underlying driver does not throw out the node. When the device does not have the sensor, there is no need to load the configuration, so the configuration is discarded. When the underlying driver does not throw out the node and there is no driver node, the device cannot load the configuration, and R&D personnel need to solve this problem. The embodiments of the present application are not limited to this.
[0075] Optionally, after step 103, the method further includes:
[0076] Step 105: Generate a first file in a first directory.
[0077] After the sensor configuration is completed, the embodiment of the present application will generate a first file in the first directory. The generation of the first file means that the current sensor configuration has been loaded and there is no need to re-retrieve and match the configuration file. Specifically, the probe_file.json file can be generated in the sensors_configs directory. The content of the first file includes the data bus interface information, path information and driver node of the project or device.
[0078] The step 101 includes:
[0079] Sub-step 1011: if the first file is not retrieved, determining that the sensor configuration is not loaded.
[0080] Since the generation of the first file indicates that the current sensor configuration has been loaded, when the device is restarted, it will first search whether there is the first file in the first directory, that is, to see whether the sensor configuration has been loaded. If there is the first file in the first directory, it means that the configuration has been loaded; if there is no first file in the first directory, it means that the configuration has not been loaded.
[0081] Specifically, in the embodiment of the present application, it is searched whether there is a probe_file.json file in the sensors_configs directory. If it exists, there is no need to traverse the json configuration file in the directory, directly read the information saved in the probe_file.json file, and then obtain data from the driver node contained in the probe_file.json file and calculate and update the DBUS data. If it does not exist, it can be determined that the sensor configuration is not loaded.
[0082] Optionally, the step 105 includes:
[0083] Sub-step 1051, generating the first file according to the data bus interface information, project information and driver node.
[0084] The JSON file format is simple and easy to read. It records data in a name / value format and uses the obtained bus interface information, project information, and related information of the driver node as values to generate a corresponding first file. An example of a first file provided in an embodiment of the present application is as follows:
[0085]
[0086] It can be seen that the first file includes bus interface information, project information and driver node, among which the DBUS interface is "xyz.openbmc_project.ADCSensor"; the device project information object is "xyz / openbmc_project / sensor / 3V3"; the driver node path for reading sensor data is " / sys / bus / class / hwmon / hwmon13 / in1_input".
[0087] The following is a configuration file provided in an embodiment of the present application:
[0088]
[0089]
[0090] The configuration management process of the configuration file is as follows, and the detailed implementation steps are:
[0091] 1) After the device is powered on, first search the sensors_configs directory to obtain the probe_file.json file; if there is no probe_file.json file, traverse the json configuration files in the directory.
[0092] 2) Read all the information in the probe_file.json file into the device cache.
[0093] 3) Check whether the ProbeData field exists. If it does not exist, discard the configuration.
[0094] 4) Check whether the ProbeType field exists. If it does not exist, discard the configuration.
[0095] 5) After finding the ProbeData field location, search for the "(" position, read out "xyz.openbmc_project.FruDevice", and check whether the "BOARD_PRODUCT_NAME" data under the "xyz.openbmc_project.FruDevice" interface on DBUS is "BMC". If the two are consistent, keep the configuration.
[0096] 6) According to the three parts of data "Bus", "Addr" and "Index", retrieve the driver node that reads the sensor data. If the driver node does not exist, discard this configuration.
[0097] 7) The configuration information retained at this time is the configuration of the current project. Create a DBUS interface (xyz.openbmc_project.ADCSensor) according to the sensor type.
[0098] 8) Add the project object (xyz / openbmc_project / sensor / 3V3) to the DBUS interface created in the previous step according to the SensorName data.
[0099] 9) Parse the Properties data and cache it in memory.
[0100] 10) According to the path in step 7, read the raw data of the sensor driver (assuming the data is 10000), and calculate the actual data of the current ADC sensor according to the scaling factor: 10000 / 1000*0.333, which is 3.33V.
[0101] 11) Update the sensor's threshold and current value data to DBUS.
[0102] 12) Generate the probe_file.json file in the sensors_configs directory.
[0103] For example, the following are three configuration files for multiple project sensors: Configuration file 1, Configuration file 2, and Configuration file 3:
[0104] Configuration file 1:
[0105]
[0106] Profile 2:
[0107]
[0108]
[0109] Profile 3:
[0110]
[0111] It can be seen that Profile 1, Profile 2, and Profile 3 all belong to 3v3 ADC type sensors, and the three profiles will be compiled into the same image file. Therefore, the implementation steps for the multi-project configuration of these three configuration files are as follows: First, after device 1 is powered on, the device will create the xyz.openbmc_project.FruDevice interface on DBUS and save the FRU information, which can be the motherboard product name BOARD_PRODUCT_NAME data is BMC_DEF. The same operation is performed after device 2 is powered on, in which the motherboard product name BOARD_PRODUCT_NAME data is BMC_HK. The same operation is performed after device 3 is powered on, in which the BOARD_PRODUCT_NAME data is BMC_hooker. Then the device searches for the motherboard product name BOARD_PRODUCT_NAME data under the xyz.openbmc_project.FruDevice interface through the DBUS library function, and saves the data cache to the memory. Compare the BOARD_PRODUCT_NAME data found by device 1 with the data found through the DBUS library function. If configuration file 1 does not match, it will not be loaded. If configuration file 2 does not match, it will not be loaded. If configuration file 3 matches, then configuration file 3 will be loaded.
[0112] The processing of device 2 and device 3 is similar to the above processing of device 1. The management method of configuration files for more projects and more different types is also consistent with the above processing.
[0113] In summary, the embodiment of the present application provides a multi-project BMC sensor configuration management method, including, after the device is powered on, if it is determined that the sensor configuration is not loaded, then reading each configuration file from the image file; wherein each configuration file is compiled into the same image file, the configuration file includes sensor attribute configuration information, a configuration information indication field, and the parameters of the configuration information indication field include first hardware information for distinguishing the device; for each configuration file, obtaining the first hardware information of the configuration information indication field, and obtaining the second hardware information of the device; when the first hardware information and the second hardware information match, obtaining the sensor attribute configuration information for loading. This method solves the problem that when adapting sensors for different machine models and different projects, due to the existence of the same configuration, the configuration retrieval and modification are manually performed one by one, which is complicated, inefficient and inaccurate.
[0114] The BMC sensor configuration management method for multiple projects provided in the embodiment of the present application can be executed by a BMC sensor configuration management device for multiple projects. In the embodiment of the present application, the BMC sensor configuration management device for multiple projects executing the BMC sensor configuration management method for multiple projects is taken as an example to illustrate the BMC sensor configuration management device for multiple projects provided in the embodiment of the present application.
[0115] Reference Figure 2 , Figure 2 is a block diagram of a multi-project BMC sensor configuration management device provided by an embodiment of the present application, such as Figure 2 As shown, the multi-project BMC sensor configuration management device includes:
[0116] The traversal module 201 is used for reading each configuration file from the image file after the device is powered on, if it is determined that the sensor configuration is not loaded; wherein each configuration file is compiled into the same image file, and the configuration file includes sensor attribute configuration information and a configuration information indication field, and the parameter of the configuration information indication field includes the first hardware information for distinguishing the device;
[0117] An acquisition module 202, configured to acquire, for each configuration file, first hardware information of the configuration information indication field and second hardware information of the device;
[0118] The loading module 203 is used to obtain the sensor attribute configuration information for loading when the first hardware information matches the second hardware information.
[0119] In summary, a multi-project BMC sensor configuration management device provided by an embodiment of the present application includes: a traversal module, which is used to read each configuration file from the image file after the device is powered on, if it is determined that the sensor configuration has not been loaded; wherein each configuration file is compiled into the same image file, and the configuration file includes sensor attribute configuration information and a configuration information indication field, and the parameters of the configuration information indication field include first hardware information for distinguishing the device; an acquisition module, which is used to obtain the first hardware information of the configuration information indication field for each configuration file, and obtain the second hardware information of the device; a loading module, which is used to obtain the sensor attribute configuration information for loading when the first hardware information and the second hardware information match. This device can solve the problem that when adapting sensors for different machine models and different projects, due to the existence of the same configuration, the configuration retrieval and modification are manually performed one by one, which is complicated, inefficient and inaccurate.
[0120] The BMC sensor configuration management device for multiple projects in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a palmtop computer, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0121] The multi-project BMC sensor configuration management device in the embodiment of the present application may be a device having an operating system, which may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0122] The BMC sensor configuration management device for multiple projects provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0123] Alternatively, if Figure 3 As shown, an embodiment of the present application also provides an electronic device M00, including a processor M01 and a memory M02, wherein the memory M02 stores programs or instructions that can be executed on the processor M01, and when the program or instructions are executed by the processor M01, the various steps of the above-mentioned message sending method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.
[0124] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0125] Figure 4 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0126] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.
[0127] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0128] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0129] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0130] The processor 110 may include one or at least two processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 110.
[0131] The embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the BMC sensor configuration management method embodiment of the above-mentioned multiple projects is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0132] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0133] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0134] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0135] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A multi-project BMC sensor configuration management method, characterized in that: The method comprises: After the device is powered on, if it is determined that the sensor configuration is not loaded, then read each configuration file from the image file; wherein each configuration file is compiled into the same image file, the configuration file includes sensor attribute configuration information and a configuration information indication field, and the parameter of the configuration information indication field includes first hardware information for distinguishing the device; For each configuration file, obtaining first hardware information of the configuration information indication field, and obtaining second hardware information of the device; When the first hardware information and the second hardware information match, obtaining the sensor attribute configuration information for loading includes: Obtaining the i2c bus, i2c address and node index in the sensor attribute configuration information; According to the i2c bus, i2c address and node index, search for the driver node; If the driver node exists, continue loading; If the driver node does not exist, the configuration is discarded.
2. The method according to claim 1, characterized in that The configuration information indication field includes: a data field and a type field; the data field is used to search for the second hardware information, and the type field is used to determine a method for searching for the second hardware information.
3. The method according to claim 2, characterized in that The configuration file is a JSON format file, and the parameters of the configuration information indication field include preset characters, and the preset characters are used to mark the position of the second hardware information; The obtaining of the second hardware information includes: When the type field meets the first condition, acquiring the second hardware information through the data bus interface information in the preset character; When the type field meets the second condition, the second hardware information is obtained through the path information in the preset characters.
4. The method according to claim 1, characterized in that Before obtaining the first hardware information of the configuration information indication field and obtaining the second hardware information of the device, the method further includes: Check whether the configuration information indication field exists, and if it does not exist, discard the configuration.
5. The method according to claim 3, characterized in that: In the case where the first hardware information and the second hardware information match, after acquiring the sensor attribute configuration information for loading, the method further includes: Generate the first file in the first directory; The determining that the sensor configuration is not loaded includes: In case the first file is not retrieved, it is determined that the sensor configuration is not loaded.
6. The method according to claim 5, characterized in that The step of generating a first file in a first directory includes: The first file is generated according to the data bus interface information, project information and driver node.
7. A multi-project BMC sensor configuration management device, characterized in that: The device comprises: A traversal module, configured to read each configuration file from the image file after the device is powered on, if it is determined that the sensor configuration is not loaded; wherein each configuration file is compiled into the same image file, and the configuration file includes sensor attribute configuration information and a configuration information indication field, and the parameter of the configuration information indication field includes first hardware information for distinguishing the device; An acquisition module, configured to acquire, for each configuration file, the first hardware information of the configuration information indication field and the second hardware information of the device; A loading module, used for acquiring the sensor attribute configuration information for loading when the first hardware information and the second hardware information match, comprises: Obtaining the i2c bus, i2c address and node index in the sensor attribute configuration information; According to the i2c bus, i2c address and node index, search for the driver node; If the driver node exists, continue loading; If the driver node does not exist, the configuration is discarded.
8. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the multi-item BMC sensor configuration management method according to any one of claims 1 to 6 is implemented.
9. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the BMC sensor configuration management method for multiple items according to any one of claims 1 to 6 is implemented.
