Model training method and system, and electrical equipment fault prediction method and system

By generating global hard negative samples and batch hard negative samples, dynamically adjusting the preset embedded model, and optimizing the electrical equipment knowledge graph model, the problems of limited data quality and quantity are solved, and the accuracy and efficiency of electrical equipment fault diagnosis are improved.

CN120338027APending Publication Date: 2025-07-18SHANGHAI ELECTRICGROUP CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510468216.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

In the diagnosis of electrical equipment faults, in the case of limited data quality and quantity, the model is poor in general and has low accuracy, making it difficult to effectively extract knowledge.

Method used

By generating global hard negative samples and batch hard negative samples, dynamically adjust the preset embedded model, calculate the target loss value, and optimize the electrical equipment knowledge graph model.

Benefits of technology

It significantly improves the distinction ability and robustness of the model, improves the accuracy and efficiency of electrical equipment fault diagnosis, and supports real-time fault prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120338027A_ABST
    Figure CN120338027A_ABST
Patent Text Reader

Abstract

The invention provides a model training method and system, and an electrical equipment fault prediction method and system. The training method comprises the following steps: acquiring triple data; taking the triple data as positive sample data, and generating candidate negative sample data corresponding to the positive sample data; inputting the positive sample data and the candidate negative sample data into a preset embedded model, and outputting the similarity between the candidate negative sample data and the corresponding positive sample data; selecting the candidate negative sample data of which the similarity is smaller than a preset similarity as global hard negative sample data; dividing the triple data into a plurality of positive sample data subsets; dynamically generating corresponding batch hard negative sample data based on the positive sample data subset; calculating a target loss value based on the global hard negative sample data, the batch hard negative sample data and the positive sample data; and dynamically adjusting a preset embedded model based on the target loss value to obtain an electrical equipment knowledge graph model. And through global hard negative samples and batch hard negative samples, the model distinguishing capability and robustness are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of knowledge graph models for electrical equipment, and particularly to a method and system for training a model, a method and system for fault prediction of electrical equipment. Background Art

[0002] With the rapid development of the Internet and digital technologies, data knowledge extraction technology has been widely applied in multiple fields. Especially in the application of knowledge graphs in the scenarios of electrical equipment maintenance and fault diagnosis, the core task of data knowledge extraction is to extract valuable information from diverse data sources and transform it into a knowledge form that can be used to support decision-making.

[0003] Traditional methods usually rely on pre-set data patterns, rules, or a large amount of labeled data to train a model so as to accurately extract the required information from specific types of data. However, in practical applications, when facing data sources related to electrical equipment, problems such as insufficient data or low data quality are often encountered, resulting in difficulties in negative sample mining, and it is difficult to carry out effective pattern definition, rule formulation, and data annotation work. Furthermore, the accuracy of data knowledge extraction is affected, and the model falls into the problem of local optimal solutions.

[0004] In view of the above problems, there is an urgent need for a technical solution that can still effectively perform knowledge extraction under the condition of limited data quality and quantity, so as to improve the intelligent level of electrical equipment maintenance and fault diagnosis. Summary of the Invention

[0005] The technical problem to be solved by the present disclosure is to overcome the defects of poor generalization and low accuracy of the trained model in the prior art under the condition of limited data quality and quantity, and to provide a method and system for training a model, a method and system for fault prediction of electrical equipment, a device, a medium, and a program product.

[0006] The present disclosure solves the above technical problem by the following technical solutions:

[0007] In a first aspect, a method for training an electrical equipment knowledge graph model is provided, and the training method includes:

[0008] Obtain triple data, where the triple data includes equipment data, fault phenomenon data, and relationship data;

[0009] Use the triple data as positive sample data to generate candidate negative sample data corresponding to the positive sample data;

[0010] Input the positive sample data and the candidate negative sample data into a preset embedding model, and output the similarity between the candidate negative sample and the corresponding positive sample data;

[0011] Select the candidate negative sample data with the similarity less than the preset similarity as the global hard negative sample data;

[0012] Divide the triple data into several positive sample data subsets;

[0013] Dynamically generate corresponding batch hard negative sample data based on the positive sample data subsets;

[0014] Calculate the target loss value based on the global hard negative sample data, the batch hard negative sample data, and the positive sample data;

[0015] Dynamically adjust the preset embedding model based on the target loss value to obtain an electrical equipment knowledge graph model.

