Robot control method and device, electronic equipment and storage medium
By establishing the expected behavior envelope of the production line robot, detecting and driving hierarchical degradation control, the problem of behavioral deviation of the production line robot is solved, and the safety and maintainability of the equipment are improved.
Patent Information
- Application Number
- CN202611688286.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-29
- Publication Date
- 2026-11-27
AI Technical Summary
During long-term operation, the behavior of production line robots may gradually or suddenly deviate from the state at the factory or during debugging, causing the system to deviate from the normal state without alarm, affecting the safety and maintainability of the equipment.
Establish a predictive behavior envelope based on historical operation data, detect abnormal behavior through multi-dimensional feature joint distribution boundary, and output a safety status word to drive hierarchical degradation control, thereby realizing online self-diagnosis and hierarchical degradation control.
Without the need for fault samples, improve the safety and maintainability of production line robot operation, reduce safety risks and quality losses caused by abnormal operations, and achieve closed-loop processing of abnormal behavior.
Smart Images

Figure CN123169149A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robotics, and in particular to a robot control method, a robot control device, an electronic device, and a computer-readable storage medium. Background Technology
[0002] In automated production lines of industries such as consumer electronics, food, and daily chemicals, the behavior of production line robots can gradually or suddenly deviate from their factory or commissioning state due to various reasons during long-term operation. Mechanical causes include loosening of the timing belt, increased backlash in the reducer, joint zero-position drift, slight deformation of the connecting rods, and wear on the gripper fingertips; control-related causes include changes in servo parameters due to temperature drift, drift in calibrated extrinsic parameters, and incorrect modification of trajectory interpolation parameters; load-related causes include changes in inertia due to fixture replacement, changes in resistance due to cable aging, and changes in workpiece specifications; environmental causes include changes in lubrication conditions due to temperature drift and changes in installation level due to foundation settlement. These early signs of deviation are often not malfunctions, but rather subtle changes in behavior. At this stage, the product may still be qualified, and the equipment may not alarm, but the system is already deviating from its normal state. Summary of the Invention
[0003] This application provides a robot control method, robot control device, electronic device, and computer-readable storage medium, which can establish an online self-diagnostic capability that is sensitive to subtle behavioral deviations of production line robots without relying on any labeled fault samples, and convert the diagnostic results into hierarchical degradation control that can be directly executed by the production line controller, thereby improving the safety and maintainability of production line robot operation.
[0004] Firstly, the robot control method provided in this application is applied to a production line robot, and the robot control method includes: Use historical task data of successfully executed tasks by production line robots as normal samples; Each historical operation is divided into several phase segments according to the process stage. The expected behavior envelope of the production line robot is established based on the normal samples in each phase segment. The expected behavior envelope is the boundary that characterizes the joint distribution of multidimensional features of normal behavior in each phase segment. When the production line robot is performing the current task, the current task data in each phase segment is constructed into corresponding feature vectors. The feature vectors of the current task in each phase segment are compared with the expected behavior envelope. Based on the degree of deviation of the feature vectors relative to the multidimensional feature joint distribution, the deviation of each phase segment is obtained. Based on the deviation, it is determined whether the behavior of the current task is abnormal. When the behavior of the current operation is determined to be abnormal, the corresponding degradation level is determined and the safety status word corresponding to the degradation level is output to the production line controller to drive the production line robot to perform graded degradation control according to the degradation level; For any phase segment, the expected behavior envelope is established using a covariance model, and the covariance matrix in the covariance model is calculated using the following formula: ; S is the sample covariance matrix of normal samples within this phase segment, p is the feature dimension within this phase segment, I is the p-order identity matrix, and δ is the contraction intensity. Wherein, the shrinkage strength δ is taken as a closed-form value that minimizes the expected Frobenius risk. , where n is the number of normal samples within that phase segment. Let Frobenius norm be the squared difference between the sample covariance matrix and the diagonal shrinkage target. It is the sum of the fluctuations of each element in the sample covariance matrix. It is the sum of the asymptotic covariances among the elements of the sample covariance matrix.
[0005] Secondly, the robot control device provided in this application is applied to a production line robot, and the robot control device includes: The sample acquisition module is used to acquire historical operation data of successfully executed historical operations by the production line robot as normal samples. The envelope building module is used to divide each historical operation into several phase segments according to the process stage of the operation. Based on the normal samples in each phase segment, the expected behavior envelope of the production line robot is built. The expected behavior envelope is the boundary that characterizes the joint distribution of multi-dimensional features of normal behavior in each phase segment. The anomaly assessment module is used to construct the current operation data in each phase segment as the corresponding feature vector when the production line robot is performing the current operation. The feature vector of the current operation in each phase segment is compared with the expected behavior envelope. The deviation of each phase segment is obtained based on the degree of deviation of the feature vector relative to the multidimensional feature joint distribution. The deviation is used to determine whether the behavior of the current operation is abnormal. The graded degradation module is used to determine the corresponding degradation level when the behavior of the current operation is abnormal, and output the safety status word corresponding to the degradation level to the production line controller to drive the production line robot to perform graded degradation control according to the degradation level. For any phase segment, the expected behavior envelope is established using a covariance model, and the covariance matrix in the covariance model is calculated using the following formula: ; S is the sample covariance matrix of normal samples within this phase segment, p is the feature dimension within this phase segment, I is the p-order identity matrix, and δ is the contraction intensity. Wherein, the shrinkage strength δ is taken as a closed-form value that minimizes the expected Frobenius risk. , where n is the number of normal samples within that phase segment. Let Frobenius norm be the squared difference between the sample covariance matrix and the diagonal shrinkage target. It is the sum of the fluctuations of each element in the sample covariance matrix. It is the sum of the asymptotic covariances among the elements of the sample covariance matrix.
[0006] Optionally, in one embodiment, the robot control device provided in this application further includes an operation freeze module, used for: Construct a deviation sequence based on the deviation of the tasks already performed by the production line robot. A trend test is performed on the deviation sequence to obtain the trend test results; If the trend test results indicate that the operating performance of the production line robot continues to deteriorate, then freeze the update operation on the expected behavior envelope.
[0007] Optionally, in one embodiment, the robot control device provided in this application further includes a disposal suggestion module, used for: Based on the contribution of each feature dimension constituting the feature vector to the deviation, the phase segment and feature dimension with the most significant deviation in the current operation are determined; where the contribution is calculated according to the precise additive decomposition of Mahalanobis distance, and the sum of the contributions of each feature dimension is always equal to the deviation of the corresponding phase segment. The phase segment and feature dimension that deviate most significantly are mapped to candidate parts and causes in the preset part correspondence relationship, and the corresponding suggested treatment actions are output based on the candidate parts and causes obtained by mapping.
[0008] Optionally, in one embodiment, for any phase segment, the extent to which the feature vector of that phase segment exceeds the joint distribution of multidimensional features is calculated according to the following formula: ; Where x is the feature vector of the current job within this phase segment. This is the mean vector of normal samples within this phase segment.
[0009] Optionally, in one embodiment, when determining whether the behavior of the current job is abnormal based on the deviation, the anomaly assessment module is used to: For each phase segment, the determination threshold for that phase segment is calculated using the following formula: T2(1-α) = p(n-1)(n+1) / (n(np))·F(p, np, 1-α); where α is the false alarm rate of the target, and F(p,np, 1-α) is the upper quantile of the F distribution at 1-α, which takes the feature dimension p as the first degree of freedom and the difference between the number of normal samples n and the feature dimension p as the second degree of freedom. The deviation of each phase segment is compared with its judgment threshold; if there is a phase segment with a deviation greater than the judgment threshold, the behavior of the current operation is determined to be abnormal; otherwise, the behavior of the current operation is determined to be normal.
[0010] Optionally, in one embodiment, when establishing the expected behavior envelope of the production line robot based on normal samples within each phase segment, the envelope establishment module is used to: Based on normal samples within each phase segment, establish the expected behavior envelope of the production line robot corresponding to different working conditions; When comparing the feature vectors of the current operation within each phase segment with the expected behavior envelope, and determining the deviation of each phase segment based on the degree of deviation of the feature vectors relative to the joint distribution of multidimensional features, the anomaly assessment module is used for: Determine the current operating condition corresponding to the current task; The feature vectors of the current operation in each phase segment are compared with the target expected behavior envelope corresponding to the current working condition. The deviation of each phase segment is obtained based on the degree of excess of the feature vectors relative to the multidimensional feature joint distribution represented by the target expected behavior envelope.
[0011] Thirdly, the electronic device provided in this application includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the robot control method provided in this application.
[0012] Fourthly, the computer-readable storage medium provided in this application stores a computer program, which, when executed by a processor, implements the robot control method provided in this application.
[0013] This application provides a robot control scheme that acquires historical operation data of successfully executed historical operations by a production line robot as normal samples; divides each historical operation into several phase segments according to the process stage; establishes the expected behavior envelope of the production line robot based on the normal samples in each phase segment, where the expected behavior envelope represents the boundary of the multi-dimensional feature joint distribution of normal behavior in each phase segment; when the production line robot executes the current operation, constructs the current operation data in each phase segment into corresponding feature vectors; compares the feature vectors of the current operation in each phase segment with the expected behavior envelope; obtains the deviation degree of each phase segment based on the degree of deviation of the feature vectors relative to the multi-dimensional feature joint distribution; determines whether the behavior of the current operation is abnormal based on the deviation degree; when the behavior of the current operation is determined to be abnormal, determines the corresponding degradation level, and outputs the safety status word corresponding to the degradation level to the production line controller to drive the production line robot to perform graded degradation control according to the degradation level. In this way, self-supervised modeling is performed using only normal samples generated from successful execution, without the need for any labeled fault samples. This shifts the data bottleneck from unavailable fault samples to a massive number of normal samples. The envelope changes along the phase and characterizes the joint distribution of multi-dimensional features, which can capture situations where each dimension is normal individually but the combined pattern is abnormal. It also has high resolution due to segmentation. The judgment result is output as a safety status word to the production line controller to drive hierarchical degradation, thereby realizing closed-loop processing of abnormal behavior from detection to response. This ensures continuous operation of the production line while reducing the safety risks and quality losses caused by abnormal operations. Attached Figure Description
[0014] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a schematic diagram illustrating an application scenario of the robot control method provided in the embodiments of this application; Figure 2 This is a flowchart illustrating the robot control method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of the robot control device provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0016] To make the technical problems, technical solutions, and beneficial effects solved by this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0017] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0018] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0019] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0020] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0021] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0022] This application provides a robot control method, a robot control device, an electronic device, a computer-readable storage medium, and a computer program product. The robot control method can be executed by the robot control device or by an electronic device integrating the robot control device.
[0023] Please refer to Figure 1 This application also provides a robot control system, such as Figure 1 As shown, the robot control system includes a production line robot, a production line controller, and electronic equipment. A production line robot is a robot equipped with a robotic arm, end effector, and controller, which performs standard tasks cyclically on a production line; the production line may be an assembly line or packaging line, and the standard tasks may include grasping, handling, assembling, and placing. The production line controller is a programmable logic controller that schedules and manages the safety of the production line, for example, by receiving status words reported by the robot via industrial Ethernet or hardwired digital output. The electronic equipment may be an edge computing device, industrial computer, or server independent of the production line controller, used to execute the robot control method provided in this application. The electronic equipment and the production line controller can establish a data connection via industrial Ethernet, fieldbus, or wireless communication, forming a closed loop of execution → detection → diagnosis → graded handling.
[0024] It should be noted that, Figure 1 The schematic diagram of the robot control system shown is merely an example. The robot control system and scenario described in this application are intended to more clearly illustrate the technical solutions of this application and do not constitute a limitation on the technical solutions provided in this application. As those skilled in the art will know, with the evolution of robot control systems and the emergence of new business scenarios, the technical solutions provided in this application are also applicable to similar technical problems.
[0025] Please refer to Figure 2 This is a flowchart illustrating a robot control method disclosed in an embodiment of this application, as shown below. Figure 2 As shown, the flow of this robot control method can be as follows: In S110, historical operation data of successfully executed historical operations by the production line robot are obtained as normal samples.
[0026] One operation refers to the process by which a production line robot completes a full operation task for a single workpiece, such as a complete cycle of picking up a workpiece from the loading position, transferring it, and placing it at the unloading position.
[0027] Historical tasks refer to the tasks performed by the production line robot up to the present moment. Historical task data refers to the multi-dimensional execution data generated by the production line robot during the execution of historical tasks. All of this data is obtained from existing feedback from the robot control system, such as the end-effector pose and velocity sequences, joint angle and angular velocity sequences, joint current or torque sequences, gripper opening sequences, and phase markers and timestamps for each process stage output by the robot controller in each control cycle. In other words, acquiring task data does not require the installation of any additional sensors.
[0028] The control cycle refers to the interval between two consecutive sampling or planning outputs of the robot controller, such as 4 milliseconds or 8 milliseconds.
[0029] Successful execution means that the task achieved the expected result. In this embodiment, successful execution is automatically determined by the production line process, without manual annotation. For example, "the task passed downstream inspection, did not trigger safety degradation, and required no human intervention" can be used as the criterion for successful execution. Downstream inspection is provided by the existing quality inspection system of the production line, safety degradation is recorded by the safety log of the production line robot, and human intervention is recorded by the operation log; all three are natural outputs of the existing system of the production line. Accordingly, the method in this embodiment does not use any annotated fault samples; that is, all samples used for modeling come from historical successfully executed tasks.
[0030] In practice, electronic devices acquire historical operation data from the production line robot's control system and aggregate it by piece, forming a complete execution record for each operation, which serves as a candidate sample. The candidate samples are then filtered using the aforementioned successful execution criteria to obtain a normal sample set. For each combination (task, condition, phase), the number n of normal samples is accumulated separately. The normal sample set continuously and automatically accumulates during operation, providing a data foundation for subsequently establishing the expected behavior envelope.
[0031] In S120, each historical operation is divided into several phase segments according to the process stage of the operation. The expected behavior envelope of the production line robot is established based on the normal samples in each phase segment. The expected behavior envelope is the boundary that characterizes the joint distribution of multidimensional features of normal behavior in each phase segment.
[0032] A phase segment refers to a time interval divided according to the technological stages of an operation. For example, a material handling operation can be divided into phase segments such as approach, contact, clamping, lifting, transfer, placement, and release. Different processes can add or remove phase segments as needed.
[0033] Multidimensional feature joint distribution refers to a statistical distribution composed of multidimensional feature vectors. Multidimensional features are vectors composed of features extracted from execution data within each phase segment. These include at least the end-effector trajectory morphology, joint current morphology, and phase duration. They may also include the position sequence envelope and trajectory curvature, the peak value and morphology of velocity or acceleration, the peak value, mean, integral, and morphology of current, the proportion of phase duration to the entire cycle, and deviations from the relative beat, as well as derived features characterizing the relationships between the various feature dimensions. Examples of derived features include the phase relationship between velocity and current (e.g., lag or lead), and the consistency of the correspondence between end-effector position and joint angle.
[0034] In practice, the electronic equipment divides each historical operation into several phase segments based on the phase identifier, and then performs equal-length resampling and alignment on the time series within each phase segment to eliminate the uneven sequence lengths caused by the difference in time consumption of each operation on the same phase; subsequently, feature vectors are constructed for each phase segment.
[0035] The expected behavior envelope refers to the multidimensional behavior distribution boundary that varies with phase, established from normal samples. In this application, an envelope is established for each phase segment.
[0036] In one implementation, for each combination of (task, condition, phase), the electronic device first estimates the mean vector and covariance matrix of normal samples, and then characterizes the normal behavior of the phase segment using a multidimensional distribution (such as a multidimensional Gaussian distribution) parameterized by the mean vector and covariance matrix. The boundary of the envelope is given by the equiprobability surface of the distribution (such as an equivalence ellipsoid where the Mahalanobis distance equals the decision threshold). The robust solution method for the covariance matrix is described in detail in subsequent embodiments. In other implementations, the expected behavior envelope can also be established using at least one of the following: quantile envelope, principal component ellipsoidal envelope, single-class support vector data description (SVDD) model, isolated forest, kNN distance model, Gaussian mixture model, or autoencoder reconstruction error model. This application does not limit this.
[0037] In S130, when the production line robot is performing the current task, the current task data in each phase segment is constructed into corresponding feature vectors. The feature vectors of the current task in each phase segment are compared with the expected behavior envelope. Based on the degree of deviation of the feature vector relative to the multidimensional feature joint distribution, the deviation of each phase segment is obtained. Based on the deviation, it is determined whether the behavior of the current task is abnormal.
[0038] The current task refers to a task that the production line robot is currently performing. Current task data refers to multi-dimensional execution data obtained from existing feedback quantities of the robot control system during the execution of the current task, and its data categories are consistent with historical task data.
[0039] Deviation refers to the quantified value of the degree to which the feature vector of the current operation deviates from the normal behavioral distribution of that phase segment. It should be noted that deviation is determined by multiple dimensions, not by individual dimensions. Therefore, it can capture situations where "each dimension is normal individually, but the combined pattern is abnormal." For example, the end-effector speed and joint current may be normal, but the phase relationship between them may have changed (reflecting a loose drivetrain). In this case, single-dimensional judgments will all pass, while multi-dimensional joint judgments can detect it.
[0040] In this embodiment of the application, when the production line robot is performing the current task, the electronic device constructs the current task data in each phase segment as the feature vector corresponding to that phase segment, compares the feature vector with the expected behavior envelope of the corresponding phase segment, obtains the deviation degree of each phase segment based on the degree of excess of the feature vector relative to the multidimensional feature joint distribution represented by the envelope, and then determines whether the behavior of the current task is abnormal based on the deviation degree of each phase segment.
[0041] In S140, when the behavior of the current operation is determined to be abnormal, the corresponding degradation level is determined, and the safety status word corresponding to the degradation level is output to the production line controller to drive the production line robot to perform graded degradation control according to the degradation level.
[0042] Downgrade level refers to a pre-defined operational level that corresponds to the severity of the deviation.
[0043] Safety status words are discrete fields that represent the safety status of the production line using digital codes. The production line controller can directly parse and execute the corresponding handling logic.
[0044] Graded degradation control refers to intervening in the operation of production lines or robots with different intensities according to the degradation level, such as requesting re-inspection, reducing cycle time, degrading operation, switching to conservative strategies, or stopping the machine.
[0045] In one implementation, the downgrade level and the corresponding action can be as follows: N0, deviation is within the normal range, normal execution, sample is entered into the database to update the envelope; N1, minor and occasional overstepping of boundaries, will be recorded and marked without intervention; if it occurs repeatedly, it will be upgraded. N2, clearly out of bounds, request re-inspection of the part; if continued, reduce the cycle time of the station and generate an inspection work order. N3, serious overstepping of boundaries or accompanied by strategic risks, should be downgraded, a conservative strategy should be switched, or manual intervention should be called. N4: Watchdog timeout or communication interruption, shutdown and enter failsafe state.
[0046] The boundaries between each level can be defined by a decision threshold based on the target false alarm rate, ensuring a one-to-one correspondence between levels and false alarm budgets. Here, N0 to N4 are level numbers, with N0 being the lowest level and N4 the highest. Higher levels correspond to greater intervention intensity.
[0047] In addition, the status word output can include hysteresis and watchdog failsafe design. Hysteresis refers to setting different switching thresholds on both sides of the upgrade / degrade boundary, so that the level does not oscillate when the deviation fluctuates near the boundary; watchdog failsafe refers to setting timeout monitoring for the diagnostic channel. If the diagnostic is not completed within the watchdog timeout or communication with the production line controller is interrupted, the production line controller will shut down at the highest level (e.g., N4) to prevent the production line from being in an unmonitored state.
[0048] In this embodiment, when the electronic device determines that the behavior of the current operation is abnormal, it determines the corresponding degradation level and outputs the safety status word corresponding to the degradation level to the production line controller. The production line controller parses the status word and drives the production line robot to perform graded degradation control, thereby directly converting the diagnostic conclusion into an action that can be performed on the production line, forming a closed loop of execution → detection → diagnosis → graded treatment.
[0049] As can be seen from the above, the robot control scheme provided in this application obtains historical operation data of successfully executed historical operations of the production line robot as normal samples; divides each historical operation into several phase segments according to the process stage of the operation; establishes the expected behavior envelope of the production line robot based on the normal samples in each phase segment, and the expected behavior envelope is the boundary representing the multi-dimensional feature joint distribution of normal behavior in each phase segment; when the production line robot executes the current operation, constructs the current operation data in each phase segment as the corresponding feature vector, compares the feature vector of the current operation in each phase segment with the expected behavior envelope, and obtains the deviation degree of each phase segment based on the degree of deviation of the feature vector relative to the multi-dimensional feature joint distribution; determines whether the behavior of the current operation is abnormal based on the deviation degree; when the behavior of the current operation is determined to be abnormal, the corresponding degradation level is determined, and the safety status word corresponding to the degradation level is output to the production line controller to drive the production line robot to perform graded degradation control according to the degradation level. In this way, self-supervised modeling is performed using only normal samples generated from successful execution, without the need for any labeled fault samples. This shifts the data bottleneck from unavailable fault samples to a massive number of normal samples. The envelope changes along the phase and characterizes the joint distribution of multi-dimensional features, which can capture situations where each dimension is normal individually but the combined pattern is abnormal. It also has high resolution due to segmentation. The judgment result is output as a safety status word to the production line controller to drive hierarchical degradation, thereby realizing closed-loop processing of abnormal behavior from detection to response. This ensures continuous operation of the production line while reducing the safety risks and quality losses caused by abnormal operations.
[0050] Optionally, in one embodiment, the robot control method provided in this application further includes: Construct a deviation sequence based on the deviation of the tasks already performed by the production line robot. A trend test is performed on the deviation sequence to obtain the trend test results; If the trend test results indicate that the operating performance of the production line robot continues to deteriorate, then freeze the update operation on the expected behavior envelope.
[0051] In this embodiment, as the production line robot continues to operate, the electronic device updates the expected behavior envelope based on the newly generated normal samples from the continuous operation of the production line robot, so that the expected behavior envelope can adaptively evolve with the actual operating state of the production line robot. The specific method for updating the expected behavior envelope is not limited here; for example, a sliding window approach can be used, incorporating newly generated normal samples into the sample set and replacing earlier normal samples within the window, and then reconstructing the expected behavior envelope based on the updated sample set.
[0052] It should be noted that if the expected behavior envelope unconditionally follows new data updates, then when the production line robot experiences slow degradation (e.g., the timing belt gradually loosens), the degradation process will be gradually absorbed into the definition of "normal," causing the envelope boundary to expand slowly. This leads to a continuous decrease in the sensitivity of the anomaly criterion, ultimately making it impossible to effectively identify slow degradation in terms of deviation. Therefore, this embodiment detects continuous degradation of operational performance through trend analysis and freezes envelope updates only at this point, preventing data from being absorbed into the envelope during the degradation period, thereby maintaining the ability to detect slow degradation.
[0053] A deviation sequence is a sequence of deviations obtained after each task is completed, arranged chronologically.
[0054] Trend testing refers to a statistical test to determine whether there is a persistent or directional change in a sequence.
[0055] The trend test results indicate that the operating performance is continuously deteriorating. This means that the test found that the overall deviation sequence is showing a continuous upward trend, that is, the overall operation is moving further and further away from the normal envelope, rather than a single occasional deviation.
[0056] In one implementation, the trend test is performed using a one-sided Cumulative Sum Control Chart (CUSUM) of the deviation sequence. This is achieved by accumulating the positive deviations of each item's deviation relative to the center of control, amplifying small but persistent drifts into a quantifiable statistic: C_k = max(0, C_{k-1} + (d2_k - d2_0 - k_c)), where C_k is the cumulative sum after the k-th operation, d2_k is the deviation of the k-th operation, d2_0 is the center of control, and k_c is a reference value. The center of control can be taken as the theoretical expectation of the squared Mahalanobis distance, i.e., d2_0 = p (feature dimension), directly derived from the distribution model in subsequent embodiments without manual setting; the reference value is taken as half the amplitude of the drift to be detected, i.e., k_c = δ_d / 2, where δ_d is the desired drift amplitude in standard errors. When C_k is greater than the decision limit h_c, a persistent, slowly deteriorating drift is detected. The decision limit h_c is obtained by inversely solving the average run length (ARL) of the target: ARL0 refers to the average number of items required to trigger a false alarm when no drift occurs, which is determined by maintenance costs and the cost of false alarms; according to the Siegmund approximation, h_c≈(1 / (2k_c))·ln(1+2k_c²·ARL0). Therefore, both design parameters for the trend test are inversely derived from the statistical distribution and design target, rather than being empirically tuned, making "how often a false alarm occurs and how quickly a large drift is detected" designable and reproducible performance indicators.
[0057] In this embodiment, after detecting a persistent, slow degradation drift, the electronic device freezes the update operation of the expected behavior envelope, meaning the envelope does not absorb any new samples generated during the degradation period. In other embodiments, the determination channel remains uninterrupted during the freeze period, and the graded alarm continues to output; that is, the freeze only applies to the envelope update channel, and subsequent operations such as deviation calculation, anomaly determination, and safety status word output proceed normally. After the production line robot is maintained, the expected behavior envelope is reset and the update is resumed, for example, by clearing the accumulated sum C_k to zero and reconstructing the envelope with normal samples after maintenance, thus forming a complete closed loop of "drift detection - freeze update - maintenance - reset recovery".
[0058] In other implementations, trend analysis can also include batch quality metrics, such as the downstream inspection yield and degradation rate for each batch. Even if the deviation sequence has not yet shown significant drift, a continuous decline in the yield of multiple consecutive batches also indicates that the equipment is slowly deteriorating, which can trigger a freeze.
[0059] The solution provided in this embodiment detects continuous degradation using trend analysis and freezes envelope updates, thus maintaining long-term sensitivity to slow degradation.
[0060] Optionally, in one embodiment, the robot control method provided in this application further includes: Based on the contribution of each feature dimension constituting the feature vector to the deviation, the phase segment and feature dimension with the most significant deviation in the current operation are determined; where the contribution is calculated according to the precise additive decomposition of Mahalanobis distance, and the sum of the contributions of each feature dimension is always equal to the deviation of the corresponding phase segment. The phase segment and feature dimension that deviate most significantly are mapped to candidate parts and causes in the preset part correspondence relationship, and the corresponding suggested treatment actions are output based on the candidate parts and causes obtained by mapping.
[0061] Feature dimension refers to the feature category corresponding to the component of the feature vector, such as end trajectory morphology, joint current morphology, phase duration and their derived features. Each feature category corresponds to a feature dimension.
[0062] Contribution refers to the signed contribution of a single feature dimension to the total deviation.
[0063] The part correspondence refers to the pre-established mapping relationship between the candidate robot parts and their causes corresponding to different combinations of phase segments and feature dimensions. For example, "the current peak of the transfer phase segment increases while the speed remains unchanged, which corresponds to an increase in transmission resistance, such as poor lubrication or excessive tension of the synchronous belt"; "the phase lag of the current and speed of the transfer phase segment increases, which corresponds to a slack in the transmission chain or an increase in backlash"; "the trajectory space deviation of the full phase segment is systematically offset, which corresponds to joint zero-position drift or calibration extrinsic parameter drift"; "the current morphology of the gripper in the clamping phase segment changes, which corresponds to gripper wear or fingertip loosening"; "the duration of each phase segment is generally extended and the cycle time is slowed down, which corresponds to servo parameter drift, temperature drift or load inertia change".
[0064] Recommended actions refer to inspection or maintenance suggestions corresponding to the candidate parts and causes, such as recalibrating, checking the tension of the timing belt, replacing the gripper fingertips, verifying servo parameters, and checking the dimensions of incoming materials.
[0065] In one implementation, the contribution is calculated using a precise additive decomposition of Mahalanobis distance: Let the deviation vector be... Related vectors Expanding the quadratic form into a double summation and then merging them along the dimension, we get: The contribution of dimension j It should be noted that the contribution value c_j may be negative, meaning that the deviation in a certain dimension may actually offset part of the total deviation. Based on this, a contribution vector of "phase × dimension" can be output, and the feature dimension with the largest absolute contribution value can be used to locate the most significant deviation.
[0066] In cases where dimensions are strongly correlated (e.g., end-effector velocity is highly correlated with joint current), while exact additive decomposition is mathematically precise, the same coupling bias will be repeatedly counted in multiple strongly correlated dimensions, leading to semantic unfairness in attribution. In such cases, Shapley value attribution can be used instead: treating each feature dimension as a participant in a cooperative game, and using the squared Mahalanobis distance calculated with the dimension subset Q as the subspace as the value function. ,in , The subvector corresponding to the dimension subset Q. φ_j is the sub-block corresponding to the dimension subset Q in the covariance matrix; the attribution value φ_j of dimension j is the average of the marginal contribution of dimension j under all possible dimension addition orders, and is approximated by Monte Carlo sampling (e.g., randomly sampling hundreds of dimensions and averaging them), and the number of samples is inversely deduced from the stability requirements of the attribution order.
[0067] In one implementation, site mapping can employ diagnostic signature matching. The diagnostic signature is defined as a normalized cross-phase contribution vector s = c / ‖c‖, where s lies in a "phase × dimension" space, characterizing which phases and dimensions exhibit the most significant deviations and their proportions. For each candidate site and its cause w, a reference signature s_w is defined (derived from the mechanism or identified from historically confirmed cases; the aforementioned site correspondence serves as the initial identification source for the reference signature). Candidates are ranked in descending order of the cosine similarity between the diagnostic signature s and the reference signature s_w. Alternatively, candidates and their confidence levels can be output using Bayesian posterior Pr(w|s) ∝ Pr(s|w)·Pr(w), where the likelihood Pr(s|w) is the normal likelihood centered on the reference signature and with the empirical covariance Ξ_w of the signatures of such historically confirmed cases as the variance. Whenever a cause is confirmed, the signature of that case is added to the case database, and s_w and Ξ_w are updated online, continuously improving the localization accuracy with operation and case accumulation. For example, outputting "The 3-axis synchronous belt may be loose (confidence level 0.62), it is recommended to check the tension" is far better than the abstract warning "This trajectory is not quite right", making the diagnostic conclusions directly executable.
[0068] The solution provided in this embodiment decomposes the deviation into various feature dimensions and locates them into phase segments and dimensions, then maps them into candidate parts, causes, and suggested actions, transforming "behavioral deviation" into "executable maintenance clues," thereby providing a quantitative basis for predictive maintenance of production line robots, reducing unplanned downtime, and improving overall equipment efficiency.
[0069] Optionally, in one embodiment, for any phase segment, the expected behavior envelope is established using a covariance model, and the covariance matrix in the covariance model is calculated according to the following formula: ; S is the sample covariance matrix of normal samples within this phase segment, p is the feature dimension within this phase segment, I is the p-order identity matrix, and δ is the contraction intensity. Wherein, the shrinkage strength δ is taken as a closed-form value that minimizes the expected Frobenius risk. , where n is the number of normal samples within that phase segment. Let Frobenius norm be the squared difference between the sample covariance matrix and the diagonal shrinkage target. It is the sum of the fluctuations of each element in the sample covariance matrix. It is the sum of the asymptotic covariances among the elements of the sample covariance matrix.
[0070] It should be noted that the covariance matrix cannot be directly represented by the sample covariance matrix. This is because each combination (task, condition, phase) has only a few hundred normal samples (n = several hundred), while the feature dimension is tens (p = several tens), with n and p on the same order of magnitude. In this case, the sample eigenvalues of the sample covariance matrix S are systematically smaller than the true values (i.e., the spectrum is shifted downwards), S is close to singular or even rank deficient, and its inverse matrix is extremely sensitive to estimation noise. In directions where the samples are sparse, the Mahalanobis distance is disproportionately amplified, leading to a large number of false alarms.
[0071] This embodiment uses linear contraction estimation to solve this problem: the sample covariance matrix S is contracted towards the diagonal contraction target. Here, tr(S) / p is the average variance of each dimension of the normal sample, tr(·) represents the trace of the matrix (the sum of the diagonal elements); δ·(tr(S) / p)·I is the diagonal matrix with "equal variances and mutual independence" as the reference, and I is the p-order identity matrix (a square matrix with 1s on the diagonal and 0s elsewhere). The effect of contraction is to raise the small eigenvalues of S as a whole and lower the large eigenvalues as a whole, resulting in a smaller covariance matrix. It is always positive definite, invertible, and has a controlled condition number. When δ=0, it degenerates into a sample covariance matrix, and when δ=1, it degenerates into a spherical diagonal matrix.
[0072] The shrinkage strength δ is not specified manually, but rather takes the expected Frobenius risk. Minimum closed value Here, the Frobenius norm refers to the square root of the sum of the squares of the elements of the matrix, and the expected Frobenius risk is the contracted estimate. The average deviation from the true covariance matrix Σ (where Σ is the theoretical true value that cannot be directly observed and is only used to characterize the estimated risk). The squared Frobenius norm of the difference between the sample covariance matrix and the diagonal shrinkage target is, i.e. To characterize the mismatch between sample covariance and diagonal target; It is the sum of the fluctuations of each element in the sample covariance matrix, that is, the sum of the estimated variances of each element; The sum of the asymptotic covariances among the elements of the sample covariance matrix can be calculated using the computable formula given by the Ledoit-Wolf method. All three statistics can be directly calculated from the normal samples within this phase segment. Therefore, the expected risk can be decomposed into two parts: "bias caused by contraction" and "variance caused by estimation." The former increases with increasing δ, while the latter decreases. The optimal δ is obtained at the point where the sum of the two is minimized. The smaller n and the larger p, the larger the estimated variance, and the larger δ automatically becomes; as n approaches infinity, δ approaches 0. Thus, the contraction strength automatically expresses the physical intuition that "the fewer the samples, the higher the dimensionality, the more contraction should occur," all derived from data inversely, without manual tuning. In practical implementation, The solution is executed once offline or during model change. Online, each item only requires one matrix and vector multiplication to complete the comparison calculation. The calculation amount per item is in the millisecond range on an industrial control computer or edge controller.
[0073] In a cold start scenario (new operating conditions just put into use, very few normal samples), even after shrinkage... If this is still unreliable, an inverse Wishart hierarchical prior can be introduced for the covariance of this working condition: the pooling estimate of the scatter matrix of similar working conditions (same model, same gripper type, adjacent product models) is used as the scaling matrix Ψ, with degrees of freedom ν=p+2, so that the prior mean is exactly equal to the pooling scatter matrix; for each normal sample observed, the posterior is updated with the normal-inverse Wishart conjugate, and the posterior mean is taken. As the covariance estimate for this operating condition, B_k and n_k are the accumulated scatter matrix and sample size for this operating condition. The cold start covariance is prior regularized, always positive definite and non-singular, and smoothly transitions to the sample covariance of this operating condition itself as the sample increases. The entire process does not require artificial rules such as "sample size threshold" or "observation mode".
[0074] Furthermore, when using a contracted or posterior estimated covariance matrix, the degrees of freedom of the subsequent F distribution can be expressed in effective dimension. Substitute the effective sample size into the calculation.
[0075] The solution provided in this embodiment makes the covariance estimation numerically stable and always positive definite and invertible under the condition that "there are only a few hundred normal samples per working condition and dozens of features". Moreover, the shrinkage strength and prior strength are both inferred from the data, eliminating the artificial setting from the source of parameters.
[0076] Optionally, in one embodiment, for any phase segment, the extent to which the feature vector of that phase segment exceeds the joint distribution of multidimensional features is calculated according to the following formula: ; Where x is the feature vector of the current job within this phase segment. This is the mean vector of normal samples within this phase segment.
[0077] In this embodiment, the degree to which the feature vector of the phase segment deviates from the joint distribution of the multidimensional features is represented by the squared Mahalanobis distance d². This squared Mahalanobis distance d² measures the distance of the feature vector x from the center of the normal distribution, and is normalized according to the distribution's own dispersion shape: in directions with small dispersion (concentrated data), the same displacement is calculated as farther; in directions with large dispersion, it is calculated as closer. Therefore, d² is a deviation measure "relative to the joint distribution of the multidimensional features," jointly considering the fluctuation amplitude of each feature dimension and the correlation between dimensions, rather than determining each dimension independently. In this embodiment, the deviation of the phase segment is taken as the value of the squared Mahalanobis distance.
[0078] Under the assumption of normal samples, the squared Mahalanobis distance d2, after scaling transformation, follows an F distribution, with the conversion relationship being d2·n(np) / [p(n-1)(n+1)]~F(p, np), where n is the number of normal samples within the phase segment, and p is the feature dimension. This distribution relationship forms the basis for analytically determining the decision threshold in subsequent embodiments. When other envelope modeling methods such as quantile envelope or single-class model are used, the degree of exceeding the threshold is replaced by the quantile exceedance or single-class model score, but the decision boundary is determined according to the same principle of "deriving the threshold from the target false alarm rate".
[0079] Optionally, in one embodiment, determining whether the behavior of the current operation is abnormal based on the deviation includes: For each phase segment, the determination threshold for that phase segment is calculated using the following formula: T2(1-α) = p(n-1)(n+1) / (n(np))·F(p, np, 1-α); where α is the false alarm rate of the target, and F(p,np, 1-α) is the upper quantile of the F distribution at 1-α, which takes the feature dimension p as the first degree of freedom and the difference between the number of normal samples n and the feature dimension p as the second degree of freedom. The deviation of each phase segment is compared with its judgment threshold. If there is a phase segment with a deviation greater than the judgment threshold, the behavior of the current operation is determined to be abnormal; otherwise, the behavior of the current operation is determined to be normal.
[0080] The judgment threshold refers to the numerical boundary used to determine whether a certain phase segment has exceeded the limit.
[0081] α is the target false alarm rate, which is the proportion of normal operations that are allowed to be misjudged as abnormal; for example, α=0.01 means that normal operations have only a 1% probability of being misjudged.
[0082] F(p, np, 1-α) is the upper quantile of the F-distribution at 1-α, where the first degree of freedom is the feature dimension p and the second degree of freedom is the difference between the number of normal samples n and the feature dimension p. The F-distribution is a statistical distribution parameterized by two degrees of freedom, used to characterize the fluctuation range of statistics such as the squared Mahalanobis distance under normal conditions. The meaning of this threshold formula is: under the normal assumption, d2 follows an F-distribution after scaling. Taking the 1-α quantile of this distribution and converting it back to the dimension of d2 is the boundary of "the proportion of (1-α) in the normal sample does not exceed", thus controlling the false alarm rate at the target α. Wherein, the smaller n is, the larger the F quantile is (the tail of the F distribution is heavier under small degrees of freedom), the threshold is automatically relaxed, and there will be no large number of false alarms due to inaccurate envelope during the cold start period; the larger n is, the F quantile tends to converge, the threshold is automatically tightened, and the detection sensitivity is improved.
[0083] In one implementation, when the maximum deviation of each phase segment is used as the job-level statistic for this operation (e.g., summing the maximum deviation of each phase segment, weighted sum, count of out-of-limit phase segments, or duration of consecutive out-of-limit operations), applying a single-phase threshold to the summarized statistic will inflate the false alarm rate: under normal circumstances, the probability of at least one phase segment exceeding the limit is approximately P·α (P is the number of phase segments), for example, when α=1% and P=7, the actual false alarm rate is approximately 7%. Therefore, multiple comparison corrections are performed on this judgment threshold, such as using Sidak correction, Bonferroni correction, or Benjamini-Hochberg false detection rate control, and the judgment threshold is determined based on the corrected significance level; when there is correlation between phase segments, the effective test number can also be used. P is replaced to reduce overcorrection, where ρ̄ is the average correlation coefficient between phase segments. This allows the false alarm rate across phases to be explicitly controlled within the design value, and the false alarm level can be directly linked to maintenance costs.
[0084] Optionally, in one embodiment, establishing the expected behavior envelope of the production line robot based on normal samples within each phase segment includes: Based on normal samples within each phase segment, establish the expected behavior envelope of the production line robot corresponding to different working conditions; The feature vectors of the current operation within each phase segment are compared with the expected behavior envelope. Based on the degree to which the feature vectors exceed the joint distribution of multidimensional features, the deviation of each phase segment is obtained, including: Determine the current operating condition corresponding to the current task; The feature vectors of the current operation in each phase segment are compared with the target expected behavior envelope corresponding to the current working condition. The deviation of each phase segment is obtained based on the degree of excess of the feature vectors relative to the multidimensional feature joint distribution represented by the target expected behavior envelope.
[0085] Working conditions refer to the production configuration conditions of the production line robot, such as classification by product model, box type, gripper number, and shift.
[0086] In this embodiment, the electronic device maintains multiple sets of expected behavior envelopes corresponding to different working conditions. When switching working conditions, the current working condition corresponding to the current operation is determined (e.g., triggered by work order information from the production line controller, gripper number feedback, or changeover event). The envelope used for comparison is switched to the target expected behavior envelope corresponding to the current working condition, so that the judgment is always based on "normal under the current configuration" and normal changeover is not falsely reported.
[0087] In one implementation, when a new operating condition is put into use and there is no readily available expected behavior envelope, the scatter matrix obtained by pooling similar operating conditions can be used as the inverse Wishart prior scaling matrix to establish a prior covariance. As normal samples accumulate, the a prior mean is transitioned to the sample covariance of the operating condition itself (see the covariance implementation example for details).
[0088] In one implementation, during steady-state operation, the envelope can be slowly updated using newly generated normal samples according to a smoothing coefficient, allowing the envelope to adapt to slow variables such as seasons and temperature drift. Here, the smoothing coefficient η = max(η_min, 1 / n_eff), the effective sample size n_eff = (1+λ) / (1-λ), λ is the smoothing constant of the Exponentially Weighted Moving Average (EWMA), and η_min is the lower bound of the smoothing coefficient; that is, the fewer the samples, the larger the update step size (quickly establishing a usable envelope), and the more samples, the smaller the step size (maintaining envelope stability). Furthermore, the update is only performed when three conditions are met simultaneously: no drift is detected, the current job is judged as normal, and the number of normal samples is not lower than the lower bound of the sample size.
[0089] In one implementation, the electronic device can also report the deviation sequence and positioning results of each operation to the manufacturing execution system to form a health record for each production line robot, which can be used for long-term trend analysis and maintenance decisions, and can also serve as a sample source for reference signature learning in part matching.
[0090] To facilitate better implementation of the above robot control methods, this application also provides a corresponding robot control device. The meanings of the terms used are the same as in the above robot control methods; for specific implementation details, please refer to the descriptions in the above method embodiments.
[0091] Please refer to Figure 3 The robot control device may include a sample acquisition module 210, an envelope establishment module 220, an anomaly assessment module 230, and a classification and degradation module 240. Detailed descriptions of each functional module are as follows: The sample acquisition module 210 is used to acquire historical operation data of successfully executed historical operations by the production line robot as normal samples. The envelope establishment module 220 is used to divide each historical operation into several phase segments according to the process stage of the operation, and establish the expected behavior envelope of the production line robot based on the normal samples in each phase segment. The expected behavior envelope is the boundary that characterizes the joint distribution of multi-dimensional features of normal behavior in each phase segment. The anomaly assessment module 230 is used to construct the current operation data in each phase segment as the corresponding feature vector when the production line robot is performing the current operation, compare the feature vector of the current operation in each phase segment with the expected behavior envelope, obtain the deviation degree of each phase segment based on the degree of excess of the feature vector relative to the multidimensional feature joint distribution, and determine whether the behavior of the current operation is abnormal based on the deviation degree. The graded degradation module 240 is used to determine the corresponding degradation level when the behavior of the current operation is abnormal, and output the safety status word corresponding to the degradation level to the production line controller to drive the production line robot to perform graded degradation control according to the degradation level.
[0092] Optionally, in one embodiment, the robot control device provided in this application further includes an operation freeze module, used for: Construct a deviation sequence based on the deviation of the tasks already performed by the production line robot. A trend test is performed on the deviation sequence to obtain the trend test results; If the trend test results indicate that the operating performance of the production line robot continues to deteriorate, then freeze the update operation on the expected behavior envelope.
[0093] Optionally, in one embodiment, the robot control device provided in this application further includes a disposal suggestion module, used for: Based on the contribution of each feature dimension constituting the feature vector to the deviation, the phase segment and feature dimension with the most significant deviation in the current operation are determined; where the contribution is calculated according to the precise additive decomposition of Mahalanobis distance, and the sum of the contributions of each feature dimension is always equal to the deviation of the corresponding phase segment. The phase segment and feature dimension that deviate most significantly are mapped to candidate parts and causes in the preset part correspondence relationship, and the corresponding suggested treatment actions are output based on the candidate parts and causes obtained by mapping.
[0094] Optionally, in one embodiment, for any phase segment, the expected behavior envelope is established using a covariance model, and the covariance matrix in the covariance model is calculated according to the following formula: ; S is the sample covariance matrix of normal samples within this phase segment, p is the feature dimension within this phase segment, I is the p-order identity matrix, and δ is the contraction intensity. Wherein, the shrinkage strength δ is taken as a closed-form value that minimizes the expected Frobenius risk. , where n is the number of normal samples within that phase segment. Let Frobenius norm be the squared difference between the sample covariance matrix and the diagonal shrinkage target. It is the sum of the fluctuations of each element in the sample covariance matrix. It is the sum of the asymptotic covariances among the elements of the sample covariance matrix.
[0095] Optionally, in one embodiment, for any phase segment, the extent to which the feature vector of that phase segment exceeds the joint distribution of multidimensional features is calculated according to the following formula: ; Where x is the feature vector of the current job within this phase segment. This is the mean vector of normal samples within this phase segment.
[0096] Optionally, in one embodiment, when determining whether the behavior of the current operation is abnormal based on the deviation, the anomaly assessment module 230 is used to: For each phase segment, the determination threshold for that phase segment is calculated using the following formula: T2(1-α) = p(n-1)(n+1) / (n(np))·F(p, np, 1-α); where α is the false alarm rate of the target, and F(p,np, 1-α) is the upper quantile of the F distribution at 1-α, which takes the feature dimension p as the first degree of freedom and the difference between the number of normal samples n and the feature dimension p as the second degree of freedom. The deviation of each phase segment is compared with its judgment threshold. If there is a phase segment with a deviation greater than the judgment threshold, the behavior of the current operation is determined to be abnormal; otherwise, the behavior of the current operation is determined to be normal.
[0097] Optionally, in one embodiment, when establishing the expected behavior envelope of the production line robot based on normal samples within each phase segment, the envelope establishment module 220 is used to: Based on normal samples within each phase segment, establish the expected behavior envelope of the production line robot corresponding to different working conditions; When comparing the feature vectors of the current operation within each phase segment with the expected behavior envelope, and determining the deviation of each phase segment based on the degree of excess of the feature vectors relative to the joint distribution of multidimensional features, the anomaly assessment module 230 is used to: Determine the current operating condition corresponding to the current task; The feature vectors of the current operation in each phase segment are compared with the target expected behavior envelope corresponding to the current working condition. The deviation of each phase segment is obtained based on the degree of excess of the feature vectors relative to the multidimensional feature joint distribution represented by the target expected behavior envelope.
[0098] Specific limitations regarding the robot control device can be found in the limitations of the robot control method described above, and will not be repeated here. Each module in the aforementioned robot control device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the production line robot in hardware form or independent of it, or stored in the memory of the production line robot in software form, so that the processor can call and execute the operations corresponding to each module.
[0099] In one embodiment, an electronic device is provided, the internal structure of which can be shown as follows: Figure 4 As shown. The electronic device includes a processor, memory, and network interface connected via a system bus; the electronic device can be a controller for a production line robot, an edge computing device attached to the production line robot, or an industrial control computer.
[0100] The processor in an electronic device is used to provide computing and control capabilities.
[0101] The network interface of an electronic device is used to communicate with external devices.
[0102] The electronic device's memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. When the computer program is executed by a processor, it implements the robot control method provided in this application, for example: Use historical task data from successfully executed operations by production line robots as normal samples; Each historical operation is divided into several phase segments according to the process stage. The expected behavior envelope of the production line robot is established based on the normal samples in each phase segment. The expected behavior envelope is the boundary that characterizes the joint distribution of multidimensional features of normal behavior in each phase segment. When the production line robot is performing the current task, the current task data in each phase segment is constructed into corresponding feature vectors. The feature vectors of the current task in each phase segment are compared with the expected behavior envelope. Based on the degree of deviation of the feature vectors relative to the multidimensional feature joint distribution, the deviation of each phase segment is obtained. Based on the deviation, it is determined whether the behavior of the current task is abnormal. When the behavior of the current operation is determined to be abnormal, the corresponding degradation level is determined, and the safety status word corresponding to the degradation level is output to the production line controller to drive the production line robot to perform graded degradation control according to the degradation level.
[0103] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the robot control method described above.
[0104] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0105] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0106] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A robot control method applied to a production line robot, characterized in that, include: The historical operation data of the production line robot that was successfully executed in the past is used as a normal sample. Each historical operation is divided into several phase segments according to the process stage. The expected behavior envelope of the production line robot is established based on the normal samples in each phase segment. The expected behavior envelope is the boundary that characterizes the joint distribution of multidimensional features of normal behavior in each phase segment. When the production line robot performs the current task, the current task data in each phase segment is constructed as a corresponding feature vector. The feature vector of the current task in each phase segment is compared with the expected behavior envelope. The deviation of each phase segment is obtained according to the degree of excess of the feature vector relative to the multidimensional feature joint distribution. The behavior of the current task is determined to be abnormal based on the deviation. When the behavior of the current operation is determined to be abnormal, the corresponding degradation level is determined, and the safety status word corresponding to the degradation level is output to the production line controller to drive the production line robot to perform graded degradation control according to the degradation level; For any of the phase segments, the expected behavior envelope is established using a covariance model, and the covariance matrix in the covariance model is calculated using the following formula: ; S is the sample covariance matrix of normal samples within this phase segment, p is the feature dimension within this phase segment, I is the p-order identity matrix, and δ is the contraction intensity. Wherein, the shrinkage strength δ is taken as a closed-form value that minimizes the expected Frobenius risk. , where n is the number of normal samples within that phase segment. Let Frobenius norm be the squared difference between the sample covariance matrix and the diagonal shrinkage target. It is the sum of the fluctuations of each element in the sample covariance matrix. It is the sum of the asymptotic covariances among the elements of the sample covariance matrix.
2. The robot control method according to claim 1, characterized in that, Also includes: Construct a deviation sequence based on the deviation corresponding to the tasks already performed by the production line robot. A trend test is performed on the deviation sequence to obtain the trend test results; If the trend test results indicate that the operating performance of the production line robot continues to deteriorate, then the update operation of the expected behavior envelope is frozen.
3. The robot control method according to claim 1, characterized in that, Also includes: Based on the contribution of each feature dimension constituting the feature vector to the deviation, determine the phase segment and feature dimension with the most significant deviation in the current operation; The contribution is calculated using the exact additive decomposition of Mahalanobis distance, and the sum of the contributions of each feature dimension is always equal to the deviation of the corresponding phase segment. The phase segment and feature dimension with the most significant deviation are mapped to candidate parts and causes in the preset part correspondence relationship, and corresponding suggested actions are output based on the candidate parts and causes obtained by mapping.
4. The robot control method according to claim 1, characterized in that, For any of the phase segments, the degree to which the feature vector of the phase segment exceeds the joint distribution of the multidimensional features is calculated according to the following formula: ; Where x is the feature vector of the current job within this phase segment. This is the mean vector of normal samples within this phase segment.
5. The robot control method according to claim 1, characterized in that, The step of determining whether the behavior of the current operation is abnormal based on the deviation includes: For each phase segment, the determination threshold for that phase segment is calculated using the following formula: T2(1-α) = p(n-1)(n+1) / (n(np))·F(p, np, 1-α); where α is the false alarm rate of the target, and F(p, np, 1-α) is the upper quantile of the F distribution at 1-α, where the first degree of freedom is the feature dimension p and the second degree of freedom is the difference between the number of normal samples n and the feature dimension p. The deviation of each phase segment is compared with its judgment threshold; if there is a phase segment with a deviation greater than the judgment threshold, the behavior of the current operation is determined to be abnormal; otherwise, the behavior of the current operation is determined to be normal.
6. The robot control method according to claim 1, characterized in that, The step of establishing the expected behavior envelope of the production line robot based on the normal samples within each phase segment includes: Based on the normal samples within each phase segment, establish the expected behavior envelope of the production line robot corresponding to different working conditions; The step of comparing the feature vector of the current operation within each phase segment with the expected behavior envelope, and obtaining the deviation of each phase segment based on the degree to which the feature vector exceeds the joint distribution of the multidimensional features, includes: Determine the current operating condition corresponding to the current task; The feature vector of the current operation in each phase segment is compared with the target expected behavior envelope corresponding to the current working condition. The deviation of each phase segment is obtained based on the degree of excess of the feature vector relative to the multidimensional feature joint distribution represented by the target expected behavior envelope.
7. A robot control device, applied to a production line robot, characterized in that, include: The sample acquisition module is used to acquire historical operation data of the production line robot as normal samples. The envelope establishment module is used to divide each historical operation into several phase segments according to the process stage of the operation, and establish the expected behavior envelope of the production line robot based on the normal samples in each phase segment. The expected behavior envelope is the boundary that characterizes the joint distribution of multidimensional features of normal behavior in each phase segment. An anomaly assessment module is used to construct the current operation data in each phase segment as a corresponding feature vector when the production line robot is performing the current operation, compare the feature vector of the current operation in each phase segment with the expected behavior envelope, obtain the deviation degree of each phase segment according to the degree of excess of the feature vector relative to the multidimensional feature joint distribution, and determine whether the behavior of the current operation is abnormal based on the deviation degree. The graded degradation module is used to determine the corresponding degradation level when the behavior of the current operation is determined to be abnormal, and output the safety status word corresponding to the degradation level to the production line controller to drive the production line robot to perform graded degradation control according to the degradation level; For any of the phase segments, the expected behavior envelope is established using a covariance model, and the covariance matrix in the covariance model is calculated using the following formula: ; S is the sample covariance matrix of normal samples within this phase segment, p is the feature dimension within this phase segment, I is the p-order identity matrix, and δ is the contraction intensity. Wherein, the shrinkage strength δ is taken as a closed-form value that minimizes the expected Frobenius risk. , where n is the number of normal samples within that phase segment. Let Frobenius norm be the squared difference between the sample covariance matrix and the diagonal shrinkage target. It is the sum of the fluctuations of each element in the sample covariance matrix. It is the sum of the asymptotic covariances among the elements of the sample covariance matrix.
8. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the robot control method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the robot control method according to any one of claims 1 to 6.
