Data interaction method and device, equipment, storage medium and program product
By detecting the synchronous communication method between BIOS and BMC, acquiring and storing interaction data, and switching to asynchronous communication when failure occurs, the problem of difficult data interaction between BIOS and BMC is solved, and fast startup and efficient operation and maintenance are achieved.
Patent Information
- Application Number
- CN202310422616.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-19
- Publication Date
- 2024-10-22
AI Technical Summary
Existing technology is difficult to ensure data interaction between BIOS and BMC in various scenarios, resulting in prolonged server startup time and low operation and maintenance efficiency, and requires waiting or restarting when the synchronous communication method fails.
By detecting whether the synchronous communication method between BIOS and BMC fails, the interaction data is obtained and stored, and when it fails, it switches to asynchronous communication method, and uses storage devices to realize data interaction between BIOS and BMC, avoiding waiting and restarting.
It realizes data interaction between BIOS and BMC in any scenario, shortens server startup time, improves operation and maintenance efficiency, and improves communication efficiency and security through enable status and signature verification.
Smart Images

Figure CN118819643A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data interaction method, device, equipment, storage medium and program product. Background Art
[0002] BIOS (Basic Input Output System) is a set of programs fixed to the read-only memory in the server, which stores the most important basic input and output programs of the computer, the self-test program after power-on, and the system self-starting program. ( Baseboard Management Controller ) Usually included in the main circuit board of the template or monitored device, it can use sensors to monitor the status of computers, network servers, or other hardware drive devices. During the startup process of the computer device, there will be a lot of data interaction between BIOS and BMC. For example, BIOS will send its own data information to BMC, and will also read some information from BMC accordingly.
[0003] In the related art, BIOS and BMC generally communicate through synchronous communication, that is, BIOS sends some information to BMC, and BMC can also send some of its own information to BIOS to achieve data interaction between the two. The synchronous communication methods here include IPMI (Intelligent Platform Management Interface), Redfish and other methods.
[0004] However, the above technology is difficult to ensure that data interaction between the BIOS and the BMC is achieved in various scenarios. Summary of the invention
[0005] Based on this, it is necessary to provide a data interaction method, device, equipment, storage medium and program product that can ensure that BIOS and BMC can achieve interaction between the two in various scenarios in response to the above technical problems.
[0006] In a first aspect, the present application provides a data interaction method, the method comprising:
[0007] Check whether the synchronous communication mode between the basic input and output system BIOS and the baseboard management controller BMC fails;
[0008] If it fails, obtaining first interaction data of communication between BIOS and BMC, and obtaining second interaction data of communication between BMC and BIOS;
[0009] The first interaction data and the second interaction data are stored in a preset storage device, and the BIOS and the BMC are controlled to communicate according to the interaction data in the storage device.
[0010] In this embodiment, by detecting whether the synchronous communication mode between BIOS and BMC fails, and obtaining the first interaction data and the second interaction data of the communication between BIOS and BMC when it fails, and storing the first interaction data and the second interaction data in a preset storage device, the BIOS and BMC are controlled to communicate based on the interaction data in the storage device. In this method, when the synchronous communication mode between BIOS and BMC is unavailable or fails, it can be switched to an asynchronous communication mode, and the asynchronous communication mode is used to realize data interaction between the two. In this way, no matter what scenario the BIOS and BMC are in, there is no need for the BIOS or BMC to wait and restart, and the data interaction between the two can be completed, thereby shortening the startup time of the BIOS and BMC and even the computer device.
[0011] In one embodiment, controlling the BIOS and the BMC to communicate according to the interaction data in the storage device includes:
[0012] Get the enable status of BIOS and BMC respectively; the enable status is used to represent the operation permissions of BIOS and BMC on storage devices;
[0013] According to the enabling states corresponding to the BIOS and the BMC respectively, the BIOS and the BMC are controlled to communicate according to the interaction data in the storage device.
[0014] In this embodiment, the enable states corresponding to the BIOS and BMC are obtained, and the two are controlled to communicate according to the interactive data in the storage device according to their respective enable states, wherein the enable state is used to indicate the access rights of the BIOS and BMC to the storage device, and generally the two cannot access the storage device at the same time, so the read-write conflict problem caused by simultaneous access to the storage device can be avoided.
[0015] In one embodiment, according to the enabling states of the BIOS and the BMC, respectively, controlling the BIOS and the BMC to communicate according to the interaction data in the storage device includes:
[0016] According to the respective enabling states of the BIOS and the BMC, the target operation object and the non-target operation object corresponding to the storage device are determined from the BIOS and the BMC;
[0017] The target operation object is controlled to communicate with the non-target operation object based on the interaction data in the storage device.
[0018] In this embodiment, during the communication process through the enable state, the target operation object and the non-target operation object can be determined from both the BIOS and the BMC through the enable state, and the target operation object is controlled to communicate based on the data in the storage device and the non-target operation object. In this way, the object of the storage device operation can be clarified, the communication process is simplified, and the efficiency and accuracy of the communication between the BIOS and the BMC are improved.
[0019] In one embodiment, storing the first interaction data and the second interaction data in a preset storage device includes:
[0020] Dividing the storage device into multiple groups of storage spaces according to a preset division method;
[0021] The first interaction data is stored in a first storage space among the plurality of storage spaces, and the second interaction data is stored in a second storage space among the plurality of storage spaces.
[0022] In this embodiment, the storage device is divided into multiple groups of storage spaces according to a preset division method, and the first interactive data is stored in the first storage space and the second interactive data is stored in the second storage space. In this way, the storage device can be divided and stored separately, and different interactive data can be better distinguished, so that the BIOS and BMC can quickly obtain their corresponding data in a targeted manner when accessing the storage device, thereby improving the efficiency and accuracy of data reading and writing.
[0023] In one embodiment, the plurality of storage spaces further include a third storage space, the third storage space being used to store the first signature of the first interaction data in the first storage space and the second signature of the second interaction data in the second storage space;
[0024] The first signature is used to verify the first interaction data; the second signature is used to verify the second interaction data.
[0025] In this embodiment, the multiple groups of storage spaces also include a third storage space, in which the signatures of the first interaction data and the second interaction data can be stored, so that the subsequent BIOS and BMC can verify the data obtained in the storage device through the signature to prevent the data from being tampered with, thereby improving the security of data interaction.
[0026] In one embodiment, the first storage space further stores an address of a first piece of data and an address of a last piece of data of the first interactive data; before controlling the BIOS and the BMC to communicate according to the interactive data in the storage device, the method further includes:
[0027] Check whether the address of the first data is greater than the address of the last data;
[0028] If it is greater, BIOS is prohibited from reading and writing data in the first storage space.
[0029] In this embodiment, by detecting whether the address of the first data in the first storage space is greater than the address of the last data, and prohibiting the BIOS or BMC from reading and writing data in the storage space when it is greater, the read and write operations on the storage device can be reduced, and the speed of searching for the latest data can be effectively improved, thereby improving the efficiency of the interaction between the BIOS and the BMC.
[0030] In a second aspect, the present application also provides a data interaction device. The device includes:
[0031] A detection module is used to detect whether the synchronous communication mode between the basic input output system BIOS and the baseboard management controller BMC fails;
[0032] An acquisition module, used for acquiring first interaction data of communication between the BIOS and the BMC, and acquiring second interaction data of communication between the BMC and the BIOS, if the failure occurs;
[0033] The interaction module is used to store the first interaction data and the second interaction data in a preset storage device, and control the BIOS and the BMC to communicate according to the interaction data in the storage device.
[0034] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0035] Check whether the synchronous communication mode between the basic input and output system BIOS and the baseboard management controller BMC fails;
[0036] If it fails, obtaining first interaction data of communication between BIOS and BMC, and obtaining second interaction data of communication between BMC and BIOS;
[0037] The first interaction data and the second interaction data are stored in a preset storage device, and the BIOS and the BMC are controlled to communicate according to the interaction data in the storage device.
[0038] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0039] Check whether the synchronous communication mode between the basic input and output system BIOS and the baseboard management controller BMC fails;
[0040] If it fails, obtaining first interaction data of communication between BIOS and BMC, and obtaining second interaction data of communication between BMC and BIOS;
[0041] The first interaction data and the second interaction data are stored in a preset storage device, and the BIOS and the BMC are controlled to communicate according to the interaction data in the storage device.
[0042] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0043] Check whether the synchronous communication mode between the basic input and output system BIOS and the baseboard management controller BMC fails;
[0044] If it fails, obtaining first interaction data of communication between BIOS and BMC, and obtaining second interaction data of communication between BMC and BIOS;
[0045] The first interaction data and the second interaction data are stored in a preset storage device, and the BIOS and the BMC are controlled to communicate according to the interaction data in the storage device.
[0046] The above-mentioned data interaction method, device, equipment, storage medium and program product detect whether the synchronous communication mode between BIOS and BMC fails, and obtain the first interaction data and the second interaction data of the communication between BIOS and BMC when it fails, and store both the first interaction data and the second interaction data in a preset storage device, and then control BIOS and BMC to communicate based on the interaction data in the storage device. In this method, when the synchronous communication mode between BIOS and BMC is unavailable or fails, it can be switched to an asynchronous communication mode, and the asynchronous communication mode is used to realize data interaction between the two. In this way, no matter what scenario the BIOS and BMC are in, there is no need for BIOS or BMC to wait and restart, and data interaction can be completed between the two, thereby shortening the startup time of BIOS and BMC and even computer equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is an internal structure diagram of a computer device in one embodiment;
[0048] Figure 2 A schematic diagram of a flow chart of a data interaction method in an embodiment;
[0049] Figure 3 is a flow chart of a data interaction method in another embodiment;
[0050] Figure 4A diagram showing an example of a hardware structure connection between a BIOS and a BMC in another embodiment;
[0051] Figure 5 is a flow chart of a data interaction method in another embodiment;
[0052] Figure 6 is a diagram showing an example of a data structure corresponding to a storage device in another embodiment;
[0053] Figure 7 is a flow chart of a data interaction method in another embodiment;
[0054] Figure 8 It is a structural block diagram of a data interaction device in an embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] During the server startup process, there will be a lot of data interaction between the BIOS and BMC in the server. For example, the BIOS will send its own setup options, asset information and other data to the BMC, and will also read some information from the BMC, such as the BMC version, IP address, etc. Due to the different startup speeds of the two, there may be a situation where one of the BIOS and BMC is not ready and the other needs to wait, which will cause the server startup time to be longer; in addition, in some cases, there may be a failure in one of the BIOS and BMC, resulting in the failure to establish a communication connection when the BIOS and BMC are communicating synchronously (such as using IPMI, Redfish and other synchronization methods), making it impossible for the two to exchange information, affecting the remote management function of the server and reducing the operation and maintenance efficiency.
[0057] In response to the above problems, the existing solutions mainly include the following: First, the synchronous communication method of IPMI is used for communication. BIOS uses the input and output IO ports on LPC (specification of low pin count bus interface) and BMC to send IPMI command interaction information; the IPMI services of BIOS and BMC need to be ready to establish communication, otherwise the communication will fail; this method cannot solve the problem of waiting. If a failure occurs, the communication cannot be completed, and the server needs to be restarted to try to re-establish communication. Second, the synchronous communication method of Redfish is used for communication. BIOS uses USB and BMC to send Redfish command interaction information. The USB of BIOS and BMC and the upper-layer Redfish service need to be ready to establish communication, otherwise the communication will fail; this method also cannot solve the problem of waiting. If a failure occurs, the communication cannot be completed, and the server needs to be restarted to try to re-establish communication. The third is to use an asynchronous communication method in which BIOS reads and writes the MMIO (Memory-mapped I / O) of the BMC device. The BIOS writes the MMIO space of the PCIE (serial bus) device on the BMC chip. After the BMC is available, the BMC can obtain the information sent by the BIOS from the MIMO space; however, this method has security vulnerabilities and is currently recommended to be prohibited. Also, because it uses random access memory RAM, it has the disadvantage of power failure and loss, so it has great limitations. The fourth is to use a communication method in which BIOS and BMC read and write the same storage device, such as an erasable programmable read-only memory EEPROM or flash memory Flash, to exchange information asynchronously, but there are also limitations such as being easy to be attacked, easy to conflict in reading and writing, and slow speed. It can be seen that the above technologies are difficult to ensure that data interaction between BIOS and BMC is realized in various scenarios. Based on this, the present application provides a data interaction method, device, equipment, storage medium and program product that can solve the above technical problems.
[0058] The data interaction method provided in the embodiment of the present application can be applied to a computer device, which can be a terminal or a server. Taking the server as an example, its internal structure diagram can be as follows: Figure 1As shown. The computer device includes a processor, a memory and a network interface connected through a system bus; and also includes a BIOS and a BMC (not shown in the figure) connected to the system bus. Among them, the processor of the computer device is used to provide computing and control capabilities, and the processor can control the startup of the BIOS and BMC after the computer device is powered on. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store interaction data between the BIOS and the BMC. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data interaction method is implemented.
[0059] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0060] In one embodiment, Figure 2 As shown, a data interaction method is provided, which is applied to Figure 1 Taking the computer device in the example as an example, the method may include the following steps:
[0061] S202, detecting whether the synchronous communication mode between the basic input output system BIOS and the baseboard management controller BMC fails.
[0062] Among them, BIOS is a set of programs fixed to the read-only memory in the server, which stores the most important basic input and output programs of the computer, the self-test program after power-on, and the system self-starting program, etc. BMC is usually included in the main circuit board of the template or monitored device, which can use sensors to monitor the status of computers, network servers, or other hardware drive devices.
[0063] During the startup process of a computer device, there will be a lot of data interaction between the BIOS and the BMC. For example, the BIOS will send its own data information to the BMC and will also read some information from the BMC accordingly.
[0064] When data is exchanged between BIOS and BMC, synchronous communication is usually used, and the synchronous communication methods here include IPMI, Redfish and other communication methods. When synchronous communication is used, both BIOS and BMC must be fully prepared for synchronous communication, so it is necessary to detect whether the synchronous communication method between BIOS and BMC is valid or invalid.
[0065] Specifically, during the detection, it is possible to detect whether the relevant parameters of the synchronous communication in the BIOS and the BMC are prepared or whether there is a fault in the relevant parameters, so as to obtain the result of whether the synchronous communication method between the two is valid or invalid. For example, if the relevant parameters between the BIOS and the BMC are prepared, the synchronous communication method between the two is valid; if one party is not prepared or both parties are not prepared, the synchronous communication method between the two is invalid; or if there is no fault between the BIOS and the BMC, the synchronous communication method between the two is valid; if at least one party between the BIOS and the BMC is faulty, the synchronous communication method between the two is invalid.
[0066] As an optional embodiment, during the actual detection process, GPIO (General-purpose input / output) can be used to detect whether the synchronous communication mode between BIOS and BMC fails. Since GPIO generally only needs to detect the enable status of high and low levels during detection, the detection performance is good, so it can ensure that BIOS and BMC are always detected, thereby improving the effectiveness of the detection.
[0067] S204: If it fails, obtaining first interaction data for communication between the BIOS and the BMC, and obtaining second interaction data for communication between the BMC and the BIOS.
[0068] In this step, when the synchronous communication mode between the BIOS and the BMC fails, it is determined that the BIOS and the BMC cannot communicate in the synchronous communication mode temporarily. At this time, some interaction data of the BIOS and the BMC in the data interaction process can be obtained.
[0069] The first interactive data refers to the interactive data that the BIOS needs to send to the BMC when the BIOS and the BMC communicate with each other. The first interactive data includes the interactive data that the BIOS needs to send to the BMC through various synchronous communication methods, for example, the interactive data that the BIOS needs to send to the BMC through the IPMI method, the interactive data that the BIOS needs to send to the BMC through the Redfish method, and so on.
[0070] The second interactive data refers to the interactive data that the BIOS needs to read from the BMC when the BMC and the BIOS communicate. The second interactive data includes the interactive data that the BIOS needs to read from the BMC through various synchronous communication methods, such as the interactive data that the BIOS reads from the BMC through the IPMI method, the interactive data that the BIOS reads from the BMC through the Redfish method, and so on.
[0071] The first interaction data and the second interaction data can be obtained from the BIOS or the BMC when the computer device learns that the synchronous communication mode between the BIOS and the BMC fails.
[0072] S206, storing the first interaction data and the second interaction data in a preset storage device, and controlling the BIOS and the BMC to communicate according to the interaction data in the storage device.
[0073] The preset storage device may be a flash memory, a read-only memory, a Flash ROM, or an erasable non-volatile storage device EEPROM, or other shared memory, as long as data storage can be achieved. In addition, the size of the address space corresponding to the preset storage device may be determined according to the size of the storage device actually managed or applied for.
[0074] Specifically, after obtaining the first interaction data of the BIOS and the second interaction data of the BMC, the first interaction data and the second interaction data can be stored in a preset storage device, and corresponding identifiers can be set for distinction. Afterwards, during the communication process, the BIOS and the BMC can realize data interaction between the two by reading the interaction data with the corresponding identifier in the storage device.
[0075] From the above description, it can be seen that the BIOS and BMC read data from the storage device in an asynchronous communication mode. When the synchronous communication mode between the BIOS and BMC is unavailable or invalid, the asynchronous communication mode can be switched to realize data exchange between the two. In this way, the BIOS or BMC does not need to wait and restart, and the two can complete data exchange, thereby shortening the startup time of the BIOS and BMC and even the computer device.
[0076] In the above data interaction method, by detecting whether the synchronous communication mode between BIOS and BMC fails, and obtaining the first interaction data and the second interaction data of the communication between BIOS and BMC when it fails, and storing both the first interaction data and the second interaction data in a preset storage device, the BIOS and BMC are controlled to communicate based on the interaction data in the storage device. In this method, when the synchronous communication mode between BIOS and BMC is unavailable or fails, it can be switched to an asynchronous communication mode, and the data interaction between the two is realized by using the asynchronous communication mode. In this way, no matter what scenario the BIOS and BMC are in, there is no need for the BIOS or BMC to wait and restart, and the data interaction between the two can be completed, thereby shortening the startup time of the BIOS and BMC and even the computer device.
[0077] In another embodiment, another data interaction method is provided. Based on the above embodiment, Figure 3 As shown, controlling the BIOS and the BMC to communicate according to the interactive data in the storage device in the above S206 may include the following steps:
[0078] S302, obtaining the enabling status corresponding to the BIOS and the BMC respectively; the enabling status is used to represent the operating authority of the BIOS and the BMC to the storage device.
[0079] In this step, see Figure 4 The hardware structure connection example diagram between BIOS and BMC shown in FIG. 1 is a diagram in which a multiplexer MUX is provided on the storage device, and both BIOS and BMC can access the storage device through the SPI communication bus and MUX to achieve asynchronous communication. At the same time, when synchronous communication is available, BIOS and BMC can also achieve synchronous communication through LPC (i.e., IPMI communication mode) and USB (Redfish communication mode). In addition, BIOS and BMC can also read the enable status through GPIO.
[0080] Before access, you can also set the enable flag for accessing the storage device for the BIOS and BMC in advance, such as BIOS Flashing and BMC Flashing, where the value of the enable flag represents the enable status. For example, if the enable flag is 0, it means that the BIOS or BMC has the operation permission of not being able to access the storage device, and if the enable flag is 1, it means that the BIOS or BMC has the operation permission of being able to access the storage device.
[0081] Specifically, when obtaining the enable states corresponding to the BIOS and the BMC, the values of the enable flags of the BIOS and the BMC may be read through GPIO to determine the enable states corresponding to the BIOS and the BMC.
[0082] During the access process, the host control of the SPI communication bus of the BIOS and BMC is generally switched through MUX. Specifically, MUX can control whether the respective SPI communication buses of the BIOS and BMC are connected based on the enable status or enable flag value of the BIOS and BMC detected by GPIO, that is, the storage device can be locked through GPIO. Generally, the SPI communication bus connected between the BIOS and MUX is connected by default. Usually, only one SPI communication bus is connected at the same time, that is, only one of the enable flag values of the BIOS and BMC is 1 at the same time, so that the BIOS and BMC can access the storage device through MUX respectively, avoiding the read-write conflict problem caused by simultaneous access to the storage device.
[0083] S304: According to the enabling states corresponding to the BIOS and the BMC, the BIOS and the BMC are controlled to communicate according to the interaction data in the storage device.
[0084] In this step, after obtaining the respective enabling states of the BIOS and the BMC, either of the two can be controlled to access the storage device to achieve data interaction. In the process of data interaction, as an optional embodiment, it can be achieved by the following steps:
[0085] Step A1: determining target operation objects and non-target operation objects corresponding to the storage device from the BIOS and the BMC according to the respective enabling states of the BIOS and the BMC.
[0086] In this step, taking the above-mentioned enable flag as an example, for example, the enable flag BIOS Flashing of BIOS is 1, and the enable flag BMC Flashing of BMC is 0, it indicates that the BIOS has the operation permission to access the storage device, and the BMC has the operation permission to not access the storage device. Here, the object BIOS that can access the storage device can be used as the target operation object, and the object BMC that cannot access the storage device is used as a non-target object.
[0087] Step A2: Control the target operation object to communicate with the non-target operation object based on the interaction data in the storage device.
[0088] In this step, after determining the target operation object and the non-target operation object, the target operation object can be controlled to read or write interaction data in the storage device, wherein the interaction data read is written in the storage device in advance by the non-target operation object, and the interaction data written by the target operation object is subsequently read by the non-target operation object, so that data interaction between the target operation object and the non-target operation object can be achieved by reading and writing data in the storage device.
[0089] In this embodiment, by obtaining the enable states corresponding to the BIOS and BMC, and controlling the two to communicate according to the interactive data in the storage device according to their respective enable states, the enable state is used to indicate the access rights of the BIOS and BMC to the storage device, and generally the two cannot access the storage device at the same time, so the read-write conflict problem caused by simultaneous access to the storage device can be avoided. In addition, in the specific communication process through the enable state, the target operation object and the non-target operation object can be determined from the BIOS and BMC through the enable state, and the target operation object can be controlled to communicate based on the data in the storage device and the non-target operation object, so that the object of the storage device operation can be clearly defined, the communication process can be simplified, and the efficiency and accuracy of the communication between the BIOS and the BMC can be improved.
[0090] In another embodiment, another data interaction method is provided. Based on the above embodiment, Figure 5 As shown, storing the first interaction data and the second interaction data in a preset storage device in the above S206 may include the following steps:
[0091] S402: Divide the storage device into multiple groups of storage spaces according to a preset division method.
[0092] S404: Store the first interaction data in a first storage space among the multiple storage spaces, and store the second interaction data in a second storage space among the multiple storage spaces.
[0093] In this embodiment, the storage device may be pre-divided into at least two groups of storage spaces. Optionally, the storage device may be pre-divided into five groups of storage spaces. Specifically, when the storage device is divided into five groups of storage spaces, the five groups of storage spaces may be respectively recorded as area 1 to area 5, wherein the data structures of area 1 to area 5 may be referred to in Figure 6 The example diagram shown.
[0094] Among them, area 1 is the layout description header area, which has a fixed size and records the starting address, length and signature of areas 2, 3, 4 and 5 (taking area 2 as an example, the starting address is such as Region 2Offset in the figure, the length is such as Region 2Size in the figure, and the signature is such as Region 2Sign in the figure).
[0095] Area 2 to Area 5 each include an area header and a data area. The area header records the address of the first data (First Data Address) and the address of the last data (Last Data Address), and the data area stores interactive data.
[0096] For the area headers in area 2 to area 5, they include data index Index, data type Type, version Version, checksum Checksum and length Length. Among them, Index stores the index number of the data, which starts from 0 and increases; Type is the data type, which is used to describe the type and function of the data; Version is the version of the data format of this data, which is used to ensure the compatibility of the interactive data between BIOS and BMC; Checksum is the checksum of this data, which is used to check the data integrity; Length indicates the length of this data.
[0097] In addition, area 2 and area 4 can be recorded as a first storage space for storing first interactive data. Taking the first interactive data including data sent by BIOS to BMC via IPMI communication and data sent by BIOS to BMC via Redfish communication as an example, the data area of area 2 records the data sent by BIOS to BMC via IPMI communication, and the data area of area 4 records the data sent by BIOS to BMC via Redfish communication.
[0098] Area 3 and area 5 can be recorded as a second storage space for storing second interactive data. For example, the second interactive data includes data read by BIOS from BMC via IPMI communication and data read by BIOS from BMC via Redfish communication, wherein the data area of area 3 records data read by BIOS from BMC via IPMI communication, and the data area of area 5 records data read by BIOS from BMC via Redfish communication.
[0099] For the above-mentioned area 1, it can be recorded as the third storage space, which is used to store the first signature of the first interaction data in the first storage space and the second signature of the second interaction data in the second storage space; the first signature is used to verify the first interaction data; the second signature is used to verify the second interaction data.
[0100] Here, for the data in the first interactive data that the BIOS sends to the BMC via the IPMI communication method, it has a corresponding first signature in the third storage space, namely, area 1. After the BMC reads the first interactive data from the storage, the first signature corresponding to the first interactive data stored in area 1 can be used to verify the first interaction. If the verification passes, it means that the first interactive data has not been tampered with, thereby ensuring the security of the first interactive data stored in the storage device, and further ensuring the security of the communication between the BIOS and the BMC. Here, during the verification process, the key pair can be pre-saved inside the BIOS and the BMC, and after obtaining the interactive data, the data is decrypted using their respective keys for verification. The verification algorithm used during the verification can be a hash algorithm, a digest algorithm, or other algorithms.
[0101] The verification process for the second interactive data is the same as that for the first interactive data, and therefore will not be described in detail.
[0102] In this embodiment, the storage device is divided into multiple groups of storage spaces according to a preset division method, and the first interactive data is stored in the first storage space and the second interactive data is stored in the second storage space. In this way, the storage device can be divided and stored separately, and different interactive data can be better distinguished, so that the BIOS and BMC can quickly obtain their respective corresponding data when accessing the storage device, thereby improving the efficiency and accuracy of data reading and writing. Furthermore, the multiple groups of storage spaces also include a third storage space, in which the signatures of the first interactive data and the second interactive data can be stored, so that the subsequent BIOS and BMC can verify the data obtained in the storage device through the signature, prevent the data from being tampered with, and improve the security of data interaction.
[0103] In another embodiment, another data interaction method is provided. Based on the above embodiment, Figure 7 As shown, the first storage space also stores the address of the first data of the first interactive data and the address of the last data of the first interactive data; before controlling the BIOS and the BMC to communicate according to the interactive data in the storage device in S206, the method may further include the following steps:
[0104] S502, detecting whether the address of the first piece of data is greater than the address of the last piece of data.
[0105] In this step, the above embodiments S402-S404 mentioned that regions 2 to 5 all include a region header and a data region, wherein the region header records the addresses of the first and last data, and the data region stores the interactive data. Figure 6As shown, area 2 and area 4 are the first storage space, and area 3 and area 5 are the second storage space, both of which store the address of the first data and the address of the last data in their own data.
[0106] Taking the first interactive data as an example, each time the BIOS writes the first interactive data in the first storage space, it can pre-determine whether the address of the first data recorded in the first storage space is greater than the address of the last data, for example, determine whether the address of the first data recorded in the respective area headers of area 2 and area 4 is greater than the address of the last data, and obtain the judgment result.
[0107] S504: If it is greater than, prohibit BIOS from reading and writing data in the first storage space.
[0108] In this step, the first data address First Data Address and the last data address LastData Address provide base addresses for convenient forward and reverse order traversal of data. When there is new data, Last Data Address is updated, and when the old data is no longer used, First Data Address is updated.
[0109] Taking area 2 as an example, if the address First Data Address of the first data recorded therein is greater than the address Last Data Address of the last data, it means that the data in area 2 has been read successfully or there is no data update, and there is no need to read it again, that is, it is necessary to prohibit BIOS or BMC from reading and writing data in area 2, which can reduce the read and write operations on the storage device and effectively improve the speed of finding the latest data.
[0110] Similarly, for the second interactive data stored in the second storage space, it is also possible to detect whether there is new data to be read or written in the second storage space in accordance with the detection method of the first storage space. For details, please refer to the detection process of the first storage space above, which will not be repeated here.
[0111] In this embodiment, by detecting whether the address of the first data in the first storage space is greater than the address of the last data, and prohibiting the BIOS or BMC from reading and writing data in the storage space when it is greater, the read and write operations on the storage device can be reduced, and the speed of searching for the latest data can be effectively improved, thereby improving the efficiency of the interaction between the BIOS and the BMC.
[0112] A detailed embodiment is given below to illustrate the process of interaction between BIOS and BMC in the present application. Based on the above embodiment, the implementation process of the method may include the following contents:
[0113] Step 1: The server is powered on and turned on. The BIOS and BMC start the boot process at the same time, initialize GPIO, and set the relevant parameters of the BMC, such as BMC IPMI Ready (representing the preparation mark of the BMC IPMI communication method), BMC Redfish Ready (representing the preparation mark of the BMC Redfish communication method), BMC Flashing (BMC enable mark), etc. GPIO is written by the BMC and read by the BIOS, and the default is 0. At the same time, the GPIO such as BIOS Flashing (BIOS enable mark) is set to be read by the BMC and written by the BIOS, and the default is 0.
[0114] Step 2: BIOS starts, configures and enables IPMI communication, and detects the status of BMC IPMI Ready. If the status is 1, the IPMI communication method is used to synchronize data with the BMC. If the status is 0, the data that the BIOS needs to send to the BMC using the IPMI communication method is sorted and written to area 2 of the storage device. Before the write operation, the BIOS Flashing status is set to 1. At the same time, the data address information in the area header of area 2 is updated.
[0115] Here, the read and write permissions of the storage device are allocated by setting and identifying the GPIO status, which can effectively prevent the operation conflicts between BIOS and BMC on the storage device and avoid data update failure.
[0116] After the BIOS finishes writing data in the storage device, the BIOS Flashing status is set to 0. Then the BIOS attempts to read the data that needs to be obtained from the BMC using the IPMI method from area 3 of the storage device. Before the read operation, the BIOS Flashing status is set to 1 to determine whether the First Data Address is greater than the Last Data Address. If it is greater, it means there is no new data and the data reading process can be skipped. If it is not greater, it means there is new data and the data needs to be read.
[0117] After reading the data, BIOS uses the Region 3Sign digital signature in Region 1 to verify the data read from Region 3. If the verification passes, it proves that the data has not been tampered with, thereby obtaining the read data. After the data is read, the First Data Address in Region 3 is updated to be greater than the Last Data Address, and then the BIOS Flashing is set to 0.
[0118] Step 3: During BIOS startup, configure to enable Redfish communication and detect the status of BMC Redfish Ready. If the status is 1, BIOS uses Redfish communication to synchronize data with BMC; if it is 0, the data that BIOS needs to send to BMC using Redfish communication is sorted and written to area 4 of the storage device. Set the BIOS Flashing status to 1 before the write operation, and set it to 0 after the write is completed. Read the data that BIOS needs to obtain from BMC using Redfish communication from area 5 of the storage device. Set the BIOS Flashing status to 1 before the read operation, and set it to 0 after the read is completed. The operation process for data in area 4 and area 5 is the same as the process of reading and writing data in areas 2 and 3 in step 2.
[0119] Step 4: During BMC startup, configure and enable IPMI communication. After IPMI service is available, set BMC IPMI Ready status to 1. Then check whether BIOS Flashing is 0. If it is 0, set BMC Flashing to 1, read data in area 2, and verify data with corresponding data signature in area 1. Then, determine whether new data needs to be read based on whether First Data Address is greater than Last Data Address. If new data needs to be read, update First Data Address in area 2 to be greater than Last Data Address after reading. Then BMC can write data in area 3, update Last Data Address and update data signature in area 1. Finally, set BMC Flashing to 0 after writing.
[0120] Step 5: During BMC startup, configure and enable Redfish communication. After the Redfish service is available, set the BMC Redfish Ready status to 1. The process of reading and writing area 4 and area 5 is the same as step 4.
[0121] In summary, in the above steps, during the communication process between BIOS and BMC, the synchronous communication parameters set can be used to first detect whether the synchronous communication between the two is available, and when it is not available, it can be switched to asynchronous communication, that is, data is read and written to the storage device, so that BIOS and BMC can access the data in the storage device to realize data interaction between the two, so that there is no need to wait and restart when either party is not ready or fails, and data interaction can be completed between the two, shortening the startup time of the computer device and improving the efficiency of data interaction. At the same time, GPIO is used to detect the enable status of each of BIOS and BMC to lock the storage device, so that the conflict between BIOS and BMC when reading and writing data in the storage device at the same time can be avoided. And the storage device can be divided into multiple groups of storage spaces, and data under different communication modes can be stored, which can simultaneously support data storage of multiple communication modes such as IPMI and Redfish, effectively utilize the characteristics of storage devices, reduce read and write operations, and ensure the accuracy of BIOS and BMC synchronization data. Further, the above method also includes the relevant content of signature verification, so that the data can be prevented from being attacked and tampered by signature verification, and the security of the interactive data during the data interaction process can be ensured.
[0122] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0123] Based on the same inventive concept, the embodiment of the present application also provides a data interaction device for implementing the data interaction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data interaction device embodiments provided below can refer to the limitations on the data interaction method above, and will not be repeated here.
[0124] In one embodiment, Figure 8 As shown, a data interaction device is provided, including: a detection module 11, an acquisition module 12 and an interaction module 13, wherein:
[0125] A detection module 11 is used to detect whether the synchronous communication mode between the basic input output system BIOS and the baseboard management controller BMC fails;
[0126] An acquisition module 12, for acquiring first interaction data of communication between the BIOS and the BMC, and acquiring second interaction data of communication between the BMC and the BIOS, if the failure occurs;
[0127] The interaction module 13 is used to store the first interaction data and the second interaction data in a preset storage device, and control the BIOS and the BMC to communicate according to the interaction data in the storage device.
[0128] Each module in the above data interaction device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0129] In another embodiment, another data interaction device is provided. Based on the above embodiment, the interaction module 13 may include:
[0130] A status acquisition unit, used to acquire the enable status corresponding to the BIOS and the BMC respectively; the enable status is used to represent the operation authority of the BIOS and the BMC to the storage device;
[0131] The interaction unit is used to control the BIOS and the BMC to communicate according to the interaction data in the storage device according to the enabling states corresponding to the BIOS and the BMC respectively.
[0132] Optionally, the above interaction unit may include:
[0133] The object determination subunit is used to determine the target operation object and the non-target operation object corresponding to the storage device from the BIOS and the BMC according to the enable states corresponding to the BIOS and the BMC respectively;
[0134] The interaction subunit is used to control the target operation object to communicate with the non-target operation object based on the interaction data in the storage device.
[0135] In another embodiment, another data interaction device is provided. Based on the above embodiment, the interaction module 13 may further include:
[0136] A storage device division unit, used to divide the storage device into multiple groups of storage spaces according to a preset division method;
[0137] The storage unit is used to store the first interactive data in a first storage space among the multiple storage spaces, and to store the second interactive data in a second storage space among the multiple storage spaces.
[0138] Optionally, the multiple groups of storage spaces also include a third storage space, which is used to store the first signature of the first interaction data in the first storage space and the second signature of the second interaction data in the second storage space; the first signature is used to verify the first interaction data; and the second signature is used to verify the second interaction data.
[0139] In another embodiment, another data interaction device is provided. Based on the above embodiment, the first storage space further stores the address of the first data of the first interaction data and the address of the last data of the first interaction data; before the interaction module 13 controls the BIOS and the BMC to communicate according to the interaction data in the storage device, the device may further include:
[0140] A detection module, used for controlling the BIOS and the BMC to detect whether the address of the first data is greater than the address of the last data before communicating according to the interactive data in the storage device;
[0141] The read-write module is used to prohibit BIOS from reading and writing data in the first storage space if it is greater than.
[0142] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0143] Detect whether the synchronous communication mode between the basic input / output system BIOS and the baseboard management controller BMC fails; if failed, obtain first interactive data for communication between the BIOS and the BMC, and obtain second interactive data for communication between the BMC and the BIOS; store the first interactive data and the second interactive data in a preset storage device, and control the BIOS and the BMC to communicate according to the interactive data in the storage device.
[0144] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0145] The enable states corresponding to the BIOS and the BMC are obtained; the enable states are used to represent the operation permissions of the BIOS and the BMC on the storage device; according to the enable states corresponding to the BIOS and the BMC, the BIOS and the BMC are controlled to communicate according to the interaction data in the storage device.
[0146] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0147] According to the enabling states corresponding to the BIOS and the BMC, the target operation object and the non-target operation object corresponding to the storage device are determined from the BIOS and the BMC; and the target operation object is controlled to communicate with the non-target operation object based on the interaction data in the storage device.
[0148] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0149] The storage device is divided into multiple groups of storage spaces according to a preset division method; the first interactive data is stored in a first storage space in the multiple groups of storage spaces, and the second interactive data is stored in a second storage space in the multiple groups of storage spaces.
[0150] In one embodiment, the multiple groups of storage spaces also include a third storage space, which is used to store the first signature of the first interaction data in the first storage space and the second signature of the second interaction data in the second storage space; the first signature is used to verify the first interaction data; and the second signature is used to verify the second interaction data.
[0151] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0152] Check whether the address of the first data is greater than the address of the last data; if so, prohibit BIOS from reading and writing data in the first storage space.
[0153] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0154] Detect whether the synchronous communication mode between the basic input / output system BIOS and the baseboard management controller BMC fails; if failed, obtain first interactive data for communication between the BIOS and the BMC, and obtain second interactive data for communication between the BMC and the BIOS; store the first interactive data and the second interactive data in a preset storage device, and control the BIOS and the BMC to communicate according to the interactive data in the storage device.
[0155] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0156] The enable states corresponding to the BIOS and the BMC are obtained; the enable states are used to represent the operation permissions of the BIOS and the BMC on the storage device; according to the enable states corresponding to the BIOS and the BMC, the BIOS and the BMC are controlled to communicate according to the interaction data in the storage device.
[0157] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0158] According to the enabling states corresponding to the BIOS and the BMC, the target operation object and the non-target operation object corresponding to the storage device are determined from the BIOS and the BMC; and the target operation object is controlled to communicate with the non-target operation object based on the interaction data in the storage device.
[0159] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0160] The storage device is divided into multiple groups of storage spaces according to a preset division method; the first interactive data is stored in a first storage space in the multiple groups of storage spaces, and the second interactive data is stored in a second storage space in the multiple groups of storage spaces.
[0161] In one embodiment, the multiple groups of storage spaces also include a third storage space, which is used to store the first signature of the first interaction data in the first storage space and the second signature of the second interaction data in the second storage space; the first signature is used to verify the first interaction data; and the second signature is used to verify the second interaction data.
[0162] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0163] Check whether the address of the first data is greater than the address of the last data; if so, prohibit BIOS from reading and writing data in the first storage space.
[0164] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0165] Detect whether the synchronous communication mode between the basic input / output system BIOS and the baseboard management controller BMC fails; if failed, obtain first interactive data for communication between the BIOS and the BMC, and obtain second interactive data for communication between the BMC and the BIOS; store the first interactive data and the second interactive data in a preset storage device, and control the BIOS and the BMC to communicate according to the interactive data in the storage device.
[0166] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0167] The enable states corresponding to the BIOS and the BMC are obtained; the enable states are used to represent the operation permissions of the BIOS and the BMC on the storage device; according to the enable states corresponding to the BIOS and the BMC, the BIOS and the BMC are controlled to communicate according to the interaction data in the storage device.
[0168] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0169] According to the enabling states corresponding to the BIOS and the BMC, the target operation object and the non-target operation object corresponding to the storage device are determined from the BIOS and the BMC; and the target operation object is controlled to communicate with the non-target operation object based on the interaction data in the storage device.
[0170] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0171] The storage device is divided into multiple groups of storage spaces according to a preset division method; the first interactive data is stored in a first storage space in the multiple groups of storage spaces, and the second interactive data is stored in a second storage space in the multiple groups of storage spaces.
[0172] In one embodiment, the multiple groups of storage spaces also include a third storage space, which is used to store the first signature of the first interaction data in the first storage space and the second signature of the second interaction data in the second storage space; the first signature is used to verify the first interaction data; and the second signature is used to verify the second interaction data.
[0173] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0174] Check whether the address of the first data is greater than the address of the last data; if so, prohibit BIOS from reading and writing data in the first storage space.
[0175] It should be noted that the data involved in this application (including but not limited to data used for analysis, data stored, data displayed, etc.) are all data fully authorized by all parties.
[0176] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0177] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0178] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data interaction method, It is characterized in that The method comprises: Check whether the synchronous communication mode between the basic input and output system BIOS and the baseboard management controller BMC fails; If it fails, obtaining first interaction data of communication between the BIOS and the BMC, and obtaining second interaction data of communication between the BMC and the BIOS; The first interaction data and the second interaction data are stored in a preset storage device, and the BIOS and the BMC are controlled to communicate according to the interaction data in the storage device.
2. The method according to claim 1, It is characterized in that The controlling the BIOS and the BMC to communicate according to the interactive data in the storage device includes: Obtaining the enabling status corresponding to each of the BIOS and the BMC; the enabling status is used to represent the operating authority of the BIOS and the BMC on the storage device; According to the enabling states corresponding to the BIOS and the BMC respectively, the BIOS and the BMC are controlled to communicate according to the interaction data in the storage device.
3. The method according to claim 2, It is characterized in that The controlling the BIOS and the BMC to communicate according to the interactive data in the storage device according to the enabling states corresponding to the BIOS and the BMC respectively includes: Determining target operation objects and non-target operation objects corresponding to the storage device from the BIOS and the BMC according to the enable states corresponding to the BIOS and the BMC respectively; The target operation object is controlled to communicate with the non-target operation object based on the interaction data in the storage device.
4. The method according to any one of claims 1 to 3, It is characterized in that The storing the first interaction data and the second interaction data in a preset storage device includes: Dividing the storage device into multiple groups of storage spaces according to a preset division method; The first interaction data is stored in a first storage space among the plurality of storage spaces, and the second interaction data is stored in a second storage space among the plurality of storage spaces.
5. The method according to claim 4, It is characterized in that The plurality of storage spaces further include a third storage space, wherein the third storage space is used to store the first signature of the first interaction data in the first storage space and to store the second signature of the second interaction data in the second storage space; The first signature is used to verify the first interaction data; The second signature is used to verify the second interaction data.
6. The method according to claim 4, It is characterized in that The first storage space also stores an address of a first piece of data and an address of a last piece of data of the first interactive data; before controlling the BIOS and the BMC to communicate according to the interactive data in the storage device, the method further includes: Detect whether the address of the first piece of data is greater than the address of the last piece of data; If it is greater, the BIOS is prohibited from reading and writing data in the first storage space.
7. A data interaction device, It is characterized in that The device comprises: A detection module is used to detect whether the synchronous communication mode between the basic input output system BIOS and the baseboard management controller BMC fails; an acquisition module, configured to acquire first interaction data of communication between the BIOS and the BMC, and acquire second interaction data of communication between the BMC and the BIOS, if the communication fails; The interaction module is used to store the first interaction data and the second interaction data in a preset storage device, and control the BIOS and the BMC to communicate according to the interaction data in the storage device.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