[0016] Optionally, the step of calculating the target loss value based on the global hard negative sample data, the batch hard negative sample data, and the positive sample data includes:

[0017] Mix the global hard negative sample data and the batch hard negative sample data in proportion;

[0018] Use the global hard negative sample data or the batch hard negative sample data and the positive sample data to calculate the Triplet Loss to obtain a first loss value, and calculate the Contrastive Loss to obtain a second loss value;

[0019] Calculate the target loss value by weighting the first loss value and the second loss value.

[0020] Optionally, the step of dynamically generating corresponding batch hard negative sample data based on the positive sample data subsets includes:

[0021] Calculate the difference in embedding vector distances between each candidate negative sample and the positive sample data in the current positive sample data subset, and select the candidate negative sample with the smallest distance difference as the batch hard negative sample data of the current positive sample data subset;

[0022] Dynamically generate corresponding batch hard negative sample data for each positive sample data subset.

[0023] Optionally, the step of dynamically adjusting the preset embedding model based on the target loss value includes:

[0024] Dynamically adjust the margin of the preset embedding model based on the target loss value;

[0025] Wherein, the margin is inversely proportional to the target loss value.

[0026] Second aspect, a fault prediction method for an electrical device is provided, and the fault prediction method includes:

[0027] Obtaining real-time fault phenomenon data of a target electrical device;

[0028] Inputting the real-time fault phenomenon data into an electrical device knowledge graph model to obtain at least one of a corresponding fault cause chain, associated fault phenomenon data, and a device health score of the target device;

[0029] Wherein, the electrical device knowledge graph model is obtained based on the training method of the electrical device knowledge graph model described in the first aspect.

[0030] Third aspect, a training system for an electrical device knowledge graph model is provided, including a data acquisition module, a negative sample generation module, a similarity output module, a global hard negative sample selection module, a batch division module, a batch hard negative sample generation module, a loss value calculation module, and a model adjustment module;

[0031] The data acquisition module is configured to acquire triple data, where the triple data includes device data, fault phenomenon data, and relationship data;

[0032] The negative sample generation module is configured to use the triple data as positive sample data and generate candidate negative sample data corresponding to the positive sample data;

[0033] The similarity output module is configured to input the positive sample data and the candidate negative sample data into a preset embedding model and output the similarity between the candidate negative sample and the corresponding positive sample data;

[0034] The global hard negative sample selection module is configured to select the candidate negative sample data with a similarity less than a preset similarity as global hard negative sample data;

[0035] The batch division module is configured to divide the triple data into several positive sample data subsets;

[0036] The batch hard negative sample generation module is configured to dynamically generate corresponding batch hard negative sample data based on the positive sample data subset;

[0037] The loss value calculation module is configured to calculate a target loss value based on the global hard negative sample data, the batch hard negative sample data, and the positive sample data;

[0038] The model adjustment module is configured to dynamically adjust the preset embedding model based on the target loss value to obtain an electrical device knowledge graph model.

[0039] Fourthly, a fault prediction system for an electrical device is provided, including a fault phenomenon acquisition module and a fault prediction module;

[0040] The fault phenomenon acquisition module is configured to acquire real-time fault phenomenon data of a target electrical device;

[0041] The fault prediction module is configured to input the real-time fault phenomenon data into an electrical device knowledge graph model to obtain at least one of a corresponding fault cause chain, associated fault phenomenon data, and a device health score of the target device;

[0042] Wherein, the electrical device knowledge graph model is obtained based on the training system of the electrical device knowledge graph model described in the third aspect.

[0043] Fifthly, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and configured to run on the processor. When the processor executes the computer program, the training method of the electrical device knowledge graph model described in the first aspect or the fault prediction method of the electrical device described in the second aspect is implemented.

[0044] Sixthly, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the training method of the electrical device knowledge graph model described in the first aspect or the fault prediction method of the electrical device described in the second aspect is implemented.

[0045] Seventhly, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the training method of the electrical device knowledge graph model described in the first aspect or the fault prediction method of the electrical device described in the second aspect is implemented.

[0046] On the basis of conforming to the common knowledge in the art, the above preferred conditions can be combined arbitrarily to obtain various preferred examples of the present disclosure.

[0047] The positive and progressive effects of the present disclosure are as follows: By generating global hard negative sample data, the difficulty and effect of model training are significantly improved, which helps the model better distinguish complex semantics in the electrical device fault relationship. Using batch hard negative sample data, the structured management of the electrical device fault diagnosis knowledge graph is realized, so that the divided positive sample data subset improves the efficiency and accuracy of data processing, and provides support for model training and evaluation; enables the model to have stronger discrimination ability and robustness. An optimized electrical device knowledge graph model is obtained, which can accurately represent the electrical device fault relationship and provide efficient support for fault diagnosis and real-time prediction. Description of the Drawings

[0048] Figure 1Flow chart of a method for training an electrical equipment knowledge graph model provided by an exemplary embodiment of the present disclosure;

[0049] Figure 2 Flow chart of step S107 in a method for training an electrical equipment knowledge graph model provided by an exemplary embodiment of the present disclosure;

[0050] Figure 3 Flow chart of step S106 in a method for training an electrical equipment knowledge graph model provided by an exemplary embodiment of the present disclosure;

[0051] Figure 4 Flow chart of a method for fault prediction of electrical equipment provided by an exemplary embodiment of the present disclosure;

[0052] Figure 5 Schematic diagram of modules of a training system for an electrical equipment knowledge graph model provided by an exemplary embodiment of the present disclosure;

[0053] Figure 6 Schematic diagram of modules of a fault prediction system for electrical equipment provided by an exemplary embodiment of the present disclosure;

[0054] Figure 7 Schematic diagram of the hardware structure of an electronic device provided by an exemplary embodiment of the present disclosure. Detailed implementation manners

[0055] The present disclosure will be further described below by way of examples, but the present disclosure is not limited to the scope of the described examples.

[0056] In the embodiments of the present disclosure, prefix words such as "first" and "second" are only used to distinguish different described objects, and do not limit the position, order, priority, quantity or content of the described objects. The use of ordinal words and other prefix words for distinguishing described objects in the embodiments of the present disclosure does not limit the described objects. For the description of the described objects, refer to the description in the claims or the context of the embodiments. There should be no redundant limitation due to the use of such prefix words. In addition, in the description of this embodiment, unless otherwise specified, the meaning of "a plurality" is two or more.

[0057] In the embodiments of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of the user's personal information and other processes all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.

[0058] Embodiment 1

[0059] Figure 1 Flow chart of a method for training an electrical equipment knowledge graph model provided by an exemplary embodiment of the present disclosure, as Figure 1As shown, the training method includes:

[0060] S101. Obtain triple data, where the triple data includes device data, fault phenomenon data, and relationship data;

[0061] Optionally, the device data and the fault phenomenon data are sourced from structured data such as SCADA system data, or unstructured files such as device operation logs, maintenance records, or fault recording files, or texts such as professional literature or device manuals. And relationship data between the device data and the fault phenomenon data is generated through rule mining algorithms, expert knowledge bases, or causal chain analysis tools to form triple data. Among them, each entity pair of device data and fault phenomenon data in the triple data corresponds to a relationship data label.

[0062] S102. Use the triple data as positive sample data and generate candidate negative sample data corresponding to the positive sample data;

[0063] Optionally, by randomly replacing the head entity or the tail entity in the triple of the positive sample data, candidate negative samples are generated. For example, the device entity in the positive sample is replaced with a similar device, or the fault entity is replaced with other electrical faults, but faults that have a causal conflict with the positive sample are excluded, or the original relationship type is disrupted, and the fault cause and the fault phenomenon are replaced. The replaced entities comply with the physical constraints of electrical equipment.

[0064] S103. Input the positive sample data and the candidate negative sample data into a preset embedding model, and output the similarity between the candidate negative sample and the corresponding positive sample data;

[0065] Optionally, the preset embedding model can adopt BERT, Word2Vec, GloVe, etc., to convert the entity pairs of device data and fault phenomenon data in the triple data, and the corresponding relationship data labels into vector representations. The similarity between the two is calculated through the vector representations of the positive sample data and the candidate negative sample data output by the embedding model. In one embodiment, the parametric weighted Euclidean distance or cosine similarity can be used to measure the difference between the candidate negative sample data and the positive sample data.

[0066] Optionally, the preset embedded model includes an input layer, an entity embedding layer, a relationship embedding layer, and a loss function layer. The input layer is used to extract entity pairs from the input text and convert the entity pairs into embedding vectors; the entity embedding layer is used to convert entities and relationship labels into vector representations, and concatenate the vectors of the two entities in each entity pair or generate a vector representation of the entire entity pair in other ways; the relationship embedding layer is used to calculate the vector representation of the relationship for each entity pair; the loss function layer is used to combine triple loss, contrastive loss, and consistency loss to calculate the loss of each entity pair. The triple loss is used to bring closer similar entity pairs and push away dissimilar entity pairs; the contrastive loss is used to further distinguish entity pairs with different relationships; the consistency loss is used to improve the accuracy and consistency of the task.

[0067] S104. Select the candidate negative sample data with a similarity less than the preset similarity as the global hard negative sample data;

[0068] Optionally, according to the requirements of the electrical equipment fault diagnosis scenario, set the threshold of the preset similarity. Screen the similarities of all candidate negative sample data, and select the negative samples with similarities less than the preset similarity threshold as the hard negative samples. Define the set of screened hard negative samples as the global hard negative sample data.

[0069] S105. Divide the triple data into several positive sample data subsets;

[0070] Optionally, allocate positive sample data subsets according to the device type based on the device data. Based on different device type subsets, the batch size is usually set to 32 or 64, and the specific value can be optimized according to the usage situation. Fault diagnosis models specifically for a certain type of device can be trained respectively to improve the pertinence and accuracy of the model.

[0071] S106. Dynamically generate corresponding batch hard negative sample data based on the positive sample data subsets;

[0072] Optionally, perform batch processing on each positive sample data subset, select all triples in the subset as positive sample inputs; in the triples of the positive sample data, dynamically replace the head entity, the tail entity, or the relationship label to generate hard negative samples; for all triples in the positive sample subset, batch generate corresponding hard negative sample data.

[0073] Optionally, start with global mining to ensure wide coverage, and gradually turn to in-batch mining as the training progresses to improve efficiency.

[0074] S107. Calculate the target loss value based on the global hard negative sample data, the batch hard negative sample data, and the positive sample data;

[0075] Optionally, input the positive sample data, global hard negative sample data, and batch hard negative sample data into the embedded model, map them into low-dimensional vectors, calculate the semantic distance between the positive sample data and the global hard negative sample data or batch hard negative sample data, and measure the distinguishability between the two in the embedding space. Combine the contrast loss and triplet loss with dynamic adjustment of the adaptive loss weight and dynamic margin adjustment, comprehensively calculate the loss values between the positive sample data and the global hard negative sample data, batch hard negative sample data, and the target loss value is the weighted sum of the two. In one embodiment, the knowledge graph consistency loss is also combined, and the target loss value is obtained by the weighted sum of the contrast loss, triplet loss, and knowledge graph consistency loss.

[0076] S108. Dynamically adjust the preset embedded model based on the target loss value to obtain an electrical equipment knowledge graph model.

[0077] Optionally, according to the feedback result of the target loss value, determine whether the current performance of the preset embedded model needs to be adjusted; use the gradient calculated by the target loss value to dynamically adjust the parameters of the embedded model, and dynamically adjust the weights of the positive and negative samples according to the target loss value to optimize the effect of the loss function. Repeat the steps of target loss value feedback, gradient descent optimization, and weight adjustment until the target loss value meets the preset loss threshold to obtain an electrical equipment knowledge graph model.

[0078] In this solution, by generating global hard negative sample data, the difficulty and effect of model training are significantly improved, which helps the model better distinguish the complex semantics in the electrical equipment fault relationship. Using batch hard negative sample data, the structured management of the electrical equipment fault diagnosis knowledge graph is realized, so that the divided positive sample data subset improves the efficiency and accuracy of data processing, and provides support for model training and evaluation; enables the model to have stronger discrimination ability and robustness. An optimized electrical equipment knowledge graph model is obtained, which can accurately represent the electrical equipment fault relationship and provide efficient support for fault diagnosis and real-time prediction.

[0079] As an implementable way, as Figure 2 shown, step S107 includes:

[0080] S1071. Mix the global hard negative sample data and the batch hard negative sample data in proportion;

[0081] S1072. Calculate the triplet loss to obtain the first loss value and calculate the contrast loss to obtain the second loss value with the global hard negative sample data or the batch hard negative sample data and the positive sample data;

[0082] Optionally, the first loss value is obtained from the global hard negative sample data and the positive sample data, or from the batch hard negative sample data and the positive sample data, using a triplet loss function, and the second loss value is calculated using a contrastive loss function. Both the contrastive loss and the triplet loss introduce an adaptive loss function weight and dynamic margin adjustment. The final loss function is a weighted sum of the triplet loss and the contrastive loss. Optionally, the final loss function is a weighted sum of the triplet loss, the contrastive loss, and the knowledge graph consistency loss:

[0083]

[0084] Among them, 、 and are hyperparameters used to balance the weights between different loss terms and determine the influence degree of each loss term on the total loss. is the triplet loss, is the contrastive loss, is the knowledge graph consistency loss.

[0085] Among them, the weights of the triplet loss and the contrastive loss are dynamically adjusted according to the current training epoch. At the beginning of training is greater than 、 , to ensure that the model first learns the basic sample discrimination ability; as the training progresses, the values of and are gradually increased, and more similarity learning and knowledge graph consistency constraints are introduced. In the later stage of training, the weights are further adjusted so that the model can reach a better balance on all loss terms. Among them, the margin of the triplet loss in the loss function is dynamically adjusted according to the distance between samples during the training process.

[0086] S1073. Calculate the target loss value by weighting the first loss value and the second loss value.

[0087] In this solution, by introducing knowledge enhancement, adaptive loss function weights, and dynamic margin adjustment, the model can better balance the global structure and local details during training, and use dynamic adjustment of hyperparameters during the training process to improve the learning ability of the model, effectively improving the discrimination ability and robustness of the embedded model, and providing strong support for electrical equipment fault diagnosis.

[0088] As an implementable way, as shown in Figure 3 , step S106 includes:

[0089] S1061. Calculate the difference in embedding vector distances between each of the candidate negative samples and the positive sample data in the current positive sample data subset, and select the candidate negative sample with the smallest distance difference as the batch hard negative sample data for the current positive sample data subset;

[0090] S1062. Dynamically generate corresponding batch hard negative sample data for each of the positive sample data subsets.

[0091] In this solution, by selecting the negative sample with the smallest distance difference as the batch hard negative sample data, the ability of the model to distinguish between positive and negative samples during training is effectively improved, enabling the model to better learn subtle semantic differences. And dynamically generate corresponding hard negative sample data for each positive sample data subset, and adjust the selection of negative samples in real time according to different positive sample subsets, avoiding the overfitting problem caused by fixed negative samples. The dynamically generated hard negative sample data in this solution is more diverse, which helps to improve the generalization ability of the model.

[0092] As an implementable way, the steps of dynamically adjusting the preset embedding model based on the target loss value in step S108 include:

[0093] Dynamically adjust the margin of the preset embedding model based on the target loss value;

[0094] Wherein, the margin is inversely proportional to the target loss value.

[0095] In this solution, the convergence speed of the model is accelerated by dynamically adjusting the margin. When the initial target loss value is high, by reducing the margin, the distinction between positive and negative samples is enhanced, promoting the model to quickly learn the correct sample relationships. As the training progresses and the target loss value gradually decreases, the margin is appropriately increased to avoid overfitting and ensure the stable convergence of the model. The robustness of the model is effectively improved, enabling the model to maintain good performance under different loss value conditions.

[0096] The training method of the electrical equipment knowledge graph model provided in this embodiment significantly improves the difficulty and effect of model training by generating global hard negative sample data, helps the model better distinguish complex semantics in electrical equipment fault relationships, and uses batch hard negative sample data to achieve structured management of the electrical equipment fault diagnosis knowledge graph, enabling the divided positive sample data subsets to improve the efficiency and accuracy of data processing and providing support for model training and evaluation; enabling the model to have stronger discrimination ability and robustness. An optimized electrical equipment knowledge graph model is obtained, which can accurately represent electrical equipment fault relationships and provide efficient support for fault diagnosis and real-time prediction.

[0097] Embodiment 2

[0098] Figure 2The flowchart of a fault prediction method for an electrical device provided by an exemplary embodiment of the present disclosure is as follows Figure 4 As shown, the fault prediction method includes:

[0099] S201. Obtain real-time fault phenomenon data of the target electrical device;

[0100] Optionally, the real-time fault phenomenon data includes device operation data, device operation and maintenance logs, environmental parameters, etc. collected in real time by sensors deployed on the electrical device.

[0101] S202. Input the real-time fault phenomenon data into the electrical device knowledge graph model to obtain at least one of a corresponding fault cause chain, associated fault phenomenon data, and the device health score of the target device;

[0102] Among them, the electrical device knowledge graph model is obtained based on the training method of the electrical device knowledge graph model described in Embodiment 1.

