PCBA production control method based on digital twinning and edge federated scheduling

By deploying edge computing nodes and building spatiotemporal predictive digital twins on the PCBA production line, and combining physical virtual calibration and federated learning, the scheduling complexity, data privacy, and virtual-physical consistency issues of the PCBA production line were resolved, thereby improving the production line's operational efficiency.

CN122239645APending Publication Date: 2026-06-19SHENZHEN ZHAOXING BOTUO TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN ZHAOXING BOTUO TECH CO LTD
Filing Date
2026-04-07
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

The PCBA production line faces challenges such as high production scheduling complexity, prominent data silos and privacy conflicts, and difficulty in ensuring consistency between virtual and physical data, resulting in low production line operating efficiency.

Method used

By deploying edge computing nodes at key process equipment, constructing an equipment communication topology mapping table, collecting and preprocessing operational data in real time, establishing a spatiotemporal predictive digital twin for data prediction, performing physical virtual bidirectional calibration, conducting federated learning based on contract theory, constructing a multi-timescale hierarchical scheduling controller, and generating collaborative scheduling instructions.

Benefits of technology

It achieves dynamic synchronization between the digital twin and the physical entity, avoiding scheduling errors, ensuring data privacy protection, and improving production line operating efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122239645A_ABST
    Figure CN122239645A_ABST
Patent Text Reader

Abstract

This application discloses a PCBA production control method based on digital twins and edge federated scheduling, including: deploying edge computing nodes at key process equipment to collect data and construct an equipment communication topology mapping table and original state vectors; obtaining enhanced state vectors by predicting production line data through spatiotemporal predictive digital twins; sending probe commands to physical entities and observing response differences, performing physical virtual bidirectional calibration to obtain calibrated state vectors; training a local scheduling strategy model based on the calibrated state vectors, uploading model gradient parameters and contribution proofs based on contract theory, so that the central server performs weighted federated aggregation based on contract weights and reputation values ​​to obtain a global scheduling strategy model; constructing a multi-timescale hierarchical scheduling controller based on the calibrated state vectors and the global scheduling strategy model, generating collaborative scheduling commands and issuing them to production line execution units for collaborative scheduling, significantly improving production line operating efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent manufacturing technology, and in particular to a PCBA production control method based on digital twins and edge federated scheduling. Background Technology

[0002] Printed circuit board assembly (PCBA) is a core component of the electronics and information manufacturing industry, involving multiple precision processes such as surface mount technology (SMT), reflow soldering, and optical inspection. As electronic products trend towards miniaturization and high density, PCBA production lines face the following technological challenges, significantly impacting their operational efficiency: First, production scheduling is highly complex. PCBA production lines include various types of equipment such as pick-and-place machines, reflow ovens, automated optical inspection (AOI) equipment, and automated guided vehicles (AGVs), with complex material flow and energy coupling relationships between these devices. Traditional scheduling methods often employ static optimization or single-time-scale control, which struggles to handle dynamic order insertions, sudden equipment failures, and other disruptive events, leading to delivery delays and low resource utilization.

[0003] Second, the conflict between data silos and privacy is prominent. When multiple factories collaborate on production, each factory's data involves trade secrets, and they are unwilling to directly share raw production data. Traditional centralized machine learning methods require the aggregation of all data, which poses a risk of privacy leakage; while simple parameter averaging federated learning lacks contribution evaluation and incentive mechanisms, resulting in insufficient participation from high-contribution nodes.

[0004] Third, consistency between the virtual and physical models is difficult to guarantee. Digital twin technology provides a virtual mapping method for PCBA production lines, but traditional digital twins are mostly one-way data mappings, lacking a feedback calibration mechanism between the physical entity and the virtual model. When equipment aging or process changes cause deviations between the virtual model and the physical entity, scheduling decisions based on the inaccurate virtual state may trigger systemic production risks. Summary of the Invention

[0005] The main purpose of this application is to provide a PCBA production control method based on digital twin and edge federated scheduling, which aims to solve the technical problems of insufficient consistency between virtual and physical systems, contradiction between data privacy protection and collaborative optimization, resulting in low production line operating efficiency.

[0006] To achieve the above objectives, this application proposes a PCBA production control method based on digital twins and edge federated scheduling. The PCBA production control method based on digital twins and edge federated scheduling includes: Edge computing nodes are deployed at key process equipment in the printed circuit board assembly line to build a device communication topology mapping table to collect and preprocess the operating data of key process equipment in real time and obtain the original state vector. A spatiotemporal predictive digital twin is constructed based on the device communication topology mapping table and the original state vector. An enhanced state vector is obtained by predicting production line data through the spatiotemporal predictive digital twin. Based on the enhanced state vector, a detection command is sent to the physical entity of the key process equipment and the response difference is observed. Physical virtual bidirectional calibration is then performed to obtain the calibrated state vector. Based on the calibrated state vectors stored locally on each edge computing node, a local scheduling strategy model is trained. The model gradient parameters and contribution proof are uploaded to the central server based on contract theory, so that the central server performs weighted federated aggregation based on contract weights and reputation values ​​to obtain a global scheduling strategy model and distribute it to each edge node. Based on the calibrated state vector and the global scheduling strategy model, a multi-time-scale hierarchical scheduling controller is constructed to generate collaborative scheduling instructions across the strategic, tactical, and execution layers, and the collaborative scheduling instructions are sent to the production line execution units for collaborative scheduling.

[0007] In one embodiment, the deployment of edge computing nodes at key process equipment in the printed circuit board assembly line, the construction of an equipment communication topology mapping table, the real-time collection and preprocessing of operational data from the key process equipment to obtain an original state vector, includes: Edge computing nodes are deployed at the chip mounters, reflow ovens, automatic optical inspection equipment and automatic guided vehicles in the printed circuit board assembly line. Lightweight industrial gateways are configured at each edge computing node. Adjacent network devices are identified through the link layer discovery protocol, and physical connection topology is established. Based on the physical connection topology, the device type and data register address are identified by scanning the manufacturing message specification protocol. The device type includes the brand and model of the programmable logic controller and the communication protocol type. The data register address includes the memory address in the programmable logic controller that stores the operating parameters. By aggregating the physical connection topology, the device type, and the data register address, a device communication topology mapping table is generated. Based on the data register address in the device communication topology mapping table, time-sensitive network transmission scheduling is configured, and the operating data of key process equipment is collected through the manufacturing message specification protocol. The operating data of key process equipment includes the position coordinates of the pick-and-place machine nozzle, the temperature values ​​of each zone of the reflow oven, the defect detection results of the automatic optical inspection equipment, and the battery power and position coordinates of the automatic guided transport vehicle. The operating data of the key process equipment are timestamped and standardized to construct the original state vector.

[0008] In one embodiment, the step of constructing a spatiotemporal predictive digital twin based on the device communication topology mapping table and the original state vector, and obtaining an enhanced state vector by predicting production line data using the spatiotemporal predictive digital twin, includes: Based on the device communication topology mapping table, the physical entities of the printed circuit board assembly line are mapped to a heterogeneous spatiotemporal network diagram. The node set of the heterogeneous spatiotemporal network diagram includes device nodes, buffer nodes, and order nodes, and the edge set represents the material flow relationship and energy coupling relationship. A spatiotemporal predictive digital twin is constructed based on a spatiotemporal graph neural network model and the heterogeneous spatiotemporal network graph, wherein the spatiotemporal graph neural network model is composed of stacked graph convolutional layers and gated temporal convolutional layers; The original state vector is input into the spatiotemporal predictive digital twin, and a predicted state vector is generated through multi-step rolling prediction. The predicted state vector includes at least the health degradation trend curve of each device within a future preset time window and the product congestion propagation path data of each buffer zone. The predicted state vector and the original state vector are fused to obtain the enhanced state vector.

[0009] In one embodiment, the step of sending a probe command to the physical entity of the key process equipment based on the enhanced state vector and observing the response difference, and performing physical virtual bidirectional calibration to obtain the calibrated state vector, includes: The system sends detection commands to the programmable logic controller of the physical entity of the key process equipment through the manufacturing message specification protocol, and collects the actual response data of the physical entity under the action of the detection commands. The detection commands include at least the chip placement head speed adjustment command, the reflow soldering temperature setpoint adjustment command, and the automatic guided vehicle running speed adjustment command. The physical virtual consistency index is determined based on the actual response data and the enhanced state vector. When the physical virtual consistency index is lower than the preset consistency threshold, the model parameters of the spatiotemporal predictive digital twin are updated through the backpropagation algorithm until the physical virtual consistency index reaches or exceeds the preset consistency threshold, thus obtaining the calibrated spatiotemporal predictive digital twin. Based on the calibrated spatiotemporal predictive digital twin, virtual response data matching the actual response data is generated. The virtual response data and the actual response data are then aligned to obtain the calibrated state vector.

[0010] In one embodiment, the local scheduling strategy model is trained based on the calibrated state vectors stored locally on each edge computing node. The model gradient parameters and contribution proofs are then uploaded to the central server based on contract theory. This allows the central server to perform weighted federated aggregation based on contract weights and reputation values ​​to obtain a global scheduling strategy model, which is then distributed to each edge node. This includes: A sample set of Markov decision process state transitions is constructed based on the calibrated state vectors stored locally on each edge computing node. Based on the sample set, the local resource scheduling strategy model of each edge computing node is trained using the near-end strategy optimization algorithm. Pruning parameters are set, a preset number of training rounds are performed, the model gradient parameters and the accuracy improvement value of the validation set are determined, and the accuracy improvement value of the validation set is used as the data quality proof of the corresponding edge computing node. Obtain the contract set published by the central server, and autonomously select and sign contracts from the contract set based on the data quality proof of each edge computing node to obtain the contract weight. Each contract in the contract set contains a data quality level and a corresponding contract weight. The Monte Carlo sampling method is used to determine the Shapley value of the local resource scheduling strategy model, and a comprehensive contribution is generated based on the data quality proof, the Shapley value, and the node online duration. The Shapley value of the local resource scheduling strategy model is determined using the Monte Carlo sampling method, and a contribution proof is generated based on the data quality proof, the Shapley value, and the node online duration. The model gradient parameters and the contribution proof are submitted to the central server, so that the central server can verify the authenticity of the gradient based on the model gradient parameters, and after the verification is passed, accumulate and calculate the node reputation value. Then, perform weighted federated aggregation based on the contract weight and the node reputation value to obtain the global scheduling strategy model and distribute it to each edge node.

[0011] In one embodiment, the step of constructing a multi-timescale hierarchical scheduling controller based on the calibrated state vector and the global scheduling strategy model, generating collaborative scheduling instructions across the strategic, tactical, and execution layers, and issuing the collaborative scheduling instructions to the production line execution units for collaborative scheduling includes: The device status data and energy consumption data are parsed from the calibrated status vector, and the order status data is obtained. Calculate the average queue backlog of the sliding window based on the order status data, equipment status data, and energy consumption data; Based on historical data, fit the Pareto front surface and calculate the projected distance from the current operating point to the Pareto front. Based on the deviation between the average queue backlog and the target backlog level of the sliding window, and combined with the projection distance, a differential equation containing a queue backlog deviation term, a central regression term, and a Pareto distance correction term is solved to obtain the control parameter update amount. The current Lyapunov optimized control parameters are superimposed with the updated control parameters, and safety boundary constraints and rate of change limits are applied to obtain the adjusted control parameters. Based on the adjusted control parameters and the global scheduling strategy model, a multi-time-scale hierarchical scheduling controller is constructed to solve the drift plus penalty plus risk optimization problem, generate collaborative scheduling instructions across the strategic, tactical and execution layers, and issue the collaborative scheduling instructions to the production line execution units for collaborative scheduling.

