Intelligent production line fault prediction method and system based on random forest enhancement
By constructing an equipment association graph and a random forest augmented classifier, the fault propagation path of the intelligent production line is identified and predicted, solving the problem of insufficient timeliness of fault identification in existing technologies and achieving accurate fault prediction and decision support.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUIZHOU UNIV
- Filing Date
- 2026-03-26
- Publication Date
- 2026-07-03
AI Technical Summary
Existing intelligent production line fault prediction methods lack timeliness in fault identification and fail to consider the coupling relationship between equipment operating states and the diffusion pattern of faults at the production line level, resulting in the accuracy and reliability of prediction results failing to meet the needs of intelligent operation and maintenance.
A production line equipment association map is constructed. Real-time status signals are received through a sensor array. A random forest augmented classifier is used for fault mode identification. A fault propagation direction sequence and time delay distribution are generated through breadth-first search and encoded into a fault evolution path map. An early warning instruction containing fault identifiers, expected occurrence times, and a list of affected equipment is generated.
It significantly improves the accuracy and robustness of fault detection, enabling precise identification of the source and scope of risk before a fault occurs, effectively shortening fault response time, optimizing maintenance resource pre-positioning strategies, and enhancing the timeliness and decision support capabilities of intelligent production line fault prediction.
Smart Images

