WO2017096633A1 - Uart data processing control method and control device - Google Patents

Uart data processing control method and control device Download PDF

Info

Publication number
WO2017096633A1
WO2017096633A1 PCT/CN2015/097488 CN2015097488W WO2017096633A1 WO 2017096633 A1 WO2017096633 A1 WO 2017096633A1 CN 2015097488 W CN2015097488 W CN 2015097488W WO 2017096633 A1 WO2017096633 A1 WO 2017096633A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
buffer
sent
length information
frame
Prior art date
Application number
PCT/CN2015/097488
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 WO2017096633A1 publication Critical patent/WO2017096633A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/622Queue service order

Definitions

  • the present invention relates to the field of household appliances, and in particular, to a data processing control method and a control device for a UART (Universal Asynchronous Receiver/Transmitter).
  • UART Universal Asynchronous Receiver/Transmitter
  • Uart's data processing method is: Uart once read the data directly to the data processing, wherein, if the method is sent by the queue, after the memory of the dynamic malloc, the distribution is received at the place where the queue is received. Memory is released.
  • the present invention aims to solve at least one of the technical problems in the related art to some extent.
  • an object of the present invention is to provide a data processing control method for a UART, which can improve the data processing performance of the UART, and is simple and convenient.
  • a second object of the present invention is to provide a data processing control device for a UART.
  • a third object of the invention is to propose an apparatus.
  • a fourth object of the present invention is to provide a computer storage medium.
  • a data processing control method for a UART including the steps of: acquiring a data frame to be transmitted, and storing the to-be-sent data frame to a circular buffer; Decoding a header of an ith frame to be transmitted in the circular buffer, and acquiring data length information in the packet header, where i is a positive integer; and the ith frame to be transmitted data is from the loop according to the data length information Transferring to the transceiver buffer in the cache; and sending a queue to send the address of the transceiver buffer and the data length information to the logic controller, so that the logic controller obtains according to the address of the transceiver buffer and the data length information
  • the ith frame is to be sent and sent
  • the data processing control method of the UART of the embodiment of the present invention by storing the data frame to be sent to the circular buffer, transfers the data to be sent from the circular buffer to the sending and receiving buffer according to the data length information in the packet header, and the sending queue will send and receive the buffer.
  • the address and data length information is sent to the logic controller to implement data transmission to ensure that the data is not Tampering, better guarantee the integrity of data transmission, and do not need to consider the problem of memory allocation release, do not worry about overflow and memory fragmentation, improve the data processing performance of UART, simple and convenient.
  • a data processing control apparatus for a UART includes: an obtaining module, configured to acquire a data frame to be transmitted, and store the to-be-sent data frame to a circular buffer; a reading module, configured to read a header of an ith frame to be sent in the circular buffer, and obtain data length information in the packet header, where i is a positive integer; and a transfer module is configured to use, according to the data length Transmitting, by the information, the ith frame to-be-sent data from the circular buffer to the transceiver buffer; and sending module, configured to send, by the sending queue, the address of the transceiver buffer and the data length information to the logic controller, so that The logic controller acquires and sends the ith frame to be transmitted according to the address of the transceiver buffer and the data length information.
  • the data processing control apparatus of the UART of the embodiment of the present invention stores the data frame to be transmitted into the circular buffer according to the data length information in the packet header, and transfers the data to be transmitted from the circular buffer to the transceiver buffer according to the data length information in the packet header, and the second transmission queue will send and receive the buffer.
  • the address and data length information is sent to the logic controller to realize the data transmission, to ensure that the data is not tampered, to better ensure the integrity of the data transmission, and to avoid the problem of memory allocation release, without worrying about overflow and memory fragmentation, and improving
  • the data processing performance of the UART is simple and convenient.
  • an apparatus of a third aspect of the present invention includes: one or more processors; a memory; one or more programs, the one or more programs being stored in the memory when When one or more processors are executed, the data processing control method of the UART of the first aspect of the present invention is executed.
  • the device in the embodiment of the present invention stores the data frame to be sent from the circular buffer to the sending and receiving buffer according to the data length information in the packet header by storing the data frame to be sent to the circular buffer, and the sending queue buffers the address and data length of the sending and receiving buffer.
  • the information is sent to the logic controller to realize the data transmission, to ensure that the data is not tampered, to better ensure the integrity of the data transmission, and to avoid the problem of memory allocation release, without worrying about overflow and memory fragmentation, and improving the data processing of the UART. Performance, simple and convenient.
  • a fourth aspect of the present invention provides a nonvolatile computer storage medium storing one or more programs when the one or more programs are executed by a device.
  • the apparatus is caused to perform the data processing control method of the UART of the first aspect of the present invention.
  • the computer storage medium of the embodiment of the present invention stores the data frame to be sent to the circular buffer according to the data length information in the packet header, and then transfers the data to be sent from the circular buffer to the transceiver buffer according to the data length information in the packet header, and the second sending queue will send and receive the cached address and
  • the data length information is sent to the logic controller to realize the data transmission, to ensure that the data is not tampered, to better ensure the integrity of the data transmission, and to avoid the problem of memory allocation release, without worrying about overflow and memory fragmentation, and improving the UART.
  • Data processing performance is simple and convenient.
  • FIG. 1 is a flowchart of a data processing control method of a UART according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of an embodiment of a data processing control apparatus of a UART according to the present invention
  • FIG. 3 is a schematic structural diagram of a data processing control apparatus for a UART according to an embodiment of the present invention.
  • FIG. 1 is a flow chart of a data processing control method of a UART according to an embodiment of the present invention.
  • the data processing control method of the UART may include the following steps:
  • the circular buffer and the transceiving buffer may be set in a global area of the memory.
  • the circular buffer (ring_buffer) and the transceiving buffer (rx_buffer) may exist in the form of static global variables.
  • the circular cache and the send/receive cache can be stored in the global area in the form of static global variables, so that the program can be automatically released after the program ends, regardless of the overflow caused by allocation, release, memory fragmentation and the like.
  • two static global variables may be first established: a ring_buffer for storing data received from Uart each time; and an rx_buffer for storing a complete frame of data actually received.
  • control method of the embodiment of the present invention does not store the data frame in the heap area of the memory, so that the memory allocation and release are very frequent, and the read data frame to be sent is first stored in the loop buffer. Therefore, there is no need to consider the issue of memory allocation release.
  • the ring_buffer For example, first put the data that Uart read to put in the ring_buffer, and then read the frame data information from the fixed position in the ring_buffer (including the frame header and frame length, which is equivalent to the header of the data to be sent and the data length information in it). Finally, the valid frame data is read from the ring_buffer according to the frame data length, and the valid frame data is placed in the rx_buffer. in.
  • transferring the ith frame to-be-sent data from the circular buffer to the transceiving buffer according to the data length information specifically includes: reading the ith frame to be sent data from the circular buffer according to the data length information And clearing the transceiver buffer; storing the data to be sent in the i-th frame to the transceiver buffer.
  • the circular cache automatically releases the oldest occupied cache when the circular cache is full.
  • the embodiment of the present invention can set the circular cache in the global area of the memory, and the size of the circular buffer can be fixed. Once the circular cache is full, the earliest is automatically released. Occupied memory, thus facilitating memory management.
  • the sending queue sends the address and data length information of the sending and receiving buffer to the logic controller, so that the logic controller acquires the data to be transmitted of the ith frame according to the address and data length information of the sending and receiving buffer and sends the data.
  • the address and data length of the rx_buffer can be packaged and sent to the logic center through the queue.
  • the logic controller can directly process the data according to the length and address for processing.
  • the mutex is used for locking control of the TX data to ensure that the data is not tampered and completely transmitted; one of the queues is a data receiving queue, and the receiving is performed.
  • the outside world gives the serial port the data to be written to the Uart device, and the other queue is the send queue, which is the data that the device data read by the serial port will be sent to the outside world.
  • the mentioned data when the process is initialized, will be assigned two static global variables, which are used to store the data sent and received.
  • the data processing control method of the UART of the embodiment of the present invention by storing the data frame to be sent to the circular buffer, transfers the data to be sent from the circular buffer to the sending and receiving buffer according to the data length information in the packet header, and the sending queue will send and receive the buffer.
  • the address and data length information is sent to the logic controller to realize the data transmission, to ensure that the data is not tampered, to better ensure the integrity of the data transmission, and to avoid the problem of memory allocation release, without worrying about overflow and memory fragmentation, and improving
  • the data processing performance of the UART is simple and convenient.
  • the present invention also provides a data processing control apparatus for a UART.
  • FIG. 2 is a block diagram showing the structure of a data processing control apparatus for a UART according to an embodiment of the present invention.
  • the data processing control apparatus 10 of the UART includes an acquisition module 100, a reading module 200, a transfer module 300, and a transmission module 400.
  • the obtaining module 100 is configured to acquire a data frame to be sent, and store the data frame to be sent to a circular buffer.
  • the reading module 200 is configured to read a header of an ith frame to be sent in the circular buffer, and obtain a data length in the header Information, where i is a positive integer.
  • the transfer module 300 is configured to transfer the ith frame to-be-sent data from the circular buffer to the transceiving buffer according to the data length information.
  • the sending module 400 is configured to send, by the sending queue, the address and data length information of the sending and receiving buffer to the logic controller, so that the logic controller acquires the data to be transmitted of the ith frame according to the address and the data length information of the sending and receiving buffer and sends the data.
  • the control device 10 of the embodiment of the invention can ensure that the data is not falsified, better guarantee the integrity of the data transmission, and does not need to consider the problem of memory allocation release, and does not worry about overflow and memory fragmentation, thereby improving the data processing performance of the UART.
  • the circular buffer and the transceiving buffer may be set in a global area of the memory.
  • the circular cache and the send and receive cache may exist in the form of static global variables.
  • the circular cache and the send/receive cache can store the global area in the form of static global variables, so that the program can be automatically released after the end of the program, regardless of the overflow caused by allocation, release, memory fragmentation and the like.
  • two static global variables may be first established: a ring_buffer for storing data received from Uart each time; and an rx_buffer for storing a complete frame of data actually received.
  • control method of the embodiment of the present invention does not store the data frame in the heap area of the memory, so that the memory allocation and release are very frequent, and the read data frame to be sent is first stored in the loop buffer. Therefore, there is no need to consider the issue of memory allocation release.
  • the sending module 400 further includes: a clearing unit 401 and a storage unit 402.
  • the clearing unit 401 is configured to read the ith frame to be sent data from the circular buffer according to the data length information, and clear the sending and receiving buffer.
  • the storage unit 402 is configured to store the ith frame to be transmitted data to the transceiver buffer.
  • the circular cache automatically releases the oldest occupied cache when the circular cache is full.
  • the embodiment of the present invention can set the circular cache in the global area of the memory, and the size of the circular buffer can be fixed. Once the circular cache is full, the earliest is automatically released. Occupied memory, thus facilitating memory management.
  • the data processing control apparatus of the UART of the embodiment of the present invention stores the data frame to be transmitted into the circular buffer according to the data length information in the packet header, and transfers the data to be transmitted from the circular buffer to the transceiver buffer according to the data length information in the packet header, and the second transmission queue will send and receive the buffer.
  • the address and data length information is sent to the logic controller to implement data transmission, to ensure that the data is not tampered, to better ensure the integrity of the data transmission, and to avoid the problem of memory allocation release, without worrying about overflow And memory fragmentation, improve the data processing performance of the UART, simple and convenient.
  • first and second are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated.
  • features defining “first” or “second” may include at least one of the features, either explicitly or implicitly.
  • the meaning of "a plurality” is at least two, such as two, three, etc., unless specifically defined otherwise.
  • the terms “installation”, “connected”, “connected”, “fixed” and the like shall be understood broadly, and may be either a fixed connection or a detachable connection, unless explicitly stated and defined otherwise. , or integrated; can be mechanical or electrical connection; can be directly connected, or indirectly connected through an intermediate medium, can be the internal communication of two elements or the interaction of two elements, unless otherwise specified Limited.
  • the specific meanings of the above terms in the present invention can be understood on a case-by-case basis.
  • the first feature "on” or “under” the second feature may be a direct contact of the first and second features, or the first and second features may be indirectly through an intermediate medium, unless otherwise explicitly stated and defined. contact.
  • the first feature "above”, “above” and “above” the second feature may be that the first feature is directly above or above the second feature, or merely that the first feature level is higher than the second feature.
  • the first feature “below”, “below” and “below” the second feature may be that the first feature is directly below or obliquely below the second feature, or merely that the first feature level is less than the second feature.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

Disclosed are a UART data processing control method and control device. The method comprises the following steps: acquiring data frames to be sent and storing the data frames to be sent into a ring buffer; reading a packet header of an i th frame of data to be sent and acquiring data length information in the packet header; transferring the i th frame of data to be sent to a transceiver buffer according to the data length information; and sending, by a sending queue, an address of the transceiver buffer and the data length information to a logic controller so as to send the i th frame of data to be sent. The control method in the embodiment of the present invention can ensure that data is not tampered, and data transmission integrity is better protected without considering the problem of memory allocation and release and without worrying about overflow and memory fragmentation, thereby improving data processing performance of a UART. In addition, the method is simple and convenient.

Description

UART的数据处理控制方法及控制装置UART data processing control method and control device 技术领域Technical field
本发明涉及一种家用电器技术领域,尤其涉及一种UART(Universal Asynchronous Receiver/Transmitter,通用异步收发传输器)的数据处理控制方法及控制装置。The present invention relates to the field of household appliances, and in particular, to a data processing control method and a control device for a UART (Universal Asynchronous Receiver/Transmitter).
背景技术Background technique
相关技术中,Uart的数据处理方法为:Uart一次read到的数据直接给到数据处理,其中,如果通过queue的方式进行发送,则在动态malloc出的内存之后,在接收queue的地方对分配的内存释放。In the related art, Uart's data processing method is: Uart once read the data directly to the data processing, wherein, if the method is sent by the queue, after the memory of the dynamic malloc, the distribution is received at the place where the queue is received. Memory is released.
然而,首先如果一次收到多帧数据,则可能会漏掉对第二帧数据的处理,或者把两帧数据当成一帧而做出错误的控制;其次内存的malloc和free太过频繁,从而容易造成内存碎片,并且没有遵守谁分配谁释放的原则,有内存泄露的风险,有待改进。However, firstly, if multiple frames of data are received at a time, the processing of the second frame of data may be missed, or the two frames of data may be treated as one frame to make false control; secondly, the memory of malloc and free is too frequent, thereby It is easy to cause memory fragmentation, and does not follow the principle of who distributes who releases, there is a risk of memory leaks, and needs to be improved.
发明内容Summary of the invention
本发明旨在至少在一定程度上解决相关技术中的技术问题之一。The present invention aims to solve at least one of the technical problems in the related art to some extent.
为此,本发明的一个目的在于提出一种UART的数据处理控制方法,该控制方法可以提高了UART的数据处理性能,简单便捷。Therefore, an object of the present invention is to provide a data processing control method for a UART, which can improve the data processing performance of the UART, and is simple and convenient.
本发明的第二个目的在于提出一种UART的数据处理控制装置。A second object of the present invention is to provide a data processing control device for a UART.
本发明的第三个目的在于提出一种设备。A third object of the invention is to propose an apparatus.
本发明的第四个目的在于提出一种计算机存储介质。A fourth object of the present invention is to provide a computer storage medium.
为达到上述目的,根据本发明第一方面实施例提出了一种UART的数据处理控制方法,包括以下步骤:获取待发送数据帧,并将所述待发送数据帧存储至循环缓存;读取所述循环缓存中第i帧待发送数据的包头,并获取所述包头中的数据长度信息,其中,i为正整数;根据所述数据长度信息将所述第i帧待发送数据从所述循环缓存中转移至收发缓存;以及发送队列将所述收发缓存的地址和所述数据长度信息发送至逻辑控制器,以使所述逻辑控制器根据所述收发缓存的地址和所述数据长度信息获取所述第i帧待发送数据并发送In order to achieve the above object, a data processing control method for a UART is provided according to the first aspect of the present invention, including the steps of: acquiring a data frame to be transmitted, and storing the to-be-sent data frame to a circular buffer; Decoding a header of an ith frame to be transmitted in the circular buffer, and acquiring data length information in the packet header, where i is a positive integer; and the ith frame to be transmitted data is from the loop according to the data length information Transferring to the transceiver buffer in the cache; and sending a queue to send the address of the transceiver buffer and the data length information to the logic controller, so that the logic controller obtains according to the address of the transceiver buffer and the data length information The ith frame is to be sent and sent
本发明实施例的UART的数据处理控制方法,通过将待发送数据帧存储至循环缓存,从而根据包头中的数据长度信息将待发送数据从循环缓存中转移至收发缓存,其次发送队列将收发缓存的地址和数据长度信息发送至逻辑控制器,实现数据的发送,保证数据不被 篡改,更好地保证数据发送的完整性,并且无需考虑内存分配释放的问题,不用担心溢出和内存碎片,提高了UART的数据处理性能,简单便捷。The data processing control method of the UART of the embodiment of the present invention, by storing the data frame to be sent to the circular buffer, transfers the data to be sent from the circular buffer to the sending and receiving buffer according to the data length information in the packet header, and the sending queue will send and receive the buffer. The address and data length information is sent to the logic controller to implement data transmission to ensure that the data is not Tampering, better guarantee the integrity of data transmission, and do not need to consider the problem of memory allocation release, do not worry about overflow and memory fragmentation, improve the data processing performance of UART, simple and convenient.
为达到上述目的,根据本发明第二方面实施例提出了一种UART的数据处理控制装置,包括:获取模块,用于获取待发送数据帧,并将所述待发送数据帧存储至循环缓存;读取模块,用于读取所述循环缓存中第i帧待发送数据的包头,并获取所述包头中的数据长度信息,其中,i为正整数;转移模块,用于根据所述数据长度信息将所述第i帧待发送数据从所述循环缓存中转移至收发缓存;以及发送模块,用于发送队列将所述收发缓存的地址和所述数据长度信息发送至逻辑控制器,以使所述逻辑控制器根据所述收发缓存的地址和所述数据长度信息获取所述第i帧待发送数据并发送。In order to achieve the above object, a data processing control apparatus for a UART according to an embodiment of the second aspect of the present invention includes: an obtaining module, configured to acquire a data frame to be transmitted, and store the to-be-sent data frame to a circular buffer; a reading module, configured to read a header of an ith frame to be sent in the circular buffer, and obtain data length information in the packet header, where i is a positive integer; and a transfer module is configured to use, according to the data length Transmitting, by the information, the ith frame to-be-sent data from the circular buffer to the transceiver buffer; and sending module, configured to send, by the sending queue, the address of the transceiver buffer and the data length information to the logic controller, so that The logic controller acquires and sends the ith frame to be transmitted according to the address of the transceiver buffer and the data length information.
本发明实施例的UART的数据处理控制装置,通过将待发送数据帧存储至循环缓存,从而根据包头中的数据长度信息将待发送数据从循环缓存中转移至收发缓存,其次发送队列将收发缓存的地址和数据长度信息发送至逻辑控制器,实现数据的发送,保证数据不被篡改,更好地保证数据发送的完整性,并且无需考虑内存分配释放的问题,不用担心溢出和内存碎片,提高了UART的数据处理性能,简单便捷。The data processing control apparatus of the UART of the embodiment of the present invention stores the data frame to be transmitted into the circular buffer according to the data length information in the packet header, and transfers the data to be transmitted from the circular buffer to the transceiver buffer according to the data length information in the packet header, and the second transmission queue will send and receive the buffer. The address and data length information is sent to the logic controller to realize the data transmission, to ensure that the data is not tampered, to better ensure the integrity of the data transmission, and to avoid the problem of memory allocation release, without worrying about overflow and memory fragmentation, and improving The data processing performance of the UART is simple and convenient.
是否本发明附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。The additional aspects and advantages of the invention will be set forth in part in the description which follows.
为达上述目的,本发明第三方面实施例的设备,包括:一个或者多个处理器;存储器;一个或者多个程序,所述一个或者多个程序存储在所述存储器中,当被所述一个或者多个处理器执行时,执行本发明第一方面实施例的UART的数据处理控制方法。To achieve the above object, an apparatus of a third aspect of the present invention includes: one or more processors; a memory; one or more programs, the one or more programs being stored in the memory when When one or more processors are executed, the data processing control method of the UART of the first aspect of the present invention is executed.
本发明实施例的设备,通过将待发送数据帧存储至循环缓存,从而根据包头中的数据长度信息将待发送数据从循环缓存中转移至收发缓存,其次发送队列将收发缓存的地址和数据长度信息发送至逻辑控制器,实现数据的发送,保证数据不被篡改,更好地保证数据发送的完整性,并且无需考虑内存分配释放的问题,不用担心溢出和内存碎片,提高了UART的数据处理性能,简单便捷。The device in the embodiment of the present invention stores the data frame to be sent from the circular buffer to the sending and receiving buffer according to the data length information in the packet header by storing the data frame to be sent to the circular buffer, and the sending queue buffers the address and data length of the sending and receiving buffer. The information is sent to the logic controller to realize the data transmission, to ensure that the data is not tampered, to better ensure the integrity of the data transmission, and to avoid the problem of memory allocation release, without worrying about overflow and memory fragmentation, and improving the data processing of the UART. Performance, simple and convenient.
为达上述目的,本发明第四方面实施例提出了一种非易失性计算机存储介质,所述计算机存储介质存储有一个或者多个程序,当所述一个或者多个程序被一个设备执行时,使得所述设备执行本发明第一方面实施例的UART的数据处理控制方法。To achieve the above object, a fourth aspect of the present invention provides a nonvolatile computer storage medium storing one or more programs when the one or more programs are executed by a device. The apparatus is caused to perform the data processing control method of the UART of the first aspect of the present invention.
本发明实施例的计算机存储介质,通过将待发送数据帧存储至循环缓存,从而根据包头中的数据长度信息将待发送数据从循环缓存中转移至收发缓存,其次发送队列将收发缓存的地址和数据长度信息发送至逻辑控制器,实现数据的发送,保证数据不被篡改,更好地保证数据发送的完整性,并且无需考虑内存分配释放的问题,不用担心溢出和内存碎片,提高了UART的数据处理性能,简单便捷。 The computer storage medium of the embodiment of the present invention stores the data frame to be sent to the circular buffer according to the data length information in the packet header, and then transfers the data to be sent from the circular buffer to the transceiver buffer according to the data length information in the packet header, and the second sending queue will send and receive the cached address and The data length information is sent to the logic controller to realize the data transmission, to ensure that the data is not tampered, to better ensure the integrity of the data transmission, and to avoid the problem of memory allocation release, without worrying about overflow and memory fragmentation, and improving the UART. Data processing performance is simple and convenient.
附图说明DRAWINGS
本发明上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become apparent and readily understood from
图1为根据本发明实施例的UART的数据处理控制方法的流程图;1 is a flowchart of a data processing control method of a UART according to an embodiment of the present invention;
图2为根据本发明UART的数据处理控制装置实施例的结构示意图;2 is a schematic structural diagram of an embodiment of a data processing control apparatus of a UART according to the present invention;
图3为根据本发明一个具体实施例的UART的数据处理控制装置的结构示意图。FIG. 3 is a schematic structural diagram of a data processing control apparatus for a UART according to an embodiment of the present invention.
具体实施方式detailed description
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本发明,而不能理解为对本发明的限制。The embodiments of the present invention are described in detail below, and the examples of the embodiments are illustrated in the drawings, wherein the same or similar reference numerals are used to refer to the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the drawings are intended to be illustrative of the invention and are not to be construed as limiting.
下面参照附图描述本发明实施例的UART的数据处理控制方法及控制装置。A data processing control method and a control apparatus for a UART according to an embodiment of the present invention will be described below with reference to the accompanying drawings.
图1为根据本发明一个实施例的UART的数据处理控制方法的流程图。1 is a flow chart of a data processing control method of a UART according to an embodiment of the present invention.
如图1所示,UART的数据处理控制方法可以包括以下步骤:As shown in FIG. 1, the data processing control method of the UART may include the following steps:
S101,获取待发送数据帧,并将待发送数据帧存储至循环缓存。S101. Acquire a data frame to be sent, and store the data frame to be sent to a circular buffer.
其中,在本发明的一个实施例中,循环缓存和收发缓存可以设置在内存的全局区。进一步地,在本发明的一个实施例中,循环缓存(ring_buffer)和收发缓存(rx_buffer)可以以静态全局变量形式存在。Wherein, in an embodiment of the invention, the circular buffer and the transceiving buffer may be set in a global area of the memory. Further, in one embodiment of the invention, the circular buffer (ring_buffer) and the transceiving buffer (rx_buffer) may exist in the form of static global variables.
在本发明的实施例中,循环缓存和收发缓存可以以静态全局变量形式存放在全局区,从而在程序结束后可以自动释放,不必考虑分配、释放带来的溢出、内存碎片等问题。In the embodiment of the present invention, the circular cache and the send/receive cache can be stored in the global area in the form of static global variables, so that the program can be automatically released after the program ends, regardless of the overflow caused by allocation, release, memory fragmentation and the like.
具体地,在本发明的实施例中,首先可以建立两个静态全局变量:ring_buffer,用于存放每次从Uart接收到的数据;以及,rx_buffer,用于存放实际接收到的一帧完整数据。Specifically, in the embodiment of the present invention, two static global variables may be first established: a ring_buffer for storing data received from Uart each time; and an rx_buffer for storing a complete frame of data actually received.
进而,本发明实施例的控制方法不会将数据帧存放在内存的堆区之中,从而导致内存分配和释放都非常频繁,而是将读取的待发送数据帧先是存储至循环缓存中,因此无需考虑内存分配释放的问题。Furthermore, the control method of the embodiment of the present invention does not store the data frame in the heap area of the memory, so that the memory allocation and release are very frequent, and the read data frame to be sent is first stored in the loop buffer. Therefore, there is no need to consider the issue of memory allocation release.
S102,读取循环缓存中第i帧待发送数据的包头,并获取包头中的数据长度信息,其中,i为正整数。S102. Read a header of the data to be sent in the i-th frame in the circular buffer, and obtain data length information in the packet header, where i is a positive integer.
S103,根据数据长度信息将第i帧待发送数据从循环缓存中转移至收发缓存。S103. Transfer the ith frame to-be-sent data from the circular buffer to the transceiver buffer according to the data length information.
举例而言,首先将Uart read到的数据放在ring_buffer,其次从ring_buffer里面固定位置读取出帧数据信息(包括帧头和帧长度,相当于待发送数据的包头及其中的数据长度信息),最后根据帧数据长度从ring_buffer读取有效的帧数据,把有效的帧数据放在rx_buffer 中。For example, first put the data that Uart read to put in the ring_buffer, and then read the frame data information from the fixed position in the ring_buffer (including the frame header and frame length, which is equivalent to the header of the data to be sent and the data length information in it). Finally, the valid frame data is read from the ring_buffer according to the frame data length, and the valid frame data is placed in the rx_buffer. in.
进一步地,在本发明的一个实施例中,根据数据长度信息将第i帧待发送数据从循环缓存中转移至收发缓存具体包括:根据数据长度信息从循环缓存中读取第i帧待发送数据,并清空收发缓存;将第i帧待发送数据存储至收发缓存。Further, in an embodiment of the present invention, transferring the ith frame to-be-sent data from the circular buffer to the transceiving buffer according to the data length information specifically includes: reading the ith frame to be sent data from the circular buffer according to the data length information And clearing the transceiver buffer; storing the data to be sent in the i-th frame to the transceiver buffer.
另外,在本发明的一个实施例中,当循环缓存存满时,循环缓存自动释放掉最早占用的缓存。Additionally, in one embodiment of the invention, the circular cache automatically releases the oldest occupied cache when the circular cache is full.
也就是说,在本发明的实施例中,本发明实施例可以将循环缓存设置在内存的全局区中,并且循环缓存的大小可以是固定的,一旦在循环缓存储存满时,自动释放掉最早占用的内存,从而方便内存的管理。That is, in the embodiment of the present invention, the embodiment of the present invention can set the circular cache in the global area of the memory, and the size of the circular buffer can be fixed. Once the circular cache is full, the earliest is automatically released. Occupied memory, thus facilitating memory management.
S104,发送队列将收发缓存的地址和数据长度信息发送至逻辑控制器,以使逻辑控制器根据收发缓存的地址和数据长度信息获取第i帧待发送数据并发送。S104. The sending queue sends the address and data length information of the sending and receiving buffer to the logic controller, so that the logic controller acquires the data to be transmitted of the ith frame according to the address and data length information of the sending and receiving buffer and sends the data.
可以理解的是,在把有效的帧数据放在rx_buffer之后,可以将rx_buffer的地址和数据长度打包通过queue发送到逻辑中心,如逻辑控制器,逻辑中心可以直接根据长度和地址取出数据进行处理。It can be understood that after the valid frame data is placed in the rx_buffer, the address and data length of the rx_buffer can be packaged and sent to the logic center through the queue. For example, the logic controller can directly process the data according to the length and address for processing.
具体而言,在本发明实施例中,可以拥有两个queue一个mutex,其中,mutex用于对TX数据的加锁控制,保证数据不被篡改,完整发送;其中一个queue是数据接收队列,接收外界给到串口将要写入到Uart device的数据,另一个queue是发送队列,为串口读取到的device data将要发送给外界的数据。另外,提到的数据,在流程初始化时,会分配两个静态全局变量,分别用于存储发送和接收的数据。Specifically, in the embodiment of the present invention, there may be two queues and one mutex, wherein the mutex is used for locking control of the TX data to ensure that the data is not tampered and completely transmitted; one of the queues is a data receiving queue, and the receiving is performed. The outside world gives the serial port the data to be written to the Uart device, and the other queue is the send queue, which is the data that the device data read by the serial port will be sent to the outside world. In addition, the mentioned data, when the process is initialized, will be assigned two static global variables, which are used to store the data sent and received.
另外,在具体实现过程中,即言在queue实际操作上时,只需将指针指向对应的地址就行,不需要考虑内存分配和free的细节问题。In addition, in the specific implementation process, that is, when the actual operation of the queue, just point the pointer to the corresponding address, do not need to consider the memory allocation and free details.
本发明实施例的UART的数据处理控制方法,通过将待发送数据帧存储至循环缓存,从而根据包头中的数据长度信息将待发送数据从循环缓存中转移至收发缓存,其次发送队列将收发缓存的地址和数据长度信息发送至逻辑控制器,实现数据的发送,保证数据不被篡改,更好地保证数据发送的完整性,并且无需考虑内存分配释放的问题,不用担心溢出和内存碎片,提高了UART的数据处理性能,简单便捷。The data processing control method of the UART of the embodiment of the present invention, by storing the data frame to be sent to the circular buffer, transfers the data to be sent from the circular buffer to the sending and receiving buffer according to the data length information in the packet header, and the sending queue will send and receive the buffer. The address and data length information is sent to the logic controller to realize the data transmission, to ensure that the data is not tampered, to better ensure the integrity of the data transmission, and to avoid the problem of memory allocation release, without worrying about overflow and memory fragmentation, and improving The data processing performance of the UART is simple and convenient.
为实现上述实施例,本发明还提出一种UART的数据处理控制装置。In order to implement the above embodiments, the present invention also provides a data processing control apparatus for a UART.
图2为根据本发明一个实施例的UART的数据处理控制装置的结构示意图。2 is a block diagram showing the structure of a data processing control apparatus for a UART according to an embodiment of the present invention.
如图2所示,UART的数据处理控制装置10包括:获取模块100、读取模块200、转移模块300和发送模块400。As shown in FIG. 2, the data processing control apparatus 10 of the UART includes an acquisition module 100, a reading module 200, a transfer module 300, and a transmission module 400.
其中,获取模块100用于获取待发送数据帧,并将待发送数据帧存储至循环缓存。读取模块200用于读取循环缓存中第i帧待发送数据的包头,并获取包头中的数据长度 信息,其中,i为正整数。转移模块300用于根据数据长度信息将第i帧待发送数据从循环缓存中转移至收发缓存。发送模块400用于发送队列将收发缓存的地址和数据长度信息发送至逻辑控制器,以使逻辑控制器根据收发缓存的地址和数据长度信息获取第i帧待发送数据并发送。本发明实施例的控制装置10可以保证数据不被篡改,更好地保证数据发送的完整性,并且无需考虑内存分配释放的问题,不用担心溢出和内存碎片,提高了UART的数据处理性能。The obtaining module 100 is configured to acquire a data frame to be sent, and store the data frame to be sent to a circular buffer. The reading module 200 is configured to read a header of an ith frame to be sent in the circular buffer, and obtain a data length in the header Information, where i is a positive integer. The transfer module 300 is configured to transfer the ith frame to-be-sent data from the circular buffer to the transceiving buffer according to the data length information. The sending module 400 is configured to send, by the sending queue, the address and data length information of the sending and receiving buffer to the logic controller, so that the logic controller acquires the data to be transmitted of the ith frame according to the address and the data length information of the sending and receiving buffer and sends the data. The control device 10 of the embodiment of the invention can ensure that the data is not falsified, better guarantee the integrity of the data transmission, and does not need to consider the problem of memory allocation release, and does not worry about overflow and memory fragmentation, thereby improving the data processing performance of the UART.
其中,在本发明的一个实施例中,循环缓存和收发缓存可以设置在内存的全局区。Wherein, in an embodiment of the invention, the circular buffer and the transceiving buffer may be set in a global area of the memory.
进一步地,在本发明的一个实施例中,循环缓存和收发缓存可以以静态全局变量形式存在。Further, in one embodiment of the invention, the circular cache and the send and receive cache may exist in the form of static global variables.
在本发明的实施例中,循环缓存和收发缓存可以以静态全局变量形式存放全局区,从而在程序结束后可以自动释放,不必考虑分配、释放带来的溢出、内存碎片等问题。In the embodiment of the present invention, the circular cache and the send/receive cache can store the global area in the form of static global variables, so that the program can be automatically released after the end of the program, regardless of the overflow caused by allocation, release, memory fragmentation and the like.
具体地,在本发明的实施例中,首先可以建立两个静态全局变量:ring_buffer,用于存放每次从Uart接收到的数据;以及,rx_buffer,用于存放实际接收到的一帧完整数据。Specifically, in the embodiment of the present invention, two static global variables may be first established: a ring_buffer for storing data received from Uart each time; and an rx_buffer for storing a complete frame of data actually received.
进而,本发明实施例的控制方法不会将数据帧存放在内存的堆区之中,从而导致内存分配和释放都非常频繁,而是将读取的待发送数据帧先是存储至循环缓存中,因此无需考虑内存分配释放的问题。Furthermore, the control method of the embodiment of the present invention does not store the data frame in the heap area of the memory, so that the memory allocation and release are very frequent, and the read data frame to be sent is first stored in the loop buffer. Therefore, there is no need to consider the issue of memory allocation release.
进一步地,在本发明的一个实施例中,如图3所示,发送模块400还包括:清空单元401和存储单元402。Further, in an embodiment of the present invention, as shown in FIG. 3, the sending module 400 further includes: a clearing unit 401 and a storage unit 402.
其中,清空单元401用于根据数据长度信息从循环缓存中读取第i帧待发送数据,并清空收发缓存。存储单元402用于将第i帧待发送数据存储至收发缓存。The clearing unit 401 is configured to read the ith frame to be sent data from the circular buffer according to the data length information, and clear the sending and receiving buffer. The storage unit 402 is configured to store the ith frame to be transmitted data to the transceiver buffer.
另外,在本发明的一个实施例中,当循环缓存存满时,循环缓存自动释放掉最早占用的缓存。Additionally, in one embodiment of the invention, the circular cache automatically releases the oldest occupied cache when the circular cache is full.
也就是说,在本发明的实施例中,本发明实施例可以将循环缓存设置在内存的全局区中,并且循环缓存的大小可以是固定的,一旦在循环缓存储存满时,自动释放掉最早占用的内存,从而方便内存的管理。That is, in the embodiment of the present invention, the embodiment of the present invention can set the circular cache in the global area of the memory, and the size of the circular buffer can be fixed. Once the circular cache is full, the earliest is automatically released. Occupied memory, thus facilitating memory management.
需要说明的是,前述对UART的数据处理控制方法实施例的解释说明也适用于该实施例的UART的数据处理控制装置,此处不再赘述。It should be noted that the foregoing explanation of the embodiment of the data processing control method for the UART is also applicable to the data processing control device of the UART of the embodiment, and details are not described herein again.
本发明实施例的UART的数据处理控制装置,通过将待发送数据帧存储至循环缓存,从而根据包头中的数据长度信息将待发送数据从循环缓存中转移至收发缓存,其次发送队列将收发缓存的地址和数据长度信息发送至逻辑控制器,实现数据的发送,保证数据不被篡改,更好地保证数据发送的完整性,并且无需考虑内存分配释放的问题,不用担心溢出 和内存碎片,提高了UART的数据处理性能,简单便捷。The data processing control apparatus of the UART of the embodiment of the present invention stores the data frame to be transmitted into the circular buffer according to the data length information in the packet header, and transfers the data to be transmitted from the circular buffer to the transceiver buffer according to the data length information in the packet header, and the second transmission queue will send and receive the buffer. The address and data length information is sent to the logic controller to implement data transmission, to ensure that the data is not tampered, to better ensure the integrity of the data transmission, and to avoid the problem of memory allocation release, without worrying about overflow And memory fragmentation, improve the data processing performance of the UART, simple and convenient.
在本发明的描述中,需要理解的是,术语“中心”、“纵向”、“横向”、“长度”、“宽度”、“厚度”、“上”、“下”、“前”、“后”、“左”、“右”、“竖直”、“水平”、“顶”、“底”“内”、“外”、“顺时针”、“逆时针”、“轴向”、“径向”、“周向”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", " After, "Left", "Right", "Vertical", "Horizontal", "Top", "Bottom", "Inside", "Outside", "Clockwise", "Counterclockwise", "Axial", The orientation or positional relationship of the "radial", "circumferential" and the like is based on the orientation or positional relationship shown in the drawings, and is merely for convenience of description of the present invention and simplified description, and does not indicate or imply the indicated device or component. It must be constructed and operated in a particular orientation, and is not to be construed as limiting the invention.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本发明的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。Moreover, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, features defining "first" or "second" may include at least one of the features, either explicitly or implicitly. In the description of the present invention, the meaning of "a plurality" is at least two, such as two, three, etc., unless specifically defined otherwise.
在本发明中,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”、“固定”等术语应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或成一体;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系,除非另有明确的限定。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本发明中的具体含义。In the present invention, the terms "installation", "connected", "connected", "fixed" and the like shall be understood broadly, and may be either a fixed connection or a detachable connection, unless explicitly stated and defined otherwise. , or integrated; can be mechanical or electrical connection; can be directly connected, or indirectly connected through an intermediate medium, can be the internal communication of two elements or the interaction of two elements, unless otherwise specified Limited. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood on a case-by-case basis.
在本发明中,除非另有明确的规定和限定,第一特征在第二特征“上”或“下”可以是第一和第二特征直接接触,或第一和第二特征通过中间媒介间接接触。而且,第一特征在第二特征“之上”、“上方”和“上面”可是第一特征在第二特征正上方或斜上方,或仅仅表示第一特征水平高度高于第二特征。第一特征在第二特征“之下”、“下方”和“下面”可以是第一特征在第二特征正下方或斜下方,或仅仅表示第一特征水平高度小于第二特征。In the present invention, the first feature "on" or "under" the second feature may be a direct contact of the first and second features, or the first and second features may be indirectly through an intermediate medium, unless otherwise explicitly stated and defined. contact. Moreover, the first feature "above", "above" and "above" the second feature may be that the first feature is directly above or above the second feature, or merely that the first feature level is higher than the second feature. The first feature "below", "below" and "below" the second feature may be that the first feature is directly below or obliquely below the second feature, or merely that the first feature level is less than the second feature.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of the present specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means a specific feature described in connection with the embodiment or example. A structure, material or feature is included in at least one embodiment or example of the invention. In the present specification, the schematic representation of the above terms is not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, various embodiments or examples described in the specification, as well as features of various embodiments or examples, may be combined and combined.
尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。 Although the embodiments of the present invention have been shown and described, it is understood that the above-described embodiments are illustrative and are not to be construed as limiting the scope of the invention. The embodiments are subject to variations, modifications, substitutions and variations.

Claims (12)

  1. 一种通用异步收发传输器UART的数据处理控制方法,其特征在于,包括以下步骤:A data processing control method for a universal asynchronous transceiver transmitter UART, comprising the steps of:
    获取待发送数据帧,并将所述待发送数据帧存储至循环缓存;Obtaining a data frame to be sent, and storing the to-be-sent data frame to a circular buffer;
    读取所述循环缓存中第i帧待发送数据的包头,并获取所述包头中的数据长度信息,其中,i为正整数;Reading a header of the to-be-sent data of the i-th frame in the circular buffer, and acquiring data length information in the packet header, where i is a positive integer;
    根据所述数据长度信息将所述第i帧待发送数据从所述循环缓存中转移至收发缓存;以及Transmitting the ith frame to-be-sent data from the circular buffer to a transceiving buffer according to the data length information;
    发送队列将所述收发缓存的地址和所述数据长度信息发送至逻辑控制器,以使所述逻辑控制器根据所述收发缓存的地址和所述数据长度信息获取所述第i帧待发送数据并发送。Sending, by the sending queue, the address of the sending and receiving buffer and the data length information to the logic controller, so that the logic controller acquires the data to be sent of the ith frame according to the address of the sending and receiving buffer and the data length information. And send.
  2. 如权利要求1所述的UART的数据处理控制方法,其特征在于,所述循环缓存和所述收发缓存设置在内存的全局区。The data processing control method of the UART according to claim 1, wherein the circular buffer and the transceiving buffer are set in a global area of the memory.
  3. 如权利要求1或2所述的UART的数据处理控制方法,其特征在于,所述循环缓存和所述收发缓存以静态全局变量形式存在。The data processing control method for a UART according to claim 1 or 2, wherein the circular buffer and the transceiving buffer exist as static global variables.
  4. 如权利要求1-3任一项所述的UART的数据处理控制方法,其特征在于,根据所述数据长度信息将所述第i帧待发送数据从所述循环缓存中转移至收发缓存具体包括:The data processing control method of the UART according to any one of claims 1 to 3, wherein the transferring the ith frame to-be-sent data from the circular buffer to the transceiver buffer according to the data length information specifically includes :
    根据所述数据长度信息从所述循环缓存中读取所述第i帧待发送数据,并清空所述收发缓存;Reading the ith frame to be sent data from the circular buffer according to the data length information, and clearing the transceiver buffer;
    将所述第i帧待发送数据存储至所述收发缓存。And storing the ith frame to transmit data to the transceiver buffer.
  5. 如权利要求1-4任一项所述的UART的数据处理控制方法,其特征在于,当循环缓存存满时,所述循环缓存自动释放掉最早占用的缓存。The data processing control method for a UART according to any one of claims 1 to 4, characterized in that, when the circular buffer is full, the circular buffer automatically releases the oldest occupied cache.
  6. 一种UART的数据处理控制装置,其特征在于,包括:A data processing control device for a UART, comprising:
    获取模块,用于获取待发送数据帧,并将所述待发送数据帧存储至循环缓存;An acquiring module, configured to acquire a data frame to be sent, and store the to-be-sent data frame to a circular buffer;
    读取模块,用于读取所述循环缓存中第i帧待发送数据的包头,并获取所述包头中的数据长度信息,其中,i为正整数;a reading module, configured to read a header of an ith frame to be sent in the circular buffer, and obtain data length information in the packet header, where i is a positive integer;
    转移模块,用于根据所述数据长度信息将所述第i帧待发送数据从所述循环缓存中转移至收发缓存;以及a transfer module, configured to transfer the ith frame to-be-sent data from the circular buffer to a transceiver buffer according to the data length information;
    发送模块,用于发送队列将所述收发缓存的地址和所述数据长度信息发送至逻辑控制器,以使所述逻辑控制器根据所述收发缓存的地址和所述数据长度信息获取所述第i帧待发送数据并发送。a sending module, configured to send, by the sending queue, the address of the sending and receiving buffer and the data length information to a logic controller, so that the logic controller acquires the first according to the address of the sending and receiving buffer and the data length information The i frame is to be sent and sent.
  7. 如权利要求6所述的通用异步收发传输器UART的数据处理控制装置,其特征在于,所述循环缓存和所述收发缓存设置在内存的全局区。 A data processing control apparatus for a universal asynchronous transceiver transmitter UART according to claim 6, wherein said cyclic buffer and said transceiver buffer are disposed in a global area of the memory.
  8. 如权利要求6或7所述的通用异步收发传输器UART的数据处理控制装置,其特征在于,所述循环缓存和所述收发缓存以静态全局变量形式存在。A data processing control apparatus for a universal asynchronous transceiver transmitter UART according to claim 6 or 7, wherein said cyclic buffer and said transceiver buffer exist in the form of static global variables.
  9. 如权利要求6-8所述的通用异步收发传输器UART的数据处理控制装置,其特征在于,所述发送模块还包括:The data processing control device of the Universal Asynchronous Receiver Transmitter UART according to any of claims 6-8, wherein the transmitting module further comprises:
    清空单元,用于根据所述数据长度信息从所述循环缓存中读取所述第i帧待发送数据,并清空所述收发缓存;a clearing unit, configured to read the ith frame to be sent data from the circular buffer according to the data length information, and clear the transceiver buffer;
    存储单元,用于将所述第i帧待发送数据存储至所述收发缓存。And a storage unit, configured to store the ith frame to-be-sent data to the transceiver buffer.
  10. 如权利要求6-9所述的通用异步收发传输器UART的数据处理控制装置,其特征在于,当循环缓存存满时,所述循环缓存自动释放掉最早占用的缓存。The data processing control apparatus for the universal asynchronous transceiver transmitter UART according to any of claims 6-9, characterized in that, when the circular buffer is full, the circular buffer automatically releases the oldest occupied cache.
  11. 一种设备,其特征在于,包括:An apparatus, comprising:
    一个或者多个处理器;One or more processors;
    存储器;Memory
    一个或者多个程序,所述一个或者多个程序存储在所述存储器中,当被所述一个或者多个处理器执行时,执行如权利要求1-5任一项所述的UART的数据处理控制方法。One or more programs, the one or more programs being stored in the memory, and when executed by the one or more processors, performing data processing of the UART according to any one of claims 1-5 Control Method.
  12. 一种非易失性计算机存储介质,其特征在于,所述计算机存储介质存储有一个或者多个程序,当所述一个或者多个程序被一个设备执行时,使得所述设备执行如权利要求1-5任一项所述的UART的数据处理控制方法。 A non-volatile computer storage medium, characterized in that the computer storage medium stores one or more programs, when the one or more programs are executed by a device, causing the device to perform as claimed in claim 1. A data processing control method for the UART according to any one of the preceding claims.