[0103] The fault prediction method for the electrical device provided in this embodiment uses real-time fault phenomenon data and the knowledge graph model to detect device faults in a timely manner, generate a fault cause chain, retrieve other fault phenomenon data related to the current fault phenomenon, or calculate the device health score, evaluate its operating status, realize real-time fault diagnosis, maintenance decision support, and device health status monitoring, and improve the efficiency and accuracy of electrical device operation and maintenance.

[0104] Embodiment 3

[0105] Corresponding to the foregoing embodiment of the training method of the electrical device knowledge graph model, the present disclosure also provides an embodiment of a training system for the electrical device knowledge graph model.

[0106] Figure 5 The module schematic diagram of a training system for an electrical device knowledge graph model provided by an exemplary embodiment of the present disclosure is as follows Figure 5 As shown, the training system 100 includes a data acquisition module 101, a negative sample generation module 102, a similarity output module 103, a global hard negative sample selection module 104, a batch division module 105, a batch hard negative sample generation module 106, a loss value calculation module 107, and a model adjustment module 108;

[0107] The data acquisition module 101 is used to acquire triple data, and the triple data includes device data, fault phenomenon data, and relationship data;

[0108] The negative sample generation module 102 is used to use the triple data as positive sample data and generate candidate negative sample data corresponding to the positive sample data;

[0109] The similarity output module 103 is configured to input the positive sample data and the candidate negative sample data into a preset embedding model, and output the similarity between the candidate negative sample and the corresponding positive sample data;

[0110] The global hard negative sample selection module 104 is configured to select the candidate negative sample data with a similarity less than a preset similarity as the global hard negative sample data;

[0111] The batch division module 105 is configured to divide the triple data into a plurality of positive sample data subsets;

[0112] The batch hard negative sample generation module 106 is configured to dynamically generate corresponding batch hard negative sample data based on the positive sample data subsets;

[0113] The loss value calculation module 107 is configured to calculate a target loss value based on the global hard negative sample data, the batch hard negative sample data, and the positive sample data;

[0114] The model adjustment module 108 is configured to dynamically adjust the preset embedding model based on the target loss value to obtain an electrical equipment knowledge graph model.

[0115] Optionally, the loss value calculation module 107 includes a sample mixing unit, an independent loss calculation unit, and a joint loss calculation unit:

[0116] The sample mixing unit is configured to mix the global hard negative sample data and the batch hard negative sample data in proportion;

[0117] The independent loss calculation unit is configured to calculate a first loss value from the triple loss obtained by using the global hard negative sample data or the batch hard negative sample data and the positive sample data, and calculate a second loss value from the contrast loss;

[0118] The joint loss calculation unit is configured to calculate the target loss value by weighted calculation of the first loss value and the second loss value.

[0119] Optionally, the batch hard negative sample generation module 106 includes a distance calculation unit and an allocation unit:

[0120] The distance calculation unit is configured to calculate the difference between the embedding vector distances between each candidate negative sample and the positive sample data in the current positive sample data subset, and select the candidate negative sample with the smallest distance difference as the batch hard negative sample data of the current positive sample data subset;

[0121] The allocation unit is configured to dynamically generate corresponding batch hard negative sample data for each positive sample data subset.

[0122] Optionally, the model adjustment module 108 is further configured to dynamically adjust the margin of the preset embedded model based on the target loss value;

[0123] Wherein, the margin is inversely proportional to the target loss value.

[0124] For the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can be referred to the partial description of the method embodiment. The system embodiment described above is only illustrative, wherein the units described as separate components may or may not be physically separated, and the components as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present disclosure solution.

[0125] The training system of the electrical equipment knowledge graph model provided in this embodiment significantly improves the difficulty and effect of model training by generating global hard negative sample data, helps the model better distinguish complex semantics in the electrical equipment fault relationship, uses batch hard negative sample data to realize the structured management of the electrical equipment fault diagnosis knowledge graph, improves the efficiency and accuracy of data processing for the divided positive sample data subset, and provides support for model training and evaluation; enables the model to have stronger discrimination ability and robustness. An optimized electrical equipment knowledge graph model is obtained, which can accurately represent the electrical equipment fault relationship and provide efficient support for fault diagnosis and real-time prediction.

[0126] Embodiment 4

[0127] Corresponding to the foregoing method embodiment of the fault prediction of electrical equipment, the present disclosure also provides an embodiment of a fault prediction system of electrical equipment.

