CN115220930A - Processing method for time-sharing shared memory of electric energy meter - Google Patents

Processing method for time-sharing shared memory of electric energy meter Download PDF

Info

Publication number
CN115220930A
CN115220930A CN202210705653.4A CN202210705653A CN115220930A CN 115220930 A CN115220930 A CN 115220930A CN 202210705653 A CN202210705653 A CN 202210705653A CN 115220930 A CN115220930 A CN 115220930A
Authority
CN
China
Prior art keywords
data
metering
shared memory
thread
freezing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210705653.4A
Other languages
Chinese (zh)
Inventor
景程
姚徐旭
卢玉凤
王朝晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Holley Technology Co Ltd
Original Assignee
Holley Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Holley Technology Co Ltd filed Critical Holley Technology Co Ltd
Priority to CN202210705653.4A priority Critical patent/CN115220930A/en
Publication of CN115220930A publication Critical patent/CN115220930A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a processing method of a time-sharing shared memory of an electric energy meter, wherein a metering thread is communicated with a metering module at regular time, and when the metering module is frozen, the metering thread is informed of data freezing and a data block A; after the metering thread receives the data block A, the metering module is informed of receiving the data block A and storing the data block A in the metering shared memory, the data block A-Related to the data block A is calculated and stored, and the freezing thread is informed of preparing the metering shared memory data; the freezing thread firstly builds a freezing data source, namely a data block B, and if the data cache in the metering shared memory is effective, the required data is fetched; if the data is invalid, taking real-time data in the metering module; and after the data block B is built, all types of freezing acquire data from the data block B. The invention ensures that the frozen data of the same data item at the same time of the metering module and the management module are consistent, and simultaneously the frozen data of the same data item at the same time of various types of freezes on the management module are consistent.

Description

