Power supply service risk early warning method, system, equipment and medium
By combining a large text-pre-trained model and a Bayesian causal inference network with a Transformer neural network, the problems of insufficient risk feature extraction and poor dynamic adaptability in power supply service risk monitoring are solved. This enables dynamic and accurate prediction of power supply system risks and capture of global risk features, providing clear risk warning results.
Patent Information
- Application Number
- CN202511701535.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-19
- Publication Date
- 2026-02-13
AI Technical Summary
Existing technologies for monitoring power supply service risks suffer from problems such as limited risk feature extraction dimensions, insufficient adaptability of dynamic features, lack of interpretability in risk assessment, and insufficient global feature capture capability. This results in narrow input feature dimensions for early warning models, poor timeliness of early warnings, and unconvincing risk classification results.
We employ a pre-trained large model to deeply mine explicit and implicit risk features from power supply service text data. By combining a Bayesian causal inference network and a Transformer neural network, we construct a Bayesian causal model to enhance the model's ability to filter data noise and improve its dynamic adaptability. Furthermore, we capture global risk features across regions and time periods through a multi-head self-attention mechanism.
It enables dynamic and accurate prediction of power supply system risks, provides clear causal logic support, improves the comprehensiveness and accuracy of risk warning, and ensures the adaptive performance of risk classification warning.
Smart Images