[0128] Figure 6 As a module schematic diagram of a fault prediction system of electrical equipment provided by an exemplary embodiment of the present disclosure, the fault prediction system 200 includes a fault phenomenon acquisition module 201 and a fault prediction module 202;

[0129] The fault phenomenon acquisition module 201 is configured to acquire real-time fault phenomenon data of a target electrical equipment;

[0130] The fault prediction module 202 is configured to input the real-time fault phenomenon data into the electrical equipment knowledge graph model to obtain at least one of a corresponding fault cause chain, associated fault phenomenon data, and a device health score of the target device;

[0131] Wherein, the electrical equipment knowledge graph model is obtained based on the training system of the electrical equipment knowledge graph model described in Embodiment 3.

[0132] The fault prediction system of the electrical equipment provided in this embodiment utilizes real-time fault phenomenon data and a knowledge graph model to timely detect equipment faults, generate a fault cause chain, retrieve other fault phenomenon data related to the current fault phenomenon, or calculate the health score of the equipment, evaluate its operating status, realize real-time fault diagnosis, maintenance decision support, and equipment health status monitoring, and improve the efficiency and accuracy of electrical equipment operation and maintenance.

[0133] Embodiment 5

[0134] Figure 7 As shown in the structural schematic diagram of an electronic device illustrated in an exemplary embodiment of the present disclosure, the electronic device includes a memory, a processor, and a computer program stored on the memory and for running on the processor. When the processor executes the computer program, it implements the training method of the electrical equipment knowledge graph model described in any of the above embodiments, or the fault prediction method of the electrical equipment. Figure 7 The displayed electronic device 90 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.

[0135] As Figure 7 shown, the electronic device 90 may be presented in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 90 may include but are not limited to: the at least one processor 91 described above, the at least one memory 92 described above, and a bus 93 connecting different system components (including the memory 92 and the processor 91).

[0136] The bus 93 includes a data bus, an address bus, and a control bus.

[0137] The memory 92 may include volatile memory, such as a random access memory (RAM) 921 and / or a cache memory 922, and may further include a read-only memory (ROM) 923.

[0138] The memory 92 may further include a program tool 925 (or utility tool) having a set of (at least one) program modules 924. Such program modules 924 include but are not limited to: an operating system, one or more application programs, other program modules, and program data. The implementation of a network environment may be included in each or some combination of these examples.

[0139] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the training method of the electrical equipment knowledge graph model provided in any of the above embodiments, or the fault prediction method of the electrical equipment.

[0140] The electronic device 90 can also communicate with one or more external devices 94 (such as a keyboard, a pointing device, etc.). Such communication can be carried out through the input / output (I / O) interface 95. Moreover, the electronic device 90 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through the network adapter 96. As shown in the figure, the network adapter 96 communicates with other modules of the electronic device 90 through the bus 93. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 90, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (redundant array of independent disks) systems, tape drives, and data backup storage systems, etc.

[0141] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / modules. Conversely, the features and functions of one unit / modules described above can be further divided and embodied by multiple units / modules.

[0142] Embodiment 6

[0143] The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the training method of the electrical equipment knowledge graph model provided in any of the above embodiments, or the fault prediction method of the electrical equipment.

[0144] Among them, the more specific computer-readable storage medium that can be adopted can include but not limited to: portable disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories, optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0145] Embodiment 7

[0146] The embodiments of the present disclosure also provide a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the training method of the electrical equipment knowledge graph model described in any of the above, or the fault prediction method of the electrical equipment.

[0147] Among them, the program code for executing the computer program product of the present disclosure can be written in any combination of one or more programming languages, and the program code can be executed entirely on the user device, partially on the user device, executed as an independent software package, partially on the user device and partially on a remote device, or entirely on a remote device.

[0148] Although the specific embodiments of the present disclosure have been described above, those skilled in the art should understand that this is only an example, and the protection scope of the present disclosure is defined by the appended claims. Without departing from the principles and essence of the present disclosure, those skilled in the art can make various changes or modifications to these embodiments, but these changes and modifications all fall within the protection scope of the present disclosure.

Claims

1. A training method for an electrical equipment knowledge graph model, characterized in that The training method includes: Obtain triple data, where the triple data includes device data, fault phenomenon data, and relationship data; Use the triple data as positive sample data and generate candidate negative sample data corresponding to the positive sample data; Input the positive sample data and the candidate negative sample data into a preset embedding model, and output the similarity between the candidate negative sample and the corresponding positive sample data; Select the candidate negative sample data with a similarity less than the preset similarity as global hard negative sample data; Divide the triple data into several subsets of positive sample data; Dynamically generate corresponding batch hard negative sample data based on the subsets of positive sample data; Calculate the target loss value based on the global hard negative sample data, the batch hard negative sample data, and the positive sample data; Dynamically adjust the preset embedding model based on the target loss value to obtain an electrical equipment knowledge graph model.

2. The training method of the electrical equipment knowledge graph model according to claim 1, characterized in that The step of calculating the target loss value based on the global hard negative sample data, the batch hard negative sample data, and the positive sample data includes: Mix the global hard negative sample data and the batch hard negative sample data in proportion; Use the global hard negative sample data or the batch hard negative sample data and the positive sample data to calculate the triple loss to obtain a first loss value, and calculate the contrast loss to obtain a second loss value; Calculate the target loss value by weighting the first loss value and the second loss value.

3. The training method of the electrical equipment knowledge graph model according to claim 1, characterized in that The step of dynamically generating corresponding batch hard negative sample data based on the subsets of positive sample data includes: Calculate the difference in embedding vector distances between each candidate negative sample and the positive sample data in the current subset of positive sample data, and select the candidate negative sample with the smallest distance difference as the batch hard negative sample data for the current subset of positive sample data; Dynamically generate corresponding batch hard negative sample data for each subset of positive sample data.

4. The training method of the electrical equipment knowledge graph model according to claim 1, wherein, The step of dynamically adjusting the preset embedding model based on the target loss value includes: Dynamically adjust the margin of the preset embedding model based on the target loss value; Wherein, the margin is inversely proportional to the target loss value.

5. A fault prediction method for an electrical device, characterized in that, The fault prediction method includes: Obtain real-time fault phenomenon data of the target electrical equipment; Input the real-time fault phenomenon data into the electrical equipment knowledge graph model to obtain at least one of the corresponding fault cause chain, associated fault phenomenon data, and device health score of the target device; Wherein, the electrical equipment knowledge graph model is obtained based on the training method of the electrical equipment knowledge graph model according to any one of claims 1 to 4.

6. A training system for an electrical equipment knowledge graph model, characterized in that It includes a data acquisition module, a negative sample generation module, a similarity output module, a global hard negative sample selection module, a batch division module, a batch hard negative sample generation module, a loss value calculation module, and a model adjustment module; The data acquisition module is used to obtain triple data, where the triple data includes device data, fault phenomenon data, and relationship data; The negative sample generation module is used to use the triple data as positive sample data and generate candidate negative sample data corresponding to the positive sample data; The similarity output module is configured to input the positive sample data and the candidate negative sample data into a preset embedding model, and output the similarity between the candidate negative sample and the corresponding positive sample data; The global hard negative sample selection module is configured to select the candidate negative sample data with a similarity less than a preset similarity as the global hard negative sample data; The batch division module is configured to divide the triple data into a plurality of positive sample data subsets; The batch hard negative sample generation module is configured to dynamically generate corresponding batch hard negative sample data based on the positive sample data subsets; The loss value calculation module is configured to calculate a target loss value based on the global hard negative sample data, the batch hard negative sample data, and the positive sample data; The model adjustment module is configured to dynamically adjust the preset embedding model based on the target loss value to obtain an electrical equipment knowledge graph model.

7. A fault prediction system for an electrical device, characterized in that, It includes a fault phenomenon acquisition module and a fault prediction module; The fault phenomenon acquisition module is configured to acquire real-time fault phenomenon data of a target electrical equipment; The fault prediction module is configured to input the real-time fault phenomenon data into the electrical equipment knowledge graph model to obtain at least one of a corresponding fault cause chain, associated fault phenomenon data, and the equipment health score of the target equipment; Wherein, the electrical equipment knowledge graph model is obtained based on the training system of the electrical equipment knowledge graph model according to claim 6.

8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and adapted to run on the processor, characterized in that, When the processor executes the computer program, it implements the training method of the electrical equipment knowledge graph model according to any one of claims 1 to 4, or the fault prediction method of the electrical equipment according to claim 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the training method of the electrical equipment knowledge graph model according to any one of claims 1 to 4, or the fault prediction method of the electrical equipment according to claim 5.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the training method of the electrical equipment knowledge graph model according to any one of claims 1 to 4, or the fault prediction method of the electrical equipment according to claim 5.