CN113358924B - Multithreading double-core smart electric meter time-sharing metering processing method and device - Google Patents

Multithreading double-core smart electric meter time-sharing metering processing method and device Download PDF

Info

Publication number
CN113358924B
CN113358924B CN202110485024.0A CN202110485024A CN113358924B CN 113358924 B CN113358924 B CN 113358924B CN 202110485024 A CN202110485024 A CN 202110485024A CN 113358924 B CN113358924 B CN 113358924B
Authority
CN
China
Prior art keywords
time
electric quantity
quantity data
real
difference value
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.)
Active
Application number
CN202110485024.0A
Other languages
Chinese (zh)
Other versions
CN113358924A (en
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.)
Xuji Group Co Ltd
Southern Power Grid Digital Grid Research Institute Co Ltd
Henan Xuji Instrument Co Ltd
Original Assignee
Xuji Group Co Ltd
Southern Power Grid Digital Grid Research Institute Co Ltd
Henan Xuji Instrument 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 Xuji Group Co Ltd, Southern Power Grid Digital Grid Research Institute Co Ltd, Henan Xuji Instrument Co Ltd filed Critical Xuji Group Co Ltd
Priority to CN202110485024.0A priority Critical patent/CN113358924B/en
Publication of CN113358924A publication Critical patent/CN113358924A/en
Application granted granted Critical
Publication of CN113358924B publication Critical patent/CN113358924B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R22/00Arrangements for measuring time integral of electric power or current, e.g. electricity meters
    • G01R22/06Arrangements for measuring time integral of electric power or current, e.g. electricity meters by electronic methods
    • G01R22/061Details of electronic electricity meters
    • G01R22/068Arrangements for indicating or signaling faults

Abstract

The invention discloses a time-sharing metering processing method and device for a multi-thread double-core intelligent ammeter, wherein the method comprises the following steps: establishing a time-sharing metering APP thread, and setting mutex for the time-sharing metering APP thread; acquiring first real-time electric quantity data of a metering unit, second real-time electric quantity data of a management unit and an electric quantity data difference value of the first real-time electric quantity data and the second real-time electric quantity data; judging whether the electric quantity data difference value is in a normal range or not; if the electric quantity data difference value is in the normal range, updating the cache data of the intelligent ammeter according to the rate time period currently executed by the intelligent ammeter and the electric quantity data difference value, and releasing mutual exclusion; and if the electric quantity data difference value is in an abnormal range, keeping the second real-time electric quantity data unchanged. The management unit is used for acquiring the time interval mutex of the metering unit and carrying out corresponding synchronous operation according to the comparison result of the difference value of the time interval mutex and the preset threshold value, so that the effective fault tolerance of the double-core intelligent electric meter in time-sharing metering is realized, and the high-frequency, high-efficiency and high-real-time data interaction is guaranteed.

Description

Multithreading double-core smart electric meter time-sharing metering processing method and device
Technical Field
The invention relates to the technical field of intelligent electric meter control, in particular to a multithreading double-core intelligent electric meter time-sharing metering processing method and device.
Background
With the implementation of the electric energy IR46 standard, the metering function of the smart meter is required to be independent of other functions. In the future full market competition, multi-rate time-sharing metering strategies formulated by different electricity selling main bodies are more pertinent, diverse and real-time, and the method has great significance for safe, economic and reliable operation of the power grid. The domestic existing intelligent electric meter is designed in an integrated manner, namely, the metering function and other functions do not have independent working requirements; the intelligent electric meter software system is designed circularly as a main function, and the multi-rate time-sharing metering function is realized by the whole electric meter software system. If demand change or equipment failure occurs, the smooth operation of power operation can be guaranteed only by replacing the whole meter, and a severe challenge is brought to the time-sharing metering mode of the intelligent electric meter.
According to the requirement of the IR46 standard, the electronic equipment of the intelligent electric meter is separated from the components, and the metering function is independent from other functions. The time-sharing measurement of the double-core intelligent electric meter runs by means of double-core SPI bus communication, the management core acquires time-sharing measurement electric quantity data by actively requesting the measurement core, the management core reads the measurement electric quantity data of the measurement core through a serial port in the network hanging running process, the measurement electric quantity data is converted into the charging electric energy through a multi-rate time-sharing measurement strategy and is uploaded to a master station or provided for a user to inquire the power consumption, so that the requirements on the reliability and the real-time performance of communication interaction are extremely strict, if the electric quantity measurement communication interaction fails due to failure, the measured electric charge has errors, the charging is not accurate enough, and even power consumption disputes are generated.
Disclosure of Invention
The embodiment of the invention aims to provide a multithreading double-core intelligent ammeter time-sharing metering processing method and device.
In order to solve the above technical problem, a first aspect of an embodiment of the present invention provides a method for processing a multi-thread dual-core smart meter in a time-sharing manner, where the smart meter includes: the management unit and the metering unit comprise the following steps:
establishing a time-sharing metering APP thread, and setting mutual exclusion for the time-sharing metering APP thread;
acquiring first real-time electric quantity data of the metering unit, second real-time electric quantity data of the management unit and electric quantity data difference values of the first real-time electric quantity data and the second real-time electric quantity data, wherein the first real-time electric quantity data comprise: the method comprises the following steps of (1) forward active total electric energy, reverse active total electric energy and four-quadrant reactive total electric energy;
judging whether the electric quantity data difference value is in a normal range or not;
if the electric quantity data difference value is within a normal range, updating cache data of the intelligent ammeter according to a rate time period currently executed by the intelligent ammeter and the electric quantity data difference value, and releasing mutual exclusion, wherein the cache data comprises: the current time-sharing rate electric quantity and the second real-time electric quantity data;
and if the electric quantity data difference value is in an abnormal range, keeping the second real-time electric quantity data unchanged.
Further, the determining whether the electric quantity data difference value is within a normal range includes:
judging whether the electric quantity data difference value is smaller than a preset threshold value or not;
if the electric quantity data difference value is smaller than the preset threshold value, judging that the increment of the first real-time electric quantity data is normal, and further updating the second real-time electric quantity data into the numerical value of the first real-time electric quantity data;
and if the electric quantity data difference value is larger than or equal to the preset threshold value, judging that the increment of the first real-time electric quantity data is abnormal, and further judging that the first real-time electric quantity data of the metering unit is abnormal.
Further, after determining whether the electric quantity data difference value is smaller than a preset threshold, the method further includes:
judging whether the electric quantity data difference value is 0 or not;
if so, the mutex is released directly.
Further, before the time period according to the rate currently executed by the smart meter, the method further includes:
and acquiring the rate time period executed by the intelligent electric meter at present according to the time information of the management unit through the time zone time period table data of the intelligent electric meter.
Further, after the updating the cache data of the smart meter, the method further includes:
and sending the cache data to an external memory and/or a backup storage unit according to a preset time interval.
Correspondingly, a second aspect of the embodiments of the present invention provides a multi-thread dual-core smart meter time-sharing metering processing apparatus, where the smart meter includes: a management unit and a metering unit comprising:
the device comprises a mutual exclusion amount setting module, a time-sharing measurement module and a time-sharing measurement module, wherein the mutual exclusion amount setting module is used for establishing a time-sharing measurement APP thread and setting a mutual exclusion amount used for the time-sharing measurement APP thread;
the acquisition module is used for acquiring first real-time electric quantity data of the metering unit, second real-time electric quantity data of the management unit and electric quantity data difference values of the first real-time electric quantity data and the second real-time electric quantity data, wherein the first real-time electric quantity data comprise: the method comprises the following steps of (1) forward active total electric energy, reverse active total electric energy and four-quadrant reactive total electric energy;
the judging module is used for judging whether the electric quantity data difference value is in a normal range or not;
the control module is used for updating the cache data of the intelligent ammeter according to the rate time period currently executed by the intelligent ammeter and the electric quantity data difference value when the electric quantity data difference value is within a normal range, and releasing mutual exclusion, wherein the cache data comprises: the current time-sharing rate electric quantity and the second real-time electric quantity data;
the control module is further used for keeping the second real-time electric quantity data unchanged when the electric quantity data difference value is in an abnormal range.
Further, the judging module comprises:
the first judgment unit is used for judging whether the electric quantity data difference value is smaller than a preset threshold value or not;
the first control unit is used for judging that the increment of the first real-time electric quantity data is normal when the electric quantity data difference value is smaller than the preset threshold value, and then updating the second real-time electric quantity data into the value of the first real-time electric quantity data;
the first control unit is further configured to determine that the increment of the first real-time electric quantity data is abnormal when the electric quantity data difference is greater than or equal to the preset threshold, and further determine that the first real-time electric quantity data of the metering unit is abnormal.
Further, the determining module further includes:
the second judging unit is used for judging whether the electric quantity data difference value is 0 or not;
and the second control unit is used for directly releasing the mutex when the electric quantity data difference value is 0.
Further, the control module further comprises:
and the third control unit is used for acquiring the rate time period executed by the intelligent electric meter at present according to the time information of the management unit through the time zone time period table data of the intelligent electric meter.
Further, the time-sharing measurement processing device for the multi-thread dual-core smart meter further comprises:
and the data storage module is used for sending the cache data to an external memory and/or a backup storage unit according to a preset time interval.
Accordingly, a third aspect of the embodiments of the present invention further provides an electronic device, including: at least one processor; and a memory coupled to the at least one processor; the memory stores instructions which can be executed by the processor, and the instructions are executed by the processor to enable the at least one processor to execute the multithreading double-core smart electric meter time-sharing metering processing method.
In addition, in a fourth aspect of the embodiment of the present invention, a computer-readable storage medium is further provided, where computer instructions are stored, and when the instructions are executed by a processor, the method for processing time-sharing metering of a multi-thread dual-core smart meter is implemented.
The technical scheme of the embodiment of the invention has the following beneficial technical effects:
the management unit of the intelligent electric meter acquires the time interval mutex of the metering unit, and corresponding synchronous operation is carried out according to the comparison result of the real-time electric quantity data difference value and the preset threshold value of the metering unit, so that effective fault tolerance of time-sharing metering of the double-core intelligent electric meter is realized, and high-frequency, high-efficiency and high-real-time data interaction of electric quantity data is guaranteed.
Drawings
Fig. 1 is a flowchart of a multithreading two-core smart meter time-sharing measurement processing method according to an embodiment of the present invention;
fig. 2 is a block diagram of a module of a multi-thread dual-core smart meter time-sharing metering processing device according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a determining module according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a control module according to an embodiment of the present invention.
Reference numerals:
1. the device comprises a mutex setting module 2, an acquisition module 3, a judgment module 31, a first judgment unit 32, a first control unit 33, a second judgment unit 34, a second control unit 4, a control module 41, a third control unit 5 and a data storage module.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings in conjunction with the following detailed description. It should be understood that the description is intended to be exemplary only, and is not intended to limit the scope of the present invention. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present invention.
Fig. 1 is a flowchart of a multithreading two-core smart meter time-sharing metering processing method according to an embodiment of the present invention.
Referring to fig. 1, a first aspect of the embodiments of the present invention provides a method for processing a multi-thread dual-core smart meter in a time-sharing manner, where the smart meter includes: the management unit and the metering unit comprise the following steps:
s100, establishing a time-sharing metering APP thread, and setting mutexes for the time-sharing metering APP thread.
Through the thread management API interface of the intelligent electric meter operating system, a time-sharing metering APP thread is established, and the normal operation of the time-sharing metering APP application starting, exiting and service functions is guaranteed.
S200, acquiring first real-time electric quantity data of the metering unit, second real-time electric quantity data of the management unit and electric quantity data difference values of the first real-time electric quantity data and the second real-time electric quantity data, wherein the first real-time electric quantity data comprise: the system comprises forward active total electric energy, reverse active total electric energy and four-quadrant reactive total electric energy.
Through the mutual exclusion API interface of the intelligent electric meter operating system, a mutual exclusion ID _ A used for a time-sharing metering APP thread is created, the time-sharing metering APP is guaranteed to run in the process, other threads are not allowed to modify the metering data of the time-sharing metering thread running within the set time after the mutual exclusion is started, the uniqueness of the time-sharing metering thread on metering data access is guaranteed, and the problem that the electric quantity of the intelligent electric meter is disordered due to the modification of the metering data by other threads is avoided. Only after the time-sharing metering thread unlocks the mutex, the metering data can be modified and accessed by other threads.
Furthermore, through a common function interface, the time-sharing metering thread acquires real-time electric quantity DATA DATA _ A of the metering unit of the double-core intelligent electric meter, including positive active total electric energy, negative active total electric energy and four-quadrant reactive total electric energy, and the DATA DATA _ A is used for electric quantity comparison in subsequent steps, so that the real-time performance and the accuracy of electric energy metering DATA are guaranteed, and the requirement of real-time updating of electric energy DATA is met.
And S300, judging whether the electric quantity data difference value is in a normal range.
S400, if the electric quantity data difference value is within a normal range, updating cache data of the intelligent electric meter according to the rate time period currently executed by the intelligent electric meter and the electric quantity data difference value, and releasing mutex, wherein the cache data comprises: the current time-share rate power and the second real-time power data.
And determining the rate period RATA _ A currently executed by the intelligent electric meter according to the time of the double-core intelligent electric meter management unit through the time zone period table data of the intelligent electric meter so as to ensure that the time-sharing rate electric energy is updated in time and the metering is accurate.
Meanwhile, through a fixed checking method, the checking code of the second real-time electric quantity DATA DATA _ B in the management unit is calculated, the uniqueness of the second real-time electric quantity DATA DATA _ B is ensured, and DATA support is provided for judging the correctness of the second real-time electric quantity DATA DATA _ B.
And S500, if the electric quantity data difference value is in an abnormal range, keeping the second real-time electric quantity data unchanged.
After the synchronization process of the electric quantity data is finished, the mutex ID _ A of the time-sharing metering APP thread is released through the mutex API of the electric energy meter operating system, and the protected time-sharing metering data can be modified and accessed by other threads within a fixed time.
According to the technical scheme, the management unit of the intelligent ammeter acquires the time interval mutual exclusion of the metering unit, corresponding synchronous operation is carried out according to the comparison result of the real-time electric quantity data difference value and the preset threshold value of the metering unit, effective fault tolerance of time-sharing metering of the double-core intelligent ammeter is achieved, and high-frequency, high-efficiency and high-real-time data interaction of the electric quantity data is guaranteed.
Further, in step S300, determining whether the electric quantity data difference is within the normal range further includes the following steps:
and S310, judging whether the electric quantity data difference value is smaller than a preset threshold value.
And S320, if the electric quantity data difference value is smaller than a preset threshold value, judging that the increment of the first real-time electric quantity data is normal, and updating the second real-time electric quantity data into a numerical value of the first real-time electric quantity data.
S330, if the electric quantity data difference value is larger than or equal to the preset threshold value, judging that the increment of the first real-time electric quantity data is abnormal, and further judging that the first real-time electric quantity data of the metering unit is abnormal.
And judging whether the electric quantity DATA difference value DATA _ C is larger than a preset threshold value, wherein optionally, the preset threshold value can be 0x200 according to the historical electric quantity DATA. If the electric quantity DATA difference value DATA _ C is smaller than the preset threshold, it indicates that the electric quantity increment is normal within the fixed time, and the management unit electric quantity DATA _ B can be updated normally. And if the electric quantity DATA difference value DATA _ C is larger than or equal to the preset threshold, indicating that the electric quantity increment is abnormal within the fixed time, setting the electric quantity abnormal state of the metering unit, and not executing normal updating on the management unit electric quantity DATA _ B. The normal measurement of the electric quantity data of the management unit can be ensured in the process, and the problems of electric energy measurement flying, disorder and the like are prevented. When an abnormal problem occurs, the electric meter state words are updated to timely feed back the abnormal state of the electric meter, and a user can be timely reminded of on-site processing through the main station, so that the loss of the user is reduced to the minimum.
Further, after judging whether the electric quantity data difference value is smaller than the preset threshold value, the method further comprises the following steps:
and S311, judging whether the electric quantity data difference value is 0.
S312, if yes, directly releasing the mutex.
And comparing whether the second real-time electric quantity DATA DATA _ B of the double-core intelligent ammeter management unit is consistent with the acquired first real-time electric quantity DATA DATA _ A of the metering unit or not, and calculating electric energy increment DATA DATA _ C.
If DATA _ a = = DATA _ B, the power DATA difference is 0, which indicates that the power DATA of the management unit and the metering unit are consistent, and the mutex may be released directly without updating the power DATA _ B of the management unit.
If the DATA _ a and the DATA _ B are not equal, it indicates that the power DATA of the management unit and the metering unit are inconsistent, and the power DATA _ B of the management unit needs to be updated.
Further, before the tariff period currently executed by the smart meter, the method further includes:
and acquiring the rate time period executed by the intelligent electric meter at present according to the time information of the management unit through the time zone time period table data of the intelligent electric meter.
Further, after the step S400 updates the cache data of the smart meter, the method further includes:
and S600, sending the cache data to an external memory and/or a backup storage unit according to a preset time interval.
And in a fixed interval, second real-time electric quantity DATA DATA _ B in the management unit is transferred to an EEPROM (electrically erasable programmable read-only memory) and a backup storage area of an external storage, so that when one part of DATA is abnormal, other DATA sources can be used, failure and disorder of electric energy DATA are avoided, and traceability, accuracy and reliability of electric energy metering DATA are ensured.
Fig. 2 is a block diagram of a multithreading two-core smart meter time-sharing metering processing module according to an embodiment of the present invention.
Correspondingly, referring to fig. 2, a second aspect of the embodiment of the present invention provides a time-sharing measurement processing apparatus for a multi-thread dual-core smart meter, where the smart meter includes: management unit and metering unit, include: the device comprises a mutex setting module 1, an acquisition module 2, a judgment module 3 and a control module 4. The mutex setting module 1 is used for establishing a time-sharing measurement APP thread and setting mutex for the time-sharing measurement APP thread. The obtaining module 2 is used for obtaining first real-time electric quantity data of the metering unit, second real-time electric quantity data of the management unit and electric quantity data difference values of the first real-time electric quantity data and the second real-time electric quantity data, wherein the first real-time electric quantity data comprises: the system comprises forward active total electric energy, reverse active total electric energy and four-quadrant reactive total electric energy. The judging module 3 is used for judging whether the electric quantity data difference value is in a normal range; control module 4 is used for when the electric quantity data difference is located normal scope, according to the rate period of time and the electric quantity data difference that smart electric meter executed at present, updates smart electric meter's cache data to release the mutex, wherein cache data includes: the current time-share rate power and the second real-time power data. The control module 4 is further configured to keep the second real-time electric quantity data unchanged when the electric quantity data difference value is in the abnormal range.
Fig. 3 is a schematic diagram of a determining module according to an embodiment of the present invention.
Further, referring to fig. 3, the determining module 3 includes: a first judging unit 31 and a first control unit 32. The first judging unit 31 is configured to judge whether the electric quantity data difference is smaller than a preset threshold; the first control unit 32 is configured to determine that the increment of the first real-time electric quantity data is normal when the electric quantity data difference is smaller than a preset threshold, and further update the second real-time electric quantity data to a numerical value of the first real-time electric quantity data; the first control unit 32 is further configured to determine that the increment of the first real-time electric quantity data is abnormal when the electric quantity data difference is greater than or equal to the preset threshold, and further determine that the first real-time electric quantity data of the metering unit is abnormal.
Further, the judging module 3 further includes: a second determination unit 33 and a second control unit 34. The second judging unit 33 is configured to judge whether the electric quantity data difference is 0; the second control unit 34 is configured to directly release the mutex when the power data difference is 0.
Fig. 4 is a schematic diagram of a control module according to an embodiment of the present invention.
Further, referring to fig. 4, the control module 4 includes: a third control unit 41. The third control unit 41 is configured to obtain the rate time period currently executed by the smart meter according to the time information of the management unit through the time zone time period table data of the smart meter.
Further, multithreading double-core smart electric meter timesharing measures processing apparatus still includes:
and the data storage module 5 is used for sending the cache data to the external memory and/or the backup storage unit according to a preset time interval.
Accordingly, a third aspect of the embodiments of the present invention further provides an electronic device, including: at least one processor; and a memory coupled to the at least one processor; the memory stores instructions which can be executed by one processor, and the instructions are executed by one processor so as to enable at least one processor to execute the multithreading double-core smart meter time-sharing metering processing method.
In addition, a fourth aspect of the embodiments of the present invention further provides a computer-readable storage medium, on which computer instructions are stored, and when the instructions are executed by a processor, the method for processing time-sharing metering of a multi-thread two-core smart meter is implemented.
The embodiment of the invention aims to protect a multithreading double-core intelligent ammeter time-sharing metering processing method and a device, wherein the intelligent ammeter comprises: management unit and measurement unit, wherein the method includes: establishing a time-sharing metering APP thread, and setting mutex for the time-sharing metering APP thread; acquiring first real-time electric quantity data of the metering unit, second real-time electric quantity data of the management unit and electric quantity data difference values of the first real-time electric quantity data and the second real-time electric quantity data, wherein the first real-time electric quantity data comprise: the method comprises the following steps of (1) forward active total electric energy, reverse active total electric energy and four-quadrant reactive total electric energy; judging whether the electric quantity data difference value is in a normal range or not; if the electric quantity data difference value is in a normal range, updating cache data of the intelligent electric meter according to the rate time period currently executed by the intelligent electric meter and the electric quantity data difference value, and releasing mutual exclusion, wherein the cache data comprises: the current time-sharing rate electric quantity and the second real-time electric quantity data; and if the electric quantity data difference value is in an abnormal range, keeping the second real-time electric quantity data unchanged. The technical scheme has the following effects:
the management unit of the intelligent electric meter acquires the time interval mutex of the metering unit, and corresponding synchronous operation is carried out according to the comparison result of the real-time electric quantity data difference value and the preset threshold value of the metering unit, so that effective fault tolerance of time-sharing metering of the double-core intelligent electric meter is realized, and high-frequency, high-efficiency and high-real-time data interaction of electric quantity data is guaranteed.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting the same, and although the present invention is described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications and equivalents may be made to the embodiments of the invention without departing from the spirit and scope of the invention, which is to be covered by the claims.