Processing method for time-sharing shared memory of electric energy meter
Technical Field
The invention relates to the technical field of intelligent electric energy meters, in particular to a processing method for time-sharing shared memory of an electric energy meter.
Background
The intelligent internet of things electric energy meter adopts a multi-module design and mainly comprises a metering module and a management module. The metering module is used as a base meter and is mainly responsible for legal parts, such as basic electric energy metering, clock, minute freezing of the metering module and the like; the management module is responsible for realizing the function of the ammeter. The management module synchronizes the container data with the metering module at regular time, and if the metering module freezes, the management module is informed of the frozen data, if the management module does not respond to the confirmation frame, the management module is informed every time the management module acquires the container data. The intelligent internet of things electric energy meter requires that the freezing data of the same data item at the same moment of the metering module and the management module are kept consistent, and the freezing data of the same data item at the same moment of various freezes on the management module are kept consistent. The common practice is that basic application APP synchronizes metering module data first, and after receiving the data that freezes of metering module, begin to do all kinds of freezes of management module, communicate with the metering module afterwards. However, in a mode of realizing large functional modules of the basic application APP in different threads, the scheme is difficult to realize. The metering thread is responsible for communication with the metering module and manages data related to metering, the freezing thread is responsible for freezing various types and manages the data recorded in freezing, and the source data required by freezing is provided by the metering thread. The metering thread and the freezing thread are operated in a time-sharing mode, if simple inter-thread communication is adopted, the complex requirement cannot be met, and if the communication is frequent, the inter-thread communication pipeline can be blocked. Therefore, it is necessary to solve the problem of how to better achieve the "keeping the frozen data of the same data item at the same time for the metering module and the management module consistent, and keeping the frozen data of the same data item at the same time for each type of freezing on the management module consistent" in such a situation.
For example, chinese patent grant publication no: CN113014620A discloses a method for synchronizing data frozen in minutes of an electric energy meter of the Internet of things, the method comprises the steps that a metering module backs up electric energy information once per minute into a temporary memory, then the electric energy information backed up into the temporary memory is provided for the metering module and a management module to use, and a UART channel is used for actively reporting the data in the temporary memory to the management module every 5 seconds. The method does not meet the standard of the existing intelligent Internet of things electric energy meter. The data of the data following container is frozen in minutes of the metering module specified by the internet of things electric energy meter, the management module is informed through the SPI channel, and a UART channel between the metering module and the management module is only used when a master station or a terminal communicates with the metering module by using a logical address 01, namely when the management module finds that the received logical address in the frame of the master station or the terminal is 01, the frame is forwarded to the metering module through the UART channel.
Disclosure of Invention
Aiming at the problems, the invention provides a processing method of an electric energy meter time-sharing shared memory, wherein a metering thread is communicated with a metering module at regular time, and when the metering module is frozen, the metering thread is informed of data freezing, namely a data block A; after the metering thread receives the data block A, the metering module is informed of receiving the data block A and storing the data block A in the metering shared memory, the data block A-Related to the data block A is calculated and stored in the metering shared memory together, and the freezing thread is informed of the readiness of the metering shared memory data; the freezing thread starts to do a freezing task, a freezing data source and a data block B are firstly established, if the data cache in the metering shared memory is effective, the required data is fetched, and if the data cache is ineffective, the real-time data in the metering thread is fetched; after the data block B is built, all kinds of freezing data are taken from the data block B. The invention ensures that the frozen data of the same data item at the same time of the metering module and the management module are consistent, and simultaneously the frozen data of the same data item at the same time of various types of freezes on the management module are consistent.
In order to achieve the purpose, the invention adopts the following technical scheme:
the utility model provides a processing method of electric energy meter timesharing memory, the electric energy meter includes measurement module and management module, the management module adopts many APP schemes, including system APP, safe APP and basic application APP, the processing method of electric energy meter timesharing memory includes:
metering threads: communicating with a metering module at regular time, establishing a metering shared memory, and informing a freezing thread that the metering shared memory data is ready;
and (3) freezing the thread: and reading the frozen associated objects, establishing frozen data sources, and acquiring data from the frozen data sources by various types of freezing.
The invention provides a processing method of a time-sharing memory of an electric energy meter, which comprises the following specific processes: the measurement thread of basic application APP communicates with the measurement module regularly in the management module, and when the measurement module freezes, the basic frozen data of measurement thread, data block A are informed. And after the metering thread receives the data block A, the metering module is informed of receiving the data of the data block A, the data block A is stored at the same time, the data block A-Related to the data block A at the moment is calculated and stored together, and the freezing thread is informed of preparing the metering shared memory data. Considering the frequency of freezing of the metering module, designing N-level metering shared memory for storing the data block A and the data block A-Related, dividing the metering shared memory into N levels, and sequentially writing and reading data, wherein the data can be written in again only when idle. And the freezing thread performs a freezing task according to the parameter setting of the management module or the prepared notification of the shared memory data of the metering thread. When a freezing task is performed, in order to keep various frozen data consistent, a frozen data source, namely a data block B, is firstly established. When the data block B is established, if the data cache in the metering shared memory is effective, the required data is taken from the metering shared memory; and if the data is invalid, taking real-time data in the metering thread. And after the data block B is built, if the data block B is acquired from the metering shared memory, the metering thread is informed that the metering shared memory data is read. And starting various freezing tasks, and taking data from the data block B by various freezing tasks. Therefore, the consistency of the frozen data of the same data item at the same time of the management module and the metering module is ensured, and the consistency of the frozen data of the same data item at the same time of various types of freezes on the management module is ensured. The metering thread is communicated with the metering module, the metering thread is started actively at regular time, the metering shared memory is provided with a multi-level cache, the communication data of the management module and the metering module are not lost, and the data can be written in again only if the freezing thread reads the data. And the freezing thread belongs to a passive task, and when freezing is needed, data is acquired from the metering shared memory, a freezing data source is established, and the metering thread is informed to release the metering shared memory of the stage. Doing so can guarantee that the communication is not blockked up between the thread on the basis application APP, and the data source keeps unanimous to the communication smoothness between management module and the measurement module does not lose data, and the data source is also unanimous simultaneously.
Preferably, the metering thread includes:
the basic application APP is communicated with the metering module at regular time to obtain container data;
when the metering module is frozen, informing the basic application APP basic frozen data and a data block A;
when the basic application APP receives the data block A, sending a confirmation frame to inform the metering module that the data block A is received;
storing the data block A in a metering shared memory;
calculating a data block A-Related to the data block A, and storing the data block A-Related in a metering shared memory;
the frozen thread is informed that the metered shared memory data is ready.
The method comprises the steps that a metering thread of a basic application APP in a management module communicates with a metering module at regular time to obtain container data of the metering module; when the metering module is frozen, the metering module informs the metering thread of the basic frozen data and the data block A along with the container data; after receiving the data block A, the metering thread sends a confirmation frame to inform the metering module that the data of the data block A is received, and simultaneously stores the data block A, calculates a data block A-Related to the data block A at the moment, stores the data block A-Related together, and informs the freezing thread that the metering shared memory data is ready. After receiving the confirmation frame, the metering module does not inform; if the metering module does not receive the confirmation frame, the frozen data can be continuously informed to the metering thread along with the container data of the next frame.
Preferably, the freezing thread includes:
according to parameter setting of a management module or a notification that measurement shared memory data is prepared, judging whether a freezing task needs to be performed;
if a freezing task needs to be done, reading the frozen associated object, and establishing a frozen data source and a data block B;
and starting various freezing tasks, wherein various freezes acquire data from the data block B.
And the freezing thread sets or notifies that the shared memory data is ready according to the parameters of the management module to perform a freezing task. When a freezing task is performed, in order to keep various frozen data consistent, a frozen data source, namely a data block B, is firstly established. When the data block B is established, if the data cache in the metering shared memory is effective, the required data is taken from the metering shared memory; and if the data is invalid, taking real-time data in the metering thread. And after the data block B is built, if the data block B is acquired from the metering shared memory, the metering thread is informed that the metering shared memory data is read. And starting various freezing tasks, and taking data from the data block B by various freezing tasks. Therefore, the consistency of the frozen data of the same data item at the same time of the management module and the metering module is ensured, and the consistency of the frozen data of the same data item at the same time of various types of freezes on the management module is ensured.
Preferably, the specific process of establishing the frozen data source comprises the following steps:
step S1: reading the frozen associated objects and the total number N of the associated objects;
step S2: if the measurement shared memory data is ready, acquiring the data of the associated object from the measurement shared memory; if the metering shared memory data is not ready, taking real-time data in the metering thread;
and step S3: storing the data acquired in the step S2 into a frozen shared memory;
and step S4: repeating the step S2-S3N times to complete the establishment of the frozen data source;
step S5: and after the frozen data source is established, if the frozen data source is acquired from the metering shared memory, the metering thread is informed that the metering shared memory data is read.
Freezing tasks performed by the freezing thread are divided into two types, one type is periodic freezing, such as minute freezing and hour freezing; one is triggering class freezing, such as time zone table switching freezing, time period table switching freezing. The freezing time of the trigger class freezing and the freezing time of the metering module are possibly asynchronous, so that real-time data is acquired when a frozen data source (data block B) is established and metering shared memory data are unavailable.
Preferably, the metering shared memory is provided with a plurality of levels of caches, and data are sequentially written in and read out to ensure that the communication data of the management module and the metering module are not lost and the frozen data sources are kept consistent. Considering the frequency of freezing of the metering module, an N-level data cache is designed for storing a data block A and a data block A-Related, and for convenience of description, the data cache is called a metering shared memory in the application, the metering shared memory is divided into N levels, and is sequentially written in and read out, and the data can be written in again only when the metering shared memory is free.
Preferably, the freezing thread belongs to a passive task, and when the freezing task is needed, data is acquired from the metering shared memory, a freezing data source is established, and the metering thread is informed to release the metering shared memory of the stage. Therefore, communication between the metering thread and the freezing thread is not blocked, related data are not lost, and meanwhile various frozen data in the basic application APP are kept consistent at the same time.
Preferably, the system APP is used for communication, the security APP is used for authority management, and the basic application APP is used for realizing meter functions.
Preferably, the base application APP adopts a multi-thread scheme, including a metering thread, a freezing thread, an event thread, a display thread and a protocol thread.
Therefore, the invention has the advantages that:
(1) Under the condition that all large function modules of a basic application APP are realized in a thread-dividing mode, the requirements that frozen data of the same data item at the same moment of a metering module and a management module are kept consistent, and frozen data of the same data item at the same moment of various types of freezes on the management module are kept consistent are met;
(2) The metering thread is communicated with the metering module, and belongs to the initiative initiation of timing, the metering shared memory is provided with a multi-level cache for ensuring that the communication data of the management module and the metering module is not lost, and the data can be written again only if the data is read by the freezing thread; the freezing thread belongs to a passive task, data can be acquired from the metering shared memory when freezing is needed, a freezing data source is established, the metering thread is informed to release the metering shared memory of the level, communication between the metering thread and the freezing thread is not blocked, related data are not lost, and meanwhile various types of frozen data in the basic application APP are kept consistent at the same time.
Drawings
FIG. 1 is a block diagram of a metering thread in an embodiment of the invention.
FIG. 2 is a block diagram of a frozen thread in an embodiment of the invention.
FIG. 3 is a flow chart of the construction of frozen data sources in an embodiment of the present invention.
FIG. 4 is a diagram illustrating a data storage of a metered shared memory (level 2) according to an embodiment of the present invention.
Fig. 5 is a flowchart of searching for an idle measurement shared memory according to an embodiment of the present invention.
Fig. 6 is a schematic diagram of data storage of the frozen data source (data block B) according to an embodiment of the present invention.
Fig. 7 is a schematic diagram of data storage in the metering shared memory (level 2) according to the second embodiment of the present invention.
Fig. 8 is a schematic diagram of data storage of the frozen data source (data block B) in the second embodiment of the present invention.
Detailed Description
The invention is further described with reference to the following figures and embodiments.
An electric energy meter comprises a metering module and a management module, wherein the management module adopts a multi-APP scheme and comprises a system APP, a safety APP and a basic application APP; a processing method of an electric energy meter time-sharing memory comprises the following steps:
metering threads: communicating with a metering module at regular time, establishing a metering shared memory, and informing a freezing thread that the metering shared memory data is ready;
and (3) freezing the thread: and reading the frozen associated objects, establishing frozen data sources, and acquiring data from the frozen data sources by various types of freezing.
The metering thread comprises:
the basic application APP is communicated with the metering module at regular time to obtain container data;
when the metering module is frozen, informing the basic application APP basic frozen data and a data block A;
when the basic application APP receives the data block A, sending a confirmation frame to inform the metering module that the data block A is received;
storing the data block A in a metering shared memory;
calculating a data block A-Related to the data block A, and storing the data block A-Related in a metering shared memory;
informing the frozen thread that the metering shared memory data is ready;
as shown in fig. 1, the metering thread starts, container data is periodically acquired from the metering module, whether the container data has the frozen data (data block a) of the metering module is determined, if yes, the metering module is informed that the frozen data (data block a) is received, the data block a is stored in the metering shared memory, a data block a-Related to the data block a is calculated, the data block a-Related is stored in the metering shared memory, and the freezing thread is informed that the metering shared memory data is ready; otherwise, directly doing other tasks of the metering thread and ending the metering thread.
Freezing the thread includes:
according to parameter setting of a management module or a notification that measurement shared memory data is prepared, judging whether a freezing task needs to be performed;
if a freezing task needs to be done, reading the frozen associated object, and establishing a frozen data source and a data block B;
if the frozen data source is obtained from the metering shared memory, informing the metering thread that the metering shared memory data is read;
starting to do various freezing tasks, wherein various freezing tasks acquire data from the data block B;
as shown in fig. 2, when a freezing thread starts, it is first determined whether freezing is needed, if freezing is needed, a freezing data source is established, and if the freezing data source is obtained from the metering shared memory, the metering thread is informed that the metering shared memory data has been read, and then various freezing tasks are started, and various freezing tasks obtain data from the freezing data source; and if the freezing is not needed, ending the freezing thread.
The specific process of establishing the frozen data source comprises the following steps:
step S1: reading the frozen associated objects and the total number N of the associated objects;
step S2: if the measurement shared memory data is ready, acquiring the data of the associated object from the measurement shared memory; if the metering shared memory data is not ready, taking real-time data in the metering thread;
and step S3: storing the data acquired in the step S2 into a frozen shared memory;
and step S4: repeating the step S2-S3N times to complete the establishment of the frozen data source;
as shown in fig. 3, starting to set up a frozen data source, acquiring the associated object OAD of the frozen class to be done and the total number N of the associated objects, acquiring data from the measurement shared memory according to the associated object OAD, and if the acquisition is successful (if the measurement shared memory data cache is valid, the acquisition can be successful), storing the acquired data in the frozen shared memory; otherwise, acquiring real-time OAD data from the metering thread, storing the data into the freezing shared memory, repeating the process for N times, and finishing the establishment of the freezing data source.
The embodiment provides a processing method for a time-sharing memory of an electric energy meter, which specifically comprises the following steps: the measurement thread of basic application APP communicates with the measurement module regularly in the management module, and when the measurement module freezes, the basic frozen data of measurement thread, data block A are informed. And after the metering thread receives the data block A, the metering module is informed of receiving the data of the data block A, the data block A is stored at the same time, the data block A-Related to the data block A at the moment is calculated and stored together, and the freezing thread is informed of preparing the metering shared memory data. Considering the frequency of freezing by the metering module, designing N-level metering shared memory for storing the data block A and the data block A-Related, dividing the metering shared memory into N levels, and sequentially writing and reading data, wherein the data can be written in again only when free. And the freezing thread performs a freezing task according to the parameter setting of the management module or the prepared notification of the shared memory data of the metering thread. When a freezing task is performed, in order to keep various frozen data consistent, a frozen data source, namely a data block B, is firstly established. When the data block B is established, if the data cache in the metering shared memory is effective, the required data is taken from the metering shared memory; and if the data is invalid, taking real-time data in the metering thread. And after the data block B is built, if the data block B is acquired from the metering shared memory, the metering thread is informed that the metering shared memory data is read. And starting various freezing tasks, and taking data from the data block B by various freezing tasks. The metering thread is communicated with the metering module, timing active initiation is achieved, the metering shared memory is provided with a multi-level cache, and data can be written in again only after the freezing thread reads the data. And the freezing thread belongs to a passive task, and when freezing is needed, data can be acquired from the metering shared memory, a freezing data source is established, and the metering thread is informed to release the metering shared memory of the stage.
According to the requirement of intelligent thing allies oneself with the electric energy meter, the minute of measurement module freezes the requirement as follows: recording the positive active total electric energy, the negative active total electric energy, the voltage, the current, the one-minute average active power, the one-minute average reactive power and the power factor every 1 minute; and recording the total forward fundamental wave electric energy, the total reverse fundamental wave electric energy, the total forward harmonic electric energy, the total reverse harmonic electric energy and the four-quadrant reactive electric energy every 15 minutes. The power failure or the set time causes the missing of the minute freezing data, and the next minute freezing data needs to be supplemented. The management module adopts many APP multithreading scheme, according to APP branch system APP, safe APP, basic application APP, system APP mainly is responsible for the communication, and safe APP is the authority management, and basic application APP is the main function that realizes the table meter.
The method is mainly used for basic applications APP, and the basic applications APP adopt a multi-thread scheme and divide metering threads, freezing threads, event threads, display threads, protocol threads and the like according to functional modules. And the metering thread communicates with the metering module at intervals of 500ms to acquire container data, and if the metering module is frozen in minutes, the metering thread is informed of the container data together with the container data. After receiving the minute frozen data, the metering thread sends a confirmation frame to inform the metering module, and after receiving the confirmation frame, the metering module does not inform the metering module; if the metering module does not receive the confirmation frame, the minute frozen data will follow the container data of the next frame and continuously inform the metering thread. The metering module generally freezes data in 1 minute and 1 frame, when the metering module is subjected to supplementary freezing, communication is frequent, and the data can be frozen in minutes for 2 500ms continuously, so that in the embodiment, the metering shared memory is designed according to a level 2 cache. If the basic application APP in the management module is not ready to be frozen in 500ms, a 3-level cache can be opened up, and the principle of the invention is not influenced.
The first embodiment is as follows:
in the first embodiment, the following conditions are assumed: the metering shared memory opens up a level 2 data cache, and the period of the minute freezing of the management module is 3 minutes. At the 1 st 500ms, the minute freeze data received by the metering thread, referred to as data block a, is 1 minute of minute freeze data. At this time, the management module needs to freeze for minutes, and as shown in fig. 6, the related objects of freezing are the total forward active electric energy and the forward active rate 2 electric energy. And the next 500ms, the metering thread receives the minute freezing data again, or the minute freezing data of 1 minute, and the management module does not need to do minute freezing at the moment.
The implementation condition of the method comprises the following steps: when the electric energy meter is initialized, the 2-level cache of the metering shared memory is idle, and the 1 st-level cache is written firstly by default. The 1 st minute frozen data received in 500ms is stored in the 1 st level cache of the metering shared memory, and the Related data block A-Related at the time is calculated and stored in the 1 st level cache together, and the 1 st level cache is busy. The data received in the next 1 ms and 500ms are stored in the level 2 buffer through the same operation, and the level 2 buffer is busy. Metering level 2 shared memory data storage is shown in fig. 4, and searching for free metered shared memory is shown in fig. 5.
And under the time-sharing operating system, the thread freezing is also carried out. When the level 1 cache of the metering shared memory is busy, the freezing thread starts to start, whether freezing is needed at present is judged, if yes, the frozen associated object is read, the level 1 data of the metering shared memory is read according to the associated object, a frozen data source is established, and the data of the frozen data source is stored as shown in fig. 6. After the establishment is finished, the 1 st level cache of the metering shared memory is idled and then frozen. When the 2 nd level cache of the metering shared memory is busy, the freezing thread starts to start again, whether freezing is needed at present is judged, if not, the metering shared memory is quitted, and the 2 nd level cache of the metering shared memory is idle.
The second embodiment:
in example two, the conditions are assumed: the metering shared memory opens up a level 2 data cache, and the period of minute freezing of the management module is 15 minutes. At the 1 st 500ms, the minute freezing data received by the metering thread is called a data block A and is the minute freezing data of 1 minute, and at the moment, the management module does not need to do minute freezing. And the next 500ms, the metering thread receives the minute freezing data which are the minute freezing data of 1 minute and the minute freezing data of 15 minutes, the management module needs to freeze the minutes at the moment, and the frozen related objects are the forward active total electric energy, the forward active rate 4 electric energy, the quadrant 4 total electric energy and the quadrant 3 rate 5 electric energy.
The implementation situation of the method is as follows: the implementation steps are the same as those of the first embodiment, except that the metering of the shared memory and the freezing of the data source is inconsistent with those of the first embodiment, as shown in fig. 7 and 8.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (8)

