Equipment control method and device, electronic equipment and computer readable storage medium
By using target action identification information in the equipment control system instead of specific action control instructions, the problem of missing and untimely issuance of motion control instructions is solved, and higher motion reliability and real-timeness are achieved.
Patent Information
- Application Number
- CN202411824049.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-12-11
AI Technical Summary
When the movement mechanism of the equipment increases or the number of axes increases, the geometric multiple of the number of motion control instructions that need to be set increases, resulting in the loss or in timely issuance of motion control instructions, affecting the reliability and real-timeness of the motion.
By determining the target motion information in the upper computer, the target motion identification information is generated, which corresponds to a set of action control instructions, and the target motion identification information is sent to the lower computer to replace the specific action control instructions, simplifying and reducing the amount of data sent.
It simplifies the issuance of motion control instructions, reduces the amount of data, alleviates the problems of missing and untimely issuance of motion control instructions, and improves the reliability and real-timeness of motion.
Smart Images

Figure CN119739070A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of device control technology, and specifically to a device control method, apparatus, electronic device, and computer-readable storage medium. Background Art
[0002] At present, the control of the motion mechanism of the equipment requires the setting of multiple motion control commands. For example, for a single axis of a single motion mechanism, the 8-point acceleration and deceleration curve control of the stepper motor driver TMC5272 is needed to achieve movement to 10 degrees. It is necessary to set A1, A2, AM, DM, D2, D1, Vstart, V1, V2, VM, Vstop one by one, and finally set the absolute position to 10 degrees. A total of 12 motion control commands are required to complete one movement.
[0003] When the number of motion mechanisms or axes of a device (such as a robot) increases, the motion control instructions that need to be set increase exponentially. This often leads to problems such as loss of motion control instructions or delay in sending them in a timely manner, resulting in poor motion reliability and real-time performance. Summary of the invention
[0004] The embodiments of the present application provide a device control method, apparatus, electronic device and computer-readable storage medium, which can simplify the motion control instructions issued, reduce the amount of data issued, and alleviate the problem of loss and untimely issuance of motion control instructions.
[0005] In a first aspect, an embodiment of the present application provides a device control method, which is applied to a host computer, and the method includes:
[0006] In response to a control operation on a target motion mechanism in a lower computer, determining target motion information of the target motion mechanism;
[0007] Determine target action identification information according to the target motion information, wherein the target action identification information corresponds to a group of action control instructions;
[0008] The target action identification information is sent to the lower computer, so that the target motion mechanism in the lower computer moves based on the motion control instruction corresponding to the target action identification information.
[0009] In a second aspect, an embodiment of the present application further provides a device control apparatus, which is applied to a host computer, and the device includes:
[0010] A response module, for determining target motion information of the target motion mechanism in response to a control operation on the target motion mechanism in the lower computer;
[0011] A determination module, used to determine target action identification information according to the target motion information, wherein the target action identification information corresponds to a group of action control instructions;
[0012] The sending module is used to send the target action identification information to the lower computer, so that the target motion mechanism in the lower computer moves based on the motion control instruction corresponding to the target action identification information.
[0013] Optionally, in some embodiments of the present application, determining the target action identification information according to the target motion information includes:
[0014] Identify the motion scene identification information corresponding to the target motion information;
[0015] At least one preset action identification information corresponding to the motion scene identification information is used as target action identification information.
[0016] Optionally, in some embodiments of the present application, the target motion mechanism includes at least two, and sending the target action identification information to the lower computer so that the target motion mechanism in the lower computer moves based on the action control instruction corresponding to the target action identification information includes:
[0017] Determining, according to the control operation, coordinated control information between target motion information of each of the target motion mechanisms;
[0018] The collaborative control information and the target motion identification information of each target motion mechanism are sent to the lower computer, so that the lower computer performs collaborative motion control on each target motion mechanism based on the action control instructions corresponding to the collaborative control information and the target motion identification information of each target motion mechanism.
[0019] Optionally, in some embodiments of the present application, sending the collaborative control information and the target motion identification information of each target motion mechanism to the lower computer, so that the lower computer performs collaborative motion control on each target motion mechanism based on the collaborative control information and the motion control instructions corresponding to the target motion identification information of each target motion mechanism, includes:
[0020] Determining the sending and receiving time information of each of the target motion mechanisms, and generating synchronization control information for each of the target motion mechanisms based on the sending and receiving time information;
[0021] The collaborative control information, the synchronous control information and the target action identification information of each target motion mechanism are sent to the lower computer, so that the lower computer performs collaborative and synchronous motion control on each target motion mechanism based on the action control instructions corresponding to the collaborative control information, the synchronous control information and the target action identification information of each target motion mechanism.
[0022] Optionally, in some embodiments of the present application, the determining the target motion information of the target motion mechanism in response to the control operation on the target motion mechanism in the lower computer includes:
[0023] In response to a control operation on a target motion mechanism in the lower computer, determining a priority of the control operation;
[0024] If the priority is lower than a preset threshold, obtaining execution status information of the last control operation;
[0025] If the execution status information indicates that the execution of the previous control operation is completed, triggering the step of filtering out at least one target action identification information from the preset action identification information;
[0026] If the execution status information indicates that the last control operation has not been completed, the step of triggering the step of filtering out at least one target action identification information from the preset action identification information is paused.
[0027] Optionally, in some embodiments of the present application, after determining the priority of the control operation in response to the control operation on the target motion mechanism in the lower computer, the method further includes:
[0028] If the priority is higher than or equal to the preset threshold, the step of filtering out at least one target action identification information from the preset action identification information is directly triggered.
[0029] In a third aspect, an embodiment of the present application provides a device control method, which is applied to a lower computer, and the method includes:
[0030] Receiving target motion identification information sent by a host computer, wherein the target motion identification information is determined by the host computer in response to a control operation on a target motion mechanism and based on target motion information corresponding to the control operation;
[0031] Sending the target motion identification information to the target motion mechanism;
[0032] The target motion mechanism determines the motion control instruction corresponding to the target motion identification information, and controls the motion of the target motion mechanism based on the motion control instruction.
[0033] In a fourth aspect, an embodiment of the present application provides a device control apparatus, which is applied to a lower computer, and the device includes:
[0034] A receiving module, used for receiving target motion identification information sent by a host computer, wherein the target motion identification information is determined by the host computer in response to a control operation on a target motion mechanism and based on target motion information corresponding to the control operation;
[0035] A sending module, used for sending the target motion identification information to the target motion mechanism;
[0036] A control module is used to determine the motion control instruction corresponding to the target motion identification information through the target motion mechanism, and control the motion of the target motion mechanism based on the motion control instruction.
[0037] In the fifth aspect, an embodiment of the present application also provides an electronic device (including the aforementioned host computer or slave computer), the electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the steps in the aforementioned device control method are implemented.
[0038] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned device control method are implemented.
[0039] In a seventh aspect, the embodiments of the present application further provide a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various optional implementations described in the embodiments of the present application.
[0040] The upper computer of the embodiment of the present application responds to the control operation on the target motion mechanism in the lower computer, determines the target motion information of the target motion mechanism, determines the target action identification information according to the target motion information, and the target action identification information corresponds to a set of action control instructions. The target action identification information is sent to the lower computer so that the target motion mechanism in the lower computer moves based on the action control instructions corresponding to the target action identification information.
[0041] Among them, the embodiment of the present application realizes the use of target action identification information to replace the issuance of specific action control instructions with a large amount of data by issuing the target action identification information corresponding to the action control instruction, thereby simplifying the motion control instructions that need to be issued and reducing the amount of data issued. Among them, when the amount of data issued is small, it can alleviate the problem of loss and untimely issuance of motion control instructions. For example, the motion control instructions will not be issued in disorder or the motion control instructions cannot be issued to the corresponding motion mechanisms in time due to the large amount of data required to be issued. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 It is a schematic diagram of a scenario in which a host computer according to an embodiment of the present application executes the device control method;
[0044] Figure 2 It is a flowchart of a device control method provided in an embodiment of the present application;
[0045] Figure 3 is a flow chart of the device control method executed by the lower computer provided in the embodiment of the present application;
[0046] Figure 4 is a schematic diagram of the structure of the device control device provided in an embodiment of the present application;
[0047] Figure 5 is another structural schematic diagram of the device control device provided in an embodiment of the present application;
[0048] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0050] The embodiment of the present application provides a device control method, device, electronic device and computer-readable storage medium. Specifically, the embodiment of the present application provides a device control device suitable for an electronic device (such as a host computer), which is used to respond to the control operation of the target motion mechanism in the lower computer, determine the target action identification information corresponding to the control operation, and send the target action identification information to the lower computer to replace the specific, large data volume of the motion control instruction, reduce the amount of data required to be sent, and simplify the instructions sent. The electronic device includes a host computer, which includes but is not limited to a mobile phone, a tablet computer, a desktop computer, a server or an industrial computer (such as an industrial computer), etc. And, the embodiment of the present application also provides a device control device suitable for an electronic device (such as a lower computer), which is used to receive the target action identification information sent by the host computer, and convert the target action identification information to obtain a specific motion control instruction, thereby controlling the motion of the target motion mechanism. The electronic device includes a lower computer, which includes but is not limited to a robot, a programmable logic controller, etc., and can also specifically refer to a micro control unit (MCU) in these devices.
[0051] See also Figure 1 , Figure 1 : is a schematic diagram of a scenario in which a host computer performs the device control method provided in an embodiment of the present application, wherein the specific execution process of the host computer performing the device control method is as follows:
[0052] The upper computer 10 responds to the control operation on the target motion mechanism 12 in the lower computer 11, determines the target motion information of the target motion mechanism 12, determines the target action identification information according to the target motion information, and the target action identification information corresponds to a set of action control instructions. The target action identification information is sent to the lower computer 11 so that the target motion mechanism 12 in the lower computer 11 moves based on the action control instructions corresponding to the target action identification information.
[0053] It can be understood that in the embodiment of the present application, the target motion mechanism includes a microcontroller unit (MCU) and hardware (such as a motion axis) and an interface associated with the microcontroller unit, etc. That is, in the embodiment of the present application, the upper computer sends the target motion identification information to the microcontroller unit in the lower computer, and then the microcontroller unit parses the corresponding motion control instruction based on the target motion identification information, and then controls the related hardware or interface actions based on the motion control instruction, for example, controls the motion axis movement or controls the interface distribution instruction, etc.
[0054] In summary, the embodiments of the present application use the target action identification information to replace the specific action control instructions with a large amount of data by issuing the target action identification information corresponding to the action control instruction, thereby simplifying the motion control instructions that need to be issued and reducing the amount of data issued. Among them, when the amount of data issued is small, the problem of loss and untimely issuance of motion control instructions can be alleviated. For example, the motion control instructions will not be issued in disorder or the motion control instructions cannot be issued to the corresponding motion mechanisms in a timely manner due to the large amount of data required to be issued.
[0055] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.
[0056] See also Figure 2 , Figure 2 A flow chart of a device control method provided in an embodiment of the present application. Although a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different from that shown in the flow chart. Specifically, the device control method is applied to a host computer, and the process of the host computer executing the device control method specifically includes:
[0057] 101. In response to a control operation on a target motion mechanism in a lower computer, determine target motion information of the target motion mechanism.
[0058] The control operation is an operation performed by the upper computer on the lower computer, for example, the upper computer sends instructions to control the movement of the target motion mechanism in the lower computer. The target motion information refers to the operation information required to be executed by the target motion mechanism corresponding to the control operation. For example, the target motion information includes the 8-point acceleration and deceleration curve control of the driver TMC5272 to achieve movement to 10 degrees, and then to 20 degrees, etc.
[0059] In the embodiment of the present application, the target motion information corresponding to the control operation can be obtained based on the mapping relationship between the control operation and the motion information. For example, the control operation is identified and the target motion information corresponding to the control operation is determined from the mapping relationship.
[0060] Among them, the host computer and the slave computer play different roles in the control system. They work together to achieve the control and management of complex systems. The host computer is responsible for high-level control and management tasks, such as data processing, algorithm calculation, user interface, system monitoring and decision making. Typical host computer devices include personal computers (PCs), single-board computers (SBCs), industrial computers (IPCs), servers, etc. The slave computer is responsible for performing specific control tasks, such as sensor data acquisition, motor control, actuator drive, etc. Typical slave computers include robots, microcontroller units (MCUs), programmable logic controllers (PLCs), embedded systems, field programmable gate arrays (FPGAs), etc.
[0061] The target motion mechanism is a motion mechanism in the lower computer, for example, the target motion mechanism includes a microcontroller unit (MCU) and related hardware and interfaces.
[0062] 102. Determine target action identification information according to the target motion information, where the target action identification information corresponds to a group of action control instructions.
[0063] Among them, in the traditional scheme, a group of action control instructions is determined based on the target motion information, and then the group of action control instructions is directly issued to the target motion mechanism in the lower computer. However, since a motion mechanism requires more action control instructions, the upper computer issues more motion control instructions, which easily leads to the problem of disordered and untimely instruction issuance. Therefore, in the embodiment of the present application, the target action identification information of the corresponding action control instruction is used to replace the issuance of specific action control instructions, simplifying the content of the issued instructions, reducing the amount of data issued, and alleviating the problem of disordered and untimely instruction issuance.
[0064] That is, in an embodiment of the present application, the action identification information is determined based on the action control instructions corresponding to the target motion information, wherein, in an embodiment of the present application, a set of action control instructions corresponding to each action identification information can be pre-configured, and the action control instructions are matched based on the actual requirements of the target motion information, and then the corresponding target action identification information is determined.
[0065] 103. Send the target action identification information to the lower computer, so that the target motion mechanism in the lower computer moves based on the motion control instruction corresponding to the target action identification information.
[0066] Specifically, after receiving the target action identification information, the lower computer sends the target action identification information to the corresponding target motion mechanism, and the target motion mechanism parses the specific action control instruction based on the target action identification, and then controls the movement of the hardware (such as the motion axis) based on the specific action control instruction.
[0067] In summary, the embodiments of the present application use the target action identification information to replace the specific action control instructions with a large amount of data by issuing the target action identification information corresponding to the action control instruction, thereby simplifying the motion control instructions that need to be issued and reducing the amount of data issued. Among them, when the amount of data issued is small, the problem of loss and untimely issuance of motion control instructions can be alleviated. For example, the motion control instructions will not be issued in disorder or the motion control instructions cannot be issued to the corresponding motion mechanisms in a timely manner due to the large amount of data required to be issued.
[0068] Optionally, in an embodiment of the present application, target action identification information for each control operation may be pre-configured so that after a control operation is detected, the target action identification information may be quickly matched based on the control operation. That is, optionally, in some embodiments of the present application, the step of “determining the target action identification information according to the target motion information” includes:
[0069] Identify the motion scene identification information corresponding to the target motion information;
[0070] At least one preset action identification information corresponding to the motion scene identification information is used as target action identification information.
[0071] The motion scene identification information is identification information for different motion scenes, that is, different control operations, for example, the motion scene identification information includes identification information such as 101, 202, and 303. Different motion scene identification information corresponds to different action identification information, and the motion identification information corresponding to each motion scene identification information can be pre-configured, for example, different motion scene identifications are configured based on different control operations, and the action identification information is configured using the content of the control operation, and each action identification information also corresponds to the motion information of the motion mechanism.
[0072] For example, the lower computer includes two motion mechanisms, namely motion mechanism MCU1 and motion mechanism MCU2, and MCU1 has two axes, namely axis 1 and axis 2, and MCU2 has three axes, namely axis 3, axis 4 and axis 5. For example, 16 points (i.e., action identification information) are provided for each axis, that is, points 0x01-0x10 belong to the 16 actions of axis 1, 0x11-0x20 belong to the 16 actions of axis 2, 0x21-0x30 belong to the 16 actions of axis 3, 0x31-0x40 belong to the 16 actions of axis 4, and 0x41-0x50 belong to the 16 actions of axis 5.
[0073] Furthermore, configure each point of each axis. For example, the action information of point 1 (0x01) of axis 1 is "Move to 10 degrees through the 8-point acceleration and deceleration curve control of the driver TMC5272, where A1, A2 and AM are all 900, DM, D2, D1 are all 1800, Vstart is 5, V1 is 30, V2 is 60, V3 is 90, Vstop is 6, and wait for 3000ms at this point after execution". Then the corresponding set of action control instructions is: [1, 10, 3000, 5, 900, 30, 900, 60, 900, 90, 1800, 1800, 1800, 6]. Similarly, the points corresponding to the action information of each axis can be pre-configured.
[0074] The above action control commands are specifically:
[0075] Vstart: motor starting speed; V1: first acceleration / deceleration stage threshold speed; V2: second acceleration / deceleration stage threshold speed; V3: motion ramp target speed; Vstop: motor stopping speed; A1: acceleration between Vstart and V1; A2: acceleration between V1 and V2; AM: acceleration between V2 and V3; DM: deceleration between V3 and V2; D2: deceleration between V2 and V1; D1: deceleration between V1 and Vstop.
[0076] Furthermore, a correspondence or binding relationship between motion scene identification information and each action identification information can be established based on motion information (which may include multiple action information of multiple axes). For example, if the motion scene identification information corresponding to the motion information is 101, and the motion information includes multiple action information, and the points corresponding to each action information, that is, the action identification information is [0x01, 0x11, 0, 0x02, 0x12, 0, 0x01, 0x11, 0, 0x02, 0x12, 0, 0x01, 0x11, 0, 0x02, 0x12, 0], then a binding relationship between motion scene identification information 101 and multiple action identification information [0x01, 0x11, 0, 0x02, 0x12, 0, 0x01, 0x11, 0, 0x02, 0x12, 0, 0x01, 0x11, 0, 0x02, 0x12, 0] can be established.
[0077] That is, when the motion scene identification information corresponding to the target motion information is identified as 101, then based on the binding relationship, its action identification information [0x01, 0x11, 0, 0x02, 0x12, 0, 0x01, 0x11, 0, 0x02, 0x12, 0, 0x01, 0x11, 0, 0x02, 0x12, 0] can be obtained, which is the target action identification information. From the above, it can be seen that the target action identification information corresponds to multiple action information of multiple axes. Based on the point name, it can be seen that the target action identification information contains the motion information of "axis 1 point 1 / axis 2 point 1, axis 1 point 2 / axis 2 point 2, cycle 3 times".
[0078] In some scenarios, the motion information (ie, action combination) corresponding to the motion scene identifier 101 is also referred to as an action matrix for MCU1, that is, it describes an action matrix completed by MCU1 through the combination of various points on each axis, which can be understood as an action set for MCU1. It can be understood that the control operation for the lower computer usually involves multiple target motion mechanisms. Therefore, based on the control operation, the target motion information for the multiple target motion mechanisms can be determined, and then the motion scene identification information for the multiple target motion information can be identified. For example, in an embodiment of the present application, the motion scene identification information 101 and the motion scene identification information 202 can be determined based on the control operation, and accordingly, two sets of target action identification information are obtained, namely [0x01, 0x11, 0, 0x02, 0x12, 0, 0x01, 0x11, 0, 0x02, 0x12, 0, 0x01, 0x11, 0, 0x02, 0x12, 0] for the motion scene identification information 101 and [0x21, 0x31, 0x41, 0x23, 0x33, 0x43, 0x25, 0x35, 0] for the motion scene identification information 202.
[0079] It can be understood that in the embodiment of the present application, the upper computer sends [0x01, 0x11, 0, 0x02, 0x12, 0, 0x01, 0x11, 0, 0x02, 0x12, 0, 0x01, 0x11, 0, 0x02, 0x12, 0] and [0x21, 0x31, 0x41, 0x23, 0x33, 0x43, 0x25, 0x35, 0] to the lower computer, and the lower computer sends [0x01, 0x11, 0, 0x02, 0x12, 0, 0x01, 0x11, 0, 0x02, 0x12, 0] to the lower computer. For the target motion mechanism, [0x01, 0x11, 0, 0x02, 0x12, 0, 0x01, 0x11, 0, 0x02, 0x12, 0, 0x01, 0x11, 0, 0x02, 0x12, 0] is sent to the motion mechanism MCU1 and [0x21, 0x31, 0x41, 0x23, 0x33, 0x43, 0x25, 0x35, 0] is sent to the motion mechanism MCU2. It can be understood that in the embodiment of the present application, although the content issued contains multiple action identification information, compared with directly issuing the action control instructions corresponding to each action identification information, the embodiment of the present application has achieved a multiple reduction in the amount of data, simplified the content of execution and issuance, reduced the amount of data, and alleviated the problem of loss and untimely issuance of motion control instructions.
[0080] Correspondingly, the lower computer or the motion mechanism in the lower computer can parse and obtain the motion control instructions contained in each motion identification information based on the stored pre-configured point information, and then perform motion control.
[0081] It is understandable that in the embodiment of the present application, in order to further reduce the amount of data sent, the target action identification information sent can also be directly the motion scene identification information, that is, the corresponding relationship between the motion scene identification information and the action identification information is stored in the lower computer or the motion mechanism of the lower computer, and the corresponding relationship between the action identification information and the action control instruction is also stored, and then, after the motion mechanism receives the motion scene identification information, the action identification information can be parsed based on the aforementioned stored corresponding relationship, and further parsed to obtain the specific action control instruction. That is, the motion scene identification information is sent instead of the target action identification information, and then the motion mechanism parses out the point, and the action control instruction is parsed based on the point.
[0082] Optionally, when multiple target motion mechanisms are involved, the effective and reasonable motion of each target motion mechanism can be ensured by collaboratively controlling the motion of each target motion mechanism, that is, optionally, in some embodiments of the present application, the target motion mechanism includes at least two steps, "sending the target action identification information to the lower computer so that the target motion mechanism in the lower computer moves based on the action control instruction corresponding to the target action identification information", including:
[0083] Determining, according to the control operation, coordinated control information between target motion information of each of the target motion mechanisms;
[0084] The collaborative control information and the target motion identification information of each target motion mechanism are sent to the lower computer, so that the lower computer performs collaborative motion control on each target motion mechanism based on the action control instructions corresponding to the collaborative control information and the target motion identification information of each target motion mechanism.
[0085] Among them, the collaborative control information is the information for collaboratively controlling the movements of multiple target motion mechanisms. For example, based on the control operation, it is determined that the motion mechanism MCU1 needs to move first, and the motion mechanism MCU2 needs to move after an interval of 1000ms. Then, the collaborative control information is sent to the lower computer, so that the lower computer can use the collaborative control information to collaboratively control each target motion mechanism.
[0086] Optionally, when multiple target motion mechanisms are involved, in order to accurately coordinate and control each target motion mechanism, it is also necessary to perform synchronous control on the multiple target motion mechanisms, that is, optionally, in some embodiments of the present application, the step of "sending the coordinated control information and the target action identification information of each target motion mechanism to the lower computer, so that the lower computer performs coordinated motion control on each target motion mechanism based on the coordinated control information and the action control instructions corresponding to the target action identification information of each target motion mechanism" includes:
[0087] Determining the sending and receiving time information of each of the target motion mechanisms, and generating synchronization control information for each of the target motion mechanisms based on the sending and receiving time information;
[0088] The collaborative control information, the synchronous control information and the target action identification information of each target motion mechanism are sent to the lower computer, so that the lower computer performs collaborative and synchronous motion control on each target motion mechanism based on the action control instructions corresponding to the collaborative control information, the synchronous control information and the target action identification information of each target motion mechanism.
[0089] Among them, the sending and receiving time information refers to the time difference information from issuing instructions to receiving the return for each target motion mechanism, and the synchronous control information is the information for controlling the synchronous control movement of multiple target motion mechanisms. For the sending and receiving time information of each target motion mechanism, the synchronous control information can be generated accordingly. For example, if the target motion mechanism includes MCU1 and MCU2, and the sending and receiving time information of MCU1 and MCU2 are 20ms and 50ms respectively, in order to synchronously control MCU1 and MCU2, the control instruction for MCU1 can be issued 30ms (corresponding to the sending time difference information) after the control instruction for MCU2 is issued, so that MCU1 and MCU2 can receive their corresponding control instructions at the same time, and then move synchronously. Correspondingly, the sending time difference information of each target motion mechanism is the synchronous control information.
[0090] Optionally, in order to ensure the effective movement of each target motion mechanism, conflict detection may be set to ensure that the movement of the current control operation is performed after the movement corresponding to the previous control operation is completed. That is, optionally, in some embodiments of the present application, the step of "determining the target motion information of the target motion mechanism in response to the control operation on the target motion mechanism in the lower computer" includes:
[0091] In response to a control operation on a target motion mechanism in the lower computer, determining a priority of the control operation;
[0092] If the priority is lower than a preset threshold, obtaining execution status information of the last control operation;
[0093] If the execution status information indicates that the execution of the previous control operation is completed, triggering the step of filtering out at least one target action identification information from the preset action identification information;
[0094] If the execution status information indicates that the last control operation has not been completed, the step of triggering the step of filtering out at least one target action identification information from the preset action identification information is paused.
[0095] Among them, priority refers to the priority of the control operation, that is, it serves as the basis for whether the movement of the previous control operation can be interrupted. When the priority is lower than the preset threshold, it is considered to be low priority, and it is necessary to wait for the action of the previous control operation to be completed before issuing the target action identification information corresponding to the current control operation.
[0096] Correspondingly, when the priority is higher, the action of the previous control operation can be directly interrupted to achieve a rapid response of motion control, that is, optionally, in some embodiments of the present application, after the step of "determining the priority of the control operation in response to the control operation of the target motion mechanism in the lower computer", the method further includes:
[0097] If the priority is higher than or equal to the preset threshold, the step of filtering out at least one target action identification information from the preset action identification information is directly triggered.
[0098] For example, for an action that the user currently urgently needs the target motion mechanism to quickly perform, the execution of the action of the previous control operation may be stopped and the action corresponding to the current control operation may be performed.
[0099] In the embodiment of the present application, the priority can be divided based on the type of control operation, which includes a normal operation, a homing operation, or a shutdown operation, etc. The method of determining the priority of the control operation is not limited here.
[0100] In summary, the embodiments of the present application use the target action identification information to replace the specific action control instructions with a large amount of data by issuing the target action identification information corresponding to the action control instruction, thereby simplifying the motion control instructions that need to be issued and reducing the amount of data issued. Among them, when the amount of data issued is small, the problem of loss and untimely issuance of motion control instructions can be alleviated. For example, the motion control instructions will not be issued in disorder or the motion control instructions cannot be issued to the corresponding motion mechanisms in a timely manner due to the large amount of data required to be issued.
[0101] Among them, the coordinated control of multiple target motion mechanisms is achieved by issuing coordinated control information, and the synchronous control of multiple target motion mechanisms is achieved by issuing synchronous control information. Through priority-based analysis and control based on whether the instruction of the current control operation is directly triggered, effective and orderly responses of multiple control operations are ensured to avoid control conflicts caused by control operations.
[0102] Based on this, the target motion mechanism in the lower computer needs to receive the target action identification information sent by the upper computer, and parse the specific action control instructions based on the target action identification information, and then control the execution of the corresponding action, that is, refer to Figure 3 As shown, Figure 3 : is a flow chart of the lower computer executing the device control method provided in the embodiment of the present application. Specifically, the process of the lower computer executing the device control method specifically includes:
[0103] 111. Receive target motion identification information sent by a host computer, where the target motion identification information is determined by the host computer in response to a control operation on a target motion mechanism and based on target motion information corresponding to the control operation;
[0104] 112. Send the target motion identification information to the target motion mechanism;
[0105] 113. Determine, through the target motion mechanism, a motion control instruction corresponding to the target motion identification information, and control the motion of the target motion mechanism based on the motion control instruction.
[0106] For example, in an embodiment of the present application, the motion mechanism of the lower computer also stores the point configuration information recorded above. Then, after the target motion mechanism receives the target action identification information, the action control instruction corresponding to the target action identification information can be determined based on the point configuration information.
[0107] In order to better implement the device control method of the present application, the present application also provides a device control apparatus based on the device control method, wherein the meanings of the terms are the same as those in the device control method, and the specific implementation details can refer to the description in the method embodiment.
[0108] See also Figure 4 , Figure 4 : is a schematic diagram of the structure of the device control device provided in the embodiment of the present application. The device control device is applied to a host computer, and can be specifically as follows:
[0109] A response module 201, for determining target motion information of the target motion mechanism in response to a control operation on the target motion mechanism in the lower computer;
[0110] A determination module 202, configured to determine target action identification information according to the target motion information, wherein the target action identification information corresponds to a set of action control instructions;
[0111] The sending module 203 is used to send the target action identification information to the lower computer, so that the target motion mechanism in the lower computer moves based on the motion control instruction corresponding to the target action identification information.
[0112] Optionally, in some embodiments of the present application, determining the target action identification information according to the target motion information includes:
[0113] Identify the motion scene identification information corresponding to the target motion information;
[0114] At least one preset action identification information corresponding to the motion scene identification information is used as target action identification information.
[0115] Optionally, in some embodiments of the present application, the target motion mechanism includes at least two, and sending the target action identification information to the lower computer so that the target motion mechanism in the lower computer moves based on the action control instruction corresponding to the target action identification information includes:
[0116] Determining, according to the control operation, coordinated control information between target motion information of each of the target motion mechanisms;
[0117] The collaborative control information and the target motion identification information of each target motion mechanism are sent to the lower computer, so that the lower computer performs collaborative motion control on each target motion mechanism based on the action control instructions corresponding to the collaborative control information and the target motion identification information of each target motion mechanism.
[0118] Optionally, in some embodiments of the present application, sending the collaborative control information and the target motion identification information of each target motion mechanism to the lower computer, so that the lower computer performs collaborative motion control on each target motion mechanism based on the collaborative control information and the motion control instructions corresponding to the target motion identification information of each target motion mechanism, includes:
[0119] Determining the sending and receiving time information of each of the target motion mechanisms, and generating synchronization control information for each of the target motion mechanisms based on the sending and receiving time information;
[0120] The collaborative control information, the synchronous control information and the target action identification information of each target motion mechanism are sent to the lower computer, so that the lower computer performs collaborative and synchronous motion control on each target motion mechanism based on the action control instructions corresponding to the collaborative control information, the synchronous control information and the target action identification information of each target motion mechanism.
[0121] Optionally, in some embodiments of the present application, the determining the target motion information of the target motion mechanism in response to the control operation on the target motion mechanism in the lower computer includes:
[0122] In response to a control operation on a target motion mechanism in the lower computer, determining a priority of the control operation;
[0123] If the priority is lower than a preset threshold, obtaining execution status information of the last control operation;
[0124] If the execution status information indicates that the execution of the previous control operation is completed, triggering the step of filtering out at least one target action identification information from the preset action identification information;
[0125] If the execution status information indicates that the last control operation has not been completed, the step of triggering the step of filtering out at least one target action identification information from the preset action identification information is paused.
[0126] Optionally, in some embodiments of the present application, after determining the priority of the control operation in response to the control operation on the target motion mechanism in the lower computer, the method further includes:
[0127] If the priority is higher than or equal to the preset threshold, the step of filtering out at least one target action identification information from the preset action identification information is directly triggered.
[0128] In the embodiment of the present application, the response module 201 determines the target motion information of the target motion mechanism in response to the control operation on the target motion mechanism in the lower computer, and the determination module 202 determines the target action identification information based on the target motion information, and the target action identification information corresponds to a set of action control instructions. The sending module 203 sends the target action identification information to the lower computer, so that the target motion mechanism in the lower computer moves based on the action control instructions corresponding to the target action identification information.
[0129] Among them, the embodiment of the present application realizes the use of target action identification information to replace the issuance of specific action control instructions with a large amount of data by issuing the target action identification information corresponding to the action control instruction, thereby simplifying the motion control instructions that need to be issued and reducing the amount of data issued. Among them, when the amount of data issued is small, it can alleviate the problem of loss and untimely issuance of motion control instructions. For example, the motion control instructions will not be issued in disorder or the motion control instructions cannot be issued to the corresponding motion mechanisms in time due to the large amount of data required to be issued.
[0130] See also Figure 5 , Figure 5 : is another structural schematic diagram of the device control device provided in the embodiment of the present application, and the device control device is applied to the lower computer, and the specific structure can be as follows:
[0131] The receiving module 211 is used to receive target motion identification information sent by the host computer, wherein the target motion identification information is determined by the host computer in response to a control operation on a target motion mechanism and based on target motion information corresponding to the control operation;
[0132] A sending module 212, used for sending the target motion identification information to the target motion mechanism;
[0133] The control module 213 is used to determine the motion control instruction corresponding to the target motion identification information through the target motion mechanism, and control the motion of the target motion mechanism based on the motion control instruction.
[0134] In summary, in the embodiment of the present application, the upper computer only needs to send target action identification information with a smaller amount of data, and does not need to send action control instructions with a larger amount of data, which reduces the number of instructions that the lower computer needs to receive and helps ensure the accurate reception and execution of instructions.
[0135] In addition, the present application also provides an electronic device, such as Figure 6 As shown, it shows a schematic diagram of the structure of the electronic device involved in this application, specifically:
[0136] The electronic device may include components such as a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, a power supply 303, and an input unit 304. Those skilled in the art will appreciate that Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0137] The processor 301 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 301.
[0138] The memory 302 can be used to store software programs and modules. The processor 301 executes various functional applications and data processing by running the software programs and modules stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 302 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.
[0139] The electronic device also includes a power supply 303 for supplying power to various components. Preferably, the power supply 303 can be logically connected to the processor 301 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 303 can also include any components such as one or more DC or AC power supplies, recharging systems, power supply device debugging circuits, power converters or inverters, and power status indicators.
[0140] The electronic device may further include an input unit 304, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0141] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 301 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 302 according to the following instructions, and the processor 301 will run the application programs stored in the memory 302, thereby implementing the steps in any device control method provided in the embodiments of the present application.
[0142] The upper computer of the embodiment of the present application responds to the control operation on the target motion mechanism in the lower computer, determines the target motion information of the target motion mechanism, determines the target action identification information according to the target motion information, and the target action identification information corresponds to a set of action control instructions. The target action identification information is sent to the lower computer so that the target motion mechanism in the lower computer moves based on the action control instructions corresponding to the target action identification information.
[0143] Among them, the embodiment of the present application realizes the use of target action identification information to replace the issuance of specific action control instructions with a large amount of data by issuing the target action identification information corresponding to the action control instruction, thereby simplifying the motion control instructions that need to be issued and reducing the amount of data issued. Among them, when the amount of data issued is small, it can alleviate the problem of loss and untimely issuance of motion control instructions. For example, the motion control instructions will not be issued in disorder or the motion control instructions cannot be issued to the corresponding motion mechanisms in time due to the large amount of data required to be issued.
[0144] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0145] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0146] To this end, the present application provides a computer-readable storage medium, on which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any device control method provided in the present application.
[0147] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0148] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0149] Since the instructions stored in the computer-readable storage medium can execute the steps in any device control method provided in the present application, the beneficial effects that can be achieved by any device control method provided in the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0150] The above is a detailed introduction to a device control method, apparatus, electronic device and computer-readable storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A device control method, characterized in that: Applied to a host computer, the method includes: In response to a control operation on a target motion mechanism in a lower computer, determining target motion information of the target motion mechanism; Determine target action identification information according to the target motion information, wherein the target action identification information corresponds to a group of action control instructions; The target action identification information is sent to the lower computer, so that the target motion mechanism in the lower computer moves based on the motion control instruction corresponding to the target action identification information.
2. The device control method according to claim 1, characterized in that: The determining the target action identification information according to the target motion information includes: Identify the motion scene identification information corresponding to the target motion information; At least one preset action identification information corresponding to the motion scene identification information is used as target action identification information.
3. The device control method according to claim 1, characterized in that: The target motion mechanism includes at least two, and sending the target action identification information to the lower computer so that the target motion mechanism in the lower computer moves based on the action control instruction corresponding to the target action identification information includes: Determining, according to the control operation, coordinated control information between target motion information of each of the target motion mechanisms; The collaborative control information and the target motion identification information of each target motion mechanism are sent to the lower computer, so that the lower computer performs collaborative motion control on each target motion mechanism based on the action control instructions corresponding to the collaborative control information and the target motion identification information of each target motion mechanism.
4. The device control method according to claim 3, characterized in that: The step of sending the collaborative control information and the target motion identification information of each target motion mechanism to the lower computer, so that the lower computer performs collaborative motion control on each target motion mechanism based on the collaborative control information and the motion control instructions corresponding to the target motion identification information of each target motion mechanism, comprises: Determining the sending and receiving time information of each of the target motion mechanisms, and generating synchronization control information for each of the target motion mechanisms based on the sending and receiving time information; The collaborative control information, the synchronous control information and the target action identification information of each target motion mechanism are sent to the lower computer, so that the lower computer performs collaborative and synchronous motion control on each target motion mechanism based on the action control instructions corresponding to the collaborative control information, the synchronous control information and the target action identification information of each target motion mechanism.
5. The device control method according to claim 1, characterized in that: The step of determining target motion information of the target motion mechanism in response to a control operation on the target motion mechanism in the lower computer includes: In response to a control operation on a target motion mechanism in the lower computer, determining a priority of the control operation; If the priority is lower than a preset threshold, obtaining execution status information of the last control operation; If the execution status information indicates that the execution of the previous control operation is completed, triggering the step of filtering out at least one target action identification information from the preset action identification information; If the execution status information indicates that the last control operation has not been completed, the step of triggering the step of filtering out at least one target action identification information from the preset action identification information is paused.
6. The device control method according to claim 5, characterized in that: After determining the priority of the control operation in response to the control operation on the target motion mechanism in the lower computer, the method further includes: If the priority is higher than or equal to the preset threshold, the step of filtering out at least one target action identification information from the preset action identification information is directly triggered.
7. A device control method, characterized in that: Applied to a lower computer, the method includes: Receiving target motion identification information sent by a host computer, wherein the target motion identification information is determined by the host computer in response to a control operation on a target motion mechanism and based on target motion information corresponding to the control operation; Sending the target motion identification information to the target motion mechanism; The target motion mechanism determines the motion control instruction corresponding to the target motion identification information, and controls the motion of the target motion mechanism based on the motion control instruction.
8. A device control device, characterized in that: Applied to a host computer, the device comprises: A response module, for determining target motion information of the target motion mechanism in response to a control operation on the target motion mechanism in the lower computer; A determination module, used to determine target action identification information according to the target motion information, wherein the target action identification information corresponds to a group of action control instructions; The sending module is used to send the target action identification information to the lower computer, so that the target motion mechanism in the lower computer moves based on the motion control instruction corresponding to the target action identification information.
9. An electronic device, characterized in that: The device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the device control method according to any one of claims 1 to 6 are implemented, or the steps of the device control method according to claim 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the device control method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Nursing bed control system and method capable of realizing secondary development
CN109966081A
Mechanical arm control method and device, electronic equipment, and storage medium
CN112677150A
Operation instruction sending method and device, computer equipment and storage medium
CN117971515A
AUPQ055999A0