[0012] In one embodiment, the construction of a multi-time-scale hierarchical scheduling controller based on the adjusted control parameters and the global scheduling strategy model, solving a drift plus penalty plus risk optimization problem, and generating collaborative scheduling instructions across the strategic, tactical, and execution layers includes: Based on the strategic layer cycle parameters in the adjusted control parameters, the work order deployment plan for the future preset planning duration is optimized in a first preset cycle. Based on the initial estimate of the action value function output by the global scheduling strategy model, the Monte Carlo tree search algorithm is used to search for the optimal deployment order in the work order sequence space to generate a strategic layer coarse-grained plan that includes equipment reservation schemes and material delivery batches. Based on the tactical layer cycle parameters in the adjusted control parameters, and using the second preset cycle to receive the strategic layer coarse-grained plan as a constraint, an action space is established. Based on the candidate action set recommended by the global scheduling strategy model, and combined with the Lyapunov drift weight in the adjusted control parameters, a drift plus penalty plus risk objective function is constructed, which includes a weighted sum of energy consumption and line switching time, a virtual queue drift penalty, and a device health risk. The drift plus penalty plus risk optimization problem is solved, and model predictive control is used to generate medium-grained instructions containing the processing sequence of each workstation and the device parameter settings through rolling optimization. Based on the execution layer cycle parameters in the adjusted control parameters, the device load prediction in the medium-granularity instruction is received in the third preset cycle. Based on the micro-action strategy output by the global scheduling strategy model, the pick-and-place machine nozzle selection, placement sequence and motion trajectory parameters are optimized to minimize the micro-cycle time and generate a fine-granular control signal containing nozzle switching signals, axis motion coordinates and vacuum degree setting values. By integrating the coarse-grained strategic plan, the medium-grained instructions, and the fine-grained control signals, a coordinated scheduling instruction is generated across the strategic, tactical, and execution layers.

[0013] In one embodiment, after constructing a multi-timescale hierarchical scheduling controller based on the calibrated state vector and the global scheduling strategy model, generating collaborative scheduling instructions across the strategic, tactical, and execution layers, and issuing the collaborative scheduling instructions to the production line execution units for collaborative scheduling, the method further includes: During the execution of the coordinated scheduling instructions, the execution status data is collected in real time through a sensor network deployed at the key process equipment. Based on the execution status data, anomaly detection is performed on the network model to determine whether any disturbance events exist; In the presence of disturbance events, the intensity of the causal effect of the disturbance source node on the downstream node along the material flow edge and energy coupling edge is calculated by backpropagation of the spatiotemporal graph neural network based on the heterogeneous spatiotemporal network graph. The set of affected nodes and the rescheduling time window are determined based on the intensity of the causal effect. Based on the set of affected nodes and the rescheduling time window, a local rescheduling instruction is generated and issued to the corresponding production line execution unit.

[0014] Furthermore, to achieve the above objectives, this application also proposes a PCBA production control device based on digital twin and edge federated scheduling. The PCBA production control device based on digital twin and edge federated scheduling includes: The preprocessing module is used to deploy edge computing nodes at key process equipment in the printed circuit board assembly line, build a device communication topology mapping table, collect the operating data of key process equipment in real time, and perform preprocessing to obtain the original state vector. The prediction module is used to construct a spatiotemporal predictive digital twin based on the device communication topology mapping table and the original state vector, and to obtain an enhanced state vector by predicting production line data through the spatiotemporal predictive digital twin. The calibration module is used to send detection commands to the physical entity of the key process equipment based on the enhanced state vector and observe the response differences, and perform physical virtual bidirectional calibration to obtain the calibrated state vector. The aggregation module is used to train a local scheduling strategy model based on the calibrated state vector stored locally on each edge computing node, and upload the model gradient parameters and contribution proof to the central server based on contract theory, so that the central server can perform weighted federated aggregation based on contract weight and reputation value to obtain a global scheduling strategy model and distribute it to each edge node. The scheduling module is used to construct a multi-time-scale hierarchical scheduling controller based on the calibrated state vector and the global scheduling strategy model, solve the drift plus penalty plus risk optimization problem, generate collaborative scheduling instructions across the strategic layer, tactical layer and execution layer, and issue the collaborative scheduling instructions to the production line execution unit for collaborative scheduling.

[0015] The proposed technical solutions, including one or more, construct a spatiotemporal predictive digital twin, combining detection commands and a physical-virtual consistency index to achieve dynamic synchronization between the digital twin and the physical entity. This avoids scheduling errors caused by model inaccuracies. The solutions employ a federated learning framework and a quality-graded contract mechanism, uploading only encrypted model gradients and not sharing raw data. Edge nodes autonomously select contract levels based on local data quality, while the central server performs weighted federated aggregation based on contract weights and reputation values ​​recorded in the permissioned chain. This prevents malicious node attacks and achieves secure collaborative scheduling across edge nodes. Furthermore, by constructing a multi-timescale hierarchical scheduling controller, collaborative scheduling at different levels is achieved, significantly improving production line operating efficiency. Attached Figure Description

[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating an embodiment of the PCBA production control method based on digital twins and edge federated scheduling provided in this application. Figure 2 This is a schematic diagram of the module structure of the PCBA production control device based on digital twin and edge federated scheduling in an embodiment of this application.

[0019] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0020] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0021] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0022] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of performing the above functions, such as a PCBA production control device based on digital twins and edge federated scheduling. The following description uses a PCBA production control device based on digital twins and edge federated scheduling as an example to illustrate this embodiment and the subsequent embodiments.

[0023] Based on this, embodiments of this application provide a PCBA production control method based on digital twin and edge federated scheduling, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the PCBA production control method based on digital twin and edge federated scheduling in this application.

[0024] In this embodiment, the PCBA production control method based on digital twin and edge federated scheduling includes steps S10~S50: Step S10: Deploy edge computing nodes at key process equipment in the printed circuit board assembly line, construct an equipment communication topology mapping table to collect real-time operating data of key process equipment and perform preprocessing to obtain the original state vector.

[0025] It should be noted that key process equipment refers to the core processing and testing equipment in the printed circuit board assembly line that directly determines production efficiency, product quality, and capacity bottlenecks. It includes at least pick-and-place machines, reflow ovens, automatic optical inspection equipment, and automated guided vehicles. This implementation method does not impose specific limitations on this.

[0026] Edge computing nodes refer to industrial-grade computing units deployed on the production line and close to the physical equipment. They have functions such as data acquisition, local storage, model inference, and instruction issuance. In this embodiment, edge computing nodes are industrial-grade embedded devices installed in the control cabinets of key process equipment or next to the equipment, and are directly connected to the programmable logic controller (PLC) of the equipment via industrial Ethernet cables.

[0027] The equipment communication topology mapping table is a structured data table that records the network connection relationships, equipment type information, and data access addresses of each device in the production line, providing addressing basis for periodic data collection.

[0028] Understandably, after the edge computing node starts up, it sends probe messages to neighboring network devices through the link layer discovery protocol, receives information such as MAC address, port number, and device name returned by the devices, establishes a physical connection topology diagram between devices, and sends identification requests to each device through the Manufacturing Message Specification Protocol (MMS) based on the physical topology relationship. It parses the device response messages to obtain information such as the device's PLC brand and model, supported protocol version, and device manufacturer information. By reading the device description file or through online scanning, it determines the register address mapping relationship of key operating parameters in the PLC. For example, the X-axis coordinate of the pick-and-place machine nozzle is stored at offset 0 of DB block 100, and the data type is REAL. By aggregating the above information, a device communication topology mapping table is generated.

[0029] It's worth noting that operational data refers to raw physical quantity data collected in real-time from the programmable logic controllers (PLCs) of key process equipment via industrial gateways, reflecting the current operating status and parameters of the equipment. Preprocessing aims to improve data quality and eliminate noise interference, and may include steps such as timestamp alignment and data standardization. The raw state vector is a fixed-dimensional numerical vector formed after time alignment and standardization of the collected heterogeneous operational data. The raw state vectors are stored chronologically in the time-series database of the edge nodes. Each record contains a timestamp, vector data, and a data quality label. The data quality label is automatically calculated based on the acquisition success rate, data integrity, and noise level, and takes a value between 0 and 1, used for confidence level assessment.

[0030] In one feasible implementation, step S10 may include: deploying edge computing nodes at the pick-and-place machine, reflow oven, automated optical inspection equipment, and automated guided vehicle (AGV) of the printed circuit board assembly line; configuring lightweight industrial gateways at each edge computing node; identifying adjacent network devices through a link layer discovery protocol and establishing physical connection topology relationships; based on the physical connection topology relationships, scanning and identifying device types and data register addresses through a manufacturing message specification protocol, wherein the device type includes the brand and model of the programmable logic controller (PLC) and the communication protocol type, and the data register address includes the memory address in the PLC that stores operating parameters; aggregating the physical connection topology relationships, the device types, and the data register addresses to generate a device communication topology mapping table; configuring time-sensitive network transmission scheduling based on the data register addresses in the device communication topology mapping table; collecting operating data of key process equipment through a manufacturing message specification protocol, wherein the operating data of key process equipment includes the position coordinates of the pick-and-place machine nozzle, the temperature values ​​of each zone of the reflow oven, the defect detection results of the automated optical inspection equipment, and the battery level and position coordinates of the AGV; and performing timestamp alignment and standardization processing on the operating data of the key process equipment to construct an original state vector.

[0031] It should be noted that, in this embodiment, the key process equipment includes a pick-and-place machine, a reflow oven, an automated optical inspection system, and an automated guided vehicle (AGV). The pick-and-place machine is the core equipment responsible for accurately mounting electronic components onto the PCB board, and includes multiple placement heads, nozzles, and a vision system. The reflow oven is the key equipment that melts the solder paste and solders the components through multi-temperature heating. The automated optical inspection system is used to perform optical inspection on the mounted PCB to identify defects such as missing components, misalignment, and incorrect polarity. The automated guided vehicle (AGV) is a mobile robot responsible for transporting PCB boards, materials, and finished products between various workstations on the production line.

[0032] The lightweight industrial gateways configured on each edge computing node possess high-speed data transmission and stable communication capabilities, effectively ensuring the timeliness and accuracy of operational data acquisition. These lightweight industrial gateways integrate industrial Ethernet protocol stacks such as MMS, Profinet, EtherCAT, and Modbus TCP, enabling communication with PLCs of different brands and generations. One edge computing node is deployed next to each critical process device, directly connected to the device's PLC via an industrial Ethernet cable. For mobile devices such as AGVs, industrial-grade wireless access points (APs) are used to achieve stable connections with the edge nodes.

[0033] The Link Layer Discovery Protocol (LLDP) is a link layer neighbor discovery protocol defined by the IEEE 802.1AB standard. It allows network devices to advertise their own identifiers, capabilities, and neighbor information to neighboring devices. In implementation, LLDP is used to automatically discover the physical connection relationships between edge computing nodes and PLCs of key process equipment. After each edge computing node starts up, it periodically sends LLDP data unit messages through its industrial gateway module. The message content includes the node's unique device identifier, port identifier, system name, system capabilities, etc. The edge node simultaneously listens for LLDP messages sent by other devices in the network and parses the identifier information and connection ports of neighboring devices from the received messages. Through the exchange of LLDP messages, each edge node can learn about: the devices directly connected to it, the MAC addresses and port numbers of the directly connected devices, and the type and basic capabilities of the devices. The neighbor information collected from all edge nodes is aggregated and can be negotiated between edge nodes or reported to the central coordinator to construct a complete physical connection topology graph, G_physical=(V,E), where V is the set of nodes, including all edge nodes and PLCs of key process equipment, and E is the set of edges, representing the physical direct connections between nodes, with each edge including connection port information. Automatic discovery via LLDP eliminates the need for manual network topology input, enabling plug-and-play devices and dynamic network topology awareness. The topology is automatically updated when device locations change or network structures are adjusted.

[0034] Manufacturing Message Specification Protocol (MMS) is an application layer protocol for industrial automation defined by the ISO 9506 standard. It is used to enable remote read and write operations on industrial equipment such as PLCs. MMS provides a standardized object model and services, supporting access to device variables, programs, events, and more.

[0035] Based on the established physical connection topology, the edge node sends an identification request to the PLC of each adjacent device via the MMS protocol. The PLC response message contains information such as manufacturer name, model name, serial number, hardware version, and firmware version. The edge node parses the response message to determine the device type and communication protocol version. The device type includes the corresponding PLC model for devices such as pick-and-place machines and reflow ovens.

[0036] Based on the device type, the edge node loads the default register address mapping template for that type of device from a locally pre-configured device template library. The template library contains key parameter register address configurations for common device models. For devices not covered in the template library, or addresses that need verification, the edge node performs a probing read using the MMS read service and determines the address's correctness based on the return value.

[0037] The obtained physical connection topology, device type identification results, and register address scan results are aggregated to generate a device record, thereby constructing a device communication topology mapping table. This table is stored in the local time-series database of each edge node and backed up to the configuration database of the central server. Edge nodes periodically, or when communication anomalies are detected, re-execute LLDP discovery and MMS scans to update the mapping table, ensuring that topology changes and device parameter variations are detected in a timely manner.

[0038] Time-Sensitive Networking (TSN) is a series of sub-standards defined by the IEEE 802.1 task group, designed to provide deterministic low-latency transmission guarantees for Ethernet. This implementation utilizes key mechanisms of TSN to ensure the real-time and deterministic nature of data acquisition. Edge nodes and network switches are configured to support gPTP (Generalized Precision Time Protocol) to achieve nanosecond-level clock synchronization across the entire network. Edge nodes act as slave clocks, synchronizing with the central switch, which acts as the master clock, ensuring consistent time bases across all nodes. Based on preset device priorities according to device type in the device communication topology mapping table, fixed time slots are allocated to each data acquisition stream. A time-aware shaper is configured to divide the time axis into recurring periods, such as 100ms periods. High-priority data, such as pick-and-place machine position data, is allocated within each period, with dedicated time slots reserved to ensure it is unaffected by network congestion. Network bandwidth is reserved for each periodic data acquisition stream to ensure that the acquisition cycle requirements can still be met under full load. The maximum latency of each data stream is guaranteed to be within a preset threshold, such as less than 5ms, through path calculation and resource reservation. Time-sensitive network configuration ensures the determinism and reliability of data acquisition, avoids acquisition delays or packet loss caused by network conflicts, and provides a basic guarantee for the real-time update of the digital twin.

[0039] The operating data of key process equipment refers to the raw physical quantity data collected in real time from the PLC of each equipment through the MMS protocol. It reflects the current working status and operating parameters of the equipment, including the position coordinates of the pick-and-place machine nozzle, the temperature values ​​of each zone of the reflow oven, the defect detection results of the automatic optical inspection equipment, and the battery power and position coordinates of the automatic guided transport vehicle.

[0040] In this embodiment, preprocessing includes timestamp alignment and standardization. Timestamp alignment aligns data collected from different devices according to a unified time base, ensuring data consistency in the time dimension for subsequent analysis and processing. Standardization transforms the raw physical quantity data from different devices according to certain rules, giving them the same dimensions and range, eliminating differences between data from different devices, and improving data comparability and usability. For example, temperature data can be converted to a unified Celsius or Fahrenheit; location coordinate data can be converted to coordinate values ​​in a unified coordinate system. After preprocessing, the running data is concatenated according to a preset dimensional order to obtain the original state vector, which is stored in the time-series database of the edge nodes, using a columnar storage format to improve compression ratio and query efficiency.

[0041] Step S20: Construct a spatiotemporal predictive digital twin based on the device communication topology mapping table and the original state vector, and obtain an enhanced state vector by predicting production line data through the spatiotemporal predictive digital twin.

[0042] It should be noted that a spatiotemporal predictive digital twin refers to a digital mirror model built on heterogeneous spatiotemporal network graphs and spatiotemporal graph neural networks, capable of simultaneously capturing the spatial dependencies and temporal evolution patterns of production line equipment. It not only reflects the current state of the production line but also possesses the ability to predict its future evolutionary trends. The heterogeneous spatiotemporal network graph is a data model that maps the physical entities of a PCBA production line to a graph structure. The spatiotemporal graph neural network is a deep learning model composed of stacked graph convolutional layers and gated temporal convolutional layers, capable of simultaneously capturing the spatial dependencies and temporal evolution patterns of the graph structure, and is the core prediction engine of the spatiotemporal predictive digital twin.

[0043] Production line data prediction refers to inputting the original state vector of the current moment into a spatiotemporal predictive digital twin, and outputting the predicted state vector of the key state of the production line within a preset time window through multi-step rolling forward reasoning, including the equipment health degradation trend curve and the congestion propagation path data of products in the buffer area.

[0044] An enhanced state vector is an extended state representation that includes time-dimensional information, generated by feature-level fusion of the original state vector and the predicted state vector.

[0045] In one feasible implementation, step S20 may include: mapping the physical entities of the printed circuit board assembly line into a heterogeneous spatiotemporal network graph based on the device communication topology mapping table, wherein the node set of the heterogeneous spatiotemporal network graph includes device nodes, buffer zone nodes, and order nodes, and the edge set represents material flow relationships and energy coupling relationships; constructing a spatiotemporal predictive digital twin based on the spatiotemporal graph neural network model and the heterogeneous spatiotemporal network graph, wherein the spatiotemporal graph neural network model is composed of stacked graph convolutional layers and gated temporal convolutional layers; inputting the original state vector into the spatiotemporal predictive digital twin, generating a predicted state vector through multi-step rolling prediction, wherein the predicted state vector includes at least the health degradation trend curve of each device within a future preset time window and the product congestion propagation path data of each buffer zone; fusing the predicted state vector and the original state vector to obtain an enhanced state vector.

[0046] It should be noted that the heterogeneous spatiotemporal network graph refers to a data model that maps the physical entities of a PCBA production line into a graph structure. It consists of a node set, an edge set, a node feature matrix, and an edge weight matrix. The node set includes equipment nodes, buffer nodes, and order nodes. The edge set represents material flow relationships and energy coupling relationships. The node feature matrix consists of a feature vector associated with each node, containing the node's attribute information. The edge weight matrix consists of a weight value associated with each edge, reflecting the strength or importance of the connection. The weights of material flow edges are dynamically updated based on the historical average transmission rate; the weights of energy coupling edges are determined based on the energy consumption ratio between equipment; and the weights of order-related edges are dynamically adjusted based on order priority. Material flow edges represent the flow relationship of work-in-process between equipment and the buffer, forming the backbone connection of the PCBA production line. They point from upstream equipment nodes to downstream buffer nodes, or from buffer nodes to downstream equipment nodes, forming a chain structure of "equipment → buffer → equipment". Energy coupling edges represent energy interaction or sharing relationships between equipment, such as reflow ovens and exhaust fans, or air compressors and multiple placement machines. These are bidirectional edges, indicating mutual energy influence.

[0047] The graph structure data of the heterogeneous spatiotemporal network is stored in the temporal database of the edge nodes in the form of tensors. The spatiotemporal graph neural network model consists of stacked graph convolutional layers and gated temporal convolutional layers. The graph convolutional layers are used to aggregate features of neighboring nodes along the edge set of the heterogeneous spatiotemporal network graph, capturing the spatial dependencies between devices, as shown in the following equation: in, The degree matrix of the heterogeneous spatiotemporal network graph. It is an adjacency matrix. For the first l The node feature matrix of the layer graph convolutional layer, For the first l The trainable weight matrix of a layered graph convolutional layer For activation function, For the first l +1 layer graph convolutional layer node feature matrix.

[0048] To differentiate the importance of different neighboring nodes, an attention mechanism is introduced into the graph convolutional layer, assigning a learnable attention coefficient to each edge, as shown in the following equation: in, Let represent the attention coefficient of node i to node j. Let i be the set of neighboring nodes. Let i be a neighboring node. This is a learnable attention parameter vector. and Let be the feature transformation matrices of node i and node j, respectively, and LeakyReLU be the activation function.

[0049] This attention mechanism allows the model to focus more on important neighboring nodes when aggregating features of neighboring nodes, thereby improving the model's performance.

[0050] Gated temporal convolutional layers are used to capture the evolution of equipment states over time, employing a structure combining dilated causal convolutions and gated linear units (GLUs). Dilated causal convolutions expand the receptive field without increasing the number of parameters by inserting holes between convolutional kernels; the dilation rate *d* increases exponentially layer by layer (e.g., 1, 2, 4, 8), enabling the model to capture long-term temporal dependencies. GLUs control the flow of information. The spatiotemporal graph neural network model, by stacking multiple graph convolutional layers and gated temporal convolutional layers, can simultaneously capture the spatial dependencies between devices and the evolution of equipment states over time, thereby achieving dynamic scheduling and optimization of the PCBA production line.

[0051] In the specific implementation, the historical original state vector sequence of T consecutive time steps is extracted from the time series database and converted into a node feature matrix sequence. The actual observation data of the T time steps after the corresponding time step is used as labels to construct training data. The spatiotemporal graph neural network model is trained using the mean squared error loss function. The model parameters are updated through the backpropagation algorithm until the model converges, and the trained spatiotemporal graph neural network model is obtained. The heterogeneous spatiotemporal network graph structure data, the trained ST-GNN model parameters, and the data fusion module are integrated to form a complete spatiotemporal predictive digital twin.

[0052] Spatiotemporal predictive digital twins require training before use. During training of the spatiotemporal graph neural network model, the input time step T... in Take 10, which corresponds to the past second. Each step is 100ms. Output the time step T. out The model uses a value of 20, corresponding to the next 2 seconds. The node feature dimension F is set to 64. The graph convolutional layers are set to 3, with each layer followed by batch normalization and ReLU activation. The graph attention heads are set to 4. The gated temporal convolution kernel size is 3, and the dilation rate is set to 1, 2, and 4 for each layer. The optimizer uses the Adam adaptive moment estimation optimizer, with an initial learning rate of 0.001 that decays by a factor of 0.5 every 50 training epochs. The maximum number of training epochs is 200. Early stopping is employed, meaning training is terminated if the verification loss does not decrease for 20 consecutive epochs. The joint loss function of the spatiotemporal graph neural network model is as follows: The first item is the mean squared error loss in equipment health prediction. This represents the number of device nodes. To predict health status, The first term represents the actual health status, and the second term represents the cross-entropy loss from congestion location prediction. C=3 represents the number of buffer nodes and the congestion level, i.e., normal, congested, and severe congestion. For one-hot tags, The third term is an L2 regularization term used to predict probabilities. Here is the set of model parameters, where λ1=0.6, λ2=0.3, and λ3=0.1 are the balance coefficients.

