CN111323626A - Uncovering detection circuit integrated in MCU and uncovering detection method based on MCU - Google Patents

Uncovering detection circuit integrated in MCU and uncovering detection method based on MCU Download PDF

Info

Publication number
CN111323626A
CN111323626A CN202010168884.7A CN202010168884A CN111323626A CN 111323626 A CN111323626 A CN 111323626A CN 202010168884 A CN202010168884 A CN 202010168884A CN 111323626 A CN111323626 A CN 111323626A
Authority
CN
China
Prior art keywords
time
detection
uncovering
mcu
event
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
CN202010168884.7A
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.)
SHENZHEN RENERGY TECHNOLOGY CO LTD
Original Assignee
SHENZHEN RENERGY 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 SHENZHEN RENERGY TECHNOLOGY CO LTD filed Critical SHENZHEN RENERGY TECHNOLOGY CO LTD
Priority to CN202010168884.7A priority Critical patent/CN111323626A/en
Publication of CN111323626A publication Critical patent/CN111323626A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R11/00Electromechanical arrangements for measuring time integral of electric power or current, e.g. of consumption
    • G01R11/02Constructional details
    • G01R11/24Arrangements for avoiding or indicating fraudulent use
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors

Abstract

A cover opening detection circuit and an electric energy meter control chip integrated in an MCU (microprogrammed control unit) are disclosed, an electric energy storage device based on an electric energy meter independently supplies power to work, a real-time clock module and other modules can run at low power consumption, the power of the real-time clock module and other modules is low, and the cover opening detection of the electric energy meter can be carried out through the cover opening detection circuit of the MCU under the condition that only the electric energy storage device supplies power when alternating current is powered off; in addition, the method and the circuit detect the level state change of the pins through the detection switch and determine whether the cover opening or closing event occurs according to the preset rule, the preset rule is set, the false triggering of the switch detection pins by interference signals can be avoided, the false cover opening or closing event is recorded, and the cover opening detection accuracy is improved.

Description

Uncovering detection circuit integrated in MCU and uncovering detection method based on MCU
Technical Field
The invention belongs to the technical field of electric meters, and particularly relates to an electric energy meter control chip of an uncovering detection circuit with an independent power supply real-time clock circuit, an uncovering detection circuit integrated in an MCU (microprogrammed control unit) and an uncovering detection method based on the MCU.
Background
The physical housing of the electric energy meter is the first line of defense against tampering, and the design of the electric energy meter must include some device capable of detecting when the electric energy meter housing is opened so as to remind a service provider that the electric energy meter may be attacked by tampering, so that a general intelligent electric meter has an open cover detection design. When the upper cover of the electric energy meter is opened, a meter cover detection switch in the electric energy meter is triggered, the electric energy meter records a meter cover opening event, in an event record acquisition rule of the electric energy meter and an acquisition terminal, the meter cover opening event belongs to a level 1 emergency event of the electric energy meter event in an event record of the electricity utilization information acquisition system, and the meaning of the emergency event is that the event that a user is suspected to have electricity stealing behavior occurs and an acquisition strategy is actively reported to a master station system.
The traditional ammeter detection mode of uncapping all detects the action of uncapping and records the time of uncapping through CPU, perhaps reports the event of uncapping to main website system through CPU, and the characteristics of this scheme need frequently awaken up CPU and detect the event of uncapping under the condition that the alternating current outage only relies on battery power supply. The CPU is in a dormant state under default conditions, the CPU is required to be awakened when the action of the key is detected, whether a cover opening event is generated or not is judged through the CPU, the cover opening time is recorded or reported, and the CPU is made to sleep after the action is completed. However, since the function control of the CPU is relatively complex and the power consumption is relatively high, the normal operation of the system is affected by detecting the uncapping event through the CPU under the condition of battery passivation, resulting in the premature depletion of the battery power.
Disclosure of Invention
The invention aims to provide an uncovering detection circuit integrated in an MCU (microprogrammed control unit) and an uncovering detection method based on the MCU, and aims to solve the problems of high power consumption and complex system caused by the fact that the traditional uncovering detection is realized based on a CPU (central processing unit).
A first aspect of an embodiment of the present invention provides an uncovering detection circuit integrated in an MCU, where the MCU can be powered by an electric energy storage device, including:
the real-time clock module is used for providing real-time;
the uncovering detection module is connected with the uncovering detection pin of the MCU and used for detecting the level state change of the uncovering detection pin, determining whether an uncovering event or a cover closing event occurs according to a preset rule and outputting a detection signal indicating the uncovering event or the cover closing event;
and the cover opening recording module is connected with the cover opening detection module and the real-time clock module and is used for receiving the detection signal and acquiring the current timestamp to record the current cover opening or cover closing event.
In one embodiment, the device further comprises an interface module, wherein the interface module is connected with the cover opening recording module and is used for sending the cover opening or cover closing event.
In one embodiment, the real time clock module includes a second counter, a minute counter, a time counter, a day counter, a month counter, a year counter, and a time setting unit for setting a counting start point of each counter.
In one embodiment, the open cover detection module includes:
the filtering unit is used for configuring the level state of the uncapping detection pin to be kept for the shortest time so as to filter interference;
the accumulator is connected with the uncapping detection pin and used for calculating the accumulation time of the uncapping detection pin which is kept in the state after the level state changes;
the comparator is connected with the uncap detection pin and used for comparing the shortest time with the accumulation time and controlling the accumulator to stop counting when the shortest time is equal to the accumulation time;
and the edge judging unit is used for comparing the current level state and the last level state of the uncovering detection pin when the shortest time is equal to the accumulation time so as to determine whether an uncovering or covering event is generated.
In one embodiment, the uncovering recording module comprises two sets of time registers, and the two sets of time registers are respectively used for acquiring the current time stamp from the real-time clock module when the detection signals of the uncovering event and the closing event are received so as to record the real-time of the current uncovering event or the closing event.
In one embodiment, each set of the time registers includes a seconds register, a minutes register, a hours register, a days register, a months register, and an years register.
A second aspect of the embodiments of the present invention provides an uncovering detection method based on an MCU, including:
detecting the level state change of an uncovering detection pin, determining whether an uncovering event or a cover closing event occurs according to a preset rule, and outputting a detection signal indicating the uncovering event or the cover closing event when the uncovering event or the cover closing event occurs;
receiving the detection signal, and acquiring a timestamp of the uncapping detection pin when the level state changes so as to record the current uncapping or closing event in real time;
sending the opening or closing event;
the real-time is provided by a real-time clock module arranged in the MCU.
In one embodiment, the step of detecting a level state change of the decap detection pin and determining whether an decap event or a decap event occurs includes:
calculating the accumulation time of the uncapping detection pin kept in the state after the level state changes;
comparing the accumulated time with a preset shortest time;
and when the shortest time is equal to the accumulation time, controlling the accumulator to stop counting, and comparing the current level state and the last level state of the uncovering detection pin to confirm whether an uncovering or covering event is generated.
In one embodiment, the preset minimum time is a preset minimum time for the level state of the decap detection pin to be maintained in one state.
The third aspect of the embodiment of the invention provides an electric energy meter control chip, which comprises the uncovering detection circuit integrated in the MCU; or the steps of the uncapping detection method are realized when the computer program is executed.
According to the uncovering detection circuit integrated with the MCU and the uncovering detection method based on the MCU, the electric energy storage device of the ammeter independently supplies power to work, the real-time clock module and other modules can run at low power consumption, the power is low, and the uncovering detection of the ammeter can be carried out through the uncovering detection circuit of the MCU under the condition that only the electric energy storage device supplies power when the alternating current is powered off; in addition, the method and the circuit detect the level state change of the pins through the detection switch and determine whether the cover opening or closing event occurs according to the preset rule, the preset rule is set, the false triggering of the switch detection pins by interference signals can be avoided, the false cover opening or closing event is recorded, and the cover opening detection accuracy is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic structural diagram of an uncapping detection circuit integrated in an MCU according to an embodiment of the present invention;
FIG. 2 is an exemplary circuit schematic of a real time clock module in the decap detection circuit of FIG. 1;
FIG. 3 is a schematic diagram of an exemplary electrical schematic of a decap detection module of the decap detection circuit of FIG. 1;
FIG. 4 is a schematic diagram of an exemplary circuit of the door opening recording module in the door opening detection circuit shown in FIG. 1
Fig. 5 is a specific flowchart of an uncapping detection method based on an MCU according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The electric energy meter is internally provided with a battery for supplying power, and is mainly used for supplying power to the real-time clock, ensuring that the real-time clock can work when the alternating current is cut off, and simultaneously supplying power to necessary circuits. Circuits that require power from a battery must operate in a low power state due to limited battery power.
An MCU (Microcontroller Unit, a micro control Unit) also called a Single chip microcomputer (Single chip microcomputer)) or a Single chip microcomputer (Single chip microcomputer) is a control Unit that controls a Central processing Unit (Central processing Unit; CPU) and the specification are appropriately reduced, and peripheral interfaces such as a memory (memory), a counter (Timer), a USB, a/D conversion, a UART, a PLC, a DMA, and the like, and even an LCD driving circuit are integrated on a single chip to form a chip-level computer, which has lower power consumption than the CPU and the MCU.
Referring to fig. 1, the uncovering detection circuit integrated in the MCU provided in the embodiment of the present application is integrated in the MCU and can be powered by the electric energy storage device, and includes a real-time clock module 110, an uncovering detection module 120, and an uncovering recording module 130.
The real-time clock module 110 is configured to provide real-time; the uncovering detection module 120 is connected with an uncovering detection pin of the MCU, and is used for detecting the level state change of the uncovering detection pin, determining whether an uncovering event or a cover closing event occurs according to a preset rule, and outputting a detection signal indicating the uncovering event or the cover closing event; the uncap recording module 130 is connected to the uncap detection module 120 and the real-time clock module 110, and is configured to receive the detection signal and obtain the current timestamp to record the current uncap or close event.
The general electric energy meter is powered by a battery and is mainly used for supplying power to the real-time clock module 110 of the MCU, so that the real-time clock module 110 can work when the alternating current is cut off, and meanwhile, the real-time clock module is used for supplying power to necessary circuits. Circuits that require power from a battery must operate in a low power state due to limited battery power. The utility model provides a battery in the ammeter is rationally utilized to the MCU chip, makes under the condition that only battery powered, carries out the ammeter through the inside low-power consumption circuit of MCU chip and uncaps and detect. The circuit of the electric energy meter adopts a multi-power-supply-domain design, wherein most of modules except an internal CPU and an MCU are powered by alternating current, and an internal real-time clock module 110, an uncapping detection module 120 and an uncapping recording module 130 of the MCU are powered by batteries and work in a low-power-consumption mode.
The preset rule refers to the shortest time kept after the level state of the uncapping detection pin is changed, so that the accuracy of judging the occurrence of an uncapping or cover closing event is ensured, and the interference of other signal sources on the uncapping detection pin is filtered. In one embodiment, in a specific circuit design, the configuring of the shortest time may be embodied as configuring an RC circuit connected to the decap detection pin, setting the size of the filter capacitor, and configuring the filter capacitor charging time mapped to the shortest time.
The MCU is internally provided with a hardware uncapping detection circuit, uncapping events are detected without the participation of a CPU, and uncapping time is automatically detected and recorded by the uncapping detection circuit. Meanwhile, a universal interface module 140 is integrated in the MCU and is mainly used for communicating with an external memory and sending an open-lid or close-lid event to the external memory, such as an EEPROM, so that data is not lost when power is lost.
Referring to fig. 2, in one embodiment, the real-time clock module 110 includes a second counter, a minute counter, a time counter, a day counter, a month counter, a year counter, and a time setting unit 112 for setting counting start points of the respective counters.
After the real-time clock module 110 is powered on, the module is in a working state all the time, and accurate real-time is provided; before the real-time clock module 110 is operated, the CPU writes the current real-time clock to the counters through the peripheral bus interface apb _ bus configuration time setting unit 112, and sets a count start point. The second counter is cleared at the same time as the time is set. Then, the second counter starts to accumulate 1 from 0, adds 1 every second, when the counting value reaches 59, generates a minute pulse which indicates that the counting is finished for 1 minute, triggers the minute counter to add 1 to the value, and simultaneously clears 0 to restart the counting; similarly, the sub-counter is added to 59, is cleared, is reset, and starts counting again, and outputs a time pulse, and the counter is added with 1 during driving; the time counter is incremented from 0 to 23; the month counter increments from 1 to 12; the values of these counters represent the real time clock and are output outside of the real time clock module 110.
Referring to fig. 3, in one embodiment, the decap detecting module 120 includes a filtering unit 121, an accumulator 122, a comparator 124, and an edge determining unit 125.
The filtering unit 121 is configured to configure the level state of the decap detection pin key to be kept for the shortest time to filter interference; the accumulator 122 is connected to the decap detection pin key, and is configured to calculate an accumulation time during which the level state of the decap detection pin key is kept in the state after being changed; the comparator 124 is connected to the decap detection pin key, and is configured to compare the shortest time with the accumulation time, and control the accumulator 122 to stop counting when the shortest time is equal to the accumulation time; the edge determining unit 125 is configured to compare the current level state of the decap detection pin key with the last level state of the decap detection pin key when the shortest time is equal to the accumulation time to determine whether an decap or decap event occurs.
The apb _ Bus pin in fig. 3 refers to a Peripheral Bus interface (Advanced Peripheral Bus), and the CPU configures an internal register of the decap detection module 120 or reads a circuit value inside the hardware module through the Bus interface, which may be understood as a channel where the CPU configures a hardware circuit through an execution program. In the present embodiment, the bus of the apb _ bus pin functions to hold the level state of the filter unit 121 for the configuration pin for the shortest time, i.e., the filter time.
The uncovering detection module 120 detects the level state change of the uncovering detection pin key in contact with the meter cover in real time, and detects whether an uncovering event or a cover closing event occurs. Specifically, a predefined filtering time (the shortest time for keeping the level state) value needs to be configured to the filtering unit 121 through the CPU, and the predefined filtering time (the shortest time for keeping the level state) value is configured according to an actual interference source, and is mainly used for preventing the uncapping false triggering, for example, the state of the uncapping detection pin key may frequently flip under the action of the interference source, and if the flipping frequency is greater than 1KHz, that is, the stable time of the uncapping detection pin key state is less than 1ms, the shortest time of the filtering unit 121 may be configured to be greater than 1ms, so as to filter the interference source. The accumulator 122 is mainly used for calculating the time for the level of the decap detection pin key to be stable, assuming that the level on the decap detection pin key is high when the electric meter cover is closed, and when the state of the decap detection pin key remains unchanged, the accumulator 122 stops counting after calculating the filtering time value of the filtering unit 121, which indicates that the current state is stable. In addition, a zero clearing control unit 123 connected with the uncovering detection pin key is further arranged, and when the zero clearing control unit 123 detects that the level of the uncovering detection pin key changes, the accumulator 122 is controlled to be cleared and count is restarted; the comparator 124 compares the accumulation time value of the accumulator 122 with the shortest time value configured by the filter unit 121 in real time, when the two values are equal, the counting of the accumulator 122 stops, at this time, the edge judgment unit 125 compares the current uncapping detection pin key state with the last uncapping detection pin key state in the register 126, and if the states are opposite, it indicates that an uncapping or closed event occurs; if the state is not changed, the cover opening or closing event is judged not to be generated. When the cover opening or closing event occurs, the cover opening detection module 120 sends a signal to the cover opening recording module 130 and the universal interface module 140, indicating that the cover opening or closing event occurs, and specifically, sends a detection signal indicating the cover opening event through the key _ pos pin and sends a detection signal indicating the cover closing event through the key _ neg pin. Wherein, key _ pos pin: the output of the pulse signal is a rising edge pulse signal of the uncapping detection pin key, and when the uncapping detection pin key is changed from a low level state to a high level state, a pulse is generated. key _ neg pin: the output of the pulse signal is a falling edge pulse signal of the uncapping detection pin key, and when the uncapping detection pin key is changed from a high level state to a low level state, a pulse is generated.
Referring to fig. 4, in one embodiment, the uncovering recording module 130 includes two sets of time registers, and the two sets of time registers are respectively used for acquiring the current time stamp from the real-time clock module 110 when the detection signal of the uncovering and closing events is received, so as to record the real-time of the current uncovering or closing event. In one embodiment, each set of time registers includes a second register, a minute register, a time register, a day register, a month register, and a year register, and the second register, the minute register, the time register, the day register, the month register, and the year register are respectively connected to the second counter, the minute counter, the time counter, the day counter, the month counter, and the year counter of the real time clock module 110.
When the uncap recording module 130 receives the detection signal indicating the uncap or close event, the uncap recording module 130 obtains the current timestamp from the real-time clock module 110, determines to record the current real-time to the register according to the configuration, and records whether the uncap or close event has occurred, but whether the current uncap or close event is recorded, which can be flexibly configured. Configuring the recording rule may include recording only a few times of the first uncapping or each uncapping, recording the latest uncapping time, overwriting the old uncapping time, saving a timestamp in an internal register when the time needs to be recorded, and waiting for the next uncapping or uncapping event. Similarly, when a closing event occurs, registers of the current time to year, month, day, hour, minute and second are also recorded. The CPU can read these registers through the interface reg _ out of the system bus to obtain the open and close times.
The interface module 140 generates a timing for writing the external memory mainly according to an interface protocol of the external memory. The communication protocol generally has the concept of frame data, before data is sent, the data to be sent at present is combined into a complete data frame, and a frame head, a frame tail, a check bit, a handshake signal and the like are added to ensure the correctness of data transmission. When a detection signal indicating an opening or closing event is received, acquiring a current timestamp from the real-time clock module 110, and sending the current timestamp to a universal external interface according to an agreed protocol, at the moment, when a controller of an external memory correctly receives a frame of data and passes verification, storing the current timestamp to the memory, and sending a successful handshake signal to the universal external module to indicate that communication is successful; otherwise, a failure handshake signal is sent to the universal peripheral interface module 140, indicating that communication has failed, and waiting for data retransmission.
Referring to fig. 5, a second aspect of the embodiment of the present invention provides an uncovering detection method based on an MCU, including:
step S120, detecting a level state change of the open-cover detection pin, determining whether an open-cover or close-cover event occurs according to a preset rule, and outputting a detection signal indicating the open-cover or close-cover event when the open-cover or close-cover event occurs.
When the meter cover is closed, the level of the uncovering detection pin of the MCU is high, and the state change of the uncovering detection pin is detected in real time at the moment. And when the level of the uncapping detection pin is detected to be low, filtering the pin state according to a preset rule configured in advance. If the time for the decap detection pin to go low is less than the configured time, for example, the configured filtering time is 20ms, and if the time for the decap detection pin to go low is 10ms, it is determined that there is no decap, and if the time for the decap detection pin to go low is 40ms, it is determined that the decap occurs.
And step S120, receiving the detection signal, and acquiring a timestamp when the level state of the uncapping detection pin changes so as to record the current uncapping or closing event in real time.
Step S130, sending the cover opening or closing event;
the real-time is provided by a real-time clock module arranged in the MCU.
In addition, whether the cover opening or closing time is recorded or not is also configured, and if the cover opening or closing time is configured, the time of the real-time clock of the current cover opening or closing event is recorded into an internal register; and the starting interface module stores the current time stamp into an external memory according to a time sequence and a data frame structure agreed in advance.
And when the uncapping time is generated, acquiring the current timestamp from the real-time clock module, and framing the data according to a predetermined time sequence advanced by the memory. And then sent to the memory through the universal peripheral interface. When the data is correctly received by the memory and the check data passes, a handshake signal is returned to indicate that the communication is successful, and the data is recorded into the memory, wherein the record of the one-time uncapping event is successful. And when the general peripheral interface module cannot receive the handshake signals returned by the memory or receives the handshake signals indicating failure, the general peripheral interface module retransmits the data. When the number of times of retransmission exceeds the set number of times, the communication is judged to fail, and the time of uncapping the cover is not recorded.
Similarly, after the cover is opened, the cover opening detection pin level is a low level, and at the moment, the action of closing the meter cover needs to be detected, namely, whether the pin is changed into a high level or not is detected and judged. And when the uncapping detection pin is detected to be changed into high level and meet the filtering time, judging the uncapping behavior, recording the time of the current real-time clock to an internal register and storing the time stamp to an external memory.
In one embodiment, the step of detecting a level state change of the decap detection pin and determining whether an decap event or a decap event occurs includes:
calculating the accumulation time of the uncapping detection pin kept in the state after the level state changes;
comparing the accumulated time with a preset shortest time;
and when the shortest time is equal to the accumulation time, controlling the accumulator to stop counting, and comparing the current level state and the last level state of the uncovering detection pin to confirm whether an uncovering or covering event is generated.
In one embodiment, the preset minimum time is a minimum time for which the pre-configured level state of the decap detection pin key is maintained in one state.
According to the uncovering detection circuit integrated with the MCU and the uncovering detection method based on the MCU, the electric energy storage device of the ammeter independently supplies power to work, the real-time clock module and other modules can run at low power consumption, the power is low, and the uncovering detection of the ammeter can be carried out through the uncovering detection circuit of the MCU under the condition that only the electric energy storage device supplies power when the alternating current is powered off; in addition, the method and the circuit can avoid the false triggering of the opening detection pin by an interference signal by detecting the level state change of the opening detection pin and determining whether an opening or closing event occurs according to a preset rule, and record the false opening or closing event, thereby improving the accuracy of the opening detection.
The third aspect of the embodiment of the invention provides an electric energy meter control chip, which comprises the uncovering detection circuit integrated in the MCU; or the steps of the uncapping detection method are realized when the computer program is executed.
The electric energy meter control chip implements the steps in the above-described embodiments of the decap detection method, such as steps 110 to 130 shown in fig. 5, when executing the computer program. Alternatively, the electric energy meter control chip implements the functions of the modules/units in the embodiments of the uncapping detection circuits described above, such as the functions of the modules 110 to 140 shown in fig. 1, when executing the computer program.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. . Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. The utility model provides an integrate in MCU's detection circuitry that uncaps, MCU available electric energy storage device supplies power which characterized in that includes:
the real-time clock module is used for providing real-time;
the uncovering detection module is connected with the uncovering detection pin of the MCU and used for detecting the level state change of the uncovering detection pin, determining whether an uncovering event or a cover closing event occurs according to a preset rule and outputting a detection signal indicating the uncovering event or the cover closing event;
and the cover opening recording module is connected with the cover opening detection module and the real-time clock module and is used for receiving the detection signal and acquiring the current timestamp to record the current cover opening or cover closing event.
2. The MCU-integrated lid opening detection circuit according to claim 1, further comprising an interface module, wherein the interface module is connected to the lid opening recording module and is configured to send the lid opening or closing event.
3. The MCU-integrated decap detecting circuit of claim 1, wherein the real time clock module comprises a second counter, a minute counter, a chronograph counter, a day counter, a month counter, a year counter, and a time setting unit for setting counting start points of the respective counters.
4. The MCU-integrated decap detection circuit of claim 1, wherein the decap detection module comprises:
the filtering unit is used for configuring the level state of the uncapping detection pin to be kept for the shortest time so as to filter interference;
the accumulator is connected with the uncapping detection pin and used for calculating the accumulation time of the uncapping detection pin which is kept in the state after the level state changes;
the comparator is connected with the uncap detection pin and used for comparing the shortest time with the accumulation time and controlling the accumulator to stop counting when the shortest time is equal to the accumulation time;
and the edge judging unit is used for comparing the current level state and the last level state of the uncovering detection pin when the shortest time is equal to the accumulation time so as to determine whether an uncovering or covering event is generated.
5. A decapping detection circuit integrated with an MCU as claimed in claim 1, wherein the decapping recording module comprises two sets of time registers, the two sets of time registers are respectively used for acquiring the current timestamp from the real-time clock module when receiving the detection signal of the decapping and decapping event, so as to record the real-time of the current decapping or decapping event.
6. The MCU-integrated decap detection circuit of claim 5, wherein each set of the time registers comprises a second register, a minute register, a time register, a day register, a month register, and a year register.
7. An uncovering detection method based on an MCU (microprogrammed control Unit) is characterized by comprising the following steps:
detecting the level state change of an uncovering detection pin, determining whether an uncovering event or a cover closing event occurs, and outputting a detection signal indicating the uncovering event or the cover closing event when the uncovering event or the cover closing event occurs;
receiving the detection signal, and acquiring a timestamp of the uncapping detection pin when the level state changes so as to record the current uncapping or closing event in real time;
sending the opening or closing event;
the real-time is provided by a real-time clock module arranged in the MCU.
8. The door opening detection method according to claim 7, wherein the step of detecting the level state change of the door opening detection pin and determining whether a door opening or closing event occurs according to a preset rule comprises:
calculating the accumulation time of the uncapping detection pin kept in the state after the level state changes;
comparing the accumulated time with a preset shortest time;
and when the shortest time is equal to the accumulation time, controlling the accumulator to stop counting, and comparing the current level state and the last level state of the uncovering detection pin to confirm whether an uncovering or covering event is generated.
9. The door opening detection method according to claim 8, wherein the preset minimum time is a preset minimum time for which a level state of the door opening detection pin is maintained in one state.
10. An electric energy meter control chip, characterized by comprising the uncovering detection circuit integrated with the MCU according to any one of claims 1 to 6; or for implementing the steps of the decap detection method of any one of claims 7-9 when executing a computer program.
CN202010168884.7A 2020-03-12 2020-03-12 Uncovering detection circuit integrated in MCU and uncovering detection method based on MCU Pending CN111323626A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010168884.7A CN111323626A (en) 2020-03-12 2020-03-12 Uncovering detection circuit integrated in MCU and uncovering detection method based on MCU

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010168884.7A CN111323626A (en) 2020-03-12 2020-03-12 Uncovering detection circuit integrated in MCU and uncovering detection method based on MCU

Publications (1)

Publication Number Publication Date
CN111323626A true CN111323626A (en) 2020-06-23

Family

ID=71167473

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010168884.7A Pending CN111323626A (en) 2020-03-12 2020-03-12 Uncovering detection circuit integrated in MCU and uncovering detection method based on MCU

Country Status (1)

Country Link
CN (1) CN111323626A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112004236A (en) * 2020-08-25 2020-11-27 大连市共进科技有限公司 Uncapping detection method and device, computer equipment and readable storage medium
CN112305282A (en) * 2020-10-10 2021-02-02 浙江晨泰科技股份有限公司 Ammeter with uncap and detect
CN113407964A (en) * 2021-06-17 2021-09-17 上海明略人工智能(集团)有限公司 Method, system, device, electronic equipment and readable storage medium for information encryption

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112004236A (en) * 2020-08-25 2020-11-27 大连市共进科技有限公司 Uncapping detection method and device, computer equipment and readable storage medium
CN112004236B (en) * 2020-08-25 2023-12-01 大连市共进科技有限公司 Uncovering detection method, uncovering detection device, computer equipment and readable storage medium
CN112305282A (en) * 2020-10-10 2021-02-02 浙江晨泰科技股份有限公司 Ammeter with uncap and detect
CN113407964A (en) * 2021-06-17 2021-09-17 上海明略人工智能(集团)有限公司 Method, system, device, electronic equipment and readable storage medium for information encryption
CN113407964B (en) * 2021-06-17 2024-02-13 上海明略人工智能(集团)有限公司 Method, system, device, electronic equipment and readable storage medium for information encryption

Similar Documents

Publication Publication Date Title
CN111323626A (en) Uncovering detection circuit integrated in MCU and uncovering detection method based on MCU
US7117107B2 (en) Computerized methods for data loggers
CN212159910U (en) MCU integrated uncapping detection circuit and electric energy meter control chip
CN101860624A (en) Crash auto-restart method and mobile phone
CN106569921B (en) A kind of metering core clock processing method and processing device of twin-core intelligent electric energy meter
CN107886702A (en) Telecommunication electric energy meter and its workflow based on carrier communication
CN102314403B (en) Device and method for identifying I2C (Inter-Integrated Circuit) bus signal by taking MCU (Micro Control Unit) as slave device
CN104606784A (en) Cardiac pacemaker system and control method thereof
CN106776218B (en) Server monitoring system with time calibration function
CN110377136A (en) A kind of PSU original value log recording method and device
CN103345440B (en) Statistical method and device of accumulated running time of electronic equipment and electronic equipment
CN109782841A (en) Implementation method, terminal device and the storage medium of real-time clock based on RTC chip
CN202434049U (en) Water meter data acquirer
CN103533184A (en) Method for reducing standby power consumption of mobile phone
CN208314989U (en) Collecting terminal based on narrowband Internet of Things
CN106528311A (en) Embedded system and control method thereof
CN113406992B (en) System clock control method, processing device and readable storage medium
CN109100654A (en) A kind of battery loss based reminding method and mobile terminal
CN112748271B (en) Electric energy meter and electric quantity metering method thereof
CN114942611A (en) Agricultural irrigation remote water meter and water meter control method
CN111044781B (en) Electric energy meter time-sharing electric quantity calculation method and device and computer equipment
CN112631526A (en) Method for reading and writing same memory by main cycle and interrupt cycle of embedded system
CN105472151A (en) Prompting method of mobile terminal and system thereof
CN108234054B (en) A kind of self-healing method of concentrator loss of clock self-test
CN111653079A (en) High-applicability remote measuring terminal

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