A method and system for collaborative control of mapping modules and multi-master communication
By introducing a mapping module collaborative control and multi-master communication method in industrial automation systems, the problem of insufficient scalability and flexibility of the traditional single-master communication mode in complex systems is solved, and more efficient instruction management and execution result feedback is achieved, improving the real-time and reliability of the system.
Patent Information
- Application Number
- CN202411975946.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-08
AI Technical Summary
The traditional single-main communication mode has problems of insufficient scalability and flexibility in complex industrial automation systems, resulting in data congestion, slow response speed, reduced real-time and reliability.
The mapping module collaboratively controls and multi-master communications are adopted, and the mapping module between the upper and lower computers performs instruction allocation and status monitoring, and the message queue management instruction execution is used to realize multi-master communication and cooperative control.
It improves the scalability and flexibility of the system, reduces bus traffic, ensures orderly issuance of instructions and timely feedback on execution results, and enhances the real-time and reliability of the system.
Smart Images

Figure CN119781937A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer communication, and in particular relates to a method and system for collaborative control of mapping modules and multi-master communication. Background Art
[0002] In the control systems of modern industrial control software and medical equipment, communication and collaboration between the host computer, the slave computer and multiple sub-modules are crucial. In the existing technology, the traditional single-master communication mode is usually used, relying on a centralized host computer to manage the status reports and command issuance of all slave computers. With the development of industrial automation, the complexity of the system continues to increase. The traditional mode has many limitations and lacks sufficient scalability and flexibility. Each slave computer must send status information to the host computer regularly, resulting in a linear increase in bus communication volume with the number of sub-modules, especially in high concurrency situations, which is easy to cause data congestion and seriously affect the response speed and efficiency of the system. With the addition of more sub-modules, the coordination and control of the system becomes more difficult, and it is difficult to efficiently handle the collaborative tasks between multiple modules, which reduces the real-time and reliability of the system. In addition, when abnormal situations such as module loss of step or collision occur, since the information needs to be transferred through the host computer, the error closed-loop processing process becomes complicated and time-consuming, affecting the stability and safety of the system. Summary of the invention
[0003] In order to solve the above problems in the prior art, the present invention provides a method for collaborative control of mapping modules and multi-master communication, the method comprising the following steps: Step S1, in the control system, the host computer starts and establishes a communication connection with the slave computer, the operation scheduling module of the host computer assigns the submodule node ID of the slave computer to the mapping module of the host computer, and the submodule node ID corresponds to the mapping module one by one; Step S2, the upper computer mapping module sends the initialization instruction to the lower computer submodule through the communication module, and the submodule executes the initialization instruction; Step S3, the upper computer distributes the operation information of the control system to the mapping module through the operation scheduling module, and the mapping module sends the operation instruction to the corresponding lower computer submodule, and the lower computer submodule receives the operation instruction and performs the corresponding operation; Step S4, during the operation of the system, when the lower computer submodule receives multiple instructions in the same time period, the submodule stores the instructions in the message queue and executes them in sequence. After each instruction is executed, the submodule returns the operation result to the mapping module to ensure the consistency of the state; Step S5, when a fault occurs in a lower computer submodule during system operation, the fault information is uploaded to the upper computer, and the upper computer identifies other lower computer submodules that cooperate with the faulty submodule and sends notifications to these modules.
[0004] On the basis of the above scheme, the upper computer establishes communication with the lower computer through the middle computer, the upper computer is connected to the middle computer through a first protocol, and the middle computer is connected to the lower computer through a second protocol.
[0005] On the basis of the above scheme, it also includes single-step debugging, in which the mapping module holds a unique instruction set of the corresponding sub-module, issues instructions to the corresponding lower-level computer sub-module, and drives the sub-module to perform specific operations.
[0006] Based on the above scheme, each mapping module holds a message queue. When the module generates multiple instructions, the instructions are stored in the message queue in order and sent to the corresponding lower-level computer sub-modules one by one. After the sub-module replies that it has received the instruction, it removes the currently issued instruction from the message queue.
[0007] On the basis of the above solution, the mapping modules communicate with other mapping modules through a host computer to achieve collaboration between the modules.
[0008] On the basis of the above scheme, in step S5, when the lower computer submodule fails, the error information is uploaded to the corresponding mapping module, the mapping module sends an error processing instruction to the submodule, and the submodule performs error processing.
[0009] The present invention also provides a system for collaborative control of mapping modules and multi-master communication, comprising: The upper computer is used to manage and schedule multiple lower computer sub-modules, including an operation scheduling module and multiple mapping modules, each mapping module corresponds to a lower computer sub-module node ID; The middle computer, as the middle layer between the upper computer and the lower computer, is responsible for forwarding instructions and status information; The lower computer, including multiple lower computer sub-modules, performs specific control tasks; The communication module is used to establish and maintain the communication connection between the upper computer and the intermediate computer, and between the intermediate computer and the lower computer, and supports multiple communication protocols.
[0010] On the basis of the above scheme, the system uses the above method to communicate.
[0011] On the basis of the above scheme, the upper computer distributes the overall operation instructions of the system to the mapping module through the operation scheduling module, and the mapping module sends the instructions to the lower computer sub-module through the intermediate computer.
[0012] On the basis of the above scheme, the lower computer submodule identifies the instruction corresponding to its own node ID and stores the instruction in the message queue.
[0013] Compared with the prior art, the present invention has the following beneficial effects: the host computer, as the control center, is responsible for global task allocation and status monitoring, while the mapping module manages and schedules the nodes of the lower computer to ensure the orderly issuance of instructions and timely feedback of execution results. At the same time, the mapping module exchanges internal information through the host computer to achieve global task scheduling and resource optimization, and when a sub-module fails, the host computer can control the action of the collaborative sub-module to ensure the efficient collaborative work of each sub-module, thereby increasing the reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 A schematic diagram of the method flow provided for this application; Figure 2 A schematic diagram of system information transmission provided for this application; DETAILED DESCRIPTION The invention is further described below in conjunction with specific embodiments.
[0015] The present invention provides a method for collaboratively controlling multi-master communication with a mapping module, such as Figure 1 As shown, first, ensure the communication connection between the upper, middle and lower computers of the control system and complete the initialization settings, including: S101, the upper computer and the middle computer establish a communication connection to ensure smooth instruction transmission and status feedback between the two, and the middle computer and the lower computer establish a communication connection to ensure correct instruction transmission and execution result feedback; S102, the host computer scheduling module assigns the node ID of the submodule of the lower computer to the corresponding host computer mapping module to ensure that each submodule of the lower computer is connected to the host computer; S103, the upper computer mapping module sends the initialization instruction to the lower computer sub-module through the communication module and the intermediate computer, and the sub-module executes the initialization instruction and performs corresponding initialization actions.
[0016] The initialization instruction ensures that in the initial stage of the control system, the initial states of the lower computer submodule and the upper computer mapping module are unified, and the communication status of each module is verified to prepare for subsequent collaboration.
[0017] After the initialization phase is completed, during the operation of the control system, the host computer distributes the overall system operation information to the mapping module through the operation scheduling module, and the mapping module sends the operation instructions to the corresponding lower computer submodule, including: S201, the upper computer mapping module generates an instruction set containing collaborative actions of multiple sub-modules according to the current state of the system and task requirements. The instruction set can be periodic or based on emergencies, and the instructions are sent to the corresponding lower computer sub-modules through the communication module and the intermediate computer; Furthermore, when a lower computer submodule receives multiple instructions, it stores these instructions in its own message queue. The submodule executes the instructions in the message queue in order and returns the execution result of each instruction to the upper computer mapping module through the intermediate computer. After execution, the instruction is removed from the message queue to ensure the execution order of the instructions. The use of message queues can effectively reduce the amount of communication on the bus.
[0018] S202, after the lower computer submodule executes the instruction, it returns the execution result to the upper computer mapping module through the intermediate computer to keep the status of the corresponding modules of the upper and lower computers consistent. At the same time, the upper computer regularly collects status information from each lower computer submodule to ensure the consistency of node status.
[0019] Furthermore, when a mapping module needs to exchange information with other mapping modules, it first sends the information to the host computer, which, after receiving the information, parses and forwards it to the target mapping module. For example, after submodule A completes the operation, mapping module A sends the message to the host computer, which then forwards the message to mapping module B.
[0020] If multiple mapping modules need to exchange information at the same time, the host computer can act as a central hub to manage the communication between multiple mapping modules. For example, three mapping modules A, B, and C can subscribe to the same topic, and the host computer will broadcast the relevant information to all subscribers.
[0021] According to an embodiment of the present invention, there are two lower computer submodules A and B in the control system, which are managed by mapping module A and mapping module B respectively, and the upper computer is responsible for coordinating the coordinated actions of the two submodules. The specific implementation is as follows: the upper computer sends a coordinated action instruction to mapping module A and mapping module B through the communication module: mapping module A instructs submodule A to perform a specific operation (such as moving to a certain position), and mapping module B instructs submodule B to remain still and wait for the operation of A to be completed before executing subsequent instructions; After receiving the instruction, mapping module A parses the instruction content and sends a start command to submodule A. Submodule A starts to execute the operation and feeds back the execution result (such as "reached the target position") to mapping module A after completing the operation; mapping module A sends the execution result of submodule A (such as "operation successful") to the host computer, and the host computer forwards the message from mapping module A to mapping module B. Mapping module B determines whether A's operation is successful based on the received message; if A's operation is successful, mapping module B will instruct submodule B to execute subsequent instructions (such as moving to a certain position). After submodule B completes the operation, it feeds back the execution result to mapping module B; mapping module B sends the execution result of submodule B (such as "operation successful") to the host computer. After receiving the message, the host computer updates its own status record to ensure the consistency of the status of the entire system.
[0022] Furthermore, whether the coordinated action between submodules A and B requires waiting can be controlled by instruction parameters to improve the overall operation and response speed.
[0023] During the operation of the system, when a fault occurs in a lower computer submodule, the fault information is uploaded to the upper computer, and the upper computer identifies other lower computer submodules that cooperate with the faulty submodule and sends notifications to these modules.
[0024] Specifically, when a running error occurs in a lower-level submodule, the error information is uploaded to the upper-level computer through the intermediate computer. The upper-level computer mapping module sends corresponding error handling instructions according to the fault type, such as restarting the device, switching to a backup device, or adjusting task allocation. At the same time, during the fault handling process, the upper-level computer identifies other lower-level submodules that cooperate with the faulty submodule, and notifies all related lower-level submodules through the mapping module to ensure that the task can continue to run stably. After the fault recovery is completed, the periodic upper-level computer instruction sending and lower-level computer instruction execution and reply are restarted to ensure the normal operation of the system.
[0025] In order to verify and adjust the functions of each submodule, the host computer provides a single-step debugging function. Users can issue a separate instruction to the corresponding lower-computer submodule through the mapping module to drive the module to perform specific operations. Specifically, users can issue a single-step instruction to the specified lower-computer submodule through the graphical interface or command line tool of the host computer, such as driving the motor to run to a specified position, controlling the valve to open and close the liquid pipeline, and pumping liquid, etc. After receiving the instruction, the submodule performs the corresponding operation and returns the operation result to the upper computer mapping module.
[0026] The present invention also provides a system for collaborative control of mapping modules and multi-master communication, wherein the system uses the above-mentioned method to achieve communication, such as Figure 2 As shown, the system includes a host computer, a middle computer, a lower computer and a communication module. The host computer, as the control center of the entire system, is responsible for managing the registration, status information, communication coordination and resource allocation of all sub-module nodes; the middle computer, as the middle layer between the host computer and the lower computer, is responsible for protocol conversion and instruction forwarding; the lower computer is responsible for executing the equipment of the specific control task, usually including multiple sub-modules, each sub-module corresponding to a mapping module of the host computer; the communication module is used to establish and maintain the communication connection between the host computer and the middle computer, and between the middle computer and the lower computer, and supports multiple communication protocols.
[0027] The upper computer includes an operation scheduling module and multiple mapping modules, each mapping module corresponds to a node ID of a lower computer submodule; the middle computer transmits the communication instruction to the submodule, the submodule identifies the instruction corresponding to its own node ID, and the submodule receives multiple instructions and stores them in the message queue; the lower computer submodule executes the instructions in the message queue one by one, and returns the execution result of each instruction to the upper computer mapping module through the middle computer, so as to always keep the status of the corresponding modules of the upper and lower computers consistent.
[0028] It should be noted that the communication between the intermediate computer and the upper computer uses communication protocols such as TCP and UDP, and the communication between the intermediate computer and the lower computer uses communication methods such as CAN, Ethernet and RS485.
[0029] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0030] Although the above describes the specific implementation methods of the present invention, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A method for collaborative control of mapping modules and multi-master communication, characterized in that: The method comprises the following steps: Step S1, in the control system, the host computer starts and establishes a communication connection with the slave computer, the operation scheduling module of the host computer assigns the submodule node ID of the slave computer to the mapping module of the host computer, and the submodule node ID corresponds to the mapping module one by one; Step S2, the upper computer mapping module sends the initialization instruction to the lower computer submodule through the communication module, and the submodule executes the initialization instruction; Step S3, the upper computer distributes the operation information of the control system to the mapping module through the operation scheduling module, and the mapping module sends the operation instruction to the corresponding lower computer submodule, and the lower computer submodule receives the operation instruction and performs the corresponding operation; Step S4, during the operation of the system, when the lower computer submodule receives multiple instructions in the same time period, the submodule stores the instructions in the message queue and executes them in sequence. After each instruction is executed, the submodule returns the operation result to the mapping module to ensure the consistency of the state; Step S5, when a fault occurs in a lower computer submodule during system operation, the fault information is uploaded to the upper computer, and the upper computer identifies other lower computer submodules that cooperate with the faulty submodule and sends notifications to these modules.
2. A method for collaborative control of mapping modules and multi-master communication according to claim 1, characterized in that: The upper computer establishes communication with the lower computer through the middle computer, the upper computer is connected to the middle computer through a first protocol, and the middle computer is connected to the lower computer through a second protocol.
3. A method for collaborative control of mapping modules and multi-master communication according to claim 1, characterized in that: It also includes single-step debugging, in which the mapping module holds a unique instruction set of the corresponding sub-module, issues instructions to the corresponding lower-level computer sub-module, and drives the sub-module to perform specific operations.
4. A method for collaborative control of mapping modules and multi-master communication according to claim 1, characterized in that: Each of the mapping modules holds a message queue. When the module generates multiple instructions, the instructions are stored in the message queue in order and sent one by one to the corresponding lower-level computer sub-modules. After the sub-module replies that it has received the instruction, it removes the currently sent instruction from the message queue.
5. A method for collaborative control of mapping modules and multi-master communication according to claim 1, characterized in that: The mapping modules communicate with other mapping modules through a host computer to achieve collaboration between the modules.
6. A method for collaborative control of mapping modules and multi-master communication according to claim 1, characterized in that: In step S5, when the lower computer submodule fails, the error information is uploaded to the corresponding mapping module, the mapping module sends an error processing instruction to the submodule, and the submodule performs error processing.
7. A system for collaborative control of mapping modules and multi-master communication according to claim 1, characterized in that: include: The upper computer is used to manage and schedule multiple lower computer sub-modules, including an operation scheduling module and multiple mapping modules, each mapping module corresponds to a lower computer sub-module node ID; The middle computer, as the middle layer between the upper computer and the lower computer, is responsible for forwarding instructions and status information; The lower computer, including multiple lower computer sub-modules, performs specific control tasks; The communication module is used to establish and maintain the communication connection between the upper computer and the intermediate computer, and between the intermediate computer and the lower computer, and supports multiple communication protocols.
8. A system for collaborative control of mapping modules and multi-master communication according to claim 7, characterized in that: The system communicates using the method described in any one of claims 1 to 6.
9. A system for collaborative control of mapping modules and multi-master communication according to claim 7, characterized in that: The upper computer distributes the overall operation instructions of the system to the mapping module through the operation scheduling module, and the mapping module sends the instructions to the lower computer sub-modules through the intermediate computer.
10. A system for collaborative control of mapping modules and multi-master communication according to claim 9, characterized in that: The lower computer submodule identifies the instruction corresponding to its own node ID and stores the instruction in the message queue.