1. The utility model provides a processing method of electric energy meter timesharing shared memory, the electric energy meter includes measurement module and management module, the management module adopts many APP schemes, including system APP, safe APP and basic application APP, its characterized in that, the processing method of electric energy meter timesharing shared memory includes:
metering threads: communicating with a metering module at regular time, establishing a metering shared memory, and informing a freezing thread that the metering shared memory data is ready;
and (3) freezing the thread: and reading the frozen associated objects, establishing frozen data sources, and acquiring data from the frozen data sources by various types of freezing.
2. The method according to claim 1, wherein the metering thread comprises:
the basic application APP is communicated with the metering module at regular time to obtain container data;
when the metering module is frozen, informing the basic application APP basic frozen data and a data block A;
when the basic application APP receives the data block A, sending a confirmation frame to inform the metering module that the data block A is received;
storing the data block A in a metering shared memory;
calculating a data block A-Related to the data block A, and storing the data block A-Related in a metering shared memory;
the frozen thread is notified that the metered shared memory data is ready.
3. The processing method of the electric energy meter time sharing shared memory according to the claim 1 or 2, characterized in that the freezing thread comprises:
according to parameter setting of a management module or a notification that measurement shared memory data is ready, judging whether a freezing task needs to be performed;
if a freezing task needs to be done, reading the frozen associated object, and establishing a frozen data source and a data block B;
and starting various freezing tasks, wherein various freezing tasks acquire data from the data block B.
4. The method for processing the electric energy meter time-sharing memory according to claim 1, wherein the specific process of establishing the frozen data source comprises the following steps:
step S1: reading the frozen associated objects and the total number N of the associated objects;
step S2: if the measurement shared memory data is ready, acquiring the data of the associated object from the measurement shared memory; if the metering shared memory data is not ready, taking real-time data in the metering thread;
and step S3: storing the data acquired in the step S2 into a frozen shared memory;
and step S4: repeating the step S2-S3N times to complete the establishment of the frozen data source;
step S5: and after the frozen data source is established, if the frozen data source is acquired from the metering shared memory, the metering thread is informed that the metering shared memory data is read.
5. The processing method of the electric energy meter time sharing shared memory according to the claim 1 or 2, characterized in that the metering shared memory is provided with a multi-level cache, and data are written in and read out in sequence.
6. The method for processing the electric energy meter time-sharing shared memory according to claim 4, wherein the freezing thread belongs to a passive task, and when the freezing task is needed, the freezing thread acquires data from the metering shared memory, constructs a freezing data source, and informs the metering thread to release the metering shared memory of the stage.
7. The processing method of the electric energy meter time-sharing memory according to claim 1, characterized in that the system APP is used for communication, the security APP is used for authority management, and the basic application APP is used for realizing meter functions.
8. The processing method for the time-sharing shared memory of the electric energy meter according to the claim 1 or 7, characterized in that the basic application APP adopts a multi-thread scheme, and comprises a metering thread, a freezing thread, an event thread, a display thread and a protocol thread.
CN202210705653.4A 2022-06-21 2022-06-21 Processing method for time-sharing shared memory of electric energy meter Pending CN115220930A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210705653.4A CN115220930A (en) 2022-06-21 2022-06-21 Processing method for time-sharing shared memory of electric energy meter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210705653.4A CN115220930A (en) 2022-06-21 2022-06-21 Processing method for time-sharing shared memory of electric energy meter