Figure CN121919710B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent manufacturing, and in particular to an intelligent production line fault prediction method and system based on random forest enhancement. Background Technology
[0002] With the rapid development of industrial automation and intelligent manufacturing technologies, intelligent production line fault prediction technology has been widely applied in the field of condition monitoring and maintenance decision-making for production equipment. Current mainstream production line fault prediction methods typically involve deploying sensors at critical equipment nodes to continuously collect status signals such as vibration, temperature, and current. The collected signal sequences are then compared with pre-set fixed thresholds, triggering an alarm if the monitored value exceeds the threshold range. However, this approach has significant limitations in practical applications. Alarm signals are often triggered only when a fault is about to occur or has already occurred, resulting in severely insufficient prediction timeliness. Furthermore, the fault identification process treats each piece of equipment in isolation, failing to consider the coupling relationship between equipment operating states and the propagation pattern of faults at the production line level. Consequently, the accuracy and reliability of the prediction results are insufficient to meet the actual needs of intelligent operation and maintenance. Summary of the Invention
[0003] This invention provides a method and system for predicting intelligent production line faults based on random forest enhancement.
[0004] In a first aspect, embodiments of the present invention provide a smart production line fault prediction method based on random forest enhancement, comprising:
[0005] A production line equipment association map is generated based on the production line equipment connection relationship list and the historical operation record archive of each equipment. The production line equipment association map consists of equipment nodes that represent each processing equipment, conveying device and testing instrument and connection edges that represent the physical connection and data interaction relationship between equipment. An operation status archive based on historical maintenance logs and operation parameter records is attached to each equipment node.
[0006] The system continuously receives real-time status signal sequences from sensor arrays deployed at various workstations and key parts of the equipment on the production line. The real-time status signal sequences are encapsulated into status data packets with timestamps and device address identifiers at a fixed time window acquisition granularity, thus obtaining the real-time operating status stream of the production line.
[0007] The real-time operation status stream of the production line is input into a pre-trained random forest augmented classifier. The random forest augmented classifier consists of multiple decision trees and introduces fault sample distribution weights during node splitting. By performing step-by-step decision branch traversal processing on the status data packet, it outputs a set of membership probability vectors of each device node belonging to various preset fault modes within the current time window.
[0008] Traverse the equipment nodes in the production line equipment association graph, take the fault modes that exceed the preset confidence threshold in the membership probability vector set as the activation nodes, perform a breadth-first search along the connection edge direction, record the fault activation node sequence and the time difference of state changes between nodes, and generate the fault propagation direction sequence and the time delay distribution of fault transfer between equipment.
[0009] The fault propagation direction sequence and time delay distribution are encoded into a fault evolution path diagram with a unified time base. Based on the fault evolution path diagram, the fault arrival probability and expected range of affected equipment for each propagation path are calculated. A production line fault prediction and early warning instruction containing a fault identifier, the expected time of occurrence, and a list of affected equipment is generated and pushed to the production line centralized monitoring platform.
[0010] In a second aspect, embodiments of the present invention provide a computer system, comprising:
[0011] Memory is used to store executable instructions or computer programs.
[0012] When a processor executes computer-executable instructions or computer programs stored in memory, it implements the above-mentioned intelligent production line fault prediction method based on random forest enhancement.
[0013] The embodiments of the present invention have the following beneficial effects:
[0014] This invention constructs a structured knowledge carrier of equipment relationships; it generates a real-time operating status stream of the production line by receiving sensor array status data packets, achieving refined perception and unified temporal representation of operating status; by introducing the status stream input into a random forest-enhanced classifier with fault sample distribution weights, it outputs a membership probability vector of equipment nodes belonging to fault modes, achieving sensitive capture and accurate discrimination of early fault symptoms, significantly improving fault detection accuracy and robustness; by traversing the association graph and performing a breadth-first search with fault modes exceeding the confidence threshold as activation nodes, it records the activation node sequence and time difference, and generates a fault propagation direction sequence and time delay distribution. By associating discrete activation events with causal fault propagation paths, the transfer patterns of faults between devices are revealed. By encoding the propagation direction sequence and time delay distribution into a fault evolution path diagram and calculating the fault arrival probability and expected affected equipment range accordingly, predictive warning instructions containing fault identifiers, expected occurrence times, and lists of affected devices are generated. This transforms the abstract propagation model into spatiotemporally directional predictive information, enabling maintenance personnel to accurately locate the source of risk and its scope before a fault occurs. This effectively shortens fault response time, reduces unplanned downtime losses, optimizes pre-positioning strategies for maintenance resources, and comprehensively improves the timeliness, interpretability, and decision support capabilities of fault prediction in intelligent production lines. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the architecture of an application scenario provided in an embodiment of the present invention;
[0016] Figure 2 This is a schematic diagram of the structure of the computer system provided in an embodiment of the present invention;
[0017] Figure 3 This is a flowchart illustrating the intelligent production line fault prediction method based on random forest enhancement provided in an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on the present invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] See Figure 1 This is a schematic diagram of the application scenario provided in the embodiment of the present invention. The sensor array 400 is connected to the computer system 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two, and data transmission is achieved using wireless or wired links.
[0020] The sensor array 400 is used to collect status signals of each workstation and key parts of the equipment on the production line and send them to the computer system 200. The computer system 200 is used to execute the intelligent production line fault prediction method based on random forest enhancement provided in this embodiment of the invention.
[0021] In some embodiments, the computer system 200 may be a standalone physical server, or a device with data processing capabilities such as a tablet computer, laptop computer, or desktop computer, but is not limited to these.
[0022] The computer system implementing the intelligent production line fault prediction method based on random forest enhancement provided in this embodiment of the invention will be described next. See also Figure 2 This is a schematic diagram of the structure of a computer system provided in an embodiment of the present invention. Figure 2 The computer system shown includes at least one processor 210, memory 250, at least one network interface 220, and an external interface 230. The various components in the computer system 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to implement communication between these components. In addition to a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 240.
[0023] Processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0024] External interface 230 may include, for example, one or more speakers and / or one or more visual displays. External interface 230 may also include one or more input devices 432, such as a keyboard, mouse, microphone, touch screen display, camera, etc.
[0025] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices physically located away from the processor 210.
[0026] The memory 250 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 250 described in this embodiment is intended to include any suitable type of memory.
[0027] In some embodiments, memory 250 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0028] Operating system 251 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;
[0029] The network communication module 252 is used to reach the sensor array via one or more (wired or wireless) network interfaces 220, exemplary network interfaces 220 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.
[0030] Presentation module 253 is configured to enable the display of information (e.g., external interface for operating peripheral devices and displaying content and information) via one or more output devices 231 (e.g., display screen, speaker, etc.) associated with external interface 230;
[0031] The input processing module 254 is used to detect and translate one or more user inputs or interactions from one or more input devices 232.
[0032] Based on the above description of the X application scenario and computer system provided in the embodiments of the present invention, the intelligent production line fault prediction method based on random forest enhancement provided in the embodiments of the present invention is described below. In actual implementation, the intelligent production line fault prediction method based on random forest enhancement provided in the embodiments of the present invention can be implemented by a computer system. See also Figure 3 , Figure 3 This is a flowchart illustrating the intelligent production line fault prediction method based on random forest enhancement provided in this embodiment of the invention. Next, we will combine... Figure 3 The steps shown are explained.
[0033] Step S100: Generate a production line equipment association map based on the production line equipment connection relationship list and the historical operation record archive of each equipment. The production line equipment association map consists of equipment nodes that represent each processing equipment, conveying device and testing instrument and connection edges that represent the physical connection and data interaction relationship between equipment. An operation status archive based on historical maintenance logs and operation parameter records is attached to each equipment node.
[0034] The production line equipment connection relationship list is a core configuration table stored in the Manufacturing Execution System (MES) database. This table comprehensively describes the adjacency topology between all hardware units within the production line through equipment identifier fields, upstream equipment identifier fields, downstream equipment identifier fields, and connection type code fields. The historical operation record archive for each piece of equipment is a composite data source, containing both time-series measurement values from various sensors stored in the industrial real-time database and unstructured maintenance work order text records stored in the enterprise asset management system. Generating the production line equipment association graph essentially involves transforming the two-dimensional table structure in the aforementioned relationship list into node and edge instances in a graph database, and then attaching the multi-dimensional features parsed from the historical archives as node attributes.
[0035] In practical implementation, the list of production line equipment connections is first parsed, and each record in the list is read line by line. For each record, the value of the equipment identifier field is extracted and used as the unique primary key of the node for querying the graph database. If the query result is empty, a new equipment node is created. The node's label is set according to the content of the equipment type field in the record. If the equipment type field is processing equipment, it is labeled as a processing equipment node; if it is a conveyor device, it is labeled as a conveyor device node; and if it is a testing instrument, it is labeled as a testing instrument node. If the query result exists, the existing equipment node is directly located. After the source node and target node are created or located, a directed connection edge is created between the two nodes according to the definition of the connection type field in the record. The direction of the edge is from the upstream equipment identifier field to the downstream equipment identifier field. The edge's attributes store the specific value of the connection type field, which may be a mechanical conveyor belt, an industrial Ethernet link, or a wireless signal connection. After traversing all records in the list, the skeleton of the production line equipment association graph, that is, the basic structure of nodes and edges, is completed.
[0036] Next, an operational status file is attached to each device node. Based on the device identifier, all historical maintenance log texts and time-series operational parameter data corresponding to that device are retrieved from the historical operation record file. For the historical maintenance log texts, a transformation model based on bidirectional encoder representation is used for processing. Each maintenance log text is input into this model. The model's embedding layer first converts each word in the text into a word embedding vector and injects the word's order information in the sentence through positional encoding. Subsequently, multiple Transformer encoder layers calculate the association weights between each word in the text and all other words through a self-attention mechanism, capturing contextual semantics, and finally outputting a fixed-dimensional semantic vector, which is the textual feature representation of that maintenance log. After completing the vector transformation of all log texts, a density-based clustering algorithm is performed on these semantic vectors. The algorithm calculates the Euclidean distance between vectors and evaluates the density within the neighborhood of each vector, merging semantically similar vectors into the same cluster. Each cluster represents a typical fault mode, generating a unique fault mode identifier for each cluster, such as the "bearing wear" identifier or the "hydraulic leakage" identifier.
[0037] For the time-series data of operating parameters, a continuous waveform sequence of each parameter within a preset time period preceding each historical fault is extracted. For this sequence, the difference between its peak and trough values is calculated as the fluctuation amplitude, the mean of the first-order differences of the sequence is calculated as the rate of change, and the energy distribution entropy of the spectrum is calculated after performing a Fourier transform on the sequence as the waveform entropy. These statistics collectively constitute multi-dimensional statistical features of the operating status. The identifier of each fault mode cluster is associated with the statistical features corresponding to all historical faults under that cluster, forming a feature set, which constitutes the operating status file of the device node. Finally, this operating status file is stored as attribute values in the attribute fields of the corresponding device node in the graph database in JSON object format.
[0038] Step S200: Continuously receive real-time status signal sequences from sensor arrays deployed at various workstations and key parts of the equipment on the production line. The real-time status signal sequences are encapsulated into status data packets with timestamps and device address identifiers at a fixed time window acquisition granularity, thus obtaining the real-time operating status stream of the production line.
[0039] In one implementation, step S200 may specifically include the following steps S210 to S250:
[0040] Step S210: Analyze the operating status files of each equipment node in the production line equipment association map, extract the statistical value of the status signal fluctuation frequency of each equipment node in the period before the historical fault occurred from the operating status files, and map the statistical value of the status signal fluctuation frequency to the fault sensitivity level of the equipment node.
[0041] The operational status archive is structured data stored within the attributes of each equipment node in the production line equipment association map. It includes the equipment's historical fault mode cluster identifiers and corresponding multi-dimensional operational status statistical characteristics. Extracting the statistical values of the status signal fluctuation frequency for each equipment node in the period preceding a historical fault involves reading statistical quantities stored in the archive, such as the spectral energy distribution entropy or zero-crossing rate, calculated from vibration or current signals within a preset period before each historical fault. Mapping the statistical values of the status signal fluctuation frequency to the fault sensitivity level of the equipment node is done by discretizing continuous statistical values into a finite number of sensitivity levels, such as high sensitivity, medium sensitivity, and low sensitivity, based on a pre-defined correspondence between statistical value intervals and level grades.
[0042] Specifically, the process iterates through each device node in the production line equipment association graph. For the currently visited device node, its attribute fields are accessed to read the running status file stored as a JSON object. From this JSON object, the array storing historical fault characteristics is located. For each historical fault record in the array, the statistical value of the state signal fluctuation frequency during the period before the fault occurred is extracted. This statistical value may be the previously calculated and stored average zero-crossing rate of the signal, or it may be the peak frequency width of the spectrum. If there are multiple historical fault records for the same device node, the arithmetic mean of the fluctuation frequency statistics of all these records is calculated as the comprehensive fluctuation frequency statistics of the node. Subsequently, a mapping table preset in the configuration file is accessed. This mapping table defines multiple continuous numerical intervals, each interval corresponding to a fault sensitivity level. For example, intervals with fluctuation frequency statistics below a first preset threshold correspond to a low sensitivity level, intervals between the first and second preset thresholds correspond to a medium sensitivity level, and intervals above the second preset threshold correspond to a high sensitivity level. The calculated comprehensive fluctuation frequency statistics are compared with the intervals in the mapping table to determine the interval to which it belongs, thereby obtaining the fault sensitivity level corresponding to the device node. Finally, this sensitivity level is written back as a new attribute field to the attributes of the current device node in the graph database for use in subsequent steps.
[0043] Step S220: Dynamically allocate a time window length adjustment coefficient to each device node according to the fault sensitivity level. The higher the fault sensitivity level of the device node, the smaller the time window length adjustment coefficient. The fixed time window is scaled according to the time window length adjustment coefficient to generate an independent adaptive time window length for each device node.
[0044] The time window length adjustment factor is a dimensionless multiplier factor that personalizes the globally fixed time window length described in step S200. Device nodes with higher fault sensitivity levels have smaller time window length adjustment factors. This association rule means that for devices more prone to failure and with more frequent status signal fluctuations, shorter time windows will be used for data acquisition to capture more refined transient changes. Scaling the fixed time window based on the time window length adjustment factor involves multiplying the globally uniform fixed time window length by a unique adjustment factor for each device node, thus calculating a unique time window length for each node. This generates an independent adaptive time window length for each device node, resulting in a mapping table that records each device identifier and its corresponding calculated new time window length.
[0045] For example, first, the latest attached fault sensitivity level attribute for each device node is read from the graph database. For each device node, based on its level, the corresponding time window length adjustment coefficient is looked up from a predefined coefficient mapping dictionary. The key of this dictionary is the sensitivity level, and the value is the adjustment coefficient. For example, for a high sensitivity level, the adjustment coefficient stored in the dictionary is a value less than one unit; for a medium sensitivity level, the adjustment coefficient is one unit; and for a low sensitivity level, the adjustment coefficient is a value greater than one unit. After the coefficient lookup is completed, the globally fixed time window length value set in step S200 is read from the configuration file. Then, a multiplication operation is performed, multiplying the fixed length value by the adjustment coefficient of the current device node. The product is the adaptive time window length of the device node. The calculated adaptive time window length is associated with the device identifier and stored in a temporary hash mapping structure. After traversing all device nodes, the hash mapping structure completely records the independent adaptive time window length of each device node. For example, when the global fixed time window length is set to a certain baseline value, for a press node marked as high sensitivity, its adjustment coefficient is a value less than one unit, and the resulting adaptive time window length after multiplication is shorter than the baseline value. However, for a storage bin node marked as low sensitivity, its adjustment coefficient is a value greater than one unit, and the resulting adaptive time window length after multiplication is longer than the baseline value.
[0046] Step S230: Reset the sampling trigger interval of each sensing unit in the sensing array with the adaptive time window length as the acquisition granularity, and issue an acquisition configuration command containing the new sampling trigger interval to each sensing unit, so that the subsequently received status data packets carry a non-uniform timestamp interval that matches the fault sensitivity level of the device node.
[0047] Here, the sampling trigger interval of each sensing unit in the sensor array is reset with the adaptive time window length as the acquisition granularity. This involves using the adaptive time window length of each device node calculated in step S220 as the new data packaging cycle, and issuing a command to each sensing unit installed on that device. Issuing acquisition configuration commands containing the new sampling trigger interval to each sensing unit involves sending control frames conforming to a specific application layer protocol to the sensors via the industrial network. The payload field of this frame contains the new time window length parameter. This causes subsequent received status data packets to carry non-uniform timestamp intervals that match the fault sensitivity level of the device nodes. After this reconfiguration, sensors on different device nodes will package data according to their own independent time periods. This results in the data packet stream converging at the central node having a timestamp difference between two consecutive data packets from the same device that is no longer globally consistent, but rather correlated with the device's sensitivity level. Devices with higher sensitivity have smaller timestamp intervals, thus forming a non-uniform time distribution.
[0048] For example, the hash mapping structure generated in step S220 is first traversed. This structure stores each device identifier and its corresponding adaptive time window length. For each device identifier, the production line device association map is queried to find the list of communication addresses of all sensor units installed on that device. These sensor unit communication addresses can be IP addresses plus port numbers on industrial Ethernet, or slave node addresses on fieldbus. Then, a data acquisition configuration command is constructed. The protocol header of this command contains an opcode, which indicates that this is a command to "set sampling trigger interval". The payload field of the command is filled with the adaptive time window length value corresponding to the device. After construction, this command is sent to each sensor unit in the list through the industrial network. After receiving the command, the microcontroller inside the sensor unit parses the command, extracts the time window length value from the payload, and writes it into the period register of the timer controlling the data acquisition process. Starting from the next acquisition cycle, the sensor unit triggers analog-to-digital conversion, data packaging, and transmission operations at intervals of the new time window length. Therefore, the status data packets subsequently received by the central data aggregation node from high-sensitivity devices have smaller timestamp differences between adjacent packets, while data packets from low-sensitivity devices have larger timestamp differences. The timestamp intervals of the entire data stream exhibit a non-uniform distribution characteristic that matches the risk of device failure.
[0049] In one implementation, step S230 may further include the following steps S231 to S235:
[0050] Step S231: Monitor the rate of change of the amplitude of the status signal of each device node within multiple consecutive adaptive time windows, calculate the difference of the sliding average value of the rate of change of the amplitude of the status signal between the current window and the historical window, and generate the operational stability index of the device node.
[0051] Monitoring the rate of change of the state signal amplitude of each device node within multiple consecutive adaptive time windows involves calculating, at the end of each adaptive time window for each device node, a sequence of the rate of change of the amplitude of all signal sampling points within that window relative to the previous sampling point, and extracting the statistical characteristics of this sequence. Calculating the difference between the moving average of the rate of change of the state signal amplitude in the current window and historical windows involves maintaining a fixed-length queue of historical window rate of change averages, and calculating the difference between the average rate of change calculated for the current window and the average of all historical averages in the queue. Generating the operational stability index for that device node involves normalizing or taking the absolute value of this difference to obtain a dimensionless value. The larger this value, the more drastic the fluctuation of the current window's operational state compared to the historical average state, i.e., the lower the stability.
[0052] For example, a circular queue is maintained in memory for each device node to store the average rate of change of state signal amplitudes calculated over the most recent adaptive time windows. Whenever an adaptive time window of a device node ends, all state signal amplitudes within the current window are read from the node's circular queue-style data buffer. Then, this amplitude sequence is traversed, starting from the second sampling point, calculating the absolute value of the difference between the amplitude of the current sampling point and the amplitude of the previous sampling point, and dividing by the amplitude of the previous sampling point to obtain the instantaneous rate of change for that point. After calculating the instantaneous rates of change for all adjacent pairs within the window, the arithmetic mean of these instantaneous rates of change is calculated to obtain the average rate of change for the current window. Next, the historical rate of change mean circular queue of the device node is accessed, and the average of all historical means in the queue is calculated to obtain the historical average rate of change. Then, the difference between the current window's average rate of change and the historical average rate of change is calculated. To eliminate the influence of dimensions, this difference is divided by the historical average rate of change to obtain the relative difference value, which is the operational stability index for the current window. Finally, the mean rate of change of the current window is pushed to the tail of the circular queue of the mean rate of change of the history, and the old value at the head of the queue is removed to keep the queue length fixed.
[0053] Step S232: Compare the running stability index with the preset stability threshold range. If the running stability index is lower than the lower limit of the stability threshold range, it is determined that the device node is in a low-fluctuation steady state and the time window stretching operation is performed to increase the adaptive time window length of the device node.
[0054] The stability threshold range is an interval defined by an upper and lower limit, which is pre-stored in a configuration file. Comparing the operational stability index to this range is a numerical comparison logic. If the operational stability index is lower than the lower limit of the stability threshold range, it means that the rate of change in the current window is much lower than the historical average, and the device's operating state is abnormally stable with almost no fluctuations. Determining that the device node is in a low-fluctuation steady state is a conclusion drawn from the above comparison results. Performing the time window stretching operation, after determining that a steady state has been reached, initiates an adjustment program to increase the adaptive time window length of the device node, allowing for the collection of data over a longer time span when state changes are slow, thus reducing data redundancy.
[0055] For example, first, the lower and upper limits of the stability threshold range are read from the configuration file. Then, the operational stability index calculated in step S231 is compared with the lower limit. If the operational stability index is less than the lower limit, the process enters the time window stretching branch. In this branch, the adaptive time window length of the current device node is obtained and multiplied by a preset stretching coefficient greater than one, such as a fixed multiple. The result of the multiplication is used as the new adaptive time window length, which is then temporarily stored for subsequent instruction issuance. Simultaneously, the timing and magnitude of this adjustment are recorded.
[0056] Step S233: If the stability index is higher than the upper limit of the stability threshold range, the device node is determined to be in a high-fluctuation transient state and a time window compression operation is performed to reduce the adaptive time window length of the device node.
[0057] If the operational stability index exceeds the upper limit of the stability threshold range, it means that the rate of change in the current window is much higher than the historical average, indicating drastic fluctuations in the equipment's operating status, which may indicate that a fault is occurring or about to occur. The determination that the device node is in a high-fluctuation transient state is based on the above comparison results. Performing time window compression is an adjustment procedure initiated after a transient state is determined, reducing the adaptive time window length of the device node to capture rapidly changing transient signals with a higher sampling density.
[0058] In practice, after comparing the stability index with the lower limit, if the index is not less than the lower limit, it is compared with the upper limit. If the stability index is greater than the upper limit, the process enters the time window compression branch. In this branch, the adaptive time window length of the current device node is obtained and multiplied by a preset compression coefficient less than one unit. The result of the multiplication is used as the new, shorter adaptive time window length, and the timing and magnitude of this adjustment are also recorded.
[0059] Step S234: Re-encode the stretched or compressed adaptive time window length into a sampling trigger interval, and send a dynamic configuration update command to the corresponding sensing unit through the in-band management channel so that the sensing unit can use the updated sampling trigger interval in the next acquisition cycle.
[0060] In specific implementation, after calculating the new adaptive time window length in step S232 or S233, the communication addresses of all sensor units attached to the device node are immediately located, and a dynamic configuration update command is constructed. The command header of this command contains a command code to identify it as a "dynamic adjustment of sampling interval" command. The payload field of the command is filled with the new adaptive time window length value. Subsequently, the command is sent to the corresponding sensor unit via the industrial network. Upon receiving the command, the sensor unit's network protocol stack delivers it to the upper-layer configuration management module. The configuration management module parses the command, extracts the new time window length value, and writes it into the comparison register of the timer controlling the data acquisition and packetization cycle. This timer will immediately start counting with the new cycle, and after the current cycle ends, the acquisition and transmission of the next data packet will be executed according to the new time interval.
[0061] Step S235: Record the adjustment time and adjustment range of the adaptive time window length of each equipment node, and store the adjustment time and adjustment range in the running status file of the corresponding equipment node in the production line equipment association map to obtain the dynamic adjustment trajectory of the time window.
[0062] Specifically, after the window length adjustment is completed in step S232 or S233 and the command is issued in step S234, an adjustment record is immediately generated. This record is a key-value pair structure, where one key is the adjustment time, and its value is taken from the current count value of the server's global clock; the other key is the adjustment magnitude, which can be the difference in window length before and after the adjustment, or the specific value of the adjustment coefficient. Then, based on the device identifier, the corresponding device node is located in the graph database. The existing runtime status file attribute of the node is read. This attribute is a JSON object, and the existence of an array key named "Time Window Adjustment Trajectory" is checked in the JSON object. If it exists, the newly generated adjustment record is appended to the array; if it does not exist, the array is created first, and then the record is added to it. After writing is complete, the updated JSON object is written back to the device node attribute in the graph database. In this way, all time window dynamic adjustment events of each device node during its runtime are permanently saved, forming a time window dynamic adjustment trajectory that can be used for subsequent analysis and backtracking.
[0063] Step S240: Receive status data packets encapsulated according to non-uniform timestamp intervals, and store them in the circular queue data buffer of the corresponding device node according to the device address identifier carried in the status data packets. The capacity of the circular queue data buffer of each device node is positively correlated with the fault sensitivity level of that device node.
[0064] In one implementation, step S240 may specifically include the following steps S241 to S245:
[0065] Step S241: Parse the timestamp identifier in the header of each status data packet, calculate the timestamp difference between the current status data packet and the previous status data packet on the same device node, and verify the consistency between the timestamp difference and the adaptive time window length of the current device node.
[0066] For example, after receiving a status data packet, the data distribution daemon first locates the corresponding device node based on the device address identifier. In the node's data structure, besides the circular queue buffer, it maintains two variables: "previous data packet timestamp" and "current adaptive time window length." The timestamp identifier is extracted from the packet header and recorded as the current timestamp. Then, the previous data packet timestamp is read from the node's data structure. If this value is empty, it indicates this is the device's first data packet, so the verification is skipped, and the current timestamp is directly stored in the node's data structure, along with the data packet in the buffer. If the previous data packet timestamp exists, the difference between the current and previous timestamps is calculated. Next, the current adaptive time window length is read from the node's data structure, and the calculated timestamp difference is subtracted from the read adaptive time window length to obtain the absolute value of the deviation. This absolute value of the deviation is then compared to a preset deviation tolerance, which is typically set as a percentage of the adaptive time window length. For example, if the adaptive time window length is a certain value, the deviation tolerance might be set as a percentage of that value. If the absolute value of the deviation is less than or equal to the deviation tolerance, the verification passes; if it is greater than the deviation tolerance, the verification fails and the timestamp marking is determined to be abnormal.
[0067] Step S242: If the deviation between the timestamp difference and the adaptive time window length exceeds the preset deviation tolerance, it is determined that the current status data packet has an abnormal timestamp marking, the status data packet is transferred to the abnormal data temporary storage area and the sensor unit clock self-calibration process is triggered.
[0068] In specific implementation, when the comparison result in step S241 shows that the absolute value of the deviation is greater than the deviation tolerance, the exception handling logic is immediately executed. First, the default exception data temporary storage area for this device node is located in memory. This temporary storage area is also a queue structure, but with a small capacity. The current status data packet is completely copied and stored at the end of the exception data temporary storage area. At the same time, the time of occurrence and the deviation value of this exception event are recorded. Subsequently, based on the device address identifier, the communication address of the sensing unit is retrieved, and a "clock self-calibration" trigger command is constructed. The protocol header of this command sets a command code to identify that this is a command to start the clock synchronization process, and the command is sent to the corresponding sensing unit. After receiving this command, the sensing unit's internal protocol stack will immediately interrupt the current data acquisition task and actively initiate a synchronization request for the precise time protocol to the master clock server to readjust the local clock, thereby eliminating any possible accumulated errors.
[0069] Step S243: Extract the abnormal status data packet with timestamp from the abnormal data temporary storage area, correct the timestamp of the abnormal status data packet based on the linear interpolation result of the timestamps of the normal status data packets before and after the same device node, and rewrite the corrected timestamp into the header of the status data packet.
[0070] After the triggered sensing unit completes clock self-calibration and begins sending subsequent normal data packets, it periodically checks the abnormal data buffer of the device node. For each abnormal data packet in the buffer, its position in the normal data stream is first determined. This requires finding the two normal data packets that are temporally closest to the abnormal packet in the device node's circular queue-style data buffer. Specifically, the original error timestamp of the abnormal packet is compared with the correct timestamps of all normal packets in the buffer. The largest normal packet with a timestamp smaller than the abnormal packet is used as the forward reference packet, and the smallest normal packet with a timestamp larger than the abnormal packet is used as the backward reference packet. The timestamps of the forward and backward reference packets are read, and the sequence number difference between the forward and backward reference packets in the buffer, as well as the sequence number offset of the abnormal packet relative to the forward reference packet, are recorded. Since data packets are sent sequentially, the sequence number of the abnormal packet should be between the preceding and following reference packets. Based on the timestamp difference between the preceding and following reference packets, and the proportion of the abnormal packet's sequence number offset to the sequence number difference between the preceding and following reference packets, the corrected timestamp of the abnormal packet is calculated. Specifically, the corrected timestamp is equal to the forward reference packet timestamp plus the difference between the forward and backward reference packet timestamps multiplied by the ratio of the sequence number offset to the sequence number difference. After calculation, the memory address of the abnormal data packet is located, and the timestamp identifier field value in its header is updated to the calculated corrected timestamp.
[0071] Step S244: Insert the status data packets that have completed timestamp correction into the circular queue data buffer of the corresponding device node in the corrected timestamp order. At the same time, calculate the upper limit of the capacity of the circular queue data buffer according to the fault sensitivity level of the device node. For each level increase in fault sensitivity, the buffer capacity increases by a preset capacity increment.
[0072] After correcting the timestamp of the abnormal packet, it needs to be inserted into the normal circular queue buffer. Since the normal packets in the buffer are strictly ordered by timestamp, the correct insertion position needs to be found. Starting from the read pointer of the buffer, the elements in the buffer are traversed, and the timestamp of each element is compared with the corrected timestamp. When an element with a timestamp greater than the corrected timestamp is found, that position is the insertion point. All elements after the insertion point are shifted one unit forward in memory, and then the corrected packet is written to the insertion point. If the insertion operation causes the number of elements in the buffer to exceed the preset capacity limit, one or more of the oldest elements at the head of the buffer are discarded to maintain the capacity within the limit. When calculating the capacity limit, the fault sensitivity level of the device node is read. Assuming the base capacity is a preset value, the capacity corresponding to a high sensitivity level is the base capacity plus an increment, the capacity corresponding to a medium sensitivity level is the base capacity, and the capacity corresponding to a low sensitivity level is the base capacity minus a decrement. Based on the mapping relationship between the level and the capacity increment, the maximum allowed length of the buffer is dynamically determined, and this limit is checked during each write operation.
[0073] Step S245: When the number of status data packets in the circular queue data buffer exceeds the capacity limit, remove the earliest arriving status data packet from the head of the buffer to ensure that the buffer always stores the most representative real-time status signal sequence within the most recent time window of the device node.
[0074] The circular queue implementation maintains two pointers: a read pointer pointing to the head of the queue and a write pointer pointing to the tail, as well as a counter recording the current number of elements. Whenever a data packet (whether a newly received normal packet or a corrected abnormal packet) is written to the tail of the queue, the counter is incremented. Immediately after the write operation is complete, the counter value is compared with the capacity limit determined in step S244. If the counter value is less than or equal to the capacity limit, no action is taken. If the counter value is greater than the capacity limit, a removal operation is performed. The removal operation does not directly delete memory; instead, it moves the read pointer forward by one element position (i.e., the read pointer points to the next element) and decrements the counter. In this way, the oldest data packet previously at the head of the queue is no longer included in the valid buffer, and its occupied memory space will be overwritten during the next write operation wraparound. In this manner, the buffer always maintains a number of elements that do not exceed the capacity limit, and these elements are always the most recent batch of data, accurately reflecting the device's recent operating state.
[0075] Step S250: Using the global reference clock as a reference, perform timestamp remapping on the status data packets in the circular queue-style data buffer of each device node to generate a real-time production line operation status stream that corresponds to the density of the time axis scale distribution and the fault sensitivity level of the device node.
[0076] Specifically, a timestamp remapping task is periodically executed. For each device node's circular queue-style data buffer, every status data packet is traversed from beginning to end. For each data packet, the currently stored timestamp identifier in its header is read. This timestamp may be the original or corrected in step S243. A global clock offset record table is accessed, which records the deviation value between the local clock of each sensing unit and the master clock server after the most recent clock synchronization. The clock offset corresponding to the source device of the current data packet is found in the table, and this deviation value is subtracted or added to the timestamp identifier of the data packet, thereby correcting it to the reference time axis of the master clock server. After the remapping is completed, the corrected timestamp is rewritten back to the data packet header. When all data packets of all device nodes have completed this transformation, from a global perspective, although the data points in the real-time operation status stream of the production line are discrete on the time axis, the distribution density of these discrete points precisely reflects the fault sensitivity level of the equipment. High-sensitivity devices, due to their short adaptive time windows and high data packet frequency, form dense scales on the global timeline; low-sensitivity devices, on the other hand, form sparse scales, thus achieving an optimal match between computing resources and monitoring focus.
[0077] Step S300: Input the real-time operation status stream of the production line into the pre-trained random forest augmentation classifier. The random forest augmentation classifier consists of multiple decision trees and introduces fault sample distribution weights during node splitting. By performing step-by-step decision branch traversal processing on the status data packet, it outputs a set of membership probability vectors of each device node belonging to various preset fault modes within the current time window.
[0078] In one implementation, step S300 may specifically include the following steps S310 to S350:
[0079] Step S310: Extract the state signal amplitude sequence of each device node in the current adaptive time window from the real-time operation status stream of the production line according to the device node identifier, and perform trend stabilization transformation on the state signal amplitude sequence to eliminate the periodic components and baseline drift in the sequence, and generate the detrended state feature vector of the device node.
[0080] In one implementation, step S310 may specifically include the following steps S311 to S315:
[0081] Step S311: Locate the start and end timestamps of the current adaptive time window in the real-time operation status stream of the production line. Based on the device node identifier, read all status data packets whose timestamps fall within the closed interval between the start and end timestamps from the circular queue data buffer of the corresponding device node. Extract the status signal amplitude of each status data packet to form the original amplitude sequence.
[0082] Specifically, the identifier of the device node to be analyzed is first obtained. Then, the currently active adaptive time window length is read from the data structure corresponding to that node. The end timestamp of the current analysis period is set as the nearest integer window boundary, and the start timestamp is equal to the end timestamp minus the adaptive time window length. For example, if the adaptive time window length is a certain value and the end timestamp is a certain moment, then the start timestamp is that moment minus that length. After obtaining the start and end timestamps, the circular queue-style data buffer of the device node is accessed. Since the elements in the circular queue are stored in timestamp order, a binary search method is used to quickly locate the position of the first element whose timestamp is greater than or equal to the start timestamp, and the position of the last element whose timestamp is less than or equal to the end timestamp. Then, all status data packets are read sequentially from these two positions. For each data packet read, its payload is parsed, and according to the data packet format description, the floating-point values representing the status signals are extracted. These floating-point values are placed into a dynamic array in the order of reading. The first element of the array corresponds to the amplitude of the earliest data packet in the window, and the last element corresponds to the amplitude of the latest data packet, thus constructing the original amplitude sequence.
[0083] Step S312: Perform a discrete Fourier transform on the original amplitude sequence to convert the time-domain amplitude sequence to the frequency domain and identify the dominant frequency component corresponding to the amplitude peak in the spectrum. Filter out the dominant frequency component and its harmonic components, and retain the remaining frequency domain components for inverse discrete Fourier transform to obtain the first intermediate sequence with periodic fluctuations removed.
[0084] In practical implementation, a Fast Fourier Transform (FFT) function library can be called, taking the original amplitude sequence obtained in step S311 as input. The length of this sequence is the number of sampling points. The function library performs a butterfly operation, outputting a complex array with the same length as the input sequence. Each complex number represents the amplitude and phase of the corresponding frequency component, i.e., the spectrum. This complex array is traversed, and the modulus of each complex number is calculated to obtain the amplitude spectrum. Local maxima are found in the amplitude spectrum, and the top few points with the largest amplitudes are selected. The frequency indices corresponding to these points are the dominant frequency components. Subsequently, based on these dominant frequency indices, the frequency indices corresponding to their second, third, and other harmonics are calculated. Next, a new array of the same size as the original spectrum array is created, and all complex numbers in the original spectrum except for the dominant frequencies and their harmonic indices are copied to the new array as is, while zeros are filled at the dominant frequencies and their harmonic indices. After completing the spectrum filtering, the Inverse Fast Fourier Transform (IFFT) function library is called, taking the filtered new complex array as input, and performing the inverse transform operation. The complex array output by the inverse transform has a real part that is the time-domain signal sequence after filtering out periodic components. Extracting the real part forms the first intermediate sequence.
[0085] Step S313: Perform local weighted regression scatter smoothing on the first intermediate sequence, calculate the weighted linear fit value in the neighborhood of each sampling point as the baseline estimate for that point, and subtract the corresponding baseline estimate from the original value of each sampling point in the first intermediate sequence to obtain the second intermediate sequence after removing trend drift.
[0086] In practice, each sampling point in the first intermediate sequence is traversed. Assuming the index of the current point is i, a neighborhood half-width parameter is pre-defined, which determines the number of neighboring points considered during regression for each point. For point i, a neighborhood window centered on i and with a width of twice the half-width plus one is defined. The index range of points within the window extends from i minus the half-width to i plus the half-width. The sequence values corresponding to these neighboring points are extracted from the first intermediate sequence. For each neighboring point j within the window, its temporal distance to the center point i is calculated, and a weight value is calculated based on a weighting function, such as a cubic weighting function, which is inversely proportional to the distance. Subsequently, a weighted linear regression is performed on all neighboring points within the window. The goal of the regression is to find a straight line that minimizes the sum of the squared weighted vertical distances from all neighboring points to this line. After solving for the intercept and slope of the line, the value of the line at the independent variable equal to the center point i (i.e., the intercept plus the slope multiplied by i) is used as the baseline estimate for point i. After performing the above calculations for all points, a baseline estimate sequence of the same length as the original sequence is obtained. Finally, the value of each point in the first intermediate sequence is subtracted from the baseline estimate at the corresponding position, and the new sequence formed by the difference is the second intermediate sequence after removing the trend drift.
[0087] Step S314: Detect whether there are outliers in the second intermediate sequence whose amplitude exceeds the preset normal fluctuation range, locate the time position of the outlier and replace it with the median of the amplitude in the neighborhood window before and after the point, to obtain a smoothed detrended sequence after outlier suppression processing.
[0088] Specifically, the system first reads the preset lower and upper limits of the normal fluctuation range from the configuration file. Then, it iterates through each sampling point in the second intermediate sequence. For the currently traversed point, its amplitude is compared with the lower and upper limits. If the amplitude is greater than or equal to the lower limit and less than or equal to the upper limit, the system continues processing the next point. If the amplitude is less than the lower limit or greater than the upper limit, the point is identified as an outlier and its index i is recorded. For each recorded index i, a neighborhood window is determined, for example, from index i minus the window length to index i plus the window length, excluding index i itself. The amplitudes of all points within this window are extracted from the second intermediate sequence to form an array. This array is sorted, and the value at the middle position is taken as the median. Then, this median is used to replace the original amplitude at index i in the second intermediate sequence. This replacement operation is performed sequentially on all marked outliers. After all outliers have been processed, the resulting second intermediate sequence becomes a smoother, detrended sequence that has undergone outlier suppression.
[0089] Step S315: Arrange the smoothed detrending sequence in chronological order and attach the device node identifier and the current adaptive time window identifier to generate the detrending state feature vector of the device node in the current diagnostic period.
[0090] After outlier suppression in step S314, the final smoothed detrended sequence is obtained. This sequence is stored in a dynamic array, creating a new data structure containing three main fields. The first field is the device node identifier, directly obtained from the current analysis context. The second field is the current adaptive time window identifier, which can be a composite string containing start and end timestamps. The third field is the feature data, i.e., the smoothed detrended sequence array obtained in step S314. This data structure is encapsulated and passed to the next stage processing module. At this point, a detrended state feature vector that can be directly analyzed by the random forest augmented classifier is constructed, accurately representing the essential fluctuation characteristics of the device after removing cycle and trend within the current diagnostic window.
[0091] Step S320: Input the detrended state feature vector in parallel to all decision trees of the random forest augmentation classifier. Each decision tree performs layer-by-layer discrimination on the detrended state feature vector based on the split feature index and split threshold stored in its root node and internal nodes, and descends along the path that meets the discrimination conditions until it reaches the leaf node.
[0092] In one implementation, step S320 may specifically include the following steps S321 to S325:
[0093] Step S321: Perform a structural traversal on each decision tree in the random forest augmentation classifier, extract the complete path set from the root node to all leaf nodes of each decision tree, and store the split feature index sequence and the corresponding split threshold sequence on each path as a path signature.
[0094] Specifically, after the random forest augmented classifier is trained and loaded into memory, a pre-computation task is triggered to traverse the decision tree array in the model. For each decision tree, a recursive traversal is performed starting from the root node. In the recursive function, two stacks are maintained: one to record the feature indices from the root to the current node, and the other to record the corresponding thresholds. Whenever an internal node is visited, the split feature index of that node is pushed onto the feature index stack, and the split threshold of that node is pushed onto the threshold stack. Then, its left and right child nodes are recursively visited. When a leaf node is visited, it is considered that a complete path has been found. The contents of the current feature index stack are copied into one array, and the contents of the threshold stack are copied into another array. These two arrays are then used as a joint key-value pair, associated with the current leaf node's number, and stored in a hash map. After processing the leaf node, the previously pushed elements are popped from both stacks, backtracking to the parent node, and continuing to traverse another branch. Once all leaf nodes of the entire tree have been traversed, all path signatures of the decision tree are constructed. After performing the same operation on all decision trees, a complete path signature library is obtained, which can be used for subsequent fast decision fingerprint mapping.
[0095] Step S322: Take the value of the feature component corresponding to the split feature index of the root node of the current decision tree from the detrended state feature vector, compare the feature component value with the split threshold of the root node, and select the left branch or the right branch to enter the next layer node according to the comparison result.
[0096] After obtaining the detrended state feature vector in step S315, the classification of the first decision tree begins. The data structure of the first decision tree is accessed to obtain a reference to its root node. The split feature index is read from the root node and used as a subscript to retrieve the corresponding feature component value from the feature vector array. Next, the split threshold is read from the root node, and the retrieved feature component value is compared with the split threshold. If the feature component value is less than or equal to the split threshold, the current node pointer is updated to the left child node of the root node; if the feature component value is greater than the split threshold, the current node pointer is updated to the right child node of the root node.
[0097] Step S323: Repeat the operation of comparing the value of the feature component with the splitting threshold. When entering a layer of nodes, extract the corresponding feature component from the detrended state feature vector according to the splitting feature index stored in the node until the leaf node position where splitting can no longer be reached, and record the node number of the leaf node.
[0098] In practice, the process involves a loop. At the beginning of each iteration, the type of the node pointed to by the current node pointer is checked. If the node contains references to both its left and right children, it is an internal node, and processing continues. The splitting feature index is read from this internal node, and the corresponding feature component value is retrieved from the feature vector using that index. Then, the splitting threshold of the node is read, compared, and the current node pointer is updated to indicate its left or right child based on the comparison result. The loop then returns to the beginning, and the new node pointer is checked again. If the node pointed to by the current node pointer has no children (i.e., it is a leaf node), the loop is exited. After exiting the loop, the number of this leaf node is recorded; this number is a unique identifier for each leaf node in the tree. For example, if the feature vector has undergone multiple comparisons and finally reaches a leaf node with a certain number, that number is recorded.
[0099] Step S324: Map the node number to the pre-stored path signature library, reverse-parse out all the branch decision sequences from the root node to the leaf node, and encode the branch decision sequences into binary vectors as the decision fingerprint of the decision tree for the current state feature vector.
[0100] Specifically, after obtaining the leaf node number, the path signature hash map corresponding to the decision tree is immediately accessed. This map uses the leaf node number as the key and a pair of arrays as values. Using the number as the key, two arrays are obtained from the map: a feature index array and a threshold array. The length of these two arrays is the depth from the root to the leaf node. To generate the decision fingerprint, it is necessary to know which branch was actually selected at each internal node. For this purpose, backtracking calculation is performed by combining the feature vector and the threshold array. The feature index array is traversed. For the k-th feature index, the corresponding feature value is taken from the feature vector and compared with the k-th threshold in the threshold array. If the feature value is less than or equal to the threshold, it means that the left branch was selected, and the k-th bit of the binary bit is set to zero; if it is greater than the threshold, it means that the right branch was selected, and the k-th bit of the binary bit is set to one. After traversing all depths, a binary vector with a length equal to the path depth is obtained. This vector completely records every step of the selection of the feature vector from the root to the leaf, and therefore can be used as the unique decision fingerprint of the decision tree for this feature vector.
[0101] Step S325: Collect the leaf node numbers and corresponding decision fingerprints output by all decision trees to obtain a set of leaf node indices and a set of decision fingerprints of the same length as the number of decision trees in the random forest augmented classifier.
[0102] Specifically, a loop iterates through all decision trees in the random forest. For each decision tree pointed to by the loop index, steps S322 to S324 are called to obtain the leaf node number and decision fingerprint of that tree. The leaf node number is appended to the end of a pre-created integer array, and the decision fingerprint (in the form of a binary string or an integer bitmask) is appended to the end of another pre-created array. After the loop has traversed all decision trees, the length of both arrays is equal to the number of decision trees in the forest. These two sets fully reflect the collective decision-making process of the entire random forest for the current input feature vector. The leaf node index set is used for subsequent fast querying of class counts, while the decision fingerprint set can be used for feature importance analysis or model interpretation.
[0103] Step S330: Read the fault category count vector stored in the leaf node of each decision tree. The fault category count vector records the distribution of the number of various fault samples covered by the leaf node during the training phase. Perform sum normalization on the fault category count vector to generate the fault category probability distribution of the decision tree for the current detrended state feature vector.
[0104] Specifically, the leaf node index set obtained in step S325 is traversed. For each leaf node number in the set, the storage area of that leaf node is located in the model data structure in memory based on the identifier of the current decision tree and the number. This storage area contains a fixed-length floating-point array, where each position corresponds to a fault category. This array is read to obtain a fault category count vector. Subsequently, the sum of all elements in this vector is calculated. If the sum is zero, to avoid division by zero errors, the vector is set to a uniform distribution. Otherwise, each element in the vector is traversed, and the value of each element is divided by the calculated sum to obtain a new floating-point number. After all elements have been divided, this newly generated vector is the fault category probability distribution of the decision tree for the current input feature vector. This probability distribution vector is associated with the corresponding decision tree index and temporarily stored in memory, awaiting the subsequent weighted fusion step.
[0105] Step S340: Collect the fault category probability distributions output by all decision trees in the random forest augmented classifier, perform a weighted average operation on the probability values of the same fault category, where the weight of each decision tree is proportional to its classification accuracy on the validation set, and calculate the fused global fault category probability distribution.
[0106] For example, first, a weight array is read from the model metadata. This array, pre-calculated after training, stores the classification accuracy of each decision tree on an independent validation set. An accumulation array of equal length to the number of fault categories and a weight sum variable are created, and all elements of the accumulation array are initialized to zero. Then, the list of probability distribution vectors corresponding to the decision trees, generated in step S330, is traversed. For the probability distribution vector of the i-th tree currently being traversed, the weight value of that tree is obtained. For each fault category index in the probability distribution vector, the probability value of the current category is multiplied by the weight, and the multiplication is accumulated and added to the corresponding index position in the accumulation array. Simultaneously, the weight is added to the weight sum variable. After all the probability distribution vectors of all decision trees have been processed, the accumulation array is traversed again, and each accumulated value in the array is divided by the weight sum variable to obtain the final weighted average probability value. A new vector composed of these values arranged in the original fault category order is the fused global fault category probability distribution.
[0107] Step S350: Select a forward fault category set from the global fault category probability distribution, arranging the probability values from high to low. Encapsulate each fault category and its corresponding probability value in the forward fault category set into a tuple, and attach the address identifier of the current device node and the end timestamp of the current adaptive time window to generate the membership probability vector set of the device node.
[0108] First, an empty list is created to store the filtered result tuples. Then, the global fault category probability distribution vector obtained in step S340 is traversed, and each fault category index and its corresponding probability value are treated as a temporary structure and placed into an auxiliary array. After traversal, this auxiliary array is sorted in descending order of probability values. After sorting, starting from the head of the array, the first few elements are taken, for example, the first three or five, the specific number determined by preset parameters. For each taken element, a tuple is created, which can be a key-value pair containing two fields: the first field is the fault category identifier, and the second field is the probability value. These tuples are then placed into the previously created list. Finally, a final output object is constructed. This object contains three main parts: the first part is the device address identifier, obtained directly from the current analysis context; the second part is the end timestamp of the current adaptive time window; and the third part is the aforementioned list. Serializing this object yields the set of membership probability vectors for the device node within the current diagnostic cycle, concisely representing the most likely fault modes the device will face and their probabilities.
[0109] Step S400: Traverse the equipment nodes in the production line equipment association graph, take the fault modes that exceed the preset confidence threshold in the membership probability vector set as the activation nodes, perform a breadth-first search along the connection edge direction, record the fault activation node sequence and the time difference of state changes between nodes, and generate the fault propagation direction sequence and the time delay distribution of fault transfer between equipment.
[0110] In one implementation, step S400 may specifically include the following steps S410 to S450:
[0111] Step S410: Parse the membership probability vector set of each device node, extract the fault mode identifier and corresponding membership probability value of each candidate fault mode, compare the membership probability value with the preset confidence threshold, filter out the fault modes whose membership probability value is greater than or equal to the preset confidence threshold, mark the device node as the active node of the fault mode, and record the activation time as the end timestamp of the current adaptive time window.
[0112] Specifically, the process iterates through all device nodes in the production line equipment association graph. For the current node, it reads the membership probability vector set generated by the most recent analysis from its data structure, iterates through each tuple in this set, and each tuple contains a fault mode identifier and a membership probability value. It also reads the pre-set confidence threshold value from the global configuration. For each tuple, its probability value is compared with the threshold. If the probability value is less than the threshold, the tuple is ignored, and the process continues to the next one. If the probability value is greater than or equal to the threshold, the current device node is determined to be active for this fault mode. An activation marker object is created in the memory of the current node, containing two attributes: the active fault mode identifier, taken from the tuple; and the activation time, taken from the current adaptive time window end timestamp attached to the membership probability vector set. This activation marker object is appended to the device node's temporary attributes for use in subsequent search steps.
[0113] Step S420: Using the marked activation node as the search source, traverse the neighboring device nodes that have direct outgoing edges associated with the search source based on the direction attribute of the connecting edges in the production line equipment association graph, and check whether the membership probability vector set of the neighboring device nodes contains activation markers with the same fault mode identifier as the search source.
[0114] In one implementation, step S420 may specifically include the following steps S421 to S425:
[0115] Step S421: Read all outgoing edge records associated with the search source point stored in the production line equipment association map. Each outgoing edge record includes the identifier of the neighboring device node it points to, the physical medium type of the connecting edge, and the signal flow direction identifier.
[0116] For example, in the memory representation of the current search source node, its outgoing edge list is accessed. This list, generated during graph construction in step S100, stores all directed edges originating from that node. Each outgoing edge record in this list is traversed. For each record, three fields are parsed: neighbor device node identifier, a string used to locate neighbor nodes in the graph database; physical medium type, such as "industrial Ethernet" or "mechanical conveyor belt"; and signal flow direction identifier, such as "unidirectional" or "bidirectional".
[0117] Step S422: Based on the signal flow direction identifier, filter out the outgoing edge records that are consistent with the actual material flow direction or the direction of control command issuance on the production line, and remove outgoing edge records whose signal flow direction identifier is reverse or bidirectional and is not the mainstream direction, to obtain the effective search edge set.
[0118] For example, when traversing the outgoing edge records obtained in step S421, the signal flow direction identifier of each record is judged. Internally, a definition of "mainstream direction" is maintained. For instance, on a production line, material flows from the press to the conveyor belt, and then to the detector; this direction is defined as the mainstream direction. If the signal flow direction identifier is explicitly marked as "reverse," or marked as "bidirectional" but the current direction is opposite to the mainstream direction, this record is skipped and not included in subsequent processing. If the signal flow direction identifier is "unidirectional" and the direction is the same as the mainstream direction, or is "bidirectional" and the current traversal direction is the same as the mainstream direction, this record is retained and added to a new list. After traversing all outgoing edges, this new list is the set of valid search edges.
[0119] Step S423: Locate the corresponding neighbor device node along each valid search edge in the set of valid search edges, and extract the fault mode identifiers of all candidate fault modes from the membership probability vector set of the neighbor device node.
[0120] In the actual execution process, the set of valid search edges is traversed. For each edge in the set, based on its neighboring device node identifier, the corresponding neighboring node object is quickly found in the node mapping table in memory. The temporary attribute region of the neighboring node object is accessed to find its membership probability vector set. Each tuple in this set is traversed, and the fault mode identifier field is extracted from each tuple. These identifiers are then added one by one to a temporary string list. After traversing the set, this temporary list contains all the diagnosed candidate fault mode identifiers for that neighboring node.
[0121] Step S424: Perform a string-complete match between each extracted fault mode identifier and the fault mode identifier of the currently active fault mode of the search source point. If a matching fault mode identifier exists, then further obtain the membership probability value corresponding to the matching fault mode.
[0122] Specifically, the activation flag of the current search source node is obtained, and the activated fault mode identifier, such as "bearing wear," is read from it. Then, the list of neighbor node fault mode identifiers generated in step S423 is traversed. For each identifier string in the list, a string comparison function is called to compare it with the activated fault mode identifier of the source node. If the comparison result is equal, it means that the match is successful. This successfully matched identifier is immediately recorded, and based on this identifier, the set of membership probability vectors of the neighbor nodes is returned to find the corresponding pair, the membership probability value is read from it, and this probability value is temporarily stored.
[0123] Step S425: Compare the obtained membership probability value with the preset confidence threshold for the second time. After confirming that the membership probability value is not lower than the preset confidence threshold, mark the neighboring device node as an active node with the same fault mode identifier, and record the fault mode identifier of the successful match and the identifier of the currently valid search edge.
[0124] After obtaining the membership probability value corresponding to the matching failure mode in step S424, this probability value is immediately compared with a preset confidence threshold for the second time. If the probability value is less than the threshold, the neighbor node is ignored and no labeling is performed. If the probability value is greater than or equal to the threshold, the neighbor node is confirmed to be the active node of the failure mode, and a new activation label object is created for this neighbor node. This object contains the active failure mode identifier and the activation time of the node. At the same time, a propagation record is recorded, which contains the identifier of the currently valid search edge and the identifier of the successfully matched failure mode.
[0125] Step S430: If a neighboring device node contains an activation flag with the same fault mode identifier, calculate the time difference between the activation time of the neighboring device node and the activation time of the search source node as the propagation time delay, and record the directed edge identifier from the search source node to the neighboring device node and the corresponding propagation time delay.
[0126] After step S425 completes the marking of neighboring nodes, delay calculation is immediately performed. The activation time is read from the activation marking object of the search source node and denoted as time A. The activation time is read from the newly created activation marking object of the neighboring node and denoted as time B. The difference between time B and time A is calculated; this difference may be positive or zero and is used as the propagation time delay. Then, the identifier of the currently processed valid search edge is obtained, such as the unique ID of this edge. A record with two fields is created: the directed edge identifier field is filled with the ID of the edge, and the propagation time delay field is filled with the calculated time difference. This record is stored in a global list for subsequent statistical analysis.
[0127] Step S440: Add neighboring device nodes to the search queue, take out nodes from the search queue one by one as new search source points, and repeat the outgoing edge traversal and activation mark check operation until the search queue is empty or no unvisited device nodes with the same fault mode activation mark are found.
[0128] In one implementation, step S440 may specifically include the following steps S441 to S445:
[0129] Step S441: Initialize the first-in-first-out queue structure and push the initial search source point to the tail of the queue. At the same time, create a global set of visited nodes to store the identifiers of all device nodes that have performed outbound edge traversal operations.
[0130] Before initiating the propagation search for a specific fault mode, an empty queue instance is first created. Then, all nodes in the production line equipment association graph are traversed to find those nodes marked as active for that fault mode in step S410. For each initially active node found, its device node identifier is pushed to the tail of the queue. Simultaneously, an empty hash set is created to store the identifiers of visited nodes. At this point, the search initialization is complete.
[0131] Step S442: Pop a device node from the head of the first-in-first-out queue as the current traversal node, and add the device node identifier of the current traversal node to the global set of visited nodes.
[0132] At the beginning of each iteration of the loop, check if the queue is empty. If it is not empty, perform a dequeue operation, retrieve a device node identifier from the head of the queue, and locate the corresponding node object in memory based on this identifier. Then, add this node identifier to the set of visited nodes to ensure that it will not be processed as a source node again in subsequent iterations.
[0133] Step S443: Obtain the set of valid search edges for the currently traversed node, traverse the neighbor device nodes corresponding to each valid search edge, and if the neighbor device node is not in the global set of visited nodes and meets the same fault mode activation flag condition, push the neighbor device node identifier into the tail of the first-in-first-out queue and record the propagation relationship of the neighbor device node relative to the currently traversed node.
[0134] In the specific execution process, steps S421 and S422 are performed on the current node to obtain a set of valid search edges. For each valid search edge in the set, the neighbor node object is found based on its neighbor node identifier. First, it is checked whether the neighbor node identifier exists in the set of visited nodes. If it exists, it means that the node has already been processed as a source node or is waiting to be processed in the queue, so this edge is skipped and the next one is processed. If it does not exist, the checking logic of steps S423 to S425 is executed to determine whether the neighbor node is activated by the same failure mode and whether its probability value exceeds the threshold. If the check passes, the neighbor node identifier is pushed to the end of the queue so that it can be used as a new source node for future searches. At the same time, the propagation relationship from the current node to the neighbor node is recorded, including the current node identifier, the neighbor node identifier, the edge identifier traversed, and the calculated propagation time delay.
[0135] Step S444: Whenever a new neighbor device node identifier is pushed into the first-in-first-out queue, an incremental fault propagation path extension event is triggered, and a fault propagation tree branch is constructed with the currently traversed node as the parent node and the newly pushed node as the child node.
[0136] In the specific implementation, after performing the push-in operation in step S443, a path recording function is immediately called. This function receives three parameters: the identifier of the currently traversed node, the identifier of the newly pushed neighbor node, and the identifier of the valid search edge connecting them. The function inserts this information as a new node into a tree structure that is being built. This tree structure is rooted at the initial search source node, and each push of a new node is equivalent to a new leaf growing on the tree. In this way, the complete path topology of fault propagation can be dynamically constructed.
[0137] Step S445: Repeat the iterative operations of popping a node from the head of the FIFO queue, traversing valid search edges, and pushing unvisited active neighbor nodes until the FIFO queue is empty and no unvisited active neighbor device node can be found within the valid search edge range of the currently traversed node. Terminate the propagation search process of the current fault mode and output the complete sequence of fault active nodes.
[0138] Specifically, the loop consisting of steps S442 to S444 is executed continuously. In each loop, a node is taken from the head of the queue for processing, and new nodes may be pushed to the tail of the queue during processing. When all possible paths have been explored, no new nodes are pushed into the queue, and the nodes at the head of the queue are gradually removed. At this point, an empty queue is detected, the loop condition is no longer met, and the loop terminates. After the loop terminates, an output function is called to organize all the node identifiers recorded during the entire search process, marked as active, into a node sequence according to their hierarchical order in the fault propagation tree. This sequence is the sequence of active fault nodes for this fault mode in this round of diagnosis, completely depicting the trajectory of the fault propagation from its initial source point between devices.
[0139] Step S450: Summarize all recorded directed edge identifiers, propagation directions, and propagation time delays. Organize the directed edge identifiers into a fault propagation direction sequence according to the search access order. Classify all propagation time delays according to the corresponding directed edge identifiers and calculate the time delay statistical distribution under each directed edge identifier to generate the time delay distribution of fault transfer between devices.
[0140] In the specific execution process, after completing the search for all initial source points and all failure modes, a list recording multiple propagation events is obtained. Each record in this list is traversed. For each record, the directed edge identifier and propagation time delay are extracted. First, the directed edge identifier of this record is appended to the end of a global failure propagation direction sequence, which reflects the macroscopic path of failure propagation according to the chronological order of the records. Simultaneously, using the directed edge identifier as the key, the corresponding value is searched in a hash map. This value is an array used to store the propagation time delay of all events passing through this edge. If found, the propagation time delay of the current record is appended to this array; if not found, a new array is created, the current delay is placed inside, and this array is then stored in the map as a value associated with the directed edge identifier. After all records have been processed, this hash map is traversed. For each key-value pair in the map, statistical analysis is performed on the delay array corresponding to the directed edge identifier. For example, the array is sorted, the median, interquartile range, and mean are calculated, and these statistics are encapsulated into a descriptive object. Ultimately, two results are output: one is a sequence of fault propagation directions composed of directed edge identifiers, and the other is a mapping with directed edge identifiers as keys and time delay statistical description objects as values, that is, the time delay distribution of fault transfer between devices.
[0141] Step S500: Encode the fault propagation direction sequence and time delay distribution into a fault evolution path diagram with a unified time base, calculate the fault arrival probability and expected affected equipment range of each propagation path based on the fault evolution path diagram, generate a production line fault prediction and early warning instruction containing fault identifier, expected occurrence time and list of affected equipment, and push the production line fault prediction and early warning instruction to the production line centralized monitoring platform.
[0142] In one implementation, step S500 may specifically include the following steps S510 to S550:
[0143] Step S510: Construct an initial fault evolution directed graph structure using device nodes in the fault propagation direction sequence as vertices, directed edge identifiers as directed edges, and the statistical mode of the corresponding directed edge identifiers in the time delay distribution as edge weights.
[0144] In practice, an empty graph object is first created, containing a set of vertices and edges. The fault propagation direction sequence output in step S450 is traversed. For each directed edge identifier in the sequence, the starting and ending device node identifiers connected by the edge are parsed out, and these two node identifiers are added to the vertex set of the graph. Then, based on the directed edge identifier, the corresponding statistical description object is found from the time delay distribution map output in step S450. The prominent numerical segment is extracted from this object and used as the weight of the edge. A record is added to the edge set of the graph object, containing the starting node, ending node, edge identifier, and edge weight. After traversing the entire propagation direction sequence, an initial fault evolution directed graph structure based on the actual propagation data is obtained.
[0145] Step S520: Scan the initial fault evolution directed graph, identify and merge multiple parallel directed edges that connect the same starting vertex and the same ending vertex, weight the edge weights of the multiple parallel directed edges according to their occurrence frequency, generate a unique directed edge and the integrated edge weight, and output a simplified fault evolution path graph.
[0146] In the specific execution process, all edges in the initial fault evolution directed graph constructed in step S510 are traversed, and a new hash map is created. The key is a composite key consisting of a start node and an end node, and the value is a structure containing a weight list and a counter. For each edge currently traversed, its start and end nodes are extracted, a composite key is generated, and the key is searched in the hash map. If found, the weight of the current edge is added to the weight list corresponding to the key, and the counter is incremented. If not found, a new list is created, the weight of the current edge is added, the counter is initialized to one, and the composite key and this new structure are associated and stored in the map. After traversing all edges, the hash map is traversed again. For each key-value pair in the map, a weighted average is calculated for its weight list. The weighted average is calculated by multiplying each weight value in the weight list by its frequency, summing the results, and then dividing by the total frequency of all weight values. The calculated results serve as the integrated edge weights. The start and end nodes are then resolved based on the composite keys. All existing parallel edges connecting these two nodes are deleted from the graph object, and a new directed edge with the calculated integrated weight is added. After processing all composite keys, the resulting graph is the simplified fault evolution path graph.
[0147] Step S530: Locate the device node with an in-degree of zero from the simplified fault evolution path graph as the potential fault source node, extract the device node identifier of the potential fault source node and its fault mode identifier activated in the current time window, and set the activation time of the potential fault source node as the propagation start time.
[0148] Traverse all vertices in the simplified fault evolution path graph output in step S520. For each vertex, count the number of directed edges pointing to it, i.e., the in-degree. If the in-degree is zero, mark the vertex as a potential fault source node. Based on the vertex's identifier, locate the activation marker object created in step S410 in memory. Read two pieces of information from the activation marker object: the activated fault mode identifier and the activation time. Temporarily store these three pieces of information—device node identifier, fault mode identifier, and activation time—as a triple. This triple defines the starting point, fault type, and time base of fault propagation.
[0149] Step S540: Starting from the potential fault source node, perform a forward topological traversal along the directed edges of the simplified fault evolution path graph. For each directed edge encountered, add the current cumulative time offset to the edge weight of that directed edge. When reaching the downstream node, add the current cumulative time offset to the propagation start time to generate the expected fault occurrence time of that downstream node.
[0150] In one implementation, step S540 may specifically include the following steps S541 to S545:
[0151] Step S541: Initialize a distance label for each vertex in the simplified fault evolution path graph, set the distance label of the potential fault source node to zero, and set the distance label of the remaining vertices to an infinity symbol.
[0152] During execution, all vertices in the simplified fault evolution path graph are traversed. For each vertex, a field named "distance label" is added to its data structure. If the vertex's identifier is the same as the identifier of the potential fault source node determined in step S530, the value of the distance label field is set to zero. For all other vertices, the value of the distance label field is set to a special extremely large value, such as a number much larger than the sum of any possible paths, representing infinity in the program logic.
[0153] Step S542: Traverse all vertices according to the topological order of the simplified fault evolution path graph. When visiting the current vertex, traverse all directed edges originating from the current vertex. For each neighboring vertex pointed to by a directed edge, calculate the sum of the distance label of the current vertex and the weight of the directed edge.
[0154] First, the simplified fault evolution path graph is topologically sorted to obtain a linear sequence of vertices. Then, each vertex is visited sequentially according to this sequence. For the currently visited vertex, its current distance label is obtained. If the value is infinite, it means the source vertex cannot reach this vertex, so it is skipped, and the next vertex in the sequence is processed. If the value is not infinite, all directed edges originating from this vertex are traversed. For each directed edge, its pointed-to neighboring vertices are obtained, and the weight of this edge is read. A candidate distance is calculated, which is equal to the distance label of the current vertex plus the weight of the edge.
[0155] Step S543: Compare the calculated cumulative sum with the currently stored distance label of the neighboring vertex. If the cumulative sum is less than the distance label of the neighboring vertex, update the distance label of the neighboring vertex with the cumulative sum, and record the predecessor vertex identifier and the directed edge identifier from the current vertex to the neighboring vertex.
[0156] In the specific execution process, the candidate distance calculated in step S542 is compared with the current distance label of the neighboring vertex. If the candidate distance is less than the distance label of the neighboring vertex, the distance label of the neighboring vertex is updated to this smaller candidate distance. Simultaneously, two pieces of information are recorded in the neighboring vertex data structure: the predecessor vertex identifier (i.e., the identifier of the current vertex); and the directed edge identifier (i.e., the identifier of the edge currently being processed). This record indicates which node and which edge the shortest path to the neighboring vertex originates from. If the candidate distance is greater than or equal to the original distance label of the neighboring vertex, no update is made.
[0157] Step S544: Repeat the vertex access and distance label relaxation operation until the distance labels of all vertices in the simplified fault evolution path graph no longer change. At this point, the distance label of each vertex represents the minimum cumulative time offset from the potential fault source node to that vertex.
[0158] Here, repeatedly performing vertex visits and distance label relaxation operations may require traversing all vertices multiple times. This is because after each traversal, the distances of some nodes are updated, potentially shortening the paths to subsequent nodes. The convergence condition is reached when the distance labels of all vertices in the simplified fault evolution path graph no longer change. At this point, the distance label of each vertex represents the minimum cumulative time offset from the potential fault source node to that vertex, which is the final result of the shortest path algorithm.
[0159] In practical implementation, steps S542 and S543 can be repeated. Each execution iterates through all vertices, setting a flag variable, initially true. At the start of each iteration, the flag is set to false. In step S543, if any distance label update operation occurs, the flag is set to true. After one iteration, the flag is checked. If the flag is true, it means there was an update in this iteration, and the next iteration is needed; if the flag is false, it means the distance labels of all vertices have stabilized, no update has occurred, the algorithm converges, and the loop terminates. After the loop terminates, the value stored in the distance label field of each vertex is the shortest cumulative time offset required to propagate from the source vertex to that vertex.
[0160] Step S545: Algebraically superimpose the activation time of the potential fault source node with the minimum cumulative time offset of each vertex to generate the expected fault occurrence time of each vertex, and use the directed edge sequence corresponding to the updated trajectory of each vertex's distance label as the dominant fault propagation path.
[0161] The activation time of the potential fault source node is algebraically superimposed with the minimum cumulative time offset of each vertex. This adds the activation time of the source node to the cumulative time offset of each node, yielding the specific time point at which each node is expected to fail. A list of expected fault occurrence times is generated for each vertex. The directed edge sequence corresponding to the updated trajectory of each vertex's distance label is then used as the dominant fault propagation path. This is achieved by tracing back from the source node to each node based on the predecessor information recorded by each node, forming one or more paths. These paths represent the dominant paths most likely to propagate the fault.
[0162] For example, all vertices in the simplified fault evolution path graph are traversed. For each vertex, its distance label is read, the activation time of the potential fault source node is obtained from step S530, and the expected fault occurrence time of the vertex is calculated, which is equal to the activation time of the source node plus the distance label of the vertex. This expected occurrence time is stored in a temporary field of the vertex. Simultaneously, to output the dominant fault propagation path, starting from each non-source vertex, based on its recorded predecessor vertex and predecessor edge identifiers, the path is backtracked to the source node, recording all directed edge identifiers traversed during the backtracking process. These directed edge identifiers are arranged in order from the source to the current vertex, thus forming a dominant propagation path from the source to the current vertex. The paths of all vertices are summarized to obtain the set of dominant propagation paths for the entire fault evolution graph.
[0163] Step S550: Collect the expected occurrence time of the faults of all downstream nodes and the corresponding equipment node identifiers and fault mode identifiers. Using the fault mode identifiers of potential fault source nodes as indexes, generate a production line fault prediction and early warning instruction containing fault source identifiers, fault mode categories, expected occurrence time lists, and affected equipment identifier lists.
[0164] Specifically, an empty list of expected occurrence times and an empty list of affected device identifiers are created. All non-source vertices (i.e., all downstream nodes) in the simplified fault evolution path graph are traversed. For each downstream node, its expected occurrence time is appended to the expected occurrence time list, its device node identifier is appended to the affected device identifier list, and the identifiers of potential fault source nodes and active fault mode identifiers are obtained from step S530. Finally, an early warning instruction object is constructed, containing four main fields: the fault source identifier field is filled with the identifiers of potential fault source nodes; the fault mode category field is filled with the active fault mode identifier; the expected occurrence time list field is filled with the newly constructed expected occurrence time list; and the affected device identifier list field is filled with the newly constructed device identifier list. This object is serialized according to a predefined format to obtain a complete production line fault prediction early warning instruction.
[0165] In one implementation, step S500 may further include the following steps S560 to S5100:
[0166] Step S560: Extract the time delay distribution corresponding to each directed edge in the simplified fault evolution path graph, and calculate the ratio of the interquartile range to the median of the time delay distribution as the propagation stability descriptor of the directed edge. The propagation stability descriptor is positively correlated with the dispersion of the time delay distribution.
[0167] Extracting the time delay distribution corresponding to each directed edge in the simplified fault evolution path graph involves returning to the original time delay distribution data generated in step S450 and obtaining all delay samples corresponding to each directed edge. The ratio of the interquartile range to the median of the time delay distribution is calculated as the propagation stability descriptor for that directed edge. The interquartile range is the difference between the third quartile and the first quartile in the distribution, representing the dispersion of the middle 50% of the data. The median is the center of the distribution. The larger this ratio, the greater the dispersion of the data relative to the center value, i.e., the more unstable the propagation time. The propagation stability descriptor is positively correlated with the dispersion of the time delay distribution, clarifying the physical meaning of this descriptor.
[0168] In the specific execution process, each directed edge in the simplified fault evolution path graph is traversed. For the current edge, its directed edge identifier is used as the key to retrieve the original list of all propagation time delay values corresponding to that edge from the original time delay distribution map stored in step S450, and this list is sorted. Then, the median is retrieved at the middle position of the sorted list, the first quartile is retrieved at the quarter position, and the third quartile is retrieved at the three-quarter position. The interquartile range (interquartile distance), i.e., the third quartile minus the first quartile, is calculated, and the ratio of the interquartile range to the median is calculated. This ratio is the propagation stability descriptor of the directed edge, and this descriptor is stored as a new attribute in the edge's data structure in the graph object.
[0169] Step S570: Map the propagation stability descriptor of each directed edge to the interval range to generate the failure propagation probability value of the directed edge. The larger the propagation stability descriptor, the smaller the failure propagation probability value, and the smaller the propagation stability descriptor, the larger the failure propagation probability value.
[0170] In the specific implementation, each directed edge is traversed, and its propagation stability descriptor is read. A mapping function, such as a linearly decreasing function, is predefined, setting a maximum and a minimum expected value for the descriptor, and setting the probability value to range from zero to one. If the descriptor is less than or equal to the minimum expected value, the failure propagation probability value is set to an upper limit close to one; if the descriptor is greater than or equal to the maximum expected value, the probability value is set to zero; if it is between the two, it is linearly mapped proportionally. Specifically, the difference between the descriptor and the minimum expected value is calculated, divided by the difference between the maximum and minimum expected values, to obtain a normalized proportional value. Then, this proportional value is subtracted from one to obtain the failure propagation probability value. This calculated probability value is also stored as a new attribute in the edge data structure, alongside the propagation stability descriptor.
[0171] Step S580: Starting from the potential fault source node, multiply the fault propagation probability value of the directed edge level by level along the directed edge direction to calculate the cumulative fault probability value reaching each downstream vertex.
[0172] In practice, a variant similar to the shortest path algorithm but with multiplication can be used. Each vertex is initialized with a cumulative probability label, with the source vertex's cumulative probability label set to one and the remaining vertices set to zero. Vertices are traversed in topological order. For the current vertex, all its outgoing edges are traversed. For each neighboring vertex pointed to by an outgoing edge, a candidate cumulative probability is calculated, equal to the current vertex's cumulative probability label multiplied by the fault propagation probability of that edge. This candidate cumulative probability is compared with the neighboring vertex's current cumulative probability label. If the candidate cumulative probability is greater than the neighboring vertex's current cumulative probability label, the neighboring vertex's cumulative probability label is updated with the candidate value, and the path is recorded. After the traversal is complete, the cumulative probability label of each vertex represents the cumulative fault probability of reaching that vertex from the source vertex along the most probable path.
[0173] Step S590: Remove downstream vertices whose cumulative failure probability value is lower than the preset probability maintenance limit from the simplified failure evolution path graph, and re-execute the forward topology traversal and failure prediction time calculation operation on the pruned simplified failure evolution path graph.
[0174] In the specific implementation, after calculating the cumulative failure probability of all vertices in step S580, all vertices in the graph are traversed. For each vertex, its cumulative probability value is compared with a preset probability maintenance limit. If the cumulative probability value is less than the limit, the vertex is marked as to be removed. At the same time, all incoming edges pointing to the vertex and outgoing edges originating from the vertex are also collected and marked as to be removed. After the traversal is completed, all marked vertices and edges are removed from the graph object. At this point, the simplified failure evolution path graph becomes a subgraph containing only high-probability nodes. Then, using this subgraph as input, the forward topology traversal in step S540 is re-executed, that is, starting from the source vertex and following the remaining high-probability paths, the minimum cumulative time offset and the expected failure occurrence time of each vertex are recalculated.
[0175] Step S5100: The recalculated expected occurrence time of the fault and the corresponding downstream vertex device identifier are incorporated into the expected occurrence time list and the affected device identifier list of the production line fault prediction and early warning instruction, and a field is appended to the end of the production line fault prediction and early warning instruction to store the cumulative fault probability value of each affected device node.
[0176] In the specific execution process, a new list of expected occurrence times and a new list of affected device identifiers are created. All non-source vertices in the trimmed subgraph are traversed. For each vertex, its recalculated expected occurrence time in step S590 is appended to the new list of expected occurrence times; its device node identifier is appended to the new list of affected device identifiers. The warning instruction object generated in step S550 is located, and its original list of expected occurrence times and list of affected device identifiers are replaced with the contents of these two new lists. Simultaneously, a new field is added to the warning instruction object, for example, named "Affected Device Cumulative Probability Mapping." All non-source vertices in the subgraph are traversed, and a key-value pair is constructed using the vertex identifier as the key and the cumulative failure probability value calculated in step S580 as the value. This key-value pair is then added to this newly added mapping field. After all updates are completed, the final production line failure prediction warning instruction not only includes the expected occurrence time and device range of the failure, but also provides the probability of failure for each affected device, making the warning information richer and more practical.
[0177] The above description is merely an embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of the present invention are included within the scope of protection of the present invention.
Claims
1. A smart production line fault prediction method based on random forest enhancement, characterized in that, The method includes: A production line equipment association map is generated based on the production line equipment connection relationship list and the historical operation record archive of each equipment. The production line equipment association map consists of equipment nodes that represent each processing equipment, conveying device and testing instrument and connection edges that represent the physical connection and data interaction relationship between equipment. An operation status archive generated based on historical maintenance logs and operation parameter records is attached to each equipment node. The system continuously receives real-time status signal sequences from sensor arrays deployed at various workstations and key parts of the equipment on the production line. The real-time status signal sequences are encapsulated into status data packets with timestamps and device address identifiers at a fixed time window as the acquisition granularity, thus obtaining the real-time operating status stream of the production line. The real-time operation status stream of the production line is input to a pre-trained random forest augmented classifier. The random forest augmented classifier consists of multiple decision trees and introduces fault sample distribution weights during node splitting. By performing step-by-step decision branch traversal processing on the status data packet, the set of membership probability vectors of each device node belonging to various preset fault modes within the current time window is output. Traverse the equipment nodes in the production line equipment association graph, take the fault modes that exceed the preset confidence threshold in the membership probability vector set as the activation nodes, perform a breadth-first search along the connection edge direction, record the fault activation node sequence and the time difference of state changes between nodes, and generate the fault propagation direction sequence and the time delay distribution of fault transfer between equipment. The fault propagation direction sequence and the time delay distribution are encoded into a fault evolution path diagram with a unified time reference. Based on the fault evolution path diagram, the fault arrival probability and expected range of affected equipment for each propagation path are calculated. A production line fault prediction and early warning instruction containing a fault identifier, the expected occurrence time and a list of affected equipment is generated. The production line fault prediction and early warning instruction is pushed to the production line centralized monitoring platform.
2. The intelligent production line fault prediction method based on random forest enhancement according to claim 1, characterized in that, The system continuously receives real-time status signal sequences from sensor arrays deployed at various workstations and key parts of the production line. These real-time status signal sequences are encapsulated into status data packets with timestamps and device address identifiers, collected at fixed time windows, resulting in a real-time production line operating status stream, including: The operation status files of each equipment node in the production line equipment association map are analyzed, and the statistical values of the status signal fluctuation frequency of each equipment node in the period before the historical failure occurred are extracted from the operation status files. The statistical values of the status signal fluctuation frequency are then mapped to the fault sensitivity level of the equipment node. According to the fault sensitivity level, a time window length adjustment coefficient is dynamically allocated to each device node. The higher the fault sensitivity level of the device node, the smaller the time window length adjustment coefficient. The fixed time window is scaled according to the time window length adjustment coefficient to generate an independent adaptive time window length for each device node. The sampling trigger interval of each sensing unit in the sensing array is reset with the length of the adaptive time window as the acquisition granularity, and an acquisition configuration instruction containing the new sampling trigger interval is issued to each sensing unit, so that the subsequently received status data packets carry a non-uniform timestamp interval that matches the fault sensitivity level of the device node. Receive status data packets encapsulated according to the non-uniform timestamp interval, and store them in the circular queue data buffer of the corresponding device node according to the device address identifier carried in the status data packets. The capacity of the circular queue data buffer of each device node is positively correlated with the fault sensitivity level of that device node. Using a global reference clock as a reference, the status data packets in the circular queue-style data buffer of each device node are timestamped and remapped to generate a real-time production line operation status stream that corresponds to the density of the time axis scale distribution and the fault sensitivity level of the device node.
3. The intelligent production line fault prediction method based on random forest enhancement according to claim 2, characterized in that, The step of resetting the sampling trigger interval of each sensing unit in the sensing array with the adaptive time window length as the acquisition granularity, and issuing an acquisition configuration command containing the new sampling trigger interval to each sensing unit, so that the subsequently received status data packets carry a non-uniform timestamp interval that matches the fault sensitivity level of the device nodes, also includes: Monitor the rate of change of the amplitude of the status signal of each device node within multiple consecutive adaptive time windows, calculate the difference of the sliding average value of the rate of change of the amplitude of the status signal between the current window and the historical window, and generate the operational stability index of the device node. The operational stability index is compared with a preset stability threshold range. If the operational stability index is lower than the lower limit of the stability threshold range, the device node is determined to be in a low-fluctuation steady state and a time window stretching operation is performed to increase the adaptive time window length of the device node. If the stability index is higher than the upper limit of the stability threshold range, the device node is determined to be in a high-fluctuation transient state and a time window compression operation is performed to reduce the adaptive time window length of the device node. The length of the stretched or compressed adaptive time window is re-encoded as the sampling trigger interval, and a dynamic configuration update command is sent to the corresponding sensor unit through the in-band management channel so that the sensor unit can use the updated sampling trigger interval in the next acquisition cycle. Record the adjustment time and adjustment range of the adaptive time window length of each equipment node, and store the adjustment time and adjustment range in the corresponding equipment node's operating status file in the production line equipment association map to obtain the dynamic adjustment trajectory of the time window.
4. The intelligent production line fault prediction method based on random forest enhancement according to claim 2, characterized in that, The process of receiving status data packets encapsulated according to the non-uniform timestamp interval and storing them in the circular queue data buffer of the corresponding device node based on the device address identifier carried in the status data packets, wherein the capacity of the circular queue data buffer of each device node is positively correlated with the fault sensitivity level of that device node, includes: Parse the timestamp identifier in the header of each status data packet, calculate the timestamp difference between the current status data packet and the previous status data packet on the same device node, and verify the consistency of the timestamp difference with the adaptive time window length of the current device node. If the deviation between the timestamp difference and the adaptive time window length exceeds the preset deviation tolerance, it is determined that the current status data packet has a timestamp marking abnormality, the status data packet is transferred to the abnormal data temporary storage area and the sensor unit clock self-calibration process is triggered. Extract the abnormal status data packet with timestamp from the abnormal data temporary storage area, correct the timestamp of the abnormal status data packet based on the linear interpolation result of the timestamps of the normal status data packets before and after the same device node, and rewrite the corrected timestamp into the header of the status data packet. The status data packets that have completed timestamp correction are inserted into the circular queue data buffer of the corresponding device node in the corrected timestamp order. At the same time, the upper limit of the capacity of the circular queue data buffer is calculated according to the fault sensitivity level of the device node. For each level increase in fault sensitivity, the buffer capacity is increased by a preset capacity increment. When the number of status data packets in the circular queue data buffer exceeds the capacity limit, the earliest arriving status data packet is removed from the head of the buffer to ensure that the buffer always stores the most representative real-time status signal sequence within the most recent time window of the device node.
5. The intelligent production line fault prediction method based on random forest enhancement according to claim 1, characterized in that, The real-time operating status stream of the production line is input into a pre-trained random forest augmented classifier. This random forest augmented classifier consists of multiple decision trees and incorporates fault sample distribution weights during node splitting. By performing a step-by-step decision branch traversal on the status data packet, it outputs a set of membership probability vectors for each device node belonging to various preset fault modes within the current time window, including: Extract the state signal amplitude sequence of each device node in the current adaptive time window from the real-time operation status stream of the production line according to the device node identifier, and perform trend stabilization transformation on the state signal amplitude sequence to eliminate the periodic components and baseline drift in the sequence, thereby generating the detrended state feature vector of the device node. The detrended state feature vector is input in parallel to all decision trees of the random forest augmentation classifier. Each decision tree performs layer-by-layer discrimination on the detrended state feature vector based on the split feature index and split threshold stored in its root node and internal nodes, and sinks down along the path that meets the discrimination conditions until it reaches the leaf node. Read the fault category count vector stored in the leaf node of each decision tree. The fault category count vector records the distribution of the number of various fault samples covered by the leaf node during the training phase. Perform sum normalization on the fault category count vector to generate the fault category probability distribution of the decision tree for the current detrended state feature vector. Collect the fault category probability distributions of all decision trees in the random forest augmented classifier, perform a weighted average operation on the probability values of the same fault category, where the weight of each decision tree is proportional to its classification accuracy on the validation set, and calculate the fused global fault category probability distribution. From the global fault category probability distribution, a forward fault category set is selected, arranged from high to low probability values. Each fault category and its corresponding probability value in the forward fault category set are encapsulated into a tuple, and the address identifier of the current device node and the end timestamp of the current adaptive time window are appended to generate the membership probability vector set of the device node.
6. The intelligent production line fault prediction method based on random forest enhancement according to claim 5, characterized in that, The process of inputting the detrended state feature vector into all decision trees of the random forest augmented classifier in parallel, with each decision tree performing layer-by-layer discrimination on the detrended state feature vector based on the split feature index and split threshold stored in its root node and internal nodes, descending along the path that satisfies the discrimination conditions until reaching the leaf node, includes: For each decision tree in the Random Forest Augmented Classifier, perform a structural traversal, extract the complete path set from the root node to all leaf nodes of each decision tree, and store the split feature index sequence and the corresponding split threshold sequence on each path as a path signature; The detrended state feature vector is compared with the feature component value corresponding to the split feature index of the root node of the current decision tree. The feature component value is compared with the split threshold of the root node. Based on the comparison result, the left branch or the right branch is selected to enter the next layer node. Repeatedly perform the operation of comparing the value of the feature component with the splitting threshold. When entering a layer of nodes, extract the corresponding feature component from the detrended state feature vector according to the splitting feature index stored in the node until the leaf node position where splitting can no longer be reached, and record the node number of the leaf node. The node number is mapped to a pre-stored path signature library, and all branch decision sequences from the root node to the leaf node are parsed in reverse. The branch decision sequences are then encoded into binary vectors as the decision fingerprint of the decision tree for the current state feature vector. By collecting the leaf node numbers and corresponding decision fingerprints output from all decision trees, a set of leaf node indices and a set of decision fingerprints of the same length as the number of decision trees in the random forest augmented classifier are obtained.
7. The intelligent production line fault prediction method based on random forest enhancement according to claim 5, characterized in that, The step of extracting the state signal amplitude sequence of each device node within the current adaptive time window from the real-time operation status stream of the production line according to the device node identifier, and performing a trend stabilization transformation on the state signal amplitude sequence to eliminate periodic components and baseline drift in the sequence, generating a detrended state feature vector for that device node, includes: Locate the start and end timestamps of the current adaptive time window in the real-time operation status stream of the production line. Based on the device node identifier, read all status data packets whose timestamps fall within the closed interval of the start and end timestamps from the circular queue-style data buffer of the corresponding device node. Extract the status signal amplitude of each status data packet to form the original amplitude sequence. The original amplitude sequence is subjected to a discrete Fourier transform to convert the time-domain amplitude sequence to the frequency domain and identify the dominant frequency component corresponding to the amplitude peak in the spectrum. The dominant frequency component and its harmonic components are filtered out, and the remaining frequency domain components are subjected to an inverse discrete Fourier transform to obtain the first intermediate sequence with periodic fluctuations removed. The first intermediate sequence is subjected to local weighted regression scatter smoothing. The weighted linear fit value in the neighborhood of each sampling point is calculated as the baseline estimate of that point. The original value of each sampling point in the first intermediate sequence is subtracted from the corresponding baseline estimate to obtain the second intermediate sequence after removing trend drift. Detect whether there are outliers in the second intermediate sequence whose amplitude exceeds the preset normal fluctuation range, locate the time position of the outlier and replace it with the median of the amplitude in the neighborhood window before and after the point, and obtain a smoothed detrended sequence after outlier suppression processing; The smoothed detrending sequence is arranged in chronological order and appended with the device node identifier and the current adaptive time window identifier to generate the detrending state feature vector of the device node in the current diagnostic period.
8. The intelligent production line fault prediction method based on random forest enhancement according to claim 1, characterized in that, The process involves traversing the equipment nodes in the production line equipment association graph, using fault modes exceeding a preset confidence threshold in the membership probability vector set as activation nodes, performing a breadth-first search along the connection edge direction, recording the fault activation node sequence and the time difference of state changes between nodes, and generating a fault propagation direction sequence and the time delay distribution of fault transfer between equipment, including: Parse the membership probability vector set of each device node, extract the fault mode identifier and corresponding membership probability value of each candidate fault mode, compare the membership probability value with the preset confidence threshold, filter out the fault modes with membership probability values greater than or equal to the preset confidence threshold, mark the device node as the active node of the fault mode, and record the activation time as the end timestamp of the current adaptive time window. Using the marked activation node as the search source, traverse the neighboring device nodes that have direct outgoing edges associated with the search source based on the direction attribute of the connecting edges in the production line equipment association graph, and check whether the membership probability vector set of the neighboring device nodes contains activation markers with the same fault mode identifier as the search source. If a neighboring device node contains an activation flag with the same fault mode identifier, the time difference between the activation time of the neighboring device node and the activation time of the search source node is calculated as the propagation time delay, and the directed edge identifier from the search source node to the neighboring device node and the corresponding propagation time delay are recorded. Add the neighboring device node to the search queue, take out the node from the search queue one by one as the new search source point, and repeat the outgoing edge traversal and activation mark check operation until the search queue is empty or no unvisited device node with the same failure mode activation mark is found. Summarize all recorded directed edge identifiers, propagation directions, and propagation time delays. Organize the directed edge identifiers into a fault propagation direction sequence according to the search access order. Classify all propagation time delays according to their corresponding directed edge identifiers and calculate the time delay statistical distribution under each directed edge identifier to generate the time delay distribution of fault transfer between devices.
9. The intelligent production line fault prediction method based on random forest enhancement according to claim 8, characterized in that, The process begins by using the marked active node as the search source, traversing neighboring device nodes that have direct outgoing edges to the search source node based on the direction attributes of the connecting edges in the production line equipment association graph, and checking whether the membership probability vector set of the neighboring device nodes contains an active marker with the same fault mode identifier as the search source node. This includes: Read all outgoing edge records associated with the search source point stored in the production line equipment association map. Each outgoing edge record contains the identifier of the neighboring equipment node it points to, the physical medium type of the connecting edge, and the signal flow direction identifier. Based on the signal flow direction identifier, filter out the outgoing edge records that are consistent with the actual material flow direction or the direction of control command issuance on the production line, and remove outgoing edge records whose signal flow direction identifier is in the reverse or bidirectional non-mainstream direction to obtain an effective search edge set. Locate the corresponding neighboring device node along each valid search edge in the set of valid search edges, and extract the fault mode identifiers of all candidate fault modes from the membership probability vector set of the neighboring device node; The extracted fault mode identifiers are matched one by one with the fault mode identifiers of the currently active fault mode of the search source point. If a matching fault mode identifier is found, the membership probability value corresponding to the matching fault mode is further obtained. The obtained membership probability value is compared with the preset confidence threshold. After confirming that the membership probability value is not lower than the preset confidence threshold, the neighboring device node is marked as an active node with the same fault mode identifier, and the fault mode identifier of the successful match and the identifier of the currently valid search edge are recorded.
10. A computer system, characterized in that, include: Memory is used to store executable instructions or computer programs. The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the intelligent production line fault prediction method based on random forest enhancement as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Monitoring control method and system for automatic production line
CN120357040A
Intelligent factory fault diagnosis method and system based on AI prediction model
CN120387002A