CN102789434B - A kind of data buffering method and system - Google Patents

A kind of data buffering method and system Download PDF

Info

Publication number
CN102789434B
CN102789434B CN201210223314.9A CN201210223314A CN102789434B CN 102789434 B CN102789434 B CN 102789434B CN 201210223314 A CN201210223314 A CN 201210223314A CN 102789434 B CN102789434 B CN 102789434B
Authority
CN
China
Prior art keywords
module
expansion board
data
communication
master control
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
CN201210223314.9A
Other languages
Chinese (zh)
Other versions
CN102789434A (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.)
Wuhu Ding Han railway transportation equipment Co., Ltd.
Original Assignee
Beijing Dinghan 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 Beijing Dinghan Technology Co Ltd filed Critical Beijing Dinghan Technology Co Ltd
Priority to CN201210223314.9A priority Critical patent/CN102789434B/en
Publication of CN102789434A publication Critical patent/CN102789434A/en
Application granted granted Critical
Publication of CN102789434B publication Critical patent/CN102789434B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Communication Control (AREA)

Abstract

The invention discloses a kind of data buffering method and system, described method comprises: master control set issues configuration information to the expansion board of communicating by letter, and communication expansion board is determined subordinate's number of modules and initializes buffering area according to configuration information; Communication expansion board is inquired about subordinate's module data and refreshes to buffering area every Preset Time; Master control set inquiry subordinate module data, the module data of buffering is fed back to master control set by communication expansion board. Of the present inventionly can reduce internal memory, and real-time is high, master control set is separate to the data query of module with the expansion board of communicating by letter to the data query of communication expansion board, saving communication time.

Description

A kind of data buffering method and system
Technical field
The present invention relates to data communication technology field, relate in particular to a kind of data buffering method and system.
Background technology
Buffer technology is the work that between the equipment differing greatly for coordination data flow speed, data transmit.Arrive and leave away the unmatched place of speed in data, just should use buffer technology. Existing buffer technologyComprise:
Double buffering, the way that solves the parallel work-flow problem between two peripheral hardwares, printer and terminals is to arrangeDouble buffering. After having had two buffers, CPU can put into one of them buffering the data that output to printerDevice (district), allow printer slowly print; Then the buffer (district) that, it can arrange for terminal from another againIn read needed input data.
Many bufferings, are that multiple buffering areas are coupled together to composition two parts, and a part is specifically designed to input, separatelyA part is specifically designed to the buffer structure of output.
Buffer Pool, couples together unified management multiple buffering areas, not only can be used for input but also can be used for outputBuffer structure.
And for the limited situation of buffer memory in the CPU of communication expansion board, above-mentioned several buffer technologys are also inapplicable,Need the least possible buffering in a kind of committed memory space.
Summary of the invention
The object of the invention is to propose a kind of data buffering method and system, can reduce internal memory, and in real timeProperty high, master control set to communication expansion board data query mutual to the data query of module with the expansion board of communicating by letterIndependent, save communication time.
For reaching this object, the present invention by the following technical solutions:
A kind of data buffering method, for railway signal power supply monitoring module, the method comprises:
Master control set issues configuration information to the expansion board of communicating by letter, and communication expansion board is determined subordinate according to configuration informationNumber of modules also initializes buffering area;
Communication expansion board is inquired about subordinate's module data and refreshes to buffering area every Preset Time;
Master control set inquiry subordinate module data, the module data of buffering is fed back to master control dress by communication expansion boardPut, now in buffering area, read and write pointer separate.
Described initialization buffering area comprises: initialize the data structure of each module and by the read-write pointer of buffering areaPoint to 0.
Described communication expansion board is inquired about subordinate's module data and is further comprised:
Communication expansion board issues querying command to module, opens the communication timer of described module simultaneously;
If communication expansion board has been collected complete module data, close communication timer the brush of described moduleThe data of module described in new buffering area;
If communication expansion board issues and obtains alert command, the Data Update of described module is complete and start inquiryNext module, otherwise communication expansion board continues to issue querying command.
If communication expansion board is not collected complete module data, further comprise:
Close the serial timer of described module and wrong number N is added to 1;
If wrong number N is greater than 3, the expansion board of communicating by letter is sent and is interrupted alarm and start to inquire about next module, noThe expansion board of communicating by letter continues to issue querying command.
If subordinate's module of master control set inquiry comprises the module that communication expansion board is being inquired about, communication is expandedIn the module data of panel feedback, do not comprise the module that described communication expansion board is being inquired about.
A kind of data buffering system, for railway signal power supply monitoring module, described system comprises: master control dressPut, communication expansion board and subordinate's module, described master control set is connected with communication expansion board by CAN bus,Communication expansion board is connected with subordinate module by RS485 bus;
Described master control set issues configuration information to communicating by letter under expansion board and inquiry and reception for master control setLevel module data;
Described communication expansion board, for buffering area is provided, regularly inquires about subordinate's module data and refreshes to bufferingDistrict, when master control set inquiry subordinate module data, feeds back to master control set by the module data of buffering.
System according to claim 1, the memory headroom that described communication expansion board utilization distributes is as beingThe buffering area of system, the read-write pointer in buffering area is separate.
System according to claim 1, comprises at least two communication expansion board, each communication expansion boardBy hanging at least one subordinate's module under RS485 bus.
Adopt technical scheme of the present invention, can reduce internal memory, and real-time is high, master control set expands communicationThe data query of panel is separate to the data query of module with the expansion board of communicating by letter, and saves communication time, adoptsUse the modular structure method of salary distribution, reduced master control set and the byte of packing when CAN communicates by letter of communicating by letter between expansion boardNumber, has simplified master control set process of analysis.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the data buffering method that provides of the embodiment of the present invention.
Fig. 2 is that in the embodiment of the present invention, buffering area initializes schematic diagram.
Fig. 3 is the schematic diagram of data query and response in the embodiment of the present invention.
Fig. 4 is the schematic diagram of buffering area under read-write state in the embodiment of the present invention.
Fig. 5 is the structural representation of the data buffering system that provides of the embodiment of the present invention.
Detailed description of the invention
Monitoring unit master control set in the embodiment of the present invention in the railway signal power supply system of new architecture with communicate by letterExpansion board is by CAN bus communication, and communication expansion board is temporary by the data of the subordinate's module collecting, and waits forThe data query order of master control set, then by data upload. According to this demand, the special prison proposing at new architectureIn control unit communication expansion board, adopt the communication buffer technology of single buffering in the embodiment of the present invention to realize.
Single buffering arranges a buffering area between master control set and communication expansion board, in communication expansionIn plate, open up a block buffer and carry out the data of storage update. Master control set is to communication expansion board swap dataTime, first exchanged data are write to buffering area, then need the master control set of data or communicate by letter expansion board fromBuffering area is got given data. The single buffering arranging can meet new architecture railway signal electricity in the embodiment of the present inventionThe requirement of source monitoring module, program is simple easily to be realized.
Further illustrate technical scheme of the present invention below in conjunction with accompanying drawing and by detailed description of the invention.
Fig. 1 is the schematic flow sheet of the data buffering method that provides of the embodiment of the present invention, and the method comprises:
S101, master control set issues configuration information to the expansion board of communicating by letter, and communication expansion board is true according to configuration informationFix grade number of modules and initialize buffering area.
Master control set can carry out according to customer demand the quantity of subordinate's module that configuration communication expansion board need to gather,And configuration information is issued to communication expansion board, master control set with communicate by letter that what between expansion board, adopt is that CAN is totalLine communication.
Communication expansion board receives after data, preserves all configuration informations. Define many according to configuration informationA few module, is the certain memory headroom of each module assignment, and Memory Allocation situation is as shown in the table:
According to configuration module 1 (device type, equipment serial number, image data)
According to configuration module 2 (device type, equipment serial number, image data)
According to configuration module 3 (device type, equipment serial number, image data)
………………………………………………………..
According to configuration module N (device type, equipment serial number, image data)
According to configuration module N+1 (device type, equipment serial number, image data)
It is 0 that remaining space is filled up
The data structure of each module is as shown in the table:
Device type
Equipment serial number
Analog data 1
Analog data 2
…………
Switching value data 1
Switching value data 2
…………..
Alarm amount data 1
Alarm amount data 2
……………
Whether module communication interrupts
Whole buffering area initializes as shown in Figure 2, and read-write pointer all points to zero.
S102, communication expansion board is inquired about subordinate's module data and refreshes to buffering area every Preset Time.
Between communication expansion board and subordinate's module, there is data query and data response, as shown in Figure 3, oneWill carry out once voluntarily described data query and data response in fixing time, and in buffer memory, upgrade each underLevel module data, when master control set data query, communication expansion board directly from buffer memory by corresponding subordinate mouldThe data feedback of piece is to master control set.
When described communication expansion board is inquired about subordinate's module data, issue querying command to module, open institute simultaneouslyState the communication timer of module. Described timer is software timer, for controlling communication expansion board and subordinateThe communication time of module, if in Preset Time, subordinate's module is not responded, think communication expansion board withThis module communication interrupts, and communication expansion board is interrupted to this module communication of master control set alarm.
Between the expansion board of communicating by letter in the embodiment of the present invention and subordinate's module, pass through RS485 bus communication, dataForm is hexadecimal ASCII character, with 7E beginning, ends up with 0D. If the data of current collection areWith 7E beginning and with 0D ending, judge that these data are complete.
According to above-mentioned decision method, if communication expansion board has been collected complete module data, close described mouldThe data of module described in the communication timer of piece flush buffers; If issuing, communication expansion board obtains alarmOrder, the Data Update of described module is complete and start to inquire about next module, otherwise communication expansion board continuesThe continuous querying command that issues, described in obtain alert command for obtaining the alarm data of this module.
If communication expansion board is not collected complete module data, the communication timer of cutting out described module also willMistake is counted N and is added 1; If wrong number N is greater than 3, the expansion board of communicating by letter is sent and is interrupted alarm and start to inquire about nextIndividual module, otherwise communication expansion board continues to issue querying command.
S103, master control set inquiry subordinate module data, communication expansion board feeds back to the module data of bufferingMaster control set.
The number of modules refreshing in expansion board audit memory of communicating by letter in the time of master control set data query, by more up-to-dateThe new data of crossing send to master control set.
If subordinate's module of master control set inquiry comprises the module that communication expansion board is being inquired about, communication is expandedThe module of inquiring about described in not comprising in the module data of panel feedback.
Now the read-write pointer of buffering area is separate, and as shown in Figure 4, master control set is to communication expansion boardData query separate to the data query of module with the expansion board of communicating by letter, can save communication time.
The embodiment of the present invention also provides a kind of data buffering system, and as shown in Figure 5, this system comprises: mainControl device, communication expansion board and subordinate's module, described master control set connects with the expansion board of communicating by letter by CAN busConnect, communication expansion board is connected with subordinate module by RS485 bus;
Described master control set issues configuration information to communicating by letter under expansion board and inquiry and reception for master control setLevel module data;
Described communication expansion board, for buffering area is provided, regularly inquires about subordinate's module data and refreshes to bufferingDistrict, when master control set inquiry subordinate module data, feeds back to master control set by the module data of buffering.
In described data buffering system, each master control set at least connects two communication expansion board, each communicationExpansion board is by hanging at least one subordinate's module under RS485 bus.
The memory headroom that described communication expansion board utilization distributes is as the buffering area of system.
Adopt technical scheme of the present invention, can reduce internal memory, and real-time is high, master control set expands communicationThe data query of panel is separate to the data query of module with the expansion board of communicating by letter, and saves communication time, adoptsUse the modular structure method of salary distribution, reduced master control set and the byte of packing when CAN communicates by letter of communicating by letter between expansion boardNumber, has simplified master control set process of analysis.
The above, be only preferably detailed description of the invention of the present invention, but not office of protection scope of the present inventionBe limited to this, any people who is familiar with this technology in the disclosed technical scope of the present invention, the change that can expect easilyChange or replace, within all should being encompassed in protection scope of the present invention. Therefore, protection scope of the present invention shouldProtection domain with claim is as the criterion.

