WO2021046936A1 - 总线数据存储到存储器上的方法、存储装置及存储介质 - Google Patents

总线数据存储到存储器上的方法、存储装置及存储介质 Download PDF

Info

Publication number
WO2021046936A1
WO2021046936A1 PCT/CN2019/108653 CN2019108653W WO2021046936A1 WO 2021046936 A1 WO2021046936 A1 WO 2021046936A1 CN 2019108653 W CN2019108653 W CN 2019108653W WO 2021046936 A1 WO2021046936 A1 WO 2021046936A1
Authority
WO
WIPO (PCT)
Prior art keywords
message queue
frame
data
storage
memory
Prior art date
Application number
PCT/CN2019/108653
Other languages
English (en)
French (fr)
Inventor
陈洁琴
Original Assignee
北京东土科技股份有限公司
北京科银京成技术有限公司
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 北京东土科技股份有限公司, 北京科银京成技术有限公司 filed Critical 北京东土科技股份有限公司
Publication of WO2021046936A1 publication Critical patent/WO2021046936A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • 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/418Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM]
    • 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/418Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM]
    • G05B19/4185Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM] characterised by the network communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Definitions

  • the present invention relates to the field of data storage, in particular to a method, storage device and storage medium for storing bus data on a memory.
  • CAN Controller Area Network
  • ISO 11898 International Standards Organization
  • the bus data exchange rate and data exchange volume between devices have greatly increased, but the existing CAN bus data storage method usually uses a single CAN data to be stored on an SD card The storage speed is slow, and it is difficult to record all CAN bus data reliably and completely.
  • Another processing method is to send the collected CAN data directly to the host computer or application layer for processing, instead of storing it in the memory. When an unexpected situation such as a power failure occurs, it will cause the loss of CAN data. Therefore, it is particularly important to collect multiple CAN data at the same time and store them on an SD card or other storage devices in real time, while also ensuring that no frames are dropped.
  • the main purpose of the present invention is to provide a method, storage device and storage medium for storing bus data on the memory.
  • the CAN interrupt service program stores each CAN frame collected from the CAN buffer to the message.
  • the CAN frame in the message queue is taken out and stored in the memory. This method can realize the collection of multi-channel CAN channel data and store it in real time without frame loss. In memory.
  • the technical solution adopted by the present invention is a method for storing bus data on a memory, setting a message queue, and the method includes:
  • Periodic storage process periodically read each CAN frame from the message queue, reorganize and store it in the memory, and delete the CAN frame read from the message queue.
  • the CAN interrupt service program collects and stores the CAN frames of the CAN buffer in the message queue, and reads each message from the message queue periodically according to the set frequency.
  • CAN frame data and reorganize each CAN frame data and store it in the memory.
  • This method can realize the collection and storage of all CAN frame data, supports data collection of multiple CAN channels, and reads sequentially in the order of the message queue Fetch and reorganize the data, and then store the reorganized data in the memory, which can also ensure that no frame is lost and data loss can be avoided.
  • the message queue needs to be initialized and configured in advance, and the number of CAN frames that the message queue can hold is reasonably configured according to the CAN frame sending rate of the CAN device and the storage rate of the memory.
  • a storage time is required.
  • the CAN bus will continue to send CAN frames to the message queue. Therefore, the storage time and the rate at which the CAN device sends CAN frames need to be considered for the message queue to be stored
  • the capacity of the CAN frame is configured to ensure that the CAN frame of the message queue will not overflow.
  • the message queue adopts a FIFO mechanism for storage and reading.
  • FIFO is a first-in, first-out buffering mechanism.
  • the buffering mechanism of the message queue uses FIFO, so CAN frames stored in the message queue are sequentially added to the end of the queue, and when reading from the message queue, they will be read from the head of the queue. .
  • the collection process includes:
  • the CAN interrupt service program collects CAN frame data from the CAN buffer
  • the required data is extracted from the CAN frame data, stored in the frame structure to form a CAN frame that can be stored in the message queue, and stored in the message queue.
  • the CAN frame data in the buffer is collected, and the required data is extracted, stored in the corresponding frame structure to form a CAN frame that can be stored in the message queue, and sent to the message queue.
  • the end of the team At the end of the team.
  • the collection includes simultaneous collection of multiple CAN channels:
  • the multi-channel CAN interrupt service program stores each CAN frame collected from the multi-channel CAN buffer into the message queue.
  • this method supports simultaneous data acquisition operations of multiple CAN channels.
  • the data acquisition operation is completed in the CAN interrupt service program.
  • you can The CAN frames stored in the multi-channel CAN buffer are taken out, sent to the message queue at the same time, and sequentially stored at the end of the queue.
  • the stored procedure includes:
  • the CAN frames stored in the message queue are not in the original order of the data, it is necessary to reorganize the data of each frame after reading the CAN frame data, and then store the reorganized data in a file in the memory.
  • the file uses a cache mechanism. When the sector is full, the flush operation is triggered to flush the data in the sector to the file.
  • a further improvement is that when each CAN frame is read from the message queue, the CAN frame in the message queue is processed in a non-blocking manner.
  • the method of processing CAN frames in the message queue is performed in a non-blocking manner, that is, as long as the storage task is activated, if there is a CAN frame in the message queue, it will be read and deleted after the reading is completed.
  • This CAN frame ensures that the message queue is always in an active state and will not cause CAN frame overflow and frame loss.
  • a further improvement also includes: when the message queue is empty, after a delay of a period of time, it is checked again whether the message queue is empty.
  • a further improvement also includes: the size of the file exceeds a set value, or the file is closed when it is judged that the power supply is abnormal.
  • the present invention also provides a storage device adopting the above-mentioned storage method, including:
  • the acquisition module is used to store the CAN frames collected from the CAN buffer in the CAN interrupt service into the message queue;
  • the storage module is used to periodically read each CAN frame from the message queue, reorganize and store it, and delete the CAN frame read from the message queue.
  • the present invention also provides a storage medium on which a computer program is stored.
  • the program is executed by a processor, the method for storing bus data on the memory as described above is realized.
  • Figure 1 is a flowchart of a method for storing bus data on a memory according to the present invention
  • FIG. 2 is a schematic diagram of the bus data stored on the memory of the present invention.
  • Fig. 4 is a flowchart of CAN frame data storage in a non-blocking manner according to the present invention.
  • Fig. 5 is a schematic diagram of the principle of the storage device of the present invention.
  • each CAN channel sends 500 frames every 1 second, that is, 1 frame every 2 milliseconds, and the two CAN channels have 1 frame every millisecond in total.
  • the data of the cache sector needs to be stored in the file in the memory.
  • the file size exceeds the preset single file size, the file needs to be closed and restarted. Create and open a new file.
  • the slowest time of this process is about 10-20 milliseconds. During this time period, the number of elements stored in the message queue will reach 10-20.
  • the above storage rate needs to be taken into account, in consideration of no frame loss, usually the number of elements in the message queue will be expanded to 2 times the slowest case, that is, it is reasonable to set N to about 20-40, so as to ensure Will not cause the message queue to overflow.
  • S200 The CAN interrupt service program stores each CAN frame collected from the CAN buffer in the message queue;
  • This step is the CAN frame collection process, that is, in the CAN interrupt service program, the CAN frame in the CAN buffer is collected and stored in the message queue set in step S100.
  • the collection process supports data on multiple CAN channels At the same time, collect all the CAN frames in the CAN buffers of the multiple CAN channels and send them to the message queue. According to the FIFO mechanism of the message queue, they are sequentially stored at the end of the queue;
  • S210 Detect whether there is a CAN interrupt, if yes, proceed to the next step, if not, then return to this step to continue the detection;
  • S300 According to the set reading frequency, periodically read a plurality of CAN frames from the message queue, and reorganize and store the data of each frame in the memory.
  • the message queue can receive multiple CAN frame data from one or more CAN channels at the same time without losing frames, ensuring storage quality, and improving Storage efficiency.
  • a storage device adopting the above-mentioned storage method is also provided, and the storage device includes:

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Manufacturing & Machinery (AREA)
  • Quality & Reliability (AREA)
  • Automation & Control Theory (AREA)
  • Information Transfer Systems (AREA)

Abstract

一种总线数据存储到存储器上的方法,设置一消息队列,该方法包括:采集过程:CAN中断服务程序从CAN缓冲区采集的各CAN帧存储到所述消息队列中;定期的存储过程:定期的从所述消息队列中读取CAN帧并重组后存储到存储器,并删除消息队列中读取出的CAN帧。通过使用消息队列,CAN中断服务程序从CAN缓冲区采集的各CAN帧存储到该消息队列中,并在之后的存储任务中将该消息队列中的CAN帧取出,并存储到存储器中。上述方法可实现对多路CAN通道数据的采集,并在不丢帧的前提下实时存储到存储器中。

Description

总线数据存储到存储器上的方法、存储装置及存储介质 技术领域
本发明涉及数据存储领域,特别涉及一种总线数据存储到存储器上的方法、存储装置及存储介质。
背景技术
CAN是控制器局域网络(Controller Area Network,CAN)的简称,是由以研发和生产汽车电子产品著称的德国BOSCH公司开发的,并最终成为国际标准(ISO 11898),是国际上应用最广泛的现场总线之一。CAN总线协议已经成为汽车计算机控制系统和嵌入式工业控制局域网的标准总线。
随着装备系统智能化和信息化的发展,各设备之间的总线数据交互速率、数据交互量均大幅的增长,但是现有CAN总线数据存储方法通常采用将单路CAN数据存储在SD卡上的方式,存储速度较慢,且难以可靠、完整地记录所有CAN总线数据。另外一种处理方式是,将采集的CAN数据直接发送到上位机或应用层进行处理,而不存储到存储器中,当发生掉电等意外情况后,会造成CAN数据丢失的后果。因此,同时进行多路CAN数据采集,并实时存储到SD卡或其他存储设备上,同时还保证不丢帧,在总线数据存储中就显得尤为重要。
发明内容
有鉴于此,本发明的主要目的在于提供一种总线数据存储到存储器上的方法、存储装置及存储介质,通过使用消息队列,CAN中断服务程序从CAN缓冲区采集的各CAN帧存储到该消息队列中,并在之后的存储任务中将该消息队列中的CAN帧取出,并存储到存储器 中,本方法可实现对多路CAN通道数据的采集,并在不丢帧的前提下实时存储到存储器中。
本发明采用的技术方案为,一种总线数据存储到存储器上的方法,设置一消息队列,该方法包括:
采集过程:CAN中断服务程序从CAN缓冲区采集的各CAN帧存储到所述消息队列中;
定期的存储过程:定期的从所述消息队列中读取各CAN帧并重组后存储到存储器,并删除消息队列中读取出的CAN帧。
由上,通过设置一消息队列,在出现CAN中断时,CAN中断服务程序将CAN缓冲区的CAN帧采集存储到消息队列中,并根据设定的频率定期从该消息队列中依次读取出各CAN帧数据,并对各CAN帧数据进行重组后存储到存储器中,本方法可实现对所有CAN帧数据的采集及存储,支持多路CAN通道的数据采集,并按照消息队列的顺序依次进行读取和数据重组,然后将重组后的数据存储到存储器中,还可保证不丢帧,避免数据丢失。
进一步改进,所述采集过程之前还包括:
根据CAN设备发送CAN帧的速率及存储器的存储速率配置所述消息队列可存储CAN帧的容量。
由上,本方法的采集过程开始之前,需要预先初始化并配置消息队列,根据CAN设备发送CAN帧的速率及存储器的存储速率合理配置消息队列可容纳的CAN帧个数,由于将消息队列的CAN帧存储到存储器时,需要一段存储时间,该段存储时间内,CAN总线仍会继续发送CAN帧到消息队列中,因此需要考虑到该存储时间及CAN设备发送CAN帧的速率对消息队列可存储CAN帧的容量进行配置,保证消息队列的CAN帧不会溢出。
进一步改进,所述消息队列采用FIFO机制进行存储和读取。
由上,FIFO是一种先进先出的缓存机制,消息队列的缓存机制采用了FIFO,故存储到消息队列的CAN帧依次加入队列尾部,而从消息队列读取时会从队列的头开始读。
进一步改进,所述采集过程包括:
检测到CAN中断时,CAN中断服务程序从CAN缓冲区采集CAN帧数据;
从该CAN帧数据中提取需要的数据,存放到帧结构体中形成可存储到消息队列的CAN帧,并存储到消息队列中。
由上,在CAN中断服务程序中,对缓冲区的CAN帧数据进行采集,并提取需要的数据,存放到对应的帧结构体中形成可存储到消息队列的CAN帧,并发送到消息队列的队尾中。
进一步改进,所述采集包括多路CAN通道的同时采集:
所述多路CAN中断服务程序将从多路CAN缓冲区采集的各CAN帧存储到所述消息队列中。
由上,由于CAN总线中通常存在多路CAN通道,本方法支持多路CAN通道的同时数据采集操作,该数据采集操作是在CAN中断服务程序中完成,在该CAN中断服务程序中,可以将存储到多路CAN缓冲区的CAN帧取出,同时发送到消息队列中,依次存储在队尾。
进一步改进,所述存储过程包括:
创建存储任务,创建并打开存储器的文件;
从所述消息队列中读取各CAN帧,重组各帧数据并写入到所述文件对应的缓存扇区中;
缓存扇区被写满时,将缓存扇区中的帧数据刷入到存储器的该文件中。
由上,由于存储到消息队列中的CAN帧并非按照数据原有的顺序,因此需要在读取CAN帧数据后,将各帧数据进行重组,再将重组后的数据存储到存储器的文件中,该文件采用了缓存机制,当扇区写满时,才会触发flush操作,将扇区内的数据刷入到文件中。
进一步改进,所述从所述消息队列中读取各CAN帧时采用无阻塞方式处理消息队列中的CAN帧。
由上,处理消息队列中CAN帧的方式采用无阻塞方式进行,即只要存储任务在被激活的情况下,消息队列中如果有CAN帧时,即 会被读取,并在读取完成后删除该CAN帧,从而保证消息队列始终处于活跃状态,不会造成CAN帧溢出,造成帧丢失。
进一步改进,还包括:所述消息队列为空时,延时一段时间后,再次检测消息队列是否为空。
由上,由于消息队列采用无阻塞的方式进行读取,只有消息队列非空,就会读取并删除其中的CAN帧,当消息队列为空时,根据系统需求,可延时一段时间,例如10毫秒,即主动放弃CPU的处理权10毫秒,让其他任务得到调度,然后再次检测消息队列是否为空。
进一步改进,还包括:所述文件的大小超过设定值,或判断供电异常时关闭所述文件。
由上,由于频繁的开关文件,会降低存储效率,因此在每次存储任务开始前,可预先打开文件,并保持打开状态,并在该文件的大小超过设定大小,或者异常断电前关闭该文件,并同时将CAN缓冲区中的内容刷到该文件中,从而保证效率,防止丢帧。
本发明还提供了一种采用上述存储方法的存储装置,包括:
采集模块,用于将CAN中断服务中从CAN缓冲区采集的各CAN帧存储到消息队列中;
存储模块,用于定期的从所述消息队列中读取各CAN帧并重组后进行存储,并删除消息队列中读取出的CAN帧。
本发明还提供一种存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上所述的总线数据存储到存储器上的方法。
附图说明
图1为本发明总线数据存储到存储器上的方法的流程图;
图2为本发明总线数据存储到存储器上的原理图;
图3为本发明CAN中断服务程序的帧处理的流程图;
图4为本发明采用无阻塞方式进行CAN帧数据存储的流程图;
图5为本发明存储装置的原理示意图。
具体实施方式
下面参照如图1~图5所示,对本发明提供的总线数据存储到存储器上的方法、存储装置及存储介质的具体实施方式进行详细说明,下述实施例中均以应用于CAN总线中为例进行说明。
如图1-图2所示,为本发明总线数据存储到存储器上的方法的流程图及原理图,步骤详述如下:
S100:设置一消息队列,并进行初始化配置;
其中,上述消息队列采用FIFO机制进行存储和读取,FIFO是一种先进先出的缓存机制,该消息队列的缓存机制采用了FIFO,故存储到消息队列的CAN帧依次加入队列尾部,而从消息队列读取时会从队列的头依次读取;
在进行后续步骤的采集和存储之前,还需要对上述消息队列进行初始化及元素个数(即可存储的CAN帧的个数)的配置,该消息队列中配置的元素个数为N,N的大小由CAN设备发送CAN帧的速率以及存储器的存储速率决定;
例如,本实施例中的CAN总线总共有两路,每路CAN通道每1秒钟会发送500帧,即每2毫秒有1帧,两路CAN通道共计每毫秒就会有1帧。而在后续步骤的存储过程中,需要在缓存扇区写满时,将缓存扇区的数据存入到存储器的文件中,当文件大小超过预设的单文件大小时,需要关闭文件,并重新创建并打开新文件,而这个过程最慢的时候大概有10-20毫秒,该时间段内,会导致存储到消息队列中的元素个数达到10-20个,因此,在配置消息队列的元素个数时,需要考虑到上述存储速率,处于不丢帧的考虑,通常会扩大消息队列中元素个数为最慢情况下的2倍,即设置N为20-40个左右比较合理,从而保证不会造成消息队列溢出。
S200:CAN中断服务程序将从CAN缓冲区采集的各CAN帧存储到所述消息队列中;
本步骤为CAN帧的采集过程,即在CAN中断服务程序中,将CAN缓冲区的CAN帧进行采集,并存储到步骤S100设置的消息队 列中,其中该采集过程支持对多路CAN通道的数据同时采集,将多路CAN通道的CAN缓冲区内的CAN帧全部采集后,发送到消息队列中,根据消息队列的FIFO机制,依次存放在队尾;
如图3所示,本步骤具体包括如下子步骤:
S210:检测是否有CAN中断,若有,则进行下一步获取,若无,则返回本步骤继续检测;
S220:当检测到CAN中断时,CAN中断服务程序从CAN缓冲区采集CAN帧数据;
S230-S240:提取上述CAN帧数据中需要的数据,存放到帧结构体中,形成可存储到消息队列中的CAN帧,并发送到消息队列的队尾;
S250:清除CAN中断,返回步骤S210。
S300:根据设定的读取频率,定期从所述消息队列中读取复数个CAN帧,将各帧数据重组并存入到存储器上。
如图4所示,本步骤中所述的读取和存入的子步骤具体如下:
S310:创建存储任务;
S320:创建并打开存储器的文件,并返回句柄;
值得说明的是,因为频繁的开关文件,会降低存储效率,因此在存储任务开始的时候,需要打开文件并保持打开状态,直至文件大小超过设定大小,或者判断供电异常(实现异常断电之前)关闭文件,并将缓存扇区的数据刷入到文件中;
S330-S350:从消息队列中无阻塞的采集队头的CAN帧,若有CAN帧,则在采集完成后,删除消息队列中对应的CAN帧,若无则返回步骤S330;其中,采用无阻塞方式处理消息队列中的CAN帧,是指:该存储任务得到激活或调度的情况下,所述消息队列为非空时,即只要有CAN帧时,就会被依次读取并删除;
S360:从所采集的CAN帧中读取出各帧数据,并按照指定格式重组各帧数据后写入到存储器的文件中,该文件写入采用了缓存机制,当缓存扇区写满时,才会触发flush操作,将缓存扇区内的数据 刷入到存储器的该文件中;
S370:完成消息队列中所有CAN帧的采集和存储后,此时判断消息队列为空,即没有CAN帧,则延时10毫秒,即主动放弃CPU的处理权10毫秒,让CPU中的其他任务得到调度,然后再返回S330。
本实施例中,由于采用了消息队列,并进行了适合系统需求的配置,使消息队列同时接收来自一路或多路CAN通道的多个CAN帧数据,而不丢帧,保证存储质量,提升了存储效率。
如图5所示,本发明的另一实施例中,还提供了一种采用上述存储方法的存储装置,该存储装置包括:
采集模块110,用于将CAN中断服务中从CAN缓冲区采集的各CAN帧存储到消息队列中;
存储模块120,用于定期的从所述消息队列中读取各CAN帧并重组后进行存储,并删除消息队列中读取出的CAN帧。
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (10)

  1. 一种总线数据存储到存储器上的方法,其特征在于,设置一消息队列,该方法包括:
    采集过程:CAN中断服务程序从CAN缓冲区采集的各CAN帧存储到所述消息队列中;
    定期的存储过程:定期的从所述消息队列中读取各CAN帧并重组后存储到存储器,并删除消息队列中读取出的CAN帧。
  2. 根据权利要求1所述的方法,其特征在于,所述采集过程之前还包括:
    根据CAN设备发送CAN帧的速率及存储器的存储速率配置所述消息队列可存储CAN帧的容量。
  3. 根据权利要求1或2所述的方法,其特征在于,所述消息队列采用FIFO机制进行存储和读取。
  4. 根据权利要求1或2所述的方法,其特征在于,所述采集过程包括:
    检测到CAN中断时,CAN中断服务程序从CAN缓冲区采集CAN帧数据;
    从该CAN帧数据中提取需要的数据,存放到帧结构体中形成可存储到消息队列的CAN帧,并存储到消息队列中。
  5. 根据权利要求1所述的方法,其特征在于,所述采集包括多路CAN通道的同时采集:
    将所述多路CAN中断服务中从多路CAN缓冲区采集的各CAN帧存储到所述消息队列中。
  6. 根据权利要求1所述的方法,其特征在于,所述存储过程包括:
    创建存储任务,创建并打开存储器的文件;
    从所述消息队列中读取各CAN帧,重组各帧数据并写入到所述文件对应的缓存扇区中;
    缓存扇区被写满时,将缓存扇区中的帧数据刷入到存储器的文件中。
  7. 根据权利要求6所述的方法,其特征在于,所述从所述消息队列中读取各CAN帧时采用无阻塞方式处理消息队列中的CAN帧。
  8. 根据权利要求7所述的方法,其特征在于,还包括:所述消息队列为空时,延时一段时间后,再次检测消息队列是否为空。
  9. 一种基于权利要求1-8任一所述方法的存储装置,其特征在于,包括:
    采集模块,用于将CAN中断服务中从CAN缓冲区采集的各CAN帧存储到消息队列中;
    存储模块,用于定期的从所述消息队列中读取各CAN帧并重组后进行存储,并删除消息队列中读取出的CAN帧。
  10. 一种存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1至8中任一项所述的总线数据存储到存储器上的方法。
PCT/CN2019/108653 2019-09-10 2019-09-27 总线数据存储到存储器上的方法、存储装置及存储介质 WO2021046936A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910853740.2 2019-09-10
CN201910853740.2A CN112559198A (zh) 2019-09-10 2019-09-10 总线数据存储到存储器上的方法、存储装置及存储介质

Publications (1)

Publication Number Publication Date
WO2021046936A1 true WO2021046936A1 (zh) 2021-03-18

Family

ID=74865998

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/108653 WO2021046936A1 (zh) 2019-09-10 2019-09-27 总线数据存储到存储器上的方法、存储装置及存储介质

Country Status (2)

Country Link
CN (1) CN112559198A (zh)
WO (1) WO2021046936A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060271600A1 (en) * 2005-05-12 2006-11-30 Goh Sweefen Adaptive and dynamic data synchronization system for managing data and inventory
CN101707599A (zh) * 2009-11-12 2010-05-12 国电南京自动化股份有限公司 故障录波系统中基于dsp的以太网通信方法
CN106302817A (zh) * 2016-09-29 2017-01-04 南京中新赛克科技有限责任公司 一种基于分布式消息队列的数据总线实现方法和装置
CN107659661A (zh) * 2017-10-24 2018-02-02 宁波森浦信息技术有限公司 一种金融实时总线系统及其控制方法

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103684944A (zh) * 2012-09-10 2014-03-26 西门子信号有限公司 嵌入式网关、采用该网关的铁路监测系统及其方法
CN106452819B (zh) * 2015-08-13 2020-07-07 腾讯科技(深圳)有限公司 数据采集系统及数据采集方法
CN105446699A (zh) * 2015-12-07 2016-03-30 中国电子科技集团公司第十研究所 数据帧队列管理方法
CN107391269B (zh) * 2016-03-28 2021-04-20 阿里巴巴集团控股有限公司 一种用于通过持久化队列处理消息的方法与设备
CN106484564B (zh) * 2016-09-18 2020-03-31 上海尚毅测控技术有限公司 一种采集数据存储方法
CN110325929B (zh) * 2016-12-07 2021-05-25 阿瑞路资讯安全科技股份有限公司 用于检测有线网络变化的信号波形分析的系统和方法
CN108512943A (zh) * 2018-05-07 2018-09-07 苏州德姆斯信息技术有限公司 基于消息队列的嵌入式设备数据保存系统及保存方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060271600A1 (en) * 2005-05-12 2006-11-30 Goh Sweefen Adaptive and dynamic data synchronization system for managing data and inventory
CN101707599A (zh) * 2009-11-12 2010-05-12 国电南京自动化股份有限公司 故障录波系统中基于dsp的以太网通信方法
CN106302817A (zh) * 2016-09-29 2017-01-04 南京中新赛克科技有限责任公司 一种基于分布式消息队列的数据总线实现方法和装置
CN107659661A (zh) * 2017-10-24 2018-02-02 宁波森浦信息技术有限公司 一种金融实时总线系统及其控制方法

Also Published As

Publication number Publication date
CN112559198A (zh) 2021-03-26

Similar Documents

Publication Publication Date Title
US9400603B2 (en) Implementing enhanced performance flash memory devices
US8032809B2 (en) Retransmission and delayed ACK timer management logic for TCP protocol
JP3810449B2 (ja) キュー装置
US7631244B2 (en) Soft error correction method, memory control apparatus and memory system
EP1703395A2 (en) Multiprocessor system with a management processor
WO2011039300A1 (en) Method for processing data packets in flow-aware network nodes
US20070168626A1 (en) Transforming flush queue command to memory barrier command in disk drive
CN101663654A (zh) 用于连接到主机的存储设备的优化的提示模型和用于存储设备的写优化方案
CN101853196A (zh) 一种记录异常数据的方法及装置
JP4641443B2 (ja) ログ情報管理装置、ログ情報管理方法およびログ情報管理プログラム
EP3742674B1 (en) Coherent capturing of shared-buffer status
US7840725B2 (en) Capture of data in a computer network
CN102571845A (zh) 一种分布式存储系统的数据存储方法及装置
WO2021046936A1 (zh) 总线数据存储到存储器上的方法、存储装置及存储介质
KR102262209B1 (ko) 더미 입출력 요청을 이용한 배리어 명령 전달 방법 및 그 장치
CN100419689C (zh) 中断处理方法及装置
WO2015170702A1 (ja) ストレージ装置と情報処理システム及びストレージ制御方法とプログラム
CN106484564B (zh) 一种采集数据存储方法
JP3989493B2 (ja) キュー装置
CN106775480A (zh) 一种基于LabVIEW的实时监控系统数据记录方法
CN103268278B (zh) 支持多核处理器的sram控制器及其跟踪信息处理方法
CN111124948A (zh) 嵌入式系统的网络数据抓包方法及系统、存储介质
JP5630033B2 (ja) バッファ管理プログラム及び方法、並びにメッセージ分析装置
JP3562371B2 (ja) Atmセル処理システム及び処理方法並びに記録媒体
JP2000354040A (ja) 系切り替え制御装置および方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19945306

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22.07.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19945306

Country of ref document: EP

Kind code of ref document: A1