Electric energy meter data storage method and device and computer equipment

By generating flag values ​​and building linked lists, we dynamically manage the associated objects of the power meter freezing task, solving the problem of excessive memory usage and inconsistent data in traditional power meter freezing processing, and realizing unified and consistent storage of frozen data.

CN119512450AActive Publication Date: 2025-02-25JIANGYIN CHANGYI GRP CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411415964.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-04-20
Publication Date
2025-02-25
Estimated Expiration
2042-04-20

AI Technical Summary

Technical Problem

When freezing, traditional power meters take up too much memory space, and different types of frozen data sources may be inconsistent at the same time, resulting in inconsistent frozen data.

Method used

By generating flag values, building a linked list to dynamically manage the associated objects of the frozen task, use temporary memory to store frozen data, and store frozen data uniformly in the storage device.

Benefits of technology

It effectively solves the problem of excessive memory space occupation, ensures the unity and consistency of frozen data, and meets the long-term storage needs of frozen data by the power meter.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512450A_ABST
    Figure CN119512450A_ABST
Patent Text Reader

Abstract

The invention relates to an electric energy meter data storage method and device, computer equipment, a storage medium and a computer program product. The method comprises the steps of obtaining an electric energy meter freezing task, generating a corresponding flag value according to the freezing task, putting the flag value into an array, and when the flag value is not 0, adding nodes in an initialized linked list according to the number of associated objects of the freezing task corresponding to the flag value to generate a final linked list, the data structure of each node comprises an object attribute descriptor corresponding to the associated object, a data length and a data pointer, applying for storing a temporary memory of frozen data corresponding to the associated object according to the data length, and traversing the final linked list to obtain a final data list; and determining an associated object of the freezing task corresponding to the mark value according to the object attribute descriptor, obtaining freezing data of the associated object from the temporary memory according to the data pointer, and storing the freezing data into a storage device. By adopting the method, the problem that excessive memory space is occupied can be effectively solved, and the beneficial effect of ensuring data source unification is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the Chinese invention patent application with the application date of April 20, 2022, application number 2022104166585, and invention name “Data storage method, device and computer equipment for freezing electric energy meters”. Technical Field

[0002] The present application relates to the technical field of electric energy meters, and in particular to an electric energy meter data storage method, device, computer equipment, storage medium and computer program product. Background Art

[0003] The electric energy meter is one of the basic devices for data collection in the power grid and the only component for measuring electric energy in the power system. Its importance and reliability are self-evident. Freezing is an important data recording function of the electric energy meter. When the electric energy meter is working and a freeze occurs, the electric energy meter must record the frozen data. The specific data to be recorded depends on the type of associated objects configured by the user for the freeze, and the specific values ​​of these associated objects at the time of the freeze are stored when the freeze occurs. In the event of a power outage of the electric energy meter, all frozen data related to settlement must be kept for at least 16 years, and other data must be kept for at least 3 years. In addition, at the same freezing time point, the same data items saved by various types of freezes must remain consistent.

[0004] In the prior art, the traditional single-chip freezing processing method is to apply for each type of freezing task to have its own fixed memory space. This method takes up too much memory space, and there may be a risk of inconsistency in the data sources of different types of freezing at the same time point. For example, when freezing the hour, freezing the minute will occur synchronously, and both need to store the total active power data of the forward and reverse directions. Since the two traditional freezing tasks sample data separately, there is a sequence in the sampling time, which may lead to inconsistent actual sampling results. However, from the perspective of the freezing function requirements, the two data should be at the same time and consistent. Summary of the invention

[0005] Based on this, it is necessary to provide a data storage method, device, computer equipment, computer-readable storage medium and computer program product for freezing electric energy meters, which can solve the problem of excessive memory space occupation and ensure the unification of data sources.

[0006] In a first aspect, the present application provides a method for storing data in an electric energy meter. The method comprises: Get the energy meter freezing task; Generate a corresponding flag value according to the frozen task and add the flag value to the array; Loop to determine the flag value in the array until the flag value is not 0, add nodes to the initialization linked list according to the number of associated objects of the frozen task corresponding to the flag value and generate a final linked list, the data structure of each node includes the corresponding OAD, data length and data pointer of each associated object; Apply for temporary memory according to the data length, and store the frozen data of the corresponding associated object into the temporary memory, and the data pointer points to the address of the temporary memory; Loop through the flag value in the array until it is not 0, traverse the final linked list, determine all associated objects of the frozen task corresponding to the flag value according to OAD, and obtain the frozen data of the associated object of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and store it in the storage device.

[0007] In one embodiment, after acquiring the frozen data of the associated object of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and storing it in the storage device, the method further includes: Release temporary memory.

[0008] In one embodiment, the electricity meter freezing task includes at least one of instantaneous freezing, minute freezing, hour freezing, day freezing, settlement day freezing, month freezing, step settlement freezing, time zone table switching freezing, day time table switching freezing, rate electricity price switching freezing and step switching freezing.

[0009] In one embodiment, the objects associated with the freeze task include forward active energy, reverse active energy, forward total active energy, reverse total active energy, combined reactive energy 1, combined reactive energy 2, combined reactive energy 1 total energy, combined reactive energy 2 total energy, first quadrant reactive energy, second quadrant reactive energy, third quadrant reactive energy, fourth quadrant reactive energy, first quadrant total reactive energy, second quadrant total reactive energy, third quadrant total reactive energy, fourth quadrant Total reactive energy, A-phase forward active energy, B-phase forward active energy, C-phase forward active energy, A-phase reverse active energy, B-phase reverse active energy, C-phase reverse active energy, maximum forward active demand and occurrence time, maximum reverse active demand and occurrence time, A-phase voltage qualification rate, B-phase voltage qualification rate, C-phase voltage qualification rate, monthly electricity consumption, active power, reactive power, active demand, reactive demand, voltage, current and power factor.

[0010] In one embodiment, the storage device includes at least one of EEPROM, Flash and disk storage.

[0011] In one embodiment, when there are more than two frozen tasks at the same time point, adding nodes to the initialization linked list according to the number of associated objects of the frozen tasks corresponding to the flag value and generating a final linked list includes: S1, adding the node of the associated object of the first frozen task to the initialization linked list according to the flag value, and updating the initialization linked list to the first linked list; S2, determine the i-th frozen task according to the flag value, where: and ; S3, traversing the i-1th linked list according to the OAD of the associated object of the i-th frozen task, and determining whether there is an associated object in the i-th frozen task that is different from the node in the i-1th linked list; S4, if it exists, add a node of a different associated object to the i-1th linked list, and update the i-1th linked list to the i-th linked list; otherwise, the i-th linked list is consistent with the i-1th linked list; S5, repeating steps S2-S4 until the node addition of the associated object of the nth frozen task is completed, and the nth linked list is updated, and the nth linked list is the final linked list.

[0012] In one embodiment, when there are more than two frozen tasks at the same time point, the final linked list is traversed, all associated objects of the frozen task corresponding to the flag value are determined according to the OAD, and frozen data of the associated objects of the frozen task are obtained from the corresponding temporary memory according to the data pointer of the associated object and stored in the storage device, including: Traverse the final linked list and determine all associated objects of the frozen tasks corresponding to different flag values ​​according to OAD; The frozen data of the associated objects of the frozen tasks corresponding to different flag values ​​are respectively obtained from the corresponding temporary memory according to the data pointer of the associated objects, and are respectively stored in the storage device.

[0013] In a second aspect, the present application also provides an electric energy meter data storage device. The device comprises: An acquisition module is used to acquire the freezing task of the electric energy meter; A flag value generation module, used for generating corresponding flag values ​​according to the frozen tasks, and adding the flag values ​​to the array; The final linked list generation module is used to loop through the flag values ​​in the array until the flag value is not 0, add nodes to the initialization linked list according to the number of associated objects of the frozen task corresponding to the flag value, and generate the final linked list. The data structure of each node includes the corresponding OAD, data length, and data pointer of each associated object. A temporary storage module is used to apply for temporary memory according to the data length, and store the frozen data of the corresponding associated object into the temporary memory, and the data pointer points to the address of the temporary memory; The associated object determination module is used to cyclically determine the flag value in the array until the flag value is not 0, traverse the final linked list, and determine all associated objects of the frozen task corresponding to the flag value according to the OAD; The data storage module is used to obtain the frozen data of the associated object of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and store it in the storage device.

[0014] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the above-mentioned data storage method for freezing an electric energy meter are implemented.

[0015] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned method for storing data in an electric energy meter are implemented.

[0016] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for storing data in an electric energy meter are implemented.

[0017] The above-mentioned electric energy meter data storage method, device, computer equipment, storage medium and computer program product can solve the problem of excessive memory space occupation and achieve the beneficial effect of ensuring the unification of data sources by reorganizing the associated object attributes of multiple frozen tasks occurring at the same time and using linked lists to dynamically add nodes according to the number of associated objects. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram of a flow chart of a method for storing data in an electric energy meter in one embodiment; Figure 2 A schematic diagram of a flow chart of an electric energy meter data storage method in another embodiment; Figure 3 is a structural block diagram of an electric energy meter data storage device in one embodiment; Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0020] In one embodiment, Figure 1As shown, a method for storing electric energy meter data is provided. This embodiment takes the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps: Step 102, obtaining the freezing task of the electric energy meter.

[0021] Optionally, the freezing task includes at least one of instantaneous freezing, minute freezing, hour freezing, daily freezing, settlement day freezing, monthly freezing, step settlement freezing, time zone table switching freezing, day time period table switching freezing, rate electricity price switching freezing and step switching freezing.

[0022] Step 104: Generate a corresponding flag value according to the frozen task, and add the flag value to an array.

[0023] Step 106, looping to determine the flag value in the array until the flag value is not 0, adding nodes to the initialization linked list according to the number of associated objects of the frozen task corresponding to the flag value and generating a final linked list, the data structure of each node includes the corresponding OAD, data length and data pointer of each associated object.

[0024] Optionally, the objects associated with the freeze task include forward active energy, reverse active energy, forward total active energy, reverse total active energy, combined reactive energy 1, combined reactive energy 2, combined reactive energy 1 total energy, combined reactive energy 2 total energy, first quadrant reactive energy, second quadrant reactive energy, third quadrant reactive energy, fourth quadrant reactive energy, first quadrant total reactive energy, second quadrant total reactive energy, third quadrant total reactive energy, fourth quadrant total reactive energy Electric energy, A-phase forward active energy, B-phase forward active energy, C-phase forward active energy, A-phase reverse active energy, B-phase reverse active energy, C-phase reverse active energy, maximum forward active demand and occurrence time, maximum reverse active demand and occurrence time, A-phase voltage qualification rate, B-phase voltage qualification rate, C-phase voltage qualification rate, monthly electricity consumption, active power, reactive power, active demand, reactive demand, voltage, current and power factor.

[0025] Step 108, applying for temporary memory according to the data length, and storing the corresponding frozen data of the associated object into the temporary memory, and the data pointer points to the address of the temporary memory.

[0026] Specifically, a corresponding temporary memory is applied for according to the data length of each associated object, a corresponding data pointer points to the address of the temporary memory, and the frozen data of the corresponding associated object is stored in the corresponding temporary memory.

[0027] Step 110, loop to determine the flag value in the array until the flag value is not 0, traverse the final linked list, determine all associated objects of the frozen task corresponding to the flag value according to OAD, and obtain the frozen data of the associated object of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and store it in the storage device.

[0028] Optionally, the storage device includes at least one of EEPROM, Flash and disk storage.

[0029] Optionally, after obtaining the frozen data of the associated object of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and storing it in the storage device, the method further includes: step 112, releasing the temporary memory.

[0030] In another embodiment, Figure 2 As shown, a method for storing electric energy meter data is provided, which specifically includes: Step 202, obtaining the freezing task of the electric energy meter.

[0031] Optionally, at least two of the following freezing tasks are obtained at the same time point: instantaneous freeze, minute freeze, hour freeze, day freeze, settlement day freeze, month freeze, step settlement freeze, time zone table switch freeze, day time table switch freeze, rate electricity price switch freeze and step switch freeze.

[0032] Specifically, in this embodiment, three freezing tasks, namely, daily freezing, hourly freezing, and minute freezing, generated at 0:00 every day are obtained.

[0033] Step 204: Generate a corresponding flag value according to the frozen task, and add the flag value to the array.

[0034] Specifically, the flag value of the daily freezing task is 0x01, the flag value of the hourly freezing task is 0x02, and the flag value of the minute freezing task is 0x03. The above flag values ​​are added to the array array.

[0035] Step 206, looping to determine the flag value in the array, until the flag value is not 0, adding nodes to the initialization linked list according to the number of associated objects of the frozen task corresponding to the flag value and generating a final linked list, the data structure of each node includes the corresponding OAD, data length and data pointer of each associated object, specifically including: Step 2061, looping to determine the flag value in the array, until the flag value is not 0, adding the node of the associated object of the first frozen task to the initialization linked list according to the flag value, and updating the initialization linked list to the first linked list.

[0036] Specifically, according to the flag value 0x01, a node of an associated object of the daily freezing task is added to the initialization linked list, and the initialization linked list is updated to the first linked list.

[0037] Step 2062, determine the i-th frozen task according to the flag value, where: and .

[0038] Specifically, the second freezing task is determined to be the hourly freezing according to the flag value 0x02.

[0039] Step 2063: traverse the i-1th linked list according to the associated object OAD of the i-th frozen task, and determine whether there is an associated object in the i-th frozen task that is different from the node in the i-1th linked list.

[0040] Specifically, the first linked list is traversed according to the associated object OAD frozen at the hour of the second freezing task, to determine whether there is an associated object in the hourly freezing task that is different from the node in the first linked list.

[0041] Step 2064, if it exists, add a node of a different associated object to the i-1th linked list, and update the i-1th linked list to the i-th linked list; otherwise, the i-th linked list remains consistent with the i-1th linked list.

[0042] Specifically, if there are associated objects different from those in the nodes of the first linked list in the second freezing task at the hourly freeze, the nodes of the different associated objects are added to the first linked list, and the first linked list is updated to the second linked list; otherwise, the second linked list remains consistent with the first linked list.

[0043] Step 2065, repeating steps 2062-2064 until the node addition of the associated object of the nth frozen task is completed, and the nth linked list is updated, and the nth linked list is the final linked list.

[0044] Specifically, in this embodiment, n=3, that is, according to the flag value 0x03, the third freezing task is determined to be minute freezing, and according to the associated object OAD of the second freezing task minute freezing, the second linked list is traversed to determine whether there is an associated object in the minute freezing task that is different from the node in the second linked list; if so, the node of the different associated object is added to the second linked list to update the second linked list to the third linked list; otherwise, the third linked list is consistent with the second linked list. At this point, the node addition of the associated objects of the three freezing tasks of day freezing, hour freezing and minute freezing is completed, and the third linked list is the final linked list.

[0045] Optionally, the objects associated with the freeze task include forward active energy, reverse active energy, forward total active energy, reverse total active energy, combined reactive energy 1, combined reactive energy 2, combined reactive energy 1 total energy, combined reactive energy 2 total energy, first quadrant reactive energy, second quadrant reactive energy, third quadrant reactive energy, fourth quadrant reactive energy, first quadrant total reactive energy, second quadrant total reactive energy, third quadrant total reactive energy, fourth quadrant total reactive energy Electric energy, A-phase forward active energy, B-phase forward active energy, C-phase forward active energy, A-phase reverse active energy, B-phase reverse active energy, C-phase reverse active energy, maximum forward active demand and occurrence time, maximum reverse active demand and occurrence time, A-phase voltage qualification rate, B-phase voltage qualification rate, C-phase voltage qualification rate, monthly electricity consumption, active power, reactive power, active demand, reactive demand, voltage, current and power factor.

[0046] Step 208, applying for temporary memory according to the data length, and storing the corresponding frozen data of the associated object into the temporary memory, and the data pointer points to the address of the temporary memory.

[0047] Specifically, the final linked list includes nodes of associated objects of the three freezing tasks of daily freezing, hourly freezing and minute freezing. The corresponding temporary memory is applied for according to the data length of each associated object, and the corresponding data pointer points to the address of the temporary memory, and the frozen data of the corresponding associated object is stored in the corresponding temporary memory.

[0048] Step 210, loop to determine the flag value in the array until the flag value is not 0, traverse the final linked list, determine all associated objects of the frozen task corresponding to the flag value according to OAD, and obtain the frozen data of the associated object of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and store it in the storage device.

[0049] Specifically, the flag value in the array is judged in a loop until the flag value is not 0, and then the final linked list is traversed, and the associated object of the daily freezing task corresponding to the flag value 0x01, the associated object of the hourly freezing task corresponding to the flag value 0x02, and the associated object of the minute freezing task corresponding to the flag value 0x03 are determined according to OAD; the frozen data of the associated object of the daily freezing task, the frozen data of the associated object of the hourly freezing task, and the frozen data of the associated object of the minute freezing task are respectively obtained from the corresponding temporary memory according to the data pointer of the associated object, and the frozen data of the associated object of the above-mentioned freezing task are respectively stored in the storage device.

[0050] Optionally, the storage device includes at least one of EEPROM, Flash and disk storage.

[0051] Optionally, after obtaining the frozen data of the associated object of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and storing it in the storage device, the method further includes: step 212, releasing the temporary memory.

[0052] The above embodiment uses a linked list to dynamically add nodes according to the number of associated objects, thereby solving the problem of excessive memory space occupation and achieving the beneficial effect of ensuring the unification of data sources.

[0053] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0054] Based on the same inventive concept, the embodiment of the present application also provides an electric energy meter data storage device for implementing the electric energy meter data storage method mentioned above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more electric energy meter data storage device embodiments provided below can refer to the limitations of an electric energy meter data storage method above, and will not be repeated here.

[0055] In one embodiment, Figure 3 As shown, an electric energy meter data storage device is provided, comprising: An acquisition module is used to acquire the freezing task of the electric energy meter; A flag value generation module, used for generating corresponding flag values ​​according to the frozen tasks, and adding the flag values ​​to the array; The final linked list generation module is used to loop through the flag values ​​in the array until the flag value is not 0, add nodes to the initialization linked list according to the number of associated objects of the frozen task corresponding to the flag value, and generate the final linked list. The data structure of each node includes the corresponding OAD, data length, and data pointer of each associated object. A temporary storage module is used to apply for temporary memory according to the data length, and store the frozen data of the corresponding associated object into the temporary memory, and the data pointer points to the address of the temporary memory; The associated object determination module is used to cyclically determine the flag value in the array until the flag value is not 0, traverse the final linked list, and determine all associated objects of the frozen task corresponding to the flag value according to the OAD; The data storage module is used to obtain the frozen data of the associated object of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and store it in the storage device.

[0056] Each module in the above-mentioned electric energy meter data storage device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0057] In one embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 4 As shown. The computer device includes a processor, a memory and a network interface 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, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the acquired frozen data of the electric energy meter. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for storing electric energy meter data is implemented.

[0058] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0059] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented: Get the energy meter freezing task; Generate a corresponding flag value according to the frozen task and add the flag value to the array; Loop to determine the flag value in the array until the flag value is not 0, add nodes to the initialization linked list according to the number of associated objects of the frozen task corresponding to the flag value and generate a final linked list, the data structure of each node includes the corresponding OAD, data length and data pointer of each associated object; Apply for temporary memory according to the data length, and store the frozen data of the corresponding associated object into the temporary memory, and the data pointer points to the address of the temporary memory; Loop through the flag value in the array until it is not 0, traverse the final linked list, determine all associated objects of the frozen task corresponding to the flag value according to OAD, and obtain the frozen data of the associated object of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and store it in the storage device.

[0060] In one embodiment, when the processor executes the computer program, it also implements: After the frozen data of the associated object of the frozen task is obtained from the corresponding temporary memory according to the data pointer of the associated object and stored in the storage device, the temporary memory is released.

[0061] In one embodiment, when there are more than two frozen tasks at the same time point, the processor further implements when executing the computer program: S1, adding the node of the associated object of the first frozen task to the initialization linked list according to the flag value, and updating the initialization linked list to the first linked list; S2, determine the i-th frozen task according to the flag value, where: and ; S3, traversing the i-1th linked list according to the OAD of the associated object of the i-th frozen task, and determining whether there is an associated object in the i-th frozen task that is different from the node in the i-1th linked list; S4, if it exists, add a node of a different associated object to the i-1th linked list, and update the i-1th linked list to the i-th linked list; otherwise, the i-th linked list is consistent with the i-1th linked list; S5, repeating steps S2-S4 until the node addition of the associated object of the nth frozen task is completed, and the nth linked list is updated, and the nth linked list is the final linked list.

[0062] In one embodiment, when there are more than two frozen tasks at the same time point, the processor further implements when executing the computer program: Traverse the final linked list and determine all associated objects of the frozen tasks corresponding to different flag values ​​according to OAD; The frozen data of the associated objects of the frozen tasks corresponding to different flag values ​​are respectively obtained from the corresponding temporary memory according to the data pointer of the associated objects, and are respectively stored in the storage device.

[0063] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: Get the energy meter freezing task; Generate a corresponding flag value according to the frozen task and add the flag value to the array; Loop to determine the flag value in the array until the flag value is not 0, add nodes to the initialization linked list according to the number of associated objects of the frozen task corresponding to the flag value and generate a final linked list, the data structure of each node includes the corresponding OAD, data length and data pointer of each associated object; Apply for temporary memory according to the data length, and store the frozen data of the corresponding associated object into the temporary memory, and the data pointer points to the address of the temporary memory; Loop through the flag value in the array until it is not 0, traverse the final linked list, determine all associated objects of the frozen task corresponding to the flag value according to OAD, and obtain the frozen data of the associated object of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and store it in the storage device.

[0064] In one embodiment, when the processor executes the computer program, it also implements: After the frozen data of the associated object of the frozen task is obtained from the corresponding temporary memory according to the data pointer of the associated object and stored in the storage device, the temporary memory is released.

[0065] In one embodiment, when there are more than two frozen tasks at the same time point, the processor further implements when executing the computer program: S1, adding the node of the associated object of the first frozen task to the initialization linked list according to the flag value, and updating the initialization linked list to the first linked list; S2, determine the i-th frozen task according to the flag value, where: and ; S3, traversing the i-1th linked list according to the OAD of the associated object of the i-th frozen task, and determining whether there is an associated object in the i-th frozen task that is different from the node in the i-1th linked list; S4, if it exists, add a node of a different associated object to the i-1th linked list, and update the i-1th linked list to the i-th linked list; otherwise, the i-th linked list is consistent with the i-1th linked list; S5, repeating steps S2-S4 until the node addition of the associated object of the nth frozen task is completed, and the nth linked list is updated, and the nth linked list is the final linked list.

[0066] In one embodiment, when there are more than two frozen tasks at the same time point, the processor further implements when executing the computer program: Traverse the final linked list and determine all associated objects of the frozen tasks corresponding to different flag values ​​according to OAD; The frozen data of the associated objects of the frozen tasks corresponding to different flag values ​​are respectively obtained from the corresponding temporary memory according to the data pointer of the associated objects, and are respectively stored in the storage device.

[0067] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the following steps: Get the energy meter freezing task; Generate a corresponding flag value according to the frozen task and add the flag value to the array; Loop to determine the flag value in the array until the flag value is not 0, add nodes to the initialization linked list according to the number of associated objects of the frozen task corresponding to the flag value and generate a final linked list, the data structure of each node includes the corresponding OAD, data length and data pointer of each associated object; Apply for temporary memory according to the data length, and store the frozen data of the corresponding associated object into the temporary memory, and the data pointer points to the address of the temporary memory; Loop through the flag value in the array until it is not 0, traverse the final linked list, determine all associated objects of the frozen task corresponding to the flag value according to OAD, and obtain the frozen data of the associated object of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and store it in the storage device.

[0068] In one embodiment, when the processor executes the computer program, it also implements: After the frozen data of the associated object of the frozen task is obtained from the corresponding temporary memory according to the data pointer of the associated object and stored in the storage device, the temporary memory is released.

[0069] In one embodiment, when there are more than two frozen tasks at the same time point, the processor further implements when executing the computer program: S1, adding the node of the associated object of the first frozen task to the initialization linked list according to the flag value, and updating the initialization linked list to the first linked list; S2, determine the i-th frozen task according to the flag value, where: and ; S3, traversing the i-1th linked list according to the OAD of the associated object of the i-th frozen task, and determining whether there is an associated object in the i-th frozen task that is different from the node in the i-1th linked list; S4, if it exists, add a node of a different associated object to the i-1th linked list, and update the i-1th linked list to the i-th linked list; otherwise, the i-th linked list is consistent with the i-1th linked list; S5, repeating steps S2-S4 until the node addition of the associated object of the nth frozen task is completed, and the nth linked list is updated, and the nth linked list is the final linked list.

[0070] In one embodiment, when there are more than two frozen tasks at the same time point, the processor further implements when executing the computer program: Traverse the final linked list and determine all associated objects of the frozen tasks corresponding to different flag values ​​according to OAD; The frozen data of the associated objects of the frozen tasks corresponding to different flag values ​​are respectively obtained from the corresponding temporary memory according to the data pointer of the associated objects, and are respectively stored in the storage device.

[0071] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0072] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0073] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0074] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for storing electric energy meter data, characterized in that: The method comprises: Get the energy meter freezing task; Generate a corresponding flag value according to the frozen task, and add the flag value to an array; Looping to determine the flag value in the array until the flag value is not 0, adding nodes to the initialization linked list according to the number of associated objects of the frozen task corresponding to the flag value and generating a final linked list, wherein the data structure of each node includes the OAD, data length and data pointer of each associated object; Applying for temporary memory according to the data length, and storing the frozen data of the corresponding associated object into the temporary memory, wherein the data pointer points to the address of the temporary memory; Looping to determine the flag value in the array until the flag value is not 0, traversing the final linked list, determining all associated objects of the frozen task corresponding to the flag value according to the OAD, and obtaining the frozen data of the associated object of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and storing it in the storage device; After acquiring the frozen data of the associated object of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and storing it in a storage device, the method further comprises: releasing the temporary memory; The electric energy meter freezing task includes at least one of instantaneous freezing, minute freezing, hour freezing, day freezing, settlement day freezing, month freezing, step settlement freezing, time zone table switching freezing, day time table switching freezing, rate electricity price switching freezing and step switching freezing.

2. The method according to claim 1, characterized in that The associated objects of the freezing task include forward active energy, reverse active energy, forward active total energy, reverse active total energy, combined reactive energy 1, combined reactive energy 2, combined reactive energy 1 total energy, combined reactive energy 2 total energy, first quadrant reactive energy, second quadrant reactive energy, third quadrant reactive energy, fourth quadrant reactive energy, first quadrant total reactive energy, second quadrant total reactive energy, third quadrant total reactive energy, fourth quadrant total reactive energy energy, A-phase forward active energy, B-phase forward active energy, C-phase forward active energy, A-phase reverse active energy, B-phase reverse active energy, C-phase reverse active energy, maximum forward active demand and occurrence time, maximum reverse active demand and occurrence time, A-phase voltage qualification rate, B-phase voltage qualification rate, C-phase voltage qualification rate, monthly electricity consumption, active power, reactive power, active demand, reactive demand, voltage, current and power factor.

3. The method according to claim 1, characterized in that The storage device includes at least one of EEPROM, Flash and disk storage.

4. The method according to any one of claims 1 to 3, characterized in that: When there are more than two frozen tasks at the same time point, adding nodes to the initialization linked list according to the number of associated objects of the frozen tasks corresponding to the flag value and generating a final linked list includes: S1, adding a node of an associated object of the first frozen task to the initialization linked list according to the flag value, and updating the initialization linked list to the first linked list; S2, determining the i-th frozen task according to the flag value, wherein: and ; S3, traversing the i-1th linked list according to the OAD of the associated object of the i-th frozen task, and determining whether there is an associated object in the i-th frozen task that is different from that in the node of the i-1th linked list; S4, if it exists, adding the node of the different associated object to the i-1th linked list, and updating the i-1th linked list to the i-th linked list; otherwise, the i-th linked list is consistent with the i-1th linked list; S5, repeating steps S2-S4 until the node addition of the associated object of the nth frozen task is completed, and the nth linked list is updated, and the nth linked list is the final linked list.

5. The method according to any one of claims 1 to 3, characterized in that: When there are more than two frozen tasks at the same time point, traversing the final linked list, determining all associated objects of the frozen task corresponding to the flag value according to the OAD, and obtaining the frozen data of the associated objects of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and storing them in the storage device, includes: Traversing the final linked list, determining all associated objects of the frozen tasks corresponding to different flag values ​​according to the OAD; The frozen data of the associated objects of the frozen tasks corresponding to the different flag values ​​are respectively obtained from the corresponding temporary memory according to the data pointer of the associated object, and are respectively stored in the storage device.

6. An electric energy meter data storage device, characterized in that: The device implements the steps of the method according to any one of claims 1 to 5, and the device comprises: An acquisition module is used to acquire the freezing task of the electric energy meter; A flag value generating module, used for generating a corresponding flag value according to the freezing task, and adding the flag value to an array; A final linked list generation module is used to cyclically determine the flag value in the array until the flag value is not 0, add nodes to the initialization linked list according to the number of associated objects of the frozen task corresponding to the flag value, and generate a final linked list, wherein the data structure of each node includes the OAD, data length and data pointer of each associated object; A temporary storage module, used for applying for a temporary memory according to the data length, and storing the frozen data of the corresponding associated object into the temporary memory, wherein the data pointer points to the address of the temporary memory; An associated object determination module, used for cyclically determining the flag value in the array until the flag value is not 0, traversing the final linked list, and determining all associated objects of the frozen task corresponding to the flag value according to the OAD; The data storage module is used to obtain the frozen data of the associated object of the frozen task from the corresponding temporary memory according to the data pointer of the associated object and store it in the storage device.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Intelligent electric meter segmented freezing data storage method and device and intelligent electric meter segmented freezing data query method and device

    CN109614447A

  • Minute freezing data synchronization method applied to Internet-of-Things electric energy meter

    CN113014620A

  • TOP ranking method and equipment for mass data and storage medium

    CN113810392A

  • Object memory interfaces across shared links

    US20170160963A1