Publications (1)

Publication Number Publication Date
CN115220930A true CN115220930A (en) 2022-10-21

Family

ID=83608262

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210705653.4A Pending CN115220930A (en) 2022-06-21 2022-06-21 Processing method for time-sharing shared memory of electric energy meter

Country Status (1)

Country Link
CN (1) CN115220930A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116303124A (en) * 2023-03-29 2023-06-23 浙江正泰仪器仪表有限责任公司 Data searching method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116303124A (en) * 2023-03-29 2023-06-23 浙江正泰仪器仪表有限责任公司 Data searching method and device, electronic equipment and storage medium
CN116303124B (en) * 2023-03-29 2024-01-30 浙江正泰仪器仪表有限责任公司 Data searching method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109803224B (en) Low-power-consumption positioning method and system, positioning terminal, service platform and control terminal
CN115220930A (en) Processing method for time-sharing shared memory of electric energy meter
CN105388991B (en) Timing wake-up processing system and method
CN112530056B (en) Method for reducing power consumption of intelligent door lock, intelligent door lock and storage medium
CN103188379B (en) Information reminding method and device
US20160360008A1 (en) Efficient context monitoring
HUE026325T2 (en) A vehicle locating unit with improved power management method
CN113400957B (en) Self-starting charging method and device for extended range vehicle, electronic equipment and medium
CN110909006A (en) Data synchronization method and device, computer equipment and storage medium
CN112235742A (en) Gas meter with NB-IoT communication module embedded with program and data processing method
CN111257608B (en) Synchronous processing method of multi-core intelligent electric energy meter and multi-core intelligent electric energy meter
US20080155546A1 (en) Method of controlling thread access to a synchronization object
CN103678522A (en) Method for acquiring and converting data of metering system of intelligent transformer substation
CN111352796B (en) Method and device for acquiring electric quantity by intelligent wearable equipment
CN113406992B (en) System clock control method, processing device and readable storage medium
CN106162239B (en) Guard based reminding method and system
CN214480603U (en) Bluetooth clock circuit structure
CN113602127A (en) Charging pile energy management method and device
CN111315000A (en) Vehicle data transmission method, device, equipment and storage medium
CN102163365B (en) Telemetric data acquiring method
CN111555947A (en) MCU low-power consumption dormancy awakening system
CN112954783B (en) Single-chip low-power-consumption system based on built-in GNSS and implementation method thereof
CN116489761B (en) Wireless time setting method, device, time setting device and sensor
CN112084022B (en) Project capacity planning method and device, computer equipment and storage medium
CN111263312A (en) Tracker and tracking method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination