Power supply scheme intelligent generation scene business rule differentiation matching method and system

By constructing a multi-dimensional vector space for the rule text of power supply enterprises, and conducting multi-dimensional difference analysis and grouping, the problems of poor accuracy and effectiveness in power supply business rule matching are solved, thereby improving the accuracy and efficiency of the power supply scheme generation system.

CN122240852APending Publication Date: 2026-06-19国家电网有限公司客户服务中心

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
国家电网有限公司客户服务中心
Filing Date
2026-03-11
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing technologies have poor accuracy and effectiveness in matching power supply business rules, and cannot meet the needs of in-depth analysis, refined quantification and multi-dimensional difference diagnosis, and have a low degree of automation.

Method used

By constructing logical structure vectors, semantic description vectors, and graph structure vectors of the power supply enterprise's rule texts, a rule vector space is formed. Multi-dimensional difference analysis and grouping are then performed, and intelligent matching is carried out in conjunction with the current business request.

Benefits of technology

This improved the accuracy and adaptability of the power supply scheme generation system in complex cross-regional scenarios, and enhanced the precision of rule matching and processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122240852A_ABST
    Figure CN122240852A_ABST
Patent Text Reader

Abstract

This invention provides a matching method and system for differentiating business rules in intelligent power supply scheme generation scenarios, belonging to the field of power supply business data processing technology. The matching method includes: acquiring rule text data from a power supply company; acquiring a rule sample library based on the rule text data; vectorizing each rule text in the rule sample library and constructing a rule vector space; performing rule difference analysis and grouping based on the rule vector space; acquiring the current business request; and inputting the current business request into the rule vector space to obtain the optimal rule set. By employing a structured vector-based vector space construction method based on rule text, and performing multi-dimensional reliable difference analysis and precise grouping, the method effectively achieves accurate quantification and intelligent matching of rule differences, significantly improving the accuracy, adaptability, and processing efficiency of the power supply scheme generation system in complex cross-regional scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power supply business data processing technology, and specifically to a matching method and system for differentiating scenario business rules in intelligent generation of power supply schemes. Background Technology

[0002] In fields such as business rule governance and policy analysis, it is often necessary to perform quantitative analysis and difference comparison on a large number of unstructured text rules in order to extract their core elements, assess their effectiveness, or discover pattern conflicts. Existing technologies mainly focus on topic mining, feature calculation, and similarity comparison of general texts.

[0003] In terms of rule quantification, existing technologies typically employ topic models and structured scoring frameworks. For example, the Chinese journal paper "Quantitative Analysis of Chinese Smart Agriculture Policy Texts Based on LDA Model" discloses a quantification method combining LDA topic modeling and social network analysis. Its working principle is as follows: First, using the probabilistic generative model LDA, each document is treated as a mixture of multiple topics, with each topic represented as a probability distribution of a series of feature words, thereby mining potential topics from the text set; subsequently, a feature word co-occurrence network is constructed, and network analysis is used to verify the association between topics. Another common approach, as shown in the paper "Evolution of the Effectiveness and Coordination of ESG Policies in my country," constructs a three-dimensional analysis framework of "policy strength, objectives, and measures," where each policy is scored across each dimension manually or based on keywords, thereby calculating the comprehensive effectiveness index and coordination degree of the policies.

[0004] In terms of rule-based difference measurement, existing technologies focus on calculating statistical differences based on text surface features. For example, the paper "Text Feature Selection Algorithm Based on Difference Measurement and Mutual Information" discloses a feature selection method that integrates Normalized Difference Measurement (NDM) and Mutual Information (MI). Its working principle is as follows: NDM measures the class discriminative power by calculating the standardized difference of feature word frequencies in documents of positive and negative classes; MI evaluates the statistical dependence between features and classes from an information theory perspective. The combination of the two aims to select the most discriminative lexical features for classification, which can then be used for subsequent text classification or clustering tasks.

[0005] The aforementioned methods, which combine text quantification and difference measurement techniques, share common shortcomings when applied to business rules with clearly defined logical structures. First, these methods remain at the statistical level of documents or words, detached from the inherent logical framework of business rules. Second, these methods rely on manual annotation or subjectively set evaluation systems, resulting in low automation. Therefore, while existing technologies can process general text, they cannot meet the needs for in-depth analysis, refined quantification, and multi-dimensional difference diagnosis of structured business rules. The quantification results lack business interpretability and are difficult to directly support rule optimization, integration, and intelligent matching.

[0006] In the process of realizing this invention, the inventors of this application discovered that the above-mentioned solutions in the prior art have the defects of poor accuracy and effect in matching power supply service rules. Summary of the Invention

[0007] The purpose of this invention is to provide a matching method and system for intelligent generation of scenario business rules for power supply schemes. This matching method and system for intelligent generation of scenario business rules for power supply schemes has the function of improving the accuracy and effectiveness of power supply business rule matching.

[0008] To achieve the above objectives, embodiments of the present invention provide a matching method for intelligent generation of scenario business rules for power supply schemes, including: Obtain the rule text data from the power supply company; Obtain a rule sample library based on the rule text data; Each rule text in the rule sample library is vectorized, and a rule vector space is constructed. Perform rule difference analysis and grouping based on the rule vector space; Get the current business request; The current business request is input into the rule vector space to obtain the optimal rule set.

[0009] Optionally, obtaining a rule sample library based on the rule text data includes: Constructing a BERT model for fine-tuning power-related text; The BERT model, fine-tuned based on the aforementioned electricity text, is used to perform semantic parsing on the rule text data; According to formula (1), obtain the rule object after parsing the rule text data. (1) in, For the first The rule object obtained after parsing the rule text data. For condition fields, As a condition for judgment, For the assignment result, It is a dependency relationship. Numbered by integer; Obtain the rule sample library according to formula (2). (2) in, For rule sample library, The number of rule text data.

[0010] Optionally, vectorizing each rule text in the rule sample library and constructing a rule vector space includes: Obtain the logical structure vector of the rule text; Obtain the semantic description vector of the rule text; Obtain the graph structure vector of the rule text; A rule vector space is constructed based on the logical structure vector, the semantic description vector, and the graph structure vector.

[0011] Optionally, obtaining the logical structure vector of the rule text includes: Determine whether the determination condition is a numerical determination condition; If the determination is determined to be a numerical determination condition, the preset business segmentation interval is obtained according to formula (3). (3) in, For the first Each interval For the first The lower bound of each interval. For the first The upper bound of each interval. For the number of intervals, Numbered by integer; The activation value of the judgment condition for each interval is obtained according to formula (4). (4) in, For the determination condition of the first The activation values ​​of each interval For activation function, This is the steepness coefficient. The preset threshold; The logical structure vector of the rule text is obtained according to formula (5). (5) in, This is the logical structure vector.

[0012] Optionally, obtaining the semantic description vector of the rule text includes: Obtain FastText models for the power industry; The rule text is input into the FastText model for the power sector; The word vector of each word in the rule text is obtained according to formula (6). (6) in, For the first rule in the text Word vectors of 1 word, For the first word n-gram vectors of 1 character, Let n be the set of n-grams of the words in the rule text. For words The vector, , Numbered by integer; The semantic description vector of the rule text is obtained according to formula (7). (7) in, This is the semantic description vector of the rule text. It is an aggregate function. The rule text is as described.

[0013] Optionally, obtaining the graph structure vector of the rule text includes: The rule sample base is constructed into a knowledge graph. ; A graph neural network is used to aggregate nodes in the knowledge graph; Update each node according to formula (8). (8) in, For nodes exist The output hidden representation of the layer, For activation function, For the first The trainable weight matrix of the layer, For splicing operations, For nodes exist The output hidden representation of the layer, It is an aggregate function. For nodes neighboring nodes exist Hidden representation of layers, For nodes The set of neighboring nodes; Obtain the vector representation of the regular subgraph .

[0014] Optionally, constructing the rule vector space based on the logical structure vector, the semantic description vector, and the graph structure vector includes: The mixed vector of the rule text is obtained according to formula (9). (9) in, This is a mixed vector of the rule text; Construct a rule vector space based on all the rule texts.

[0015] Optionally, performing rule difference analysis and grouping based on the rule vector space includes: Select any two rules from the rule vector space; Obtain the cosine similarity between any two rules and the corresponding graph structure vectors; Get the first Jaccard coefficient of the set of corresponding condition fields in any two rules; Obtain the Euclidean distance between the corresponding logical structure vectors of any two rules; Obtain the second Jaccard coefficient for the corresponding assignment result in any two rules; The combined similarity value of any two rules is obtained based on the cosine similarity, the first Jaccard coefficient, the Euclidean distance, and the second Jaccard coefficient. The rules in the vector space are grouped.

[0016] Optionally, inputting the current business request into the rule vector space to obtain the optimal rule set includes: Transform the business request into a query vector; An efficient index is used to retrieve multiple candidate rule vectors that are most similar to the query vector, forming a candidate set; The candidate set is mapped back to the corresponding node in the knowledge graph, and the node is used as the starting point for subgraph traversal. The final rule sequence is output as the optimal rule set.

[0017] On the other hand, the present invention also provides a matching system for intelligent generation of scenario business rules for power supply solutions, comprising: The rule text acquisition module is used to collect rule texts from power supply companies. The controller, connected to the rule text acquisition module, is used to execute any of the matching methods described above.

[0018] Through the above technical solution, the power supply scheme intelligent generation scenario business rule differentiation matching method and system provided by the present invention acquires the rule text data of the power supply enterprise, constructs a rule sample library based on the logical structure of the rule text data, and performs vectorization processing on each rule text to obtain a rule vector space; at the same time, it performs multi-dimensional difference analysis and grouping on the rule vector space, and then searches for the optimal rule set based on the current business request; by adopting the method of constructing the vector space based on the structured vector of the rule text and performing multi-dimensional reliable difference analysis and accurate grouping, it can effectively realize the accurate quantification and intelligent matching of rule differences, and significantly improve the accuracy, adaptability and processing efficiency of the power supply scheme generation system in complex cross-regional scenarios.

[0019] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0020] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a method for intelligently generating scenario-based business rule differentiation matching for power supply schemes according to an embodiment of the present invention; Figure 2 This is a flowchart of semantic parsing of text data in a power supply scheme intelligent generation scenario business rule differentiation matching method according to an embodiment of the present invention; Figure 3 This is a flowchart of the rule text vectorization process in a power supply scheme intelligent generation scenario business rule differentiation matching method according to an embodiment of the present invention. Figure 4 This is a flowchart of obtaining a logical structure vector in a power supply scheme intelligent generation scenario business rule differentiation matching method according to an embodiment of the present invention; Figure 5 This is a flowchart of obtaining semantic description vectors in a matching method for differentiating service rules in a scenario of intelligent generation of power supply schemes according to an embodiment of the present invention; Figure 6 This is a flowchart of obtaining the graph structure vector in a matching method for differentiating service rules in a scenario intelligent generation of power supply schemes according to an embodiment of the present invention. Figure 7 This is a flowchart of a method for obtaining a hybrid vector in a scenario-based business rule differentiation matching method for intelligent generation of power supply schemes according to an embodiment of the present invention; Figure 8This is a flowchart of rule difference analysis and grouping in a power supply scheme intelligent generation scenario business rule differentiation matching method according to an embodiment of the present invention; Figure 9 This is a flowchart of a method for obtaining a rule set in a scenario-based business rule differentiation matching method for intelligent generation of power supply schemes according to an embodiment of the present invention; Figure 10 This is a flowchart of a matching method for differentiating service rules in a scenario of intelligent generation of power supply schemes according to an embodiment of the present invention, which obtains comprehensive similarity. Figure 11 This is a flowchart of obtaining comprehensive similarity in a power supply scheme intelligent generation scenario business rule differentiation matching method according to an embodiment of the present invention. Detailed Implementation

[0021] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the scope of the present invention.

[0022] It should be noted that the acquisition, transmission, storage, use, and processing of data in the technical solution of this application all comply with relevant laws and regulations. In the embodiments of this application, certain existing industry solutions such as software, components, and models may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solution of this application, and do not imply that the applicant has already used or necessarily used such solutions.

[0023] Figure 1 This is a flowchart of a method for intelligently generating scenario-based business rule differentiation matching for power supply schemes according to an embodiment of the present invention. Figure 1 In this context, the matching method may include: In step S1, the rule text data of the power supply company is obtained. This rule text data can be collected from the power supply company's historical power supply plans, policy documents, and standards and specifications. Specifically, this rule text data may include unstructured data.

[0024] In step S2, a rule sample library is obtained based on the rule text data. After obtaining multiple rule text data sets, each set can be processed individually, such as through semantic parsing, to obtain the corresponding rule objects, thus resulting in a structured rule sample library. Specifically, the rule object can include four attributes: condition fields, decision conditions, assignment results, and dependencies.

[0025] In step S3, each rule text in the rule sample library is vectorized, and a rule vector space is constructed. The rule texts in the rule sample library are, in effect, the processed set of rule objects. Vectorizing the rule text / rule object yields the logical structure vector, semantic description vector, and graph structure vector for that rule text. Summarizing the vectors of all rule texts provides the rule vector space.

[0026] In step S4, rule difference analysis is performed based on the rule vector space, and rules are grouped. Specifically, for any two rules in the rule vector space, a multi-dimensional rule difference analysis is performed. Based on the analysis results, it is determined whether any two rules are similar, and similar rules are grouped into the same group / cluster.

[0027] In step S5, the current service request is obtained. This service request may include user characteristics of the new service application, electricity demand, etc., which are the characteristics of the new service request. After obtaining the business request, it can be transformed to obtain a query vector. Specifically, the conversion between business requests and query vectors can adopt the same vectorization process and method as the rule text.

[0028] In step S6, the current service request is input into the rule vector space to obtain the optimal rule set. Specifically, based on the query vector, it can be input into the rule vector space for search and matching. The rule vector space can output a recommended rule set to achieve accurate matching of power supply solutions.

[0029] In steps S1 to S6, rule text data from power supply companies is first collected, then processed to obtain corresponding rule objects, and a rule sample library is constructed based on multiple rule objects. Each rule sample in the rule sample library is then vectorized to obtain a multi-dimensional vector of the rule text, thereby constructing a rule vector space. Simultaneously, the vector differences between different rules in the rule vector space are analyzed, and groups are formed based on the similarity of different rule vectors. Finally, requests for current power services are collected, converted into query vectors, and input into the rule vector space to obtain the optimal rule set.

[0030] Traditional methods of rule quantification and rule difference measurement remain at the statistical level of documents or words, detached from the inherent logical framework of business rules, and rely on manual annotation or subjective evaluation systems, resulting in low automation. Therefore, while existing technologies can process general text, they cannot meet the needs for in-depth analysis, refined quantification, and multi-dimensional difference diagnosis of structured business rules. The quantification results lack business interpretability and are difficult to directly support rule optimization, fusion, and intelligent matching. In this embodiment of the invention, a method is adopted to construct a vector space based on structured vectors of rule text and to perform multi-dimensional reliable difference analysis and precise grouping. This effectively achieves accurate quantification and intelligent matching of rule differences, significantly improving the accuracy, adaptability, and processing efficiency of the power supply scheme generation system in complex cross-regional scenarios.

[0031] In this embodiment of the invention, after collecting the rule text data of the power supply company, semantic parsing can be performed on the text data to construct a rule sample library. Specifically, the parsing steps can be as follows: Figure 2 As shown. Specifically, in Figure 2 In addition, the matching method may also include: In step S20, a BERT model fine-tuned with electricity text is constructed. The BERT model is a pre-trained model that has been fine-tuned with electricity text.

[0032] In step S21, a BERT model fine-tuned for power text is used to perform semantic parsing on the rule text data. Semantic parsing of the rule text data can generate standardized, computable rule objects / attributes.

[0033] In step S22, the rule object after parsing the rule text data is obtained according to formula (1). (1) in, For the first The rule object / attribute after parsing the rule text data. For condition fields / collections of fields, For the determination condition / set of conditions, For the assignment result / result set, For dependency relationships / sets of relationships, The number is an integer.

[0034] In step S23, the rule sample library is obtained according to formula (2). (2) in, For rule sample library, This refers to the number of rule text data / rule texts. Specifically, a group / set of rule objects with multiple rule text data can form a structured sample library.

[0035] In steps S20 to S23, the BERT model, fine-tuned from the power text, is used to semantically parse the rule text data into standardized rule objects / attributes, including condition fields, decision conditions, assignment results, and dependencies. Simultaneously, the rule objects / attributes corresponding to all rule text data are aggregated to construct a structured rule sample library.

[0036] In this embodiment of the invention, after constructing a structured rule sample library, each rule text in the rule sample library can be vectorized to obtain a rule vector space. Specifically, the vectorization steps can be as follows: Figure 3 As shown. Specifically, in Figure 3 In addition, the matching method may also include: In step S30, the logical structure vector of the rule text is obtained. The logical structure vector of the rule text can be obtained as follows: Figure 4 As shown, specifically, in Figure 4 In this context, the steps for obtaining the logical structure vector may include: In step S300, it is determined whether the determination condition is a numerical determination condition.

[0037] In step S301, if the determination condition is numerical, the preset business segmentation interval is obtained according to formula (3). (3) in, For the first An interval, a specific range of business values. For the first The lower bound of each interval. For the first The upper bound of each interval, such as This indicates the capacity range of "greater than 160kVA and less than or equal to 315kV"; For the number of intervals, The numbering is for integers. Specifically, for numerical judgment conditions, piecewise function encoding can be used, assuming the condition is... , The comparison operator is used, and the business segmentation interval is preset as shown in formula (3).

[0038] In step S302, the activation value of the judgment condition for each interval is obtained according to formula (4). (4) in, For the judgment condition, the first The activation values ​​of each interval For activation function, This is the steepness coefficient. This is a preset threshold. Specifically, the activation level of this condition for each interval can be calculated using a membership function. Further, the steepness coefficient... This is a preset positive hyperparameter used to control the clarity of the numerical threshold's allocation within a business range. Its specific value is set based on the clarity of the boundary conditions in the business rules: for mandatory business thresholds with clearly defined boundaries (such as capacity and voltage level thresholds), a larger value is used. A value (usually ≥10) makes the membership function approximate a step function, thus strengthening the deterministic distinction in vector representation; for guiding conditions with some flexibility, a smaller value can be used. Values ​​are used to achieve a smooth transition.

[0039] In step S303, the logical structure vector of the rule text is obtained according to formula (5). (5) in, It is a logical structure vector, that is, the first... A logical structure vector of rule text / rule text data. For the first The activation value of each interval.

[0040] In step S31, the semantic description vector of the rule text is obtained. The semantic description vector of the rule text can be obtained as follows: Figure 5 As shown, specifically, in Figure 5 In this context, the steps for obtaining the semantic description vector may include: In step S310, a FastText model for the power sector is obtained. Specifically, an existing FastText model can be trained using an energy-saving power corpus to encode the rule description text into a fixed-dimensional semantic vector.

[0041] In step S311, the rule text is input into the FastText model for the power sector.

[0042] In step S312, the word vector of each word in the rule text is obtained according to formula (6). (6) in, For the first rule in the text Words Word vectors, For the first word n-gram vectors of 1 character, For the set of n-grams of words in the regular text, For words The vector, , Numbered by integers. Specifically, given a word... Its vector representation is the n-gram vector of all characters of the word. and the entire word vector sum.

[0043] In step S313, the semantic description vector of the rule text is obtained according to formula (7). (7) in, For the first A semantic description vector of a rule text. It is an aggregate function. For the first A set of rule-based texts. Specifically, for rule-based texts, sentence vectors are generated by aggregating the vectors of their constituent words, thereby capturing the semantics of electrical engineering terminology. Furthermore, for the aggregation function... This may include, but is not limited to, the calculation of average values.

[0044] In step S32, the graph structure vector of the rule text is obtained. The graph structure vector of the rule text can be obtained as follows: Figure 6 As shown, specifically, in Figure 6 In this process, the steps for obtaining the spectral structure vector may include: In step S320, the rule sample base is constructed into a knowledge graph. Among them, the rule sample library Constructing as a simple graph Nodes are fields or values, and edges are logical relationships.

[0045] In step S321, a graph neural network is used to aggregate nodes in the knowledge graph. Specifically, a graph neural network (GNN) can be used for node aggregation to update each node.

[0046] In step S322, each node is updated according to formula (8). (8) in, For nodes exist layer / The next update outputs the hidden representation / feature vector. For activation function, For the first The trainable weight matrix of the layer, For splicing operations, For nodes exist The output of a layer is hidden, that is, the output of the layer above. Aggregate functions, including but not limited to summation and averaging. For nodes neighboring nodes exist Hidden representation of layers, For nodes The set of neighboring nodes, The number is an integer.

[0047] In step S323, the vector representation of the regular subgraph is obtained. The vector representation of the regular subgraph can be obtained by using a readout function (such as global average pooling).

[0048] In step S33, a rule vector space is constructed based on the logical structure vector, semantic description vector, and graph structure vector. Specifically, the logical structure vector, semantic description vector, and graph structure vector are used to vectorize the 33 power receiving scheme fields and 14 access scheme fields. Finally, the hybrid representation vector of the rules is a concatenation of the above vectors, as shown below. Figure 7 As shown. Specifically, in Figure 7 In addition, the matching method may also include: In step S330, the blending vector of the rule text is obtained according to formula (9). (9) in, This is the mixed vector of the regular text, that is, the first... A mixed vector of regular texts.

[0049] In step S331, a rule vector space is constructed based on all the rule texts. .

[0050] In steps S30 to S33, the logical structure vector, semantic description vector, and graph structure vector of each rule text are obtained sequentially. If a certain vector of a rule text is missing, then that vector is a control vector. After obtaining the logical structure vector, semantic description vector, and graph structure vector, a rule vector space can be constructed based on these vectors.

[0051] In this embodiment of the invention, after constructing the rule vector space, rule difference analysis and grouping can be performed based on the rule vector space. Specifically, the rule difference analysis and grouping steps can be as follows: Figure 8 As shown. Specifically, in Figure 8 In addition, the matching method may also include: In step S40, any two rules are selected from the rule vector space. Specifically, in the vector space... In this system, the difference between any two rules can be quantified in an interpretable way.

[0052] In step S41, the cosine similarity of the corresponding graph structure vectors of any two rules is obtained. The difference is measured by calculating the cosine similarity or distance between the graph structure vectors corresponding to the two rules, reflecting the differences in the logical dependency paths and structures of the rules; this difference is also the difference in the reasoning process.

[0053] In step S42, the first Jaccard coefficient of the corresponding condition field set in any two rules is obtained. The difference is measured by calculating the Jaccard coefficient of the condition field set on which the two rules depend, reflecting whether the field sets used for judgment are consistent; this difference is the judgment field difference. Specifically, this first Jaccard coefficient is the condition field Jaccard coefficient.

[0054] In step S43, the Euclidean distance between the corresponding logical structure vectors of any two rules is obtained. The difference between the logical structure vectors of two rules is measured by calculating the distance using Euclidean distance, directly quantifying the differences in core decision logic such as numerical thresholds and comparison operators; this difference is also known as the difference in decision conditions.

[0055] In step S44, the second Jaccard coefficient of the corresponding assignment results for any two rules is obtained. Specifically, for cases where the assignment result is a discrete set of options, the consistency of the two assignment results is measured by calculating their Jaccard coefficients; the difference between the corresponding assignment results for any two rules is also the assignment result difference. In particular, this second Jaccard coefficient is the Jaccard coefficient of the assignment result.

[0056] In step S45, the comprehensive similarity value of any two rules is obtained based on cosine similarity, the first Jaccard coefficient, Euclidean distance, and the second Jaccard coefficient. Furthermore, the independent calculation results of these four dimensions can be combined to form a four-dimensional difference profile vector, accurately locating the specific source and composition of the difference between any two rules in an interpretable "profile" form. During rule retrieval, matching, or macro-level comparison, the system dynamically assigns weights to the four dimensions of the difference profile based on the type of the target business field and the context of the current query, and calculates the comprehensive difference or similarity. For example, for strongly logical fields such as "metering method," "reasoning process difference" is given a higher weight; for calculation-based fields such as "current ratio," "judgment condition difference" is given a higher weight.

[0057] For calculating the overall similarity value, the weights of the four difference values ​​can be dynamically adjusted to improve the accuracy of the calculation and more conveniently and accurately reflect the degree of difference between the two rules. Specifically, the steps for calculating the overall similarity value can be as follows: Figure 10 As shown, in Figure 10 In addition, the matching method may also include: In step S450, the similarity of the judgment conditions is obtained according to formula (10). (10) in, To determine conditional similarity, that is, the similarity between the corresponding logical structure vectors of any two rules, For the attenuation parameter, and It is acceptable Used to control attenuation parameters. It is a Euclidean distance.

[0058] In step S451, the similarity of the reasoning process, the similarity of the decision field, and the similarity of the assignment result are obtained based on the cosine similarity, the first Jaccard coefficient, and the second Jaccard coefficient, respectively. Specifically, the similarity of the reasoning process... Determine field similarity and the similarity of the assignment results The corresponding cosine similarity, first Jaccard coefficient, and second Jaccard coefficient are used respectively to replace them. Furthermore, this method can replace the similarity of the reasoning process. Determine field similarity Similarity of judgment conditions and the similarity of the assignment results The similarity scores in all four dimensions are normalized to between 0 and 1, with larger values ​​indicating greater similarity.

[0059] In step S452, the similarity of the reasoning process is obtained respectively. Determine field similarity Similarity of judgment conditions and the similarity of the assignment results The mean and standard deviation of similarity across four dimensions. After each rule comparison, the current... Add a historical window and update the mean and standard deviation, such as by using a moving average or exponentially weighted moving average, so that the statistics can adapt to changes in the data distribution.

[0060] In step S453, the absolute deviation of the similarity of each dimension from the mean is obtained according to formula (11). (11) in, For the first The absolute deviation of the similarity in each dimension For the first Similarity in 10 dimensions For the first The mean of each dimension, The number is an integer, and The first dimension of similarity This refers to the similarity of the reasoning process, the second dimension of similarity. That is, to determine the similarity of fields, the third dimension of similarity. This refers to the similarity criteria, specifically the fourth dimension of similarity. This refers to the similarity of the assigned results. Specifically, the greater the absolute deviation of the dimension similarity, the greater the difference between the similarity of that dimension in the current comparison and the normal situation, indicating that there may be special information that needs to be assigned a higher weight.

[0061] In step S454, the discriminant factor for each dimension of similarity is obtained according to formula (12). (12) in, For the first Discrimination factor based on similarity across multiple dimensions. For the first The standard deviation of the similarity in each dimension It is a small constant. Considering the discriminative power of the dimension itself, the larger the standard deviation, the more significant the difference of that dimension is globally, and the more effectively it can distinguish rules.

[0062] In step S455, the similarity weights for each dimension are obtained according to formula (13). (13) in, For the first Similarity weights in each dimension This is a balancing coefficient, ranging from 0 to 1, and can be set to 0.7. It controls the weighting of global information and uniform prior. It represents the absolute deviation in dimensional similarity. When the value is very small, the uniform term ensures that the weights do not approach zero, thus preserving the basic text.

[0063] In step S456, the similarity weights for each dimension are normalized according to formula (14). (14) in, For the first The similarity weights after normalization of each dimension.

[0064] In step S457, the comprehensive similarity value is obtained according to formula (15). (15) in, This is the overall similarity value. Specifically, based on this overall similarity value, it can be determined whether the two rules are similar or belong to the same group, and an appropriate judgment threshold can be set to determine this.

[0065] In this embodiment of the invention, regarding the calculation of the comprehensive similarity value, considering the influence of the similarity magnitude, for multiple cases with low similarity, corresponding weights can be increased to make the comprehensive similarity value more focused on that case, avoiding being neutralized or adjusted by other similarities. This may also include, for example... Figure 11 Steps: In step S458, it is determined whether the similarity of each dimension is greater than or equal to a similarity threshold. A threshold larger than this similarity threshold can also be set; if the similarity of each dimension is greater than the larger threshold, it can be directly determined that the two rules are not similar in that dimension.

[0066] In step S459, if it is determined that the similarity of each dimension is greater than or equal to the similarity threshold, the number of abnormal dimensions is obtained. This number of abnormal dimensions is also the number of dimensions whose similarity is greater than or equal to the similarity threshold.

[0067] In step S460, the similarity weights for each dimension are obtained according to formula (16). (16) in, For similarity threshold, This represents the number of outlier dimensions. Specifically, this approach effectively increases the emphasis on multiple potentially dissimilar dimensions, preventing them from being neutralized or adjusted by other similar dimensions, thus avoiding errors. Furthermore, the above formula applies to the number of outlier dimensions. It cannot be 4, if the number of abnormal dimensions is... When the value is 4, it can be directly determined that the two rules are not similar.

[0068] In step S461, the similarity weights of each dimension are normalized according to formula (14).

[0069] In step S462, the comprehensive similarity value is obtained according to formula (15).

[0070] In step S46, the rules in the vector space are grouped. This can be done using the K-means clustering algorithm to perform unsupervised clustering of the mixed feature vectors of all rules. Through iterative optimization, rules that are geographically close in the vector space are automatically grouped into the same cluster, thereby discovering different business rule patterns or regional groupings and providing a macro-level perspective for understanding rule distribution. Alternatively, a threshold can be set based on the comprehensive similarity value of any two rules to determine whether the two rules are similar and can be classified into the same group.

[0071] In steps S40 to S46, any two rules in the rule vector space are selected, and the cosine similarity, first Gerard coefficient, Euclidean distance, and second Jaccard coefficient of each rule are calculated. Then, based on the differences mentioned above, a comprehensive similarity value is calculated between the two rules. Based on this comprehensive similarity value, the rules in the vector space can be grouped.

[0072] In this embodiment of the invention, upon receiving a current service request, a corresponding rule set can be obtained based on the service request and the rule vector space to complete rule matching for different power supply schemes. Specific steps include... Figure 9 As shown. Specifically, in Figure 9 In addition, the matching method may also include: In step S60, the business request is transformed into a query vector. This transformation can be performed using the same vectorization process as the rule.

[0073] In step S61, an efficient index is used to retrieve multiple candidate rule vectors that are most similar to the query vector, forming a candidate set. This is done within the rule vector space. In the process, efficient indexes are used to retrieve the query vector. The top-K most similar candidate rule vectors constitute the candidate set. such as candidate set Specifically, this efficient index retrieval can include approximate nearest neighbor search.

[0074] In step S62, the candidate set is mapped back to the corresponding nodes in the knowledge graph, and the nodes are used as starting points for subgraph traversal. Specifically, the candidate set... Mapping back to knowledge graph The corresponding node in the graph is used as the starting point for subgraph traversal. User characteristics are verified through graph queries or a rule engine. Whether all the prerequisite chains of the candidate rules are met, and resolve conflicts according to preset strategies (such as territorial priority).

[0075] In step S63, the final rule sequence is output as the optimal rule set. Specifically, the output consists of the rule sequence that finally meets the conditions and is sorted by matching degree, serving as the basis for generating the power supply scheme.

[0076] In steps S60 to S63, a hybrid matching mode of "graph reasoning + vector nearest neighbor search" is adopted to output a recommended rule set, which can complete the rule matching of different power supply schemes.

[0077] In this embodiment of the present invention, this embodiment takes the differentiated matching of power supply scheme business rules in various provinces as the background, and takes the two fields with high difference rate, "pricing strategy type" and "power factor assessment method", as examples.

[0078] Step 1: Collect the original text of the business rules regarding "pricing strategy types" from each province. For example, the text "For industrial and commercial users with an installed capacity greater than 100kVA and less than or equal to 315kVA, a single-rate electricity price shall be applied." After being parsed by a fine-tuned BERT model, structured rule objects are obtained. .

[0079] Condition fields : ["User type", "Installation capacity"]; Judgment conditions :["User type = industrial and commercial", "100 < installed capacity ≤ 315"]; Assignment result "Pricing strategy type = single system"; Dependency The conclusion of this rule depends on the values ​​of the "user type" and "installation capacity" fields.

[0080] Step 2: Logical Structure Vector: For the condition "100 < installed capacity ≤ 315", preset capacity segment intervals [(0, 100], (100, 160], (160, 315], (315, 500], (500, ∞)]. Use membership functions to calculate the activation values ​​of each interval for thresholds 100 and 315 respectively, and merge them to obtain the logical vector, resulting in [0.0, 0.6, 0.4, 0.0, 0.0].

[0081] Semantic description vector: The original text of the above rules is input into the FastText model in the power field. By calculating the average value of the word vectors, a 128-dimensional semantic vector is obtained.

[0082] Graph Structure Vector: A "Pricing Strategy Type" node is created in the knowledge graph, and "Conditional Dependency" edges are established between it and the "User Type" and "Installation Capacity" nodes. A two-layer GraphSAGE model is applied to learn this subgraph, updating the node representations using a formula. Finally, the average of all node vectors within the subgraph is taken to obtain the graph structure vector.

[0083] Vector fusion: The logical structure vector, semantic description vector and graph structure vector generated above are concatenated to form the hybrid feature vector of the rule, which is then stored in the vector database.

[0084] Step 3: Compare the differences in “Pricing Strategy Type” between Province A (Rule A: Two-part system applies to capacity > 315) and Province B (Rule B: Two-part system applies to capacity > 500).

[0085] Determine field differences: The Jaccard coefficient for the condition field set (both {user type, installation capacity}) of the two is 1.0, indicating no difference.

[0086] Judgment condition difference: Calculate the Euclidean distance between the two logic vectors. Since the logic structure vector of province A has strong activation in the interval 315 ([0, 0, 0.9, 0.1, 0]) and the logic structure vector of province B has strong activation in the interval 500 ([0, 0, 0, 0.9, 0.1]), the calculated Euclidean distance is larger, quantifying the significant difference in threshold conditions.

[0087] Cluster analysis: K-means clustering (K=3) was performed on the rule vectors of "power factor assessment method" for all provinces. After iterative calculation, the rules were clearly divided into three clusters: "strict assessment for general industry", "lenient assessment for commerce", and "partial assessment for agriculture", which is consistent with the experience of business experts.

[0088] Step 4: Accept an application from an industrial user in Shaanxi Province: {Voltage: 10kV, Capacity: 800kVA, User Type: Industrial}.

[0089] Vector retrieval: The request features are vectorized, and an approximate nearest neighbor search is performed using the HNSW index in the vector database to return the Top-5 candidate rule vectors, which include the "two-part system for large industrial users" rule for Shaanxi Province.

[0090] Graph reasoning: Locate these candidate rule nodes in the knowledge graph. Starting from the "Large Industrial User Two-Part System" node, search backwards for "conditional dependency" edges to find the prerequisite nodes "User Type = Industrial" and "Capacity > 315". The system verifies that the user characteristics meet these two conditions, and there are no mismatched exclusionary conditions. Based on the "local priority" strategy, this Shaanxi Province rule is confirmed to be adopted.

[0091] Output: The system outputs the final matching rule set: {Pricing strategy type: two-part system, power factor assessment method: 0.90 assessment, ...}, based on which a power supply scheme draft is automatically generated.

[0092] On the other hand, the present invention also provides a matching system for differentiating business rules in intelligent generation scenarios of power supply schemes. Specifically, the matching system may include a rule text acquisition module and a controller.

[0093] The rule text acquisition module is used to collect the rule text of the power supply company. The controller and the rule text acquisition module are used to execute any of the matching methods mentioned above.

[0094] Through the above technical solution, the power supply scheme intelligent generation scenario business rule differentiation matching method and system provided by the present invention acquires the rule text data of the power supply enterprise, constructs a rule sample library based on the logical structure of the rule text data, and performs vectorization processing on each rule text to obtain a rule vector space; at the same time, it performs multi-dimensional difference analysis and grouping on the rule vector space, and then searches for the optimal rule set based on the current business request; by adopting the method of constructing the vector space based on the structured vector of the rule text and performing multi-dimensional reliable difference analysis and accurate grouping, it can effectively realize the accurate quantification and intelligent matching of rule differences, and significantly improve the accuracy, adaptability and processing efficiency of the power supply scheme generation system in complex cross-regional scenarios.

[0095] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0096] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0097] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0098] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0099] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0100] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0101] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0102] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0103] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for intelligently generating scenario-based business rule differentiation matching of power supply schemes, characterized in that, include: Obtain the rule text data from the power supply company; Obtain a rule sample library based on the rule text data; Each rule text in the rule sample library is vectorized, and a rule vector space is constructed. Perform rule difference analysis and grouping based on the rule vector space; Get the current business request; The current business request is input into the rule vector space to obtain the optimal rule set.

2. The matching method according to claim 1, characterized in that, The rule sample library is obtained based on the rule text data, including: Constructing a BERT model for fine-tuning power-related text; The BERT model, fine-tuned based on the aforementioned electricity text, is used to perform semantic parsing on the rule text data; According to formula (1), obtain the rule object after parsing the rule text data. ,(1) in, For the first The rule object obtained after parsing the rule text data. For condition fields, As a condition for judgment, For the assignment result, It is a dependency relationship. Numbered by integer; Obtain the rule sample library according to formula (2). ,(2) in, For rule sample library, The number of rule text data.

3. The matching method according to claim 2, characterized in that, Vectorization of each rule text in the rule sample library and construction of the rule vector space include: Obtain the logical structure vector of the rule text; Obtain the semantic description vector of the rule text; Obtain the graph structure vector of the rule text; A rule vector space is constructed based on the logical structure vector, the semantic description vector, and the graph structure vector.

4. The matching method according to claim 3, characterized in that, The logical structure vector of the rule text is obtained as follows: Determine whether the determination condition is a numerical determination condition; If the determination is determined to be a numerical determination condition, the preset business segmentation interval is obtained according to formula (3). ,(3) in, For the first Each interval For the first The lower bound of each interval. For the first The upper bound of each interval. For the number of intervals, Numbered by integer; The activation value of the judgment condition for each interval is obtained according to formula (4). ,(4) in, For the determination condition of the first The activation values ​​of each interval For activation function, This is the steepness coefficient. The preset threshold; The logical structure vector of the rule text is obtained according to formula (5). ,(5) in, This is the logical structure vector.

5. The matching method according to claim 4, characterized in that, Obtaining the semantic description vector of the rule text includes: Obtain FastText models for the power industry; The rule text is input into the FastText model for the power sector; The word vector of each word in the rule text is obtained according to formula (6). ,(6) in, For the first rule in the text Word vectors of 1 word, For the first word n-gram vectors of 1 character, Let n be the set of n-grams of the words in the rule text. For words The vector, , Numbered by integer; The semantic description vector of the rule text is obtained according to formula (7). ,(7) in, This is the semantic description vector of the rule text. It is an aggregate function. The rule text is as described.

6. The matching method according to claim 5, characterized in that, Obtaining the graph structure vector of the rule text includes: The rule sample base is constructed into a knowledge graph. ; A graph neural network is used to aggregate nodes in the knowledge graph; Update each node according to formula (8). ,(8) in, For nodes exist The output hidden representation of the layer, For activation function, For the first The trainable weight matrix of the layer, For splicing operations, For nodes exist The output hidden representation of the layer, It is an aggregate function. For nodes neighboring nodes exist Hidden representation of layers, For nodes The set of neighboring nodes; Obtain the vector representation of the regular subgraph .

7. The matching method according to claim 6, characterized in that, Constructing a rule vector space based on the logical structure vector, the semantic description vector, and the graph structure vector includes: The mixed vector of the rule text is obtained according to formula (9). ,(9) in, This is a mixed vector of the rule text; Construct a rule vector space based on all the rule texts.

8. The matching method according to claim 7, characterized in that, The rule difference analysis and grouping based on the rule vector space include: Select any two rules from the rule vector space; Obtain the cosine similarity between any two rules and the corresponding graph structure vectors; Get the first Jaccard coefficient of the set of corresponding condition fields in any two rules; Obtain the Euclidean distance between the corresponding logical structure vectors of any two rules; Obtain the second Jaccard coefficient for the corresponding assignment result in any two rules; The combined similarity value of any two rules is obtained based on the cosine similarity, the first Jaccard coefficient, the Euclidean distance, and the second Jaccard coefficient. The rules in the vector space are grouped.

9. The matching method according to claim 6, characterized in that, Inputting the current business request into the rule vector space to obtain the optimal rule set includes: Transform the business request into a query vector; An efficient index is used to retrieve multiple candidate rule vectors that are most similar to the query vector, forming a candidate set; The candidate set is mapped back to the corresponding node in the knowledge graph, and the node is used as the starting point for subgraph traversal. The final rule sequence is output as the optimal rule set.

10. A matching system for intelligent generation of scenario-based business rules for power supply schemes, characterized in that, include: The rule text acquisition module is used to collect rule texts from power supply companies. The controller, connected to the rule text acquisition module, is used to execute the matching method as described in any one of claims 1-9.