Control instruction processing method, apparatus and device, and computer storage medium
View Patent ↗A control instruction processing method, apparatus and a device, and a computer storage medium. The method is applied to a first control system. The method includes: receiving a target control instruction on the basis of a control instruction receiving thread, the target control instruction including a control instruction sent by a second control system that controls the first control system (S 101 ); determining whether the target control instruction is legitimate (S 102 ); if the target control instruction is legitimate, storing the target control instruction in a pre-set queue, and sending, to the second control system, information which represents the fact that the target control instruction has been received, such that the second control system ends the sending of the target control instruction (S 103 ); and processing the control instruction in the pre-set queue on the basis of a control instruction processing thread (S 104 ).
1 . A method for processing a control instruction, applied to a server, wherein a controller of the server comprises a first control system and a second control system, the first control system is an embedded system, the second control system is a system running on a server central processing unit, and the method comprises:
receiving, by the first control system, a target control instruction according to a control instruction receiving thread, wherein the target control instruction comprises a control instruction sent by a second control system that controls the first control system;
determining, by the first control system, whether the target control instruction is legal, and when the target control instruction is legal, storing the target control instruction in a preset queue, and sending a message indicating that the target control instruction is received to the second control system, so that the second control system stops sending the target control instruction; and
processing, by the first control system, the target control instruction in the preset queue according to a control instruction processing thread;
wherein after processing the target control instruction in the preset queue according to a control instruction processing thread, the method further comprises:
determining whether a processing query instruction sent by the second control system for querying a target processing result of the target control instruction is received; and
when the processing query instruction is received, sending the target processing result to the second control system; and
wherein sending the target processing result to the second control system comprise:
calculating a time interval between receiving the target control instruction and receiving the processing query instruction;
determining whether the time interval is less than a preset instruction processing duration;
when the time interval is greater than or equal to the preset instruction processing duration, acquiring the target processing result, and sending the target processing result to the second control system; and
when the time interval is less than the preset instruction processing duration, acquiring the target processing result after waiting for a preset compensation duration, and sending the target processing result to the second control system.
2 . The method according to claim 1 , before calculating a time interval between receiving the target control instruction and receiving the processing query instruction, further comprising:
negotiating the preset instruction processing duration with the second control system.
3 . The method according to claim 1 , further comprising:
receiving a state query instruction according to the control instruction receiving thread, wherein the state query instruction comprises a query instruction sent by the second control system;
acquiring a target query result corresponding to the state query instruction according to the control instruction processing thread; and
transmitting the target query result to the second control system according to the control instruction receiving thread.
4 . The method according to claim 3 , wherein determining whether the target control instruction is legal comprises:
determining whether a type of the target control instruction is of a preset instruction type;
when the type of the target control instruction is of the preset instruction type, determining that the target control instruction is legal; and
when the type of the target control instruction is not of the preset instruction type, determining that the target control instruction is illegal.
5 . The method according to claim 3 , wherein determining whether the target control instruction is legal comprises:
determining whether a length of the target control instruction complies with a preset length rule;
when the length of the target control instruction complies with the preset length rule, determining that the target control instruction is legal; and
when the length of the target control instruction does not comply with the preset length rule, determining that the target control instruction is illegal.
6 . A device for processing a control instruction, comprising:
a memory storing a computer program; and
a processor, when executing the computer program, performing operations comprising:
receiving a target control instruction according to a control instruction receiving thread, wherein the target control instruction comprises a control instruction sent by a second control system that controls the first control system, and the first control system is an embedded system and the second control system is a system running on a server central processing unit;
determining whether the target control instruction is legal, and when the target control instruction is legal, storing the target control instruction in a preset queue, and sending a message indicating that the target control instruction is received to the second control system, so that the second control system stops sending the target control instruction; and
processing the target control instruction in the preset queue according to a control instruction processing thread;
wherein after the operation of processing the target control instruction in the preset queue according to a control instruction processing thread, the processor performing operations further comprises:
determining whether a processing query instruction sent by the second control system for querying a target processing result of the target control instruction is received; and
when the processing query instruction is received, sending the target processing result to the second control system; and
wherein the operation of sending the target processing result to the second control system comprises:
calculating a time interval between receiving the target control instruction and receiving the processing query instruction;
determining whether the time interval is less than a preset instruction processing duration;
when the time interval is greater than or equal to the preset instruction processing duration, acquiring the target processing result, and sending the target processing result to the second control system; and
when the time interval is less than the preset instruction processing duration, acquiring the target processing result after waiting for a preset compensation duration, and sending the target processing result to the second control system.
7 . A non-transitory computer-readable storage medium, storing a computer program which, when executed by a processor, performs operations comprising:
receiving a target control instruction according to a control instruction receiving thread, wherein the target control instruction comprises a control instruction sent by a second control system that controls the first control system, and the first control system is an embedded system and the second control system is a system running on a server central processing unit;
determining whether the target control instruction is legal, and when the target control instruction is legal, storing the target control instruction in a preset queue, and sending a message indicating that the target control instruction is received to the second control system, so that the second control system stops sending the target control instruction; and
processing the target control instruction in the preset queue according to a control instruction processing thread;
wherein after the operation of processing the target control instruction in the preset queue according to a control instruction processing thread, the operations further comprise:
determining whether a processing query instruction sent by the second control system for querying a target processing result of the target control instruction is received; and
when the processing query instruction is received, sending the target processing result to the second control system; and
wherein the operation of sending the target processing result to the second control system comprises:
calculating a time interval between receiving the target control instruction and receiving the processing query instruction;
determining whether the time interval is less than a preset instruction processing duration;
when the time interval is greater than or equal to the preset instruction processing duration, acquiring the target processing result, and sending the target processing result to the second control system; and
when the time interval is less than the preset instruction processing duration, acquiring the target processing result after waiting for a preset compensation duration, and sending the target processing result to the second control system.
8 . The device for processing a control instruction according to claim 6 , wherein before the operation of calculating a time interval between receiving the target control instruction and receiving the processing query instruction, the processor performing operations further comprises:
negotiating the preset instruction processing duration with the second control system.
9 . The device for processing a control instruction according to claim 6 , wherein the processor performing operations further comprises:
receiving a state query instruction according to the control instruction receiving thread, wherein the state query instruction comprises a query instruction sent by the second control system;
acquiring a target query result corresponding to the state query instruction according to the control instruction processing thread; and
transmitting the target query result to the second control system according to the control instruction receiving thread.
10 . The device for processing a control instruction according to claim 9 , wherein the operation of determining whether the target control instruction is legal comprises:
determining whether a type of the target control instruction is of a preset instruction type;
when the type of the target control instruction is of the preset instruction type, determining that the target control instruction is legal; and
when the type of the target control instruction is not of the preset instruction type, determining that the target control instruction is illegal.
11 . The device for processing a control instruction according to claim 9 , wherein the operation of determining whether the target control instruction is legal comprises:
determining whether a length of the target control instruction complies with a preset length rule;
when the length of the target control instruction complies with the preset length rule, determining that the target control instruction is legal; and
when the length of the target control instruction does not comply with the preset length rule, determining that the target control instruction is illegal.
12 . The non-transitory computer-readable storage medium according to claim 7 , wherein before the operation of calculating a time interval between receiving the target control instruction and receiving the processing query instruction, the operations further comprise:
negotiating the preset instruction processing duration with the second control system.
13 . The non-transitory computer-readable storage medium according to claim 7 , wherein the operations further comprise:
receiving a state query instruction according to the control instruction receiving thread, wherein the state query instruction comprises a query instruction sent by the second control system;
acquiring a target query result corresponding to the state query instruction according to the control instruction processing thread; and
transmitting the target query result to the second control system according to the control instruction receiving thread.
14 . The non-transitory computer-readable storage medium according to claim 13 , wherein the operation of determining whether the target control instruction is legal comprises:
determining whether a type of the target control instruction is of a preset instruction type;
when the type of the target control instruction is of the preset instruction type, determining that the target control instruction is legal; and
when the type of the target control instruction is not of the preset instruction type, determining that the target control instruction is illegal.