Claims (6)

1. a data buffering method, for railway signal power supply monitoring module, is characterized in that the methodComprise:
Master control set issues configuration information to the expansion board of communicating by letter, and communication expansion board is determined subordinate according to configuration informationNumber of modules also initializes buffering area;
Communication expansion board is inquired about subordinate's module data and refreshes to buffering area every Preset Time;
Master control set inquiry subordinate module data, the module data of buffering is fed back to master control dress by communication expansion boardPut, if subordinate's module of master control set inquiry comprises the module that communication expansion board is being inquired about, communication is expandedThe module of inquiring about described in not comprising in the module data of panel feedback, now reads and writes pointer phase in buffering areaIndependent mutually.
2. method according to claim 1, is characterized in that, described initialization buffering area comprises: justThe data structure of the each module of beginningization by the read-write pointed 0 of buffering area.
3. method according to claim 1, is characterized in that, described communication expansion board is inquired about subordinate's mouldBlocks of data further comprises:
Communication expansion board issues querying command to module, opens the communication timer of described module simultaneously;
If communication expansion board has been collected complete module data, close communication timer the brush of described moduleThe data of module described in new buffering area;
If communication expansion board issues and obtains alert command, the Data Update of described module is complete and start inquiryNext module, otherwise communication expansion board continues to issue querying command.
4. method according to claim 3, is characterized in that, if communication expansion board is not collected completeModule data, further comprises:
Close the serial timer of described module and wrong number N is added to 1;
If wrong number N is greater than 3, the expansion board of communicating by letter is sent and is interrupted alarm and start to inquire about next module,Otherwise communication expansion board continues to issue querying command.
5. a data buffering system, for railway signal power supply monitoring module, is characterized in that, described systemTurnkey is drawn together: master control set, and communication expansion board and subordinate's module, described master control set is by CAN bus and logicalLetter expansion board connects, and communication expansion board is connected with subordinate module by RS485 bus;
Described master control set issues configuration information to communicating by letter under expansion board and inquiry and reception for master control setLevel module data;
Described communication expansion board, for buffering area is provided, regularly inquires about subordinate's module data and refreshes to bufferingDistrict, when master control set inquiry subordinate module data, feeds back to master control set by the module data of buffering, described inThe memory headroom that the utilization of communication expansion board distributes is as the buffering area of system, and the read-write pointer in buffering area is mutualIndependent.
6. system according to claim 5, is characterized in that, comprises at least two communication expansion board,Each communication expansion board is by hanging at least one subordinate's module under RS485 bus.
CN201210223314.9A 2012-06-28 2012-06-28 A kind of data buffering method and system Active CN102789434B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210223314.9A CN102789434B (en) 2012-06-28 2012-06-28 A kind of data buffering method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210223314.9A CN102789434B (en) 2012-06-28 2012-06-28 A kind of data buffering method and system

Publications (2)

Publication Number Publication Date
CN102789434A CN102789434A (en) 2012-11-21
CN102789434B true CN102789434B (en) 2016-05-25

Family

ID=47154838

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210223314.9A Active CN102789434B (en) 2012-06-28 2012-06-28 A kind of data buffering method and system

Country Status (1)

Country Link
CN (1) CN102789434B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105809764B (en) * 2014-12-30 2018-06-26 中国科学院沈阳自动化研究所 Proton Exchange Membrane Fuel Cells inspection data transmission method based on CAN bus
CN111464419B (en) * 2020-04-13 2021-08-27 中国人民解放军国防科技大学 Data transmission control method based on bus network communication

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1458598A (en) * 2002-05-17 2003-11-26 清华同方股份有限公司 Method and its device for household network gateway
CN101196852A (en) * 2008-01-03 2008-06-11 杭州华三通信技术有限公司 Distributed caching method and system, caching equipment and non-caching equipment
CN201918012U (en) * 2010-08-24 2011-08-03 北京牡丹视源电子有限责任公司 Bus information acquisition and inquiring system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070297433A1 (en) * 2006-06-26 2007-12-27 Mediatek Inc. Method and apparatus for double buffering

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1458598A (en) * 2002-05-17 2003-11-26 清华同方股份有限公司 Method and its device for household network gateway
CN101196852A (en) * 2008-01-03 2008-06-11 杭州华三通信技术有限公司 Distributed caching method and system, caching equipment and non-caching equipment
CN201918012U (en) * 2010-08-24 2011-08-03 北京牡丹视源电子有限责任公司 Bus information acquisition and inquiring system

Also Published As

Publication number Publication date
CN102789434A (en) 2012-11-21

Similar Documents

Publication Publication Date Title
CN102708388B (en) Electronic tag system, electronic tag and method for updating electronic tag
CN103972981A (en) Cloud-based intelligent low-voltage switch cabinet monitoring system
CN101867226A (en) Wide-area distribution type data collection method for dispatching automation system
CN102789434B (en) A kind of data buffering method and system
CN202281949U (en) Data acquisition and information management system of production line
CN104702428A (en) Method for determining work order dispatching modes and integrated alarm system
EP3770814B1 (en) Display device for displaying price and / or product information
CN109507936A (en) A kind of composite type processing unit
CN202230362U (en) Industrial control system
CN205451437U (en) Distributing type wireless electronics tag system
CN201035357Y (en) Feeder line distant place terminal
CN103984249A (en) Cloud cabinet independent express parcel taking device and independent express parcel taking method
CN212208011U (en) Master-slave switchable building controller
CN101141287A (en) Method and apparatus for managing multi-work space contents
CN102541014A (en) Thermotechnical electrical integrated control system for thermal power plant
CN202864198U (en) Tobacco city logistics automation system
CN209044355U (en) A kind of composite type processing unit
CN202864197U (en) Serried cabinet control system
CN101692262A (en) Triage method suitable for sanitary train
CN207603222U (en) Reactive power adjusts circuit
CN111103940A (en) Remote electric energy data terminal based on container engine
CN106875663B (en) Data concentrator for substation monitoring system and control method
CN203608216U (en) Centralized-control intelligent ODN electronic tag machine disc management circuit
CN106292351A (en) The electrical energy supply system of Cell and Time Distribution economize on electricity and method
CN213521960U (en) Intelligent terminal for ecological flow of hydropower station

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20181114

Address after: 238312 Nanhu Avenue, Yaogou Industrial Zone, Wuwei County, Wuhu City, Anhui Province

Patentee after: Wuhu Ding Han railway transportation equipment Co., Ltd.

Address before: 100070 Beijing Fengtai District South Fourth Ring West Road 188 Headquarters Base 18 District 2 Building

Patentee before: Beijing Dinghan Technology Co., Ltd.