CN110147370A - Train data storage method based on producers or consumers' Task scheduling pattern - Google Patents
Train data storage method based on producers or consumers' Task scheduling pattern Download PDFInfo
- Publication number
- CN110147370A CN110147370A CN201910350764.6A CN201910350764A CN110147370A CN 110147370 A CN110147370 A CN 110147370A CN 201910350764 A CN201910350764 A CN 201910350764A CN 110147370 A CN110147370 A CN 110147370A
- Authority
- CN
- China
- Prior art keywords
- task
- file
- producers
- consumers
- data storage
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 238000013500 data storage Methods 0.000 title claims abstract description 17
- 238000007726 management method Methods 0.000 claims abstract description 15
- 238000013461 design Methods 0.000 claims abstract description 4
- 238000012216 screening Methods 0.000 claims description 17
- 238000003860 storage Methods 0.000 claims description 12
- 239000003990 capacitor Substances 0.000 claims description 3
- 238000012544 monitoring process Methods 0.000 claims description 3
- 238000004092 self-diagnosis Methods 0.000 claims description 3
- 230000000737 periodic effect Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 241001269238 Data Species 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000003745 diagnosis Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005265 energy consumption Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003862 health status Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1471—Saving, restoring, recovering or retrying involving logging of persistent data for recovery
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1479—Generic software techniques for error detection or fault masking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/40—Business processes related to the transportation industry
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Quality & Reliability (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Economics (AREA)
- General Health & Medical Sciences (AREA)
- Human Resources & Organizations (AREA)
- Marketing (AREA)
- Primary Health Care (AREA)
- Strategic Management (AREA)
- Tourism & Hospitality (AREA)
- General Business, Economics & Management (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention relates to a kind of train data storage methods based on producers or consumers' Task scheduling pattern, this method is according to software structure design, multiple tasks are prevented by semaphore while accessing the same shared buffer memory queue, the method specifically includes: 1) initial phase: the initialization of initialization task completion hardware environment, reception task, store tasks and monitor task are generated according to configuration data, or it generates and listens to task, file management initialization is carried out according to the file on disk, and starts clock interrupt;2) normal operating phase: running reception task, store tasks and monitor task in the normal mode, listens to operation under mode and listens to task.Compared with prior art, the present invention has many advantages, such as high efficiency.
Description
Technical field
The present invention relates to a kind of train data storage methods, are based on producers or consumers' task more particularly, to one kind
The train data storage method of scheduling method.
Background technique
The status data that each subsystem generates in train travelling process plays important work to guarantee train safe operation
With, and these status datas are reliably and effectively stored, it can be provided for assessment train health status, analysis train fault reason
Important leverage.
Since each subsystem of train is more, covered route is longer in driving process, the cycle of operation is more long, the number of generation
Very big according to measuring, train capacity of memory device is again relatively limited, if not using a kind of effective storage method, easily occurs
Data store exception or loss of data.If storage equipment does not have power down safeguard procedures in the case where train power-off, can lead
It causes data that cannot be stored completely, causes loss of data.
Currently, FLASH memory technology has been widely used for because it has the characteristics that storage is big, performance is good, low energy consumption
Train stores in equipment, but deposits the disadvantage easy to be lost of data during power down, and need to rely on effective store tasks supervisor
Manufacture guarantee.
Summary of the invention
It is an object of the present invention to overcome the above-mentioned drawbacks of the prior art and provide one kind based on the producer or
The train data storage method of consumer task's scheduling method.
The purpose of the present invention can be achieved through the following technical solutions:
A kind of train data storage method based on producers or consumers' Task scheduling pattern, this method is according to software
Structure design, prevents multiple tasks by semaphore while accessing the same shared buffer memory queue, the method is specifically wrapped
It includes:
1) initial phase:
Initialization task complete hardware environment initialization, according to configuration data generate reception task, store tasks and
Monitor task, or generate and listen to task, file management initialization is carried out according to the file on disk, and start clock interrupt;
2) normal operating phase:
Reception task, store tasks and monitor task are run in the normal mode, are listened to operation under mode and are listened to task.
Preferably, file management initialization includes the file management initialization and complete file management of screening
Initialization.
Preferably, the reception task run specifically:
The semaphore resource needed for task run to be received such as first, after clock interrupt release semaphore resource according to
Upper period operation data generates self diagnosis information, manages time synchronization state, receives the running log that mobile unit is sent and disappears
Breath packet, and data packet is handled, update equipment connection status;Reception task is as the producer, by diagnostic message and operation
Buffer queue is written in log;Store tasks semaphore resource is discharged after task execution.
Preferably, store tasks operation specifically:
Semaphore resource needed for waiting store tasks operation first, executes after the release semaphore resource that receives an assignment
Disk management, store tasks read the diagnostic message and running log in buffer queue and save to disk text as consumer
In part.
Preferably, monitor task operation specifically:
Semaphore resource needed for waiting monitor task operation first, monitors after clock interrupt release semaphore resource
Task accesses disk as consumer, and complete file is added to complete file queue and monitors quantity of documents in screening queue,
When quantity of documents is less than setting threshold values, the screening file in disk is added to screening queue.
The time is only saved preferably for the screening file, to ensure that disk space adequacy.
Preferably, the reset monitor task when finding that reception task or store tasks are in suspend state.
It is preferably, described to listen to task run specifically:
Data in array buffer queue are copied to data buffer storage by semaphore resource needed for obtaining SPY task run
In, the data in data buffer storage are saved to file.
Preferably, the method is to protect the data volume received is larger magnetic cannot be written in time after cabinet power down
Disk installs capacitor in hardware board, the time of equipment utilization capacitances to supply power deferred run 1s after cabinet power down, software fortune
The row period is 100ms, to ensure that the integrality that data store after cabinet power down.
Compared with prior art, the invention has the following advantages that
1. high efficiency: task management is realized by the producer/consumer task's scheduling mechanism, it is relatively more efficient.
2. reliability: work can be postponed after power down, guarantee that data are stored in file in program circulating period, avoid counting
According to loss.
3. storage space utilization is high: being screened to storing data, insignificant time data memory is short, it is ensured that important
Data storage is complete.
Detailed description of the invention
Fig. 1 is the applicable software configuration schematic diagram of the present invention;
Fig. 2 is the flow chart of initial phase of the present invention;
Fig. 3 is the flow chart in main task stage of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiment is a part of the embodiments of the present invention, rather than whole embodiments.Based on this hair
Embodiment in bright, those of ordinary skill in the art are obtained every other without making creative work
Embodiment all should belong to the scope of protection of the invention.
The present invention prevents multiple tasks by semaphore while accessing the same shared buffer memory according to software structure design
Queue deposits mistake by the producer/consumer's mode Task scheduling pattern progress data and is broadly divided into the following two stage:
Initial phase:
Initialization task complete hardware environment initialization, according to configuration data generate reception task, store tasks and
Monitor task, or generate and listen to task, file management initialization, the file including screening are carried out according to the file on disk
With complete file, and start clock interrupt.
Normal operating phase:
Reception task, store tasks and monitor task are run in the normal mode, are listened to operation under mode and are listened to task.
Semaphore resource needed for the reception task task run to be received such as first, when clock interrupt release semaphore provides
Self diagnosis information is generated according to operation data of upper period behind source, manages time synchronization state, receives the fortune that mobile unit is sent
Row log information packet, and data packet is handled, update equipment connection status.Reception task believes diagnosis as the producer
Buffer queue is written in breath and running log.Store tasks semaphore resource is discharged after task execution.
Semaphore resource needed for store tasks wait store tasks operation first, when the release semaphore money that receives an assignment
Disk management is executed behind source, store tasks read the diagnostic message and running log in buffer queue and save as consumer
Into disk file.
Semaphore resource needed for monitor task waits monitor task operation first, when clock interrupt release semaphore provides
Monitor task accesses disk as consumer behind source, and complete file is added to complete file queue and is monitored in screening queue
Screening file in disk is added to screening queue, for screening when quantity of documents is less than setting threshold values by quantity of documents
File only saves the time, to ensure that disk space adequacy.When discovery reception task or store tasks are in
Software is restarted when suspend state.
Semaphore resource needed for task obtains SPY task run is listened to, the data in array buffer queue are copied to
In data buffer storage, the data in data buffer storage are saved to file
To protect the data volume received is larger disk cannot be written in time after cabinet power down, pacify in hardware board
Capacitor, the time of equipment utilization capacitances to supply power deferred run 1s after cabinet power down are filled, the software cycle of operation is 100ms, thus
It ensure that the integrality that data store after cabinet power down.
Reception task is driven by clock interrupt, and the relationship received between task and store tasks is as follows:
1) it receives task dispatching and waits for semaphore resource;
2) store tasks waiting signal amount resource;
3) clock interrupt release semaphore resource;
4) it receives task and obtains semaphore resource, execute this periodic duty, store tasks semaphore is discharged after being finished
Resource;
5) store tasks obtain semaphore resource, execute this periodic duty.
Monitor task is driven by clock interrupt:
1) monitor task waiting signal amount resource;
2) clock interrupt release semaphore resource;
3) monitor task obtains semaphore resource, executes this periodic duty.
It listens to task and obtains the IP data packet listened to from network task, relationship is as follows between two tasks:
1) data packet listened to is stored in array buffer queue by network task, when cache node is filled in queue
When, then release semaphore;
2) listening to after task obtains semaphore will be handled in the data deposit data buffer storage in cache node.
Fig. 2 and 3 show detailed process of the invention.In conjunction with Fig. 1, Fig. 2 and Fig. 3, to apply of the invention vehicle-mounted deposit
For storing up software DLU, it is as follows that lower embodiments of the present invention are described:
As shown in Figure 1, initialization task is responsible for initializing DLU hardware environment for the system structure that this programme is applicable in,
Generate each task.Reception task is responsible for the functions such as diagnostic message reception, processing and time synchronization.Store tasks are responsible for management
Disk storage space, and the diagnostic data that reception task receives is saved to disk.Condition monitoring task is received in discovery appoints
When business or store tasks are in suspend state, DLU software is restarted, meanwhile, when number of files is small in screening document queue
When setting threshold values, the respective file in catalogue is added in screening document queue.Task is listened to be responsible for connecing from network task
Receive interception data packet.
Fig. 2 is initial phase flow chart of the present invention, is described in detail as follows:
Step 1: initializers hardware environment.
Step 2: creation monitor task.
Step 3: creation reception task.
Step 4: creation store tasks.
Step 5: task is listened in creation.
Step 6: starting clock interrupt.
Fig. 3 is main task phase flow figure of the present invention, is described in detail as follows:
Step 1: judging present mode state, if it is normal mode, then enter step 2, otherwise enter step 6;
Step 2: waiting clock interrupt release semaphore resource;
Step 3: if the semaphore of clock interrupt release is monitor task semaphore, entering step 4.
It is no to enter step 5.
Step 4: monitor task obtain semaphore resource, execute disk management, by diagnostic message and running log save to
In disk file, meanwhile, monitoring receives an assignment and store tasks;
Step 5: receiving task and obtain semaphore resource, this periodic duty is executed, by the diagnostic message received and generation
Running log deposit buffer queue in, after being finished discharge store tasks semaphore resource;
Step 5: store tasks obtain semaphore resource, execute this periodic duty, and the data in buffer queue are taken out,
It saves into disk file;
Step 6: waiting network task release semaphore;
Step 7: task of listening to will be handled after obtaining semaphore in the data deposit buffer queue in cache node.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, appoints
What those familiar with the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications
Or replacement, these modifications or substitutions should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention is answered
It is subject to the protection scope in claims.
Claims (9)
1. a kind of train data storage method based on producers or consumers' Task scheduling pattern, which is characterized in that this method
According to software structure design, multiple tasks are prevented by semaphore while accessing the same shared buffer memory queue, the method
It specifically includes:
1) initial phase:
Initialization task completes the initialization of hardware environment, generates reception task, store tasks and monitoring according to configuration data
Task, or generate and listen to task, file management initialization is carried out according to the file on disk, and start clock interrupt;
2) normal operating phase:
Reception task, store tasks and monitor task are run in the normal mode, are listened to operation under mode and are listened to task.
2. a kind of train data storage side based on producers or consumers' Task scheduling pattern according to claim 1
Method, which is characterized in that at the beginning of the file management initialization includes the file management initialization and complete file management of screening
Beginningization.
3. a kind of train data storage side based on producers or consumers' Task scheduling pattern according to claim 1
Method, which is characterized in that the reception task run specifically:
The semaphore resource needed for task run to be received such as first, according to the upper period after clock interrupt release semaphore resource
Operation data generates self diagnosis information, manages time synchronization state, receives the running log message package that mobile unit is sent, and
Data packet is handled, equipment connection status is updated;Diagnostic message and running log are written as the producer for reception task
Buffer queue;Store tasks semaphore resource is discharged after task execution.
4. a kind of train data storage side based on producers or consumers' Task scheduling pattern according to claim 1
Method, which is characterized in that the store tasks operation specifically:
First wait store tasks operation needed for semaphore resource, when receive an assignment release semaphore resource after execute disk pipe
Reason, store tasks read the diagnostic message and running log in buffer queue and save into disk file as consumer.
5. a kind of train data storage side based on producers or consumers' Task scheduling pattern according to claim 1
Method, which is characterized in that the monitor task operation specifically:
Semaphore resource needed for waiting monitor task operation first, monitor task is made after clock interrupt release semaphore resource
Disk is accessed for consumer, complete file is added to complete file queue and monitors quantity of documents in screening queue, works as file
When quantity is less than setting threshold values, the screening file in disk is added to screening queue.
6. a kind of train data storage side based on producers or consumers' Task scheduling pattern according to claim 5
Method, which is characterized in that is only saved for the screening file, to ensure that disk space adequacy the time.
7. a kind of train data storage side based on producers or consumers' Task scheduling pattern according to claim 5
Method, which is characterized in that the reset monitor task when finding that reception task or store tasks are in suspend state.
8. a kind of train data storage side based on producers or consumers' Task scheduling pattern according to claim 1
Method, which is characterized in that described listens to task run specifically:
Semaphore resource needed for obtaining SPY task run, the data in array buffer queue are copied in data buffer storage, will
Data in data buffer storage are saved to file.
9. a kind of train data storage side based on producers or consumers' Task scheduling pattern according to claim 1
Method, which is characterized in that the method is to protect the data volume received is larger disk cannot be written in time after cabinet power down,
Capacitor is installed in hardware board, the time of equipment utilization capacitances to supply power deferred run 1s after cabinet power down, software operation week
Phase is 100ms, to ensure that the integrality that data store after cabinet power down.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910350764.6A CN110147370B (en) | 2019-04-28 | 2019-04-28 | Train data storage method based on producer or consumer task scheduling mode |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910350764.6A CN110147370B (en) | 2019-04-28 | 2019-04-28 | Train data storage method based on producer or consumer task scheduling mode |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110147370A true CN110147370A (en) | 2019-08-20 |
CN110147370B CN110147370B (en) | 2022-08-30 |
Family
ID=67594055
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910350764.6A Active CN110147370B (en) | 2019-04-28 | 2019-04-28 | Train data storage method based on producer or consumer task scheduling mode |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110147370B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8812875B1 (en) * | 2010-04-12 | 2014-08-19 | Stephen Melvin | Virtual self-destruction of stored information |
CN106685856A (en) * | 2016-12-30 | 2017-05-17 | 国网浙江省电力公司绍兴供电公司 | Method, system and equipment for processing intelligent substation mass network messages |
-
2019
- 2019-04-28 CN CN201910350764.6A patent/CN110147370B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8812875B1 (en) * | 2010-04-12 | 2014-08-19 | Stephen Melvin | Virtual self-destruction of stored information |
CN106685856A (en) * | 2016-12-30 | 2017-05-17 | 国网浙江省电力公司绍兴供电公司 | Method, system and equipment for processing intelligent substation mass network messages |
Non-Patent Citations (2)
Title |
---|
ALI AZARIAN ET AL.: "Reducing misses to external memory accesses in task-level pipelining", 《2015 IEEE INTERNATIONAL SYMPOSIUM ON CIRCUITS AND SYSTEMS (ISCAS)》 * |
易诗: "基于MongoDB的光纤传感海量监测数据存储方法研究", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 * |
Also Published As
Publication number | Publication date |
---|---|
CN110147370B (en) | 2022-08-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9389936B2 (en) | Monitoring the responsiveness of a user interface | |
CN102117240B (en) | A kind of method and device obtaining progress blocking information | |
CN107451147B (en) | Method and device for dynamically switching kafka clusters | |
US20110067029A1 (en) | Thread shift: allocating threads to cores | |
CN110704173A (en) | Task scheduling method, scheduling system, electronic device and computer storage medium | |
US9348630B2 (en) | Virtual machine control program in a cloud computing environment, virtual machine control method in a cloud computing environment, virtual machine control apparatus, and cloud computing system | |
CN103714016A (en) | Cache cleaning method, device and client side | |
CN102541661B (en) | Realize the method and apparatus of wait on address synchronization interface | |
CN110399220A (en) | A kind of management method and relevant apparatus of FPGA accelerator card | |
CN102929769A (en) | Virtual machine internal-data acquisition method based on agency service | |
CN109597653A (en) | Method, BIOS and the BMC of BIOS and BMC command interaction | |
CN110247812A (en) | A kind of more cluster management methods, device, system and associated component | |
CN103729166B (en) | Method, device and system for determining thread relation of program | |
US9329972B2 (en) | Implementing client based throttled error logging in a computing device | |
CN110147370A (en) | Train data storage method based on producers or consumers' Task scheduling pattern | |
US20130024730A1 (en) | Disk control apparatus, method of detecting failure of disk apparatus, and recording medium for disk diagnosis program | |
CN116185636A (en) | Memory management method, device, equipment and storage medium | |
EP4163795A1 (en) | Techniques for core-specific metrics collection | |
CN112463574A (en) | Software testing method, device, system, equipment and storage medium | |
CN103176897A (en) | Software regression testing method and software regression testing system | |
CN115391106A (en) | Method, system and device for pooling backup resources | |
Li et al. | Breaking the boundary for whole-system performance optimization of big data | |
CN109257256A (en) | Apparatus monitoring method, device, computer equipment and storage medium | |
CN115562933A (en) | Processing method and device of operation monitoring data, storage medium and electronic equipment | |
CN117093335A (en) | Task scheduling method and device for distributed storage system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |