WO2022052407A1 - 一种设备控制方法、系统、电子设备及存储介质 - Google Patents

一种设备控制方法、系统、电子设备及存储介质 Download PDF

Info

Publication number
WO2022052407A1
WO2022052407A1 PCT/CN2021/073450 CN2021073450W WO2022052407A1 WO 2022052407 A1 WO2022052407 A1 WO 2022052407A1 CN 2021073450 W CN2021073450 W CN 2021073450W WO 2022052407 A1 WO2022052407 A1 WO 2022052407A1
Authority
WO
WIPO (PCT)
Prior art keywords
command
command line
control
control command
target hardware
Prior art date
Application number
PCT/CN2021/073450
Other languages
English (en)
French (fr)
Inventor
姜辉
Original Assignee
苏州浪潮智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Publication of WO2022052407A1 publication Critical patent/WO2022052407A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions

Definitions

  • the present application relates to the field of computer technology, and in particular, to a device control method, a system, an electronic device, and a storage medium.
  • the main function of the control command line for chassis management is that the user can control the relevant hardware devices on the storage device through the input of the command line, such as lighting the chassis alarm light or restarting the device. Therefore, the command line can display the control results. It can quickly and accurately inform users to guide users to follow-up operations.
  • the execution of the control commands of the storage device is mainly realized by two modules: the upper-layer module is responsible for the parsing and processing of the command line and packaged and delivered to the lower-layer execution module, and the lower-layer execution module actually executes the specific hardware control commands.
  • the interaction between the upper and lower systems adopts asynchronous processing to improve the return efficiency of the command, but this method brings the uncertainty of the command execution.
  • the successful return of the upper layer does not mean that the actual physical device has successfully received the command. Or if the physical link is faulty, the command is issued successfully but the physical device is not actually changed and controlled.
  • the purpose of this application is to provide a device control method, a system, an electronic device, and a storage medium, which can improve the accuracy of command line execution results.
  • the present application provides a device control method, which includes:
  • control command line If the control command line is verified through the command line and the device status is normal, encapsulate the control command line to obtain a control command, and send the control command to the lower-level execution module, so that the lower-level execution module can The target hardware executes the operation corresponding to the control command;
  • control command line fails the command line verification, the device control process is terminated, and a corresponding error code is returned according to the command line verification result.
  • control class command line after receiving the control class command line, it also includes:
  • the device state includes node state and chassis state, the node state is used to describe whether the node is online, the chassis state is used to describe whether the chassis is online, and the device state is determined when both the node state and the chassis state are online normal.
  • the device control process is terminated, and a corresponding error code is returned according to the device state.
  • perform command line verification on the control command line including:
  • sending the control command to the lower layer execution module includes:
  • the device control process is terminated, and an error code of the failure of command issuing is returned.
  • the link for issuing the control command is switched, so as to repeatedly send the control command to the lower-layer execution module through a new link.
  • the application also provides a device control system, the device control system includes:
  • a command-line verification module used for receiving a control-type command line, and performing command-line verification on the control-type command line
  • a command issuing module is configured to encapsulate the control command line to obtain a control command if the control command line is verified through the command line and the device state is normal, and send the control command to the lower-layer execution module, so that the lower-layer execution module executes the operation corresponding to the control command to the target hardware;
  • a hardware state reading module configured to read the state information of the target hardware according to a preset period, and record the number of readings of the state information of the target hardware
  • the command execution feedback module is used to determine that the command is successfully executed if the state information of the target hardware is the same as the preset state information; if the number of readings of the state information of the target hardware is greater than or equal to the preset value, then It is determined that the execution of the control command is abnormal, and the device control flow is terminated.
  • the present application also provides a storage medium on which a computer program is stored, and when the computer program is executed, the steps performed by the above-mentioned device control method are implemented.
  • the present application also provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor invokes the computer program in the memory, the steps performed by the above-mentioned device control method are implemented.
  • the present application provides a device control method, comprising: receiving a control command line, and performing command line verification on the control command line; if the control command line passes the command line verification and the device is in a normal state, Then encapsulate the control class command line to obtain a control command, and send the control command to the lower-layer execution module, so that the lower-layer execution module executes the operation corresponding to the control command on the target hardware; read the control command according to the preset cycle state information of the target hardware, and record the number of readings of the state information of the target hardware; if the state information of the target hardware is the same as the preset state information, it is determined that the command is executed successfully; If the number of readings is greater than or equal to the preset value, it is determined that the control command is executed abnormally, and the device control process is terminated.
  • the present application performs command line verification after receiving the control command line. If the control command line passes the command line verification and the device status is normal, the control command is obtained by encapsulating the control command line. After the control command is sent to the lower-level execution module, the lower-level execution module can execute the operation corresponding to the control command to the target hardware.
  • the present application judges whether the control instruction is successfully executed by reading the state information of the target hardware. If the state information of the target hardware is different from the preset state information, the reading is repeated at intervals of a preset period of time until the state information of the target hardware is equal to the preset state. The information is the same or the number of repetitions is greater than or equal to the preset value.
  • the present application uses the state information of the target hardware as the basis for evaluating whether the control instruction is successfully executed, and re-reads the state information of the target hardware after a certain period of time after the state information of the target hardware is not the preset state information. Compared with the related art, the command is issued to the lower layer. After the execution of the module, the successful execution scheme is returned, and the present application can improve the accuracy of the command line execution result.
  • the present application also provides a device control system, a storage medium, and an electronic device, which have the above beneficial effects, and are not repeated here.
  • FIG. 1 is a flowchart of a device control method provided by an embodiment of the present application.
  • FIG. 2 is a flowchart of a method for sending a control command provided by an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of an interactive system based on a control command line of a storage device provided by an embodiment of the present application;
  • FIG. 4 is a schematic structural diagram of a device control system provided by an embodiment of the present application.
  • FIG. 1 is a flowchart of a device control method provided by an embodiment of the present application.
  • this embodiment can be applied to a storage device, and the storage device includes an upper-layer command processing module, a lower-layer execution module, and hardware; the upper-layer command processing module can receive a control-type command line input by a user, and encapsulate the control-type command line obtained by encapsulating the control-type command line. The command is sent to the lower-layer execution module, and the lower-layer execution module can perform corresponding control operations on the hardware according to the control command.
  • a command-line verification operation may be performed on the control-type command line. If the control command line fails the command line verification, the device control process is terminated, and a corresponding error code is returned according to the command line verification result.
  • the command line verification operation may include command line format verification and command line parameter verification. Each type of control command line may have its corresponding standard format and standard parameter matching rules. This embodiment may be executed according to the type of control command line. Command line verification operation.
  • the process of executing the command line verification may include: judging whether the format of the control command line is correct, and obtaining a first judgment result; judging the control class Whether the parameters of the command line are correct, a second judgment result is obtained; if both the first judgment result and the second judgment result are yes, it is judged that the control command line passes the command line verification; if the If both the first judgment result and the second judgment result are not yes, it is determined that the control command line fails the command line verification.
  • the first judgment result is no, it can be determined that the command line is abnormal and the device control process is terminated, and an error code that the command line format is wrong can also be output; if the second judgment result is no, it can be determined that the command line There is an exception in the line and the device control process is terminated, and an error code that the command line parameter is wrong can also be output.
  • the device status can be obtained and whether the device status is normal.
  • the device status can include node status and chassis.
  • the node state is used to describe whether the node is online
  • the chassis state is used to describe whether the chassis is online
  • the device state is determined to be normal when both the node state and the chassis state are online. Further, if the node is offline and/or the chassis is offline, it is determined that the device state is abnormal, the device control process can be terminated, and a corresponding error code is returned according to the device state.
  • this step can encapsulate the control command line to obtain the control command, and deliver the control command to the lower-level execution module, so that the lower-level execution module can execute the control command on the target hardware. corresponding operation.
  • the lower-layer execution module can parse the control command to determine the hardware to be controlled, that is, the target hardware, and then execute the operation corresponding to the control command on the target hardware.
  • S103 Read the state information of the target hardware according to a preset cycle, and record the read times of the state information of the target hardware;
  • the state information of the target hardware can be read according to a preset period. For example, if the lower-layer execution module controls the target hardware to execute the operation corresponding to the control instruction, the state information of the target hardware will be updated to the preset state information. For example, the lower-level execution module controls the chassis to perform the lighting operation. After the chassis lights up successfully, the value of the lighting status flag in the status information of the chassis will change from 0 to 1. In this example, the value of the lighting status flag is “1”, which is the preset state information. .
  • the lower-level execution module needs a certain amount of time to execute the control command. Therefore, when it is detected that the state information of the target hardware is not the same as the preset state information, a predetermined interval can be used. Set the duration of the cycle to read the state information of the new target hardware again, until the state information of the target hardware is the same as the preset state information, then it is determined that the command is successfully executed.
  • the number of times the status information of the target hardware is read is also recorded, that is, the number of times the status information of the target hardware is read, if the status information of the target hardware is read. If the number of fetches is greater than or equal to the preset value, it means that the control command has not been executed by the lower-level execution module or has not been successfully executed for a long time. At this time, it can be determined that the execution of the control command is abnormal, and the device control process is terminated.
  • S105 If the number of times of reading the state information of the target hardware is greater than or equal to a preset value, determine that the control command is executed abnormally, and terminate the device control process.
  • This embodiment adopts the state machine method and timer method to process the control requirements of the control command line, terminates the command immediately after a problem occurs in each step, and informs the user of the failure cause by category.
  • the hardware information is verified by Whether the actual result of the control command is consistent with the expected result of the command issuance is to judge whether the control command is effective or not. If it is inconsistent, the hardware information is obtained regularly. After the time-out is inconsistent, the user is notified that the hardware is faulty.
  • the command line verification is performed after receiving the control command line. If the control command line passes the command line verification and the device is in a normal state, the control command is obtained by encapsulating the control command line. After the control command is sent to the lower-level execution module, the lower-level execution module can execute the operation corresponding to the control command to the target hardware. In this embodiment, it is determined whether the control instruction is successfully executed by reading the state information of the target hardware. If the state information of the target hardware is different from the preset state information, the reading is repeated at intervals of a preset period of time until the state information of the target hardware is the same as the preset state information. The status information is the same or the number of repetitions is greater than or equal to the preset value.
  • the state information of the target hardware is used as the basis for evaluating whether the control instruction is successfully executed, and after the state information of the target hardware is not the preset state information, the state information of the target hardware is re-read at a certain period of time.
  • the command is issued to After the lower-level execution module returns the successful execution solution, this embodiment can improve the accuracy of the command line execution result.
  • FIG. 2 is a flowchart of a method for sending a control command provided by an embodiment of the present application.
  • This embodiment is a further introduction to S102 in the embodiment corresponding to FIG. 1.
  • This embodiment can be compared with FIG. 1
  • Corresponding embodiments are combined to obtain further implementations, and this embodiment may include the following steps:
  • S201 Send the control command to the lower-level execution module and record the number of times of command issuance;
  • S202 Determine whether the response information returned by the lower-layer execution module is received within a preset time; if so, enter S203; if not, enter S201;
  • the device control process if it is detected that the number of times of command issuance is greater than the preset number of times of issuance, the device control process is terminated, and an error code of command issuance failure is returned. Further, in this embodiment, after it is determined that the response information returned by the lower-layer execution module is not received within a preset time, the link for issuing the control command is switched, so as to be repeatedly sent to the lower-layer execution module through a new link. the control command. By using the above method for switching a new link to send a control command, the success rate of issuing the control command can be improved.
  • FIG. 3 is a schematic structural diagram of a storage device-based command line interaction system provided by an embodiment of the present application.
  • An application scenario in which the system is located may include: a command line input module, an upper-layer command processing module , lower-level execution modules, and specific hardware devices that need to be controlled.
  • This embodiment can be applied to an upper-layer command processing module of a storage device.
  • the upper-layer command processing module may include a command verification submodule, a command issuing submodule, a command task result judgment and retry module, a reading actual information submodule, and a verification submodule. data submodule.
  • the above five types of submodules all have corresponding error codes.
  • this embodiment can quickly terminate abnormally; at the same time, the accurate and detailed error code classification method can inform the user of the exact error cause; the retry strategy after the command execution fails to increase the system
  • the reliability of the update data adopts the polling method and the time selection principle to quickly update the hardware data, avoiding the increase of the command line return time due to the long cycle or the increase of the CPU load if the polling frequency is too fast.
  • the five sub-modules use state machines to switch states, and a task execution fails to return to the command line immediately; after an exception occurs, the error codes are divided into three categories: (1) verification failure category; (2) task execution failure category; (3) ) hardware fault class.
  • the error code is divided according to the verification items and the cause of the failure is accurately reflected.
  • the command issuing submodule will issue the command again.
  • a timer can also be used to periodically trigger the process to update the hardware data. If the updated data is inconsistent with the expected result, the data acquisition is repeated; the timer timing principle: by counting the hardware after the normal command is issued for many times The average time of the actual execution of the device is t, then the timing time of the timer is t/2, and the process is triggered to update the hardware data after the timeout.
  • the command verification sub-module can be used to verify whether the command line input is correct and whether the parameter matching is reasonable, and can also judge that the status information of the storage device is normal. If the verification of the command verification sub-module fails, the returned error code may be verification failure, and the error code may include corresponding error codes subdivided according to the verification items.
  • the command issuing sub-module can be used to encapsulate the control command line to obtain the control command, encapsulate the command according to the protocol specified by the upper and lower systems and issue it to the lower layer execution module, and can also accept the return code of the success or failure of the command delivery.
  • the error code category of the command delivery submodule can be task execution failure.
  • the command task result judgment and retry module can be used to judge whether the control command is successfully issued, and if the command fails to be issued, the command is issued again.
  • the error code type of the command task result judgment and retry module can be task execution failure.
  • the reading actual information submodule is used to read the updated specific hardware information, and the error code type of the reading actual information submodule may be the task execution failure.
  • the verification data to the module can be used to verify whether the updated hardware information is consistent with the expected result of the expected control command. If it is inconsistent, start the timer, poll the underlying hardware information regularly, and re-verify the result after the data is updated.
  • the hardware firmware error code is reported after the specified time.
  • the tasks of the above command verification sub-module, command issuing sub-module, command task result judgment and retry module, reading actual information sub-module and verification data sub-module are executed sequentially. Line error codes to improve the execution efficiency of control command lines.
  • the state machine is used for distributed execution, which can ensure that the processing flow of the previous state can immediately terminate the subsequent steps if it is unsuccessful, thereby improving the execution efficiency of the command line; meanwhile, the issuance and verification of the control command can be ensured in a separate module to ensure the issuance of the command. accuracy.
  • the command line return code situation is divided into four specific categories: (1) no return information if the execution is successful; (2) the verification failure returns an error code error of the verification failure; (3) the control command cannot be successfully issued to the underlying execution The system's task failure return code; (4) The hardware failure return code of the command issued successfully but the verification failed.
  • category (2) is divided into detailed check items, each item corresponds to a unique return code, and the user can obtain detailed fault causes by comparing the error category and specific error code with the error code instruction manual.
  • This embodiment can improve the command line execution efficiency and accuracy, and can accurately inform the user of fault information when an abnormal scenario occurs.
  • This embodiment adopts the control-type command line execution interaction design method based on the storage device, which can accurately execute and return the command, and has a good user experience.
  • the successful return of the command line can ensure the command
  • the successful execution of the system avoids the common errors caused by the asynchronous processing of the upper and lower systems; at the same time, this embodiment has detailed and specific error code division, which can accurately inform the user of the fault type; the timer polling strategy adopted by the update data module and the selection of the timer
  • the time principle can efficiently update and verify data in order to lay the foundation for the rapid execution of the command line.
  • This embodiment may include the following steps:
  • Step 1 The command line receives and sends the command to turn on the chassis positioning light: chenclosure–identify yes–canister canister id enclousreid.
  • Step 2 After receiving the command, first check whether the format of the command line is correct. In the command, you need to add yes/no to the identify parameter to indicate whether the light is on or off; if the parameter is missing, the task is terminated, and the command line returns. Secondly, this embodiment also needs to check whether the node of the storage device that needs to be lit, that is, the id corresponding to the canister is online, and if it is not online, the task is terminated; similarly, the chassis where the node is located also needs to be online, otherwise the termination of the task returns a corresponding error code; after the task is successfully executed, enter the command issuing task.
  • Step 3 The upper and lower systems of the current embodiment use SES (SCSI Enclosure Services, Small Computer System Interface Chassis Service Protocol), the module sends the received command to the lower-level execution module according to the SES protocol, and waits to judge whether the control command is normal or not. return.
  • SES Serial Enclosure Services, Small Computer System Interface Chassis Service Protocol
  • Step 4 If the command execution fails, repackage the lighting command and send it to the underlying system. After the command is successfully executed, go to Step 5, so as to update the actual result of the physical lamp to the upper system.
  • Step 5 After the command is successfully executed, start the 10s timer to read the actual result of the physical light, and go to Step 6 after the update is successful.
  • Step 6 Compare the updated data with the expected results and find that the expected target is not reached, then restart the 10s timer to poll the updated data and then verify the data. Note that the selection principle of the 10s time interval is half of the normal hardware update time period. The method can get the updated data in the shortest time and reduce the CPU usage time; if the data is inconsistent after multiple updates and the timeout is 1 minute, the hardware fault will be reported to the user and the task will be terminated. If the verification is successful, the command will be successfully returned to the command line. Line information without any error message.
  • FIG. 4 is a schematic structural diagram of a device control system provided by an embodiment of the application.
  • the system can include:
  • the command line verification module 100 is configured to receive a control command line, and perform command line verification on the control command line;
  • the command issuing module 200 is configured to encapsulate the control command line to obtain a control command if the control command line passes the command line verification and the device status is normal, and send the control command to the lower layer execution module , so that the lower-layer execution module executes the operation corresponding to the control command to the target hardware;
  • a hardware state reading module 300 configured to read the state information of the target hardware according to a preset period, and record the number of times of reading the state information of the target hardware;
  • the command execution feedback module 400 is used to determine that the command is successfully executed if the state information of the target hardware is the same as the preset state information; if the read times of the state information of the target hardware is greater than or equal to the preset value, Then, it is determined that the execution of the control command is abnormal, and the device control process is terminated.
  • the command line verification is performed after receiving the control command line. If the control command line passes the command line verification and the device is in a normal state, the control command is obtained by encapsulating the control command line. After the control command is sent to the lower-level execution module, the lower-level execution module can execute the operation corresponding to the control command to the target hardware. In this embodiment, it is determined whether the control instruction is successfully executed by reading the state information of the target hardware. If the state information of the target hardware is different from the preset state information, the reading is repeated at intervals of a preset period of time until the state information of the target hardware is the same as the preset state information. The status information is the same or the number of repetitions is greater than or equal to the preset value.
  • the state information of the target hardware is used as the basis for evaluating whether the control instruction is successfully executed, and after the state information of the target hardware is not the preset state information, the state information of the target hardware is re-read at a certain period of time.
  • the command is issued to After the lower-level execution module returns the successful execution solution, this embodiment can improve the accuracy of the command line execution result.
  • the first error code return module is configured to terminate the device control process if the control command line fails the command line verification, and return a corresponding error code according to the command line verification result.
  • a device state detection module configured to obtain the device state after receiving the control command line, and determine whether the device state is normal
  • the device state includes node state and chassis state, the node state is used to describe whether the node is online, the chassis state is used to describe whether the chassis is online, and the device state is determined when both the node state and the chassis state are online normal.
  • the second error code return module is configured to terminate the device control process if the device state is abnormal, and return a corresponding error code according to the device state.
  • command line verification module 100 includes:
  • a format checking unit configured to judge whether the format of the control command line is correct, and obtain a first judgment result
  • a parameter checking unit configured to judge whether the parameters of the control command line are correct, and obtain a second judgment result
  • a judging unit configured to judge that the control command line has passed the command line verification if both the first judgment result and the second judgment result are yes; If the second judgment result is not all yes, it is judged that the control command line fails the command line verification.
  • command issuing module 200 includes:
  • an issuing unit configured to send the control command to the lower-layer execution module and record the number of command issuances
  • the response detection unit is used to determine whether the response information returned by the lower-layer execution module is received within a preset time; if so, it is determined that the control command has been sent to the lower-layer execution module; the step of sending the control command by the execution module and recording the number of times the command is issued;
  • the error detection unit is used for terminating the device control process if the number of times of issuing the command is greater than the preset number of issuing times, and returning an error code of the failure of the command issuing.
  • a link switching unit configured to switch the issuing link of the control command after determining that the response information returned by the lower-layer execution module has not been received within a preset time, so as to repeat to the lower-layer execution module through a new link Send the control command.
  • the present application also provides a storage medium on which a computer program is stored, and when the computer program is executed, the steps provided by the above embodiments can be implemented.
  • the storage medium may include: U disk, removable hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
  • the present application also provides an electronic device, which may include a memory and a processor, where a computer program is stored in the memory, and when the processor invokes the computer program in the memory, the steps provided in the above embodiments can be implemented.
  • the electronic device may also include various network interfaces, power supplies and other components.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

一种设备控制方法、系统、一种电子设备及一种存储介质,涉及计算机技术领域,设备控制方法包括:接收控制类命令行,对控制类命令行进行命令行校验;若控制类命令行通过命令行校验且设备状态正常,则封装控制类命令行得到控制命令,并将控制命令发送至下层执行模块;按照预设周期读取目标硬件的状态信息,并记录目标硬件的状态信息的读取次数;若目标硬件的状态信息与预设状态信息相同,则判定命令执行成功;若目标硬件的状态信息的读取次数大于或等于预设值,则判定控制命令执行异常,并终止设备控制流程。本申请将目标硬件的状态信息作为评价控制指令是否执行成功的依据,能够提高命令执行结果的准确率。

Description

一种设备控制方法、系统、电子设备及存储介质
本申请要求于2020年09月11日提交中国专利局、申请号为202010954933.X、发明名称为“一种设备控制方法、系统、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别涉及一种设备控制方法、系统、一种电子设备及一种存储介质。
背景技术
在存储设备中,针对机箱管理的控制类命令行的主要作用在于用户通过命令行的输入来控制存储设备上相关硬件设备,比如点亮机箱告警灯或者让设备重启,因此命令行可以将控制结果能够快速准确的告知给用户,以便指导用户进行后续的操作。
存储设备的控制命令的执行主要由两大模块来实现:上层模块负责命令行的解析处理并包装下发给下层的执行模块,下层执行模块实际执行具体的控制硬件的命令。相关技术中,上下系统的交互采用异步处理来提高命令的返回效率,但是这种方式带来了命令执行的不确定性,上层成功的返回并不代表实际物理器件成功接收到命令,如果物理器件或者物理链路存在故障,则导致命令成功下发但是物理器件并没有真正改变得到控制。
因此,如何提高命令执行结果的准确率是本领域技术人员目前需要解决的技术问题。
发明内容
本申请的目的是提供一种设备控制方法、系统、一种电子设备及一种存储介质,能够提高命令行执行结果的准确率。
为解决上述技术问题,本申请提供一种设备控制方法,该设备控制方法包括:
接收控制类命令行,对所述控制类命令行进行命令行校验;
若所述控制类命令行通过所述命令行校验且设备状态正常,则封装所述控制类命令行得到控制命令,并将所述控制命令发送至下层执行模块,以便所述下层执行模块对目标硬件执行所述控制命令对应的操作;
按照预设周期读取所述目标硬件的状态信息,并记录所述目标硬件的状态信息的读取次数;
若所述目标硬件的状态信息与预设状态信息相同,则判定命令执行成功;
若所述目标硬件的状态信息的读取次数大于或等于预设值,则判定所述控制命令执行异常,并终止设备控制流程。
可选的,还包括:
若所述控制类命令行未通过所述命令行校验,则终止设备控制流程,并根据命令行校验结果返回对应的错误码。
可选的,在接收控制类命令行之后,还包括:
获取设备状态,并判断所述设备状态是否正常;
其中,设备状态包括节点状态和机箱状态,所述节点状态用于描述节点是否在线,所述机箱状态用于描述机箱是否在线,当所述节点状态和机箱状态均为在线时判定所述设备状态正常。
可选的,还包括:
若所述设备状态异常,则终止设备控制流程,并根据所述设备状态返回对应的错误码。
可选的,对所述控制类命令行进行命令行校验,包括:
判断所述控制类命令行的格式是否正确,得到第一判断结果;
判断所述控制类命令行的参数是否正确,得到第二判断结果;
若所述第一判断结果和所述第二判断结果均为是,则判定所述控制类命令行通过所述命令行校验;
若所述第一判断结果和所述第二判断结果不均为是,则判定所述控制类命令行未通过所述命令行校验。
可选的,将所述控制命令发送至下层执行模块包括:
向所述下层执行模块发送所述控制命令并记录命令下发次数;
判断在预设时间内是否收到所述下层执行模块返回的应答信息;
若是,则判定已将所述控制命令发送至下层执行模块;
若否,则进入向所述下层执行模块发送所述控制命令并记录命令下发次数的步骤;
若所述命令下发次数大于预设下发次数,则终止设备控制流程,并返回命令下发失败的错误码。
可选的,还包括:
在判定在预设时间内未收到所述下层执行模块返回的应答信息之后,切换控制命令的下发链路,以便通过新的链路向所述下层执行模块重复发送所述控制命令。
本申请还提供了一种设备控制系统,该设备控制系统包括:
命令行校验模块,用于接收控制类命令行,对所述控制类命令行进行命令行校验;
命令下发模块,用于若所述控制类命令行通过所述命令行校验且设备状态正常,则封装所述控制类命令行得到控制命令,并将所述控制命令发送至下层执行模块,以便所述下层执行模块对目标硬件执行所述控制命令对应的操作;
硬件状态读取模块,用于按照预设周期读取所述目标硬件的状态信息,并记录所述目标硬件的状态信息的读取次数;
命令执行反馈模块,用于若所述目标硬件的状态信息与预设状态信息相同,则判定命令执行成功;用于若所述目标硬件的状态信息的读取次数大于或等于预设值,则判定所述控制命令执行异常,并终止设备控制流程。
本申请还提供了一种存储介质,其上存储有计算机程序,所述计算机程序执行时实现上述设备控制方法执行的步骤。
本申请还提供了一种电子设备,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器调用所述存储器中的计算机程序时实现上述设备控制方法执行的步骤。
本申请提供了一种设备控制方法,包括:接收控制类命令行,对所述 控制类命令行进行命令行校验;若所述控制类命令行通过所述命令行校验且设备状态正常,则封装所述控制类命令行得到控制命令,并将所述控制命令发送至下层执行模块,以便所述下层执行模块对目标硬件执行所述控制命令对应的操作;按照预设周期读取所述目标硬件的状态信息,并记录所述目标硬件的状态信息的读取次数;若所述目标硬件的状态信息与预设状态信息相同,则判定命令执行成功;若所述目标硬件的状态信息的读取次数大于或等于预设值,则判定所述控制命令执行异常,并终止设备控制流程。
本申请在接收到控制类命令行之后进行命令行校验,若控制类命令行通过所述命令行校验且设备状态正常,则通过封装控制类命令行得到控制命令。将控制命令发送至下层执行模块后,下层执行模块可以对目标硬件执行控制命令对应的操作。本申请通过读取目标硬件的状态信息判断控制指令是否执行成功,若目标硬件的状态信息与预设状态信息不相同,则间隔预设时长重复读取,直至目标硬件的状态信息与预设状态信息相同或重复次数大于或等于预设值。本申请将目标硬件的状态信息作为评价控制指令是否执行成功的依据,并在目标硬件的状态信息不为预设状态信息后间隔一定时长重新读取,相对于相关技术中将命令下发给下层执行模块后即返回执行成功的方案,本申请能够提高命令行执行结果的准确率。本申请同时还提供了一种设备控制系统、一种存储介质和一种电子设备,具有上述有益效果,在此不再赘述。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例所提供的一种设备控制方法的流程图;
图2为本申请实施例所提供的一种发送控制命令的方法的流程图;
图3为本申请实施例所提供的一种基于存储设备的控制类命令行的交互系统的结构示意图;
图4为本申请实施例所提供的一种设备控制系统的结构示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
下面请参见图1,图1为本申请实施例所提供的一种设备控制方法的流程图。
具体步骤可以包括:
S101:接收控制类命令行,对所述控制类命令行进行命令行校验;
其中,本实施例可以应用于存储设备,存储设备包括上层命令处理模块、下层执行模块和硬件;上层命令处理模块可以接收用户输入的控制类命令行,并将封装后控制类命令行得到的控制命令下发至下层执行模块,下层执行模块可以根据控制命令对硬件执行对应的控制操作。
本实施例在接收到控制类命令行之后,可以对控制类命令行执行命令行校验操作。若所述控制类命令行未通过所述命令行校验,则终止设备控制流程,并根据命令行校验结果返回对应的错误码。命令行校验操作可以包括命令行格式校验和命令行参数校验,每一类控制命令行可以存在其对应的标准格式和标准参数匹配规则,本实施例可以根据控制类命令行的类型执行命令行校验操作。在确定了命令行的标准格式和标准参数匹配规则的基础上,执行命令行校验的过程可以包括:判断所述控制类命令行的格式是否正确,得到第一判断结果;判断所述控制类命令行的参数是否正确,得到第二判断结果;若所述第一判断结果和所述第二判断结果均为是,则判定所述控制类命令行通过所述命令行校验;若所述第一判断结果和所述 第二判断结果不均为是,则判定所述控制类命令行未通过所述命令行校验。可以理解的是,若第一判断结果为否,则可以判定命令行存在异常并终止设备控制流程,还可以输出命令行格式存在错误的错误码;若第二判断结果为否,则可以判定命令行存在异常并终止设备控制流程,还可以输出命令行参数存在错误的错误码。
S102:若所述控制类命令行通过所述命令行校验且设备状态正常,则封装所述控制类命令行得到控制命令,并将所述控制命令发送至下层执行模块,以便所述下层执行模块对目标硬件执行所述控制命令对应的操作;
其中,在本步骤之前还可以存在对设备状态进行检测的方案,具体的,在接收控制类命令行之后,可以获取设备状态并判断所述设备状态是否正常;上述设备状态可以包括节点状态和机箱状态,所述节点状态用于描述节点是否在线,所述机箱状态用于描述机箱是否在线,当所述节点状态和机箱状态均为在线时判定所述设备状态正常。进一步的,若节点离线和/或机箱离线,则判定设备状态异常,可以终止设备控制流程并根据所述设备状态返回对应的错误码。
在控制类命令行通过命令行校验且设备状态的前提下,本步骤可以封装控制类命令行得到控制命令,并将控制命令下发至下层执行模块,以便下层执行模块对目标硬件执行控制命令对应的操作。具体的,下层执行模块可以解析控制命令确定需要控制的硬件,即目标硬件,进而对目标硬件执行所述控制命令对应的操作。
S103:按照预设周期读取所述目标硬件的状态信息,并记录所述目标硬件的状态信息的读取次数;
其中,本实施例可以在将控制命令发送至下层执行模块之后,按照预设周期读取目标硬件的状态信息。举例进行说明,若下层执行模块控制目标硬件执行控制指令对应的操作之后,目标硬件的状态信息将会更新为预设状态信息。例如下层执行模块控制机箱执行点灯操作,在机箱点灯成功之后,机箱的状态信息中的点灯状态标识的值将由0变为1,在该例子中点灯状态标识的值“1”即预设状态信息。
可以理解的是,在将控制命令发送至下层执行模块之后,下层执行模 块需要一定的时间才能执行控制命令,因此在检测到述目标硬件的状态信息与预设状态信息不相同时可以间隔一个预设周期的时长再次读取新的目标硬件的状态信息,直至目标硬件的状态信息与预设状态信息相同,则判定命令执行成功。本实施例在读取目标硬件的状态信息的同时,还记录所述目标硬件的状态信息的读取次数,即目标硬件的状态信息被读取的次数,若所述目标硬件的状态信息的读取次数大于或等于预设值,则说明在较长时间内控制命令都没有被下层执行模块执行或没有执行成功,此时可以判定所述控制命令执行异常,并终止设备控制流程。
S104:若所述目标硬件的状态信息与预设状态信息相同,则判定命令执行成功;
S105:若所述目标硬件的状态信息的读取次数大于或等于预设值,则判定所述控制命令执行异常,并终止设备控制流程。
本实施例采用状态机方式加定时器方式来处理控制类命令行的控制需求,在每一步出现问题后立即终止命令,并将故障原因分类别告知用户,命令执行成功后,通过校验硬件信息的实际结果与命令下发的预期结果是否一致来判断控制命令下发是否有效,如果不一致则定时获取硬件信息,超时后不一致则告知用户硬件出现故障。
本实施例在接收到控制类命令行之后进行命令行校验,若控制类命令行通过所述命令行校验且设备状态正常,则通过封装控制类命令行得到控制命令。将控制命令发送至下层执行模块后,下层执行模块可以对目标硬件执行控制命令对应的操作。本实施例通过读取目标硬件的状态信息判断控制指令是否执行成功,若目标硬件的状态信息与预设状态信息不相同,则间隔预设时长重复读取,直至目标硬件的状态信息与预设状态信息相同或重复次数大于或等于预设值。本实施例将目标硬件的状态信息作为评价控制指令是否执行成功的依据,并在目标硬件的状态信息不为预设状态信息后间隔一定时长重新读取,相对于相关技术中将命令下发给下层执行模块后即返回执行成功的方案,本实施例能够提高命令行执行结果的准确率。
请参见图2,图2为本申请实施例所提供的一种发送控制命令的方法 的流程图,本实施例是对图1对应实施例中S102的进一步介绍,可以将本实施例与图1对应的实施例相结合得到进一步的实施方式,本实施例可以包括以下步骤:
S201:向下层执行模块发送所述控制命令并记录命令下发次数;
S202:判断在预设时间内是否收到所述下层执行模块返回的应答信息;若是,则进入S203;若否,则进入S201;
S203:判定已将所述控制命令发送至下层执行模块。
作为一种可行的实施方式,在上述实施例的执行过程中若检测到命令下发次数大于预设下发次数,则终止设备控制流程,并返回命令下发失败的错误码。进一步的,本实施例在判定在预设时间内未收到所述下层执行模块返回的应答信息之后,切换控制命令的下发链路,以便通过新的链路向所述下层执行模块重复发送所述控制命令。通过上述切换新链路发送控制命令的方法,能够提高控制命令下发的成功率。
请参见图3,图3为本申请实施例所提供的一种基于存储设备的控制类命令行的交互系统的结构示意图,该系统所在的应用场景可以包括:命令行输入模块、上层命令处理模块、下层执行模块、以及具体需要控制的硬件器件。本实施例可以应用于存储设备的上层命令处理模块,上层命令处理模块可以包括命令校验子模块、命令下发子模块,命令任务结果判断及重试模块、读取实际信息子模块和校验数据子模块。上述五类子模块均存在对应的错误码。本实施例通过五个子模块的准确划分,以及状态机的实现能够遇到异常快速终止;同时准确细致的错误码分类方法能够将告知用户准确的错误原因;命令执行失败后的重试策略增加系统的可靠性,更新数据采用轮询方式以及时间选取原则能够快速更新硬件数据,避免周期过长增加命令行返回时间或者轮询频率过快增加CPU的负荷。五个子模块采用状态机进行状态切换,某一任务执行失败立刻返回命令行;出现异常之后将错误码分为三大类:(1)校验失败类;(2)任务执行失败类;(3)硬件故障类。同时第(1)类错误中根据校验项目细致划分错误码并准确反映故障原因。在本实施例中,若更新硬件信息的任务没有执行成功或者执 行成功后数据没有更新,命令下发子模块则重新进行命令下发。本实施例还可以采用定时器的方式定时触发流程更新硬件数据,如果更新后的数据与预期的结果不一致,则重复进行数据获取;定时器定时时间原则:通过多次统计正常命令下发后硬件器件实际执行的平均时间为t,则定时器的定时时间为t/2,超时后触发流程来更新硬件数据。
其中,命令校验子模块可以用于校验命令行输入是否正确,以及参数匹配是否合理,还可以判断存储设备的状态信息正常。命令校验子模块校验失败则返回的错误码可以为校验失败,该错误码中可以包括根据校验项目细分对应的错误码。命令下发子模块可以用于封装控制类命令行得到控制命令,按照上下层系统规定好的协议封装命令下发给下层执行模块,还可以接受命令下发成功或者下发失败的返回码。命令下发子模块的错误码类别可以为任务执行失败。命令任务结果判断及重试模块可以用于判断控制命令是否成功下发,如果命令下发失败,则重新下发命令。命令任务结果判断及重试模块的错误码种类可以为任务执行失败。读取实际信息子模块用于读取更新后的具体硬件信息,读取实际信息子模块的错误码种类可以为任务执行失败。校验数据至模块可以用于校验更新后的硬件信息与预期的控制命令的期望结果是否一致,如果不一致则启动定时器,定时轮询底层硬件信息,数据更新后重新校验结果,如果超过规定时间后上报硬件固件错误码。上述命令校验子模块、命令下发子模块,命令任务结果判断及重试模块、读取实际信息子模块和校验数据子模块的任务顺序执行,某一任务执行失败后命令行立即返对应行错误码,提高控制类命令行的执行效率。
本实施例采用状态机分布执行,能够保证上一状态的处理流程未成功可立刻终止后续步骤,提高命令行的执行效率;同时控制命令的下发与校验在单独的模块能够保证命令下发的准确性。命令行返回码情况分为具体的四大类情况:(1)执行成功无返回信息;(2)校验失败返回校验失败错误码错误;(3)控制命令无法成功下发给底层的执行系统的任务失败返回码;(4)命令成功下发但是校验失败的硬件失败返回码。其中类别(2)有具体分为详细的校验项,每一项对应唯一的返回码,用户可以根据错误类 别和具体的错误码跟错误码指导手册比对获得详细的故障原因。本实施例能够提高命令行执行效率和准确率,并且出现异常场景能够准确的告知用户故障信息。
本实施例采用基于存储设备的控制类命令行执行交互设计方法,能够准确的进行命令的执行并返回,具有良好的用户体验,同时因为带有数据校验模块,命令行的成功返回能够保证命令的成功执行避免了常见的上下系统异步处理带来的误差;同时该实施例具有详细具体错误码划分,可以准确的告知用户故障类型;更新数据模块采用的定时器轮询策略以及定时器的选取时间原则能够高效的更新、校验数据,以便为命令行的快速执行奠定基础。
下面通过在实际应用中通过控制类命令行下发机箱定位灯点亮命令的方案说明上述实施例描述的流程,本实施例可以包括以下步骤:
步骤1:命令行接收下发点亮机箱定位灯命令:chenclosure–identify yes–canister canister id enclousreid。
步骤2:收到命令之后首先校验命令行的格式是否正确,该命令中需要在identify的参数加上yes/no表明是电亮还是点灭;如果参数遗漏终止任务,命令行返回。其次,本实施例还需要校验需要点亮的存储设备的节点即canister对应的id是否在线,如果不在线则终止任务;同理该节点所在的机箱也需要在线,否则终止任务返回对应的错误码;该任务执行成功后进入命令下发任务。
步骤3:当前实施例的上下系统采用SES(SCSI Enclosure Services,小型计算机系统接口机箱服务协议),该模块将接受到的命令按照SES协议的方式下发给下层执行模块,等待判断控制命令是否正常返回。
步骤4:如果命令执行失败,则重新封装点灯命令下发给底层系统,命令执行成功后进入步骤5,以便更新物理灯的实际结果到上层系统。
步骤5:命令执行成功后,通过启动10s定时器来读取物理灯的实际结果,更新成功后进入步骤6。
步骤6:将更新的数据与预期的结果比对发现没有达到预期目标则重启10s定时器进行轮询更新数据然后校验数据,注意10s时间间隔的选取 原则为正常硬件更新时间周期的一半,此方法可以以最小的时间拿到更新的数据同时减少CPU占用时间;如果多次更新后数据不一致超时1分钟则上报硬件故障给用户并终止任务,如果校验成功后则进行成功返回命令行,命令行信息无任何错误提示信息。
请参见图4,图4为本申请实施例所提供的一种设备控制系统的结构示意图;
该系统可以包括:
命令行校验模块100,用于接收控制类命令行,对所述控制类命令行进行命令行校验;
命令下发模块200,用于若所述控制类命令行通过所述命令行校验且设备状态正常,则封装所述控制类命令行得到控制命令,并将所述控制命令发送至下层执行模块,以便所述下层执行模块对目标硬件执行所述控制命令对应的操作;
硬件状态读取模块300,用于按照预设周期读取所述目标硬件的状态信息,并记录所述目标硬件的状态信息的读取次数;
命令执行反馈模块400,用于若所述目标硬件的状态信息与预设状态信息相同,则判定命令执行成功;用于若所述目标硬件的状态信息的读取次数大于或等于预设值,则判定所述控制命令执行异常,并终止设备控制流程。
本实施例在接收到控制类命令行之后进行命令行校验,若控制类命令行通过所述命令行校验且设备状态正常,则通过封装控制类命令行得到控制命令。将控制命令发送至下层执行模块后,下层执行模块可以对目标硬件执行控制命令对应的操作。本实施例通过读取目标硬件的状态信息判断控制指令是否执行成功,若目标硬件的状态信息与预设状态信息不相同,则间隔预设时长重复读取,直至目标硬件的状态信息与预设状态信息相同或重复次数大于或等于预设值。本实施例将目标硬件的状态信息作为评价控制指令是否执行成功的依据,并在目标硬件的状态信息不为预设状态信息后间隔一定时长重新读取,相对于相关技术中将命令下发给下层执行模 块后即返回执行成功的方案,本实施例能够提高命令行执行结果的准确率。
进一步的,还包括:
第一错误码返回模块,用于若所述控制类命令行未通过所述命令行校验,则终止设备控制流程,并根据命令行校验结果返回对应的错误码。
进一步的,还包括:
设备状态检测模块,用于在接收控制类命令行之后,获取设备状态,并判断所述设备状态是否正常;
其中,设备状态包括节点状态和机箱状态,所述节点状态用于描述节点是否在线,所述机箱状态用于描述机箱是否在线,当所述节点状态和机箱状态均为在线时判定所述设备状态正常。
进一步的,还包括:
第二错误码返回模块,用于若所述设备状态异常,则终止设备控制流程,并根据所述设备状态返回对应的错误码。
进一步的,命令行校验模块100包括:
格式检验单元,用于判断所述控制类命令行的格式是否正确,得到第一判断结果;
参数校验单元,用于判断所述控制类命令行的参数是否正确,得到第二判断结果;
判断单元,用于若所述第一判断结果和所述第二判断结果均为是,则判定所述控制类命令行通过所述命令行校验;还用于若所述第一判断结果和所述第二判断结果不均为是,则判定所述控制类命令行未通过所述命令行校验。
进一步的,命令下发模块200包括:
下发单元,用于向所述下层执行模块发送所述控制命令并记录命令下发次数;
应答检测单元,用于判断在预设时间内是否收到所述下层执行模块返回的应答信息;若是,则判定已将所述控制命令发送至下层执行模块;若否,则进入向所述下层执行模块发送所述控制命令并记录命令下发次数的步骤;
错误检测单元,用于若所述命令下发次数大于预设下发次数,则终止设备控制流程,并返回命令下发失败的错误码。
进一步的,还包括:
链路切换单元,用于在判定在预设时间内未收到所述下层执行模块返回的应答信息之后,切换控制命令的下发链路,以便通过新的链路向所述下层执行模块重复发送所述控制命令。
由于系统部分的实施例与方法部分的实施例相互对应,因此系统部分的实施例请参见方法部分的实施例的描述,这里暂不赘述。
本申请还提供了一种存储介质,其上存有计算机程序,该计算机程序被执行时可以实现上述实施例所提供的步骤。该存储介质可以包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
本申请还提供了一种电子设备,可以包括存储器和处理器,所述存储器中存有计算机程序,所述处理器调用所述存储器中的计算机程序时,可以实现上述实施例所提供的步骤。当然所述电子设备还可以包括各种网络接口,电源等组件。
说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的系统而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。
还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而 使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的状况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。

