A method, device, equipment and storage medium for detecting component working status
By adopting a forest detection model in the motor working state detection, comprehensively considering the detection results of the working data of multiple components, the problem of insufficient accuracy of the motor working state detection in the existing technology is solved, and more accurate component state detection is achieved to ensure the production line Run stably.
Patent Information
- Application Number
- CN202110994160.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-27
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2041-08-27
AI Technical Summary
The prior art is difficult to effectively detect the working status of the motor, which affects the normal operation of the production line.
Using the forest detection model, by obtaining the working data of multiple components, inserting them into each model tree in the forest detection model, calculating the detection scores of each detection tree, comprehensively considering the detection results of multiple detection trees, and obtaining the working status of the components Test results.
By considering the working conditions of components from multiple dimensions and using a comprehensive detection method of forest detection model, more accurate detection results of component working status are obtained to ensure the normal operation of the production line.
Smart Images

Figure CN113705668B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of abnormality detection, and in particular, to a method, device, equipment and storage medium for detecting the working status of a component. Background Art
[0002] The motor is the heart of the production line, and the state of the motor has a decisive influence on the normal operation of the production line. Therefore, it is necessary to build a detection model for the working state of the motor to detect the working state of the motor, so as to always pay attention to the working state of the motor and ensure the normal operation of the production line. Summary of the invention
[0003] Based on this, a method, device, equipment and storage medium for detecting the working status of a component are proposed to detect the working status of the component.
[0004] In a first aspect, a method for detecting a working state of a component is provided, comprising:
[0005] Acquire a data set to be detected of a target component, wherein the data set to be detected includes working data of multiple components;
[0006] Inserting the data set to be detected into each model tree in the forest detection model to obtain multiple detection trees;
[0007] Calculating a detection score of each detection tree in the plurality of detection trees, wherein the detection score represents a tree state of the detection tree;
[0008] According to the detection score of each detection tree in the plurality of detection trees, a detection result of the working state of the target component is obtained.
[0009] In the above-mentioned method for detecting the working status of components, since the data set to be detected includes the working data of multiple components, when detecting the working status of the components, the working conditions of the components can be considered from multiple dimensions, so as to obtain more accurate detection results; and, in the process of detecting the working status, a forest detection model is adopted. The forest detection model includes multiple model trees, and each model tree can be regarded as a detection model. Therefore, the forest detection model is equivalent to obtaining the detection result of the working status of the component by integrating the detection results of multiple detection models, so that the obtained detection result is more accurate.
[0010] In one embodiment, the calculation of the detection score of each detection tree in the multiple detection trees includes: obtaining the tree depth of a candidate detection tree, the candidate detection tree being a detection tree in the multiple detection trees whose detection score has not been calculated; deleting the candidate nodes in the candidate path to obtain an incomplete tree corresponding to the candidate path, the candidate path being the path of the data set to be detected in the candidate detection tree, and the candidate nodes being the nodes in the candidate path excluding the root node; calculating the tree depth of the incomplete tree corresponding to the candidate path; and obtaining the detection score of the candidate detection tree according to the tree depths of the incomplete trees corresponding to the candidate path and the tree depth of the candidate detection tree.
[0011] The above embodiment provides a method for calculating the detection score of a detection tree, which divides the change in tree depth by the reduced number of leaf nodes. Compared with the method of simply determining the detection score based on the change in tree depth, this method has a higher accuracy.
[0012] In one embodiment, the detection result of the working state of the target component is obtained based on the detection score of each detection tree in the multiple detection trees, including: summing the detection scores of each detection tree in the multiple detection trees to obtain a detection sum; dividing the detection sum by the number of detection numbers corresponding to the multiple detection trees to obtain a detection mean; and obtaining the detection result of the working state of the target component based on the detection mean.
[0013] The above embodiment provides a method for comprehensively considering the detection results of each detection tree in the forest detection model, that is, obtaining the average value of the detection scores of each detection tree and obtaining the detection result according to the average value.
[0014] In one embodiment, obtaining the detection result of the working state of the target component according to the detection mean value includes: calculating the difference between the detection mean value and a preset mean value; and obtaining the detection result of the working state of the target component according to the difference.
[0015] In the above embodiment, a mean value is preset, the detected mean value is compared with the preset mean value, and the detection result is obtained according to the comparison result.
[0016] In one embodiment, after obtaining the detection result of the working state of the target component according to the detection score of each detection tree in the multiple detection trees, it also includes: deleting the leaf node corresponding to the data set to be detected in each detection tree in the forest detection model.
[0017] In the above embodiment, after obtaining the detection result, the leaf nodes corresponding to the data set to be detected are also deleted, so that each model tree in the forest detection model is restored after the detection.
[0018] In one embodiment, it also includes: obtaining an update data set; deleting a leaf node in the update model tree to obtain a target model tree, wherein the update model tree is a model tree in the forest detection model used to update the forest detection model; and inserting the update data set into the target model tree.
[0019] The above embodiment realizes the update of the forest detection model, that is, randomly selecting a model tree, deleting old points in the tree, and then using new points to update the model.
[0020] In one embodiment, before obtaining the data set to be detected of the target component, it also includes: determining the number of model trees in the forest detection model and the number of leaf nodes in each model tree; obtaining the number of leaf nodes in the forest detection model according to the number of model trees in the forest detection model and the number of leaf nodes in each model tree; obtaining a corresponding number of historical data sets according to the number of leaf nodes in the forest detection model; and constructing the forest detection model according to the corresponding number of historical data sets.
[0021] The above embodiment provides a method for constructing a forest detection model, which first determines the size of the forest and the size of the trees, that is, the number of model trees and the number of leaf nodes in the trees, and then obtains a corresponding amount of historical component working data, thereby avoiding the need to obtain too many data sets and then downsample.
[0022] In a second aspect, a device for detecting a working state of a component is provided, comprising:
[0023] An acquisition module, used for acquiring a data set to be detected of a target component, wherein the data set to be detected includes working data of multiple components;
[0024] An insertion module, used for inserting the data set to be detected into each model tree in the forest detection model to obtain multiple detection trees;
[0025] A calculation module, used to calculate a detection score of each detection tree in the plurality of detection trees, wherein the detection score represents a tree state of the detection tree;
[0026] The result module is used to obtain the detection result of the working state of the target component according to the detection score of each detection tree in the multiple detection trees.
[0027] In one embodiment, the calculation module is specifically used to: obtain the tree depth of a candidate detection tree, wherein the candidate detection tree is a detection tree among the multiple detection trees whose detection score has not been calculated; delete the candidate nodes in the candidate path to obtain an incomplete tree corresponding to the candidate path, wherein the candidate path is the path of the data set to be detected in the candidate detection tree, and the candidate nodes are the nodes in the candidate path excluding the root node; calculate the tree depth of the incomplete tree corresponding to the candidate path; and obtain the detection score of the candidate detection tree according to the tree depths of the incomplete trees corresponding to the candidate path and the tree depth of the candidate detection tree.
[0028] In one embodiment, the result module is specifically used to: sum the detection points of each detection tree in the multiple detection trees to obtain a detection sum; divide the detection sum by the number of detection numbers corresponding to the multiple detection trees to obtain a detection mean; and obtain a detection result of the working status of the target component based on the detection mean.
[0029] In one embodiment, the result module is specifically used to: calculate the difference between the detection mean and the preset mean; and obtain the detection result of the working state of the target component according to the difference.
[0030] In one embodiment, the device for detecting the working status of a component further includes: a deletion module, configured to delete a leaf node corresponding to the data set to be detected in each detection tree in the forest detection model.
[0031] In one embodiment, the detection device for the working status of a component also includes: an update module, used to obtain an update data set; delete a leaf node in the update model tree to obtain a target model tree, wherein the update model tree is a model tree in the forest detection model used to update the forest detection model; and insert the update data set into the target model tree.
[0032] In one embodiment, the detection device for the working status of a component also includes: a construction module, used to determine the number of model trees in the forest detection model and the number of leaf nodes in each model tree; obtain the number of leaf nodes in the forest detection model according to the number of model trees in the forest detection model and the number of leaf nodes in each model tree; obtain a corresponding number of historical data sets according to the number of leaf nodes in the forest detection model; and construct the forest detection model according to the corresponding number of historical data sets.
[0033] According to a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the component working status detection method as described above when executing the computer program.
[0034] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer program instructions, and when the computer program instructions are read and executed by a processor, the steps of the component working status detection method as described above are executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 This is a schematic diagram of the implementation flow of the method for detecting the working status of a component in an embodiment of the present application;
[0037] Figure 2 A schematic diagram of inserting a data set to be detected in an embodiment of the present application;
[0038] Figure 3 A schematic diagram of inserting a data set to be detected in an embodiment of the present application;
[0039] Figure 4 A schematic diagram of inserting a data set to be detected in an embodiment of the present application;
[0040] Figure 5 A schematic diagram of the path where the leaf node is located in an embodiment of the present application;
[0041] Figure 6 This is a schematic diagram of deleting a leaf node in an embodiment of the present application;
[0042] Figure 7 This is a schematic diagram of deleting a leaf node in an embodiment of the present application;
[0043] Figure 8 This is a schematic diagram of deleting a leaf node in an embodiment of the present application;
[0044] Fig. 9 This is a schematic diagram of deleting a leaf node in an embodiment of the present application;
[0045] Fig.10 A schematic diagram of deleting a leaf node corresponding to a data set to be detected in an embodiment of the present application;
[0046] Fig.11 A schematic diagram of deleting a leaf node corresponding to a data set to be detected in an embodiment of the present application;
[0047] Fig.12A schematic diagram of generating a model tree in an embodiment of the present application;
[0048] Fig.13 It is a schematic diagram of the composition structure of the detection device of the working state of the components in the embodiment of the present application;
[0049] Fig.14 This is a block diagram of the internal structure of a computer device in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] In one embodiment, a method for detecting the working state of a component is provided. The execution subject of the method for detecting the working state of a component described in the embodiment of the present invention is a computer device capable of implementing the method for detecting the working state of a component described in the embodiment of the present invention, for example, the computer device is a device provided with a target component, for example, the target component is a motor; the computer device can also be a terminal and a server, wherein the terminal includes a desktop terminal and a mobile terminal, the desktop terminal includes but is not limited to a desktop computer and a vehicle-mounted computer, the mobile terminal includes but is not limited to a mobile phone, a tablet, a laptop computer and a smart watch, and the server includes a high-performance computer and a high-performance computer cluster, for example, the device containing the target component sends the target component's data set to be detected to the terminal or server, and after receiving the target component's data set to be detected, the terminal and the server obtain the detection result of the working state of the target component according to the method for detecting the working state of the component described in the embodiment of the present invention.
[0052] In one embodiment, Figure 1 As shown, a method for detecting the working status of a component is provided, comprising:
[0053] Step 100: Acquire a data set to be inspected of a target component, wherein the data set to be inspected includes a plurality of component working data.
[0054] The target component is a component in the machine equipment, for example, the target component is a motor.
[0055] The data set to be tested is a collection of working data of multiple components, wherein the component working data is data reflecting the working condition of the component. For example, when the target component is a motor, the four component working data in the data set to be tested are: current data, temperature data, vibration data and power data, wherein the temperature data reflects the temperature condition of the motor, the current data reflects the current condition in the motor, for example, the current data can be a three-phase current value (phase A, phase B and phase C), the vibration data reflects the vibration condition of the motor, for example, the motor vibrates during operation due to loose screws in the motor, and the power data reflects the power of the motor during operation.
[0056] A variety of detection sensors are provided for the target component, through which the data set to be detected of the target component can be acquired. For example, the various detection sensors include a current detection sensor for detecting current data and a temperature detection sensor for detecting temperature.
[0057] Acquiring the data set to be detected of the target component includes: acquiring the data set to be detected of the target component at preset time intervals. For example, if the preset time is 30 seconds, it means that the working state of the component needs to be detected every 30 seconds, so as to timely find out whether the component is abnormal.
[0058] Step 200: insert the data set to be detected into each model tree in the forest detection model to obtain multiple detection trees.
[0059] The forest detection model is a model for detecting the working status of the target component; the model tree is a tree in the forest detection model. A model tree in the forest detection model can be regarded as a detection model for detecting the working status of the target component. Since the forest detection model contains multiple model trees, the forest detection model can integrate the detection results of each model tree to obtain a more accurate detection result; the detection tree is a tree obtained after inserting the data set to be detected into the model tree.
[0060] An example of inserting a data set to be detected in a model tree is provided, including: obtaining a leaf data set corresponding to a target leaf node in the model tree; obtaining a target dimension and a target split point corresponding to the target dimension according to the data set to be detected and the leaf data set corresponding to the target leaf node; determining the initial range of the target dimension according to the leaf data sets corresponding to each leaf node in the model tree; in case 1, if the target split point is within the initial range, the data set to be detected is divided into a left subtree or a right subtree of a root node corresponding to the target leaf node; in case 2, if the target split point is not within the target range, the data set to be detected is used as a node parallel to the root node corresponding to the target leaf node. The cutoff condition for inserting the data set to be detected in the model tree is: the data set to be detected becomes a leaf node of the model tree.
[0061] As an example, Figure 2 As shown, there are a total of 7 leaf nodes in the model tree, each leaf node corresponds to a leaf data set, and the model tree has a total of 2 dimensions of component working data, one dimension is temperature, and the corresponding component working data is the temperature value, and the other dimension is current, and the corresponding component working data is the current value. According to the 7 leaf data sets, the initial range of the temperature dimension is determined to be [20,50], and according to the 7 leaf data sets, the initial range of the current dimension is determined to be [5A,20A].
[0062] Case 1: When the data set to be tested needs to be inserted, the 7 leaf nodes in the model tree are all target leaf nodes. Assuming that the data set to be tested is (15,30), according to the leaf data sets corresponding to the 7 leaf nodes and the data set to be tested, the data range of the temperature dimension is determined to be [15,50], and the data range of the current dimension is [5A,30A]. Assuming that the target dimension is the temperature dimension, a temperature value is selected from the data range of the temperature dimension [15,50] as the split point of the temperature dimension, that is, the target split point. Assuming that the target split point is 25, since 25 is within the initial range of the temperature dimension [20,50], according to Figure 2 As shown, since the temperature value of the data set to be tested is 15, which is less than the split point (30) of the root node (node A) corresponding to the target leaf node, the data set to be tested is divided into the left subtree of the root node corresponding to the 7 leaf nodes. Since the data set to be tested has not yet become a leaf node of the model tree, it needs to be further divided.
[0063] Case 2: After the division in case 1 above, the target leaf nodes become leaf nodes 1, 2, and 3. The data range of the temperature dimension of leaf nodes 1, 2, and 3 is [20, 30], and the data range of the current dimension is [5A, 20A]. Since the data set to be tested is (15, 30), the data range of the temperature dimension determined by leaf nodes 1, 2, 3 and the data set to be tested is [15, 30], and the data range of the current dimension is [5A, 30A]. Assuming that the target dimension is current and the target split point is 25A, since the target split point is not within the initial range of the current dimension [5A, 20A], if Figure 3 As shown, the node corresponding to the dataset to be detected (leaf node 8) is used as the root node corresponding to the target leaf node ( Figure 2 The nodes in parallel are the B nodes in the .
[0064] Case 1: After the division in case 1 above, the target leaf nodes become leaf nodes 1, 2, and 3. The data range of the temperature dimension of leaf nodes 1, 2, and 3 is [20, 30], and the data range of the current dimension is [5A, 20A]. Since the data set to be tested is (15, 30), the data range of the temperature dimension determined by leaf nodes 1, 2, 3 and the data set to be tested is [15, 30], and the data range of the current dimension is [5A, 30A]. Assuming that the target dimension is current, the target split point is 18A. Since the target split point is within the initial range of the current dimension [5A, 20A], if Figure 4 As shown, since the temperature value of the data set to be tested is 15, which is less than the split point (25) of the root node (B node) corresponding to the three target leaf nodes, the data set to be tested is divided into the left subtree of the root node (B node) corresponding to the three target leaf nodes. Since the data set to be tested has not yet become a leaf node of the model tree, it needs to be further divided. After the above division, the target leaf node becomes leaf node 1. The data range of the temperature dimension of leaf node 1 is [20, 25], and the initial range of the current dimension is [5A, 20A]. Since the data set to be tested is (15, 30), a suitable target dimension and target split point are selected. For example, the target dimension selected is current, and the target split point is 25A, so as to separate the leaf data set corresponding to leaf node 1 and the data set to be tested (leaf node 8 is the node corresponding to the data set to be tested).
[0065] Step 300: Calculate the detection score of each detection tree in the plurality of detection trees, wherein the detection score represents the tree state of the detection tree.
[0066] The detection score of the detection tree is a value reflecting the tree status of the detection tree; the tree status reflects whether the tree is in a normal state or an abnormal state.
[0067] Exemplarily, the tree depth of the detection tree is obtained; the tree depth of the model tree corresponding to the detection tree (the model tree before the detection tree is inserted into the data to be detected) is obtained; and the detection score of the detection tree is obtained based on the difference between the tree depth of the detection tree and the tree depth of the model tree corresponding to the detection tree.
[0068] The greater the difference between the tree depth of the detection tree and the tree depth of the model tree corresponding to the detection tree, the more abnormal it is considered, and accordingly, the greater the detection score of the detection tree; the smaller the difference between the tree depth of the detection tree and the tree depth of the model tree corresponding to the detection tree, the more normal it is considered, and accordingly, the smaller the detection score of the detection tree.
[0069] Step 400: Obtain a detection result of the working state of the target component according to the detection score of each detection tree in the plurality of detection trees.
[0070] The working status reflects whether the working condition of the target component is normal or abnormal. For example, when the detection score of each detection tree is lower than the preset detection score, the detection result of the working status of the target component is normal, wherein the preset detection score is a preset threshold for judging the detection score; otherwise, the detection result of the working status of the target component is abnormal.
[0071] In the above-mentioned method for detecting the working status of components, since the data set to be detected includes the working data of multiple components, when detecting the working status of the components, the working conditions of the components can be considered from multiple dimensions, so as to obtain more accurate detection results; and, in the process of detecting the working status, a forest detection model is adopted. The forest detection model includes multiple model trees, and each model tree can be regarded as a detection model. Therefore, the forest detection model is equivalent to obtaining the detection result of the working status of the component by integrating the detection results of multiple detection models, so that the obtained detection result is more accurate.
[0072] In one embodiment, the component working state detection method further includes: if the detection result of the working state of the target component is abnormal, generating abnormal prompt information, so as to provide a prompt through the abnormal prompt information.
[0073] In one embodiment, the step 300 of calculating the detection score of each detection tree in the plurality of detection trees includes:
[0074] Step 301, obtaining the tree depth of a candidate detection tree, wherein the candidate detection tree is a detection tree among the multiple detection trees for which detection scores have not been calculated.
[0075] Obtain the path where each leaf node in the candidate detection tree is located; and obtain the tree depth of the candidate detection tree according to the path where each leaf node is located.
[0076] like Figure 5 As shown in the left figure, the path where leaf node 111 is located is: 1-11-111, the path where leaf node 1121 is located is: 1-11-112-1121, and the path where leaf node 12211 is located is: 1-12-122-1221-12211. The depth of the path where leaf node 111 is located is: 2, the depth of the path where leaf node 1121 is located is: 3, and the depth of the path where leaf node 12211 is: 4. Sum the depths of the paths where each leaf node is located to obtain the tree depth of the candidate detection tree, as shown in Figure 5 The tree depth of the candidate detection tree is: 21.
[0077] Step 302, delete the candidate nodes in the candidate path to obtain the incomplete tree corresponding to the candidate path, the candidate path is the path of the data set to be detected in the candidate detection tree, and the candidate nodes are the nodes in the candidate path excluding the root node.
[0078] Assuming that leaf node 12211 is the node corresponding to the data set to be detected, the candidate path is 1-12-122-1221-12211.
[0079] If the candidate node is leaf node 12211, then delete leaf node 12211, and the resulting incomplete tree 1 is as follows Figure 6 As shown in FIG. 1 , after deleting the leaf node 12211, the node 1221 becomes 12212; if the candidate node is the node 1221, then after deleting the candidate node 1221, the incomplete tree 2 obtained is as follows: Figure 7 As shown in FIG. 1 , after deleting leaf node 1221, node 122 becomes 1222; if the candidate node is 122, then after deleting candidate node 122, the incomplete tree 3 obtained is as follows: Figure 8 As shown in FIG. 1 , after deleting leaf node 122, node 12 becomes 121; if the candidate node is 12, then after deleting candidate node 12, the incomplete tree 4 obtained is as follows: Fig. 9 shown.
[0080] Step 303: Calculate the tree depth of the incomplete tree corresponding to the candidate path.
[0081] The tree depth of the incomplete tree is calculated according to the method of calculating the tree depth of the candidate detection tree in step 301, which will not be described in detail here. The tree depths of the incomplete trees 1, 2, 3, and 4 are obtained as follows: 16, 12, 9, and 5.
[0082] Step 304: Obtain the detection score of the candidate detection tree according to the tree depth of each incomplete tree corresponding to the candidate path and the tree depth of the candidate detection tree.
[0083] The tree depth of the candidate detection tree is subtracted from the tree depth of the incomplete tree to obtain the depth change corresponding to the incomplete tree; the depth change corresponding to the incomplete tree is divided by the number of node reductions to obtain the detection score of the incomplete tree; the detection score of the candidate detection tree is obtained according to the detection scores corresponding to each incomplete tree corresponding to the candidate path.
[0084] The number of nodes reduced is the number of leaf nodes included in the candidate detection tree minus the number of leaf nodes included in the incomplete tree. For example, for incomplete tree 1, the number of leaf nodes included in the candidate detection tree is 7, and the number of leaf nodes included in incomplete tree 1 is 6, so the number of nodes reduced is 1.
[0085] For example, for incomplete tree 1, the detection score is: (21-16) / (7-6)=5; for incomplete tree 2, the detection score is: (21-12) / (7-5)=4.5; for incomplete tree 3, the detection score is: (21-9) / (7-4)=4; for incomplete tree 4, the detection score is: (21-5) / (7-3)=4. Since the maximum detection score is 5, 5 is used as the detection score of the candidate detection tree.
[0086] The above embodiment provides a method for calculating the detection score of a detection tree, which divides the change in tree depth by the reduced number of leaf nodes. Compared with the method of simply determining the detection score based on the change in tree depth, this method has a higher accuracy.
[0087] In one embodiment, step 400 obtains the detection result of the working state of the target component according to the detection score of each detection tree in the plurality of detection trees, including:
[0088] Step 401, summing up the detection score of each detection tree in the plurality of detection trees to obtain a detection sum.
[0089] For example, there are a total of 3 detection trees in the forest detection model, and the detection scores of the 3 detection trees are A, B and C respectively, so the detection sum is: A+B+C.
[0090] Step 402: Divide the detection sum by the number of detections corresponding to the multiple detection trees to obtain a detection mean.
[0091] The detection mean is: (A+B+C) / 3.
[0092] Step 403: Obtain a detection result of the working state of the target component according to the detection mean.
[0093] Exemplarily, if the detection mean is within [T1, T2], the detection result is normal; if the detection mean is within [T2, T3], the detection result is abnormal.
[0094] The above embodiment provides a method for comprehensively considering the detection results of each detection tree in the forest detection model, that is, obtaining the average value of the detection scores of each detection tree and obtaining the detection result according to the average value.
[0095] In one embodiment, the step 403 of obtaining the detection result of the working state of the target component according to the detection mean value includes:
[0096] Calculating the difference between the detected mean and a preset mean;
[0097] A detection result of the working state of the target component is obtained according to the difference.
[0098] For example, the preset mean is R, the detection mean is U, and the difference is UR. If UR is greater than 0, the detection result of the working state of the target component is abnormal; if UR is less than 0, the detection result of the working state of the target component is normal.
[0099] In the above embodiment, a mean value is preset, the detected mean value is compared with the preset mean value, and the detection result is obtained according to the comparison result.
[0100] In one embodiment, after obtaining the detection result of the working state of the target component according to the detection score of each detection tree in the plurality of detection trees in step 400, the method further includes:
[0101] Step 500: delete the leaf node corresponding to the to-be-detected data set in each detection tree in the forest detection model.
[0102] like Fig.10 and 11 As shown, this is a schematic diagram of deleting the leaf node 8 corresponding to the data set to be detected. All parts covered with triangles need to be deleted, that is, not only the leaf node but also the rule for obtaining the leaf node and the parent node of the leaf node need to be deleted, so as to restore the model tree.
[0103] In the above embodiment, after obtaining the detection result, the leaf nodes corresponding to the data set to be detected are also deleted, so that each model tree in the forest detection model is restored after the detection.
[0104] In one embodiment, the method for detecting the working status of a component further includes:
[0105] Step 600, obtaining an update data set.
[0106] The update data set is a data set used to update the forest detection model. For example, the update data set is obtained at a predetermined time interval. For example, if the predetermined time interval is 2 minutes, it means that the forest detection model is updated every 2 minutes.
[0107] Step 700, deleting a leaf node in the update model tree to obtain a target model tree, wherein the update model tree is a model tree in the forest detection model used to update the forest detection model.
[0108] The updated model tree is one of the multiple model trees in the forest detection model. One of the multiple model trees in the forest detection model can be randomly selected as the updated model tree, and a leaf node in the updated model tree is deleted to obtain the target model tree, such as Figure 5 shown.
[0109] Exemplarily, the leaf target node is determined according to the survival time of each leaf node in the update model tree; the leaf target node in the update model tree is deleted. For example, the leaf node with the longest survival time is deleted to ensure that the forest detection model is continuously updated over time. Survival time = current time - time of inserting into the update model tree. For example, the current time is 10:28:32, and the time of inserting a leaf node into the update model tree is 10:27:32, so the survival time of the leaf node is 1 minute.
[0110] Step 800: insert the update data set into the target model tree.
[0111] The inserting method is as in step 200 and will not be described in detail here.
[0112] The above embodiment realizes the update of the forest detection model, that is, randomly selecting a model tree, deleting old points in the tree, and then using new points to update the model.
[0113] In one embodiment, before step 100 of acquiring the to-be-detected data set of the target component, the method further includes:
[0114] Step 900, determining the number of model trees in the forest detection model and the number of leaf nodes in each model tree.
[0115] Step 1000, obtaining the number of leaf nodes in the forest detection model according to the number of model trees in the forest detection model and the number of leaf nodes in each model tree.
[0116] For example, if the number of model trees is A and the number of leaf nodes in each model tree is B, then the number of leaf nodes in the forest detection model is A×B.
[0117] Step 1100, acquiring a corresponding number of historical data sets according to the number of leaf nodes in the forest detection model.
[0118] The historical data set is a data set collected historically. For example, A×B=C historical data sets are obtained. After the model tree is built, one leaf node corresponds to one historical data set.
[0119] Step 1200, constructing the forest detection model according to the corresponding number of historical data sets.
[0120] The C historical data sets are divided into A sets, each set contains B historical data sets, and a set of sets generates a model tree.
[0121] The following describes how to generate a model tree. Initialize a root node, the sample set corresponding to the root node contains B historical data sets; if there is only one data set in the current sample set corresponding to the current node, mark the current node as a leaf node; if the number of data sets in the current sample set corresponding to the current node is greater than 1, determine the data range ki=max of the i-th dimension in the current sample set corresponding to the current node i -min i , max i is the maximum value of the data contained in dimension i, and mini is the minimum value of the data contained in dimension i; according to ki / ∑ j The probability of kj selects a dimension q, where j = 1, 2, 3, ..., d, where d is the maximum value of the dimension. For dimension q, from [min q , max q ] as a split point, and based on the split point, the data set contained in the current sample set is divided into two. For example, the data set smaller than the split point is divided into the right child node of the current node, and the data set greater than or equal to the split point is divided into the left child node of the current node.
[0122] For example Fig.12 , B=7, that is, there are 7 historical data sets in the sample set corresponding to the root node, assuming they are: (50°, 17A), (44°, 17A), (41°, 9A), (39°, 20A), (38°, 16A), (30°, 5A), (20°, 17A). When the first division is performed, the current node is the root node, and the current sample set includes the above 7 historical data sets. Therefore, the number of historical data sets is greater than 1. Therefore, the data range of the first dimension temperature is: [20,50], and the data range of the second dimension current is: [5A,20A]. Assuming that dimension q is temperature, select one from the data range [20,50] as the split point. For example, the split point is 40, so the historical data sets 1 to 3 are divided into the left child node of the root node, and the historical data sets 4 to 7 are divided into the right child node of the root node; assuming that the current node is the left child node of the root node, and the current sample set is the historical data sets 1 to 3, because the number of historical data sets contained in the left child node of the root node is greater than 1, therefore, according to the historical data sets 1 to 3, the data range of the first dimension temperature is determined to be: [41,50], and the data range of the second dimension current is: [9A,17A]. Assuming that the dimension q is temperature, select one from the data range [41,50] as the split point. For example, the split point is 45, so the historical data set 1 is divided into the current node ( Fig.12The left child node of the node with the black triangle in the figure), historical data sets 2 and 3 are divided into the right child node of the current node. It can be seen that historical data set 1 becomes a leaf node, while historical data sets 2 and 3 still need to be divided.
[0123] The above embodiment provides a method for constructing a forest detection model, which first determines the size of the forest and the size of the trees, that is, the number of model trees and the number of leaf nodes in the trees, and then obtains a corresponding amount of historical component working data, thereby avoiding the need to obtain too many data sets and then downsample.
[0124] In one embodiment, Fig.13 , a detection device 1300 for detecting the working state of a component is provided, comprising:
[0125] An acquisition module 1301 is used to acquire a data set to be detected of a target component, wherein the data set to be detected includes working data of multiple components;
[0126] An inserting module 1302 is used to insert the to-be-detected data set into each model tree in the forest detection model to obtain multiple detection trees;
[0127] A calculation module 1303, configured to calculate a detection score of each detection tree in the plurality of detection trees, wherein the detection score indicates a tree state of the detection tree;
[0128] The result module 1304 is used to obtain the detection result of the working state of the target component according to the detection score of each detection tree in the multiple detection trees.
[0129] In one embodiment, the calculation module 1303 is specifically used to: obtain the tree depth of a candidate detection tree, wherein the candidate detection tree is a detection tree among the multiple detection trees whose detection score has not been calculated; delete the candidate nodes in the candidate path to obtain an incomplete tree corresponding to the candidate path, wherein the candidate path is the path of the data set to be detected in the candidate detection tree, and the candidate nodes are the nodes in the candidate path excluding the root node; calculate the tree depth of the incomplete tree corresponding to the candidate path; and obtain the detection score of the candidate detection tree according to the tree depths of the incomplete trees corresponding to the candidate path and the tree depth of the candidate detection tree.
[0130] In one embodiment, the result module 1304 is specifically used to: sum the detection points of each detection tree in the multiple detection trees to obtain a detection sum; divide the detection sum by the number of detection numbers corresponding to the multiple detection trees to obtain a detection mean; and obtain a detection result of the working status of the target component based on the detection mean.
[0131] In one embodiment, the result module 1304 is specifically used to: calculate the difference between the detection mean and the preset mean; and obtain the detection result of the working state of the target component according to the difference.
[0132] In one embodiment, the device 1300 for detecting the working status of a component further includes: a deleting module, configured to delete a leaf node corresponding to the data set to be detected in each detection tree in the forest detection model.
[0133] In one embodiment, the detection device 1300 for the working status of a component further includes: an update module, used to obtain an update data set; delete a leaf node in the update model tree to obtain a target model tree, wherein the update model tree is a model tree in the forest detection model used to update the forest detection model; and insert the update data set into the target model tree.
[0134] In one embodiment, the detection device 1300 for the working status of a component further includes: a construction module, used to determine the number of model trees in the forest detection model and the number of leaf nodes in each model tree; obtain the number of leaf nodes in the forest detection model according to the number of model trees in the forest detection model and the number of leaf nodes in each model tree; obtain a corresponding number of historical data sets according to the number of leaf nodes in the forest detection model; and construct the forest detection model according to the corresponding number of historical data sets.
[0135] In one embodiment, Fig.14As shown, a computer device is provided, which can be a terminal or a server, or a device including a motor. The computer device includes a processor, a memory and a network interface connected by a system bus, and the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and can also store a computer program. When the computer program is executed by the processor, the processor can implement a detection method for the working state of the component. The non-volatile memory may include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM) or a flash memory. The volatile memory may include a random access memory (RAM) or an external cache memory. As an illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM). The internal memory may also store a computer program, which, when executed by the processor, enables the processor to execute the method for detecting the working status of the component. Fig.14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0136] The component working state detection method provided in the present application can be implemented in the form of a computer program. The computer program can be used in Fig.14 The computer device shown in the figure is run. The memory of the computer device can store various program templates of the detection device of the working status of the components, such as the acquisition module 1301, the insertion module 1302 and the calculation module 1303.
[0137] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the following steps:
[0138] Acquire a data set to be detected of a target component, wherein the data set to be detected includes working data of multiple components;
[0139] Inserting the data set to be detected into each model tree in the forest detection model to obtain multiple detection trees;
[0140] Calculating a detection score of each detection tree in the plurality of detection trees, wherein the detection score represents a tree state of the detection tree;
[0141] According to the detection score of each detection tree in the plurality of detection trees, a detection result of the working state of the target component is obtained.
[0142] In one embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the processor performs the following steps:
[0143] Acquire a data set to be detected of a target component, wherein the data set to be detected includes working data of multiple components;
[0144] Inserting the data set to be detected into each model tree in the forest detection model to obtain multiple detection trees;
[0145] Calculating a detection score of each detection tree in the plurality of detection trees, wherein the detection score represents a tree state of the detection tree;
[0146] According to the detection score of each detection tree in the plurality of detection trees, a detection result of the working state of the target component is obtained.
[0147] It should be noted that the above-mentioned component working status detection method, component working status detection device, computer equipment and computer-readable storage medium belong to a general inventive concept, and the contents of the component working status detection method, component working status detection device, computer equipment and computer-readable storage medium embodiments are applicable to each other.
[0148] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0149] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0150] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0151] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0152] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for detecting the working status of a component, characterized in that: include: Acquire a data set to be detected of a target component, wherein the data set to be detected includes working data of multiple components; Inserting the data set to be detected into each model tree in the forest detection model to obtain multiple detection trees; Calculating a detection score of each detection tree in the plurality of detection trees, wherein the detection score represents a tree state of the detection tree; Obtaining a detection result of the working state of the target component according to the detection score of each detection tree in the plurality of detection trees; The step of obtaining the detection result of the working state of the target component according to the detection score of each detection tree in the plurality of detection trees comprises: summing the detection score of each detection tree in the plurality of detection trees to obtain a detection sum; Dividing the detection sum by the number of detections corresponding to the multiple detection trees to obtain a detection mean; Obtaining a detection result of the working state of the target component according to the detection mean; The calculating the detection score of each detection tree in the plurality of detection trees comprises: Obtaining a tree depth of a candidate detection tree, wherein the candidate detection tree is a detection tree among the multiple detection trees for which detection scores have not yet been calculated; Deleting candidate nodes in a candidate path to obtain an incomplete tree corresponding to the candidate path, wherein the candidate path is a path of the to-be-detected data set in the candidate detection tree, and the candidate nodes are nodes in the candidate path excluding a root node; Calculating the tree depth of the incomplete tree corresponding to the candidate path; The detection score of the candidate detection tree is obtained according to the tree depth of each incomplete tree corresponding to the candidate path and the tree depth of the candidate detection tree.
2. The detection method according to claim 1, characterized in that The step of obtaining a detection result of the working state of the target component according to the detection mean value includes: Calculating the difference between the detected mean and a preset mean; A detection result of the working state of the target component is obtained according to the difference.
3. The detection method according to claim 1, characterized in that After obtaining the detection result of the working state of the target component according to the detection score of each detection tree in the plurality of detection trees, the method further includes: In each detection tree in the forest detection model, a leaf node corresponding to the data set to be detected is deleted.
4. The detection method according to claim 1, characterized in that Also includes: Get updated dataset; Deleting a leaf node in the update model tree to obtain a target model tree, wherein the update model tree is a model tree in the forest detection model used to update the forest detection model; The update data set is inserted into the target model tree.
5. The detection method according to claim 1, characterized in that: Before obtaining the to-be-detected data set of the target component, the method further includes: Determine the number of model trees in the forest detection model and the number of leaf nodes in each model tree; According to the number of model trees in the forest detection model and the number of leaf nodes in each model tree, the number of leaf nodes in the forest detection model is obtained; According to the number of leaf nodes in the forest detection model, a corresponding number of historical data sets are obtained; The forest detection model is constructed based on the corresponding number of historical data sets.
6. A device for detecting the working state of a component, characterized in that: include: An acquisition module, used for acquiring a data set to be detected of a target component, wherein the data set to be detected includes working data of multiple components; An insertion module, used for inserting the data set to be detected into each model tree in the forest detection model to obtain multiple detection trees; A calculation module, used to calculate a detection score of each detection tree in the plurality of detection trees, wherein the detection score represents a tree state of the detection tree; The calculating the detection score of each detection tree in the plurality of detection trees comprises: Obtaining a tree depth of a candidate detection tree, wherein the candidate detection tree is a detection tree among the multiple detection trees for which detection scores have not yet been calculated; Deleting candidate nodes in a candidate path to obtain an incomplete tree corresponding to the candidate path, wherein the candidate path is a path of the to-be-detected data set in the candidate detection tree, and the candidate nodes are nodes in the candidate path excluding a root node; Calculating the tree depth of the incomplete tree corresponding to the candidate path; Obtaining a detection score of the candidate detection tree according to the tree depth of each incomplete tree corresponding to the candidate path and the tree depth of the candidate detection tree; A result module, used for obtaining a detection result of the working state of the target component according to the detection score of each detection tree in the plurality of detection trees; The step of obtaining the detection result of the working state of the target component according to the detection score of each detection tree in the plurality of detection trees comprises: summing the detection score of each detection tree in the plurality of detection trees to obtain a detection sum; Dividing the detection sum by the number of detections corresponding to the multiple detection trees to obtain a detection mean; A detection result of the working state of the target component is obtained according to the detection mean.
7. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for detecting the working status of a component as claimed in any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are read and executed by a processor, the steps of the method for detecting the working status of a component according to any one of claims 1 to 5 are executed.
Citation Information
Patent Citations
Early warning method for on-line operation state of electric power metering equipment
CN112561176A