PCT/CN2015/097488 2015-12-09 2015-12-15 Uart data processing control method and control device WO2017096633A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510906589.6 2015-12-09
CN201510906589.6A CN105577568A (en) 2015-12-09 2015-12-09 UART data processing control method and control device

Publications (1)

Publication Number Publication Date
WO2017096633A1 true WO2017096633A1 (en) 2017-06-15

Family

ID=55887245

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/097488 WO2017096633A1 (en) 2015-12-09 2015-12-15 Uart data processing control method and control device

Country Status (2)

Country Link
CN (1) CN105577568A (en)
WO (1) WO2017096633A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506676A (en) * 2020-12-02 2021-03-16 深圳市广和通无线股份有限公司 Inter-process data transmission method, computer device and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110555890B (en) * 2018-05-30 2023-10-20 珠海全志科技股份有限公司 Memory management method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004105312A2 (en) * 2003-05-15 2004-12-02 Sun Microsystems, Inc. Deskewing parallel data
KR20050069694A (en) * 2003-12-31 2005-07-05 엘지전자 주식회사 Method for reducing receive interrupt interconnecting data of uart
US20070028015A1 (en) * 2005-07-28 2007-02-01 Wickham Mark H System and method for processing data streams
CN101212620A (en) * 2006-12-30 2008-07-02 技嘉科技股份有限公司 Time-shifted video recording method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100530140C (en) * 2007-11-08 2009-08-19 Ut斯达康通讯有限公司 Memory management method for application program
CN101986613B (en) * 2010-08-26 2012-04-25 中国航天科技集团公司第九研究院第七七一研究所 All-purpose asynchronous serial communication controller
CN102567260A (en) * 2010-12-27 2012-07-11 北京国睿中数科技股份有限公司 Device with multiple UART (universal asynchronous receiver/transmitter) interfaces and method using same

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004105312A2 (en) * 2003-05-15 2004-12-02 Sun Microsystems, Inc. Deskewing parallel data
KR20050069694A (en) * 2003-12-31 2005-07-05 엘지전자 주식회사 Method for reducing receive interrupt interconnecting data of uart
US20070028015A1 (en) * 2005-07-28 2007-02-01 Wickham Mark H System and method for processing data streams
CN101212620A (en) * 2006-12-30 2008-07-02 技嘉科技股份有限公司 Time-shifted video recording method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506676A (en) * 2020-12-02 2021-03-16 深圳市广和通无线股份有限公司 Inter-process data transmission method, computer device and storage medium
CN112506676B (en) * 2020-12-02 2024-04-05 深圳市广和通无线股份有限公司 Inter-process data transmission method, computer device and storage medium

Also Published As

Publication number Publication date
CN105577568A (en) 2016-05-11

Similar Documents

Publication Publication Date Title
US9405725B2 (en) Writing message to controller memory space
TWI575402B (en) Computing device and data processing method
US9223717B2 (en) Computer cache system providing multi-line invalidation messages
US9973335B2 (en) Shared buffers for processing elements on a network device
JP2014526071A5 (en)
RU2012107868A (en) COMMUNICATION SYSTEM, COMMUNICATION DEVICE, COMMUNICATION METHOD AND COMPUTER PROGRAM
KR101861471B1 (en) Command trapping in an input/output virtualization (iov) host controller (hc) (iov-hc) of a flash-memory-based storage device
WO2017096633A1 (en) Uart data processing control method and control device
CN102291298B (en) Efficient computer network communication method oriented to long message
KR101702374B1 (en) Multi processor device and inter process communication method thereof
CN112698959A (en) Multi-core communication method and device
WO2014092551A1 (en) System and method for optimal memory management between cpu and fpga unit
US9292456B2 (en) System and method for data synchronization across digital device interfaces
WO2013097098A1 (en) Data processing method, graphics processing unit (gpu) and first node device
TWI602063B (en) Sdio equipment and an applied electronic device and data transfer method
US20090262739A1 (en) Network device of processing packets efficiently and method thereof
Liu et al. A performance study of InfiniBand fourteen data rate (FDR)
CN114969851B (en) FPGA-based data processing method, device, equipment and medium
CN110134621A (en) CMB is provided by looping back data access
US9608842B2 (en) Providing, at least in part, at least one indication that at least one portion of data is available for processing
EP4055486A1 (en) Enabling atomic memory accesses across coherence granule boundaries in processor-based devices
KR20090128605A (en) Inter-processor communication device having burst transfer function, system including the inter-processor communication device, and device driver for operating the inter-processor communication device
TWI792728B (en) Device for packet processing acceleration
CN105528312B (en) A kind of system and method for ensureing to receive data integrity between communication processor and host
WO2019062275A1 (en) Pcie controller and loopback data path using pcie controller

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

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

Country of ref document: EP

Kind code of ref document: A1

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 03/12/2018)