Figure CN121526326A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of risk warning technology, specifically to a method, system, device, and medium for risk warning of power supply services. Background Technology
[0002] Currently, with the expansion of power distribution networks and increasing user demands for power supply reliability, power supply service risk monitoring and early warning have become crucial for ensuring the stable operation of the power system. Existing technologies largely revolve around data statistics, rule pre-setting, or single-dimensional assessment. While these can achieve basic risk identification in specific scenarios, they suffer from the following problems when considering the complexity, dynamism, and multi-factor coupling characteristics of power supply systems:
[0003] 1. Limited Dimensions in Risk Feature Extraction and Insufficient Capabilities in Extracting Explicit and Implicit Features: Traditional machine learning algorithms (such as logistic regression, support vector machines, tree models, and ensemble learning) rely on manually designed features, making it impossible to automatically extract multi-dimensional and in-depth risk factors from massive amounts of power supply service text data (such as customer repair work orders, equipment inspection records, and dispatch operation logs). For example, it is difficult to extract the potential implicit risk correlation features of "voltage fluctuation - line equipment problems - regional power supply hazards" from text descriptions such as "a certain community has repeatedly reported unstable voltage and electrical appliances cannot be used normally"; it is also unable to accurately identify the explicit representations of risks such as power outages, voltage fluctuations, equipment aging, and delayed emergency repair responses. This results in a narrow input feature dimension for the risk warning model, making it difficult to cover the entire chain of risk points such as distribution network operation, equipment status, and service process, and causing a significant lag in warning triggering.
[0004] 2. Insufficient adaptability to dynamic risk characteristics: Traditional models are mostly trained based on historical static data, which cannot capture the dynamic risk changes of the power supply system in real time. For example, the risks of line icing and tree obstruction caused by extreme weather (such as typhoons and cold waves), or the risks of transformer overload caused by peak electricity consumption during holidays, have characteristics that change dynamically with time and environment. Traditional models have difficulty updating feature weights dynamically, resulting in insufficient ability to capture such sudden and temporary risks and a significant decrease in the timeliness of early warnings.
[0005] 3. Current deep learning-based algorithms lack interpretable features: In recent years, while deep learning models such as Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs) have achieved great success in improving the accuracy of power supply service risk identification due to their powerful automatic feature extraction capabilities, their complex models and large parameter scales present serious "black box" problems. For example, a model may determine that "there is a risk of low voltage in a certain area in the next day," but it cannot explain which type of risk factor this conclusion is based on, nor can it quantify the influence weight of each risk factor on the final risk level. This results in a lack of persuasiveness in risk assessment results, making it difficult for maintenance personnel to formulate targeted response plans based on early warning information.
[0006] 4. Lack of global risk feature capture capability: Traditional machine learning models (such as Random Forest, XGBoost, and LightGBM) and basic deep learning models (such as CNN) are good at learning local features (such as the operating parameters of a single device or the repair data of a single area), but they cannot fully capture the global correlation features of the power supply system. For example, they have difficulty integrating global signals across regions and dimensions, such as "fault at a substation", "load changes on related lines", "electricity demand of multiple downstream communities", and "location distribution of emergency repair teams". They also cannot identify the spatiotemporal correlation features of risk factors (such as "the high-incidence period of a line fault highly overlaps with the production shifts of surrounding factories" or "the aging degree of multiple devices within the same power supply radius exhibits spatial clustering"). This leads to a one-sided judgment of the global risk situation, and risk classification is prone to the problem of "overestimating local risks and omitting global hidden dangers".
[0007] Based on this, the present invention aims to provide a method, system, device and medium for early warning of power supply service risks, so as to solve the related problems mentioned above. Summary of the Invention
[0008] The technical problem this invention aims to solve is the insufficient risk feature mining, lack of interpretability in risk assessment, and inadequate accuracy in risk classification and early warning in existing technologies. The goal is to provide a method, system, device, and medium for power supply service risk early warning. This invention employs a large-scale pre-trained model to deeply mine explicit and implicit risk features from power supply service text data. It also enhances the model's ability to filter data noise, improves its adaptability to dynamically changing risk features, and strengthens the overall robustness of the model. This addresses the problems of insufficient risk feature extraction, weak noise resistance, and poor dynamic adaptability in traditional models. By constructing a Bayesian causal model based on a Bayesian causal inference network and combining it with power grid service data, the invention accurately identifies key risk factors and their mechanisms of action, effectively assesses the severity and spatiotemporal impact of risk events, and achieves dynamic and accurate prediction of service risks in different regions and time periods, providing clear causal logic support for risk warning results. Furthermore, relying on the global attention mechanism of the Transformer neural network, the invention strengthens the model's ability to capture global risk features across regions and time periods, while improving the adaptive performance of risk warning to dynamic operating scenarios of the power supply system, ensuring the comprehensiveness and accuracy of risk classification and early warning.
[0009] This invention is achieved through the following technical solution:
[0010] A method for early warning of power supply service risks, the method comprising:
[0011] The obtained service order text sequence is input into the pre-trained BERT model for feature extraction. The extracted text features include explicit features and implicit features. The explicit features and implicit features are fused to obtain the text feature matrix.
[0012] Based on the text feature matrix, a causal variable containing multiple risk factors is constructed. Based on the pre-constructed service risk index, an outcome variable containing multiple risk indexes is constructed. Based on Bayesian causal effects, the risk causal effect between risk factors and risk indexes is generated, and the risk causal effect parameters are obtained.
[0013] The text feature matrix and risk causal effect parameters are concatenated, and the concatenated joint risk features are input into the multi-head self-attention mechanism to obtain the risk features perceived by the multi-head attention mechanism.
[0014] The risk features perceived by the multi-head attention mechanism and the concatenated joint risk features are normalized to obtain the feature encoding vector of the risk factor. The feature encoding vector of the risk factor is then processed by a feedforward neural network and a normalization layer. Finally, the processed feature vector is mapped to the category probability of different risk level warnings using an activation function, thereby realizing the risk warning of power supply service.
[0015] Furthermore, the method also includes: using the LoRA fine-tuning model to denoise the text feature matrix to obtain the denoised feature matrix;
[0016] The time information in the service work order text sequence is obtained, the time information is converted into a time-series feature vector using time feature encoding, and the text features are cross-fused using a spatiotemporal cross algorithm to obtain dynamic derived features.
[0017] The temporal feature vector and dynamically derived features are added to the denoising feature matrix to obtain the final text feature matrix.
[0018] Furthermore, based on Bayesian causality, the risk causal effect between risk factors and risk indicators is generated, and the risk causal effect parameters are obtained, specifically:
[0019] Obtain the conditional likelihood distribution of the outcome variable; and based on the conditional likelihood distribution of the outcome variable, use Bayes' theorem to calculate the posterior distribution of the causal effect parameters.
[0020] Based on the posterior distribution of the causal effect parameters, the average causal effect of the cause variable on the outcome variable is calculated to obtain the final risk causal effect parameters.
[0021] Furthermore, the text feature matrix and risk causality effect parameters are concatenated, and the concatenated joint risk features are input into a multi-head self-attention mechanism to obtain the risk features perceived by the multi-head attention mechanism, including:
[0022] By concatenating the text feature matrix and the risk causality effect parameters, the joint risk features are obtained, specifically: In the formula, Indicates joint risk characteristics, Represents the text feature matrix. Indicates the parameters of risk causality;
[0023] The concatenated joint risk features are input into a multi-head self-attention mechanism to obtain the feature representation of each attention head, specifically: , These represent the query matrix, key matrix, and value matrix, respectively, representing the joint risk characteristics. Indicates the number of attention heads. ;
[0024] The feature representations of each attention head are concatenated to obtain the risk features perceived by the multi-head attention mechanism, specifically: ,in, This represents the adaptive multi-head attention weight matrix.
[0025] Furthermore, the risk features perceived by the multi-head attention mechanism and the concatenated joint risk features are normalized to obtain the feature encoding vector of the risk factor, specifically: ,in, This indicates normalization processing; Indicates joint risk characteristics, This indicates the risk characteristics perceived by the multi-head attention mechanism.
[0026] Furthermore, a feedforward neural network and a normalization layer are used to process the feature encoding vectors of risk factors, and an activation function is used to map the processed feature vectors to the category probabilities of different risk level warnings, specifically as follows: ,in, This represents a feedforward neural network. The feature encoding vector representing the risk factor. This indicates normalization processing; This represents an activation function with multiple risk levels in Softmax. This represents a risk classification.
[0027] The present invention also provides a power supply service risk early warning system, which is used in any of the power supply service risk early warning methods described above, the system comprising:
[0028] The feature fusion module is used to input the acquired service order text sequence into the pre-trained BERT model for feature extraction, and extract text features, which include explicit features and implicit features. The explicit features and implicit features are fused to obtain a text feature matrix.
[0029] The causal effect parameter generation module is used to construct causal variables containing multiple risk factors based on the text feature matrix, construct outcome variables containing multiple risk indicators based on pre-built service risk indicators, and generate risk causal effects between risk factors and risk indicators according to Bayesian causal effects, and obtain risk causal effect parameters.
[0030] The risk feature acquisition module is used to concatenate the text feature matrix and the risk causal effect parameters, and input the concatenated joint risk features into the multi-head self-attention mechanism to obtain the risk features perceived by the multi-head attention mechanism.
[0031] The risk warning category generation module is used to normalize the risk features perceived by the multi-head attention mechanism and the spliced joint risk features to obtain the feature encoding vector of the risk factor. Then, a feedforward neural network and a normalization layer are used to process the feature encoding vector of the risk factor, and an activation function is used to map the processed feature vector to the category probability of different risk level warnings, so as to realize the power supply service risk warning.
[0032] The present invention also provides a computer device, including a system memory and a processor, wherein the system memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described above.
[0033] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the methods described above.
[0034] The present invention also provides a computer program product containing instructions that, when executed by a cluster of computer devices, cause the cluster of computer devices to perform the method described in any of the preceding claims.
[0035] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0036] This invention employs a pre-trained large-scale model to deeply mine explicit and implicit risk features from power supply service text data. Simultaneously, it enhances the model's ability to filter data noise and improves its adaptability to dynamically changing risk features, thereby strengthening the overall robustness of the model. This addresses the problems of insufficient risk feature extraction, weak noise resistance, and poor dynamic adaptability inherent in traditional models. By constructing a Bayesian causal model based on a Bayesian causal inference network and combining it with power grid service data, the invention accurately identifies key risk factors and their mechanisms of action, effectively assesses the severity and spatiotemporal impact of risk events, and achieves dynamic and accurate prediction of service risks in different regions and time periods, providing clear causal logic support for risk warning results. Furthermore, relying on the global attention mechanism of the Transformer neural network, the invention strengthens the model's ability to capture global risk features across regions and time periods, while improving the adaptive performance of risk warnings to dynamic operating scenarios of the power supply system, ensuring the comprehensiveness and accuracy of risk classification warnings. Attached Figure Description
[0037] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0038] Figure 1 This is a schematic diagram of the method flow for a power supply service risk early warning method in this embodiment;
[0039] Figure 2 This is a schematic diagram of the module connections of a power supply service risk early warning system in this embodiment;
[0040] Figure 3 This is a schematic diagram of the structure of a computer device in this embodiment. Detailed Implementation
[0041] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0042] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to define the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.
[0043] The terminology used in the description of the various examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. Furthermore, the term "and / or" as used in this disclosure covers any one of the listed items and all possible combinations thereof.
[0044] Example 1
[0045] See Figure 1 , Figure 1 A flowchart illustrating a method for early warning of power supply service risks is shown, wherein the method includes:
[0046] S1: Input the obtained service order text sequence into the pre-trained BERT model for feature extraction, and extract the text features, which include explicit features and implicit features. The explicit features and implicit features are fused to obtain the text feature matrix.
[0047] It should be noted that in this embodiment, risk features are deeply mined by targeting work order text data (covering various types of text such as fault report descriptions, user complaints, equipment maintenance records, and customer service communication minutes) in power supply service scenarios. Text features include explicit features and implicit features. Explicit features refer to risk-related entities or events directly presented in the work order text, such as explicit statements that can be directly associated with risk types, such as "transformer failure", "cable short circuit", "rainstorm weather", and "voltage drop". Implicit features refer to potential risk associations hidden in the semantic logic of the text and not directly manifested. For example, from the text association between "circuit breaker in a certain area has automatically tripped multiple times in the past three months" and "equipment has been in operation for more than 8 years", the causal risk chain of "equipment aging → mechanical performance degradation → frequent tripping" can be captured.
[0048] Specifically, in this embodiment, the work order text sequence (L is the text length) Input to a pre-trained BERT model to output context-aware word embeddings. In the formula, This indicates the dimension of the BERT hidden layer (e.g., 64). Indicates the first Each word embedding vector; word embeddings with explicit feature labels are used as explicit features. In the formula, This represents the encoding of explicit features; where the explicit feature markers are pre-annotated word vectors, a common technique in this field that will not be elaborated upon here; then, a self-attention mechanism is used to capture potential relationships between words to obtain implicit features. In the formula, Represents the inner product of elements. Indicator and The feature similarity between them is calculated using the following formula: .
[0049] Meanwhile, in this embodiment, after obtaining the explicit and implicit features, it is necessary to remove noise from the features, such as false work orders and outliers caused by text typos, in order to retain the core features; firstly, the explicit and implicit features are fused to obtain the text feature matrix, specifically: In the formula, Represents explicit and implicit features in the feature space. splicing in The dimension representing feature fusion;
[0050] Secondly, the LoRA fine-tuning model is used to denoise the text feature matrix, resulting in a denoised feature matrix. Specifically, the LoRA fine-tuning model introduces a low-rank projection matrix. and reconstruction matrix Fine-tuning the text feature matrix involves learning noise correction parameters with only a small number of parameters to avoid destroying the core information in the original features; for noisy text feature matrices... (where n is the number of samples and d is the feature dimension) The essence of LoRA denoising is to learn a low-rank perturbation. This makes the corrected denoising feature matrix .
[0051] Then, the time information in the service order text sequence is obtained, and the time information is converted into a temporal feature vector using time feature encoding. Finally, the text features are cross-fused using a spatiotemporal cross-validation algorithm to obtain dynamically derived features, specifically:
[0052] By using time feature encoding, time information such as "year / month / day / hour" is transformed into quantifiable time-series feature vectors. Sine and cosine encoding is used to capture periodic patterns, and one-hot encoding is used to mark special time periods. On the other hand, dynamic derivative features are generated through spatiotemporal cross-validation algorithms. For example, "regional attributes (urban / suburban)" are cross-validated with "seasonal characteristics (summer / winter)" to obtain "urban summer load characteristics", and "equipment type (transformer / cable)" is cross-validated with "time period characteristics (peak / off-peak)" to obtain "transformer peak load fluctuation characteristics". This enriches the feature dimensions and strengthens the ability to represent dynamic risk patterns, ensuring that the model can stably capture risk features in different time and space scenarios.
[0053] It should be noted that, in this embodiment, in order to cope with dynamic risk scenarios in power supply services, such as the difference in fault modes caused by seasonal changes (e.g., line overload faults caused by high temperature and high load in summer, and equipment insulation failure caused by low temperature freezing damage in winter), and the fluctuation of risk characteristics during peak electricity consumption periods (e.g., 8 am on weekdays and 7 pm on holidays), a time-adaptive sample augmentation mechanism is constructed to improve the model's generalization ability to dynamically changing scenarios.
[0054] The temporal feature vector and dynamically derived features are added to the denoising feature matrix to obtain the final text feature matrix.
[0055] S2: Construct causal variables containing multiple risk factors based on the text feature matrix, construct outcome variables containing multiple risk indicators based on pre-constructed service risk indicators, and generate risk causal effects between risk factors and risk indicators according to Bayesian causal effects, and obtain risk causal effect parameters.
[0056] It should be noted that in this embodiment, the risk factor comes from the modified noise reduction feature matrix, and the risk factor includes the extracted explicit features and implicit features.
[0057] Specifically, in this embodiment, a result variable containing multiple risk indicators is first constructed based on predefined service risk indicators. Construct causal variables using multiple risk factors Features excluding causal and outcome variables are extracted from the work order text sequence as confounding variables. Confounding variables can simultaneously affect both outcome and causal variables;
[0058] Secondly, we assume causal effect parameters. (The strength of the influence of causal variable X on outcome variable Y) follows a normal prior distribution. ,in and The initial mean and variance were set for knowledge in the power supply service field, respectively; and confounding variables were controlled for. Then, the conditional likelihood distribution of the outcome variable is obtained from the following likelihood function: In the formula, It is a bias term. This is the control interference coefficient term; to quantify the uncertainty of power supply service risk factors, the causal effect parameters are then calculated using Bayes' theorem based on the conditional likelihood distribution of the outcome variables. The posterior distribution: Simultaneously, variational inference suggests that the approximate posterior is a normal distribution. The causal variable and confusing variables Through neural networks respectively Fitted posterior mean Through neural networks Post-learning variance Finally, based on the posterior distribution of the causal effect parameters, the average causal effect of the cause variable on the outcome variable is calculated, yielding the final risk causal effect parameters. The formula for the average causal effect of the causal variable on the outcome variable is as follows: In the formula, Indicating intervention causal variables Exclude confounding variables For causal variables The impact.
[0059] S3: Concatenate the text feature matrix and the risk causal effect parameters, and input the concatenated joint risk features into the multi-head self-attention mechanism to obtain the risk features perceived by the multi-head attention mechanism;
[0060] Specifically, in this embodiment, the text feature matrix and the risk causal effect parameters are concatenated to obtain the joint risk features, as follows: In the formula, Indicates joint risk characteristics, Represents the text feature matrix. Indicates the parameters of risk causality;
[0061] The concatenated joint risk features are input into a multi-head self-attention mechanism to obtain the feature representation of each attention head, specifically: , These represent the query matrix, key matrix, and value matrix, respectively, representing the joint risk characteristics. Indicates the number of attention heads. ;
[0062] The feature representations of each attention head are concatenated to obtain the risk features perceived by the multi-head attention mechanism, specifically: ,in, This represents the adaptive multi-head attention weight matrix.
[0063] S4: Normalize the risk features perceived by the multi-head attention mechanism and the concatenated joint risk features to obtain the feature encoding vector of the risk factor. Then, use a feedforward neural network and a normalization layer to process the feature encoding vector of the risk factor, and use an activation function to map the processed feature vector into the category probability of different risk level warnings to realize power supply service risk warning.
[0064] Specifically, in this embodiment, the risk features perceived by the multi-head attention mechanism and the concatenated joint risk features are first normalized to obtain the feature encoding vector of the risk factor, as follows: ,in, This indicates normalization processing; Indicates joint risk characteristics, This indicates the risk characteristics perceived by the multi-head attention mechanism;
[0065] Then, a feedforward neural network and a normalization layer are used to process the feature encoding vectors of the risk factors, and an activation function is used to map the processed feature vectors to the category probabilities of different risk level warnings, specifically: ,in, This represents a feedforward neural network. The feature encoding vector representing the risk factor. This indicates normalization processing; This represents an activation function with multiple risk levels in Softmax. This represents a risk classification.
[0066] Specifically, in this embodiment, in order to address the problems of insufficient risk feature extraction, weak noise resistance and poor dynamic adaptability of traditional models, the present invention adopts a text pre-trained large model to deeply mine explicit and implicit risk features from power supply service text data, while enhancing the model's ability to filter data noise, improving its adaptability to dynamically changing risk features, and thus strengthening the overall robustness of the model.
[0067] Meanwhile, to address the issue of the lack of interpretability in risk assessment caused by the "black box" nature of deep learning models, this invention constructs a Bayesian causal model based on Bayesian causal inference network and combined with power grid power supply service data. This model accurately identifies key risk factors and their mechanisms of action, effectively assesses the severity and spatiotemporal impact of risk events, and achieves dynamic and accurate prediction of service risks in different regions and time periods, providing clear causal logic support for risk warning results.
[0068] Finally, addressing the issues of insufficient global risk feature capture and weak early warning adaptation capabilities in traditional models, this invention leverages the global attention mechanism of the Transformer neural network to enhance the model's ability to capture global risk features across regions and time periods. Simultaneously, it improves the adaptive performance of risk warnings to dynamic operating scenarios of the power supply system, ensuring the comprehensiveness and accuracy of risk classification and early warning.
[0069] Example 2
[0070] See Figure 2 The present invention also provides a power supply service risk early warning system, which is used in any of the power supply service risk early warning methods described above, the system comprising:
[0071] The feature fusion module 100 is used to input the acquired service order text sequence into the pre-trained BERT model for feature extraction, and extract text features, which include explicit features and implicit features. The explicit features and implicit features are fused to obtain a text feature matrix.
[0072] The causal effect parameter generation module 200 is used to construct causal variables containing multiple risk factors based on the text feature matrix, construct outcome variables containing multiple risk indicators based on pre-constructed service risk indicators, and generate risk causal effects between risk factors and risk indicators according to Bayesian causal effects, and obtain risk causal effect parameters.
[0073] The risk feature acquisition module 300 is used to concatenate the text feature matrix and the risk causal effect parameters, and input the concatenated joint risk features into the multi-head self-attention mechanism to obtain the risk features perceived by the multi-head attention mechanism.
[0074] The risk warning category generation module 400 is used to normalize the risk features perceived by the multi-head attention mechanism and the spliced joint risk features to obtain the feature encoding vector of the risk factor. The feature encoding vector of the risk factor is processed by a feedforward neural network and a normalization layer. The processed feature vector is then mapped to the category probability of different risk level warnings using an activation function, thereby realizing the risk warning of power supply service.
[0075] It should be noted that the modules in the system of Embodiment 2 correspond to the steps in the method of Embodiment 1. The steps in the method of Embodiment 1 have been described in detail in Embodiment 1, and the module content in the system will not be described in detail in this Embodiment 2.
[0076] Example 3
[0077] See Figure 3This embodiment also provides a computer device, including a system memory 1005 and a processor 1001. The system memory 1005 stores a computer program, and the processor 1001 executes the computer program to implement the steps of any of the methods described above.
[0078] It should be noted that the processor 1001 is used to execute the steps in the above method embodiments according to the instructions in the program code. Alternatively, when the processor 1001 executes the computer program, it implements the functions of each module / unit in the above system / device embodiments.
[0079] Specifically, in this embodiment, the computer program can be divided into one or more modules / units. One or more modules / units are stored in the system memory 1005 and executed by the processor 1001 to complete this application. One or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the terminal device.
[0080] The terminal device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor 1001 and a system memory 1005. Those skilled in the art will understand that this does not constitute a limitation on the terminal device, which may include more or fewer components than shown, or a combination of certain components, or different components. For example, the terminal device may also include an input / output device 1003, a network access device 1002, a bus 1006, etc.
[0081] The processor 1001 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0082] System memory 1005 can be an internal storage unit of the terminal device, such as a hard drive or RAM. System memory 1005 can also be a storage device 1004 of the terminal device, such as an external hard drive, SmartMedia Card (SMC), Secure Digital (SD) card, or FlashCard. Furthermore, system memory 1005 can include both internal storage units and storage device 1004. System memory 1005 is used to store computer programs and other programs and data required by the terminal device. System memory 1005 can also be used to temporarily store data that has been output or will be output.
[0083] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0084] Example 4
[0085] This embodiment provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.
[0086] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), registers, hard disks, optical fibers, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof, or any other form of computer-readable storage medium in the art.
[0087] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and storage medium can reside within an application-specific integrated circuit (ASIC). In embodiments of the invention, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device.
[0088] Example 5
[0089] This embodiment also provides a computer program product containing instructions that, when executed by a cluster of computer devices, cause the cluster of computer devices to perform the method described in Embodiment 1.
[0090] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for early warning of power supply service risks, characterized in that, The methods include: The obtained service order text sequence is input into the pre-trained BERT model for feature extraction. The extracted text features include explicit features and implicit features. The explicit features and implicit features are fused to obtain the text feature matrix. Based on the text feature matrix, a causal variable containing multiple risk factors is constructed. Based on the pre-constructed service risk index, an outcome variable containing multiple risk indexes is constructed. Based on Bayesian causal effects, the risk causal effect between risk factors and risk indexes is generated, and the risk causal effect parameters are obtained. The text feature matrix and risk causal effect parameters are concatenated, and the concatenated joint risk features are input into the multi-head self-attention mechanism to obtain the risk features perceived by the multi-head attention mechanism. The risk features perceived by the multi-head attention mechanism and the concatenated joint risk features are normalized to obtain the feature encoding vector of the risk factor. The feature encoding vector of the risk factor is then processed by a feedforward neural network and a normalization layer. Finally, the processed feature vector is mapped to the category probability of different risk level warnings using an activation function, thereby realizing the risk warning of power supply service.
2. The power supply service risk early warning method according to claim 1, characterized in that, The method also includes: using the LoRA fine-tuning model to denoise the text feature matrix to obtain the denoised feature matrix; The time information in the service work order text sequence is obtained, the time information is converted into a time-series feature vector using time feature encoding, and the text features are cross-fused using a spatiotemporal cross algorithm to obtain dynamic derived features. The temporal feature vector and dynamically derived features are added to the denoising feature matrix to obtain the final text feature matrix.
3. The power supply service risk early warning method according to claim 1, characterized in that, Based on Bayesian causality, the risk causal effect between risk factors and risk indicators is generated, and the risk causal effect parameters are obtained, specifically: Obtain the conditional likelihood distribution of the outcome variable; and based on the conditional likelihood distribution of the outcome variable, use Bayes' theorem to calculate the posterior distribution of the causal effect parameters. Based on the posterior distribution of the causal effect parameters, the average causal effect of the cause variable on the outcome variable is calculated to obtain the final risk causal effect parameters.
4. The power supply service risk early warning method according to claim 1, characterized in that, The text feature matrix and risk causality effect parameters are concatenated, and the concatenated joint risk features are input into a multi-head self-attention mechanism to obtain the risk features perceived by the multi-head attention mechanism, including: By concatenating the text feature matrix and the risk causality effect parameters, the joint risk features are obtained, specifically: In the formula, Indicates joint risk characteristics, Represents the text feature matrix. Indicates the parameters of risk causality; The concatenated joint risk features are input into a multi-head self-attention mechanism to obtain the feature representation of each attention head, specifically: , These represent the query matrix, key matrix, and value matrix, respectively, representing the joint risk characteristics. Indicates the number of attention heads. ; The feature representations of each attention head are concatenated to obtain the risk features perceived by the multi-head attention mechanism, specifically: ,in, This represents the adaptive multi-head attention weight matrix.
5. The power supply service risk early warning method according to claim 1, characterized in that, The risk features perceived by the multi-head attention mechanism and the concatenated joint risk features are normalized to obtain the feature encoding vector of the risk factor, specifically: ,in, This indicates normalization processing; Indicates joint risk characteristics, This indicates the risk characteristics perceived by the multi-head attention mechanism.
6. The power supply service risk early warning method according to claim 1, characterized in that, The feature encoding vectors of risk factors are processed using a feedforward neural network and a normalization layer. An activation function is then used to map the processed feature vectors to the probabilities of different risk level warning categories. Specifically: ,in, This represents a feedforward neural network. The feature encoding vector representing the risk factor. This indicates normalization processing; This represents an activation function with multiple risk levels in Softmax. This represents a risk classification.
7. A power supply service risk early warning system, characterized in that, This system is used in a power supply service risk early warning method according to any one of claims 1-6, the system comprising: The feature fusion module is used to input the acquired service order text sequence into the pre-trained BERT model for feature extraction, and extract text features, which include explicit features and implicit features. The explicit features and implicit features are fused to obtain a text feature matrix. The causal effect parameter generation module is used to construct causal variables containing multiple risk factors based on the text feature matrix, construct outcome variables containing multiple risk indicators based on pre-built service risk indicators, and generate risk causal effects between risk factors and risk indicators according to Bayesian causal effects, and obtain risk causal effect parameters. The risk feature acquisition module is used to concatenate the text feature matrix and the risk causal effect parameters, and input the concatenated joint risk features into the multi-head self-attention mechanism to obtain the risk features perceived by the multi-head attention mechanism. The risk warning category generation module is used to normalize the risk features perceived by the multi-head attention mechanism and the spliced joint risk features to obtain the feature encoding vector of the risk factor. Then, a feedforward neural network and a normalization layer are used to process the feature encoding vector of the risk factor, and an activation function is used to map the processed feature vector to the category probability of different risk level warnings, so as to realize the power supply service risk warning.
8. A computer device comprising a system memory and a processor, wherein the system memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1 to 6.
10. A computer program product containing instructions, characterized in that, When the instructions are executed by a cluster of computer devices, the cluster of computer devices causes the cluster of computer devices to perform the method as described in any one of claims 1 to 6.