Claims (8)

1. A multithreading double-core smart meter time-sharing metering processing method is characterized in that a smart meter comprises the following steps: the management unit and the metering unit comprise the following steps:
establishing a time-sharing measurement APP thread, and setting a mutual exclusion for the time-sharing measurement APP thread;
acquiring first real-time electric quantity data of the metering unit, second real-time electric quantity data of the management unit and an electric quantity data difference value of the first real-time electric quantity data and the second real-time electric quantity data, wherein the first real-time electric quantity data comprises: the method comprises the following steps of (1) forward active total electric energy, reverse active total electric energy and four-quadrant reactive total electric energy;
judging whether the electric quantity data difference value is in a normal range or not;
if the electric quantity data difference value is in a normal range, updating cache data of the intelligent ammeter according to the rate time period currently executed by the intelligent ammeter and the electric quantity data difference value, and releasing mutex, wherein the cache data comprises: the current time-sharing rate electric quantity and the second real-time electric quantity data;
if the electric quantity data difference value is in an abnormal range, keeping the second real-time electric quantity data unchanged;
wherein, the judging whether the electric quantity data difference value is in a normal range includes:
judging whether the electric quantity data difference value is smaller than a preset threshold value or not;
if the electric quantity data difference value is smaller than the preset threshold value, judging that the increment of the first real-time electric quantity data is normal, and further updating the second real-time electric quantity data into the numerical value of the first real-time electric quantity data;
and if the electric quantity data difference value is larger than or equal to the preset threshold value, judging that the increment of the first real-time electric quantity data is abnormal, and further judging that the first real-time electric quantity data of the metering unit is abnormal.
2. The time-sharing metering processing method of the multi-thread double-core smart electric meter according to claim 1, wherein after judging whether the electric quantity data difference value is smaller than a preset threshold value, the time-sharing metering processing method further comprises:
judging whether the electric quantity data difference value is 0 or not;
if so, the mutex is released directly.
3. The method for processing time-sharing metering of a multi-thread dual-core smart meter according to claim 1, wherein before a charging period according to the current execution of the smart meter, the method further comprises:
and acquiring the rate time period executed by the intelligent electric meter at present according to the time information of the management unit through the time zone time period table data of the intelligent electric meter.
4. The method for processing the time-sharing measurement of the multi-thread double-core smart meter according to claim 1, wherein after the updating of the cache data of the smart meter, the method further comprises:
and sending the cache data to an external memory and/or a backup storage unit according to a preset time interval.
5. The utility model provides a multithread two-core smart electric meter timesharing measurement processing apparatus which characterized in that, smart electric meter includes: a management unit and a metering unit comprising:
the mutual exclusion setting module is used for establishing a time-sharing metering APP thread and setting the mutual exclusion for the time-sharing metering APP thread;
the acquisition module is used for acquiring first real-time electric quantity data of the metering unit, second real-time electric quantity data of the management unit and electric quantity data difference values of the first real-time electric quantity data and the second real-time electric quantity data, wherein the first real-time electric quantity data comprises: the method comprises the following steps of (1) forward active total electric energy, reverse active total electric energy and four-quadrant reactive total electric energy;
the judging module is used for judging whether the electric quantity data difference value is in a normal range or not;
the control module is used for updating the cache data of the intelligent ammeter according to the rate time period currently executed by the intelligent ammeter and the electric quantity data difference value when the electric quantity data difference value is within a normal range, and releasing mutual exclusion, wherein the cache data comprises: the current time-sharing rate electric quantity and the second real-time electric quantity data;
the control module is further used for keeping the second real-time electric quantity data unchanged when the electric quantity data difference value is in an abnormal range;
wherein, the judging module comprises:
the first judgment unit is used for judging whether the electric quantity data difference value is smaller than a preset threshold value or not;
the first control unit is used for judging that the increment of the first real-time electric quantity data is normal when the electric quantity data difference value is smaller than the preset threshold value, and then updating the second real-time electric quantity data into the value of the first real-time electric quantity data;
the first control unit is further configured to determine that the increment of the first real-time electric quantity data is abnormal when the electric quantity data difference is greater than or equal to the preset threshold, and further determine that the first real-time electric quantity data of the metering unit is abnormal.
6. The time-sharing metering processing device of the multi-thread dual-core smart meter according to claim 5, wherein the judging module further comprises:
a second determination unit configured to determine whether the electric quantity data difference is 0;
and the second control unit is used for directly releasing the mutex when the electric quantity data difference value is 0.
7. The time-sharing metering processing device for the multi-thread double-core smart meter according to claim 5, wherein the control module further comprises:
and the third control unit is used for acquiring the rate time period executed by the intelligent electric meter at present according to the time information of the management unit through the time zone time period table data of the intelligent electric meter.
8. The time-sharing metering processing device of the multi-thread dual-core smart meter according to claim 5, further comprising:
and the data storage module is used for sending the cache data to an external memory and/or a backup storage unit according to a preset time interval.
CN202110485024.0A 2021-04-30 2021-04-30 Multithreading double-core smart electric meter time-sharing metering processing method and device Active CN113358924B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110485024.0A CN113358924B (en) 2021-04-30 2021-04-30 Multithreading double-core smart electric meter time-sharing metering processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110485024.0A CN113358924B (en) 2021-04-30 2021-04-30 Multithreading double-core smart electric meter time-sharing metering processing method and device