[0053] The spatiotemporal predictive digital twin can receive real-time raw state vectors and update the node features of heterogeneous spatiotemporal network graphs; perform graph convolution message passing along material flow edges and energy coupling edges to infer the mutual influence between devices; predict future states based on historical evolution patterns through gated temporal convolution; and trigger online retraining when the prediction error exceeds the threshold to adapt to dynamic changes in the production line.

[0054] The original state vector at the current moment is read from the edge node time series database and mapped to the node feature matrix of the heterogeneous spatiotemporal network graph. The specific mapping rules are as follows: for device nodes, the part of the original state vector corresponding to the device state, such as load rate and temperature value, is assigned to the dynamic feature of the corresponding node; for buffer nodes, the part of the original state vector corresponding to the buffer queue length is assigned to the corresponding node. Extract features and assign values ​​from the latest order data synchronized from the Enterprise Resource Planning system at the order node.

[0055] A rolling prediction method is used to generate a prediction sequence for the next T time steps. At each time step, the node feature matrix at the current moment is input into a trained spatiotemporal graph neural network model. The model aggregates the features of neighboring nodes through graph convolutional layers to capture the spatial dependencies between devices, and then predicts the device state at the next moment based on historical evolution patterns through gated temporal convolutional layers, outputting a sequence of predicted node feature matrices for the next T time steps. The predicted node feature matrix sequence is then inversely mapped to a sequence of predicted original state vectors for the next T time steps. The predicted values ​​for device nodes include dynamic parameters such as load rate and temperature, the predicted value for buffer nodes is the queue length, and the predicted values ​​for order nodes are state parameters dynamically adjusted according to order priority. By comparing the mean squared error between the predicted sequence and the actual observed sequence, when the error exceeds a preset threshold, the latest data is extracted from the time-series database to construct an incremental training set. The model parameters are then updated online using mini-batch gradient descent. During the update process, the attention parameters of the graph convolutional layers are frozen, and only the weight matrix of the gated temporal convolutional layers is optimized. After the update, the predicted sequence is regenerated. From the predicted sequence, the health degradation trend curves of each device within a preset future time window and the product congestion propagation path data of each buffer zone are extracted to construct a predicted state vector. Device health is a value between 0 and 1, where 1 represents fully healthy equipment and 0 represents completely failed equipment. The health degradation trend curve describes the predicted trajectory of device health decreasing over time.

[0056] Extract device node health indicators from the predicted node features at each time step. As shown in the following formula: in, This refers to the equipment's uptime since the last maintenance. Mean time between failures (MTBF) is the equipment's average time between failures (MTBF). The ratio of MTBF to MTBF reflects the degree of fatigue damage accumulated by the equipment due to prolonged operation. This represents the energy consumption of the device at the current moment. This ratio represents the equipment's rated energy consumption and reflects the impact of equipment energy utilization efficiency on health status. The standard deviation of the equipment's temperature at the current moment. This ratio represents the maximum permissible standard deviation of the equipment's temperature; it measures the potential threat to health posed by equipment temperature fluctuations. , , These are the weighting coefficients for the three factors mentioned above.

[0057] Connect the health values ​​of all time steps in the predicted sequence in chronological order to form a degradation trend curve.

[0058] The product congestion propagation path describes the direction and intensity of congestion spread between buffer zones, reflecting how congestion propagates along the production line. The queue length q of the buffer zone nodes is extracted from the predicted node features at each time step. b (t), calculate the congestion propagation intensity between adjacent buffer zones, as shown in the following formula: in, This represents the change in queue length of buffer j between time step t-1 and t. This represents the change in queue length of buffer i at time step t-1. This represents the weight of the material flow edge.

[0059] At each time step, the propagation intensity of all adjacent buffer pairs is calculated to form a directed weighted graph, which identifies the main propagation path of congestion.

[0060] The original state vector and the predicted state vector are fused at the feature level to generate an enhanced state vector.

[0061] Step S30: Based on the enhanced state vector, send a detection command to the physical entity of the key process equipment and observe the response difference, and perform physical virtual bidirectional calibration to obtain the calibrated state vector.

[0062] It should be noted that a physical entity refers to a collection of real hardware devices, material carriers, and actuators in a PCBA production line that can perform production tasks and undergo physical state changes. It is the mapping object of the digital twin and the direct target of detection commands. In the PCBA production line scenario of this embodiment, a physical entity refers to the programmable logic controller (PLC) and its controlled mechanical components deployed in pick-and-place machines, reflow ovens, automated optical inspection equipment, and automated guided vehicles (AGVs). For example, the physical entity of a pick-and-place machine includes a servo motor controlling the nozzle movement, an encoder detecting the nozzle position, and a pneumatic valve controlling vacuum suction; its PLC stores operating parameters such as nozzle position coordinates and placement speed. The physical entity of a reflow oven includes heating elements for each temperature zone, temperature sensors, and conveyor belt motors; its PLC stores parameters such as the actual temperature of each zone and conveyor belt speed. The physical entity of an AGV includes a drive motor, battery management system, and LiDAR; its PLC stores parameters such as battery level, position coordinates, and operating speed.

[0063] A probe command is a micro-amplitude control signal sent by an edge computing node to the PLC of a physical entity via a manufacturing message specification protocol. This signal is used to actively stimulate the physical system to generate a response. Its design follows the principle of "micro-disturbance, no impact on production," aiming to verify the prediction accuracy of the digital twin by observing the physical response.

[0064] The observed response discrepancy refers to the deviation between the actual response data generated by the physical entity after receiving a probe command and the virtual response data predicted by the digital twin based on the current enhanced state vector. This discrepancy is used to quantify the degree of consistency between the twin and the physical entity.

[0065] Physical-virtual bidirectional calibration refers to the process where, when the physical-virtual consistency index falls below a preset threshold, actual response data is used as a label to update the parameters of the digital twin model through a backpropagation algorithm. This allows the twin's predictions to gradually approximate the actual response of the physical entity, thus achieving "physical → virtual" calibration. The calibrated twin then generates a virtual response that matches the actual response, completing the "virtual → physical" alignment. This closed-loop process of "detection-comparison-update-alignment" is called bidirectional calibration.

[0066] The physical virtual consistency index is a dimensionless value between 0 and 1, used to quantify the degree of agreement between the digital twin prediction and the actual response of the physical entity. The closer the index is to 1, the higher the consistency between the twin and the physical entity. When the index is below the threshold, it indicates that there is a significant deviation in the twin and calibration needs to be triggered.

[0067] In one feasible implementation, step S30 may include: sending a probe command to the programmable logic controller of the physical entity of the key process equipment through a manufacturing message specification protocol, and collecting the actual response data of the physical entity under the action of the probe command, wherein the probe command includes at least a chip placement head speed adjustment command, a reflow soldering temperature setpoint adjustment command, and an automated guided vehicle running speed adjustment command; determining a physical virtual consistency index based on the actual response data and the enhanced state vector; when the physical virtual consistency index is lower than a preset consistency threshold, updating the model parameters of the spatiotemporal predictive digital twin through a backpropagation algorithm until the physical virtual consistency index reaches or exceeds the preset consistency threshold, thereby obtaining a calibrated spatiotemporal predictive digital twin; generating virtual response data matching the actual response data based on the calibrated spatiotemporal predictive digital twin, and aligning the virtual response data with the actual response data to obtain a calibrated state vector.

[0068] It should be noted that this implementation utilizes the Manufacturing Message Specification Protocol (MMS) to send detection commands and transmit response data. The programmable logic controller (PLC) is the core control unit of industrial equipment, responsible for receiving commands, driving actuators, collecting sensor data, and communicating with edge nodes via industrial networks.

[0069] It is understood that the detection commands in this embodiment include at least the chip mounter speed adjustment command, used for the Z-axis mounting speed of the chip mounter, with an adjustment range of ±1% of the rated speed; the reflow soldering temperature setting adjustment command, used for fine-tuning the temperature of each temperature zone of the reflow oven, with an adjustment range of ±0.5% of the set temperature; and the automated guided vehicle (AGV) running speed adjustment command, used to change the AGV's travel speed, with an adjustment range of ±2% of the rated speed. These detection commands all follow the principle of "minor disturbances without affecting production," ensuring that while verifying the prediction accuracy of the digital twin, they do not interfere with the normal production of the PCBA production line.

[0070] By using the Manufacturing Message Specification Protocol (MMS), edge computing nodes can accurately send these probe commands to the programmable logic controllers of physical entities and collect the actual response data of physical entities under the action of probe commands in real time.

[0071] The predicted portion corresponding to the detection command is extracted from the enhanced state vector. The enhanced state vector contains the predicted output for the current moment. For the patch head speed adjustment command, the predicted speed response of the patch head corresponding to the device health degradation trend curve is extracted from the enhanced state vector. The predicted response is sampled along the same time axis as the actual measurement to generate a virtual response curve. The deviation vector between the virtual response and the actual response is calculated. The physical virtual consistency index is obtained by calculating the L2 norm of the deviation vector. This index comprehensively reflects the degree of agreement between the digital twin prediction and the actual response of the physical entity. After obtaining the physical virtual consistency index, it is compared with a preset consistency threshold. If the index is lower than the threshold, it indicates that there is a significant difference between the prediction result of the digital twin and the actual response of the physical entity, and a calibration process needs to be initiated.

[0072] Specifically, edge computing nodes use actual response data as training labels and iteratively update the model parameters of the digital twin through a backpropagation algorithm. During this process, the model continuously adjusts its internal parameters to minimize the deviation between the predicted and actual responses until the physical-virtual consistency index reaches or exceeds a preset threshold. After calibration, the digital twin generates virtual response data that highly matches the actual response, and ensures temporal synchronization through timeline alignment, ultimately outputting a calibrated state vector. This vector not only reflects the current state of the physical entity but also incorporates the predictive capabilities of the digital twin, providing more accurate decision-making support for subsequent production control. The entire calibration process is implemented through a closed-loop feedback mechanism, ensuring that the digital twin can continuously track the dynamic changes of the physical entity and maintain high-precision predictive performance.

[0073] Step S40: Train the corresponding local scheduling strategy model based on the calibrated state vector stored locally on each edge computing node, and upload the model gradient parameters and contribution proof to the central server based on contract theory, so that the central server can perform weighted federated aggregation based on contract weights and reputation values ​​to obtain a global scheduling strategy model and distribute it to each edge node.

[0074] It should be noted that the local scheduling strategy model refers to a deep reinforcement learning model deployed on each edge computing node, trained based on calibrated state vectors stored locally, used to generate optimal scheduling decisions based on the current production line status. Each edge node independently maintains its own local model and evolves collaboratively with the central server and other nodes through federated learning.

[0075] Contract theory refers to the design of incentive mechanisms to encourage participants to disclose true information and take desired actions under conditions of information asymmetry. In this implementation, contract theory is used for incentive design in federated learning. The central server publishes multiple contract options, and each edge node autonomously selects a contract based on its own data quality and computing power, thereby obtaining different aggregation weights and rewards.

[0076] A central server refers to one or more high-performance servers deployed in an enterprise's private cloud or edge data center. It is responsible for coordinating the federated learning process across edge nodes, including publishing contracts, aggregating model parameters, updating node reputation values, and distributing the global model. The central server does not handle any raw data; it only processes encrypted model gradients.

[0077] Model gradient parameters refer to the vector of partial derivatives of the loss function with respect to the parameters of each network layer, calculated during the training process of the local scheduling strategy model. This is core information transmitted in federated learning. Contribution proof refers to the credentials submitted by a node proving its contribution to the convergence of the global model, encompassing comprehensive information such as data quality, model improvement, and participation duration.

[0078] Contract weight refers to the initial aggregation weight coefficient that a node receives based on the selected contract, reflecting the contract's intrinsic value. Reputation score refers to the credibility rating accumulated by a node over long-term participation, dynamically updated based on historical contributions and behavioral performance. Both together determine the node's final weight in the federated aggregation.

[0079] Weighted federated aggregation refers to the process by which the central server collects the model gradients uploaded by each edge node, performs a weighted average based on the weight coefficient of each node, and generates global model parameters. This is the core step of federated learning, ensuring that high-quality nodes have a greater impact on the global model.

[0080] The global scheduling strategy model refers to a scheduling strategy model generated by the central server after multiple rounds of federated learning, which integrates the knowledge of all edge nodes. This model has broader generalization capabilities and can adapt to the scheduling needs of different production lines and operating conditions. It is distributed to each edge node as the initial parameters of the local model to guide subsequent scheduling decisions. The global scheduling strategy model and the local scheduling strategy model have the same network structure, namely a policy network + a value network, so that nodes can be seamlessly loaded.

[0081] In one feasible implementation, step S40 may include: constructing a sample set of Markov decision process state transitions based on the calibrated state vectors stored locally by each edge computing node; training the local resource scheduling strategy model of each edge computing node using a near-end policy optimization algorithm based on the sample set, setting pruning parameters, training a preset number of rounds, determining the model gradient parameters and the validation set accuracy improvement value, and using the validation set accuracy improvement value as the data quality proof of the corresponding edge computing node; obtaining a set of contracts published by the central server, autonomously selecting and signing contracts from the contract set according to the data quality proof of each edge computing node, obtaining contract weights, wherein each contract in the contract set includes a data quality level and... The model is configured with corresponding contract weights; a Monte Carlo sampling method is used to determine the Shapley value of the local resource scheduling strategy model, and a comprehensive contribution is generated based on the data quality proof, the Shapley value, and the node online duration; the model gradient parameters and the contribution proof are submitted to the central server, so that the central server can verify the gradient authenticity based on the model gradient parameters, and after the verification is passed, accumulate and calculate the node reputation value, perform weighted federated aggregation based on the contract weights and the node reputation value, obtain the global scheduling strategy model, and distribute it to each edge node.

[0082] It should be noted that the Markov Decision Process (MDP) is a mathematical framework for sequential decision-making, consisting of a state space, an action space, state transition probabilities, a reward function, and a discount factor. In the implementation, the MDP is used to model the scheduling decision problem of a PCBA production line, abstracting each moment of the production process as a state, scheduling decisions as actions, and production performance as rewards.

[0083] A continuous sequence of calibrated state vectors is extracted from the temporal database of edge nodes and arranged chronologically as the input to the state space of a Markov decision process (MDP). Simultaneously, the action space is defined as the various scheduling operations executable on the production line, such as equipment start-up and shutdown, material allocation, and process parameter adjustment. State transition probabilities are obtained by analyzing historical production data and statistically calculating the probability of transitioning to the next state after performing a specific action in different states. The reward function is set according to production goals, such as improving production efficiency, reducing defect rates, and reducing energy consumption. Positive rewards are given when the executed action improves production performance in the direction of the goal, and negative rewards are given otherwise. A discount factor is used to balance the importance of current and future rewards, with a value between 0 and 1. Based on the defined MDP framework, the continuous sequence of calibrated state vectors extracted from the temporal database provides rich state information for constructing a sample set. Combined with the scheduling actions executed in actual production and the corresponding production performance feedback, complete sample data is formed to train the local resource scheduling strategy model, enabling the model to learn which scheduling actions to take in different states to achieve optimal production performance.

[0084] Understandably, proximal policy optimization is a deep reinforcement learning algorithm that achieves efficient policy optimization while ensuring training stability by pruning the magnitude of policy updates. This algorithm employs two independent policy networks and a value network. The policy network is responsible for generating scheduled actions, while the value network is responsible for evaluating the value of the current state. The two work together to improve the model's decision-making ability and convergence speed.

[0085] During training, setting appropriate pruning parameters can prevent training instability caused by excessive policy updates. Simultaneously, training through a predetermined number of epochs allows the model to gradually learn the optimal scheduling strategy. After training, data quality is evaluated based on the model's accuracy improvement on the validation set. A higher accuracy improvement indicates a greater contribution of the edge node's data to model training, and this improvement is used as proof of data quality for subsequent contract selection.

[0086] The central server publishes a set of contracts with various data quality levels and corresponding contract weights. Each edge node autonomously selects and signs the most suitable contract from the set based on its own data quality proof. The contract weights are designed to incentivize edge nodes to provide high-quality data; nodes with higher data quality receive greater contract weights and have a greater impact on the global model during federated aggregation. The central server publishes a set of contracts with N predefined contract options, each corresponding to a data quality level range and a fixed contract weight. In this implementation, N=4, meaning the contract levels include A, B, C, and D, with corresponding data quality level ranges of ΔAcc≥15%, 10%≤ΔAcc<15%, 5%≤ΔAcc<10%, and ΔAcc<5%, respectively. ΔAcc represents the improvement in validation set accuracy, and the corresponding contract weights are 0.4, 0.3, 0.2, and 0.1, respectively. Level A has the highest aggregation priority, and Level D has the lowest. Contracts are deployed on the permissioned blockchain using smart contracts, and each edge node queries the list of available contracts via a remote procedure call interface. Nodes autonomously select and sign contracts based on their own validation set accuracy improvement value, and the signing record is stored on the blockchain.

[0087] The Shapley score is an indicator used to measure the contribution of participants in cooperative games. Using the Monte Carlo sampling method to determine the Shapley score of the local resource scheduling strategy model can comprehensively consider various contribution factors of nodes during model training. Combining data quality proof, Shapley score, and node online duration to generate a comprehensive contribution proof can more comprehensively and objectively reflect the actual contribution of nodes to the convergence of the global model. The data quality proof reflects the direct value of the data provided by the node to model training; the Shapley score measures the comprehensive role of the node in the model building process from a cooperative game perspective; and the node online duration reflects the persistence and stability of the node's participation in federated learning. These three factors complement each other and together constitute a complete system for evaluating node contributions.

[0088] After receiving the model gradient parameters and contribution proofs submitted by each edge node, the central server first verifies the gradient authenticity of the model gradient parameters to ensure that the uploaded gradient parameters have not been tampered with and meet the training requirements. The gradient authenticity verification steps include: the central server receiving the model gradient parameters θ uploaded by the edge nodes. k And contribution proof P k ; Call the blockchain light node verification module to verify the contribution proof P k The Shapley value S included k and data quality label q k Does it exist in the permissioned chain ledger? Calculate the gradient residual, i.e., using the verification set D held by the central server. val Calculate the global model θ global In Dval gradient g of the loss function on global and the weighted upload gradient The comparison is performed as follows: in, Upload the residual of the gradient to the k-th edge node. The gradient of the loss function of the global model on the validation set. The gradient uploaded after weighting the k-th edge node.

[0089] If gradient residual If the value is less than a preset threshold, such as 0.05, the model gradient parameters uploaded by the edge node are considered valid. After successful verification, a reputation value update is performed. The node reputation value is dynamically updated based on historical contributions and behavioral performance, which can incentivize nodes to maintain high-quality participation over the long term. In this implementation, the node reputation value is dynamically updated using an accumulation mechanism. The reputation value after the (t+1)th round of federated learning is: in, It is the reputation value of the i-th edge node after the (t+1)-th round of federated learning. It is the reputation value of the i-th edge node before the t-th round of federated learning. The overall contribution in this round is represented by a value ranging from [0,1]. This represents the reputation update rate, with a value of 0.1.

[0090] The updated reputation value is subject to boundary constraints: R i =max(0.5,min(2.0,R i )).

[0091] Overall contribution The calculation formula is: in, To prove the quality of the normalized data, The normalized Shapley value was calculated using the Monte Carlo sampling method with M=100 samples. The normalized node online duration, The contract fulfillment rate is 1 if the commitment is fulfilled, and 0 otherwise. q =0.3, w =0.4, w t =0.2, w f =0.1 is the weighting coefficient.

[0092] After successful verification, the central server incorporates the gradient into the aggregation calculation; gradients that fail verification are discarded, and abnormal behavior is recorded. A node that fails verification three times consecutively has its reputation value reduced by 0.2. The specific calculation formula for the weighted federated aggregation by the central server based on contract weight and node reputation value is as follows: in, Here are the aggregated global model parameters, and K is the total number of edge nodes participating in this round of aggregation. Let be the contract weight of the k-th edge node, and its value is determined based on the contract level signed by the node. Let be the current reputation value of the k-th edge node. The local model gradient parameters uploaded for the k-th edge node. α is a moderating factor used to balance the influence ratio between contract weight and reputation value, and satisfies α + β = 1. The Hadamard product of a tensor is represented by the element-wise multiplication.

[0093] Through weighted federated aggregation, the central server generates a global scheduling strategy model. This model integrates the knowledge and experience of all edge nodes, possessing broader generalization capabilities and higher decision-making accuracy. Finally, the central server distributes the global scheduling strategy model to each edge node as initial parameters for their local models, guiding subsequent scheduling decisions. Upon receiving the global model, each edge node can seamlessly load it and continue local training and optimization, forming a closed-loop feedback mechanism that ensures the digital twin can continuously track the dynamic changes of the physical entity, maintaining high-precision predictive performance.

[0094] Step S50: Based on the calibrated state vector and the global scheduling strategy model, construct a multi-time-scale hierarchical scheduling controller, generate collaborative scheduling instructions across the strategic, tactical, and execution layers, and issue the collaborative scheduling instructions to the production line execution units for collaborative scheduling.

[0095] It should be noted that the multi-timescale hierarchical scheduling controller refers to an intelligent control architecture that decomposes the PCBA production line scheduling problem into three interrelated layers—strategic, tactical, and execution—based on different decision cycles and levels. Each layer is optimized at different time scales, and global coordination is achieved through inter-layer information exchange. This controller takes the calibrated state vector as input and is guided by a global scheduling strategy model to generate collaborative scheduling instructions covering long, medium, and short-term timeframes.

