Task scheduling method of furniture production line distributed system
By employing gateway cluster redundancy in the distributed system of the furniture production line, the problem of untimely and lost message transmission caused by gateway failure is solved by monitoring and reconnecting to the online gateway with the smallest sequence number, thus improving communication quality.
Patent Information
- Application Number
- CN202511267701.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2045-09-05
AI Technical Summary
In the existing distributed system of the furniture production line, gateway failures cause problems such as untimely message transmission and message loss.
A gateway cluster redundancy setting is adopted. By monitoring the online gateway with the smallest sequence number, the device can reconnect to the online gateway with the smallest sequence number when the device connection fails, thus ensuring smooth communication between the device and the gateway.
It effectively avoids message transmission failures caused by gateway failures or disconnections, ensuring timely message transmission between devices and preventing message loss, thus improving communication quality.
Smart Images

Figure CN121008549B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital information transmission. More specifically, this invention relates to a task scheduling method for a distributed system of a furniture production line. Background Technology
[0002] A distributed furniture production line system is a system that uses computer networks and intelligent control technology to manage and control the various stages of furniture manufacturing (such as raw material processing, component manufacturing, assembly, painting, and packaging) in a distributed and collaborative manner. This system aims to improve production efficiency, flexibility, and automation levels, adapting to the demands of modern furniture production characterized by customization, flexibility, and small-batch production of diverse varieties.
[0003] In existing technologies, distributed systems for furniture production lines typically include a central control unit, intermediate control units, and various production devices. The central control unit monitors each intermediate control unit, which in turn monitors its corresponding production device. Communication connections exist between the central control unit and the intermediate control units, as well as between the intermediate control units and the production devices. Currently, the devices in a distributed furniture production line system typically communicate through a gateway. When scheduling the devices, the central control unit needs to issue tasks to the corresponding intermediate control units and receive topic messages from them. Similarly, the intermediate control units issue tasks to the corresponding production devices and receive topic messages from them. However, since the gateway may experience disconnections during operation, this can lead to delayed message transmission and message loss between devices.
[0004] In summary, existing task scheduling methods for distributed systems in furniture production lines suffer from problems such as untimely message transmission and message loss. Summary of the Invention
[0005] To address the problems of untimely message transmission and message loss in existing task scheduling methods for distributed systems in furniture production lines, this invention provides solutions in the following aspects.
[0006] In a first aspect, the present invention provides a task scheduling method for a distributed system of a furniture production line. The distributed system includes a central control device connected to multiple intermediate control devices, each intermediate control device connected to multiple production devices. The central control device is used to issue production tasks to the intermediate control devices and receive topic messages published by the intermediate control devices. The intermediate control devices are used to forward the production tasks issued by the central control device to the corresponding production devices and receive topic messages published by the corresponding production devices. The production devices are used to execute the production tasks issued by the central control device. Communication between the central control device and the intermediate control devices, as well as between the intermediate control devices and the production devices, is conducted through a gateway cluster. The method includes: obtaining the online gateway with the smallest sequence number among the online gateways in the gateway cluster, and monitoring whether each device is connected to the online gateway with the smallest sequence number. The devices include each production device, each intermediate control device, and the central control device.
[0007] If a device is not connected to the online gateway with the smallest serial number, disconnect the gateway it is currently connected to, connect it to the online gateway with the smallest serial number, and determine whether the connection is successful.
[0008] If the connection is successful, it will enter a task waiting state and process the task upon receipt; if the connection fails, it will reacquire a new online gateway with the smallest sequence number and establish connections between each production device, each central control device, and the main control device and the new online gateway with the smallest sequence number. The task includes issuing and receiving tasks.
[0009] The beneficial effects are as follows: This method, through redundant gateway settings (i.e., setting up a gateway cluster and simultaneously keeping multiple gateways online), enables backup gateways for message transmission when the currently used gateway goes offline, avoiding the problem of message transmission failure due to gateway malfunction or disconnection. When connecting a device to the online gateway with the smallest sequence number, if the connection fails, it is likely because that online gateway has gone offline. The task scheduling method of the furniture production line distributed system in this embodiment, when connecting a device to the online gateway with the smallest sequence number, re-acquires the online gateway with the smallest sequence number if the connection fails, and re-establishes the connection between the device and the online gateway with the smallest sequence number. This allows for timely connection of each device to a new gateway after the online gateway with the smallest sequence number goes offline, ensuring timely message transmission between devices, preventing message loss, and improving the communication quality of the furniture production line distributed system.
[0010] Preferably, the method further includes: in response to the device being in a task waiting state for a duration exceeding a first duration threshold, re-acquiring the online gateway with the smallest sequence number, and re-establishing the connection between the device and the online gateway with the smallest sequence number.
[0011] Its beneficial effects are as follows: if the device times out while waiting for a task, it means that the gateway to which the device is connected may have gone offline. By re-acquiring the online gateway with the smallest sequence number and reconnecting the device to the gateway, the timeliness of message transmission between devices can be further guaranteed, and message loss can be prevented.
[0012] Preferably, the method further includes: real-time monitoring of whether each production device, each central control device, and the main control device are executing the release task;
[0013] In response to a device completing the published task, the online gateway with the smallest sequence number is reacquired.
[0014] In response to a change in the online gateway with the smallest sequence number, the connection between each device and the online gateway with the smallest sequence number is re-established.
[0015] Its beneficial effects are as follows: As time goes by, the gateways that the device has been connected to may go offline; after the device finishes executing the published task, it can detect whether the online gateway with the smallest sequence number has changed, and re-establish the connection between the device and the gateway if it has changed. This can prevent the problem of the device failing to execute the task next time due to the disconnection of the previously connected gateway, and further ensure the timeliness of message transmission between devices and prevent message loss.
[0016] Preferably, the topic messages published by the production equipment include the status of task execution and the operating status of the production equipment itself; the topic messages published by the central control equipment include the operating status of each corresponding production equipment and its task execution status.
[0017] Preferably, the method further includes:
[0018] Obtain the quantity of production orders;
[0019] If the number of production orders is less than a first preset threshold, the first preset number of central control devices and corresponding production devices will be deactivated through the central control device.
[0020] Its beneficial effects are: when there are few orders, many machines and workstations are not fully utilized. By shutting down some central control equipment and corresponding production equipment, the cost of order production can be saved.
[0021] Preferably, the online gateways in the gateway cluster are enabled one by one using the same enabling method upon initial activation. For a given gateway, the enabling method includes:
[0022] Broadcast the ID of this gateway and listen to online gateways to obtain the maximum sequence number of online gateways;
[0023] The sum of the maximum sequence number and the preset value is used as the sequence number of this gateway, and this gateway is controlled to enter the working state.
[0024] Preferably, the central control device is also connected to multiple workpiece layout servers to publish task topic messages to the workpiece layout servers and receive messages returned by the workpiece layout servers. The method further includes: in response to the number of production orders being less than a first preset threshold, a second preset number of workpiece layout servers are deactivated through the central control device.
[0025] Preferably, the method further includes:
[0026] The central control equipment obtains the working status of the online workpiece layout server to identify whether there is an idle workpiece layout server; and receives the first task topic message issued by the central control equipment in real time.
[0027] In response to the existence of an idle workpiece layout server and the central control device receiving a first task topic message from the master control device, the central control device sends the first task topic message to the workpiece layout server and enters a waiting state for a return message; the return message refers to the message returned by the workpiece layout server after it has finished processing the task corresponding to the first task topic message;
[0028] If the duration of the central control device in the waiting-for-return-message state exceeds the second duration threshold, the idle workpiece layout server is re-identified, a task topic message is sent to it, and the device re-enters the waiting-for-return-message state.
[0029] Preferably, the method further includes: in response to the central control device receiving the return message within a second time threshold, returning a first message to the central control device, the first message including the scheduling status and the completion status of the layout task.
[0030] Preferably, the method further includes: simultaneously starting programs for two gateways on the gateway's server, and having the two gateways monitor each other; when one gateway is detected to be without a heartbeat, the other gateway restarts it. Attached Figure Description
[0031] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent upon reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of the invention are illustrated by way of example and not limitation, and like or corresponding reference numerals denote like or corresponding parts, wherein:
[0032] Figure 1 This is a schematic diagram illustrating the composition structure of a distributed system for a furniture production line according to an embodiment of the present invention;
[0033] Figure 2This is a schematic flowchart illustrating a task scheduling method for a distributed system of a furniture production line according to an embodiment of the present invention. Detailed Implementation
[0034] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0035] Example of a task scheduling method for a distributed system of a furniture production line:
[0036] like Figure 1 As shown, the task scheduling method of the furniture production line distributed system of the present invention is based on a furniture production line distributed system, which includes a central control device connected to multiple central control devices. Each central control device is connected to multiple production devices. The central control device is used to issue production tasks to the central control devices and receive topic messages published by the central control devices. The central control devices are used to forward the production tasks issued by the central control devices to the corresponding production devices and receive topic messages published by the corresponding production devices. The production devices are used to execute the production tasks issued by the central control devices. Communication between the central control devices and the central control devices, as well as between the central control devices and the production devices, is conducted through a gateway cluster.
[0037] In this embodiment, the central control equipment can include various types, such as: drilling workstation central control equipment, sorting central control equipment, and edge banding machine connection central control equipment. The types of production equipment also vary, such as: cutting machines, drilling centers, computer-controlled saws, and edge banding machines.
[0038] like Figure 2 As shown, the task scheduling method of the furniture production line distributed system in this embodiment includes:
[0039] S101. Obtain the online gateway with the smallest serial number and monitor the connection status of each device. Specifically, obtain the online gateway with the smallest serial number among the online gateways in the gateway cluster and monitor whether each device is connected to the online gateway with the smallest serial number. The devices include each production device, each central control device, and the main control device.
[0040] S102. Connect each device to the online gateway with the smallest serial number. Specifically, if a device is not connected to the online gateway with the smallest serial number, disconnect the gateway it is currently connected to and connect it to the online gateway with the smallest serial number, and identify whether the connection is successful.
[0041] S103. Control the device to enter a task waiting state or reconnect to the gateway. Specifically, if the connection is successful, it is put into a task waiting state and the task is processed after it is received. If the connection fails, the device reacquires the online gateway with the smallest sequence number and establishes a connection between each device and the online gateway with the smallest sequence number. The task includes publishing a task and receiving a task.
[0042] In this embodiment, the production equipment's publishing task includes publishing a topic message, and the receiving task includes receiving production tasks issued by the corresponding central control equipment. The topic message published by the production equipment includes the task execution status and the operating status of the production equipment itself.
[0043] If a device, system, or software in the distributed system of a furniture production line malfunctions, the direct manifestation will be that the gateway does not receive broadcasts from that device, and the central control unit will not assign tasks to that device. Similarly, if the central control unit is offline, the master control unit will not assign tasks to it.
[0044] The central control unit's publishing tasks include publishing topic messages, which include the operating status and task execution status of each corresponding production device. Task execution status includes three states: not executed, executing, and completed. The central control unit's receiving tasks include receiving production tasks issued by the central control unit and topic messages published by the production devices.
[0045] The central control device's publishing tasks include publishing topic messages, which include production tasks. The central control device's receiving tasks include receiving topic messages published by the central control device.
[0046] In this embodiment, the gateway uses the MQTT protocol for interaction. MQTT is a lightweight, publish / subscribe-based messaging protocol designed for resource-constrained devices and low-bandwidth, unreliable network environments. It is widely used in the Internet of Things (IoT), smart homes, industrial automation, and other fields.
[0047] The method in this embodiment utilizes gateway redundancy (i.e., setting up a gateway cluster and simultaneously keeping multiple gateways online) to activate a backup gateway for message transmission when the currently used gateway goes offline. This avoids message transmission failures caused by gateway malfunctions or outages. When connecting a device to the online gateway with the smallest sequence number, if the connection fails, it's likely because that gateway has gone offline. The task scheduling method in this embodiment of the furniture production line distributed system, when connecting a device to the online gateway with the smallest sequence number, re-acquires the gateway with the smallest sequence number if the connection fails, and re-establishes the connection between the device and the gateway. This ensures that devices can be connected to new gateways promptly after the gateway with the smallest sequence number goes offline, guaranteeing timely message transmission between devices, preventing message loss, and improving the communication quality of the furniture production line distributed system.
[0048] In one embodiment, the method further includes: in response to the device being in a task waiting state for a duration exceeding a first duration threshold, re-acquiring the online gateway with the smallest sequence number and re-establishing the connection between each device and the online gateway with the smallest sequence number.
[0049] If a device times out while waiting for a task, it indicates that the gateway to which the device is connected may have gone offline. By re-acquiring the online gateway with the smallest sequence number and reconnecting the device to the gateway, the timeliness of message transmission between devices can be further guaranteed, and message loss can be prevented.
[0050] In one embodiment, the method further includes:
[0051] S201. Real-time monitoring of whether each device is executing the publishing task;
[0052] S202. In response to a device completing the publishing task, the online gateway with the smallest sequence number is reacquired.
[0053] S203. In response to a change in the online gateway with the smallest sequence number, reconnect each device to the online gateway with the smallest sequence number.
[0054] As time goes by, the gateways that the device is connected to may go offline. After the device finishes executing the published task, it checks whether the online gateway with the smallest sequence number has changed, and if it has changed, it re-establishes the connection between the device and the gateway. This can prevent the problem of the device failing to execute the task next time due to the disconnection of the previously connected gateway, and further ensure the timeliness of message transmission between devices and prevent message loss.
[0055] In one embodiment, the method further includes:
[0056] S301, Obtain the quantity of the production order;
[0057] S302. In response to the number of production orders being less than a first preset threshold, the first preset number of central control devices and corresponding production devices are disabled through the central control device.
[0058] When there are many production orders, and a large number of central control devices and production equipment are in use, the central control device will automatically schedule and assign tasks to these central control devices, which in turn assign tasks to individual machines. If there are few customer orders, many machines and workstations will not be fully utilized. By shutting down some central control devices and their corresponding production equipment, production costs can be saved.
[0059] In one embodiment, the online gateways of the gateway cluster are enabled one by one according to the same enabling method upon initial activation. For a given gateway, the enabling method includes:
[0060] S401, broadcast the ID of this gateway and listen to online gateways to obtain the maximum sequence number of online gateways;
[0061] S402. The sum of the maximum sequence number and the preset value is used as the sequence number of this gateway, and the gateway is controlled to enter the working state.
[0062] In this embodiment, the preset value can be set to 1. In other embodiments, it can also be set to other suitable values.
[0063] The gateway activation method in this embodiment ensures that the serial numbers of each online gateway in the gateway cluster are different.
[0064] In one embodiment, the central control device is also connected to multiple workpiece layout servers to publish task topic messages to the workpiece layout servers and receive messages returned by the workpiece layout servers. The method further includes: in response to the number of production orders being less than a first preset threshold, disabling a second preset number of workpiece layout servers through the central control device.
[0065] A workpiece layout server is a computing system used to rationally arrange multiple workpieces to be processed on materials (such as steel plates, wood boards, glass, cloth, etc.) with the goal of minimizing material waste.
[0066] When the number of production orders is small, only a small number of workpiece layout servers are used; when the number of production orders is large, more workpiece layout servers are used; this can save costs.
[0067] In one embodiment, the method further includes:
[0068] S501, the central control equipment obtains the working status of the online workpiece layout server to identify whether there is an idle workpiece layout server; and receives the first task topic message issued by the central control equipment in real time;
[0069] In this embodiment, the method for determining whether the workpiece layout server is in an idle state is as follows: obtain the CPU utilization rate of the workpiece layout server; when the CPU utilization rate is lower than the utilization rate threshold, the workpiece layout server is determined to be in an idle state. In this embodiment, the utilization rate threshold can be set to 80%, but in other embodiments, it can also be set to other suitable values.
[0070] S502. In response to the existence of a workpiece layout server in an idle state and the central control device receiving a first task topic message issued by the main control device, the central control device issues the first task topic message to the workpiece layout server and enters a waiting state for a return message; the return message refers to the message returned by the workpiece layout server after it has finished processing the task corresponding to the first task topic message.
[0071] S503. In response to the fact that the duration of the central control device in the waiting-to-process-return-message state exceeds the second duration threshold, the idle workpiece layout server is re-identified, the first task topic message is sent to it, and the device re-enters the waiting-to-process-return-message state.
[0072] If some workpiece layout servers have an excessive workload while others are relatively idle, the layout efficiency will be too low. By instructing the central control device to only issue layout tasks to the idle workpiece layout servers, the workload of each workpiece layout server can be more balanced, thereby improving the efficiency of workpiece layout.
[0073] As can be seen from the above embodiments, the central control device needs to forward the first task topic message issued by the main control device to the idle workpiece layout server after receiving it. Since the furniture production line distributed system includes multiple central control devices, the main control device only needs to call one of the central control devices when performing workpiece layout tasks. In one embodiment, the main control device issues the first task topic message by: obtaining the working status of all online central control devices to obtain the idle level of each online central control device, and issuing the first task topic message to the online central control device with the highest idle level.
[0074] The idle time of the central control device can be measured by its CPU utilization rate; the higher the CPU utilization rate, the lower the idle time.
[0075] Sending the first task message to a busy central control device may result in delayed processing of the message. By having the main control device send the first task message to the online central control device with the highest idle time, the task processing efficiency of the furniture production line's distributed system can be improved.
[0076] In one embodiment, the method further includes: in response to the central control device receiving the return message within a second time threshold, returning a first message to the central control device, the first message including the scheduling status and the completion status of the typesetting task.
[0077] In one embodiment, the method further includes: simultaneously starting programs for two gateways on the gateway's server, and having the two gateways monitor each other; if one gateway is detected to be without a heartbeat, the other gateway restarts it.
[0078] By having the two gateways monitor each other, the lost gateway can be restarted in a timely manner if it goes offline, ensuring normal information exchange between the central control equipment, the master control equipment, and the production equipment.
[0079] In the description of this specification, "multiple" or "several" means at least two, such as two, three or more, unless otherwise explicitly specified.
[0080] While this specification has shown and described numerous embodiments of the invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will occur to those skilled in the art without departing from the spirit and essence of the invention. It should be understood that various alternatives to the embodiments of the invention described herein may be employed in the practice of this invention.
Claims
1. A task scheduling method for a distributed system of a furniture production line, characterized in that, The distributed system includes a central control device, which is connected to multiple central control devices. Each central control device is connected to multiple production devices. The central control device is used to issue production tasks to the central control devices and receive topic messages published by the central control devices. The central control devices are used to forward the production tasks issued by the central control device to the corresponding production devices and receive topic messages published by the corresponding production devices. The production devices are used to execute the production tasks issued by the central control device. The communication between the central control equipment and the intermediate control equipment, as well as between the intermediate control equipment and the production equipment, is conducted through a gateway cluster. The method includes: obtaining the online gateway with the smallest sequence number among the online gateways in the gateway cluster, and monitoring whether each device is connected to the online gateway with the smallest sequence number; the devices include each production device, each intermediate control equipment, and the central control equipment. If a device is not connected to the online gateway with the smallest serial number, disconnect the gateway it is currently connected to, connect it to the online gateway with the smallest serial number, and determine whether the connection is successful. If the connection is successful, it will enter a task waiting state and process the task upon receipt; if the connection fails, it will reacquire a new online gateway with the smallest sequence number and establish connections between each production device, each central control device, and the main control device and the new online gateway with the smallest sequence number. The task includes issuing and receiving tasks.
2. The task scheduling method for a distributed system of a furniture production line as described in claim 1, characterized in that, The method further includes: If the duration of the device in the task waiting state exceeds a first duration threshold, the device will reacquire the online gateway with the smallest sequence number and re-establish the connection between the device and the online gateway with the smallest sequence number.
3. The task scheduling method for a distributed system of a furniture production line as described in claim 2, characterized in that, The method further includes: Real-time monitoring of whether each production device, each central control device, and the main control device executes the issued task; In response to a device completing the published task, the online gateway with the smallest sequence number is reacquired. In response to a change in the online gateway with the smallest sequence number, the connection between each device and the online gateway with the smallest sequence number is re-established.
4. The task scheduling method for a distributed system of a furniture production line as described in claim 1, characterized in that, The topic messages published by production equipment include the status of task execution and the operating status of the production equipment itself; the topic messages published by central control equipment include the operating status of each corresponding production equipment and its task execution status.
5. The task scheduling method for a distributed system of a furniture production line as described in claim 1, characterized in that, The method further includes: Obtain the quantity of production orders; If the number of production orders is less than a first preset threshold, the first preset number of central control devices and corresponding production devices will be deactivated through the central control device.
6. The task scheduling method for a distributed system of a furniture production line as described in claim 1, characterized in that, The online gateways in the gateway cluster are enabled one by one using the same activation method upon initial startup. For a given gateway, the activation method includes: Broadcast the ID of this gateway and listen to online gateways to obtain the maximum sequence number of online gateways; The sum of the maximum sequence number and the preset value is used as the sequence number of this gateway, and this gateway is controlled to enter the working state.
7. The task scheduling method for a distributed system of a furniture production line as described in any one of claims 1 to 6, characterized in that, The central control device is also connected to multiple workpiece layout servers to publish task topic messages to the workpiece layout servers and receive messages returned by the workpiece layout servers. The method further includes: in response to the number of production orders being less than a first preset threshold, a second preset number of workpiece layout servers are deactivated through the central control device.
8. The task scheduling method for a distributed system of a furniture production line as described in claim 7, characterized in that, The method further includes: The central control equipment obtains the working status of the online workpiece layout server to identify whether there is an idle workpiece layout server; and receives the first task topic message issued by the central control equipment in real time. In response to the existence of an idle workpiece layout server and the central control device receiving a first task topic message from the master control device, the central control device sends the first task topic message to the workpiece layout server and enters a state of waiting for a return message; the return message refers to the message returned by the workpiece layout server after it has finished processing the task corresponding to the first task topic message; If the duration of the central control device in the waiting-for-return-message state exceeds the second duration threshold, the idle workpiece layout server is re-identified, a task topic message is sent to it, and the device re-enters the waiting-for-return-message state.
9. The task scheduling method for a distributed system of a furniture production line as described in claim 8, characterized in that, The method further includes: in response to the central control device receiving the return message within a second time threshold, returning a first message to the central control device, the first message including the scheduling status and the completion status of the layout task.
10. The task scheduling method for a distributed system of a furniture production line as described in claim 1, characterized in that, The method further includes: simultaneously starting programs for two gateways on the gateway's server, and having the two gateways monitor each other; if one gateway is found to be without a heartbeat, the other gateway restarts it.
Citation Information
Patent Citations
Cloud communication based collection front-end system
CN108011915A
Distributed file storage system and file storage method
CN110351119A