Determination method and equipment of electric energy metering device, electric energy metering method and electric energy meter
Through the combination of pre-trained large language model and third-party simulation software, the automatic selection of power metering devices is solved, and the accuracy and efficiency of power metering is improved.
Patent Information
- Application Number
- CN202510432526.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-08-08
AI Technical Summary
In the prior art, the selection of electrical energy metering devices mainly relies on manual experience, resulting in low selection accuracy and affecting the accuracy of electrical energy metering.
The pre-trained large language model is used to process the prompt text related to the electrical energy metering scenario, generate matching metering devices and electrical energy metering virtual circuits, and verify it through third-party simulation software to output the target metering devices.
It improves the efficiency and accuracy of metering device selection to ensure the accuracy of power metering.
Smart Images

Figure CN120446855A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electric energy metering, and in particular to a method and device for determining an electric energy metering device, an electric energy metering method, and an electric energy meter. Background Art
[0002] With the increasing demand for power quality monitoring, performance bottlenecks in high-precision energy metering systems are gradually emerging. The performance of energy metering systems depends on the selection of energy metering devices. Therefore, the selection of energy metering devices is crucial. Related technologies rely primarily on R&D engineers to match appropriate metering devices from a device database based on specific energy metering scenarios. This approach suffers from low accuracy of the selected metering devices, which in turn affects the accuracy of the measured energy. Summary of the Invention
[0003] The main purpose of this application is to provide a method and device for determining an electric energy metering device, an electric energy metering method and an electric energy meter, aiming to solve the technical problem that the selected electric energy metering device is inaccurate, resulting in low accuracy of the measured electric energy.
[0004] To achieve the above objectives, the present application proposes a method for determining an electric energy metering device, comprising:
[0005] receiving a first prompt text related to a current electric energy metering scenario;
[0006] The first prompt text is processed using a pre-trained large language model to obtain a metering device that matches the electric energy metering scenario and an electric energy metering virtual circuit constructed based on the metering device;
[0007] Calling third-party simulation software to run the energy metering virtual circuit to obtain simulated electric energy, and receiving the electric energy processed by the real energy metering circuit;
[0008] If the electric energy processed by the real electric energy metering circuit is consistent with the simulated electric energy, the corresponding target metering device is output.
[0009] In one embodiment, the pre-trained large language model includes: a first pre-trained large language model and a second pre-trained large language model. The pre-trained large language model is used to process the first prompt text to obtain a metering device that matches the electric energy metering scenario. The electric energy metering virtual circuit constructed based on the metering device includes:
[0010] Processing the first prompt text using a first pre-trained large language model to obtain a metering device matching the electric energy metering scenario, and outputting the metering device;
[0011] Constructing a second prompt text according to the device information of the metering device and the requirements for establishing the electric energy metering circuit;
[0012] The second prompt text is processed using a second pre-trained large language model to output an electric energy metering virtual circuit.
[0013] In one embodiment, the first prompt text includes: an electric energy metering scenario requirement description information and a first sample example, wherein the first sample example is used to help a first pre-trained large language model understand the electric energy metering scenario requirement description information and the data format expected to be output by the metering device; the first prompt text is processed using the first pre-trained large language model to obtain a metering device that matches the electric energy metering scenario, and the output of the metering device includes:
[0014] Parsing the first prompt text using a first pre-trained large language model to obtain a first text feature vector of the first prompt text;
[0015] Calculating a similarity between the first text feature vector and a preset text feature vector in a first preset database to obtain a first similar text feature vector, wherein the first preset database stores a correspondence between preset text feature vectors corresponding to different electric energy metering scenario requirements and preset metering devices;
[0016] Determine the preset metering device associated with the first similar text feature vector as a metering device matching the electric energy metering scenario;
[0017] According to a first sample example, a first data format output by a metering device is determined, and the metering device is output based on the first data format.
[0018] In one embodiment, the second prompt text includes: device information of the metering device, description information of the requirements for setting up the electric energy metering circuit, and a second sample example, wherein the second sample example is used to help the second pre-trained large language model understand the description information of the requirements for setting up the electric energy metering circuit and the expected output format of the electric energy metering virtual circuit; the second prompt text is processed using the second pre-trained large language model, and the output of the electric energy metering virtual circuit includes:
[0019] Parsing the second prompt text using a second pre-trained large language model to obtain a second text feature vector of the second prompt text;
[0020] Calculating similarity between the second text feature vector and a preset text feature vector in a second preset database to obtain a second similar text feature vector, wherein the second preset database stores correspondences between preset text feature vectors corresponding to different electric energy metering circuit construction requirements and preset electric energy metering virtual circuits;
[0021] Determine the preset electric energy metering virtual circuit associated with the second similar text feature vector as an electric energy metering virtual circuit that matches the electric energy metering circuit construction requirement;
[0022] According to the second sample example, a second data format output by the electric energy metering virtual circuit is determined, and the electric energy metering virtual circuit is output based on the second data format.
[0023] In one embodiment, after calling third-party simulation software to run a virtual circuit for electric energy metering to obtain simulated electric energy and receiving electric energy processed by a real circuit for electric energy metering, the method further includes:
[0024] If the electric energy obtained by processing the actual electric energy metering circuit does not match the simulated electric energy, the pre-trained large language model is fine-tuned to obtain a fine-tuned large language model;
[0025] The fine-tuned large language model is used to process the first prompt text to obtain a metering device that matches the electric energy metering scenario and an electric energy metering virtual circuit constructed based on the metering device;
[0026] Calling third-party simulation software to run the energy metering virtual circuit to obtain simulated electric energy, and receiving the electric energy processed by the real energy metering circuit;
[0027] If the electric energy processed by the real electric energy metering circuit is consistent with the simulated electric energy, the corresponding target metering device is output.
[0028] In addition, to achieve the above objectives, the present application also proposes an electric energy metering method applied to an electric energy meter, comprising:
[0029] Get the current power grid simulation signal;
[0030] Performing signal conversion and analog-to-digital conversion on the grid analog signal using a target electric energy metering real circuit, wherein the target electric energy metering real circuit is constructed based on a target metering device, and the target metering device is obtained by processing a first prompt text related to the current electric energy metering scenario using a pre-trained large language model;
[0031] The grid signal after analog-to-digital conversion is subjected to DC removal processing, phase shift processing, active power calculation and time integration calculation in sequence to obtain the measured electric energy.
[0032] In one embodiment, the grid analog signal includes a three-phase grid analog signal, and the target metering device includes a transformer and an analog-to-digital converter; performing signal conversion and analog-to-digital conversion on the grid analog signal through the target electric energy metering real circuit includes:
[0033] The analog signal of each phase of the power grid is converted by a mutual inductor to obtain a target signal of each phase processed by an analog-to-digital converter suitable for the real circuit of the target electric energy metering;
[0034] Performing analog-to-digital conversion on each phase target signal through an analog-to-digital converter to obtain an analog-to-digital converted power grid signal for each phase;
[0035] The grid signal after analog-to-digital conversion is subjected to DC removal, phase shifting, active power calculation, and time integration calculation in sequence to obtain the measured electric energy including:
[0036] The power grid signal of each phase after analog-to-digital conversion is subjected to DC removal processing, phase shift processing, active power calculation and time integration calculation in sequence to obtain the measured electric energy.
[0037] In one embodiment, the target metering device includes a signal processor; performing DC removal processing, phase shift processing, active power calculation, and time integration calculation on each phase grid signal after analog-to-digital conversion, and obtaining the measured electric energy includes:
[0038] The signal processor performs DC removal, phase shifting and active power calculation on each phase grid signal after analog-to-digital conversion to obtain the active power corresponding to each phase grid signal;
[0039] The total active power is obtained according to the accumulated value of the active power corresponding to each phase grid signal;
[0040] The total active power is calculated by time integration to obtain the measured electric energy.
[0041] In addition, to achieve the above-mentioned purpose, the present application also proposes a device for determining an electric energy metering device, comprising: a first memory, a processor, and a computer program stored in the first memory and executable on the processor, the computer program being configured to implement the steps of the above-mentioned method for determining an electric energy metering device.
[0042] In addition, to achieve the above objectives, the present application also proposes an electric energy metering device, comprising: a second memory, a processor, and a computer program stored in the second memory and executable on the processor, wherein the computer program is configured to implement the steps of the electric energy metering method as described above.
[0043] The present application receives a first prompt text related to the current electric energy metering scenario; then uses a pre-trained large language model to process the first prompt text to obtain a metering device that matches the electric energy metering scenario, and obtains an electric energy metering virtual circuit built based on the metering device; then calls a third-party simulation software to run the electric energy metering virtual circuit to obtain simulated electric energy, and receives the electric energy obtained by processing the real electric energy metering circuit; if the electric energy obtained by processing the real electric energy metering circuit is consistent with the simulated electric energy, the corresponding target metering device is output. Compared with manual selection of metering devices, the present application can use a pre-trained large language model to assist in the preliminary selection of metering devices and the construction of electric energy metering virtual circuits for different electric energy metering scenarios, thereby improving the efficiency and accuracy of metering device selection. On this basis, the simulated electric energy obtained by running the electric energy metering virtual circuit by the third-party simulation software is compared with the electric energy obtained by processing the real electric energy metering circuit, and the metering device obtained by the pre-trained large language model analysis is verified according to the comparison results, thereby improving the accuracy of the obtained metering device, and then improving the accuracy of the electric energy obtained by subsequent measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0046] Figure 1 A flowchart of an embodiment of a method for determining an electric energy metering device of the present application is provided;
[0047] Figure 2 A detailed flowchart of step S20 of the method for determining an electric energy metering device of the present application is provided;
[0048] Figure 3 A flowchart of another embodiment of the method for determining an electric energy metering device of the present application is provided;
[0049] Figure 4 A flowchart illustrating an embodiment of an electric energy metering method of the present application is provided.
[0050] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.
[0052] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0053] As power systems become increasingly complex and intelligent, power quality monitoring has become a crucial component in ensuring stable grid operation and efficient management. Power quality directly impacts the efficiency and service life of power equipment, as well as the user experience. Consequently, the need for high-precision metering and monitoring of electrical energy is becoming increasingly urgent.
[0054] As the core equipment for power quality monitoring, the performance of high-precision energy metering systems directly determines the accuracy and reliability of monitoring results. However, with the increasing diversification and volatility of power loads, as well as users' increasing demands for power quality, traditional energy metering systems are gradually experiencing performance bottlenecks and are unable to meet the growing monitoring needs.
[0055] In-depth analysis reveals that the performance of an energy metering system depends largely on the selection of energy metering devices. As the fundamental building block of an energy metering system, the accuracy, stability, and response speed of these devices directly determine the accuracy and reliability of the entire system. Therefore, the selection of energy metering devices is crucial when designing and building a high-precision energy metering system.
[0056] However, in related technical fields, the selection of energy metering devices relies primarily on the experience and judgment of R&D engineers. They must manually screen and match appropriate devices from a vast device database based on specific energy metering scenarios. This approach is not only inefficient but also susceptible to human error, leading to significant uncertainty in the accuracy and applicability of the selected devices. Improper selection directly impacts the overall performance of the energy metering system, reducing the accuracy of measured energy and posing potential risks to the stable operation and efficient management of the power system.
[0057] To address the above issues, the present application proposes a method for determining an energy metering device. The main technical solution includes: receiving a first prompt text related to the current energy metering scenario; using a pre-trained large language model to process the first prompt text to obtain a metering device that matches the energy metering scenario, and an energy metering virtual circuit constructed based on the metering device; calling third-party simulation software to run the energy metering virtual circuit to obtain simulated electric energy, and receiving the electric energy processed by the real energy metering circuit; if the electric energy processed by the real energy metering circuit matches the simulated electric energy, outputting the corresponding target metering device. Compared with manual selection of metering devices, the present application can use a pre-trained large language model to assist in preliminary selection of metering devices and construction of energy metering virtual circuits for different energy metering scenarios, thereby improving the efficiency and accuracy of metering device selection. On this basis, the simulated electric energy obtained by running the energy metering virtual circuit by the third-party simulation software is compared with the electric energy processed by the real energy metering circuit, and the metering device analyzed by the pre-trained large language model is verified based on the comparison results, thereby improving the accuracy of the obtained metering device and further improving the accuracy of the electric energy obtained by subsequent measurement.
[0058] Based on this, the embodiment of the present application provides a method for determining an electric energy metering device, referring to Figure 1 , Figure 1 This is a flow chart of an embodiment of a method for determining an electric energy metering device of the present application.
[0059] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication, and program execution capabilities, such as a tablet computer, personal computer, or mobile phone, or a device for determining an electric energy meter capable of performing the aforementioned functions. This embodiment and the following embodiments will be described below using a device for determining an electric energy meter as an example.
[0060] In this embodiment, the electric energy metering method includes steps S10 to S40:
[0061] Step S10: receiving a first prompt text related to the current electric energy metering scenario.
[0062] Among them, the electricity metering scenario refers to specific application scenarios involving electricity measurement, recording, and calculation, such as household electricity metering and industrial electricity metering. It clarifies the specific environment and requirements of electricity metering, and provides a basis for the subsequent selection of appropriate metering devices and the construction of virtual circuits.
[0063] Among them, the first prompt text is a descriptive text related to the current electricity metering scenario, which contains information such as scenario characteristics and electricity metering scenario requirement description information. It provides input for the pre-trained large language model and guides the pre-trained large language model to generate metering devices and electricity metering virtual circuits that match the electricity metering scenario.
[0064] In a feasible implementation, the first prompt text is obtained through user input or automatic detection. The user can enter text describing the energy metering scenario on the interface, or the system can automatically detect scenario features through sensors and other devices and generate the first prompt text.
[0065] In another feasible implementation, natural language processing technology is used to extract the first prompt text from existing design documents. The system can analyze the document containing the power metering information and extract key information to form the first prompt text.
[0066] Specifically, the following describes how to extract the first prompt text from existing design documents using natural language processing technology: First, the design document is converted into a computer-processable format, such as a text file (.txt) or PDF-to-text. Then, irrelevant information, such as advertisements, comments, headers, and footers, is removed from the design document. Spelling, grammatical, and punctuation errors are corrected. The design document content is standardized to a consistent encoding format to avoid garbled text. Key information prompting then involves: using named entity recognition technology to identify key entities in the document, such as the name, model, and parameters of equipment related to energy metering, annotating the design document to extract information related to energy metering. Using algorithms such as TF-IDF and TextRank, keywords are extracted from the design document. These keywords reflect the document's theme and core content, contributing to the formation of the first prompt text. Finally, the design document undergoes syntactic analysis to identify sentence structures, such as the subject, predicate, and object. Using semantic understanding technology, the logical relationships between sentences are analyzed to extract key information related to energy metering. Finally, the extracted key information is integrated to form a structured information set, removing duplicate information to ensure accuracy and uniqueness. Natural language generation technology is then used to convert the structured information set into natural language text. The text is sorted and reorganized based on the logical relationships and importance of the information, forming a clear and coherent first prompt text. This method can efficiently extract key information and provide strong support for subsequent energy metering analysis and application.
[0067] Step S20: Process the first prompt text using a pre-trained large language model to obtain a metering device that matches the electric energy metering scenario and an electric energy metering virtual circuit constructed based on the metering device.
[0068] Among them, the pre-trained large language model is a deep learning model trained with a large amount of text data. It can understand and generate natural language text. It is used to parse the first prompt text, understand the electricity metering requirements based on the context, and generate corresponding metering devices and electricity metering virtual circuits.
[0069] Among them, metering devices are used to measure devices related to electric energy, such as current transformers, voltage transformers, analog-to-digital converters, signal processors, etc. They are used to actually measure electric energy in the electric energy metering system and are the basis for building an electric energy metering virtual circuit.
[0070] Among them, the electric energy metering virtual circuit is an analog circuit built based on the metering device, which is used to simulate the electric energy metering process in a computer environment. It is used to simulate electric energy metering without actually connecting the physical circuit and verify the applicability and accuracy of the metering device.
[0071] In one feasible implementation, a GPT model or other pre-trained language model is used to process the first prompt text. The pre-trained language model generates a list of metering devices that match the energy metering scenario based on the first prompt text and constructs a corresponding energy metering virtual circuit.
[0072] Specifically, the first prompt text containing the electric energy metering information is first input into the GPT model or other pre-trained language model. Then, the first prompt text is parsed to obtain the electric energy metering information, including: the pre-trained large language model parses the input first prompt text, identifies keywords, phrases and sentences related to electric energy metering, and uses the semantic understanding ability of the pre-trained large language model to analyze the electric energy metering scenarios, requirements and conditions described in the first prompt text. Then, based on the parsed electric energy metering information, the pre-trained large language model matches the corresponding metering devices in the internal knowledge base or pre-trained database. These metering devices may include ammeters, voltmeters, power meters, electric energy meters, etc., depending on the metering requirements described in the text. The matched metering devices are sorted according to the order or importance mentioned in the text to generate a list of metering devices. The list may contain detailed information such as the name, model, specifications, accuracy, etc. of the device. Next, the virtual circuit for energy metering is constructed. Based on the generated list of metering components, appropriate circuit components are selected to build the virtual circuit. These components may include power supplies, resistors, capacitors, inductors, and the metering components themselves. Using circuit design software or simulation tools, the selected circuit components are connected according to the requirements and principles of energy metering. When laying out the circuit, the signal flow, component arrangement, and wiring are considered to ensure circuit accuracy and stability. Finally, the constructed virtual circuit is simulated and tested using circuit simulation software. The simulation results verify the circuit's correctness and performance, ensuring that the metering device can accurately measure energy.
[0073] In another feasible implementation, the domain knowledge base and the rule engine are combined to generate the energy metering virtual circuit. The system uses the rule engine to construct the energy metering virtual circuit that meets the requirements based on the first prompt text and the information in the domain knowledge base.
[0074] Specifically, the user enters a first prompt text containing energy metering information. Natural language processing techniques, such as GPT models or other pre-trained language models, are used to parse the text and extract key information, such as meter type, meter accuracy, rated voltage, and rated current. Next, a domain knowledge base is constructed. This should contain relevant knowledge in the energy metering domain, including but not limited to: detailed information about metering devices, such as model, specifications, accuracy, and applicable scope; circuit principles and design specifications, such as circuit topology, component selection principles, and signal processing methods; and common problems and solutions, such as metering error analysis and troubleshooting methods. This knowledge is represented using structured methods, such as ontologies, frameworks, and rules, to facilitate reasoning and matching within the rule engine. Next, the rule engine is designed. Based on the information in the domain knowledge base and design requirements, a series of rules are defined. These rules may include: selecting appropriate metering devices based on meter type and accuracy; determining circuit component parameters based on rated voltage and current; and connecting circuit components according to circuit principles and design specifications to form a complete energy metering circuit. A reasoning mechanism is then designed to enable the rule engine to automatically construct a compliant energy metering virtual circuit based on the parsed key information and defined rules. Finally, circuit design software or simulation tools are used to establish a virtual circuit for electric energy metering based on the results inferred by the rule engine; simulation tests are performed on the established virtual circuit for electric energy metering to verify the correctness and performance of the virtual circuit for electric energy metering.
[0075] Step S30: calling third-party simulation software to run the energy metering virtual circuit to obtain simulated energy, and receiving the energy processed by the energy metering real circuit.
[0076] Among them, the third-party simulation software is a software tool used to run the energy metering virtual circuit and simulate energy metering, which is used to perform energy metering virtual circuit simulation, output simulated electric energy, and compare it with real electric energy. For example, the third-party simulation software can be simulation software such as MATLAB / Simulink.
[0077] Among them, simulated electric energy is electric energy data obtained through virtual circuit simulation, which serves as a benchmark for comparison with real electric energy and is used to evaluate the accuracy of virtual circuits and metering devices.
[0078] Among them, the real circuit for electric energy measurement is a real physical circuit built based on the metering device, which is used to build an electric energy metering process in a real environment and obtain the electric energy processed by the real circuit for electric energy measurement.
[0079] The energy measured in the actual energy metering circuit is processed by the actual energy metering circuit. This is used as the actual value and compared with the simulated energy to verify the accuracy of the simulation results. Due to the influence of the metering environment, the simulated energy obtained by the energy metering virtual circuit may differ from the energy measured in the actual energy metering circuit.
[0080] In a feasible implementation, simulation software such as MATLAB / Simulink is used to run the electric energy metering virtual circuit. These simulation software simulates the electric energy metering process and outputs simulated electric energy based on the parameters and model of the electric energy metering virtual circuit.
[0081] Specifically, based on the actual energy metering requirements, determine the circuit parameters, such as voltage, current, and power factor. Select an appropriate circuit model, such as a three-phase circuit or a single-phase circuit, and determine the metering devices in the circuit. Open MATLAB and start Simulink. In the Simulink library browser, find the required circuit component modules and drag them into the model window. Connect the metering devices according to the circuit model to form a complete virtual energy metering circuit. Double-click each device in the virtual energy metering circuit to open the parameter setting dialog box. Set the parameters of each device according to actual requirements, such as the voltage level of the voltage source, the current value of the current source, and the impedance of the load. In the Simulink model configuration parameter dialog box, set the simulation start and end times. Select the appropriate solver type and set parameters such as the simulation step size. Then, in the Simulink model interface, click the Run button to start the simulation. Use the virtual oscilloscope module or other measurement tools to monitor the changes in voltage, current, and other signals in the circuit in real time. The simulation data can be exported to the MATLAB workspace for subsequent data processing and analysis. Finally, based on the voltage and current data obtained during the simulation process, the simulated electric energy is calculated using the electric energy calculation formula, such as P = UIcosφ, where P is the active power, U is the effective value of voltage, I is the effective value of current, and cosφ is the power factor.
[0082] In another feasible implementation, a metering device is used to build an electric energy metering real circuit, and the electric energy data processed by the electric energy metering real circuit is acquired through a data acquisition system.
[0083] Step S40 : If the electric energy obtained by the actual electric energy metering circuit is consistent with the simulated electric energy, the corresponding target metering device is output.
[0084] Among them, the target metering device refers to the metering device that has been verified and determined to be suitable for the current electricity metering scenario. As a component of the actual electricity metering system, it ensures the accuracy and reliability of the metering results.
[0085] In a feasible implementation, the values or change trends of the simulated electric energy and the real electric energy are compared. If the two values match or the error is within an acceptable range, the corresponding metering device is output as the target metering device.
[0086] Specifically, a virtual energy metering circuit is run using simulation software such as MATLAB / Simulink. The simulated energy generated during the simulation is recorded, while the energy processed by the actual energy metering circuit is also acquired. The simulated energy and the energy processed by the actual energy metering circuit are then preprocessed, including noise removal and data smoothing, to improve data accuracy and comparability. The simulated and actual energy values are then directly compared to calculate their differences or errors. Alternatively, the trends of the simulated and actual energy values over time or other variables are analyzed to determine whether they are consistent or similar. Then, based on the application field and actual needs, a reasonable error range is determined; the error between the simulated electric energy and the real electric energy is calculated and compared with the determined error range; if the error is within the acceptable range, the simulated electric energy is considered to be consistent with the real electric energy; if the error exceeds the acceptable range, further analysis of the reasons is required, which may include the accuracy of the simulation model, the rationality of the parameter settings, etc.; finally, based on the comparison results of the simulated electric energy and the real electric energy, the metering device with the smallest error or the best performance is selected as the target metering device; the selected target metering device is further verified and confirmed to ensure its accuracy and reliability in actual applications.
[0087] In another feasible implementation, a statistical method is used to evaluate the simulation results, calculate indicators such as the error rate and correlation coefficient of the simulated electric energy and the real electric energy, and determine the target metering device based on the evaluation results.
[0088] Specifically, third-party simulation software is used to run a virtual energy metering circuit, recording simulated energy data while simultaneously acquiring energy processed by the actual energy metering circuit. The collected data is then cleaned to remove outliers or invalid data, and the data is standardized to ensure comparability across different sources. The error rate and correlation coefficient are then calculated. The error rate measures the degree of discrepancy between simulated and real energy. The calculation formula is: Error rate = |Simulated energy - Real energy| / Real energy * 100%. The error rate is calculated for each time point or measurement point, and statistics such as the average and standard deviation of the overall error rate are calculated. The correlation coefficient measures the degree of linear correlation between simulated and real energy. The calculation formula is typically the Pearson correlation coefficient, with values ranging from -1 to 1. A positive value indicates positive correlation, a negative value indicates negative correlation, and a value close to 0 indicates no correlation. In practical applications, a correlation coefficient close to 1 is typically expected, indicating a high degree of consistency between the simulated and real energy results. Finally, based on the application field and actual needs, set the acceptable range of the error rate and correlation coefficient. For example, for certain high-precision applications, the error rate may be required to be less than 5% and the correlation coefficient may be greater than 0.95. The calculated error rate and correlation coefficient are compared with the set evaluation criteria. If the error rate is lower than the acceptable range and the correlation coefficient is higher than the acceptable range, the simulation results are considered accurate and reliable. Among the simulation results of multiple metrology devices, the metrology device with the lowest error rate and the highest correlation coefficient is selected as the target metrology device. If the simulation results of multiple devices are similar, other factors such as cost, reliability, and maintainability are considered for a comprehensive evaluation.
[0089] In this embodiment, a pre-trained large language model can be used to assist in the initial selection of metering devices and the construction of virtual energy metering circuits for different energy metering scenarios, thereby improving the efficiency and accuracy of metering device selection. Furthermore, the simulated energy obtained by running the virtual energy metering circuit using third-party simulation software is compared with the energy obtained by processing the actual energy metering circuit. Based on the comparison results, the metering devices analyzed by the pre-trained large language model are verified, thereby improving the accuracy of the resulting metering devices and, in turn, the accuracy of subsequent energy measurements.
[0090] Reference Figure 2 In one feasible implementation, the pre-trained large language model includes: a first pre-trained large language model and a second pre-trained large language model; the pre-trained large language model is used to process the first prompt text to obtain a metering device that matches the electric energy metering scenario; and the electric energy metering virtual circuit constructed based on the metering device includes:
[0091] Step S21 : Process the first prompt text using a first pre-trained large language model to obtain a metering device that matches the electric energy metering scenario, and output the metering device.
[0092] Among them, the first pre-trained large language model is a deep learning model that has been pre-trained on large-scale text data and can understand and generate natural language text. In the electricity metering scenario, it can be used to process text information related to electricity metering, thereby recommending or selecting suitable metering devices.
[0093] In one feasible implementation, the first prompt text is input into the GPT model, and a recommended list of metering devices matching the electric energy metering scenario is generated based on the first prompt text. This can quickly and accurately recommend metering devices suitable for the electric energy metering scenario, reducing the time cost of manual screening.
[0094] Specifically, the specific requirements of the energy metering scenario must be clarified, including the energy type to be measured (e.g., active energy, reactive energy), measurement range, accuracy requirements, and operating environment conditions (e.g., temperature, humidity, and electromagnetic interference). Based on these requirements, a descriptive text, the first prompt text, is constructed. This text should clearly and accurately reflect the characteristics and requirements of the energy metering scenario. Next, the GPT model parameters, such as the maximum generation length and temperature parameters, are configured according to the task requirements. The constructed first prompt text is then input into the GPT model. Based on the input first prompt text, the GPT model generates one or more paragraphs of text relevant to the energy metering scenario. This text may include descriptions, recommendations, or suggestions for metering devices. Device-related information, such as device name, model, manufacturer, and performance parameters, is extracted from the generated text to construct a recommendation list. Based on this extracted information, a list of recommended metering devices is constructed. Each entry in the list should contain detailed device information to facilitate user selection and comparison. It should be noted that if the generated recommendation list contains duplicate entries, duplicate removal is required. In addition, the list can be sorted according to certain criteria such as accuracy, cost, reliability, etc., so that users can more easily find the most suitable metering device.
[0095] In another possible implementation, the BERT model is fine-tuned to enable it to recognize and understand key information in energy metering scenarios. Then, a first prompt text is input, and the model outputs the metering device that best matches the text content. By fine-tuning the BERT model, the model's understanding ability in specific scenarios is improved, enabling more accurate metering device recommendations.
[0096] Specifically, first, collect text data related to energy metering scenarios. This data can come from academic papers, technical documents, product manuals, and other sources. Ensure that the dataset contains a rich set of information, including energy metering terminology, device names, and application scenarios. Label the collected data, which typically involves assigning labels to key information in the text, such as the device name, model, and performance parameters. The quality of the labeled data directly impacts the effectiveness of model fine-tuning. The labeled data is divided into a training set and a validation set. The training set is used to train the model, while the validation set is used to evaluate model performance. Next, select a suitable BERT model from the available BERT models. Load the selected pre-trained BERT model and define the task, which is either text classification or entity recognition, aiming to identify and understand key information in energy metering scenarios. Based on the pre-trained model, add task-related layers, such as classification and entity recognition layers, and define a loss function and optimizer. Train the fine-tuned model using the training set data. During training, the model learns to identify and understand key information in energy metering scenarios. Evaluate the model's performance using the validation set data. Based on the evaluation results, adjust the model's parameters and structure to improve performance. In actual application, the first prompt text is preprocessed, such as word segmentation and stop word removal, to make it match the format of the fine-tuned model input; the preprocessed prompt text is input into the fine-tuned BERT model; the model will process the first prompt text and output key information related to the electricity metering scenario, which may include the name, model, performance parameters, etc. of the metering device; based on the extracted key information, the most suitable metering device is searched and matched in a predefined metering device library or database; the matching metering device is output as a recommendation result; this can be a list of one or more metering devices, each device containing detailed information and the reason for the recommendation.
[0097] In another feasible embodiment, the first prompt text includes: a description of the energy metering scenario requirements and a first sample example, the first sample example being used to help a first pre-trained large language model understand the energy metering scenario requirements and the desired data format of the metering device output. Processing the first prompt text using the first pre-trained large language model to obtain a metering device that matches the energy metering scenario and outputting the metering device includes: parsing the first prompt text using the first pre-trained large language model to obtain a first text feature vector of the first prompt text; calculating similarity between the first text feature vector and preset text feature vectors in a first preset database to obtain a first similar text feature vector, wherein the first preset database stores correspondences between preset text feature vectors corresponding to different energy metering scenario requirements and preset metering devices; determining the preset metering device associated with the first similar text feature vector as the metering device that matches the energy metering scenario; determining a first data format to be output by the metering device based on the first sample example, and outputting the metering device based on the first data format. By designing the first sample example, the metering device output by the model is standardized to improve the readability and uniformity of the output result. The similarity calculation may be performed by using cosine similarity, or by calculating the Euclidean distance to obtain the similarity, or by using other similarity calculation methods.
[0098] Step S22: construct a second prompt text according to the device information of the metering device and the requirements for establishing the electric energy metering circuit.
[0099] The device information of the measuring device includes key information such as device model, specifications, and performance.
[0100] Among them, the second prompt text is a text description constructed based on the device information of the metering device and the requirements for building the electric energy metering circuit. It contains the key information and instructions required to build the electric energy metering virtual circuit, and is used to guide and prompt the second pre-trained large language model to determine the electric energy metering virtual circuit.
[0101] In one feasible implementation, key information such as the model, specifications, and performance of the aforementioned metering devices is extracted; specific requirements for circuit construction are determined based on factors such as application scenarios, budget, and technical feasibility; and the device information and circuit construction requirements are integrated into a descriptive text, namely the second prompt text, which contains all key information and instructions required for circuit construction.
[0102] In another feasible implementation, a text template containing placeholders is designed to quickly generate the second prompt text. The device information and circuit construction requirements of the metering device are filled into the placeholder positions in the template. The filled template becomes the second prompt text for processing in subsequent steps.
[0103] Step S23: Process the second prompt text using the second pre-trained large language model and output an electric energy metering virtual circuit.
[0104] Among them, the second pre-trained large language model is similar to the first pre-trained large language model. It is also a pre-trained deep learning model, but here it is specifically used to process prompt text related to the construction of the electricity metering circuit and generate the corresponding electricity metering virtual circuit.
[0105] In a feasible implementation, a model with code generation capability is selected, and the second prompt text is input into the model. The model generates the code or model file of the electric energy metering virtual circuit according to the text content, and can automatically generate the electric energy metering virtual circuit that meets the requirements, thereby reducing the time cost of manually building the circuit and improving efficiency.
[0106] Specifically, from available models with code generation capabilities, select a model suitable for the task at hand, taking into account factors such as model performance, computing resource requirements, and code generation quality. The selected model is loaded and ensured to be operational. The content of the second prompt text is clearly constructed based on the specific requirements of the energy metering virtual circuit, including circuit functionality, performance parameters, and component selection. Based on these clear requirements, a descriptive text, the second prompt text, is written. This text should contain all key information and instructions required to build the circuit, such as a functional description of the circuit, component connections, and signal flow. The second prompt text is preprocessed as necessary, such as by tokenization, stop word removal, and standardized terminology, to ensure the model can accurately understand the text content. The preprocessed second prompt text is then input into the model with code generation capabilities. Based on the input second prompt text, the model automatically generates code or model files related to the energy metering virtual circuit. This may include circuit diagram description languages such as VHDL or Verilog, simulation code such as MATLAB / Simulink scripts, or scripts or project files from specialized circuit design software such as Altium Designer or Eagle. These files are used to generate the energy metering virtual circuit. For the generated virtual energy metering circuit, simulation or actual circuit construction can be used to verify whether the generated code meets the functional requirements of the virtual energy metering circuit. Performance parameters such as accuracy, stability, and power consumption can also be evaluated. Finally, the optimized circuit code is deployed on an actual hardware platform for further testing and verification.
[0107] In another feasible implementation, a model based on the Transformer architecture is fine-tuned so that the model can understand and process textual information related to the construction of the electric energy metering circuit. The second prompt text is input into the fine-tuned model, and the model outputs a graphical representation or simulation model of the electric energy metering virtual circuit. By fine-tuning the model, its performance on specific tasks is improved, and the electric energy metering virtual circuit that meets the requirements can be generated more accurately.
[0108] In another feasible embodiment, the second prompt text includes: device information of the metering device, description information of the requirements for setting up the electric energy metering circuit, and a second sample example, wherein the second sample example is used to help the second pre-trained large language model understand the description information of the requirements for setting up the electric energy metering circuit, and the expected output format of the electric energy metering virtual circuit; the second prompt text is processed by the second pre-trained large language model, and outputting the electric energy metering virtual circuit includes: parsing the second prompt text by the second pre-trained large language model to obtain a second text feature vector of the second prompt text; performing similarity calculation on the second text feature vector and a preset text feature vector in a second preset database to obtain a second similar text feature vector, wherein the second preset database stores the correspondence between the preset text feature vectors corresponding to different electric energy metering circuit setting requirements and the preset electric energy metering virtual circuit; the preset electric energy metering virtual circuit associated with the second similar text feature vector is determined as the electric energy metering virtual circuit that matches the electric energy metering circuit setting requirement; according to the second sample example, a second data format output by the electric energy metering virtual circuit is determined, and the electric energy metering virtual circuit is output based on the second data format. By designing a second sample example, the electric energy metering virtual circuit output by the model is standardized to improve the readability of the electric energy metering virtual circuit. The similarity calculation mentioned above can be a cosine similarity measurement, or can be similarity obtained by calculating the Euclidean distance, or can be other similarity calculation methods.
[0109] In this embodiment, through the processing of the pre-trained large language model, suitable metering devices can be automatically recommended and a virtual circuit for energy metering can be generated, reducing manual intervention and improving efficiency. By constructing a second prompt text and adopting different large language model processing schemes, the circuit construction scheme and details can be flexibly adjusted according to actual needs.
[0110] Based on the above embodiment of the present application, in another embodiment of the present application, the same or similar contents as the above embodiment can be referred to the above introduction, and no further details will be given later. Figure 3 , calling third-party simulation software to run the energy metering virtual circuit to obtain simulated electric energy, and, after receiving the electric energy processed by the energy metering real circuit, also including:
[0111] In step S50 , if the electric energy obtained by processing the real electric energy metering circuit does not match the simulated electric energy, the pre-trained large language model is fine-tuned to obtain a fine-tuned large language model.
[0112] In one feasible implementation, an Adapter structure can be designed and embedded within the Transformer structure. During training, the parameters of the original pre-trained model are fixed, and only the newly added Adapter structure is fine-tuned. This method can reduce the introduction of additional parameters while ensuring efficient training.
[0113] Specifically, the Adapter structure usually contains two main parts: a downsampling layer and an upsampling layer, which may contain a nonlinear activation function in the middle. These layers are usually implemented by fully connected layers. Among them, the downsampling layer maps the input feature vector to a lower-dimensional space to reduce the amount of calculation and avoid overfitting; the nonlinear activation function increases the nonlinear expression ability of the model, and commonly used ones are ReLU, GELU, etc.; the upsampling layer maps the downsampled feature vector back to the original dimension to match the input / output dimensions of other layers in the Transformer model. The Adapter structure is embedded after each Transformer layer of the Transformer model, which usually means inserting the Adapter after each multi-head attention and feedforward network; the Adapter structure is added after each relevant layer of the Transformer model to ensure that the input / output dimensions of the Adapter structure match the input / output dimensions of the Transformer layer. During the training process, all parameters of the pre-trained Transformer model are fixed. This can be achieved by not updating the gradients of these parameters during training; only training the parameters of the Adapter structure while keeping the parameters of the pre-trained model unchanged, which can be achieved by only updating the gradients of the Adapter structure during training; usually using small random values to initialize the parameters of the Adapter structure; setting optimizers such as Adam, SGD, etc. for the Adapter structure and specifying hyperparameters such as the learning rate; during training, only calculating and updating the gradients of the Adapter structure, not the gradients of the pre-trained model. Use the training dataset to train the model and the validation dataset to evaluate the model; during training, you can monitor changes in loss functions such as cross-entropy loss and the performance of the model on the validation dataset, such as accuracy and F1 score; if the validation performance does not improve within multiple consecutive epochs, stop training to avoid overfitting; learning rate adjustment: adjust the learning rate according to changes in validation performance, such as using learning rate decay or a learning rate scheduler; finally, after training is completed, deploy the fine-tuned Adapter structure together with the pre-trained model to the actual application. During inference, only use the fine-tuned Adapter structure and the fixed pre-trained model for prediction.
[0114] Another feasible implementation indirectly trains some dense layers in the neural network by optimizing the rank decomposition matrix of the dense layers during the adaptation process, while keeping the pre-trained weights unchanged. A bypass is added to the original pre-trained language model, performing a dimensionality reduction and then dimensionality increase operation to simulate the intrinsic rank. During training, the intrinsic rank parameters are fixed, and only the reduced-dimensional matrix A and the increased-dimensional matrix B are trained. Compared with other fine-tuning methods, increasing the number of parameters does not lead to a performance degradation, and the performance is equal to or even better than that of full-parameter fine-tuning. Based on the inherent low-rank characteristics of large models, this method adds a bypass matrix to simulate full-parameter fine-tuning, which can transform various large models into specialized models in different fields through lightweight fine-tuning.
[0115] Step S60 : Processing the first prompt text using the fine-tuned large language model to obtain a metering device that matches the electric energy metering scenario and an electric energy metering virtual circuit constructed based on the metering device.
[0116] Step S70: calling third-party simulation software to run the energy metering virtual circuit to obtain simulated energy, and receiving the energy processed by the energy metering real circuit.
[0117] Step S80 : If the electric energy obtained by the actual electric energy metering circuit is consistent with the simulated electric energy, the corresponding target metering device is output.
[0118] The specific implementation of the above steps S60 to S80 can refer to steps S20 to S40, which are similar to steps S20 to S40 and are not described here in detail. By re-determining the energy metering device using the fine-tuned large language model, the accuracy of the determined energy metering device is improved.
[0119] In this embodiment, by combining simulation technology with a large language model, the operating process and performance of an energy metering device in an actual operating environment can be simulated, allowing its accuracy and reliability to be evaluated and optimized. When the energy measured by the actual circuitry doesn't match the simulated energy, the large language model can be used to troubleshoot and locate the problem, quickly identifying the cause and enabling repairs, reducing both repair costs and time.
[0120] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the determination method of the electric energy metering device of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0121] Based on the same inventive concept, the present application provides an electric energy metering method, referring to Figure 4 , Figure 4 This is a flow chart of an embodiment of the electric energy metering method of the present application.
[0122] It should be noted that the method for determining the target electric energy metering real circuit and the target metering device can refer to the embodiments related to the above-mentioned method for determining the electric energy metering device. The embodiments related to the above-mentioned method for determining the electric energy metering device are similar and will not be repeated here. The present application determines the target metering device based on the above-mentioned method for determining the electric energy metering device, builds the target electric energy metering real circuit in the actual application scenario based on the target metering device, and uses the actually deployed target electric energy metering real circuit to perform electric energy metering to improve the accuracy of electric energy metering.
[0123] It should be noted that the execution subject of this embodiment may be an electric energy meter. The electric energy meter is used as an example to illustrate this embodiment and the following embodiments.
[0124] For details, please refer to Figure 4 , the electricity metering methods include:
[0125] Step S110: Acquire the current power grid simulation signal.
[0126] Among them, the current power grid analog signal refers to the electrical signal generated in real time in the power grid and exists in analog form, such as continuous waveforms of voltage and current. It serves as the original input data for electric energy metering and reflects the real-time status of the power grid.
[0127] In a feasible implementation, a high-precision current / voltage transformer can be used to directly acquire analog signals in the power grid. The transformer can accurately convert the high voltage / large current in the power grid into a low voltage / small current signal suitable for subsequent processing.
[0128] In another feasible implementation, the power grid analog signal can be acquired through an analog signal acquisition card or a data acquisition system. The acquisition card or the data acquisition system can simultaneously acquire analog signals of multiple channels and support multiple signal formats and ranges, thereby improving the flexibility and accuracy of data acquisition.
[0129] In step S120, signal conversion and analog-to-digital conversion are performed on the grid analog signal using a target electric energy metering real circuit. The target electric energy metering real circuit is constructed based on a target metering device, and the target metering device is obtained by processing a first prompt text related to the current electric energy metering scenario using a pre-trained large language model.
[0130] Among them, signal conversion is to convert the analog signal of the power grid into a signal form suitable for subsequent processing, such as converting it into a standard signal that varies within a certain range of voltage or current, to ensure that the signal can be correctly processed and measured by subsequent circuits.
[0131] Among them, analog-to-digital conversion is the process of converting analog signals into digital signals so that computers or digital circuits can process them. It realizes the digitization of signals and facilitates subsequent digital signal processing and analysis.
[0132] In a feasible implementation, an integrated signal conditioning circuit and an analog-to-digital converter can be used for signal conversion and analog-to-digital conversion. The integrated circuit has a small size and low power consumption, which can simplify circuit design and improve conversion accuracy.
[0133] In another feasible implementation, discrete signal conditioning circuits and independent high-precision analog-to-digital converters can be used for conversion. Discrete components provide greater flexibility and customization, and the most appropriate signal conditioning circuits and analog-to-digital converters can be selected according to specific needs.
[0134] The above-mentioned analog-to-digital converter can be a 24-bit high-precision analog-to-digital conversion chip, which can collect current signals at a sampling rate of 32kHz, ensuring high-frequency sampling of the signal and improving measurement accuracy.
[0135] Step S130 , performing DC removal processing, phase shift processing, active power calculation, and time integration calculation on the analog-to-digital converted grid signal in sequence to obtain the measured electric energy.
[0136] Among them, DC removal processing is to remove the DC component, that is, the average value or offset of the signal, from the signal, so as to eliminate the influence of the DC component on subsequent signal processing and ensure the accuracy and stability of the signal.
[0137] Phase shifting refers to adjusting the phase of a signal to satisfy a specific phase relationship or requirement, and is used to calibrate or adjust the phase of a signal to ensure the accuracy of power calculation.
[0138] Among them, active power calculation refers to calculating the active power in the signal, that is, the power actually consumed or generated. It is used to measure the actual transmitted and consumed electric energy in the power grid and is the core of electric energy metering.
[0139] Among them, time integral calculation refers to integrating the active power over time to obtain the total electric energy within a period of time, which is used to calculate the total electric energy transmitted in the power grid within a period of time and used for electricity bill settlement or energy management.
[0140] In a feasible embodiment, a high-pass filter may be used to remove the DC component, or a software algorithm such as a mean filter may be used to calculate and remove the DC offset of the signal.
[0141] Specifically, calculating and removing the DC offset of a signal using a software algorithm such as mean filtering includes: using an analog-to-digital converter to collect an analog signal from the power grid or other signal source and converting it into a digital signal; storing the collected digital signal in the power meter's memory; traversing the collected signal data and calculating the average value of all sampling points. This average value is the DC component of the signal, calculated using the formula: DC component = (sum of signal data) / (number of sampling points). Subtracting the calculated DC component from the original signal data using the formula: Signal after DC offset removal = Original signal - DC component; and storing the signal data after DC offset removal in the power meter's memory.
[0142] In a feasible implementation, a phase shifting circuit such as a phase shifter or a phase shifting network may be used to adjust the signal phase, or the phase adjustment may be implemented in software using a digital signal processing algorithm.
[0143] Specifically, using a phase shifting circuit such as a phase shifter or a phase shifting network to adjust the signal phase includes:
[0144] Phase-shifting circuits typically consist of components such as oscillators, amplifiers, and filters. These components, through specific combinations and connections, form a network capable of adjusting the signal phase. A key component in a phase-shifting circuit is the phase shifter, which adjusts the signal phase as needed. Filter-based phase shifters utilize a combination of low-pass and high-pass filters to achieve phase shifting. Adjusting filter parameters, such as capacitance and inductance, can alter the signal's phase. For example, in an all-pass filter, varying the values of resistance and capacitance can achieve different phase shifts. An all-pass filter's characteristic is that the amplitude of its output signal remains constant, while the phase varies with changes in resistance and capacitance. Phase shifters based on varactor diodes and inductors adjust the signal's phase by varying the capacitance of the varactor diode. The capacitance of the varactor diode changes with the voltage across it, thereby adjusting the signal's phase. Adjusting the voltage across the varactor diode changes its capacitance, and thus the signal's phase. This type of phase shifter is often used when precise phase adjustment is required. Phase shifters based on ferrite or ferroelectric materials have the property that the magnetic permeability or dielectric constant of ferrite or ferroelectric materials changes with the magnetic field or electric field. By utilizing this property, a tunable phase shifter can be made. By changing the magnetic field or electric field applied to the ferrite or ferroelectric material, its magnetic permeability or dielectric constant can be adjusted, thereby achieving adjustment of the signal phase.
[0145] In a feasible implementation, a multiplier and a low-pass filter may be used to calculate the instantaneous power and obtain the active power, or the active power of the discrete-time signal may be directly calculated using a DSP algorithm.
[0146] In a feasible embodiment, an analog integrator may be used to perform time integration on the power signal, or time integration may be implemented in software using a digital integration algorithm such as trapezoidal integration or Simpson integration.
[0147] In another feasible embodiment, the aforementioned grid analog signal includes a three-phase grid analog signal, such as a phase A grid analog signal, a phase B grid analog signal, and a phase C grid analog signal. The target metering device includes a transformer and an analog-to-digital converter, wherein three transformers may be provided, each transformer corresponding to processing a phase grid analog signal, and the analog-to-digital converter includes three processing channels for processing each phase signal separately. Each phase grid analog signal can be converted separately by the transformer to obtain a target signal for each phase that can be processed by the analog-to-digital converter in the target electric energy metering circuit. Each phase target signal can be converted separately by the analog-to-digital converter to obtain a grid signal after analog-to-digital conversion. Each phase grid signal after analog-to-digital conversion can then be subjected to DC removal, phase shifting, active power calculation, and time integration calculation in sequence to obtain the measured electric energy.
[0148] Furthermore, the target metering device includes a signal processor. The process of sequentially performing DC removal, phase shifting, active power calculation, and time integration on each phase of the analog-to-digital converted power grid signal to obtain the measured electric energy includes: performing DC removal, phase shifting, and active power calculation on each phase of the analog-to-digital converted power grid signal by the signal processor to obtain the active power corresponding to each phase of the power grid signal; obtaining the total active power based on the accumulated active power corresponding to each phase of the power grid signal; and performing time integration calculation on the total active power to obtain the measured electric energy. The aforementioned signal processor may be one or more. When there is one signal processor, the signal processor may sequentially perform DC removal, phase shifting, and active power calculation on each phase of the power grid analog signal to obtain the active power corresponding to each phase of the power grid signal. When there are multiple signal processors, each signal processor is configured to perform DC removal, phase shifting, and active power calculation on the corresponding phase of the power grid analog signal to obtain the active power corresponding to each phase of the power grid signal. Finally, the accumulated active power corresponding to each phase of the power grid signal is added to obtain the total active power.
[0149] In this embodiment, the current grid analog signal is obtained; the grid analog signal is converted into a signal and analog-to-digital converted through the target electric energy metering real circuit; the grid signal after analog-to-digital conversion is sequentially subjected to DC removal processing, phase shift processing, active power calculation, and time integration calculation to obtain the measured electric energy; the accuracy and reliability of electric energy metering are ensured through the steps of high-precision acquisition, signal conditioning, analog-to-digital conversion, signal processing, and electric energy calculation.
[0150] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the electric energy metering method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0151] Based on the same inventive concept, the present application provides a device for determining an electric energy metering device, comprising: a processor, a first memory communicatively connected to the processor, and a computer program stored in the first memory and runnable on the processor; wherein the first memory stores instructions executable by the processor, and the instructions are executed by the processor so that the processor can execute the method for determining the electric energy metering device in the above-mentioned embodiment.
[0152] The device for determining an electric energy metering device provided in this application, employing the method for determining an electric energy metering device in the above-described embodiment, can resolve the technical problem of inaccurately selected electric energy metering devices, resulting in low accuracy in the measured electric energy. Compared to the prior art, the device for determining an electric energy metering device provided in this application has the same beneficial effects as the method for determining an electric energy metering device provided in the above-described embodiment. Other technical features of the device for determining an electric energy metering device are the same as those disclosed in the method in the above-described embodiment and are not further elaborated here.
[0153] Based on the same inventive concept, the present application provides an electric energy metering device, comprising: a second memory, a mutual inductor, an analog-to-digital converter, a signal processor, and a computer program stored on the second memory and runnable on the signal processor; wherein the second memory stores instructions that can be executed by the signal processor, and the instructions are executed by the signal processor so that the signal processor can execute the electric energy metering method in the above embodiment.
[0154] The electric energy metering device provided in this application, employing the electric energy metering method of the aforementioned embodiment, can resolve the technical problem of inaccurately selected electric energy metering devices, resulting in low accuracy in the measured electric energy. Compared to the prior art, the beneficial effects of the electric energy metering device provided in this application are the same as those of the electric energy metering method provided in the aforementioned embodiment. Other technical features of this electric energy metering device are the same as those disclosed in the aforementioned embodiment and are not further described here.
[0155] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0156] The above are only some embodiments of the present application and are not intended to limit the patent scope of the present application. All equivalent structural transformations made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for determining an electric energy metering device, characterized in that: The method for determining the electric energy metering device includes: receiving a first prompt text related to a current electric energy metering scenario; Processing the first prompt text using a pre-trained large language model to obtain a metering device matching the electric energy metering scenario and an electric energy metering virtual circuit constructed based on the metering device; Calling third-party simulation software to run the energy metering virtual circuit to obtain simulated electric energy, and receiving electric energy processed by the energy metering real circuit; If the electric energy obtained by processing the real electric energy metering circuit is consistent with the simulated electric energy, the corresponding target metering device is output.
2. The method for determining an electric energy metering device according to claim 1, wherein: The pre-trained large language model includes: a first pre-trained large language model and a second pre-trained large language model; the pre-trained large language model is used to process the first prompt text to obtain a metering device matching the electric energy metering scenario; and the electric energy metering virtual circuit constructed based on the metering device includes: Processing the first prompt text using the first pre-trained large language model to obtain a metering device matching the electric energy metering scenario, and outputting the metering device; Constructing a second prompt text according to the device information of the metering device and the requirements for establishing the electric energy metering circuit; The second prompt text is processed using the second pre-trained large language model to output the electric energy metering virtual circuit.
3. The method for determining an electric energy metering device according to claim 2, wherein: The first prompt text includes: an electric energy metering scenario requirement description information and a first sample example, wherein the first sample example is used to help the first pre-trained large language model understand the electric energy metering scenario requirement description information and the data format expected to be output by the metering device; the first pre-trained large language model is used to process the first prompt text to obtain a metering device matching the electric energy metering scenario, and output the metering device including: parsing the first prompt text using the first pre-trained large language model to obtain a first text feature vector of the first prompt text; Calculating a similarity between the first text feature vector and a preset text feature vector in a first preset database to obtain a first similar text feature vector, wherein the first preset database stores a correspondence between preset text feature vectors corresponding to different electric energy metering scenario requirements and preset metering devices; Determining the preset metering device associated with the first similar text feature vector as the metering device matching the electric energy metering scenario; According to the first sample example, a first data format output by the metering device is determined, and the metering device outputs data based on the first data format.
4. The method for determining an electric energy metering device according to claim 2, wherein: The second prompt text includes: device information of the metering device, description information of the requirements for setting up the electric energy metering circuit, and a second sample example, wherein the second sample example is used to help the second pre-trained large language model understand the description information of the requirements for setting up the electric energy metering circuit and the expected output format of the electric energy metering virtual circuit; processing the second prompt text using the second pre-trained large language model, and outputting the electric energy metering virtual circuit includes: parsing the second prompt text using the second pre-trained large language model to obtain a second text feature vector of the second prompt text; Calculating a similarity between the second text feature vector and a preset text feature vector in a second preset database to obtain a second similar text feature vector, wherein the second preset database stores a correspondence between preset text feature vectors corresponding to different electric energy metering circuit construction requirements and preset electric energy metering virtual circuits; Determining the preset electric energy metering virtual circuit associated with the second similar text feature vector as an electric energy metering virtual circuit that matches the electric energy metering circuit construction requirement; According to the second sample example, a second data format output by the electric energy metering virtual circuit is determined, and the electric energy metering virtual circuit is output based on the second data format.
5. The method for determining an electric energy metering device according to any one of claims 1 to 4, wherein: After calling the third-party simulation software to run the energy metering virtual circuit to obtain simulated electric energy and receiving the electric energy processed by the energy metering real circuit, the method further includes: If the electric energy obtained by processing the real electric energy metering circuit does not match the simulated electric energy, fine-tuning the pre-trained large language model to obtain a fine-tuned large language model; The first prompt text is processed using the fine-tuned large language model to obtain a metering device matching the electric energy metering scenario and an electric energy metering virtual circuit constructed based on the metering device; Calling third-party simulation software to run the energy metering virtual circuit to obtain simulated electric energy, and receiving electric energy processed by the energy metering real circuit; If the electric energy obtained by processing the real electric energy metering circuit is consistent with the simulated electric energy, the corresponding target metering device is output.
6. A method for measuring electric energy, characterized in that: Applied to an electric energy meter, the electric energy metering method includes: Get the current power grid simulation signal; performing signal conversion and analog-to-digital conversion on the grid analog signal using a target electric energy metering real circuit, wherein the target electric energy metering real circuit is constructed based on a target metering device, and the target metering device is obtained by processing a first prompt text related to a current electric energy metering scenario using a pre-trained large language model; The grid signal after analog-to-digital conversion is subjected to DC removal processing, phase shift processing, active power calculation and time integration calculation in sequence to obtain the measured electric energy.
7. The electric energy metering method according to claim 6, wherein: The power grid analog signal includes a three-phase power grid analog signal, and the target metering device includes a mutual inductor and an analog-to-digital converter; The performing signal conversion and analog-to-digital conversion on the grid analog signal through the target electric energy metering real circuit includes: Performing signal conversion on each phase of the power grid analog signal through the mutual inductor to obtain a target signal for each phase processed by an analog-to-digital converter suitable for the target electric energy metering real circuit; Performing analog-to-digital conversion on the target signal of each phase by the analog-to-digital converter to obtain an analog-to-digital converted power grid signal of each phase; The grid signal after analog-to-digital conversion is subjected to DC removal processing, phase shift processing, active power calculation, and time integration calculation in sequence to obtain the measured electric energy, including: The power grid signal of each phase after analog-to-digital conversion is subjected to DC removal processing, phase shift processing, active power calculation and time integration calculation in sequence to obtain the measured electric energy.
8. The electric energy metering method according to claim 7, wherein: The target metering device includes a signal processor; the DC removal processing, phase shift processing, active power calculation and time integration calculation are performed on each phase grid signal after analog-to-digital conversion in sequence to obtain the measured electric energy, which includes: The signal processor sequentially performs DC removal processing, phase shift processing, and active power calculation on each phase power grid signal after analog-to-digital conversion to obtain the active power corresponding to each phase power grid signal; Obtaining total active power according to the accumulated value of active power corresponding to each phase grid signal; Performing time integration calculation on the total active power to obtain the measured electric energy.
9. A device for determining an electric energy metering device, characterized in that: The determination device of the electric energy metering device includes: a first memory, a processor, and a computer program stored in the first memory and executable on the processor, wherein the computer program is configured to implement the steps of the determination method of the electric energy metering device according to any one of claims 1 to 5.
10. An electric energy meter, characterized in that: The electric energy meter includes: a second memory, a mutual inductor, an analog-to-digital converter, a signal processor, and a computer program stored in the second memory and executable on the signal processor, wherein the computer program is configured to implement the steps of the electric energy metering method according to any one of claims 6 to 8.
Citation Information
Patent Citations
Conversion device for digital electric energy testing
CN108254709A
Metering performance determination method and device of metering equipment and computer equipment
CN118094875A
Current transformer test method and device, equipment and storage medium
CN119087331A
Automatic design method and device for power converter based on multi-mode large language model system
CN119129502A