[0096] Understandably, the time-scale hierarchical scheduling controller consists of a strategic layer scheduler, a tactical layer scheduler, and an execution layer scheduler. The strategic layer scheduler is the top layer of the multi-time-scale hierarchical scheduling controller. It continuously optimizes the work order deployment plan for the future preset planning duration over a relatively long time period, outputting a coarse-grained plan. The strategic layer focuses on macro-level decisions such as capacity planning and order sequencing, providing constraint boundaries for the lower layers. The tactical layer scheduler is the middle layer of the multi-time-scale hierarchical scheduling controller. It receives the coarse-grained plan from the strategic layer as constraints over a shorter time period. Combining this with the current production line status, it solves the Lyapunov drift plus penalty plus risk optimization problem, generating medium-grained instructions. The tactical layer focuses on medium-term decisions such as equipment allocation and load balancing. The execution layer scheduler is the bottom layer of the multi-time-scale hierarchical scheduling controller. It receives the medium-grained instructions from the tactical layer over an extremely short period. Combining this with the real-time equipment status, it optimizes micro-level action parameters, generating fine-grained control signals. The execution layer focuses on real-time decisions such as nozzle selection, path planning, and temperature control.

[0097] Coordinated scheduling instructions are comprehensive instruction packages that integrate coarse-grained plans at the strategic level, medium-grained instructions at the tactical level, and fine-grained control signals at the execution level, ensuring consistency and coordination from long-term planning to real-time control. The instruction package includes a timestamp, version number, and checksum, and is distributed to each execution unit via a time-sensitive network.

[0098] In one feasible implementation, after step S50, the process may further include: during the execution of the collaborative scheduling instruction, collecting execution status data in real time through a sensor network deployed at the key process equipment; performing anomaly detection based on the execution status data using a network model to determine whether a disturbance event exists; if a disturbance event exists, calculating the causal effect intensity of the disturbance source node on downstream nodes along the material flow edge and energy coupling edge using backpropagation of a spatiotemporal graph neural network based on a heterogeneous spatiotemporal network graph; determining the set of affected nodes and the rescheduling time window based on the causal effect intensity; and generating a local rescheduling instruction based on the set of affected nodes and the rescheduling time window and issuing it to the corresponding production line execution unit.

[0099] It should be noted that sensor networks refer to the collective term for various sensors and their data acquisition systems deployed on key process equipment in PCBA production lines. This includes sensors embedded in the equipment and additionally deployed monitoring sensors, used to perceive the real-time operating status of physical entities. Execution status data refers to the actual operating data collected by the sensor network during the execution of collaborative scheduling instructions on the production line, reflecting the true effect of instruction execution.

[0100] After the coordinated scheduling command is issued to the PLC, the PLC begins to execute the command, such as moving the pick-and-place machine or adjusting the temperature. Edge nodes record the command issuance time and command content. Based on the command type, the edge nodes initiate the corresponding sensor data acquisition task. The acquisition time window covers the entire command execution process, including the 100ms before execution, during execution, and the 100ms after execution. Data from different sensors at the same time are timestamped and fused into a unified execution status data vector.

[0101] Anomaly detection refers to identifying deviations from normal production line operation based on execution status data using machine learning algorithms, and marking potential disturbance events. Disturbance events are unexpected events that may lead to production interruptions, quality degradation, or efficiency reduction, including equipment failures, material anomalies, order insertions, and quality defects. This implementation uses the Isolation Forest algorithm for unsupervised anomaly detection. This algorithm is based on the principle that outliers are more easily isolated through random segmentation, resulting in shorter path lengths in the tree structure.

[0102] From the execution status data, a feature and a segmentation value are randomly selected, and the data is recursively segmented until each leaf node contains only one sample or the tree depth limit is reached, constructing multiple isolated trees. In this embodiment, t=100 trees. For each sample, its average path length across all isolated trees is determined. The shorter the average path length, the greater the probability that the sample is an outlier. By setting an appropriate threshold, samples with an average path length less than the threshold are identified as outliers, thereby identifying disturbance events in the production line operation.

[0103] The causal effect strength refers to the degree of influence of the disturbance source node on the downstream node. It is calculated through backpropagation of the spatiotemporal graph neural network and reflects the path and strength of the abnormal propagation.

[0104] Upon detection of a disturbance event, a rescheduling mechanism is triggered. Based on the anomaly detection results, the node experiencing the disturbance and the time of its occurrence are determined. The characteristics of the disturbed node at the time of the disturbance are modified to an anomalous state value, such as a sudden change in vibration value from 0.12 to 2.5, while keeping the characteristics of other nodes unchanged, thus constructing the disturbance input. The disturbance input is then fed into a pre-trained spatiotemporal graph neural network model, and forward propagation is performed to calculate the predicted output for the next T time steps. With the normal state input into the model, a baseline output is obtained. For each downstream node and each future time step, the disturbance impact is determined based on the baseline output and the predicted output. The disturbance impacts of all downstream nodes and future time steps are aggregated to obtain the causal effect strength of the disturbance event on the overall production line.

[0105] The set of affected nodes refers to the collection of device nodes, buffer nodes, and order nodes that may be affected by the disturbance, selected based on the strength of the causal effect. The rescheduling time window refers to the time range within which rescheduling is required, covering the period from the current moment until the anomaly's impact has largely disappeared.

[0106] Local rescheduling instructions are corrective scheduling instructions generated only for the affected set of nodes and within a specific time window after an anomaly occurs. They aim to minimize local disturbances and avoid the computational overhead and system fluctuations caused by global rescheduling. These instructions are rapidly distributed to execution units via a high-priority channel.

[0107] Within the set of affected nodes and the time window, a simplified optimization problem is constructed with the goal of minimizing the impact of local disturbances on the overall production line, considering multi-dimensional constraints such as equipment status, order priority, and material supply. Heuristic or exact algorithms are used to solve this simplified optimization problem, yielding specific solutions for local rescheduling, including adjustments to equipment operation sequences, optimization of material delivery paths, and changes to order processing sequences. The solved local rescheduling solutions are then transformed into executable instructions and rapidly distributed to the corresponding affected nodes through a collaborative scheduling system. This ensures that the production line can quickly resume stable operation after an anomaly occurs, reducing production downtime and quality losses.

[0108] This embodiment provides a PCBA production control method based on digital twins and edge federated scheduling. By constructing a spatiotemporal predictive digital twin and combining detection commands and a physical-virtual consistency index, dynamic synchronization between the digital twin and the physical entity is achieved, avoiding scheduling errors caused by model inaccuracies. A federated learning framework and a quality-graded contract mechanism are adopted, uploading only encrypted model gradients and not sharing original data. Edge nodes autonomously select contract levels based on local data quality, and the central server performs weighted federated aggregation based on contract weights and reputation values ​​recorded in the permissioned chain. This can prevent malicious node attacks and achieve secure collaborative scheduling across edge nodes. Furthermore, by constructing a multi-timescale hierarchical scheduling controller, collaborative scheduling at different levels is achieved, significantly improving production line operating efficiency.

[0109] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description and will not be repeated hereafter. Based on this, step S50 includes steps S501 to S506: Step S501: Parse the device status data and energy consumption data from the calibrated status vector, and obtain the order status data.

[0110] It should be noted that the order status data is obtained synchronously from the enterprise resource planning system through edge nodes, and includes the priority of each order, remaining processing time, delivery deadline, process path, etc. Equipment status data is calculated based on equipment operating parameters in the calibrated status vector, including the actual processing rate of the pick-and-place machine determined by the rate of change of the nozzle position coordinates, the load rate of each device determined by the current task allocation, the temperature control stability index determined by the deviation between the temperature value and the set value, and the real-time yield determined by the defect detection results. Energy consumption data is calculated based on battery power and equipment operating parameters in the calibrated status vector, including the real-time power consumption of the AGV and the cumulative energy consumption of the pick-and-place machine and the reflow oven.

[0111] Step S502: Calculate the average queue backlog of the sliding window based on the order status data, equipment status data and energy consumption data.

[0112] It should be noted that queue backlog refers to the number of orders or workload waiting to be processed in front of each machine, reflecting the degree of congestion on the production line. Sliding window averaging of queue backlog smooths out the queue backlog within a time window, eliminating the impact of instantaneous fluctuations and obtaining a stable system load index for subsequent Lyapunov optimization.

[0113] Understandably, a virtual queue with delivery date constraints is constructed based on order status data. The queue length is updated according to the order arrival volume and actual processing volume to determine the backlog of the virtual queue with delivery date constraints. The current load rate of each device is determined based on the device status data. The real-time energy consumption level of each device is determined based on the energy consumption data. Based on the backlog of the virtual queue with delivery date constraints, the current load rate of the devices, and the real-time energy consumption level, the average queue backlog of each device within the sliding time window is determined.

[0114] Specifically, the virtual queue backlog due to order delivery constraints, equipment load rate, and real-time energy consumption are weighted and summed. The weights are set according to actual production needs and optimization objectives. For example, if order delivery dates are of greater concern, the weight of the virtual queue backlog due to order delivery constraints is increased; if equipment load balancing is of greater concern, the weight of equipment load rate is increased; and if energy costs are of greater concern, the weight of real-time energy consumption level is increased. The weighted sum is the average queue backlog for each device within the sliding time window. This indicator can comprehensively reflect multiple factors such as order delivery dates, equipment load, and energy consumption, providing more comprehensive system load information for subsequent Lyapunov optimization.

[0115] Step S503: Fit the Pareto front surface based on historical data and calculate the projected distance from the current working point to the Pareto front.

[0116] It should be noted that the Pareto front surface is a surface formed by the set of all non-dominated solutions under given constraints in multi-objective optimization, reflecting the optimal balance achieved among multiple optimization objectives. In this embodiment, historical production data is collected, covering order status, equipment status, energy consumption, and corresponding production efficiency, quality, and other multi-dimensional information under different production scenarios. Using this historical data, a suitable multi-objective optimization algorithm, such as a multi-objective optimization method based on genetic algorithms, is employed to fit the Pareto front surface. This surface can intuitively show how to achieve the optimal combination among multiple objectives such as ensuring order delivery time, balancing equipment load, and reducing energy costs under different production conditions.

[0117] The current operating point represents the position of the current production line's actual operating state in a multi-objective space. It is determined by current order status data, equipment status data, and energy consumption data. Determining the projected distance from the current operating point to the Pareto front aims to quantify the gap between the current production line's operating state and its optimal state. The smaller this projected distance, the closer the current production line's operating state is to the optimal state, and the better the overall performance of the production line. Conversely, a larger projected distance indicates that there is significant room for improvement in balancing multiple objectives, requiring subsequent scheduling optimization to adjust the production line's operating state closer to the Pareto front, thereby improving the overall performance of the production line.

[0118] Step S504: Based on the deviation between the average queue backlog and the target backlog level of the sliding window, and in conjunction with the projection distance, solve the differential equation containing the queue backlog deviation term, the central regression term, and the Pareto distance correction term to obtain the control parameter update amount.

[0119] It should be noted that the deviation between the average queue backlog and the target backlog level in the sliding window reflects the difference between the current load and the expected load of the production line, and this difference is an important basis for scheduling adjustments. The projected distance reflects the gap between the current production line operating state and the optimal state, providing directional guidance for scheduling optimization. By constructing a differential equation that includes a queue backlog deviation term, a central regression term, and a Pareto distance correction term, the influence of these factors on the control parameters can be comprehensively considered. The queue backlog deviation term is used to adjust the production line load to approach the target backlog level; the central regression term is used to ensure the stability of the production line operating state and avoid system fluctuations caused by over-adjustment; and the Pareto distance correction term is used to guide the production line operating state towards the Pareto front, achieving multi-objective optimization. Solving this differential equation, i.e., discretizing the differential equation using the Euler method, yields the updated control parameters. These updated parameters will be used to guide subsequent scheduling adjustments to achieve a significant improvement in production line operating efficiency. The differential equation including the queue backlog deviation term, the central regression term, and the Pareto distance correction term is as follows: in, To control parameter vectors, such as scheduling priority, The average queue backlog for the sliding window at the current moment. The target backlog level is set at 60% of the maximum queue length. This represents the projected distance from the current operating point to the Pareto front. This is the queue deviation feedback coefficient, with a value range of [0.5, 2.0], and a preferred value of 1.0. The Pareto correction intensity coefficient has a value range of [0.1, 1.0], with a preferred value of 0.5. This is the distance attenuation factor, with a value of 0.2. The central regression term is used to suppress system oscillations. This is the regression amplitude coefficient, with a value of 0.01. ω is the angular frequency.

