Interactive command processing method and device, electronic device, and computer program product
By introducing a virtual communication layer into the RAID monitoring service, the server status is monitored in real time, and historical interactive data packets are used to respond to upper-layer applications during shutdown. This solves the communication anomaly problem during server shutdown and improves system stability and user experience.
Patent Information
- Application Number
- CN202510964676.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-14
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-07-14
AI Technical Summary
When the server is shut down, communication timeout, communication failure or abnormal communication content may easily occur when interacting with the RAID card, and the existing technology has not been able to effectively solve the problem.
A virtual communication layer is introduced between the RAID monitoring service and the physical layer to monitor the server's power on and off status in real time. When the server is shut down, the virtual communication layer no longer passes the command to the physical layer, but uses the last interactive data packet to return it to the upper-layer application.
It effectively avoids continuous communication timeouts, failures or content anomalies when the server is shut down, shortens interaction time, prevents false alarms, and improves system stability and user experience.
Smart Images

Figure CN120492221B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage, and in particular to a method and device for processing interactive commands, an electronic device, and a computer program product. Background Art
[0002] OpenBMC (Board Management Controller) provides RAID (Redundant Arrays of Independent Disks) monitoring services, enabling remote viewing of storage information that was previously accessible only in-band (within the server system) out-of-band. RAID card monitoring in OpenBMC includes monitoring of the card controller and both logical and physical drives. Controller information includes manufacturer, model, serial number, version number, speed, temperature, and health status. Logical drive information includes name, capacity, type, read / write policy, and health status. Physical drive information includes manufacturer, model, serial number, capacity, interface type, temperature, software version, and health status. The RAID monitoring service periodically retrieves this information, using a fixed command format and content.
[0003] RAID card-related information must be monitored while the server is powered on. Once the server is powered off, the RAID card and related information will no longer be accessible. The RAID monitoring service cannot predict when the server will be powered off. Therefore, if the RAID monitoring service is communicating with the underlying layer when the server transitions from powered on to powered off, a communication timeout, communication failure, information retrieval anomalies, or communication content anomalies may occur.
[0004] In the related art, when a server is shut down, communication timeouts, communication failures, or abnormal communication content may occur when interacting with a RAID card (Redundant Array of Disk Adapter). Currently, no effective solution has been proposed. Summary of the Invention
[0005] The present application provides a method and apparatus for processing interactive commands, an electronic device, and a computer program product to at least address the problem in the related art of communication timeouts, communication failures, or abnormal communication content that may occur when interacting with a RAID card (Redundant Array of Disks) when the server is shut down.
[0006] The present application provides a method for processing interactive commands, comprising: upon receiving a first interactive command sent by a target object for information interaction with a redundant disk array card through a data transceiver interface function, determining the power on / off state of a server, wherein the data transceiver interface function is set in a virtual communication layer; upon determining that the server is in a power off state, searching a database for a historical interactive record corresponding to the first interactive command; sending first interactive data corresponding to the historical interactive record to the target object, and prohibiting the first interactive command from being sent to the redundant disk array card.
[0007] The present application also provides an interactive command processing device, comprising: a determination module, configured to determine the power on / off state of a server upon receiving a first interactive command sent by a target object for information interaction with a redundant disk array card through a data transceiver interface function, wherein the data transceiver interface function is provided in a virtual communication layer; a search module, configured to search a database for historical interactive records corresponding to the first interactive command upon determining that the server is in a shutdown state; and a sending module, configured to send first interactive data corresponding to the historical interactive record to the target object, and prohibit sending the first interactive command to the redundant disk array card.
[0008] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of the above-mentioned method for processing any one of the interactive commands when executing the computer program.
[0009] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the method for processing any of the above-mentioned interactive commands are implemented.
[0010] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned interactive command processing methods when the computer program is executed by a processor.
[0011] This application provides a virtual communication layer between the RAID monitoring service and the physical layer. Every command communicating with the RAID card must pass through the virtual communication layer. The virtual communication layer can obtain the server's power-on and power-off status in real time. When the server is shut down, the virtual communication layer no longer passes commands to the physical layer. Instead, it uses the last data to assemble a data packet (i.e., the first interaction data) and returns it to the upper-layer application (i.e., the target object). This way, when the server is shut down, if the upper-layer application still attempts to communicate with the lower layer, there will be no continuous communication timeouts, communication failures, or abnormal communication content. This can greatly shorten the interaction time during shutdown and avoid abnormal situations such as false alarms caused by abnormal communication content. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0013] Figure 1 This is a hardware structure block diagram of a computer terminal according to a method for processing interactive commands in an embodiment of the present application;
[0014] Figure 2 is a flowchart of a method for processing an interactive command according to an embodiment of the present application;
[0015] Figure 3 is a flowchart (1) of an optional RAID information monitoring according to an embodiment of the present application;
[0016] Figure 4 is a flow chart (II) of an optional RAID information monitoring according to an embodiment of the present application;
[0017] Figure 5 This is a flowchart of an optional interactive naming execution method according to an embodiment of the present application;
[0018] Figure 6 This is a structural block diagram of a device for processing interactive commands according to an embodiment of the present application. DETAILED DESCRIPTION
[0019] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0020] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0021] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0022] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the interactive command processing method depends, the specific application environment architecture or specific hardware architecture is described here.
[0023] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or similar computing device. Taking running on a computer terminal as an example, Figure 1 FIG. 1 is a hardware structure diagram of a computer terminal according to a method for processing interactive commands in an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. The computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. For example, the computer terminal may also include Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0024] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the startup method of the operating system in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0025] Transmission device 106 is used to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by a computer terminal's communications provider. In one embodiment, transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0026] In this embodiment, a method for processing interactive commands is provided, including but not limited to being applied to a computer terminal. Figure 2 is a flowchart of a method for processing interactive commands according to an embodiment of the present application, such as Figure 2 As shown, the method includes the following steps S202-S206:
[0027] Step S202, determining the power on / off state of the server when a first interaction command for interacting with a redundant array of disks card is received from a target object via a data transceiver interface function, wherein the data transceiver interface function is provided in a virtual communication layer;
[0028] Step S204: When it is determined that the server is in a shutdown state, searching a database for a historical interaction record corresponding to the first interaction command;
[0029] Step S206: sending the first interaction data corresponding to the historical interaction record to the target object, and prohibiting the first interaction command from being sent to the redundant array of disks card.
[0030] Through the above steps, a virtual communication layer is established between the RAID monitoring service and the physical layer. Every command sent to the RAID card passes through this virtual communication layer, which provides real-time information on the server's power-on and power-off status. When the server is shut down, the virtual communication layer no longer passes commands to the physical layer. Instead, it uses the last data to assemble a data packet (the first interaction data) and returns it to the upper-layer application (the target object). This prevents continuous communication timeouts, communication failures, or communication anomalies from occurring during server shutdown, even if the upper-layer application continues to attempt to communicate with the lower layer. This significantly reduces interaction time during shutdown and avoids false alarms caused by communication anomalies.
[0031] In an exemplary embodiment, after determining the power on / off status of the server, the method further includes: when it is determined that the server is in the power on state, sending the first interaction command to the disk redundant array card; receiving second interaction data sent by the disk redundant array card, and determining the power on / off status of the server again, wherein the second interaction data corresponds to the first interaction command; when it is determined that the server is in the power off state, searching the database for the historical interaction records, sending the first interaction data to the target object, and deleting the second interaction data.
[0032] After confirming that the server's power-on status is on, the first interaction command is passed to the disk redundant array card. Subsequently, the second interaction data fed back by the disk redundant array card is received. While receiving the second interaction data, it is again verified whether the server is currently in the power-on state. If the server status has changed to the off state, the database is searched to extract the historical interaction records that match the first interaction command. Based on the found historical interaction records, the corresponding first interaction data is delivered to the target object. This behavior replaces the actual communication with the underlying RAID card. At the same time, considering that the second interaction data in the off state may contain abnormal or irrelevant information, measures are taken to remove it from the system to prevent interference with the subsequent normal monitoring process.
[0033] It's important to note that a Redundant Array of Independent Disks (RAID) card provides data redundancy and improves storage performance, particularly in server environments, where it manages a logical storage space comprised of multiple physical disks. The first interactive command is a set of instructions generated by upper-layer applications to query or control the RAID card. It contains specific request information, such as requesting the card's health status or making configuration changes. The target object refers to the upper-layer application or monitoring interface, which is responsible for receiving data packets from the virtual communication layer and parsing and displaying them to the end user or performing further processing. The database stores historical interaction records of all successful commands and responses to the RAID card, forming a reference data pool. This is crucial for simulating normal communication during a server shutdown. The second interactive data, the RAID card's response to the first interactive command, normally contains the specific information requested by the user. However, when the server is shut down, this data may become meaningless or even erroneous, and therefore needs to be promptly deleted.
[0034] By adopting the above mechanism, the server status is monitored in real time through the virtual communication layer and the interaction strategy with the underlying RAID card is intelligently adjusted, which effectively solves the problem of being unable to monitor the RAID status normally when the server is shut down, and improves the stability of the overall system and user experience.
[0035] Optionally, after receiving the second interaction data sent by the redundant disk array card and re-determining the power on / off status of the server, the method further includes: if it is determined that the server is in the power on state, sending the second interaction data to the target object.
[0036] After receiving the second interactive data fed back by the redundant disk array card, the server operation status is rechecked. If it is determined that the server is still in the boot state, the second interactive data is determined to be valid and sent to the target object.
[0037] It should be noted that the target object refers to the upper-level application or monitoring system, which is the interface or component directly facing the user. It is responsible for presenting and processing various types of information from the RAID card, including but not limited to health status, storage capacity, read and write performance and other data, so that users can understand the operating status of the storage device in real time.
[0038] The entire process emphasizes state verification before and after data transmission. This additional layer of assurance not only ensures the accuracy and timeliness of data flows but also enhances the robustness of the system, enabling efficient monitoring and management even in complex operating environments. This allows the system to respond appropriately to server status changes instantly, avoiding unnecessary data loss or processing errors and providing users with a consistent and reliable monitoring experience.
[0039] Optionally, when it is determined that the server is in the power-on state, the first interaction command is sent to the disk redundant array card, and the method further includes: searching the database for the historical interaction record; when the historical interaction record is not found, establishing the historical interaction record according to the first interaction command, and assigning a null value to the first interaction data corresponding to the historical interaction record.
[0040] Once the server is confirmed to be operational, the first interactive command is immediately delivered to the redundant disk array card. The system then searches the database for corresponding historical interactive records, aiming to locate historical transactions that match the current command. If no relevant historical records are found in the database, the system quickly responds by creating a dedicated historical interactive record entry for the first interactive command and setting the initial value of the first interactive data field under this entry to empty.
[0041] The creation and maintenance of historical interaction records is crucial for building simulated responses using past data in exceptional circumstances, such as server shutdowns, to avoid system-level outages or false alarms. When a command is encountered for the first time, it is added to the historical interaction record and the response data is set to empty, laying the foundation for subsequent command processing and data simulation. This mechanism ensures a certain degree of service continuity through software-level patches, even in the absence of real-time responses, optimizing the overall user experience.
[0042] Optionally, after receiving the second interaction data sent by the disk redundant array card and re-determining the power-on / power-off status of the server, the method further includes: searching the database for the historical interaction record when it is determined that the server is in the power-on state; filling the historical interaction record with the second interaction data when it is determined that the first interaction data corresponding to the historical interaction record is a null value; and updating the first interaction data according to the second interaction data when it is determined that the first interaction data corresponding to the historical interaction record is not a null value.
[0043] After receiving the second interaction data from the redundant disk array card, the server power status is immediately checked. If the server is confirmed to be online, the historical interaction records in the database are immediately searched, focusing on the record details related to the current command. If the first interaction data in the historical interaction record is empty, the second interaction data is injected into the historical interaction record as the basis for subsequent similar requests. If the first interaction data in the historical interaction record is filled with data, the first interaction data is updated based on the second interaction data to ensure that the stored information is always kept up to date.
[0044] Through this series of operations, not only the effective storage and updating of data is achieved, but also the flexibility and robustness of the system are enhanced. Even when the server status changes, it can maintain continuous responsiveness to external requests through intelligent processing at the software level, thereby optimizing the overall performance of the system.
[0045] Optionally, when it is determined that the server is in a shutdown state, after searching the database for the historical interaction records, the method further includes: when the historical interaction records are not found, sending a preset exception message to the target object, wherein the preset exception message is used to indicate that the server is in a shutdown state and the first interaction data is missing from the database.
[0046] Once it is determined that the server has entered offline mode, the indexing process of historical interaction records will be started in the database. If the query results show that there is no corresponding interaction data record in the past, the system will immediately generate a preset exception notification for the refrigerator target object to clearly convey the fact that the server is in shutdown state and the database is missing the first interaction data.
[0047] The server's shutdown state triggered the virtual communication layer to redirect data flows from direct hardware communication to database retrieval, simulating a normal interaction process. Without historical data to support it, the system's ability to send a pre-set exception message demonstrated both accurate perception of server status and the integrity control within the database management mechanism, highlighting the solution's robustness in handling various unexpected situations and its user-centric design principles.
[0048] Optionally, determining the power on / off status of the server includes: sending a status determination command to the server at a preset frequency, wherein the status determination command is used to determine the power on / off status of the server, and the preset frequency is greater than a preset threshold; receiving status information returned by the server, and storing the status information in the virtual communication layer; when two adjacent status information received are different, sending the status determination command to the server again to verify the power on / off status of the server; when a first interaction command or a second interaction data is received, obtaining the latest status information from the virtual communication layer to determine the power on / off status of the server based on the latest status information.
[0049] In order to grasp the server status in real time, the system regularly sends status confirmation commands to the server at a frequency higher than the preset threshold. This command is specifically used to inquire whether the server is currently online. The status information returned by each status confirmation command will be integrated into the memory library of the virtual service layer for subsequent query and analysis. In the case of a status contrast before and after receiving the status information, the system will proactively initiate a new round of status confirmation commands to reconfirm the true status of the server and prevent misjudgment due to signal interference or other technical factors. Whenever the upper-layer application submits the first interactive command or receives the second interactive data from the RAID card, the virtual communication layer immediately calls the latest status information stored in itself, and uses this as a basis to accurately determine whether the server is in the power-on or power-off state, ensuring the smoothness of the command chain and the accuracy of command execution.
[0050] The core advantage of this mechanism is that it effectively compensates for the uncertainty and lag of hardware communication in the face of server status changes through dynamic monitoring and decision-making at the software level, thereby improving the responsiveness and operational smoothness of the entire system, especially when dealing with sudden state switching.
[0051] It should be noted that in the related technology, OpenBMC provides a RAID monitoring service, which is used to put storage information that can only be accessed or viewed in-band (within the server system) out of band for users to view remotely. The monitoring of RAID cards in OpenBMC includes card controller monitoring and monitoring of logical disks and physical disks. The controller information includes manufacturer, model, serial number, version number, speed, temperature, health status, etc. Logical disk information includes name, capacity, type, read and write policy, health status, etc. Physical disk information includes manufacturer, model, serial number, capacity, interface type, temperature, software version, health status, etc. The RAID monitoring service will periodically obtain the information that needs to be monitored, and the acquisition of each information has a fixed command format and content. The basic process of RAID information monitoring is as follows: Figure 3 As shown, it determines whether the server is powered on. If so, the subsequent process of obtaining RAID card controller information, physical disk information, and logical disk information is executed. If not, it continues to wait for the server to power on. Therefore, home security monitoring of RAID card-related information must be performed when the server is powered on. After the server is powered off, the RAID card and related information will no longer be accessible. The RAID monitoring service cannot predict the server shutdown time. Therefore, when the server transitions from powered on to powered off, if the RAID monitoring service is communicating with the underlying layer, a communication timeout, communication failure, information acquisition anomaly, or abnormal communication content may occur.
[0052] Obviously, the embodiments described above are only part of the embodiments of the present application, rather than all the embodiments. In order to better understand the above method, the above process is described below in conjunction with the embodiments, but it is not intended to limit the technical solutions of the embodiments of the present application. Specifically:
[0053] In the related art, another RAID card information monitoring process is also provided, such as Figure 4 As shown, during the periodic acquisition of RAID card information, server power-on status checks are added at multiple key nodes. If the server is detected to be powered off, the monitoring process is exited and no longer interacts with the underlying RAID card. For example, power-on status checks are added before acquiring key module information, and server power-on status checks are added before acquiring controller information, physical disk information, and logical disk information.
[0054] However, this method requires adding repeated server power-on status check code at multiple key nodes, which creates code redundancy and increases the complexity of the code flow. Furthermore, acquiring module information requires multiple instructions. Simply adding server power-on status check before key nodes cannot cover all commands. This can still lead to errors in multiple commands communicating with the RAID card during server shutdown, long abnormal interactions, frequent errors, and false alarms caused by abnormal returned data.
[0055] To address the aforementioned issues, this application adds a virtual communication layer between the upper-layer application and the physical layer in OpenBMC RAID card monitoring. Every command communicating with the underlying RAID card must pass through the virtual communication layer. The virtual communication layer determines the server's power-on and power-off status in real time. When the server is powered on, the virtual communication layer operates transparently, passing data packets to the physical layer for actual data exchange with the RAID card. However, when the server transitions from powered on to powered off, if an upper-layer application still attempts to communicate with the underlying layer, the virtual communication layer reassembles a data packet using the data from the previous successful communication with that command and returns it to the upper-layer application, bypassing the physical layer for actual information exchange with the underlying RAID card. This prevents continuous communication timeouts and failures even when upper-layer applications attempt to communicate with the RAID card after the server is powered off. False alarms due to abnormal communication data content are also eliminated. This method centrally processes interactive commands, minimally altering the existing code content and structure, and covering every communication command.
[0056] The execution process of the interactive command execution method provided by this application is as follows Figure 5 As shown, when the server is powered on and the RAID monitoring upper-layer application is interacting normally with the RAID card, the virtual communication layer needs to record and update command request data and return data. When a command requesting data enters the virtual communication layer, the virtual communication layer needs to check whether the command is recorded in the database. If not, the command is stored in the database. If the command already exists in the database, no record is required. When the command return data reaches the virtual communication layer, the virtual communication layer needs to find the command corresponding to the return data. If there is no content in the command return data temporary storage unit, the return data is stored in the return data temporary storage unit. If there is content in the return data temporary storage unit, the content is updated with the new data.
[0057] The following uses an example to introduce the specific implementation process of the above interactive command execution method, taking a simplified RAID monitoring process as an example. Among them, the access to the RAID card controller is taken as an example by command C-1, the access to the physical disk is taken as an example by command P-1, and the access to the logical disk is taken as an example by command L-1.
[0058] 1. OpenBMC provides RAID monitoring services, including controllers, logical disks, and physical disks. You can use command C-1 to obtain controller information, command P-1 to obtain physical disk information, and command L-1 to obtain logical disk information.
[0059] 2. The OpenBMC RAID monitoring service provides a virtual communication layer that supports real-time acquisition of server power-on and power-off status, and supports the storage, reading, and retrieval of large amounts of data.
[0060] 3. The virtual communication layer provides a data transceiver interface function Function1 to replace the original interactive command interface Interface1. The commands that previously interacted with the RAID card uniformly called this interface function to ensure that all interactive commands must pass through the virtual communication layer;
[0061] 4. When the interactive command X-1 (X-1 is any of C-1, P-1, and L-1) reaches the virtual communication layer, the virtual communication layer determines the current server power-on / off status. If the server is powered on (see step 6 for the power-off status process), the command is passed to the physical layer according to the previous process and interacts with the RAID card normally. At the same time, the virtual communication layer checks whether the command X-1 is in its own database. If not, it creates a record for it in the database and records the command in the command key.
[0062] 5. When the virtual communication layer receives the return data of command X-1 from the RAID card, it again determines the server's power-on / off status. If the server is still powered on (see step 7 for the power-off status process), the return data is passed to the upper-layer application as normal. At the same time, the record of command X-1 is found in the database and the return data is stored in the corresponding command return value. (If there is no value in the command return value, it means that the command is executed for the first time, and the return data is used to fill it; if there is already a value in the command return value, it means that the command has been executed before, and the new return data is used to update the command return value (as shown in Table 1)).
[0063] Table 1 Command record content in the database
[0064]
[0065] 6. When the interactive command X-1 reaches the virtual communication layer, the virtual communication layer determines the power-on / off status of the current server. If the server is already powered off, it searches the database for the record of command X-1 and directly returns the return value of command X-1 to the upper-layer application without communicating with the underlying RAID card.
[0066] 7. When the virtual communication layer receives the return data of command X-1 from the RAID card, it again determines the server's power-on / off status. If the server is already powered off, it searches the database for the record of command X-1 and directly returns the return value of command X-1 to the upper-layer application without passing the abnormal data of this underlying interaction to the upper-layer application.
[0067] The present application proposes a method for resolving data anomalies between RAID card monitoring and underlying layers during server shutdown using OpenBMC. This method uses a virtual communication layer to simulate normal interaction with the RAID card at shutdown time, returning previously recorded communication data to upper-layer applications. Software operations replace underlying data interactions, accelerating exception handling in shutdown scenarios and avoiding issues such as continuous communication timeouts, communication failures, and abnormal interaction data content during shutdown. This method also avoids false alarms from upper-layer applications. The virtual communication layer uses a unified interaction interface to respond to upper-layer commands, covering every interaction command without significantly altering existing code structures and processes.
[0068] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0069] The embodiment of the present application also provides a device for processing interactive commands. Figure 6 is a processing device for interactive commands according to an embodiment of the present application, such as Figure 6 As shown, the device includes:
[0070] a determination module 62 configured to determine the power on / off state of the server upon receiving a first interaction command for interacting with a redundant array of disks card from a target object via a data transceiver interface function, wherein the data transceiver interface function is provided in a virtual communication layer;
[0071] A search module 64 is configured to search a database for historical interaction records corresponding to the first interaction command when it is determined that the server is in a shutdown state;
[0072] The sending module 66 is configured to send the first interaction data corresponding to the historical interaction record to the target object, and prohibit sending the first interaction command to the redundant array of disks card.
[0073] The above device provides a virtual communication layer between the RAID monitoring service and the physical layer. Every command sent to the RAID card passes through the virtual communication layer, which provides real-time access to the server's power-on and power-off status. When the server is powered off, the virtual communication layer no longer passes commands to the physical layer. Instead, it uses the last data to assemble a data packet (the first interaction data) and returns it to the upper-layer application (the target object). This prevents continuous communication timeouts, communication failures, or communication anomalies from occurring during server shutdown, even if the upper-layer application continues to attempt to communicate with the lower layer. This significantly reduces interaction time during shutdown and avoids false alarms and other anomalies caused by communication anomalies.
[0074] Optionally, the determination module 62 is further used to send the first interaction command to the disk redundant array card when it is determined that the server is in the power-on state; receive second interaction data sent by the disk redundant array card, and again determine the power-on / off state of the server, wherein the second interaction data corresponds to the first interaction command; and when it is determined that the server is in the power-off state, search the database for the historical interaction records, send the first interaction data to the target object, and delete the second interaction data.
[0075] Optionally, the determining module 62 is further configured to send the second interaction data to the target object when it is determined that the server is in a powered-on state.
[0076] Optionally, the above-mentioned determination module 62 is used to search the historical interaction record in the database; if the historical interaction record is not found, establish the historical interaction record according to the first interaction command, and assign a null value to the first interaction data corresponding to the historical interaction record.
[0077] Optionally, the above-mentioned determination module 62 is also used to search the historical interaction record in the database when it is determined that the server is in the power-on state; fill the second interaction data into the historical interaction record when it is determined that the first interaction data corresponding to the historical interaction record is a null value; and update the first interaction data according to the second interaction data when it is determined that the first interaction data corresponding to the historical interaction record is not a null value.
[0078] Optionally, the search module 64 is further configured to send a preset exception message to the target object if the historical interaction record is not found, wherein the preset exception message is configured to indicate that the server is in a shutdown state and the first interaction data is missing from the database.
[0079] Optionally, the above-mentioned determination module 62 is also used to send a status determination command to the server at a preset frequency, wherein the status determination command is used to determine the power on / off status of the server, and the preset frequency is greater than a preset threshold; receive the status information returned by the server, and store the status information in the virtual communication layer; when two adjacent status information received are different, send the status determination command to the server again to verify the power on / off status of the server; when the first interaction command or the second interaction data is received, obtain the latest status information from the virtual communication layer to determine the power on / off status of the server according to the latest status information.
[0080] For the description of the features in the embodiment corresponding to the interactive command processing device, please refer to the relevant description of the embodiment corresponding to the interactive command processing method, which will not be repeated here.
[0081] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned embodiments of the method for processing interactive commands.
[0082] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned interactive command processing method embodiments when running.
[0083] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0084] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned methods for processing interactive commands are implemented.
[0085] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps in the above-mentioned method for processing any one of the interactive commands.
[0086] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0087] The above is a detailed introduction to the interactive command processing method and device, electronic device, and computer program product provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A method for processing interactive commands, characterized in that: include: determining the power on / off state of the server upon receiving a first interaction command for interacting with a redundant array of disks card sent by a target object through a data transceiver interface function, wherein the data transceiver interface function is provided in a virtual communication layer; When it is determined that the server is in a shutdown state, searching a database for a historical interaction record corresponding to the first interaction command; Sending the first interaction data corresponding to the historical interaction record to the target object, and prohibiting the first interaction command from being sent to the redundant disk array card; Determining the server's power on / off status includes: sending a status determination command to the server at a preset frequency, wherein the status determination command is used to determine the power on / off status of the server, and the preset frequency is greater than a preset threshold; receiving status information returned by the server, and storing the status information in the virtual communication layer; When the two adjacent pieces of status information received are different, sending the status determination command to the server again to verify the power on / off status of the server; When the first interaction command or the second interaction data is received, the latest status information is obtained from the virtual communication layer to determine the power on / off status of the server according to the latest status information.
2. The method for processing interactive commands according to claim 1, wherein: After determining the power-on / off status of the server, the method further includes: When it is determined that the server is in a powered-on state, sending the first interactive command to the redundant array of disks card; receiving second interaction data sent by the redundant disk array card, and determining the power on / off status of the server again, wherein the second interaction data corresponds to the first interaction command; When it is determined that the server is in a shutdown state, the historical interaction record is searched in the database, the first interaction data is sent to the target object, and the second interaction data is deleted.
3. The method for processing interactive commands according to claim 2, characterized in that: After receiving the second interaction data sent by the redundant disk array card and re-determining the power on / off status of the server, the method further includes: When it is determined that the server is in the powered-on state, the second interaction data is sent to the target object.
4. The method for processing interactive commands according to claim 2, wherein: When it is determined that the server is in a powered-on state, sending the first interactive command to the redundant array of disks card, the method further includes: Searching the database for the historical interaction record; In the case that the historical interaction record is not found in the search, the historical interaction record is created according to the first interaction command, and the first interaction data corresponding to the historical interaction record is assigned a null value.
5. The method for processing interactive commands according to claim 2, characterized in that: After receiving the second interaction data sent by the redundant disk array card and re-determining the power on / off status of the server, the method further includes: When it is determined that the server is in a powered-on state, searching the database for the historical interaction record; If it is determined that the first interaction data corresponding to the historical interaction record is a null value, filling the second interaction data into the historical interaction record; When it is determined that the first interaction data corresponding to the historical interaction record is not a null value, the first interaction data is updated according to the second interaction data.
6. The method for processing interactive commands according to claim 1 or 2, characterized in that: When it is determined that the server is in a shutdown state, after searching the database for the historical interaction record, the method further includes: In the case that the historical interaction record is not found, a preset exception message is sent to the target object, wherein the preset exception message is used to indicate that the server is in a shutdown state and the first interaction data is missing from the database.
7. A device for processing interactive commands, characterized in that: include: a determination module configured to determine the power on / off state of the server upon receiving a first interaction command for information interaction with a redundant array of disks card sent by a target object through a data transceiver interface function, wherein the data transceiver interface function is provided in a virtual communication layer; A search module, configured to search a database for historical interaction records corresponding to the first interaction command when determining that the server is in a shutdown state; a sending module, configured to send the first interaction data corresponding to the historical interaction record to the target object, and prohibit sending the first interaction command to the redundant disk array card; Wherein, the determination module is further used to send a status determination command to the server at a preset frequency, wherein the status determination command is used to determine the power on / off status of the server, and the preset frequency is greater than a preset threshold; receive status information returned by the server, and store the status information in the virtual communication layer; when two adjacent status information received are different, send the status determination command to the server again to verify the power on / off status of the server; when the first interaction command or the second interaction data is received, obtain the latest status information from the virtual communication layer to determine the power on / off status of the server according to the latest status information.
8. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the method according to any one of claims 1 to 6 when executing the computer program.
9. A computer program product comprising a computer program, 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.
Citation Information
Patent Citations
RAID 5 disk array monitoring method, device and equipment and medium
CN109634531A
State query method, device, system and equipment of logic disk and storage medium
CN118708133A