CN112114876B - Equipment control method, system, electronic equipment and storage medium - Google Patents

Equipment control method, system, electronic equipment and storage medium Download PDF

Info

Publication number
CN112114876B
CN112114876B CN202010954933.XA CN202010954933A CN112114876B CN 112114876 B CN112114876 B CN 112114876B CN 202010954933 A CN202010954933 A CN 202010954933A CN 112114876 B CN112114876 B CN 112114876B
Authority
CN
China
Prior art keywords
command
control
state
command line
control command
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202010954933.XA
Other languages
Chinese (zh)
Other versions
CN112114876A (en
Inventor
姜辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010954933.XA priority Critical patent/CN112114876B/en
Publication of CN112114876A publication Critical patent/CN112114876A/en
Priority to PCT/CN2021/073450 priority patent/WO2022052407A1/en
Application granted granted Critical
Publication of CN112114876B publication Critical patent/CN112114876B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

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

The application discloses an equipment control method, which comprises the following steps: receiving a control command line, and verifying the command line of the control command line; if the control command line passes the command line verification and the equipment state is normal, packaging the control command line to obtain a control command, and sending the control command to a lower-layer execution module; reading the state information of the target hardware according to a preset period, and recording the reading times of the state information of the target hardware; if the state information of the target hardware is the same as the preset state information, judging that the command is successfully executed; and if the reading times of the state information of the target hardware are greater than or equal to a preset value, judging that the execution of the control command is abnormal, and terminating the equipment control flow. The method and the device can improve the accuracy of the command execution result. The application also discloses an equipment control system, an electronic equipment and a storage medium, which have the beneficial effects.

Description

Equipment control method, system, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to an apparatus control method and system, an electronic apparatus, and a storage medium.
Background
In the storage device, the main role of the control command line for the case management is that a user controls related hardware devices on the storage device through the input of the command line, such as lighting a case warning lamp or restarting the device, so that the command line can quickly and accurately inform the user of a control result so as to guide the user to perform subsequent operations.
The execution of the control commands of the storage device is mainly realized by two modules: the upper layer module is responsible for analyzing and processing the command line and packaging and issuing the command line to the lower layer execution module, and the lower layer execution module actually executes the specific command for controlling the hardware. In the related art, the interaction of the upper system and the lower system adopts asynchronous processing to improve the return efficiency of the command, but the mode brings uncertainty of command execution, the successful return of the upper layer does not represent that the actual physical device successfully receives the command, and if the physical device or the physical link has a fault, the command is successfully issued but the physical device is not really changed and controlled.
Therefore, how to improve the accuracy of the command execution result is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The application aims to provide a device control method, a device control system, an electronic device and a storage medium, which can improve the accuracy of a command line execution result.
In order to solve the above technical problem, the present application provides an apparatus control method, including:
receiving a control command line, and verifying the command line of the control command line;
if the control command line passes the command line verification and the equipment state is normal, encapsulating the control command line to obtain a control command, and sending the control command to a lower-layer execution module so that the lower-layer execution module can execute the operation corresponding to the control command on target hardware;
reading the state information of the target hardware according to a preset period, and recording the reading times of the state information of the target hardware;
if the state information of the target hardware is the same as the preset state information, judging that the command is successfully executed;
and if the reading times of the state information of the target hardware are larger than or equal to a preset value, judging that the control command is abnormal to execute, and terminating the equipment control flow.
Optionally, the method further includes:
if the control command line fails to pass the command line verification, the equipment control flow is terminated, and a corresponding error code is returned according to the command line verification result.
Optionally, after receiving the control class command line, the method further includes:
acquiring the equipment state, and judging whether the equipment state is normal or not;
the equipment state comprises a node state and a case state, the node state is used for describing whether a node is on line or not, the case state is used for describing whether a case is on line or not, and the equipment state is judged to be normal when the node state and the case state are on line.
Optionally, the method further includes:
if the equipment state is abnormal, the equipment control flow is terminated, and a corresponding error code is returned according to the equipment state.
Optionally, the checking the command line of the control class command line includes:
judging whether the format of the control command line is correct or not to obtain a first judgment result;
judging whether the parameters of the control command line are correct or not to obtain a second judgment result;
if the first judgment result and the second judgment result are both yes, judging that the control command line passes the command line verification;
if the first judgment result and the second judgment result are not both yes, the control type command line is judged not to pass the command line verification.
Optionally, sending the control command to the lower layer execution module includes:
sending the control command to the lower layer execution module and recording command issuing times;
judging whether response information returned by the lower layer execution module is received within preset time;
if so, judging that the control command is sent to a lower layer execution module;
if not, the step of sending the control command to the lower layer execution module and recording the command issuing times is carried out;
if the command issuing times are larger than the preset issuing times, the equipment control flow is terminated, and an error code for failure of command issuing is returned.
Optionally, the method further includes:
and after judging that the response information returned by the lower layer execution module is not received within the preset time, switching a sending link of the control command so as to repeatedly send the control command to the lower layer execution module through a new link.
The present application also provides an apparatus control system, including:
the command line checking module is used for receiving the control command line and checking the command line of the control command line;
the command issuing module is used for packaging the control type command line to obtain a control command and sending the control command to the lower layer execution module if the control type command line passes the command line verification and the equipment state is normal, so that the lower layer execution module can execute the operation corresponding to the control command on the target hardware;
the hardware state reading module is used for reading the state information of the target hardware according to a preset period and recording the reading times of the state information of the target hardware;
the command execution feedback module is used for judging that the command is successfully executed if the state information of the target hardware is the same as the preset state information; and if the reading times of the state information of the target hardware are larger than or equal to a preset value, judging that the control command is abnormal to execute, and terminating the equipment control flow.
The present application also provides a storage medium having stored thereon a computer program that, when executed, implements the steps performed by the above-described apparatus control method.
The application also provides an electronic device, which comprises a memory and a processor, wherein the memory is stored with a computer program, and the processor realizes the steps executed by the device control method when calling the computer program in the memory.
The application provides an equipment control method, which comprises the following steps: receiving a control command line, and verifying the command line of the control command line; if the control command line passes the command line verification and the equipment state is normal, encapsulating the control command line to obtain a control command, and sending the control command to a lower-layer execution module so that the lower-layer execution module can execute the operation corresponding to the control command on target hardware; reading the state information of the target hardware according to a preset period, and recording the reading times of the state information of the target hardware; if the state information of the target hardware is the same as the preset state information, judging that the command is successfully executed; and if the reading times of the state information of the target hardware are larger than or equal to a preset value, judging that the control command is abnormal to execute, and terminating the equipment control flow.
According to the method and the device, command line verification is carried out after the control command line is received, and if the control command line passes the command line verification and the equipment state is normal, the control command is obtained by packaging the control command line. After the control command is sent to the lower layer execution module, the lower layer execution module may execute an operation corresponding to the control command on the target hardware. According to the method and the device, whether the control instruction is successfully executed is judged 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 control instruction is repeatedly read at intervals of preset time length until the state information of the target hardware is the same as the preset state information or the repetition times are larger than or equal to the preset value. According to the method and the device, the state information of the target hardware is used as a basis for evaluating whether the control instruction is successfully executed, the state information of the target hardware is read again at a certain time interval after not being preset, and compared with a scheme that the execution is successful after the command is issued to a lower-layer execution module in the related art, the accuracy of the execution result of the command line can be improved. The application also provides an equipment control system, a storage medium and an electronic equipment, which have the beneficial effects and are not described again.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of an apparatus control method according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a method for sending a control command according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an interactive system based on a control class command line of a storage device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an apparatus control system according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart of an apparatus control method according to an embodiment of the present disclosure.
The method comprises the following specific steps:
s101: receiving a control command line, and verifying the command line of the control command line;
the embodiment can be applied to a storage device, and the storage device comprises an upper-layer command processing module, a lower-layer execution module and hardware; the upper layer command processing module can receive a control command line input by a user and issue a control command obtained by the encapsulated control command line to the lower layer execution module, and the lower layer execution module can execute corresponding control operation on hardware according to the control command.
After receiving the control class command line, the present embodiment may perform a command line check operation on the control class command line. If the control command line fails to pass the command line verification, the equipment control flow 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 rule, and this embodiment may perform the command line verification operation according to the type of the control type command line. On the basis of determining the standard format and the standard parameter matching rule of the command line, the process of performing command line verification may include: judging whether the format of the control command line is correct or not to obtain a first judgment result; judging whether the parameters of the control command line are correct or not to obtain a second judgment result; if the first judgment result and the second judgment result are both yes, judging that the control command line passes the command line verification; if the first judgment result and the second judgment result are not both yes, the control type command line is judged not to pass the command line verification. It can be understood that if the first determination result is negative, it may be determined that the command line is abnormal and terminate the device control flow, and may also output an error code in which the command line format has an error; if the second judgment result is no, the command line can be judged to have abnormity, the equipment control flow is terminated, and error codes of the command line parameters with errors can be output.
S102: if the control command line passes the command line verification and the equipment state is normal, encapsulating the control command line to obtain a control command, and sending the control command to a lower-layer execution module so that the lower-layer execution module can execute the operation corresponding to the control command on target hardware;
a scheme for detecting the state of the device may also exist before the step, and specifically, after the control command line is received, the state of the device may be acquired and whether the state of the device is normal or not may be judged; the device state may include a node state and a chassis state, where the node state is used to describe whether a node is online, the chassis state is used to describe whether a chassis is online, and when both the node state and the chassis state are online, the device state is determined to be normal. Further, if the node is offline and/or the chassis is offline, it is determined that the device state is abnormal, and the device control process may be terminated and a corresponding error code may be returned according to the device state.
Under the premise that the control command line passes the command line verification and the equipment state, the control command line can be packaged to obtain a control command, and the control command is issued to the lower-layer execution module, so that the lower-layer execution module can execute the operation corresponding to the control command on the target hardware. Specifically, the lower layer execution module may analyze the control command to determine hardware that needs to be controlled, that is, target hardware, and then execute an operation corresponding to the control command on the target hardware.
S103: reading the state information of the target hardware according to a preset period, and recording the reading times of the state information of the target hardware;
after the control command is sent to the lower layer execution module, the present embodiment may read the state information of the target hardware 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 is updated to the preset state information. For example, the lower execution module controls the chassis to perform the lighting operation, and after the chassis is successfully lighted, the value of the lighting state flag in the state information of the chassis will be changed from 0 to 1, in this example, the value "1" of the lighting state flag is the preset state information.
It can be understood that, after the control command is sent to the lower layer execution module, the lower layer execution module needs a certain time to execute the control command, and therefore, when it is detected that the state information of the target hardware is different from the preset state information, new state information of the target hardware may be read again at a time interval of a preset period, and until the state information of the target hardware is the same as the preset state information, it is determined that the command is successfully executed. In this embodiment, while reading the state information of the target hardware, the number of times of reading the state information of the target hardware, that is, the number of times of reading the state information of the target hardware is also recorded, and if the number of times of reading the state information of the target hardware is greater than or equal to a preset value, it indicates that the control command is not executed or is not successfully executed by the lower layer execution module within a long time, at this time, it may be determined that the control command is abnormally executed, and the device control flow is terminated.
S104: if the state information of the target hardware is the same as the preset state information, judging that the command is successfully executed;
s105: and if the reading times of the state information of the target hardware are larger than or equal to a preset value, judging that the control command is abnormal to execute, and terminating the equipment control flow.
In the embodiment, a state machine mode and a timer mode are adopted to process the control requirements of a control type command line, the command is terminated immediately after the problem occurs in each step, the fault reasons are respectively informed to the user, after the command is successfully executed, whether the issuing of the control command is effective is judged by checking whether the actual result of hardware information is consistent with the expected result issued by the command, if not, the hardware information is acquired at regular time, and if not, the user is informed that the hardware has the fault.
In this embodiment, after the control type command line is received, command line verification is performed, and if the control type command line passes the command line verification and the device state is normal, the control command is obtained by encapsulating the control type command line. After the control command is sent to the lower layer execution module, the lower layer execution module may execute an operation corresponding to the control command on the target hardware. In this embodiment, whether the control instruction is successfully executed is determined by reading the state information of the target hardware, and if the state information of the target hardware is different from the preset state information, the control instruction is repeatedly read at intervals of a preset time length until the state information of the target hardware is the same as the preset state information or the repetition times are greater than or equal to a preset value. In the embodiment, the state information of the target hardware is used as a basis for evaluating whether the control instruction is successfully executed, and is read again at a certain time interval after the state information of the target hardware is not the preset state information, so that the accuracy of the execution result of the command line can be improved compared with a scheme that the execution is successfully returned after the command is issued to the lower layer execution module in the related art.
Referring to fig. 2, fig. 2 is a flowchart of a method for sending a control command according to an embodiment of the present application, where this embodiment further describes S102 in the embodiment corresponding to fig. 1, and a further implementation manner can be obtained by combining this embodiment with the embodiment corresponding to fig. 1, where this embodiment may include the following steps:
s201: sending the control command to a lower layer execution module and recording command issuing times;
s202: judging whether response information returned by the lower layer execution module is received within preset time; if yes, entering S203; if not, the process goes to S201;
s203: and judging that the control command is sent to a lower layer execution module.
As a feasible implementation manner, in the execution process of the above embodiment, if it is detected that the command issuing number is greater than the preset issuing number, the device control flow is terminated, and an error code indicating that the command issuing fails is returned. Further, in this embodiment, after it is determined that the response message returned by the lower layer execution module is not received within the preset time, the sending link of the control command is switched, so that the control command is repeatedly sent to the lower layer execution module through a new link. By the method for switching the new link to send the control command, the success rate of sending the control command can be improved.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an interactive system based on a control class command line of a storage device according to an embodiment of the present application, where an application scenario of the system may include: the device comprises a command line input module, an upper layer command processing module, a lower layer execution module and a hardware device which needs to be controlled specifically. The present embodiment may be applied to an upper layer command processing module of a storage device, where the upper layer command processing module may include a command checking sub-module, a command issuing sub-module, a command task result determining and retrying module, a sub-module for reading actual information, and a sub-module for checking data. The five sub-modules all have corresponding error codes. The embodiment can be rapidly terminated when an exception is encountered through the accurate division of five sub-modules and the realization of a state machine; meanwhile, the accurate and detailed error code classification method can inform the user of the accurate error reason; the retry strategy after the command execution fails increases the reliability of the system, the hardware data can be quickly updated by updating the data in a polling mode and a time selection principle, and the phenomenon that the command line return time is increased due to overlong period or the load of a CPU is increased due to overlong polling frequency is avoided. The five sub-modules adopt a state machine to carry out state switching, and a certain task fails to execute and returns to a command line immediately; error codes are classified into three major categories after an exception occurs: (1) checking for lossiness; (2) task execution lossiness; and (3) hardware fault class. Meanwhile, in the type (1) error, error codes are finely divided according to check items and fault reasons are accurately reflected. In this embodiment, if the task for updating the hardware information is not successfully executed or the data is not updated after the task is successfully executed, the command issuing sub-module issues the command again. The embodiment can also adopt a timer mode to regularly trigger the process to update the hardware data, and if the updated data is inconsistent with the expected result, the data acquisition is repeated; the timer timing time principle is as follows: and counting the average time actually executed by the hardware device after the normal command is issued for a plurality of times as t, wherein the timing time of the timer is t/2, and triggering the flow to update the hardware data after the time is out.
The command verification submodule can be used for verifying whether the command line input is correct and whether the parameter matching is reasonable, and can also be used for judging whether the state information of the storage device is normal. If the command check submodule fails in checking, the returned error code may be a check failure, and the error code may include an error code corresponding to the check item subdivision. The command issuing submodule can be used for encapsulating the control command line to obtain a control command, encapsulating the command according to a protocol specified by an upper-layer system and a lower-layer system and issuing the encapsulated command to the lower-layer execution module, and can also receive a return code indicating that the command is successfully issued or the command is failed to be issued. The error code category of the command issuing sub-module may be a task execution failure. The command task result judging and retrying module can be used for judging whether the control command is successfully issued or not, and if the command is unsuccessfully issued, the command is issued again. The error code type of the command task result determining and retrying module may be a task execution failure. The actual information reading sub-module is used for reading the updated specific hardware information, and the error code type of the actual information reading sub-module can be a task execution failure. The verification data-to-module can be used for verifying whether the updated hardware information is consistent with the expected result of the expected control command, if not, a timer is started, the bottom-layer hardware information is polled at regular time, the result is verified again after the data is updated, and if the time exceeds the specified time, the hardware firmware error code is reported. The command verification sub-module and the command issuing sub-module execute the command in sequence, the command task result judging and retrying module, the actual information reading sub-module and the data verification sub-module, and the command line immediately returns the corresponding line error code after the execution of a certain task fails, so that the execution efficiency of the control command line is improved.
The embodiment adopts the state machine to execute in a distributed manner, so that the condition that the subsequent steps can be immediately terminated when the processing flow of the previous state is unsuccessful can be ensured, and the execution efficiency of a command line is improved; meanwhile, the issuing and checking of the control command can be carried out in an independent module, so that the accuracy of the issuing of the command can be ensured. The command line return code cases are divided into four specific categories: (1) successful execution without return information; (2) the check fails and the check failed error code error is returned; (3) The control command cannot be successfully issued to the task failure return code of the bottom execution system; (4) A hardware failure return code that commands were successfully issued but failed to check. The category (2) is specifically divided into detailed check items, each item corresponds to a unique return code, and a user can obtain a detailed fault reason by comparing the error category and the specific error code with an error code guide manual. According to the method and the device, the execution efficiency and the accuracy of the command line can be improved, and the fault information can be accurately informed to the user in an abnormal scene.
In the embodiment, the control command line execution interactive design method based on the storage device is adopted, so that the command can be accurately executed and returned, good user experience is achieved, and meanwhile due to the data verification module, the successful return of the command line can ensure that the command can be successfully executed, and errors caused by common upper and lower system asynchronous processing are avoided; meanwhile, the embodiment has detailed specific error code division, and can accurately inform a user of the fault type; the timer polling strategy adopted by the data updating module and the selection time principle of the timer can efficiently update and verify data so as to lay a foundation for the rapid execution of the command line.
The following describes the flow described in the above embodiment by using a scheme of issuing a lighting command of a chassis positioning lamp through a control-type command line in practical application, where this embodiment may include the following steps:
step 1: the command line receives and issues a command for lighting the case positioning lamp: the chemomeasure-identification yes-resonator id enclosreid.
Step 2: after receiving a command, firstly checking whether the format of a command line is correct, wherein yes/no is added to a parameter of identification to indicate whether the command line is on or off; if the parameter misses the termination task, the command line returns. Secondly, the embodiment also needs to check whether the node of the storage device needing to be lighted, namely the id corresponding to the resonator, is online, and if not, the task is terminated; similarly, the case where the node is located also needs to be online, otherwise, the termination task returns a corresponding error code; and entering a command issuing task after the task is successfully executed.
And step 3: the system for loading and unloading in the present embodiment adopts an SES (SCSI Enclosure Services, small computer system interface chassis service protocol), and the module issues the received command to the lower layer execution module according to the SES protocol, and waits to determine whether the control command returns normally.
And 4, step 4: if the command execution fails, the lighting command is repackaged and sent to the bottom layer system, and the command execution succeeds and then the step 5 is carried out, so that the actual result of the physical lamp is updated to the upper layer system.
And 5: after the command is successfully executed, the actual result of the physical lamp is read by starting a 10s timer, and the step 6 is proceeded after the update is successful.
And 6: comparing the updated data with an expected result, restarting a 10s timer to poll and update the data if the updated data does not reach the expected target, and then checking the data, wherein the selection principle of the 10s time interval is half of the normal hardware updating time period, and the method can take the updated data in the minimum time and reduce the CPU occupation time; if the data after multiple updates are inconsistent and overtime for 1 minute, reporting a hardware fault to a user and terminating the task, and if the data are verified successfully, successfully returning to a command line, wherein the command line information has no error prompt information.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an apparatus control system according to an embodiment of the present disclosure;
the system may include:
the command line checking module 100 is configured to receive a control command line and check the control command line;
a command issuing module 200, configured to encapsulate the control-type command line to obtain a control command and send the control command to a lower-layer execution module if the control-type command line passes the command line verification and the device state is normal, so that the lower-layer execution module executes an operation corresponding to the control command on target hardware;
a hardware status reading module 300, configured to read the status information of the target hardware according to a preset period, and record the number of times of reading the status information of the target hardware;
a command execution feedback module 400, configured to determine that command execution is successful if the state information of the target hardware is the same as preset state information; and the controller is used for judging that the execution of the control command is abnormal and terminating the equipment control flow if the reading times of the state information of the target hardware are greater than or equal to a preset value.
In this embodiment, after the control command line is received, the command line is verified, and 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 layer execution module, the lower layer execution module may execute an operation corresponding to the control command on the target hardware. In this embodiment, whether the control instruction is successfully executed is determined by reading the state information of the target hardware, and if the state information of the target hardware is different from the preset state information, the control instruction is repeatedly read at intervals of a preset time length until the state information of the target hardware is the same as the preset state information or the repetition number is greater than or equal to a preset value. In the embodiment, the state information of the target hardware is used as a basis for evaluating whether the control instruction is executed successfully, and the control instruction is read again at intervals after the state information of the target hardware is not the preset state information.
Further, the method also comprises the following steps:
and the first error code returning module is used for terminating the equipment control flow if the control type command line fails to pass the command line verification and returning a corresponding error code according to a command line verification result.
Further, the method also comprises the following steps:
the device state detection module is used for acquiring the device state after receiving the control command line and judging whether the device state is normal or not;
the equipment state comprises a node state and a case state, the node state is used for describing whether a node is on line or not, the case state is used for describing whether a case is on line or not, and the equipment state is judged to be normal when the node state and the case state are on line.
Further, the method also comprises the following steps:
and the second error code returning module is used for terminating the equipment control flow if the equipment state is abnormal and returning the corresponding error code according to the equipment state.
Further, the command line checking module 100 includes:
the format checking unit is used for judging whether the format of the control type command line is correct or not to obtain a first judgment result;
the parameter checking unit is used for judging whether the parameters of the control command line are correct or not to obtain a second judgment result;
the judging unit is used for judging that the control command line passes the command line verification if the first judging result and the second judging result are both yes; and the control type command line verification module is further configured to determine that the control type command line fails the command line verification if the first determination result and the second determination result are not both yes.
Further, the command issuing module 200 includes:
the issuing unit is used for sending the control command to the lower layer execution module and recording command issuing times;
the response detection unit is used for judging whether response information returned by the lower layer execution module is received within preset time; if yes, the control command is judged to be sent to a lower layer execution module; if not, entering the step of sending the control command to the lower layer execution module and recording the command issuing times;
and the error detection unit is used for terminating the equipment control flow and returning an error code failing to issue the command if the command issuing times are greater than the preset issuing times.
Further, the method also comprises the following steps:
and the link switching unit is used for switching a sending link of the control command after judging that the response information returned by the lower layer execution module is not received in the preset time, so that the control command is repeatedly sent to the lower layer execution module through a new link.
Since the embodiment of the system part corresponds to the embodiment of the method part, the embodiment of the system part is described with reference to the embodiment of the method part, and is not repeated here.
The present application also provides a storage medium having a computer program stored thereon, which when executed, may implement the steps provided by the above-described embodiments. The storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The present application further provides an electronic device, which may include a memory and a processor, where the memory stores a computer program, and when the processor calls the computer program in the memory, the steps provided in the foregoing embodiments may be implemented. Of course, the electronic device may also include various network interfaces, power supplies, and the like.
The embodiments are described in a progressive mode in the specification, the emphasis of each embodiment is on the difference from the other embodiments, and the same and similar parts among the embodiments can be referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

Claims (9)

1. An apparatus control method, characterized by comprising:
receiving a control command line, and verifying the command line of the control command line;
if the control command line passes the command line verification and the equipment state is normal, packaging the control command line to obtain a control command, and sending the control command to a lower-layer execution module so that the lower-layer execution module can execute the operation corresponding to the control command on target hardware;
reading the state information of the target hardware according to a preset period, and recording the reading times of the state information of the target hardware;
if the state information of the target hardware is the same as the preset state information, judging that the command is successfully executed;
if the reading times of the state information of the target hardware are larger than or equal to a preset value, judging that the execution of the control command is abnormal, and terminating the equipment control flow;
after receiving the control class command line, the method further comprises the following steps:
acquiring the equipment state, and judging whether the equipment state is normal or not;
the equipment state comprises a node state and a case state, the node state is used for describing whether a node is on line or not, the case state is used for describing whether a case is on line or not, and the equipment state is judged to be normal when the node state and the case state are on line.
2. The device control method according to claim 1, characterized by further comprising:
if the control command line fails to pass the command line verification, the equipment control flow is terminated, and a corresponding error code is returned according to the command line verification result.
3. The device control method according to claim 1, characterized by further comprising:
if the equipment state is abnormal, the equipment control flow is terminated, and a corresponding error code is returned according to the equipment state.
4. The device control method of claim 1, wherein the command line checking the control class command line comprises:
judging whether the format of the control type command line is correct or not to obtain a first judgment result;
judging whether the parameters of the control command line are correct or not to obtain a second judgment result;
if the first judgment result and the second judgment result are both yes, judging that the control command line passes the command line verification;
if the first judgment result and the second judgment result are not both yes, the control type command line is judged not to pass the command line verification.
5. The device control method according to any one of claims 1 to 4, wherein sending the control command to a lower layer execution module comprises:
sending the control command to the lower layer execution module and recording command issuing times;
judging whether response information returned by the lower layer execution module is received within preset time;
if yes, the control command is judged to be sent to a lower layer execution module;
if not, entering the step of sending the control command to the lower layer execution module and recording the command issuing times;
if the command issuing times are larger than the preset issuing times, the equipment control flow is terminated, and an error code for failure of command issuing is returned.
6. The apparatus control method according to claim 5, further comprising:
and after judging that the response information returned by the lower layer execution module is not received within the preset time, switching a sending link of the control command so as to repeatedly send the control command to the lower layer execution module through a new link.
7. An appliance control system, comprising:
the command line checking module is used for receiving the control command line and checking the command line of the control command line;
the command issuing module is used for packaging the control type command line to obtain a control command and sending the control command to the lower layer execution module if the control type command line passes the command line verification and the equipment state is normal, so that the lower layer execution module can execute the operation corresponding to the control command on the target hardware;
the hardware state reading module is used for reading the state information of the target hardware according to a preset period and recording the reading times of the state information of the target hardware;
the command execution feedback module is used for judging that the command is successfully executed if the state information of the target hardware is the same as the preset state information; the device is used for judging that the control command is abnormal to execute if the reading times of the state information of the target hardware are larger than or equal to a preset value, and stopping the device control flow;
the device state detection module is used for acquiring the device state after receiving the control command line and judging whether the device state is normal or not;
the device state comprises a node state and a case state, the node state is used for describing whether a node is on line or not, the case state is used for describing whether a case is on line or not, and the device state is judged to be normal when the node state and the case state are on line.
8. An electronic device, comprising a memory in which a computer program is stored and a processor which, when calling the computer program in the memory, carries out the steps of the device control method according to any one of claims 1 to 6.
9. A storage medium having stored thereon computer-executable instructions which, when loaded and executed by a processor, carry out the steps of a method of controlling a device according to any one of claims 1 to 6.
CN202010954933.XA 2020-09-11 2020-09-11 Equipment control method, system, electronic equipment and storage medium Active CN112114876B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010954933.XA CN112114876B (en) 2020-09-11 2020-09-11 Equipment control method, system, electronic equipment and storage medium
PCT/CN2021/073450 WO2022052407A1 (en) 2020-09-11 2021-01-23 Device control method and system, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010954933.XA CN112114876B (en) 2020-09-11 2020-09-11 Equipment control method, system, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112114876A CN112114876A (en) 2020-12-22
CN112114876B true CN112114876B (en) 2023-01-10

Family

ID=73802912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010954933.XA Active CN112114876B (en) 2020-09-11 2020-09-11 Equipment control method, system, electronic equipment and storage medium

Country Status (2)

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

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112114876B (en) * 2020-09-11 2023-01-10 苏州浪潮智能科技有限公司 Equipment control method, system, electronic equipment and storage medium
CN113433873A (en) * 2021-07-21 2021-09-24 合肥市春华起重机械有限公司 Lorry-mounted crane remote control system based on 5G network
CN113777909A (en) * 2021-09-06 2021-12-10 珠海格力电器股份有限公司 Master-slave communication control method, device, storage medium and master-slave communication control system
CN115033172B (en) * 2022-04-30 2024-06-25 苏州浪潮智能科技有限公司 Storage module management and control method, device, equipment and storage medium
CN115102965B (en) * 2022-05-25 2024-06-25 弥费科技(上海)股份有限公司 SECSGEM communication conversion system and method for semiconductor material storage equipment
CN115200173B (en) * 2022-07-13 2024-01-23 深圳中集天达空港设备有限公司 Control method and device of boarding passage air conditioner, electronic equipment and storage medium
CN115225477B (en) * 2022-07-19 2023-12-01 北京天融信网络安全技术有限公司 Configuration maintenance method and device for frame type equipment, electronic equipment and storage medium
CN115664268A (en) * 2022-11-17 2023-01-31 亿航智能设备(广州)有限公司 Motor controller control method, device, equipment and storage medium
CN116861488B (en) * 2023-09-01 2024-01-12 北京城建智控科技股份有限公司 Data file writing method and device, electronic equipment and storage medium
CN118041975A (en) * 2024-04-11 2024-05-14 杭州海浔科技有限公司 Command processing transfer method, system and storage medium of concentrator device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108826440A (en) * 2018-07-27 2018-11-16 河北隆基泰和云能源科技有限公司 A kind of distributed heating system intelligence control system and method based on Internet of Things
CN111107041A (en) * 2018-10-26 2020-05-05 青岛海尔股份有限公司 Method and device for preventing intelligent household appliance from being maliciously controlled

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003044420A (en) * 2001-07-27 2003-02-14 Fujitsu Ltd Bus driver device
WO2008120337A1 (en) * 2007-03-28 2008-10-09 Fujitsu Limited Host bus adapter managing program, computer readable recording medium recording the same, recording method and recording device
CN102117234B (en) * 2011-03-23 2013-07-03 惠州Tcl移动通信有限公司 Method for recovering original software by mobile terminal in software upgrading failure
TW202001561A (en) * 2018-06-12 2020-01-01 和碩聯合科技股份有限公司 Method for notifying a user via a computer system
CN109255114A (en) * 2018-09-17 2019-01-22 四川长虹电器股份有限公司 The system and method for Excel table and legend is generated based on data configuration
CN110187916B (en) * 2019-05-31 2022-09-02 四川长虹电器股份有限公司 Method for generating Word document based on data configuration
CN110502406A (en) * 2019-07-26 2019-11-26 苏州浪潮智能科技有限公司 Store management method, system, equipment and the storage medium of equipment cabinets display lamp
CN110633179A (en) * 2019-09-05 2019-12-31 苏州浪潮智能科技有限公司 Method and device for checking physical lamp of case
CN112114876B (en) * 2020-09-11 2023-01-10 苏州浪潮智能科技有限公司 Equipment control method, system, electronic equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108826440A (en) * 2018-07-27 2018-11-16 河北隆基泰和云能源科技有限公司 A kind of distributed heating system intelligence control system and method based on Internet of Things
CN111107041A (en) * 2018-10-26 2020-05-05 青岛海尔股份有限公司 Method and device for preventing intelligent household appliance from being maliciously controlled

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Kvaser Leaf Light v2的车载控制单元Bootloader测试系统设计;王邵龙等;《汽车电器》;20180520(第05期);全文 *

Also Published As

Publication number Publication date
CN112114876A (en) 2020-12-22
WO2022052407A1 (en) 2022-03-17

Similar Documents

Publication Publication Date Title
CN112114876B (en) Equipment control method, system, electronic equipment and storage medium
CN105550113B (en) Web test method and test machine
CN111708650A (en) High-availability analysis method and system for business application system
CN113157411A (en) Reliable configurable task system and device based on Celery
CN113189664B (en) Object placing state detection method and device
CN114020432A (en) Task exception handling method and device and task exception handling system
CN108920338A (en) A kind of method and terminal indicating file system state
CN111756594B (en) Control method of pressure test, computer device and computer readable storage medium
CN111930719A (en) Database access method, device and system
CN116521405A (en) sd card state detection method, device, equipment and storage medium
CN113419949B (en) Abnormality detection method, device, equipment and storage medium for data processing
CN106855804B (en) Code change management and control method and device
CN112596750B (en) Application testing method and device, electronic equipment and computer readable storage medium
CN114968694A (en) Hard disk fault injection method, device, equipment and storage medium
CN111078239B (en) Map data updating method and device
CN107797915B (en) Fault repairing method, device and system
CN111858136A (en) Method and system for detecting abnormal data of solid state disk, electronic device and storage medium
CN111338678A (en) Method and equipment for upgrading and checking storage system
CN111444032A (en) Computer system fault repairing method, system and equipment
CN111625185A (en) Method, system and related assembly for monitoring disk fault
CN111309532A (en) PCIE equipment abnormity detection method, system, electronic equipment and storage medium
CN113037521A (en) Method for identifying state of communication equipment, communication system and storage medium
CN117172925B (en) Transaction processing method, device, equipment and medium
WO2023226601A1 (en) Anomaly processing method and apparatus for heterogeneous acceleration resource, and storage medium and electronic apparatus
CN117313856B (en) Reliability test planning system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant