Power data matching method and system
By designing dynamic priority matching rules and building priority queues, the problem of low rule matching efficiency and difficulty in adapting to environmental changes in power data processing is solved, efficient and automated data classification and grading is achieved, and maintenance costs are reduced.
Patent Information
- Application Number
- CN202411830675.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-25
AI Technical Summary
The existing power data processing methods rely on static rules and cannot adapt to dynamic data changes, resulting in reduced classification accuracy, low processing efficiency, and difficult to meet real-time requirements.
By obtaining power system data, designing matching rules and priorities, building priority queues, using priority queues to classify and classify data, and dynamically adjusting rule priorities to adapt to environmental changes.
It realizes the automation, efficient classification and grading of power data, improves the efficiency and speed of rule matching, and reduces the cost of rule maintenance.
Smart Images

Figure CN119884811A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power grid data matching, and in particular to a power data matching method and system. Background Art
[0002] With the development of intelligent and information-based power systems, the power industry has accumulated a large amount of business data. These data not only have huge business value, but also contain a lot of sensitive information. In order to ensure data security and privacy protection, power data processing is particularly important. However, existing methods mostly rely on manual rule updates and manual judgments, lack intelligent and automated means, and cannot efficiently process massive data.
[0003] Traditional power data processing methods usually process data through static rules. Static rules are not only unable to adapt to the dynamic changes of data, but may also lead to a decrease in the accuracy of classification and grading, and increase the workload of manual maintenance. At present, there are the following main problems in power data processing methods: Since the priority of the rules is fixed, when the amount of data increases, the processing efficiency will decrease significantly, and it is difficult to meet the real-time requirements. Due to the different sources of data, the environment of the data is also constantly changing. It is difficult to adapt to the requirements of the environment by relying solely on the priority of calculation. Summary of the invention
[0004] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.
[0005] In view of the above existing problems, the present invention is proposed. Therefore, the present invention provides a power data matching method to solve the problems of low rule matching efficiency and difficulty in adapting to environmental changes in power data processing.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] In a first aspect, the present invention provides a power data matching method, comprising:
[0008] Obtain power system data;
[0009] Designing matching rules and priorities of the matching rules according to the power system data;
[0010] A priority queue is constructed according to the priority, and the power system data is classified and graded using the priority queue.
[0011] As a preferred solution of the power data matching method described in the present invention, wherein: the design matching rules and the priority of the matching rules include:
[0012] Based on the power system data, matching rules and initial priorities of the matching rules are designed, and the initial priorities are dynamically adjusted to obtain priorities of the matching rules.
[0013] As a preferred solution of the power data matching method of the present invention, wherein: constructing a priority queue according to the priority includes:
[0014] Use the priority queue data structure to store the rules and sort them according to the dynamically calculated priorities to obtain the priority sorting results.
[0015] As a preferred solution of the power data matching method of the present invention, wherein: using the priority queue to classify and grade the power system data includes:
[0016] Extract source information of the data to be matched, compare the source information with the matching rules, and classify and grade according to the comparison results.
[0017] As a preferred solution of the power data matching method of the present invention, dynamically adjusting the initial priority includes:
[0018] Calculate the hit rate of the matching rule, expressed as:
[0019]
[0020] Among them, Hits i Attempts is the number of successful matches for rule i. i The total number of matching attempts for matching rule i.
[0021] As a preferred solution of the power data matching method described in the present invention, it also includes:
[0022] Combining the initial priority and hit rate, different weights are set to calculate the priority of the matching rule, which is expressed as:
[0023] Priority i =α×hit rate i +β×initial priority i
[0024] Among them, α and β are the set weights, and i is the current matching rule.
[0025] As a preferred solution of the power data matching method of the present invention, wherein: extracting source information of the data to be matched, and comparing the source information with the matching rule comprises:
[0026] Take the matching rule with the highest priority from the priority queue;
[0027] Check whether the database and table to which the data to be matched belongs meet the requirements of the matching rules; check whether the value of the field of the data to be matched meets the rule conditions;
[0028] If the comparison is successful, the data is processed according to the matching rules;
[0029] If the comparison fails, continue to take out the next matching rule until the comparison succeeds or the priority queue is empty.
[0030] In a second aspect, the present invention provides a system for matching power data, comprising:
[0031] An acquisition module, used for acquiring power system data;
[0032] A design module, used for designing matching rules and priorities of the matching rules according to the power system data;
[0033] A comparison module is used to construct a priority queue according to the priority, and use the priority queue to classify and grade the power system data.
[0034] In a third aspect, the present invention provides a computing device, comprising:
[0035] Memory and processor;
[0036] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the power data matching method are implemented.
[0037] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the power data matching method.
[0038] Compared with the prior art, the present invention has the following beneficial effects: the present invention realizes automatic and efficient classification and grading of power data by dynamically calculating and adjusting rule priorities and utilizing priority queues for efficient management, scheduling and matching, thereby effectively avoiding waste of resources, greatly improving the efficiency of rule matching, increasing the speed of rule matching, and reducing the cost of rule maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:
[0040] Figure 1 A schematic diagram of the overall process of a power data matching method according to an embodiment of the present invention;
[0041] Figure 2 A schematic diagram of a comparison process of a power data matching method according to an embodiment of the present invention;
[0042] Figure 3 A schematic diagram of the internal structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0044] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0045] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0046] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0047] At the same time, in the description of the present invention, it should be noted that the orientations or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the system or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0048] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0049] Example 1
[0050] Reference Figure 1-2 , as an embodiment of the present invention, provides a power data matching method, comprising:
[0051] S100: Acquiring power system data;
[0052] In an optional embodiment, the power system data includes numerical data such as voltage and current and metadata such as database names and table names related thereto;
[0053] In an optional embodiment, these data come from various links of the power system, such as monitoring equipment, sensors and information systems in the processes of power generation, transmission, distribution and consumption, which together constitute a large amount of business data accumulated by the power industry.
[0054] In an embodiment of the present application, after the power system data is obtained, the data is preprocessed, and the preprocessing includes data cleaning and normalization. When cleaning the data, missing values and outliers are deleted, and the numerical data is normalized to ensure that the data is at the same scale for subsequent processing.
[0055] In another possible embodiment, the preprocessing operation may be data interpolation and feature engineering; for missing power system data, interpolation may be used to fill in the missing data;
[0056] For example: Commonly used interpolation methods include linear interpolation, spline interpolation, and nearest neighbor interpolation.
[0057] It should be noted that the above preprocessing steps can effectively improve the accuracy and reliability of power data, providing a data basis for subsequent data matching and analysis.
[0058] S102: Design matching rules and matching rule priorities according to power system data;
[0059] Preferably, based on the power system data, matching rules and initial priorities of the matching rules are designed, and the initial priorities are dynamically adjusted to obtain the priorities of the matching rules.
[0060] In the embodiment of the present application, the matching rule format includes database name, table name, voltage name, condition and classification result;
[0061] For example, rule 1: when the voltage field of table X in a database A exceeds 230, the data is "important data" and the initial priority is 2; rule 2: when the voltage field of table Y in a database B cannot exceed 230, the data is "normal data" and the initial priority is 1.
[0062] Preferably, the hit rate of the matching rule is calculated, which is expressed as:
[0063]
[0064] Among them, Hits i Attenpts is the number of successful matches of matching rule i. i The total number of attempts to match rule i;
[0065] In the embodiment of the present application, each time a piece of data to be matched is compared, the corresponding matching rule is increased. i Count; if the rule matches successfully, increase the Hits of the corresponding matching rule i count.
[0066] It should be noted that for each rule i, Hits is initialized i Attempts i , that is, initialized to 0.
[0067] For example, assume the following matching rules and data:
[0068] Matching rule A: Applicable to data with voltage exceeding 230.
[0069] Matching rule B: Applicable to data with voltage not exceeding 230.
[0070] During the processing, matching rule A tried to match 100 times, of which 60 times were successful; matching rule B tried to match 80 times, of which 50 times were successful;
[0071] Then: hit rate A = 0.60; hit rate B = 0.625.
[0072] Preferably, different weights are set in combination with the initial priority and the hit rate to calculate the priority of the matching rule, which is expressed as:
[0073] Priority i =α×hit rate i +β×initial priority i
[0074] Among them, α and β are the set weights, and i is the current matching rule.
[0075] In an optional embodiment, the weights α and β may be (0.3, 0.7) and (0.7, 0.3), and the initial priorities and weights may be adjusted as needed;
[0076] For example, for rule A and rule B, if the initial priorities are both 1, and the weight coefficients α=0.7, β=0.3, then:
[0077] Priority A = 0.7 × 0.60 + 0.3 × 1 = 0.42 + 0.3 = 0.72
[0078] Priority B = 0.7 × 0.625 + 0.3 × 1 = 0.4375 + 0.3 = 0.7375
[0079] Rule B has a slightly higher priority than Rule A because it has a higher hit rate.
[0080] For example, if the initial priority of rule A is 1, the initial priority of rule B is 2, and the weight coefficients α=0.7, β=0.3, then:
[0081] Priority A = 0.7 × 0.60 + 0.3 × 1 = 0.42 + 0.3 = 0.72
[0082] Priority B = 0.7 × 0.625 + 0.3 × 2 = 0.4375 + 0.6 = 1.0375
[0083] Rule A has a slightly higher priority than Rule B because its initial priority is higher.
[0084] It should be noted that by designing matching rules and their dynamic priority adjustment mechanism, the present invention can flexibly adapt to different data processing requirements according to the characteristics of power system data; by calculating the hit rate of matching rules and setting different weights in combination with the initial priority and hit rate, the priority of each rule can be accurately calculated, thereby achieving efficient and accurate classification and processing of power system data. This mechanism not only improves the accuracy and efficiency of data processing, but also enhances the flexibility and scalability of the system.
[0085] S104: construct a priority queue according to the priority, and use the priority queue to classify and grade the power system data; Figure 2 As shown;
[0086] Preferably, a priority queue data structure is used to store the rules, and the rules are sorted according to dynamically calculated priorities to obtain priority sorting results.
[0087] Preferably, the source information of the data to be matched is extracted, the source information is compared with the matching rules, and classification and grading are performed according to the comparison results;
[0088] In an optional embodiment, the source information of the data to be matched may include which database, which table the data comes from, and the value of a specific data field, etc.;
[0089] Exemplary:
[0090] Data source information to be matched 1: database A, table X, voltage field, value is 250V;
[0091] Data source information to be matched 2: database B, table Y, voltage field, value is 250V.
[0092] In the embodiment of the present application, the comparison process is: taking out the matching rule with the highest priority from the priority queue; checking whether the database and table to which the data to be matched belongs meet the matching rule requirements; checking whether the value of the field of the data to be matched meets the rule conditions;
[0093] If the comparison is successful, the data is processed according to the matching rule; if the comparison fails, the next matching rule is taken out until the comparison is successful or the priority queue is empty.
[0094] In the embodiment of the present application, the classification and grading of data are determined according to the matching results; for example:
[0095] Data source 1 matches rule 1, and because the voltage is 250 and exceeds 230, the data is classified as “important data”.
[0096] Data source 2 matches rule 2, and because the voltage is 250, which is greater than 230, the data is classified as “normal data”.
[0097] In an embodiment of the present application, matching rules are designed and stored in a database for efficient management and access. These rules not only cover key information such as database name, table name, voltage name, conditions, and classification and grading results, but also are carefully classified according to the characteristics of the power system data and business needs. In order to ensure that the rules can adapt to changing business needs, the hit rate in the rule base is updated regularly. By deeply analyzing the matching of the data, the priority and conditions of the rules can be adjusted in time to improve the accuracy and efficiency of data processing. This dynamic update mechanism enables the system to continuously adapt to changes in power system data; at the same time, storing the matching rules in the database is also conducive to the centralized management and maintenance of the rules, reducing the complexity and maintenance costs of the system.
[0098] It should be noted that by constructing a priority queue based on dynamic priority sorting and using the queue to classify and grade the power system data, the present invention achieves high efficiency and accuracy in data processing. By extracting the source information of the data to be matched and comparing it with the matching rules stored in the priority queue, the classification and grading of the data can be quickly determined; at the same time, the matching rules are stored in the database and can be updated regularly, ensuring flexible adaptation to business needs. This mechanism not only improves the efficiency of data processing, but also enhances the stability and reliability of the system.
[0099] The above is a schematic scheme of a power data matching method of this embodiment. It should be noted that the technical scheme of the power data matching system and the technical scheme of the power data matching method described above belong to the same concept, and the details of the technical scheme of the power data matching system in this embodiment that are not described in detail can all be referred to the description of the technical scheme of the power data matching method described above.
[0100] Example 2
[0101] This embodiment provides a power data matching system, including:
[0102] An acquisition module, used for acquiring power system data;
[0103] A design module, used for designing matching rules and priorities of matching rules according to power system data;
[0104] The comparison module is used to construct a priority queue according to the priority level and classify and grade the power system data using the priority queue.
[0105] The above-mentioned unit modules may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to the above-mentioned modules.
[0106] Example 3
[0107] This embodiment provides a computer device, which may be a terminal, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a power data matching method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0108] This embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements: obtaining power system data; designing matching rules and priorities of matching rules based on the power system data; constructing a priority queue based on the priority, and using the priority queue to classify and grade the power system data.
[0109] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A power data matching method, characterized in that: include: Obtain power system data; Designing matching rules and priorities of the matching rules according to the power system data; A priority queue is constructed according to the priority, and the power system data is classified and graded using the priority queue.
2. The power data matching method according to claim 1, characterized in that: Designing matching rules and priorities of the matching rules includes, Based on the power system data, matching rules and initial priorities of the matching rules are designed, and the initial priorities are dynamically adjusted to obtain priorities of the matching rules.
3. The power data matching method according to claim 1 or 2, characterized in that: Constructing a priority queue according to the priority level includes: Use the priority queue data structure to store the rules and sort them according to the dynamically calculated priorities to obtain the priority sorting results.
4. The power data matching method according to claim 3, characterized in that: Using the priority queue to classify and grade the power system data includes: Extract source information of the data to be matched, compare the source information with the matching rules, and classify and grade according to the comparison results.
5. The power data matching method according to claim 4, characterized in that: Dynamically adjusting the initial priority includes: Calculate the hit rate of the matching rule, expressed as: Among them, Hits i Attempts is the number of successful matches for rule i. i The total number of matching attempts for matching rule i.
6. The power data matching method according to claim 5, characterized in that: Also includes, Combining the initial priority and hit rate, different weights are set to calculate the priority of the matching rule, which is expressed as: Priority i =α×hit rate i +β×initial priority i Among them, α and β are the set weights, and i is the current matching rule.
7. The power data matching method according to claim 6, characterized in that: Extracting source information of the data to be matched, and comparing the source information with the matching rules includes: Take the matching rule with the highest priority from the priority queue; Check whether the database and table to which the data to be matched belongs meet the requirements of the matching rules; check whether the value of the field of the data to be matched meets the rule conditions; If the comparison is successful, the data is processed according to the matching rules; If the comparison fails, continue to take out the next matching rule until the comparison succeeds or the priority queue is empty.
8. A power data matching system, characterized in that: include, An acquisition module, used for acquiring power system data; A design module, used for designing matching rules and priorities of the matching rules according to the power system data; A comparison module is used to construct a priority queue according to the priority, and use the priority queue to classify and grade the power system data.
9. An electronic device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the power data matching method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the power data matching method according to any one of claims 1 to 7.