CN104637180A - Intelligent gas meter electronic impulse caching processing method - Google Patents

Intelligent gas meter electronic impulse caching processing method Download PDF

Info

Publication number
CN104637180A
CN104637180A CN201510055307.6A CN201510055307A CN104637180A CN 104637180 A CN104637180 A CN 104637180A CN 201510055307 A CN201510055307 A CN 201510055307A CN 104637180 A CN104637180 A CN 104637180A
Authority
CN
China
Prior art keywords
rapid pulse
button
buffer
rushes
access
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.)
Granted
Application number
CN201510055307.6A
Other languages
Chinese (zh)
Other versions
CN104637180B (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.)
Chengdu Qinchuan IoT Technology Co Ltd
Original Assignee
Chengdu Qinchuan Technology Development 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 Chengdu Qinchuan Technology Development Co Ltd filed Critical Chengdu Qinchuan Technology Development Co Ltd
Priority to CN201510055307.6A priority Critical patent/CN104637180B/en
Publication of CN104637180A publication Critical patent/CN104637180A/en
Application granted granted Critical
Publication of CN104637180B publication Critical patent/CN104637180B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses an intelligent gas meter electronic impulse caching processing method. The method comprises the steps of turn number impulse interrupt processing function processing and main program turn number impulse processing function processing. The step of turn number impulse interrupt processing function processing comprises the substeps that 11, an MCU detects turn number impulse interrupt through an impulse sampling circuit and enters a turn number impulse interrupt processing function; 12, the visit mutual exclusion semaphore of a turn number impulse cache is visited, whether the turn number impulse cache is visited by the turn number impulse interrupt processing function or not is judged, and the next operation is executed. According to the intelligent gas meter electronic impulse caching processing method, the MCU is used for automatically caching electronic impulses, the problem that counting losses are caused in the gas meter using process is solved, and the powerful guarantee is provided for the complete matching between mechanical metering and electronic metering of a gas meter.

Description

A kind of intelligent gas meter electronic impulse method for caching and processing
Technical field
The present invention relates to a kind of intelligent gas meter electronic impulse method for caching and processing.
Background technology
Intelligent gas meter domestic at present mainly contains these several large classes such as IC-card intelligent gas meter, CPU card intelligent gas meter, radio frequency card intelligent gas meter, flow meter, direct-reading remote transmitting gas meter (wired remote-transmission table) and wireless telemetering gas-meter (integrated), and along with the raising of people's living standard and quality of life, "smart" products demand required for modernization family, will impel intelligent gas meter towards security, reliability, intelligent convenience future development.
But existing intelligent gas meter is difficult to accomplish fitting like a glove of machinery metering and electronic measurement, and in use there is the problem of error of omission number.
Summary of the invention
The object of the invention is to overcome the deficiencies in the prior art, a kind of intelligent gas meter electronic impulse method for caching and processing is provided, solve the problem that number in use appears failing to record in existing gas meter, flow meter.
The object of the invention is to be achieved through the following technical solutions: a kind of intelligent gas meter electronic impulse method for caching and processing, it comprises button rapid pulse and rushes interrupt processing function processing step and master routine button number burst process function processing step;
Described button rapid pulse rushes interrupt processing function processing step and comprises following sub-step:
S11: main control MCU detects button number pulse-break by pulse sampling circuit, enters button rapid pulse and rushes interrupt processing function;
S12: access button rapid pulse rushes the access mutex of buffer, judges that button rapid pulse rushes buffer and whether can be rushed interrupt processing function access by button rapid pulse:
(1) detain rapid pulse rush buffer can not by button rapid pulse rush interrupt processing function access, namely access mutex be not 0 time:
S1211: button rapid pulse rushes the direct make-up rapid pulse of interrupt processing function and rushes temporary buffer and do and add an operation;
S1212: exit button rapid pulse and rush interrupt processing function;
(2) detain rapid pulse rush buffer can by button rapid pulse rush interrupt processing function access, namely access mutex be 0 time:
S1221: the access mutex set of button rapid pulse being rushed buffer, does not allow other routine access;
S1222: button rapid pulse rushes buffer and does and add an operation, adds the value that button rapid pulse rushes temporary buffer;
S1223: remove button rapid pulse and rush temporary buffer, release button rapid pulse rushes the access mutex of buffer;
S1224: exit button rapid pulse and rush interrupt processing function;
Described master routine button number burst process function processing step comprises following sub-step:
S21: main control MCU enters master routine button number burst process function;
S22: access button rapid pulse rushes the access mutex of buffer, judge to detain rapid pulse rush buffer whether can by master routine button number burst process function access:
(1) if it is not 0 that button rapid pulse rushes the value that namely buffer can not be accessed mutex by master routine button number burst process function access, then master routine button number burst process function directly exits;
(2) if button rapid pulse rushes value that namely buffer can be accessed mutex by master routine button number burst process function access when being 0:
S2221: the access mutex set of button rapid pulse being rushed buffer, does not allow other routine access;
S2222: judge that button rapid pulse rushes buffer and whether has the punching of button rapid pulse, namely button rapid pulse rushes whether the value of buffer is 0:
(1) if button rapid pulse rushes buffer without the punching of button rapid pulse:
S222211: after button rapid pulse being rushed the reset of buffer access mutex;
S222212: exit master routine button number burst process function;
(2) if button rapid pulse rushes buffer the punching of button rapid pulse:
S222221: reading button rapid pulse rushes the button rapid pulse punching in buffer, puts into temporary storage;
S222222: remove the value that button rapid pulse rushes buffer;
S222223: release button rapid pulse rushes the access mutex of buffer;
S222224: row relax is rushed in the button rapid pulse in temporary storage;
S222225: exit master routine button number burst process function.
The model of described main control MCU is MSP430.
Described master routine button number burst process function processing step supplements deduction with money for gas meter, flow meter.
The invention has the beneficial effects as follows: (1) the present invention can pass through the automatic caching electronic pulse of main control MCU, solve the counting loss problem that gas meter, flow meter occurs in use procedure, provide strong guarantee for the machinery metering and electronic measurement that realize gas meter, flow meter fit like a glove; (2) button rapid pulse of the present invention rushes interrupt processing function processing step for the counting to gas meter, flow meter, and master routine button number burst process function processing step is for taking out the counting of gas meter, flow meter and deducting fees; (3) adopt the method that mutex is set, improve reliability of the present invention.
Accompanying drawing explanation
Fig. 1 is the inventive method process flow diagram.
Embodiment
Below in conjunction with accompanying drawing, technical scheme of the present invention is described in further detail: as shown in Figure 1, a kind of intelligent gas meter electronic impulse method for caching and processing, it comprises button rapid pulse and rushes interrupt processing function processing step and master routine button number burst process function processing step;
Described button rapid pulse rushes interrupt processing function processing step and comprises following sub-step:
S11: main control MCU detects button number pulse-break by pulse sampling circuit, enters button rapid pulse and rushes interrupt processing function;
S12: access button rapid pulse rushes the access mutex of buffer, judges that button rapid pulse rushes buffer and whether can be rushed interrupt processing function access by button rapid pulse:
(1) detain rapid pulse rush buffer can not by button rapid pulse rush interrupt processing function access, namely access mutex be not 0 time:
S1211: button rapid pulse rushes the direct make-up rapid pulse of interrupt processing function and rushes temporary buffer and do and add an operation;
S1212: exit button rapid pulse and rush interrupt processing function;
(2) detain rapid pulse rush buffer can by button rapid pulse rush interrupt processing function access, namely access mutex be 0 time:
S1221: the access mutex set of button rapid pulse being rushed buffer, does not allow other routine access;
S1222: button rapid pulse rushes buffer and does and add an operation, adds the value that button rapid pulse rushes temporary buffer;
S1223: remove button rapid pulse and rush temporary buffer, release button rapid pulse rushes the access mutex of buffer;
S1224: exit button rapid pulse and rush interrupt processing function;
Described master routine button number burst process function processing step comprises following sub-step:
S21: main control MCU enters master routine button number burst process function;
S22: access button rapid pulse rushes the access mutex of buffer, judge to detain rapid pulse rush buffer whether can by master routine button number burst process function access:
(1) if it is not 0 that button rapid pulse rushes the value that namely buffer can not be accessed mutex by master routine button number burst process function access, then master routine button number burst process function directly exits;
(2) if button rapid pulse rushes value that namely buffer can be accessed mutex by master routine button number burst process function access when being 0:
S2221: the access mutex set of button rapid pulse being rushed buffer, does not allow other routine access;
S2222: judge that button rapid pulse rushes buffer and whether has the punching of button rapid pulse, namely button rapid pulse rushes whether the value of buffer is 0:
(1) if button rapid pulse rushes buffer without the punching of button rapid pulse:
S222211: after button rapid pulse being rushed the reset of buffer access mutex;
S222212: exit master routine button number burst process function;
(2) if button rapid pulse rushes buffer the punching of button rapid pulse:
S222221: reading button rapid pulse rushes the button rapid pulse punching in buffer, puts into temporary storage;
S222222: remove the value that button rapid pulse rushes buffer;
S222223: release button rapid pulse rushes the access mutex of buffer;
S222224: row relax is rushed in the button rapid pulse in temporary storage;
S222225: exit master routine button number burst process function.
The model of described main control MCU is MSP430.
Described master routine button number burst process function processing step supplements deduction with money for gas meter, flow meter.

Claims (3)

1. an intelligent gas meter electronic impulse method for caching and processing, is characterized in that: it comprises button rapid pulse and rushes interrupt processing function processing step and master routine button number burst process function processing step;
Described button rapid pulse rushes interrupt processing function processing step and comprises following sub-step:
S11: main control MCU detects button number pulse-break by pulse sampling circuit, enters button rapid pulse and rushes interrupt processing function;
S12: access button rapid pulse rushes the access mutex of buffer, judges that button rapid pulse rushes buffer and whether can be rushed interrupt processing function access by button rapid pulse:
(1) detain rapid pulse rush buffer can not by button rapid pulse rush interrupt processing function access, namely access mutex be not 0 time:
S1211: button rapid pulse rushes the direct make-up rapid pulse of interrupt processing function and rushes temporary buffer and do and add an operation;
S1212: exit button rapid pulse and rush interrupt processing function;
(2) detain rapid pulse rush buffer can by button rapid pulse rush interrupt processing function access, namely access mutex be 0 time:
S1221: the access mutex set of button rapid pulse being rushed buffer, does not allow other routine access;
S1222: button rapid pulse rushes buffer and does and add an operation, adds the value that button rapid pulse rushes temporary buffer;
S1223: remove button rapid pulse and rush temporary buffer, release button rapid pulse rushes the access mutex of buffer;
S1224: exit button rapid pulse and rush interrupt processing function;
Described master routine button number burst process function processing step comprises following sub-step:
S21: main control MCU enters master routine button number burst process function;
S22: access button rapid pulse rushes the access mutex of buffer, judge to detain rapid pulse rush buffer whether can by master routine button number burst process function access:
(1) if it is not 0 that button rapid pulse rushes the value that namely buffer can not be accessed mutex by master routine button number burst process function access, then master routine button number burst process function directly exits;
(2) if button rapid pulse rushes value that namely buffer can be accessed mutex by master routine button number burst process function access when being 0:
S2221: the access mutex set of button rapid pulse being rushed buffer, does not allow other routine access;
S2222: judge that button rapid pulse rushes buffer and whether has the punching of button rapid pulse, namely button rapid pulse rushes whether the value of buffer is 0:
(1) if button rapid pulse rushes buffer without the punching of button rapid pulse:
S222211: after button rapid pulse being rushed the reset of buffer access mutex;
S222212: exit master routine button number burst process function;
(2) if button rapid pulse rushes buffer the punching of button rapid pulse:
S222221: reading button rapid pulse rushes the button rapid pulse punching in buffer, puts into temporary storage;
S222222: remove the value that button rapid pulse rushes buffer;
S222223: release button rapid pulse rushes the access mutex of buffer;
S222224: row relax is rushed in the button rapid pulse in temporary storage;
S222225: exit master routine button number burst process function.
2. a kind of intelligent gas meter electronic impulse method for caching and processing according to claim 1, is characterized in that: the model of described main control MCU is MSP430.
3. a kind of intelligent gas meter electronic impulse method for caching and processing according to claim 1, is characterized in that: described master routine button number burst process function processing step supplements deduction with money for gas meter, flow meter.
CN201510055307.6A 2015-02-03 2015-02-03 A kind of intelligent gas meter electronic impulse method for caching and processing Active CN104637180B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510055307.6A CN104637180B (en) 2015-02-03 2015-02-03 A kind of intelligent gas meter electronic impulse method for caching and processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510055307.6A CN104637180B (en) 2015-02-03 2015-02-03 A kind of intelligent gas meter electronic impulse method for caching and processing

Publications (2)

Publication Number Publication Date
CN104637180A true CN104637180A (en) 2015-05-20
CN104637180B CN104637180B (en) 2017-01-04

Family

ID=53215879

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510055307.6A Active CN104637180B (en) 2015-02-03 2015-02-03 A kind of intelligent gas meter electronic impulse method for caching and processing

Country Status (1)

Country Link
CN (1) CN104637180B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2581952Y (en) * 2002-11-29 2003-10-22 福建省天通电讯科技有限公司 Flow pulse counting acquiring display and data transmission apparatus
CN2620249Y (en) * 2003-05-26 2004-06-09 上海联欣科技发展有限公司 Single-double pulse anti-interference multi-channel input circuit for watermeter and gas-meter
JP2006064430A (en) * 2004-08-25 2006-03-09 Yazaki Corp Automatic meter reading unit
JP2010020491A (en) * 2008-07-09 2010-01-28 Osaka Gas Co Ltd Adapter

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2581952Y (en) * 2002-11-29 2003-10-22 福建省天通电讯科技有限公司 Flow pulse counting acquiring display and data transmission apparatus
CN2620249Y (en) * 2003-05-26 2004-06-09 上海联欣科技发展有限公司 Single-double pulse anti-interference multi-channel input circuit for watermeter and gas-meter
JP2006064430A (en) * 2004-08-25 2006-03-09 Yazaki Corp Automatic meter reading unit
JP2010020491A (en) * 2008-07-09 2010-01-28 Osaka Gas Co Ltd Adapter

Also Published As

Publication number Publication date
CN104637180B (en) 2017-01-04

Similar Documents

Publication Publication Date Title
CN103142255A (en) Women ovulatory period electronic detection instrument and detection method
CN203276356U (en) Internet checking-in and advertisement all-in-one machine
CN201562317U (en) Three-phase three-wire CPU card intelligent electric energy meter
CN212134809U (en) Module for embedded intelligent load identification
CN104637180A (en) Intelligent gas meter electronic impulse caching processing method
CN108153623B (en) Method and device for testing energy efficiency ratio of SATA interface hard disk
CN206192430U (en) Long -range meter system that copies based on pulse water gauge
CN108627207A (en) Ultrasonic electronic water meter
CN204008835U (en) A kind of current sensing means based on wireless singlechip
CN201233603Y (en) Automatic triggering type wide range radio frequency antenna
TW201010297A (en) Decoding apparatus and method
CN204731331U (en) A kind of flip flop equipment of SPDIF interface signal
CN205680137U (en) A kind of Intelligent Checking on Work Attendance logger
CN203311491U (en) Statistical system for people flow rate of library individual-study room
CN205537762U (en) Humiture measuring circuit of prepackage type transformer substation
CN204131495U (en) Non-refrigerated infrared detector interface sequence control circuit
CN103354608A (en) Intelligent meter reading device
CN206594720U (en) A kind of human body sensing device
CN201757653U (en) Instrument function expanding device
CN207319227U (en) A kind of general man-computer interactive communication circuit
CN106370255A (en) Remote meter reading system based on pulse water meter
CN108635806A (en) A kind of training acquisition reponse system
CN201903926U (en) Electric energy meter
CN210466678U (en) Drowning alarm device based on ZigBee communication
CN203149689U (en) Intelligent population flow detection door

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 610199 Longquanyi, Sichuan Province Industrial Park licensing

Patentee after: Chengdu Qinchuan networking Polytron Technologies Inc

Address before: 610199 Longquanyi, Sichuan Province Industrial Park licensing

Patentee before: Chengdu Taichuan Technology Development Co., Ltd.