Publications (2)

Publication Number Publication Date
CN113358924A CN113358924A (en) 2021-09-07
CN113358924B true CN113358924B (en) 2022-12-06

Family

ID=77525733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110485024.0A Active CN113358924B (en) 2021-04-30 2021-04-30 Multithreading double-core smart electric meter time-sharing metering processing method and device

Country Status (1)

Country Link
CN (1) CN113358924B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016090908A1 (en) * 2014-12-12 2016-06-16 国家电网公司 Memory simulation testing board system and testing method for embedded application of intelligent electric meter
CN111488290A (en) * 2020-04-28 2020-08-04 南方电网数字电网研究院有限公司 Thread testing method and device based on intelligent electric meter operating system

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1245810C (en) * 2002-09-03 2006-03-15 华为技术有限公司 Multithreading test method utilized in tester for communication devices
US8244642B2 (en) * 2006-06-22 2012-08-14 Itron, Inc. System and method for storing metering data while increasing memory endurance
US9633407B2 (en) * 2011-07-29 2017-04-25 Intel Corporation CPU/GPU synchronization mechanism
CN102662747A (en) * 2012-04-23 2012-09-12 深圳市融创天下科技股份有限公司 Method, system and terminal device for threads to access critical zones
CN106569028B (en) * 2016-10-17 2019-12-27 国家电网公司 Electric quantity synchronous processing method and system of double-core intelligent electric energy meter
CN106569164B (en) * 2016-10-17 2019-04-23 国家电网公司 A kind of synchronous detecting method and system of twin-core electric energy meter electricity
CN110333387B (en) * 2019-06-13 2021-08-31 宁波三星医疗电气股份有限公司 Electric energy metering method of electric energy meter
CN110891016A (en) * 2019-10-29 2020-03-17 深圳供电局有限公司 Energy gateway for accurate metering
CN111257608B (en) * 2020-02-17 2021-06-22 浙江正泰仪器仪表有限责任公司 Synchronous processing method of multi-core intelligent electric energy meter and multi-core intelligent electric energy meter
CN112098924B (en) * 2020-11-04 2021-02-23 南方电网数字电网研究院有限公司 Interactive function testing method and device based on double-core intelligent electric meter
CN112557714A (en) * 2020-12-10 2021-03-26 宁波迦南智能电气股份有限公司 Multi-core modular intelligent electric energy meter

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016090908A1 (en) * 2014-12-12 2016-06-16 国家电网公司 Memory simulation testing board system and testing method for embedded application of intelligent electric meter
CN111488290A (en) * 2020-04-28 2020-08-04 南方电网数字电网研究院有限公司 Thread testing method and device based on intelligent electric meter operating system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于多线程技术的用电管理信息系统;周明刚等;《计算机时代》;20100502(第05期);第35-36页 *