[0120] The above continuous differential equation is discretized into a computer-executable difference equation. First, the discretization time step Δt is set; in this embodiment, it is 10 ms. The differential equation is then... Transform into difference form, according to the Euler method formula: Substituting the specific function (V,t), i.e., the expression on the right side of the above differential equation, we can calculate the control parameter update ΔV: Where ΔV represents the amount of update of the control parameters within the time step Δt.

[0121] Step S505: Superimpose the current Lyapunov optimized control parameters with the updated control parameters, and apply safety boundary constraints and rate of change limits to obtain the adjusted control parameters.

[0122] It should be noted that Lyapunov optimal control parameters play a crucial role in production line scheduling, as they determine the direction and intensity of scheduling strategy adjustments. By superimposing the current Lyapunov optimal control parameters with the updated control parameters obtained by solving differential equations, the control parameters can be dynamically adjusted according to the real-time status of the production line.

[0123] In actual production environments, to ensure the stable operation of the production line and the safety of equipment, control parameters cannot be adjusted without restriction. Therefore, safety boundary constraints and rate-of-change limits need to be applied. Safety boundary constraints prevent control parameters from exceeding the safe operating range of the equipment or system, avoiding equipment failure or production accidents caused by parameters that are too large or too small. Rate-of-change limits ensure the smoothness of parameter adjustments, preventing drastic changes in parameters within a short period, which could cause fluctuations and instability in the production line. By applying these constraints and limits, adjusted control parameters are obtained. These parameters reflect the real-time needs of the production line while ensuring its safe and stable operation, providing an accurate and reliable basis for subsequent scheduling decisions.

[0124] Step S506: Based on the adjusted control parameters and the global scheduling strategy model, construct a multi-time-scale hierarchical scheduling controller, solve the drift plus penalty plus risk optimization problem, generate collaborative scheduling instructions across the strategic layer, tactical layer and execution layer, and issue the collaborative scheduling instructions to the production line execution unit for collaborative scheduling.

[0125] It should be noted that the construction of the multi-timescale hierarchical scheduling controller comprehensively considers the operational characteristics and scheduling needs of the production line at different time dimensions. The strategic layer is responsible for formulating long-term production plans and resource allocation strategies, the tactical layer focuses on medium-term production scheduling and task arrangement, and the execution layer focuses on short-term equipment operation and real-time control. By integrating the adjusted control parameters into the global scheduling strategy model, the organic integration of scheduling tasks at different time scales can be achieved. Solving the drift plus penalty plus risk optimization problem aims to balance various factors in the production process. The drift term reflects the change of system state over time, the penalty term is used to constrain behaviors that violate production rules or objectives, and the risk term considers the uncertainties that may occur in the production process. By solving this optimization problem, the generated collaborative scheduling instructions can span the strategic, tactical, and execution layers, achieving collaborative operation between each level. These instructions will clarify the operational tasks and operating parameters of each piece of equipment at different time nodes, ensuring that the production line achieves efficient, stable, and coordinated production on a global scale. Finally, the collaborative scheduling instructions are issued to the production line execution units, which perform corresponding operations and adjustments according to the instructions to complete the collaborative scheduling process.

[0126] In one feasible implementation, step S506, "constructing a multi-timescale hierarchical scheduling controller based on the adjusted control parameters and the global scheduling strategy model, solving the drift plus penalty plus risk optimization problem, and generating collaborative scheduling instructions across the strategic, tactical, and execution layers," may include: optimizing the work order delivery plan for a future preset planning duration using a first preset period based on the strategic layer periodic parameters in the adjusted control parameters; using the Monte Carlo tree search algorithm to search for the optimal delivery order in the work order sequence space based on the initial estimate of the action value function output by the global scheduling strategy model, generating a strategic layer coarse-grained plan that includes equipment reservation schemes and material delivery batches; establishing a feasible action space based on the tactical layer periodic parameters in the adjusted control parameters, using a second preset period to receive the strategic layer coarse-grained plan as a constraint; and combining the candidate action set recommended by the global scheduling strategy model with... The Lyapunov drift weights in the adjusted control parameters are used to construct a drift plus penalty plus risk objective function, which includes a weighted sum of energy consumption and changeover time, a virtual queue drift penalty, and a device health risk. The drift plus penalty plus risk optimization problem is solved, and model predictive control is used for rolling optimization to generate medium-granularity instructions containing processing sequences for each workstation and device parameter settings. Based on the execution layer cycle parameters in the adjusted control parameters, the device load prediction in the medium-granularity instructions is received at a third preset cycle. Based on the micro-action strategy output by the global scheduling strategy model, the pick-and-place machine nozzle selection, placement sequence, and motion trajectory parameters are optimized to minimize the micro-cycle time, generating a fine-granularity control signal containing nozzle switching signals, axis motion coordinates, and vacuum setting values. The strategic layer coarse-grained plan, the medium-granularity instructions, and the fine-granularity control signals are integrated to generate a collaborative scheduling instruction across the strategic, tactical, and execution layers.

[0127] It should be noted that the first, second, and third preset cycles are set based on the actual operation and scheduling needs of the production line, corresponding to different time scales at the strategic, tactical, and execution levels, respectively. The first preset cycle is relatively long, used for long-term production planning and resource allocation to ensure that the overall development direction of the production line meets the expected goals; the second preset cycle is moderate, mainly considering medium-term production scheduling and task arrangement, enabling the production line to maintain a highly efficient and stable operating state for a certain period of time; the third preset cycle is short, focusing on short-term equipment operation and real-time control to respond promptly to various emergencies on the production line. In this embodiment, the strategic layer scheduler continuously optimizes the work order delivery plan for the next 24 hours at a 4-hour interval of the first preset cycle; the tactical layer scheduler receives the coarse-grained plan from the strategic layer at a 5-minute interval of the second preset cycle as a constraint, and uses model predictive control for continuous optimization, with a prediction duration of 1 hour; the execution layer scheduler receives equipment load predictions from the granular instructions in the tactical layer at a 100-millisecond interval of the third preset cycle for micro-action optimization.

[0128] When searching for the optimal delivery order in the work order sequence space, the Monte Carlo tree search algorithm takes into account a variety of factors, such as equipment utilization, material supply, and work order priority, in order to generate a scientific and reasonable equipment reservation plan and material delivery batch.

[0129] When the model predictive control roll optimization generates medium-granular instructions, it continuously explores and adjusts the action space, and combines factors such as the weighted sum of energy consumption and changeover time, virtual queue drift penalty, and equipment health risk to ensure that the generated instructions can meet production needs while reducing production costs and risks.

[0130] The drift plus penalty plus risk optimization problem to be solved at the tactical level is as follows: in, This represents the value of the objective function at time t. The action space at time t For Lyapunov drift, Q(t) is the virtual queue of order delivery constraints, E(t) is the virtual queue of equipment energy consumption, and V is the adjusted Lyapunov optimal control parameter. As a penalty item, α, β, and γ are weighting coefficients used to balance the impact of energy consumption penalties, delivery delay penalties, and the interaction penalties between order delivery time and equipment load, respectively. This represents the energy consumption penalty function. This represents the penalty function for delivery delay. Let R(t) represent the equipment load function, and R(t) be the risk term. , This is a device health risk indicator function, set to 1 when the health level is below 0.7. =100 is the risk cost coefficient. This is the risk weighting coefficient, with a value range of [0.1, 0.5], and a preferred value of 0.2.

[0131] When optimizing the selection of pick-and-place machine nozzles, placement sequence, and motion trajectory parameters, we fully consider the performance characteristics of the pick-and-place machine and the processing requirements of the workpiece. By continuously adjusting the parameters, we minimize the micro-cycle time and improve production efficiency.

[0132] When integrating strategic-level coarse-grained planning, medium-grained instructions, and fine-grained control signals, it ensures that the instructions at each level are coordinated to form collaborative scheduling instructions, providing a strong guarantee for the efficient operation of the production line.

[0133] In this embodiment, by constructing a multi-time-scale hierarchical scheduling controller, refined and dynamic control of the PCBA production process is achieved, effectively improving the flexibility and response speed of production scheduling.

[0134] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the PCBA production control method based on digital twin and edge federated scheduling in this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0135] This application also provides a PCBA production control device based on digital twin and edge federated scheduling. Please refer to [link / reference]. Figure 2 The PCBA production control device based on digital twins and edge federated scheduling includes: The preprocessing module 10 is used to deploy edge computing nodes at key process equipment in the printed circuit board assembly line, build a device communication topology mapping table, collect the operating data of key process equipment in real time, and perform preprocessing to obtain the original state vector.

[0136] The prediction module 20 is used to construct a spatiotemporal predictive digital twin based on the device communication topology mapping table and the original state vector, and to obtain an enhanced state vector by predicting production line data through the spatiotemporal predictive digital twin.

[0137] The calibration module 30 is used to send a detection command to the physical entity of the key process equipment based on the enhanced state vector and observe the response difference, and perform physical virtual bidirectional calibration to obtain the calibrated state vector.

[0138] The aggregation module 40 is used to train a local scheduling strategy model based on the calibrated state vector stored locally on each edge computing node, and upload the model gradient parameters and contribution proof to the central server based on contract theory, so that the central server can perform weighted federated aggregation based on contract weights and reputation values ​​to obtain a global scheduling strategy model and distribute it to each edge node.

[0139] The scheduling module 50 is used to construct a multi-time-scale hierarchical scheduling controller based on the calibrated state vector and the global scheduling strategy model, solve the drift plus penalty plus risk optimization problem, generate collaborative scheduling instructions across the strategic layer, tactical layer and execution layer, and issue the collaborative scheduling instructions to the production line execution unit for collaborative scheduling.

[0140] The PCBA production control device based on digital twins and edge federated scheduling provided in this application, employing the PCBA production control method based on digital twins and edge federated scheduling in the above embodiments, can solve the technical problems of insufficient virtual-physical consistency, contradiction between data privacy protection and collaborative optimization, leading to low production line operating efficiency. Compared with the prior art, the beneficial effects of the PCBA production control device based on digital twins and edge federated scheduling provided in this application are the same as the beneficial effects of the PCBA production control method based on digital twins and edge federated scheduling provided in the above embodiments, and other technical features in the PCBA production control device based on digital twins and edge federated scheduling are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0141] This application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the PCBA production control method based on digital twin and edge federated scheduling as described above.

[0142] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A PCBA production control method based on digital twinning and edge federated scheduling, characterized in that, The method comprises: Deploying edge computing nodes at key process equipment of a printed circuit board assembly production line, constructing a device communication topology mapping table, collecting and preprocessing operation data of the key process equipment in real time to obtain an original state vector; Based on the device communication topology mapping table and the original state vector, a spatiotemporal predictive digital twin is constructed, and a production line data prediction is performed through the spatiotemporal predictive digital twin to obtain an enhanced state vector; Based on the enhanced state vector, a detection instruction is sent to the physical entity of the key process equipment and a response difference is observed, and a physical-virtual bidirectional calibration is performed to obtain a calibrated state vector; Based on the calibrated state vector stored locally by each edge computing node, a corresponding local scheduling strategy model is trained, and model gradient parameters and contribution proof are uploaded to a central server based on contract theory, so that the central server performs weighted federated aggregation according to contract weights and reputation values to obtain a global scheduling strategy model and distribute it to each edge node; Based on the calibrated state vector and the global scheduling strategy model, a multi-time scale hierarchical scheduling controller is constructed, a cooperative scheduling instruction is generated across strategic, tactical and execution layers, and the cooperative scheduling instruction is distributed to a production line execution unit for cooperative scheduling.

2. The method of claim 1, wherein, The method comprises: Deploying edge computing nodes at a placement machine, a reflow soldering furnace, an automatic optical detection device and an automatic guided transport vehicle of a printed circuit board assembly production line, configuring a lightweight industrial gateway at each edge computing node, identifying adjacent network devices through a link layer discovery protocol, and establishing a physical connection topology relationship; Based on the physical connection topology relationship, device types and data register addresses are identified through a manufacturing message specification protocol, the device types include brand and model of programmable logic controllers and communication protocol types, and the data register addresses include memory addresses for storing operation parameters in programmable logic controllers; The physical connection topology relationship, the device types and the data register addresses are aggregated to generate a device communication topology mapping table; Based on the data register addresses in the device communication topology mapping table, a time-sensitive network transmission schedule is configured, and operation data of the key process equipment is collected through a manufacturing message specification protocol, wherein the operation data of the key process equipment includes placement machine suction nozzle position coordinates, reflow soldering furnace zone temperature values, automatic optical detection device defect detection results, automatic guided transport vehicle battery power and position coordinates; The operation data of the key process equipment is timestamped and standardized to construct an original state vector.

3. The method of claim 1, wherein, The method comprises: Based on the device communication topology mapping table and the original state vector, a spatiotemporal predictive digital twin is constructed, and a production line data prediction is performed through the spatiotemporal predictive digital twin to obtain an enhanced state vector; Based on the device communication topology mapping table, the physical entities of the printed circuit board assembly line are mapped to a heterogeneous spatiotemporal network diagram. The node set of the heterogeneous spatiotemporal network diagram includes device nodes, buffer nodes, and order nodes, and the edge set represents the material flow relationship and energy coupling relationship. A spatiotemporal predictive digital twin is constructed based on a spatiotemporal graph neural network model and the heterogeneous spatiotemporal network graph, wherein the spatiotemporal graph neural network model is composed of stacked graph convolutional layers and gated temporal convolutional layers; The original state vector is input into the spatiotemporal predictive digital twin, and a predicted state vector is generated through multi-step rolling prediction. The predicted state vector includes at least the health degradation trend curve of each device within a future preset time window and the product congestion propagation path data of each buffer zone. The predicted state vector and the original state vector are fused to obtain the enhanced state vector.

4. The method of claim 1, wherein, The process of sending detection commands to the physical entity of the key process equipment based on the enhanced state vector and observing response differences, and performing physical virtual bidirectional calibration to obtain the calibrated state vector includes: The system sends detection commands to the programmable logic controller of the physical entity of the key process equipment through the manufacturing message specification protocol, and collects the actual response data of the physical entity under the action of the detection commands. The detection commands include at least the chip placement head speed adjustment command, the reflow soldering temperature setpoint adjustment command, and the automatic guided vehicle running speed adjustment command. The physical virtual consistency index is determined based on the actual response data and the enhanced state vector. When the physical virtual consistency index is lower than the preset consistency threshold, the model parameters of the spatiotemporal predictive digital twin are updated through the backpropagation algorithm until the physical virtual consistency index reaches or exceeds the preset consistency threshold, thus obtaining the calibrated spatiotemporal predictive digital twin. Based on the calibrated spatiotemporal predictive digital twin, virtual response data matching the actual response data is generated. The virtual response data and the actual response data are then aligned to obtain the calibrated state vector.

5. The method of claim 1, wherein, The local scheduling strategy model is trained based on the calibrated state vectors stored locally on each edge computing node. Based on contract theory, the model gradient parameters and contribution proofs are uploaded to the central server. This allows the central server to perform weighted federated aggregation based on contract weights and reputation values ​​to obtain a global scheduling strategy model, which is then distributed to each edge node. This includes: A sample set of Markov decision process state transitions is constructed based on the calibrated state vectors stored locally on each edge computing node. Based on the sample set, the local resource scheduling strategy model of each edge computing node is trained using the near-end strategy optimization algorithm. Pruning parameters are set, a preset number of training rounds are performed, the model gradient parameters and the accuracy improvement value of the validation set are determined, and the accuracy improvement value of the validation set is used as the data quality proof of the corresponding edge computing node. Obtain the contract set published by the central server, and autonomously select and sign contracts from the contract set based on the data quality proof of each edge computing node to obtain the contract weight. Each contract in the contract set contains a data quality level and a corresponding contract weight. The Monte Carlo sampling method is used to determine the Shapley value of the local resource scheduling strategy model, and a comprehensive contribution is generated based on the data quality proof, the Shapley value, and the node online duration. The Shapley value of the local resource scheduling strategy model is determined using the Monte Carlo sampling method, and a contribution proof is generated based on the data quality proof, the Shapley value, and the node online duration. The model gradient parameters and the contribution proof are submitted to the central server, so that the central server can verify the authenticity of the gradient based on the model gradient parameters, and after the verification is passed, accumulate and calculate the node reputation value. Then, perform weighted federated aggregation based on the contract weight and the node reputation value to obtain the global scheduling strategy model and distribute it to each edge node.

6. The method of claim 1, wherein, The process of constructing a multi-timescale hierarchical scheduling controller based on the calibrated state vector and the global scheduling strategy model, generating collaborative scheduling instructions across the strategic, tactical, and execution layers, and issuing these collaborative scheduling instructions to production line execution units for collaborative scheduling includes: The device status data and energy consumption data are parsed from the calibrated status vector, and the order status data is obtained. Calculate the average queue backlog of the sliding window based on the order status data, equipment status data, and energy consumption data; Based on historical data, fit the Pareto front surface and calculate the projected distance from the current operating point to the Pareto front. Based on the deviation between the average queue backlog and the target backlog level of the sliding window, and combined with the projection distance, a differential equation containing a queue backlog deviation term, a central regression term, and a Pareto distance correction term is solved to obtain the control parameter update amount. The current Lyapunov optimized control parameters are superimposed with the updated control parameters, and safety boundary constraints and rate of change limits are applied to obtain the adjusted control parameters. Based on the adjusted control parameters and the global scheduling strategy model, a multi-time-scale hierarchical scheduling controller is constructed to solve the drift plus penalty plus risk optimization problem, generate collaborative scheduling instructions across the strategic, tactical and execution layers, and issue the collaborative scheduling instructions to the production line execution units for collaborative scheduling.

7. The method of claim 6, wherein, The multi-time-scale hierarchical scheduling controller is constructed based on the adjusted control parameters and the global scheduling strategy model to solve the drift plus penalty plus risk optimization problem, and generate collaborative scheduling instructions across the strategic, tactical and execution layers, including: Based on the strategic layer cycle parameters in the adjusted control parameters, the work order deployment plan for the future preset planning duration is optimized in a first preset cycle. Based on the initial estimate of the action value function output by the global scheduling strategy model, the Monte Carlo tree search algorithm is used to search for the optimal deployment order in the work order sequence space to generate a strategic layer coarse-grained plan that includes equipment reservation schemes and material delivery batches. Based on the tactical layer cycle parameters in the adjusted control parameters, and using the second preset cycle to receive the strategic layer coarse-grained plan as a constraint, an action space is established. Based on the candidate action set recommended by the global scheduling strategy model, and combined with the Lyapunov drift weight in the adjusted control parameters, a drift plus penalty plus risk objective function is constructed, which includes a weighted sum of energy consumption and line switching time, a virtual queue drift penalty, and a device health risk. The drift plus penalty plus risk optimization problem is solved, and model predictive control is used to generate medium-grained instructions containing the processing sequence of each workstation and the device parameter settings through rolling optimization. Based on the execution layer cycle parameters in the adjusted control parameters, the device load prediction in the medium-granularity instruction is received in the third preset cycle. Based on the micro-action strategy output by the global scheduling strategy model, the pick-and-place machine nozzle selection, placement sequence and motion trajectory parameters are optimized to minimize the micro-cycle time and generate a fine-granular control signal containing nozzle switching signals, axis motion coordinates and vacuum degree setting values. By integrating the coarse-grained strategic plan, the medium-grained instructions, and the fine-grained control signals, a coordinated scheduling instruction is generated across the strategic, tactical, and execution layers.

8. The method of claim 1, wherein, The process of constructing a multi-timescale hierarchical scheduling controller based on the calibrated state vector and the global scheduling strategy model, generating collaborative scheduling instructions across the strategic, tactical, and execution layers, and issuing these instructions to production line execution units for collaborative scheduling, further includes: During the execution of the coordinated scheduling instructions, the execution status data is collected in real time through a sensor network deployed at the key process equipment. Based on the execution status data, anomaly detection is performed on the network model to determine whether any disturbance events exist; In the presence of disturbance events, the intensity of the causal effect of the disturbance source node on the downstream node along the material flow edge and energy coupling edge is calculated by backpropagation of the spatiotemporal graph neural network based on the heterogeneous spatiotemporal network graph. The set of affected nodes and the rescheduling time window are determined based on the intensity of the causal effect. Based on the set of affected nodes and the rescheduling time window, a local rescheduling instruction is generated and issued to the corresponding production line execution unit.

9. A PCBA production control device based on digital twinning and edge federated scheduling, characterized in that, The device includes: The preprocessing module is used to deploy edge computing nodes at key process equipment in the printed circuit board assembly line, build a device communication topology mapping table, collect the operating data of key process equipment in real time, and perform preprocessing to obtain the original state vector. The prediction module is used to construct a spatiotemporal predictive digital twin based on the device communication topology mapping table and the original state vector, and to obtain an enhanced state vector by predicting production line data through the spatiotemporal predictive digital twin. The calibration module is used to send detection commands to the physical entity of the key process equipment based on the enhanced state vector and observe the response differences, and perform physical virtual bidirectional calibration to obtain the calibrated state vector. The aggregation module is used to train a local scheduling strategy model based on the calibrated state vector stored locally on each edge computing node, and upload the model gradient parameters and contribution proof to the central server based on contract theory, so that the central server can perform weighted federated aggregation based on contract weight and reputation value to obtain a global scheduling strategy model and distribute it to each edge node. The scheduling module is used to construct a multi-time-scale hierarchical scheduling controller based on the calibrated state vector and the global scheduling strategy model, solve the drift plus penalty plus risk optimization problem, generate collaborative scheduling instructions across the strategic layer, tactical layer and execution layer, and issue the collaborative scheduling instructions to the production line execution unit for collaborative scheduling. 10.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by the processor, it implements the PCBA production control method based on digital twin and edge federated scheduling as described in any one of claims 1 to 8.