WO2019019295A1 - Ring data buffering implementation method based on synchronization mechanism for embedded system - Google Patents

Ring data buffering implementation method based on synchronization mechanism for embedded system Download PDF

Info

Publication number
WO2019019295A1
WO2019019295A1 PCT/CN2017/101335 CN2017101335W WO2019019295A1 WO 2019019295 A1 WO2019019295 A1 WO 2019019295A1 CN 2017101335 W CN2017101335 W CN 2017101335W WO 2019019295 A1 WO2019019295 A1 WO 2019019295A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
buffer
working state
ring
ring buffer
Prior art date
Application number
PCT/CN2017/101335
Other languages
French (fr)
Chinese (zh)
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 WO2019019295A1 publication Critical patent/WO2019019295A1/en

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/543User-generated data transfer, e.g. clipboards, dynamic data exchange [DDE], object linking and embedding [OLE]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0736Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in functional embedded systems, i.e. in a data processing system designed as a combination of hardware and software dedicated to performing a certain function
    • G06F11/0739Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in functional embedded systems, i.e. in a data processing system designed as a combination of hardware and software dedicated to performing a certain function in a data processing system embedded in automotive or aircraft systems
    • 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/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • 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/544Buffers; Shared memory; Pipes

Definitions

  • the invention relates to a ring data buffer implementation method for an embedded system based on a synchronization mechanism.
  • the general ring buffer implementation method is as follows: the ring buffer usually has a read pointer and a write pointer, the read pointer points to the readable data in the ring buffer, and the write pointer points to a writable buffer in the ring buffer, which is read by the mobile.
  • the pointer and write pointer can be used to read and write data from the buffer.
  • Figure 1 is the initial state of the ring buffer, you can see that both the read pointer and the write pointer point to the first buffer;
  • Figure 2 is the case after adding a data to the ring buffer, you can see that the write pointer has moved To the position of data block 2, and the read pointer does not move;
  • Figure 3 shows the state after the ring buffer has been read and added. It can be seen that two data have been added to the ring buffer and one data has been read.
  • the communication data is usually defined as the "frame header + data + checksum" format, and here " The frame header is usually split into two or more linked data and sent to another system, and the "checksum” is calculated according to one frame of data.
  • the data sender and receiver are based on the "frame header".
  • an object of the present invention is to provide a ring data buffer implementation method for an embedded system based on a synchronization mechanism that avoids the above-mentioned technical drawbacks.
  • a method for implementing a ring data buffer based on a synchronization mechanism in an embedded system comprising switching between four working states; the four working states are:
  • Working state 2 There is sufficient memory in the ring buffer to store more data
  • the working state 2 When the working state 2 continues to write data, if the buffer is filled with the newly added data, it enters the working state 4, and if the newly added data does not fill the buffer, it remains in the working state 2;
  • the data of the buffer is read. If the size of the read data is smaller than the size of the data buffered by the buffer, it enters the working state 3. If the size of the read data exceeds or equals the data buffered by the buffer, Go into work status four;
  • the ring buffer is processed according to the actual use requirement in two cases:
  • the ring data buffer implementation method embeds a synchronization mechanism of the embedded system, and the synchronization mechanism is implemented on the ring buffer, and is divided into three steps: initialization, write buffer, and read buffer.
  • the initialized input has two parameters: Max_Index and Unit_Size; Max_Index defines the maximum signal scalar value of the write semaphore and the read semaphore; Unit_Size defines the number of bytes per read buffer or write buffer.
  • the input parameters of the write buffer are Block, TimeOut, and Value; Block determines that No use suspend mode, TimeOut determines the time to suspend, and Value is the data to be written to the ring buffer.
  • the method for implementing the ring data buffering in the embedded system based on the synchronization mechanism provided by the invention uses the semaphore synchronization mechanism of the embedded operating system, and the original ring buffer is more robust, adopting configurable and portable Ring buffer, suitable for different software systems and different hardware systems, can achieve good results in applications of single hardware systems or communication between different hardware systems, and can be well satisfied. The need for practical applications.
  • FIG. 1 is a schematic diagram of an initial state of a ring buffer of the prior art
  • FIG. 2 is a schematic diagram of a state in which a data is added to a ring buffer in the prior art
  • FIG. 3 is a schematic diagram of a state in which a ring buffer of the prior art is read and added;
  • FIG. 4 is a schematic diagram of a switching process of four working states according to the present invention.
  • Figure 5 is a flowchart of initialization of the synchronization mechanism
  • Figure 6 is a flow chart of the write buffer of the synchronization mechanism
  • Figure 7 is a flow chart of the read buffer of the synchronization mechanism.
  • a ring data buffer implementation method for an embedded system based on a synchronization mechanism includes switching between four working states
  • the four working states are:
  • Working state 1 There is no readable data in the ring buffer; when reading data in the ring buffer under working state 1, the ring buffer will be processed according to the actual use requirements in two cases:
  • Working state 2 There is sufficient memory in the ring buffer to store more data; in the working state 2, writing data to the ring buffer does not cause any error, and valid data is written into the buffer.
  • Working state 3 sufficient data is buffered in the ring buffer; in the working state 3, the data is read in the ring buffer without any error, and the valid cached data is returned.
  • Working state 4 There is no writable buffer space in the ring buffer; in the working state 4, when writing data to the ring buffer, the structure will be processed according to the actual use requirements:
  • the working state 2 When the working state 2 continues to write data, if the buffer is filled with the newly added data, it enters the working state 4, and if the newly added data does not fill the buffer, it remains in the working state 2;
  • the data of the buffer is read. If the size of the read data (for example, 4 unit data) is smaller than the buffered data size, it enters the working state 3, if the read data size (for example, 7 Unit data) exceeds or equals the data buffered by the buffer, and enters the working state 4;
  • working state 3 when reading data, when the buffer has no data to read, it enters working state 1.
  • working state 4 When writing data to the buffer, if the buffer is filled with data, it enters working state 4.
  • the cacheable writable space and the readable data of the ring buffer are mutually exclusive, that is, when one unit data is written to the ring buffer, the ring buffer can be
  • the rewritten circular buffer space is reduced by one unit, and the readable buffer data is one more unit size; on the contrary, whenever a unit of data is fetched from the ring buffer, it can be read from the ring buffer.
  • Cache data is reduced by one unit, and the ring buffer will be one more unit. A small space to store newly written data.
  • a key technique in the above ring buffer is the synchronization between the size of the writable data and the size of the readable cache data.
  • the embedded operating system will have a synchronization mechanism component (API), and the synchronization mechanism implementation principle and usage method in different embedded operating systems are basically similar. You can make full use of the synchronization mechanism that comes with these systems to embed in the above ring buffer.
  • API synchronization mechanism component
  • the ring data buffer implementation method for the embedded system based on the synchronization mechanism is embedded with the synchronization mechanism of the embedded system, and the synchronization mechanism is implemented on the ring buffer, and is divided into three steps: initialization, write buffering, and Read buffer
  • Max_Index defines the maximum signal scalar value of the write semaphore (Write_Sem) and read semaphore (Read_Sem).
  • Unit_Size defines the number of bytes per read buffer or write buffer (one unit data size).
  • the initial value of Write_Sem is defined as Max_Index, because the data in the buffer area is empty, that is, the Max_Index data can be written (if the data is not read or the buffer is cleared), the same principle
  • the initial value of Read_Sem is defined as 0 (the data is not started at the beginning). Readable).
  • the initialization data buffer size is Unit_Size x Max_Index (Max_Index unit data). Both Write_Pointer and Read_Pointer are initialized to 0, which means that the data read into the ring buffer and the write data are initially pointed to the first address of the buffered data.
  • the input parameters of the write buffer are Block, TimeOut and Value.
  • Block determines whether to use the suspended (blocked) mode, and TimeOut determines the time to suspend (block).
  • Value is the data to be written to the ring buffer.
  • Pend(x,x) and Accept(x) in Figure 6 are functions of blocking semaphore acquisition or non-blocking semaphore acquisition, respectively. Blocking semaphore acquisition function: If a specific semaphore is not obtained (the Write_Sem semaphore is 0 in Figure 6), it will block. If the semaphore is still not available during the TimeOut period, it will exit the blocking.
  • the Read_Sem is incremented here by the function Add(x), and when it is incremented to be larger than the semaphore
  • the maximum scalar value is Max_Index
  • Read_Sem will not be incremented anymore.
  • the corresponding write pointer is incremented cyclically. When it is incremented to be greater than or equal to Max_Index, the write pointer points to the first address of the buffered data. Finally, return the return value err obtained when acquiring a specific semaphore.
  • the difference between the read buffer and the write buffer is mainly that the specific semaphore to be acquired here is the read semaphore (Read_Sem), and after the data is successfully read, the write semaphore (Write_Sem) is incremented.
  • the cyclic increment is the read pointer, which returns the data err with or without the error flag and the data read from a specific location in the buffer.
  • the blocking type semaphore acquisition function Pend(x, x) mentioned in the above read buffer and write buffer, the non-blocking type semaphore acquisition function Accept(x), and the x semaphore increment function Add(x), in each Embedded operating systems with semaphores have their own prototypes, such as functions in the UCOS operating system: OSSemPend(), OSSemAccept(), OSSemPost(); functions in the Linux operating system: sem_wait(), sem_trywait() , sem_post().
  • the benefits of these functions are to ease the pressure of software writing and to make efficient use of resources.
  • the method for implementing the ring data buffering in the embedded system based on the synchronization mechanism provided by the invention uses the semaphore synchronization mechanism of the embedded operating system, and the original ring buffer is more robust, adopting configurable and portable Ring buffer, suitable for different software systems and different hardware systems, can achieve good results in applications of single hardware systems or communication between different hardware systems, and can be well satisfied. The need for practical applications.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Information Transfer Systems (AREA)

Abstract

Disclosed is a ring data buffering implementation method based on a synchronization mechanism for an embedded system, the method comprising: when data is written under a first working state, switching to a second working state; when data continues to be written under the second working state, if a buffer is filled with newly added data, entering a fourth working state; under the second working state, reading the data of the buffer, and if the size of the read data is smaller than the size of buffered data in the buffer, entering a third working state, otherwise, entering the fourth working state; and under the third working state, when data is read and no data in the buffer can be read, entering the first working state, and when the data is written into the buffer, if the buffer is filled with data through writing, entering the fourth working state. The method uses a semaphore synchronization mechanism built into an embedded operating system, an original ring buffer is stronger, a configurable and transplantable ring buffer is used, the method is applicable to different software systems and different hardware systems, and the requirements of practical application can be better met.

Description

用于嵌入式系统基于同步机制下的环形数据缓冲实现方法Ring data buffer implementation method for embedded system based on synchronization mechanism 技术领域Technical field
本发明涉及一种用于嵌入式系统基于同步机制下的环形数据缓冲实现方法。The invention relates to a ring data buffer implementation method for an embedded system based on a synchronization mechanism.
背景技术Background technique
嵌入式通信程序中,经常有这样一个情景:需要程序一边从通讯接口接收数据,一边解析接收的数据。具体情景为:嵌入式系统在采集并解析汽车数据的系统应用中,系统必须采集数据的同时根据这些实时数据以一定的形式向用户表达出来,或者根据数据做出一些逻辑运算等一系列可能比较耗时的工作。这样的情景一般存在以下约束:In embedded communication programs, there is often a scenario where the program needs to parse the received data while receiving data from the communication interface. The specific scenario is: embedded system in the system application of collecting and parsing car data, the system must collect data according to the real-time data to express to the user in a certain form, or make some logical operations based on the data, etc. Time-consuming work. Such scenarios generally have the following constraints:
1)由于实时性要求,必须边读取数据,边对数据进行解析,不能等数据全部接收完整后才能开始解析,同时也不能等解析完一帧数据后才开始接收下一帧数据;1) Due to real-time requirements, it is necessary to read the data while parsing the data. The data cannot be parsed until the data is completely received, and the next frame data cannot be received after parsing one frame of data;
2)数据的解析需要兼容性能和内存空间的利用效率,特别是应用在内存等资源比较有限的嵌入式系统环境中,所以要做到减少内存之间的直接拷贝,分配适当大小的缓存空间。2) Data parsing requires compatibility performance and memory space utilization efficiency, especially in embedded system environments where memory and other resources are limited, so it is necessary to reduce direct copy between memory and allocate appropriate size cache space.
以上背景应用场景通常会使用环形缓冲方法来实现。The above background application scenarios are usually implemented using the ring buffer method.
一般环形缓冲区的实现方法为:环形缓冲区通常有一个读指针和一个写指针,读指针指向环形缓冲区中可读的数据,写指针指向环形缓冲区中可写的缓冲区,通过移动读指针和写指针就可以实现缓冲区的数据读取和写入。The general ring buffer implementation method is as follows: the ring buffer usually has a read pointer and a write pointer, the read pointer points to the readable data in the ring buffer, and the write pointer points to a writable buffer in the ring buffer, which is read by the mobile. The pointer and write pointer can be used to read and write data from the buffer.
图1、图2和图3是一个环形缓冲区的运行示意图。图1是环形缓冲区的初始状态,可以看到读指针和写指针都指向第一个缓冲区处;图2是向环形缓冲区中添加了一个数据后的情况,可以看到写指针已经移动到数据块2的位置,而读指针没有移动;图3是环形缓冲区进行了读取和添加后的状态,可以看到环形缓冲区中已经添加了两个数据,已经读取了一个数据。1, 2 and 3 are schematic diagrams of the operation of a ring buffer. Figure 1 is the initial state of the ring buffer, you can see that both the read pointer and the write pointer point to the first buffer; Figure 2 is the case after adding a data to the ring buffer, you can see that the write pointer has moved To the position of data block 2, and the read pointer does not move; Figure 3 shows the state after the ring buffer has been read and added. It can be seen that two data have been added to the ring buffer and one data has been read.
以上是现有技术的环形缓冲的基本实现原理和模型,在实际应用中存在诸多的问题:1)读指针和写指针会出现重叠的情况,这可能导致读取的数据不准 确;2)当外部模块从缓存中读取数据的速度跟不上向该缓存写数据速度时,会出现读取的数据帧的前后不连续问题,例如引用上面图3中的环形缓冲区,假设读指针保持在2号位置,把这一刻时间定义为T0,而写指针不断向前递增,当写指针已经从6号位置跳到1号时,把这一刻时间定义为T1,然后继续递增到4号位置,这时T1时刻3号位置的数据已经不是T0时刻的数据;这种情况在对于要求保持采集数据帧连续性要求较高的场合下的应用是不允许出现的;例如,在两个相对独立的模块或系统之间的通讯的应用中,为了确保数据的准确性和安全性,通常会把通讯数据定义为“帧头+数据+校验和”的格式,而且这里的“帧头”通常会分拆到两个或多个联系的数据上发送到另外一个系统,而“校验和”则要根据一帧数据来计算,数据发送端和接收端都要根据“帧头”和“校验和”来判断数据的有效性,并且排除干扰数据;假如把这类通讯方式使用了上述带有缺陷的环形缓冲区,则很多数据帧及数据之间原有的前后连续性都有可能被破坏而导致数据接收端的系统不能正确有效地分析通讯数据。The above is the basic implementation principle and model of the prior art ring buffer. There are many problems in practical applications: 1) The read pointer and the write pointer may overlap, which may result in the read data being inaccurate. Indeed; 2) when the speed at which the external module reads data from the cache cannot keep up with the speed of writing data to the cache, there will be a problem of discontinuity before and after the read data frame, for example, referring to the ring buffer in Figure 3 above. Suppose the read pointer is kept at position 2, the moment is defined as T0, and the write pointer is continuously incremented. When the write pointer has jumped from position 6 to number 1, the time is defined as T1, and then continues to increment. To position 4, the data at position 3 at time T1 is no longer the data at time T0; this situation is not allowed in applications where the requirement for maintaining the continuity of the acquired data frame is high; for example, In the application of communication between two relatively independent modules or systems, in order to ensure the accuracy and security of the data, the communication data is usually defined as the "frame header + data + checksum" format, and here " The frame header is usually split into two or more linked data and sent to another system, and the "checksum" is calculated according to one frame of data. The data sender and receiver are based on the "frame header". And "checksum" to judge the validity of the data, and to exclude the interference data; if such a communication method uses the above-mentioned defective ring buffer, the original continuity between many data frames and data It is possible that the system at the data receiving end may be corrupted and the communication data cannot be analyzed correctly and efficiently.
目前有文献提出使用软件计数器的方法来实现对环形缓冲的读写数据,其基本实现原理是这样的:在读数据和写数据时同时判断读指针和写指针的位置,为保证读写数据不发生上述的冲突,由这两个位置差可以得出还剩余多少空间可以写入数据的;但这样的结构会比较耗CPU资源,因为其要不断进行逻辑判断的操作。At present, there are literatures that use the software counter method to realize the read and write data to the ring buffer. The basic implementation principle is as follows: the position of the read pointer and the write pointer are simultaneously determined when reading data and writing data, so as to ensure that the read and write data does not occur. The above conflicts, from these two position differences, can be used to calculate how much space is left to write data; but such a structure will consume CPU resources because it has to perform logical judgment operations.
发明内容Summary of the invention
针对上述现有技术中存在的问题,本发明的目的在于提供一种可避免出现上述技术缺陷的用于嵌入式系统基于同步机制下的环形数据缓冲实现方法。In view of the above problems in the prior art, an object of the present invention is to provide a ring data buffer implementation method for an embedded system based on a synchronization mechanism that avoids the above-mentioned technical drawbacks.
为了实现上述发明目的,本发明提供的技术方案如下:In order to achieve the above object, the technical solution provided by the present invention is as follows:
一种用于嵌入式系统基于同步机制下的环形数据缓冲实现方法,包括四个工作状态的切换;所述四个工作状态,分别是:A method for implementing a ring data buffer based on a synchronization mechanism in an embedded system, comprising switching between four working states; the four working states are:
工作状态一:环形缓冲区里面没有可读的数据;Working state 1: There is no readable data in the ring buffer;
工作状态二:环形缓冲区里面有充足的内存可以储存更多的数据;Working state 2: There is sufficient memory in the ring buffer to store more data;
工作状态三:环形缓冲区里缓存了充足的数据;Working state three: sufficient data is buffered in the ring buffer;
工作状态四:环形缓冲区里面没有可写的缓存空间;Working state four: there is no writable buffer space in the ring buffer;
所述四个工作状态的切换过程为: The switching process of the four working states is:
在工作状态一写入数据时,就切换到工作状态二;When the data is written in the working state, it switches to the working state 2;
在工作状态二继续写入数据时,如果缓冲区被新增加的数据写满,就进入工作状态四,如果新增的数据没能使缓冲区填满,则还是保持在工作状态二;When the working state 2 continues to write data, if the buffer is filled with the newly added data, it enters the working state 4, and if the newly added data does not fill the buffer, it remains in the working state 2;
在工作状态二下,读取缓冲区的数据,如果读取的数据大小小于缓冲区缓冲好的数据大小,就进入工作状态三,如果读取的数据大小超出或者等于缓冲区所缓存的数据,就进入工作状态四;In the working state 2, the data of the buffer is read. If the size of the read data is smaller than the size of the data buffered by the buffer, it enters the working state 3. If the size of the read data exceeds or equals the data buffered by the buffer, Go into work status four;
在工作状态三,读取数据时,当缓冲区没有数据可读时,就进入工作状态一,向缓冲区写入数据时,如果缓冲区被写满了数据,则进入工作状态四。In the working state three, when reading data, when the buffer has no data to read, it enters the working state. When writing data to the buffer, if the buffer is full of data, it enters the working state four.
进一步地,在工作状态一下的环形缓存区中读取数据时,环形缓冲区会根据实际使用需求分两种情况来处理:Further, when data is read in the ring buffer area in the working state, the ring buffer is processed according to the actual use requirement in two cases:
1)直接返回一个带有错误标志位的数据给调用该环形缓冲区的程序;1) directly return a data with an error flag to the program that called the ring buffer;
2)程序在这里挂起一段时间,在这时间段内有数据被写入到该环形缓冲区时,该环形缓冲区会立即返回一个单位大小的缓存数据给调用该环形缓冲区的程序;如果等待了这段时间仍然没有数据被写入到该环形缓冲区,则该环形缓冲区返回一个带有错误标志位的数据给调用该环形缓冲区的程序。2) The program hangs here for a period of time. When data is written to the ring buffer during this time period, the ring buffer will immediately return a unit size of cache data to the program that calls the ring buffer; Waiting for this time, no data is still written to the ring buffer, then the ring buffer returns a data with an error flag to the program that called the ring buffer.
进一步地,在工作状态四下,继续向环形缓存区中写入数据时,该结构会根据实际使用需求分两种情况来处理:Further, when the data is continuously written to the ring buffer area under the working state four, the structure is processed according to the actual use requirement in two cases:
1)直接返回一个带有错误标志位的数据给调用该环形缓冲区的程序;1) directly return a data with an error flag to the program that called the ring buffer;
2)程序在这里挂起一段时间;在这时间段内有其他缓存的数据从该环形缓存空间取出时,该形缓冲结构会立刻保存这个数据并返回不带有错误标志位的数据给调用该环形缓冲区的程序;如果等待了这段时间仍然没有其他缓存的数据从环形缓冲区中被取出,该环形缓冲区返回一个带有错误标志位的数据给调用该环形缓冲区的程序。2) The program hangs here for a period of time; when other cached data is taken out of the ring buffer space during this time period, the shape buffer structure will immediately save the data and return the data without the error flag to call the The program of the ring buffer; if no other cached data is fetched from the ring buffer while waiting for this time, the ring buffer returns a data with an error flag to the program that called the ring buffer.
进一步地,所述环形数据缓冲实现方法嵌入有嵌入式系统的同步机制,所述同步机制在环形缓冲区上实现,分为三个步骤:初始化、写缓冲和读缓冲。Further, the ring data buffer implementation method embeds a synchronization mechanism of the embedded system, and the synchronization mechanism is implemented on the ring buffer, and is divided into three steps: initialization, write buffer, and read buffer.
进一步地,初始化的输入有Max_Index和Unit_Size两参数;Max_Index定义了写信号量和读信号量的最大信号标量值;Unit_Size定义的是每次读缓存区或写缓存区的字节数大小。Further, the initialized input has two parameters: Max_Index and Unit_Size; Max_Index defines the maximum signal scalar value of the write semaphore and the read semaphore; Unit_Size defines the number of bytes per read buffer or write buffer.
进一步地,写缓冲的输入参数有Block、TimeOut和Value;Block决定是 否使用挂起的模式,TimeOut决定挂起的时间,Value为要写入环形缓冲区内的数据。Further, the input parameters of the write buffer are Block, TimeOut, and Value; Block determines that No use suspend mode, TimeOut determines the time to suspend, and Value is the data to be written to the ring buffer.
本发明提供的用于嵌入式系统基于同步机制下的环形数据缓冲实现方法,使用了嵌入式操作系统自带的信号量同步机制,原有的环形缓冲区更加强壮,采用可配置和可移植的环形缓冲区,适用于不同的软件系统和不同的硬件体系,在不管是单个硬件系统的应用或是不同硬件系统之间的通讯上的应用,都能取得很好的效果,可以很好地满足实际应用的需要。The method for implementing the ring data buffering in the embedded system based on the synchronization mechanism provided by the invention uses the semaphore synchronization mechanism of the embedded operating system, and the original ring buffer is more robust, adopting configurable and portable Ring buffer, suitable for different software systems and different hardware systems, can achieve good results in applications of single hardware systems or communication between different hardware systems, and can be well satisfied. The need for practical applications.
附图说明DRAWINGS
图1为现有技术的环形缓冲区的初始状态示意图;1 is a schematic diagram of an initial state of a ring buffer of the prior art;
图2为现有技术的向环形缓冲区中添加了一个数据后的状态示意图;2 is a schematic diagram of a state in which a data is added to a ring buffer in the prior art;
图3为现有技术的环形缓冲区进行了读取和添加后的状态示意图;3 is a schematic diagram of a state in which a ring buffer of the prior art is read and added;
图4为本发明的四个工作状态的切换过程示意图;4 is a schematic diagram of a switching process of four working states according to the present invention;
图5为同步机制的初始化流程图;Figure 5 is a flowchart of initialization of the synchronization mechanism;
图6为同步机制的写缓冲流程图;Figure 6 is a flow chart of the write buffer of the synchronization mechanism;
图7为同步机制的读缓冲流程图。Figure 7 is a flow chart of the read buffer of the synchronization mechanism.
具体实施方式Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白,下面结合附图和具体实施例对本发明做进一步说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The present invention will be further described in conjunction with the accompanying drawings and specific embodiments. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
如图4所示,用于嵌入式系统基于同步机制下的环形数据缓冲实现方法,包括四个工作状态的切换;As shown in FIG. 4, a ring data buffer implementation method for an embedded system based on a synchronization mechanism includes switching between four working states;
所述四个工作状态,分别是:The four working states are:
1.工作状态1:环形缓冲区里面没有可读的数据;在工作状态1下的环形缓存区中读取数据时,该环形缓冲区会根据实际使用需求分两种情况来处理:1. Working state 1: There is no readable data in the ring buffer; when reading data in the ring buffer under working state 1, the ring buffer will be processed according to the actual use requirements in two cases:
1)直接返回一个带有错误标志位的数据给调用该环形缓冲区的程序;1) directly return a data with an error flag to the program that called the ring buffer;
2)程序在这里挂起(阻塞)一段时间,在这时间段内有数据被写入到该环形缓冲区时,该环形缓冲区会立即返回一个单位大小的缓存数据给调用该环形 缓冲区的程序;如果等待了这段时间仍然没有数据被写入到该环形缓冲区,则该环形缓冲区返回一个带有错误标志位的数据给调用该环形缓冲区的程序。2) The program hangs (blocks) here for a period of time. When data is written to the ring buffer during this time period, the ring buffer will immediately return a unit size of cache data to call the ring. The program of the buffer; if no data is written to the ring buffer while waiting for this time, the ring buffer returns a data with an error flag to the program that called the ring buffer.
2.工作状态2:环形缓冲区里面有充足的内存可以储存更多的数据;在工作状态2下向该环形缓冲区写入数据不会出现任何错误,并且有效数据写入缓存中。2. Working state 2: There is sufficient memory in the ring buffer to store more data; in the working state 2, writing data to the ring buffer does not cause any error, and valid data is written into the buffer.
3.工作状态3:环形缓冲区里缓存了充足的数据;在工作状态3下在该环形缓冲区读取数据不会出现任何错误,并且返回有效的缓存的数据。3. Working state 3: sufficient data is buffered in the ring buffer; in the working state 3, the data is read in the ring buffer without any error, and the valid cached data is returned.
4.工作状态4:环形缓冲区里面没有可写的缓存空间;在工作状态4下,继续向环形缓存区中写入数据时,该结构会根据实际使用需求分两种情况来处理:4. Working state 4: There is no writable buffer space in the ring buffer; in the working state 4, when writing data to the ring buffer, the structure will be processed according to the actual use requirements:
1)直接返回一个带有错误标志位的数据给调用该环形缓冲区的程序;1) directly return a data with an error flag to the program that called the ring buffer;
2)程序在这里挂起(阻塞)一段时间;在这时间段内有其他缓存的数据从该环形缓存空间取出时,该形缓冲结构会立刻保存这个数据并返回不带有错误标志位的数据给调用该环形缓冲区的程序;如果等待了这段时间仍然没有其他缓存的数据从环形缓冲区中被取出,该环形缓冲区返回一个带有错误标志位的数据给调用该环形缓冲区的程序。2) The program hangs (blocks) here for a period of time; when other cached data is fetched from the ring buffer space during this time period, the shape buffer structure will immediately save the data and return the data without the error flag. The program that calls the ring buffer; if no other cached data is fetched from the ring buffer while waiting for this time, the ring buffer returns a data with an error flag to the program that called the ring buffer. .
四个工作状态的切换过程为:The switching process of the four working states is:
在工作状态1写入数据(例如5个单位数据)时,就切换到工作状态2;When the data is written in the working state 1 (for example, 5 unit data), it is switched to the working state 2;
在工作状态2继续写入数据时,如果缓冲区被新增加的数据写满,就进入工作状态4,如果新增的数据没能使缓冲区填满,则还是保持在工作状态2;When the working state 2 continues to write data, if the buffer is filled with the newly added data, it enters the working state 4, and if the newly added data does not fill the buffer, it remains in the working state 2;
在工作状态2下,读取缓冲区的数据,如果读取的数据大小(例如4个单位数据)小于缓冲区缓冲好的数据大小,就进入工作状态3,如果读取的数据大小(例如7个单位数据)超出或者等于缓冲区所缓存的数据,就进入工作状态4;In working state 2, the data of the buffer is read. If the size of the read data (for example, 4 unit data) is smaller than the buffered data size, it enters the working state 3, if the read data size (for example, 7 Unit data) exceeds or equals the data buffered by the buffer, and enters the working state 4;
在工作状态3,读取数据时,当缓冲区没有数据可读时,就进入工作状态1,向缓冲区写入数据时,如果缓冲区被写满了数据,则进入工作状态4。In working state 3, when reading data, when the buffer has no data to read, it enters working state 1. When writing data to the buffer, if the buffer is filled with data, it enters working state 4.
从上述四个工作状态的切换效果来看,该环形缓冲区的缓存的可写空间和可读数据是互斥的,也就是当每向该环形缓冲区写入一个单位数据,该环形缓冲可再写入的环形缓冲空间就减少一个单位,同时可读的缓存数据的就会多一个单位大小;相反,每当从该环形缓冲区取出一个单位的数据,该能从该环形缓冲读取的缓存数据就减少一个单位大小,同时该环形缓冲就会多一个单位大 小空间来储存新写入的数据。From the switching effect of the above four working states, the cacheable writable space and the readable data of the ring buffer are mutually exclusive, that is, when one unit data is written to the ring buffer, the ring buffer can be The rewritten circular buffer space is reduced by one unit, and the readable buffer data is one more unit size; on the contrary, whenever a unit of data is fetched from the ring buffer, it can be read from the ring buffer. Cache data is reduced by one unit, and the ring buffer will be one more unit. A small space to store newly written data.
上述环形缓冲区中有个关键的技术是可写入数据的空间大小和可读出缓存数据大小之间的同步关系。一般嵌入式操作系统都会带有同步机制的组件(API),而且不同嵌入式操作系统中的同步机制实现原理及使用方法基本类似。可以充分利用这些系统自带的同步机制嵌入到上述的环形缓冲区中。A key technique in the above ring buffer is the synchronization between the size of the writable data and the size of the readable cache data. Generally, the embedded operating system will have a synchronization mechanism component (API), and the synchronization mechanism implementation principle and usage method in different embedded operating systems are basically similar. You can make full use of the synchronization mechanism that comes with these systems to embed in the above ring buffer.
本发明的用于嵌入式系统基于同步机制下的环形数据缓冲实现方法,嵌入有嵌入式系统的同步机制,所述同步机制在环形缓冲区上实现,分为三个步骤:初始化、写缓冲和读缓冲;The ring data buffer implementation method for the embedded system based on the synchronization mechanism is embedded with the synchronization mechanism of the embedded system, and the synchronization mechanism is implemented on the ring buffer, and is divided into three steps: initialization, write buffering, and Read buffer
如图5所示,初始化的输入主要有Max_Index和Unit_Size两参数。Max_Index定义了写信号量(Write_Sem)和读信号量(Read_Sem)的最大信号标量值。Unit_Size定义的是每次读缓存区或写缓存区的字节数大小(一单元数据大小)。Write_Sem初始值定义为Max_Index,因为刚开始缓存区的数据为空,即可以写入Max_Index次数据(假如一直不读取数据或清空缓冲区),同样原理Read_Sem初始值定义为0(刚开始没数据可读)。初始化数据缓冲区大小为Unit_Size x Max_Index(Max_Index个单元数据)。Write_Pointer和Read_Pointer都被初始化为0,代表向该环形缓冲中读取数据和写数据刚开始都指向于缓冲数据的首地址。As shown in Figure 5, the initialized input has two parameters, Max_Index and Unit_Size. Max_Index defines the maximum signal scalar value of the write semaphore (Write_Sem) and read semaphore (Read_Sem). Unit_Size defines the number of bytes per read buffer or write buffer (one unit data size). The initial value of Write_Sem is defined as Max_Index, because the data in the buffer area is empty, that is, the Max_Index data can be written (if the data is not read or the buffer is cleared), the same principle The initial value of Read_Sem is defined as 0 (the data is not started at the beginning). Readable). The initialization data buffer size is Unit_Size x Max_Index (Max_Index unit data). Both Write_Pointer and Read_Pointer are initialized to 0, which means that the data read into the ring buffer and the write data are initially pointed to the first address of the buffered data.
如图6所示,写缓冲的输入参数有Block,TimeOut和Value这三个。Block决定是否使用挂起(阻塞)的模式,TimeOut决定挂起(阻塞)的时间。Value为要写入环形缓冲区内的数据。图6上Pend(x,x)和Accept(x)分别为阻塞型信号量获取或非阻塞型信号量获取的函数。阻塞型信号量获取函数:获取不到特定信号量(图6上为Write_Sem信号量为0时)则会阻塞,在阻塞时算起TimeOut时间段内依然获取不到特定的信号量,则退出阻塞状态并且返回带有错误标志位的数据(err=1),若获取到则返回,特定的信号量自减1,并且返回的数据(err=0)中不含有错误标志;非阻塞型信号量获取函数:如果获取到特定信号量(上图为Write_Sem)返回一不带有错误标志位的数据(err=0),否则返回带有错误标志位的数据(err=1)。非阻塞型信号量获取函数调用过程都不会有阻塞的情况发生。接着根据这个数据err来判断是否进一步向数据缓冲Buffer特定位置写入用户数据(Value),当写入数据后,将Read_Sem进行递增在这里用函数Add(x)所表示,当递增到大于信号量最大标量值Max_Index时, Read_Sem不会再被递增。相应的写指针进行循环递增,递增到大于或等于Max_Index时,写指针又再指向缓冲数据的首地址处。最后返回获取特定信号量时所得到的返回值err。As shown in Figure 6, the input parameters of the write buffer are Block, TimeOut and Value. Block determines whether to use the suspended (blocked) mode, and TimeOut determines the time to suspend (block). Value is the data to be written to the ring buffer. Pend(x,x) and Accept(x) in Figure 6 are functions of blocking semaphore acquisition or non-blocking semaphore acquisition, respectively. Blocking semaphore acquisition function: If a specific semaphore is not obtained (the Write_Sem semaphore is 0 in Figure 6), it will block. If the semaphore is still not available during the TimeOut period, it will exit the blocking. Status and return data with error flag (err=1), if it is obtained, it returns, the specific semaphore is decremented by 1, and the returned data (err=0) does not contain error flag; non-blocking semaphore Get function: If a specific semaphore is acquired (Write_Sem above), return a data without error flag (err=0), otherwise return data with error flag (err=1). There is no blocking of the non-blocking semaphore acquisition function call process. Then, according to the data err, it is judged whether the user data (Value) is further written to the specific position of the data buffer Buffer, and after the data is written, the Read_Sem is incremented here by the function Add(x), and when it is incremented to be larger than the semaphore When the maximum scalar value is Max_Index, Read_Sem will not be incremented anymore. The corresponding write pointer is incremented cyclically. When it is incremented to be greater than or equal to Max_Index, the write pointer points to the first address of the buffered data. Finally, return the return value err obtained when acquiring a specific semaphore.
如图7所示,读缓冲与写缓冲区的区别主要是这里要获取的特定的信号量是读信号量(Read_Sem),而成功读取数据后,要递增的是写信号量(Write_Sem),循环递增的是读指针,返回的是带有或不带有错误标志位的数据err和从缓冲区特定位置所读取的数据。As shown in FIG. 7, the difference between the read buffer and the write buffer is mainly that the specific semaphore to be acquired here is the read semaphore (Read_Sem), and after the data is successfully read, the write semaphore (Write_Sem) is incremented. The cyclic increment is the read pointer, which returns the data err with or without the error flag and the data read from a specific location in the buffer.
在上述的读缓冲和写缓冲中提及到的阻塞型信号量获取函数Pend(x,x),非阻塞型信号量获取函数Accept(x),x信号量递增函数Add(x),在各个带有信号量的嵌入式操作系统都有自己相应的原型,如UCOS操作系统中的函数:OSSemPend(),OSSemAccept(),OSSemPost();Linux操作系统中的函数:sem_wait(),sem_trywait(),sem_post()。这些函数的好处在于减轻软件编写的压力和有效地利用资源。The blocking type semaphore acquisition function Pend(x, x) mentioned in the above read buffer and write buffer, the non-blocking type semaphore acquisition function Accept(x), and the x semaphore increment function Add(x), in each Embedded operating systems with semaphores have their own prototypes, such as functions in the UCOS operating system: OSSemPend(), OSSemAccept(), OSSemPost(); functions in the Linux operating system: sem_wait(), sem_trywait() , sem_post(). The benefits of these functions are to ease the pressure of software writing and to make efficient use of resources.
本发明提供的用于嵌入式系统基于同步机制下的环形数据缓冲实现方法,使用了嵌入式操作系统自带的信号量同步机制,原有的环形缓冲区更加强壮,采用可配置和可移植的环形缓冲区,适用于不同的软件系统和不同的硬件体系,在不管是单个硬件系统的应用或是不同硬件系统之间的通讯上的应用,都能取得很好的效果,可以很好地满足实际应用的需要。The method for implementing the ring data buffering in the embedded system based on the synchronization mechanism provided by the invention uses the semaphore synchronization mechanism of the embedded operating system, and the original ring buffer is more robust, adopting configurable and portable Ring buffer, suitable for different software systems and different hardware systems, can achieve good results in applications of single hardware systems or communication between different hardware systems, and can be well satisfied. The need for practical applications.
以上所述实施例仅表达了本发明的实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。 The above-mentioned embodiments are merely illustrative of the embodiments of the present invention, and the description thereof is not to be construed as limiting the scope of the invention. It should be noted that a number of variations and modifications may be made by those skilled in the art without departing from the spirit and scope of the invention. Therefore, the scope of the invention should be determined by the appended claims.

Claims (6)

  1. 一种用于嵌入式系统基于同步机制下的环形数据缓冲实现方法,其特征在于,包括四个工作状态的切换;所述四个工作状态,分别是:A method for implementing a ring data buffer based on a synchronization mechanism in an embedded system, comprising: switching between four working states; the four working states are:
    工作状态一:环形缓冲区里面没有可读的数据;Working state 1: There is no readable data in the ring buffer;
    工作状态二:环形缓冲区里面有充足的内存可以储存更多的数据;Working state 2: There is sufficient memory in the ring buffer to store more data;
    工作状态三:环形缓冲区里缓存了充足的数据;Working state three: sufficient data is buffered in the ring buffer;
    工作状态四:环形缓冲区里面没有可写的缓存空间;Working state four: there is no writable buffer space in the ring buffer;
    所述四个工作状态的切换过程为:The switching process of the four working states is:
    在工作状态一写入数据时,就切换到工作状态二;When the data is written in the working state, it switches to the working state 2;
    在工作状态二继续写入数据时,如果缓冲区被新增加的数据写满,就进入工作状态四,如果新增的数据没能使缓冲区填满,则还是保持在工作状态二;When the working state 2 continues to write data, if the buffer is filled with the newly added data, it enters the working state 4, and if the newly added data does not fill the buffer, it remains in the working state 2;
    在工作状态二下,读取缓冲区的数据,如果读取的数据大小小于缓冲区缓冲好的数据大小,就进入工作状态三,如果读取的数据大小超出或者等于缓冲区所缓存的数据,就进入工作状态四;In the working state 2, the data of the buffer is read. If the size of the read data is smaller than the size of the data buffered by the buffer, it enters the working state 3. If the size of the read data exceeds or equals the data buffered by the buffer, Go into work status four;
    在工作状态三,读取数据时,当缓冲区没有数据可读时,就进入工作状态一,向缓冲区写入数据时,如果缓冲区被写满了数据,则进入工作状态四。In the working state three, when reading data, when the buffer has no data to read, it enters the working state. When writing data to the buffer, if the buffer is full of data, it enters the working state four.
  2. 根据权利要求1所述的用于嵌入式系统的缓冲方法,其特征在于,在工作状态一下的环形缓存区中读取数据时,环形缓冲区会根据实际使用需求分两种情况来处理:The buffering method for an embedded system according to claim 1, wherein when the data is read in the ring buffer area in the working state, the ring buffer is processed according to the actual use requirement in two cases:
    1)直接返回一个带有错误标志位的数据给调用该环形缓冲区的程序;1) directly return a data with an error flag to the program that called the ring buffer;
    2)程序在这里挂起一段时间,在这时间段内有数据被写入到该环形缓冲区时,该环形缓冲区会立即返回一个单位大小的缓存数据给调用该环形缓冲区的程序;如果等待了这段时间仍然没有数据被写入到该环形缓冲区,则该环形缓冲区返回一个带有错误标志位的数据给调用该环形缓冲区的程序。2) The program hangs here for a period of time. When data is written to the ring buffer during this time period, the ring buffer will immediately return a unit size of cache data to the program that calls the ring buffer; Waiting for this time, no data is still written to the ring buffer, then the ring buffer returns a data with an error flag to the program that called the ring buffer.
  3. 根据权利要求1-2所述的用于嵌入式系统基于同步机制下的环形数据缓冲实现方法,其特征在于,在工作状态四下,继续向环形缓存区中写入数据时,该结构会根据实际使用需求分两种情况来处理:The ring data buffer implementation method for an embedded system based on a synchronization mechanism according to any of claims 1-2, characterized in that, in the working state four, when the data is continuously written into the ring buffer area, the structure is based on The actual use requirements are handled in two cases:
    1)直接返回一个带有错误标志位的数据给调用该环形缓冲区的程序。 1) Directly return a data with an error flag to the program that called the ring buffer.
    2)程序在这里挂起一段时间;在这时间段内有其他缓存的数据从该环形缓存空间取出时,该形缓冲结构会立刻保存这个数据并返回不带有错误标志位的数据给调用该环形缓冲区的程序;如果等待了这段时间仍然没有其他缓存的数据从环形缓冲区中被取出,该环形缓冲区返回一个带有错误标志位的数据给调用该环形缓冲区的程序。2) The program hangs here for a period of time; when other cached data is taken out of the ring buffer space during this time period, the shape buffer structure will immediately save the data and return the data without the error flag to call the The program of the ring buffer; if no other cached data is fetched from the ring buffer while waiting for this time, the ring buffer returns a data with an error flag to the program that called the ring buffer.
  4. 根据权利要求1-3所述的用于嵌入式系统基于同步机制下的环形数据缓冲实现方法,其特征在于,所述环形数据缓冲实现方法嵌入有嵌入式系统的同步机制,所述同步机制在环形缓冲区上实现,分为三个步骤:初始化、写缓冲和读缓冲。The ring data buffer implementation method for an embedded system based on a synchronization mechanism according to any of claims 1-3, wherein the ring data buffer implementation method embeds a synchronization mechanism of an embedded system, and the synchronization mechanism is Implemented on a ring buffer, it is divided into three steps: initialization, write buffer, and read buffer.
  5. 根据权利要求1所述的用于嵌入式系统基于同步机制下的环形数据缓冲实现方法,其特征在于,初始化的输入有Max_Index和Unit_Size两参数;Max_Index定义了写信号量和读信号量的最大信号标量值;Unit_Size定义的是每次读缓存区或写缓存区的字节数大小。The ring data buffer implementation method for an embedded system based on a synchronization mechanism according to claim 1, wherein the initialized input has two parameters: Max_Index and Unit_Size; and Max_Index defines a maximum signal of the write semaphore and the read semaphore. Scalar value; Unit_Size defines the number of bytes per read buffer or write buffer.
  6. 根据权利要求1所述的用于嵌入式系统基于同步机制下的环形数据缓冲实现方法,其特征在于,写缓冲的输入参数有Block、TimeOut和Value;Block决定是否使用挂起的模式,TimeOut决定挂起的时间,Value为要写入环形缓冲区内的数据。 The ring data buffer implementation method for an embedded system based on a synchronization mechanism according to claim 1, wherein the input parameters of the write buffer are Block, TimeOut, and Value; and Block determines whether to use the suspended mode, and TimeOut determines The time to suspend, Value is the data to be written to the ring buffer.
PCT/CN2017/101335 2017-07-26 2017-09-12 Ring data buffering implementation method based on synchronization mechanism for embedded system WO2019019295A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710620299.4A CN107368374B (en) 2017-07-26 2017-07-26 Implementation method is buffered based on the annular data under synchronization mechanism for embedded system
CN201710620299.4 2017-07-26

Publications (1)

Publication Number Publication Date
WO2019019295A1 true WO2019019295A1 (en) 2019-01-31

Family

ID=60308223

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/101335 WO2019019295A1 (en) 2017-07-26 2017-09-12 Ring data buffering implementation method based on synchronization mechanism for embedded system

Country Status (2)

Country Link
CN (1) CN107368374B (en)
WO (1) WO2019019295A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108037931B (en) * 2017-12-06 2021-02-02 广州路派电子科技有限公司 Method for writing file in storage unit of microprocessor
CN111538607B (en) * 2020-06-22 2020-10-20 北京翼辉信息技术有限公司 Message communication method and device based on boundary protection
CN112379844A (en) * 2020-11-25 2021-02-19 深圳市华宝电子科技有限公司 Data protection method and device, electronic terminal and storage medium
CN113342836A (en) * 2021-06-23 2021-09-03 平安普惠企业管理有限公司 Synchronous data processing method and device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101834978A (en) * 2009-12-23 2010-09-15 福建新大陆通信科技有限公司 Method for optimizing digital set-top box EPG system
US20110124375A1 (en) * 2008-04-07 2011-05-26 St-Ericsson Sa Mobile phone with low-power media rendering sub-system
CN102521410A (en) * 2011-12-28 2012-06-27 天津凯发电气股份有限公司 VxWorks-operating-system-based file storage structure and storage method
CN102591815A (en) * 2011-12-27 2012-07-18 Tcl集团股份有限公司 Method and device for using annular data buffer to read and write batch data

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7451281B2 (en) * 2003-06-05 2008-11-11 Hewlett-Packard Development Company, L.P. System and method for using swappable storage for storing program data
CN101526748B (en) * 2009-01-13 2010-12-08 上海微电子装备有限公司 Memory device, method and aligning control system for photoetching aligning data detection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110124375A1 (en) * 2008-04-07 2011-05-26 St-Ericsson Sa Mobile phone with low-power media rendering sub-system
CN101834978A (en) * 2009-12-23 2010-09-15 福建新大陆通信科技有限公司 Method for optimizing digital set-top box EPG system
CN102591815A (en) * 2011-12-27 2012-07-18 Tcl集团股份有限公司 Method and device for using annular data buffer to read and write batch data
CN102521410A (en) * 2011-12-28 2012-06-27 天津凯发电气股份有限公司 VxWorks-operating-system-based file storage structure and storage method

Also Published As

Publication number Publication date
CN107368374A (en) 2017-11-21
CN107368374B (en) 2019-08-06

Similar Documents

Publication Publication Date Title
WO2019019295A1 (en) Ring data buffering implementation method based on synchronization mechanism for embedded system
US9483209B2 (en) Interface system and method
EP2830269A1 (en) Message processing method and device
TWI478055B (en) Asymmetrical multiprocessing multi-core system and network device
CN108600053B (en) Wireless network data packet capturing method based on zero copy technology
CN113094309A (en) Data bit width conversion method and device
US10609125B2 (en) Method and system for transmitting communication data
CN107172037B (en) Real-time subpackage analysis method for multi-path multi-channel high-speed data stream
CN113518044B (en) EPA equipment
US20150154004A1 (en) System and method for supporting efficient buffer usage with a single external memory interface
WO2020156797A1 (en) Handling an input/output store instruction
US7324520B2 (en) Method and apparatus to process switch traffic
CN112995261A (en) Configuration method and device of service table, network equipment and storage medium
CN111625376B (en) Method and message system for queue communication through proxy
US8199648B2 (en) Flow control in a variable latency system
CN108632166B (en) DPDK-based packet receiving secondary caching method and system
US20130061247A1 (en) Processor to message-based network interface using speculative techniques
US9817784B2 (en) Multi-port transmitter device for transmitting at least partly redundant data, an associated control system, an associated method and an associated computer program product
CN115543882B (en) Data forwarding device and data transmission method between buses with different bit widths
US20120281713A1 (en) Communication system and corresponding integrated circuit and method
CN114817090B (en) MCU communication management method and system with low RAM consumption
CN102831077A (en) Flow management device and method for saving cache resource
US9104637B2 (en) System and method for managing host bus adaptor (HBA) over infiniband (IB) using a single external memory interface
CN107608928B (en) Configurable device for analyzing SDIO data stream
CN112750066B (en) Extensible coprocessor architecture for image target detection

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: 17919199

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17919199

Country of ref document: EP

Kind code of ref document: A1