Also Published As

Publication number Publication date
CN113358924A (en) 2021-09-07

Similar Documents

Publication Publication Date Title
CN102004828A (en) Method for computing work amount
CN114143201A (en) Power distribution network fusion terminal equipment control method based on low code technology
CN110196404A (en) A kind of metering chip calibration method, device and the terminal device of charging pile
CN107181284B (en) Method and device for adjusting out-of-limit electric quantity of circuit
CN110021792A (en) Charge control method, device, terminal device and computer storage medium
CN109193802A (en) A kind of Demand-side resource regulating method and system considering new energy prediction error
US20160111880A1 (en) Power controller, power control method, and power control system
CN104578411A (en) Multi-source data safety verification and failure locking method after PMU (Phasor Measurements Units) data's accessing to AGC (Automatic Generation Control)
CN113358924B (en) Multithreading double-core smart electric meter time-sharing metering processing method and device
CN109490618A (en) A kind of amended record method of load curves of electric energy meter
CN109391038A (en) A kind of dispositions method of intelligent substation interval observing and controlling function
CN115436871A (en) Method for preventing zero line missing electricity stealing of single-phase electric energy meter based on low power consumption
WO2013093119A1 (en) System for distributing electrical energy over a cluster of electrical devices, method for distributing electrical energy over a cluster of electrical devices of such a system and controller for use in such a system
WO2018205425A1 (en) Battery charging method
CN101727098A (en) Cycle time target measuring method and system
CN106786533B (en) The acquisition methods and device of electric dispatching plan data
CN111508154A (en) Charging system with double controllers and control method thereof
CN104991193B (en) Rechargeable battery uses efficiency tracing system and method
CN109309394A (en) The reservation charging control method and device of the vehicles with power supply system
CN111398675A (en) Electric energy meter reading method, device and system
CN104301159B (en) A kind of monitoring method and system of server cluster
CN106779179A (en) The load forecasting method and equipment of a kind of air-conditioner set
CN115940301A (en) Power factor control method, device, equipment and storage medium
CN114626700A (en) BIM-based transport airport construction management method, system, device and storage medium
CN112667643A (en) Power failure data storage method and device based on double-core intelligent electric meter

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
GR01 Patent grant
GR01 Patent grant