Claims (10)

  1. 一种设备控制方法,其特征在于,包括:
    接收控制类命令行,对所述控制类命令行进行命令行校验;
    若所述控制类命令行通过所述命令行校验且设备状态正常,则封装所述控制类命令行得到控制命令,并将所述控制命令发送至下层执行模块,以便所述下层执行模块对目标硬件执行所述控制命令对应的操作;
    按照预设周期读取所述目标硬件的状态信息,并记录所述目标硬件的状态信息的读取次数;
    若所述目标硬件的状态信息与预设状态信息相同,则判定命令执行成功;
    若所述目标硬件的状态信息的读取次数大于或等于预设值,则判定所述控制命令执行异常,并终止设备控制流程。
  2. 根据权利要求1所述设备控制方法,其特征在于,还包括:
    若所述控制类命令行未通过所述命令行校验,则终止设备控制流程,并根据命令行校验结果返回对应的错误码。
  3. 根据权利要求1所述设备控制方法,其特征在于,在接收控制类命令行之后,还包括:
    获取设备状态,并判断所述设备状态是否正常;
    其中,设备状态包括节点状态和机箱状态,所述节点状态用于描述节点是否在线,所述机箱状态用于描述机箱是否在线,当所述节点状态和机箱状态均为在线时判定所述设备状态正常。
  4. 根据权利要求3所述设备控制方法,其特征在于,还包括:
    若所述设备状态异常,则终止设备控制流程,并根据所述设备状态返回对应的错误码。
  5. 根据权利要求1所述设备控制方法,其特征在于,对所述控制类命令行进行命令行校验,包括:
    判断所述控制类命令行的格式是否正确,得到第一判断结果;
    判断所述控制类命令行的参数是否正确,得到第二判断结果;
    若所述第一判断结果和所述第二判断结果均为是,则判定所述控制类 命令行通过所述命令行校验;
    若所述第一判断结果和所述第二判断结果不均为是,则判定所述控制类命令行未通过所述命令行校验。
  6. 根据权利要求1至5任一项所述设备控制方法,其特征在于,将所述控制命令发送至下层执行模块包括:
    向所述下层执行模块发送所述控制命令并记录命令下发次数;
    判断在预设时间内是否收到所述下层执行模块返回的应答信息;
    若是,则判定已将所述控制命令发送至下层执行模块;
    若否,则进入向所述下层执行模块发送所述控制命令并记录命令下发次数的步骤;
    若所述命令下发次数大于预设下发次数,则终止设备控制流程,并返回命令下发失败的错误码。
  7. 根据权利要求6所述设备控制方法,其特征在于,还包括:
    在判定在预设时间内未收到所述下层执行模块返回的应答信息之后,切换控制命令的下发链路,以便通过新的链路向所述下层执行模块重复发送所述控制命令。
  8. 一种设备控制系统,其特征在于,包括:
    命令行校验模块,用于接收控制类命令行,对所述控制类命令行进行命令行校验;
    命令下发模块,用于若所述控制类命令行通过所述命令行校验且设备状态正常,则封装所述控制类命令行得到控制命令,并将所述控制命令发送至下层执行模块,以便所述下层执行模块对目标硬件执行所述控制命令对应的操作;
    硬件状态读取模块,用于按照预设周期读取所述目标硬件的状态信息,并记录所述目标硬件的状态信息的读取次数;
    命令执行反馈模块,用于若所述目标硬件的状态信息与预设状态信息相同,则判定命令执行成功;用于若所述目标硬件的状态信息的读取次数大于或等于预设值,则判定所述控制命令执行异常,并终止设备控制流程。
  9. 一种电子设备,其特征在于,包括存储器和处理器,所述存储器中 存储有计算机程序,所述处理器调用所述存储器中的计算机程序时实现如权利要求1至7任一项所述设备控制方法的步骤。
  10. 一种存储介质,其特征在于,所述存储介质中存储有计算机可执行指令,所述计算机可执行指令被处理器加载并执行时,实现如上权利要求1至7任一项所述设备控制方法的步骤。
PCT/CN2021/073450 2020-09-11 2021-01-23 一种设备控制方法、系统、电子设备及存储介质 WO2022052407A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010954933.XA CN112114876B (zh) 2020-09-11 2020-09-11 一种设备控制方法、系统、电子设备及存储介质
CN202010954933.X 2020-09-11

Publications (1)

Publication Number Publication Date
WO2022052407A1 true WO2022052407A1 (zh) 2022-03-17

Family

ID=73802912

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/073450 WO2022052407A1 (zh) 2020-09-11 2021-01-23 一种设备控制方法、系统、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN112114876B (zh)
WO (1) WO2022052407A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115033172A (zh) * 2022-04-30 2022-09-09 苏州浪潮智能科技有限公司 一种存储模块管控方法、装置、设备及存储介质
CN115102965A (zh) * 2022-05-25 2022-09-23 弥费实业(上海)有限公司 用于半导体物料仓储设备的secsgem通讯转换系统及方法
CN115200173A (zh) * 2022-07-13 2022-10-18 深圳中集天达空港设备有限公司 登机通道空调的控制方法、装置、电子设备和存储介质
CN116861488A (zh) * 2023-09-01 2023-10-10 北京城建智控科技股份有限公司 数据文件的写入方法及装置、电子设备及存储介质
WO2024104338A1 (zh) * 2022-11-17 2024-05-23 亿航智能设备(广州)有限公司 一种电机控制器控制方法、装置、设备及存储介质
CN118354195A (zh) * 2024-06-17 2024-07-16 合肥安迅精密技术有限公司 贴片机基准标记相机收图控制方法、系统及存储介质

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112114876B (zh) * 2020-09-11 2023-01-10 苏州浪潮智能科技有限公司 一种设备控制方法、系统、电子设备及存储介质
CN113433873A (zh) * 2021-07-21 2021-09-24 合肥市春华起重机械有限公司 一种基于5g网络的随车起重机远程控制系统
CN113821493A (zh) * 2021-07-22 2021-12-21 广东九联科技股份有限公司 一种适配不同记录仪的数据采集方法与系统
CN113777909A (zh) * 2021-09-06 2021-12-10 珠海格力电器股份有限公司 主从通讯控制方法、装置、存储介质及主从通讯控制系统
CN115225477B (zh) * 2022-07-19 2023-12-01 北京天融信网络安全技术有限公司 机框式设备的配置维护方法、装置、电子设备和存储介质
CN118041975B (zh) * 2024-04-11 2024-08-13 杭州海浔科技有限公司 一种集中器设备的命令处理中转方法、系统以及存储介质

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008120337A1 (ja) * 2007-03-28 2008-10-09 Fujitsu Limited ホストバスアダプタ管理プログラム、それを記録したコンピュータ読み取り可能な記録媒体、方法および装置
CN102117234A (zh) * 2011-03-23 2011-07-06 惠州Tcl移动通信有限公司 移动终端在软件升级失败时恢复原有软件的方法
CN109255114A (zh) * 2018-09-17 2019-01-22 四川长虹电器股份有限公司 基于数据配置生成Excel表格和图例的系统及方法
CN110187916A (zh) * 2019-05-31 2019-08-30 四川长虹电器股份有限公司 基于数据配置生成Word文档的方法
CN110502406A (zh) * 2019-07-26 2019-11-26 苏州浪潮智能科技有限公司 存储设备机箱显示灯的管理方法、系统、设备及存储介质
CN110633179A (zh) * 2019-09-05 2019-12-31 苏州浪潮智能科技有限公司 一种机箱物理灯的校验方法及装置
TW202001561A (zh) * 2018-06-12 2020-01-01 和碩聯合科技股份有限公司 藉由電腦系統提示使用者的方法
CN112114876A (zh) * 2020-09-11 2020-12-22 苏州浪潮智能科技有限公司 一种设备控制方法、系统、电子设备及存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003044420A (ja) * 2001-07-27 2003-02-14 Fujitsu Ltd デバイスドライバ装置
CN108826440A (zh) * 2018-07-27 2018-11-16 河北隆基泰和云能源科技有限公司 一种基于物联网的分布式取暖设备智能控制系统及方法
CN111107041B (zh) * 2018-10-26 2022-04-29 海尔智家股份有限公司 防止智能家电被恶意控制的方法与装置

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008120337A1 (ja) * 2007-03-28 2008-10-09 Fujitsu Limited ホストバスアダプタ管理プログラム、それを記録したコンピュータ読み取り可能な記録媒体、方法および装置
CN102117234A (zh) * 2011-03-23 2011-07-06 惠州Tcl移动通信有限公司 移动终端在软件升级失败时恢复原有软件的方法
TW202001561A (zh) * 2018-06-12 2020-01-01 和碩聯合科技股份有限公司 藉由電腦系統提示使用者的方法
CN109255114A (zh) * 2018-09-17 2019-01-22 四川长虹电器股份有限公司 基于数据配置生成Excel表格和图例的系统及方法
CN110187916A (zh) * 2019-05-31 2019-08-30 四川长虹电器股份有限公司 基于数据配置生成Word文档的方法
CN110502406A (zh) * 2019-07-26 2019-11-26 苏州浪潮智能科技有限公司 存储设备机箱显示灯的管理方法、系统、设备及存储介质
CN110633179A (zh) * 2019-09-05 2019-12-31 苏州浪潮智能科技有限公司 一种机箱物理灯的校验方法及装置
CN112114876A (zh) * 2020-09-11 2020-12-22 苏州浪潮智能科技有限公司 一种设备控制方法、系统、电子设备及存储介质

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115033172A (zh) * 2022-04-30 2022-09-09 苏州浪潮智能科技有限公司 一种存储模块管控方法、装置、设备及存储介质
CN115102965A (zh) * 2022-05-25 2022-09-23 弥费实业(上海)有限公司 用于半导体物料仓储设备的secsgem通讯转换系统及方法
CN115200173A (zh) * 2022-07-13 2022-10-18 深圳中集天达空港设备有限公司 登机通道空调的控制方法、装置、电子设备和存储介质
CN115200173B (zh) * 2022-07-13 2024-01-23 深圳中集天达空港设备有限公司 登机通道空调的控制方法、装置、电子设备和存储介质
WO2024104338A1 (zh) * 2022-11-17 2024-05-23 亿航智能设备(广州)有限公司 一种电机控制器控制方法、装置、设备及存储介质
CN116861488A (zh) * 2023-09-01 2023-10-10 北京城建智控科技股份有限公司 数据文件的写入方法及装置、电子设备及存储介质
CN116861488B (zh) * 2023-09-01 2024-01-12 北京城建智控科技股份有限公司 数据文件的写入方法及装置、电子设备及存储介质
CN118354195A (zh) * 2024-06-17 2024-07-16 合肥安迅精密技术有限公司 贴片机基准标记相机收图控制方法、系统及存储介质

Also Published As

Publication number Publication date
CN112114876B (zh) 2023-01-10
CN112114876A (zh) 2020-12-22

Similar Documents

Publication Publication Date Title
WO2022052407A1 (zh) 一种设备控制方法、系统、电子设备及存储介质
JP2019500680A (ja) データ処理方法及び装置
US9430221B2 (en) Device and method for updating firmware of a rackmount server system
CN102984500A (zh) 一种实现多种视频监控设备兼容的方法、装置和系统
US11579960B2 (en) Chip fault diagnosis method, chip fault diagnosis device, computer-readable storage medium and electronic equipment
WO2022198973A1 (zh) 一种服务器固件自恢复系统及服务器
US10235278B2 (en) Software testing using statistical error injection
WO2024113780A1 (zh) 一种fc链路管理方法、装置、设备及可读存储介质
CN111400081A (zh) 进程的守护方法、装置、电子设备和计算机存储介质
US11930292B2 (en) Device state monitoring method and apparatus
TW201308072A (zh) 伺服器穩定性測試方法及系統
CN110380929A (zh) 一种幂等有效性检测方法、装置及设备
CN118193238A (zh) 一种业务信息的处理方法、装置、设备及存储介质
WO2022027773A1 (zh) 一种多协议端口的共用方法、系统及服务器
WO2024124862A1 (zh) 基于服务器的内存处理方法和装置、处理器及电子设备
WO2023035426A1 (zh) 一种静电干扰处理方法、装置、设备及可读存储介质
CN115794525A (zh) 一种bmc压力测试方法、装置、设备及存储介质
CN113835971A (zh) 一种服务器背板异常点灯的监测方法及相关组件
CN111858136A (zh) 固态硬盘异常数据检测方法、系统、电子设备及存储介质
CN118132358B (zh) 注错方法、系统、上位机、控制器、设备和存储介质
CN110554932A (zh) 一种api模块异常检测方法
CN111258833A (zh) 一种高速总线稳定性检测方法、系统及相关组件
CN110399263A (zh) Bmc功能版本号的验证方法、装置、电子设备及介质
CN115002241B (zh) 一种智能仪器的操控方法、系统、电子设备及其介质
CN114518972B (zh) 内存错误处理方法、装置、内存控制器及处理器

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21865471

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21865471

Country of ref document: EP

Kind code of ref document: A1