WO2019095124A1 - 切换串口数据传输状态的方法及装置 - Google Patents

切换串口数据传输状态的方法及装置 Download PDF

Info

Publication number
WO2019095124A1
WO2019095124A1 PCT/CN2017/111009 CN2017111009W WO2019095124A1 WO 2019095124 A1 WO2019095124 A1 WO 2019095124A1 CN 2017111009 W CN2017111009 W CN 2017111009W WO 2019095124 A1 WO2019095124 A1 WO 2019095124A1
Authority
WO
WIPO (PCT)
Prior art keywords
serial port
data transmission
switching
real
data
Prior art date
Application number
PCT/CN2017/111009
Other languages
English (en)
French (fr)
Inventor
武小虎
Original Assignee
深圳配天智能技术研究院有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳配天智能技术研究院有限公司 filed Critical 深圳配天智能技术研究院有限公司
Priority to PCT/CN2017/111009 priority Critical patent/WO2019095124A1/zh
Priority to CN201780034123.9A priority patent/CN109313623B/zh
Publication of WO2019095124A1 publication Critical patent/WO2019095124A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4022Coupling between buses using switching circuits, e.g. switching matrix, connection or expansion network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3027Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus

Definitions

  • the present invention relates to the field of communications, and in particular, to a method and apparatus for switching a data transmission state of a serial port.
  • Parallel communication refers to the communication method in which each piece of data of a piece of information is transmitted at the same time.
  • the characteristic of parallel communication is that each data bit is transmitted at the same time, the transmission speed is fast and the efficiency is high, but how many data lines need more data lines, so the transmission cost High and only suitable for communication at close range (a few meters apart).
  • Serial communication refers to the communication method in which the data of each piece of information is transmitted in order by bit. The characteristics of serial communication are: data bit transmission, transmission in bit order, at least one transmission line can be completed, and the cost is low. The transfer speed is slow. Serial communication can range from a few meters to a few kilometers.
  • serial communication can be further divided into simplex, half-duplex and full-duplex.
  • Information can only be transmitted as one-way in one direction; information can be transmitted in both directions but cannot be transmitted in both directions at the same time as half-duplex; information can be transmitted in both directions at the same time as full-duplex.
  • RS-485 is a typical serial communication standard. The difference between it and the ordinary serial port is that the defined voltage and impedance are different, but the software protocol is not defined. The programming method is the same as the ordinary serial port programming. In the RS-485 half-duplex serial port transmission mode, the master station should switch the state and wait for the data sent by the slave station according to the state of the serial port register after the data transmission is completed.
  • the technical problem to be solved by the present invention is to provide a method and device for switching the data transmission state of the serial port, optimize the data loss and switching delay problem of the serial port communication, and reduce the delay time of the serial port state switching while ensuring the normal communication. get on.
  • the method includes: the serial port sends data through a serial port register disposed in the serial port; and the creation is used to determine whether the serial port register is An empty real-time thread; if the real-time thread determines that the serial port register is empty, the serial port switches the data transmission state.
  • the step of the serial port sending data through the serial port register disposed in the serial port specifically includes: the serial port uses a Linux thread to send data through a serial port register disposed in the serial port.
  • the step of switching the data transmission state by the serial port further includes: the serial port receiving data and storing the data to the serial port register.
  • the method further includes: if the real-time thread determines that the serial port register is not empty, continuing to determine the status of the serial port register.
  • serial port is an RS-485 serial port.
  • the communication mode of the serial port is a half-duplex communication mode.
  • the present invention also proposes a data transmission device, including a physical device, a serial port provided with a serial port register, and a memory; the memory stores a computer program executable on the processor; the serial port transmits and receives data through the register; and when the processor executes the computer program The method for switching the data transmission state of the serial port is implemented.
  • a device having a storage function is stored thereon with a computer program capable of being executed by the above method of switching a serial port data transmission state.
  • the present invention provides a method and device for switching the serial port data transmission state.
  • a real-time thread to monitor the status of the serial port register, when the serial port register is empty, the data transmission state of the serial port is switched. Since the real-time thread has the highest priority, it can ensure that the delay time of the serial port state switching can be reduced while ensuring normal communication.
  • FIG. 1 is a schematic flow chart of an embodiment of a method for switching a serial port data transmission state provided by the present invention
  • FIG. 2 is a schematic structural diagram of an embodiment of a data transmission apparatus provided by the present invention.
  • FIG. 1 is a schematic flowchart diagram of an embodiment of a method for switching a serial port data transmission state according to the present invention. The method includes the following steps:
  • serial port sends data through a serial port register disposed in the serial port.
  • serial communication is used in operating systems with high frequency and versatility, especially in embedded operating systems.
  • the serial port is used for data transmission in the embedded Linux system, that is, the serial port uses the Linux line.
  • the program sends data through the serial port register set in the serial port.
  • Using the serial port for data transfer can be either using the serial port to send data or using the serial port to accept data.
  • the serial port used in this embodiment is an RS-485 serial port, but the serial port used in the present invention is not limited to the RS-485 serial port, and may be other types of serial ports or a combination of several serial ports.
  • the communication mode of the serial port of the present invention is a half-duplex communication mode.
  • the master station In the RS-485 half-duplex serial port transmission mode, the master station should switch state according to the state of the serial port register after the data transmission is completed, and wait for receiving the data sent by the slave station.
  • S102 Create a real-time thread for determining whether the serial port register is empty.
  • a real-time thread is created, and the real-time thread has the highest priority. As long as it detects that the serial port is transmitting data, it continuously determines whether the serial port register is empty. If it is not empty, the data is still being transmitted and needs to be judged all the time.
  • a real-time thread is created, and the real-time thread has the highest priority. As long as it detects that the serial port is receiving data, it continuously determines whether the serial port register is empty. If it is not empty, the data is still being transmitted and needs to be judged all the time.
  • a real-time thread is created, and the real-time thread has the highest priority. As long as it detects that the serial port is transmitting data, it continuously determines whether the serial port register is empty. If it is not empty, the data is still being transmitted and needs to be judged all the time.
  • Real-time threads have the highest priority. Therefore, if the real-time thread determines that the serial port register is empty, the data transmission state of the serial port is switched at the first time, thereby ensuring normal communication. After the serial port is switched to the receiving state, the serial port receives the data and stores it in the serial port register, and then sends the data to the primary station.
  • the data transmission state of the serial port is switched to the data receiving state by the real-time thread.
  • the data receiving state of the serial port is switched by the real-time thread to be a data sending state.
  • the hardware platform used is the AM335X chip and ADM2486 half-duplex RS-485 transceiver, specifically, the RS-485 transceiver state conversion pin RE/RT is connected to one IO pin of AM335X, realizes RS-485 through software output IO high and low changes State transition of the chip.
  • the software system used is the kernel of Linux3.8.13 and the real-time kernel of xenomai 2.6.3, which implements dual-core system, namely the Linux kernel and the real-time kernel of xenomai, thus retaining the functions of the Linux system itself.
  • real-time thread management can be realized.
  • the serial port sends data into two threads to complete, sending data this time-consuming task, using Linux threads.
  • the less time-consuming task of detecting the completion status of the transmission is done using xenomai's real-time thread.
  • the thread that detects the completion state of the sent data is a high-priority real-time thread that will recapture the CPU, which can reduce the delay time of the serial port state switching, thereby ensuring normal communication.
  • the present invention provides a method and device for switching the serial port data transmission state.
  • a real-time thread to monitor the status of the serial port register, when the serial port register is empty, the data transmission state of the serial port is switched. Since the real-time thread has the highest priority, it can ensure that the delay time of the serial port state switching can be reduced while ensuring normal communication.
  • FIG. 2 is a schematic structural diagram of an embodiment of a data transmission apparatus provided by the present invention.
  • the data transmission device 20 includes a processor 21, a serial port 22 provided with a serial port register, and a memory 23; the memory 23 stores a computer program executable on the processor 21; the serial port 22 transmits and receives data through the serial port register; and the processor 21 executes the computer program.
  • the method for switching the serial port data transmission state according to the above claims is implemented.
  • serial communication is used in operating systems with high frequency and versatility, especially in embedded operating systems.
  • the serial port 22 is used for data transmission in the embedded Linux system, that is, the serial port 22 uses a Linux thread to send data through a serial port register set in the serial port 22.
  • Using the serial port for data transfer can be either using the serial port to send data or using the serial port to accept data.
  • the serial port 22 used in this embodiment is an RS-485 serial port, but the serial port used in the present invention is not limited to the RS-485 serial port, and may be other types of serial ports or a combination of several serial ports.
  • the data transmission state of the serial port 22 is switched to the data receiving state by the real-time thread switching.
  • the data receiving state of the serial port 22 is switched to the data transmitting state by the real-time thread switching.
  • the hardware platform used is an AM335X chip and an ADM2486 half-duplex RS-485 transceiver.
  • the RS-485 transceiver state transition RE/RT is connected to an IO of the AM335X.
  • the software system used is the kernel of Linux3.8.13 and the real-time kernel of xenomai 2.6.3, which implements dual-core system, namely the Linux kernel and the real-time kernel of xenomai, thus retaining the functions of the Linux system itself.
  • real-time thread management can be realized.
  • the serial port 22 sends data into two threads to complete, sending data this time-consuming task, using Linux threads.
  • the less time-consuming task of detecting the completion status of the transmission is done using xenomai's real-time thread.
  • the thread that detects the completion state of the sent data is a high-priority real-time thread that will recapture the CPU, which can reduce the delay time of the serial port 22 state switching, thereby ensuring normal communication.
  • the present invention provides a method and device for switching the serial port data transmission state.
  • a real-time thread to monitor the status of the serial port register, when the serial port register is empty, the data transmission state of the serial port is switched. Since the real-time thread has the highest priority, it can ensure that the delay time of the serial port state switching can be reduced while ensuring normal communication.
  • the present invention also proposes a device having a storage function on which is stored a computer program capable of being executed to implement the above-described method of switching the serial port data transmission state.
  • the device having the storage function may be a memory in the terminal.
  • the present invention provides a method and device for switching the serial port data transmission state.
  • a real-time thread to monitor the status of the serial port register, when the serial port register is empty, the data transmission state of the serial port is switched. Since the real-time thread has the highest priority, it can ensure that the delay time of the serial port state switching can be reduced while ensuring normal communication.

Abstract

本发明公开了一种切换串口数据传输状态的方法,该方法包括:所述串口通过设置在所述串口内的串口寄存器发送数据;创建用于判断所述串口寄存器是否为空的实时线程;若所述实时线程判断所述串口寄存器为空,则所述串口切换数据传输状态。本发明通过建立实时线程监控串口寄存器的状态,当串口寄存器为空时,切换数据的传输状态。由于实时线程具有最高优先级,因此能保证减少串口状态切换的延时时间的同时还能保证通讯能正常进行。

Description

切换串口数据传输状态的方法及装置 技术领域
本发明涉及通讯领域,特别是涉及一种切换串口数据传输状态的方法及装置。
背景技术
与外接的信息交换称为通讯,基本的通讯方式有并行通讯和串行通讯两种。并行通讯是指一条信息的各位数据被同时传送的通讯方式,并行通讯的特点是:各数据位同时传送,传送速度快、效率高,但有多少数据位就需多少根数据线,因此传送成本高,且只适用于近距离(相距数米)的通讯。串行通讯是指一条信息的各位数据被逐位按顺序传送的通讯方式,串行通讯的特点是:数据位传送,传按位顺序进行,最少只需一根传输线即可完成,成本低但传送速度慢。串行通讯的距离可以从几米到几千米。
根据信息的传送方向,串行通讯可以进一步分为单工、半双工和全双工三种。信息只能单向传送为单工;信息能双向传送但不能同时双向传送称为半双工;信息能够同时双向传送则称为全双工。RS-485是一种典型的串行通讯标准,它和普通串口的区别是定义的电压,阻抗等不同,但不对软件协议给予定义,编程方式和普通的串口编程一样。在RS-485半双工的串口传输模式下,主站要在数据发送完成后根据串口寄存器的状态,来切换状态等待接收从站发送过来的数据,如果状态没有及时切换,就会导致数据接收不到,导致这次通讯失败。普通的Linux系统中不会发生这种情况,因为在串口的驱动计算机程序中会在发送数据时加锁,等待串口状态切换后完成后再解锁,这样保证在串口发送数据到串口完成状态切换这段时间CPU不会被抢占。但是在Linux的系统中加入了实时补丁就会破坏上述的机制,实时线程会随时抢占低优先级的线程。但很多时候,加入实时线程很有必要,因为实时线程能满足任务对时间高要求标准。
在嵌入式Linux系统中为了解决实时性问题经常在原Li nux系统中 打入一个实时补丁,这样普通的任务可以用Linux系统的线程来实现,而对时间有严格规定的任务必须要用实时的线程来处理,我们称这样的系统为实时Li nux系统。实时Linux系统中,会发生实时线程抢占Linux系统的线程的CPU使用权。系统串口收发数据是耗费时间比较长的一个任务,因此经常用Linux系统提供的线程来实现。RS-485的串口收发数据时要发生状态转换,当串口发送完数据后要切到收数据的状态时如果发生实时线程抢占CPU,导致状态切换没完成,从而导致在这一时间内发送的数据就会丢失,导致数据接收失败。
发明内容
本发明主要解决的技术问题是提供一种切换串口数据传输状态的方法及装置,优化串口通讯的数据丢失和切换延时问题,在减少串口状态切换的延时时间的同时还能保证通讯能正常进行。
为解决上述技术问题,本发明采用的一种切换串口数据传输状态的方法,该方法包括:所述串口通过设置在所述串口内的串口寄存器发送数据;创建用于判断所述串口寄存器是否为空的实时线程;若所述实时线程判断所述串口寄存器为空,则所述串口切换数据传输状态。
进一步地,所述串口通过设置在所述串口内的串口寄存器发送数据的步骤具体包括:所述串口使用Linux线程通过设置在所述串口内的串口寄存器发送数据。
进一步地,若所述实时线程判断所述串口寄存器为空,则所述串口切换数据传输状态的步骤之后还包括:所述串口接收数据并存储至所述串口寄存器。
进一步地,所述方法还包括:若所述实时线程判断所述串口寄存器不为空,则继续判断所述串口寄存器的状态。
进一步地,所述串口为RS-485串口。
进一步地,所述串口的通讯方式为半双工通讯方式。
进一步地,实时线程具有最高优先级。
为解决上述技术问题,本发明还提出了一种数据传输装置,包括处 理器、设置有串口寄存器的串口以及存储器;所述存储器上存储有可在所述处理器上运行的计算机程序;所述串口通过所述寄存器收发数据;所述处理器执行所述计算机程序时实现上述切换串口数据传输状态的方法。
为解决上述技术问题,一种具有存储功能的装置,其上存储有计算机程序,所述计算机程序能够被执行上述切换串口数据传输状态的方法。
区别于现有技术,本发明提出一种切换串口数据传输状态的方法及装置,通过建立实时线程监控串口寄存器的状态,当串口寄存器为空时,切换串口的数据传输状态。由于实时线程具有最高优先级,因此能保证减少串口状态切换的延时时间的同时还能保证通讯能正常进行。
附图说明
图1是本发明提供的切换串口数据传输状态的方法实施例的流程示意图;
图2是本发明提供的数据传输装置实施例的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,均属于本发明保护的范围。
参阅图1,图1是本发明提供的切换串口数据传输状态的方法实施例的流程示意图。该方法包括步骤如下:
S101:所述串口通过设置在所述串口内的串口寄存器发送数据。
在通信领域,串口通信在操作系统中使用的频率高、用途广泛,尤其在嵌入式操作系统中的使用频率很高。在一个具体的实施场景中,在嵌入式Linux系统下使用串口来进行数据的传输,即串口使用Linux线 程通过设置在串口内的串口寄存器发送数据。使用串口来进行数据传输既可以是使用串口发送数据也可以是使用串口接受数据。本实施例中使用的串口为RS-485串口,但本发明使用的串口不限于RS-485串口,还可以是其他类型的串口,也可以是几种串口的组合。
在一个具体的实施场景中,本发明的串口的通讯方式为半双工通讯方式。在RS-485半双工的串口传输模式下,主站要在数据发送完成后根据串口寄存器的状态,来切换状态等待接收从站发送过来的数据。
S102:创建用于判断所述串口寄存器是否为空的实时线程。
当串口在传输数据时,创建实时线程,实时线程具有最高优先级。只要检测到串口在传输数据,就持续判断该串口寄存器是否为空。如果不为空,说明数据还在传输,需要一直进行判断。
在一个具体的实施方式中,当串口在接收数据时,创建实时线程,实时线程具有最高优先级。只要检测到串口在接收数据,就持续判断该串口寄存器是否为空。如果不为空,说明数据还在传输,需要一直进行判断。
在另一个具体的实施方式中,当串口在传送数据时,创建实时线程,实时线程具有最高优先级。只要检测到串口在传送数据,就持续判断该串口寄存器是否为空。如果不为空,说明数据还在传输,需要一直进行判断。
S103:若实时线程判断串口寄存器为空,则串口切换数据传输状态。
实时线程的优先级最高。因此,若实时线程判断串口寄存器为空,则第一时间切换串口的数据传输状态,从而保证通讯能正常进行。串口切换至接收状态后,串口接收数据并存储至串口寄存器,进而将数据发送至主站。
在一个具体的实施方式中,若判断串口寄存器为空,则通过实时线程切换串口的数据发送状态为数据接收状态。
在另一个具体的实施方式中,若判断串口寄存器为空,则通过实时线程切换串口的数据接收状态为数据发送状态。
在一个具体的实施场景中,采用的硬件平台为AM335X芯片和 ADM2486半双工的RS-485收发器,具体地,将RS-485收发器的状态转换的管脚RE/RT连接到AM335X的一个IO管脚,通过软件输出IO的高低变化来实现RS-485芯片的状态转换。
在一个具体的实施场景中,采用的软件系统是Linux3.8.13的内核和xenomai2.6.3的实时内核,实现双内核制,即Linux的内核和xenomai的实时内核,这样既保留了Linux系统自身的功能,又可以实现实时线程的管理。将串口发送数据分成两个线程去完成,发送数据这个比较耗时的任务,使用Linux的线程。而检测发送完成状态这个耗时较少的任务使用xenomai的实时线程去完成。这样即使发送数据过程中被抢占,由于检测发送数据完成状态的线程是高优先级的实时线程还会抢回CPU,能减少串口状态切换的延时时间,从而保证通讯能正常进行。
区别于现有技术,本发明提出一种切换串口数据传输状态的方法及装置,通过建立实时线程监控串口寄存器的状态,当串口寄存器为空时,切换串口的数据传输状态。由于实时线程具有最高优先级,因此能保证减少串口状态切换的延时时间的同时还能保证通讯能正常进行。
参阅图2,图2是本发明提供的数据传输装置实施例的结构示意图。数据传输装置20包括处理器21、设置有串口寄存器的串口22以及存储器23;存储器23上存储有可在处理器21上运行的计算机程序;串口22通过串口寄存器收发数据;处理器21执行计算机程序时实现权利要求上述切换串口数据传输状态的方法。
在通信领域,串口通信在操作系统中使用的频率高、用途广泛,尤其在嵌入式操作系统中的使用频率很高。在一个具体的实施场景中,在嵌入式Linux系统下使用串口22来进行数据的传输,即串口22使用Linux线程通过设置在串口22内的串口寄存器发送数据。使用串口来进行数据传输既可以是使用串口发送数据也可以是使用串口接受数据。本实施例中使用的串口22为RS-485串口,但本发明使用的串口不限于RS-485串口,还可以是其他类型的串口,也可以是几种串口的组合。
在一个具体的实施方式中,若判断串口寄存器为空,则通过实时线程切换串口22的数据发送状态为数据接收状态。
在另一个具体的实施方式中,若判断串口寄存器为空,则通过实时线程切换串口22的数据接收状态为数据发送状态。
在一个具体的实施场景中,采用的硬件平台为AM335X芯片和ADM2486半双工的RS-485收发器,具体地,将RS-485收发器的状态转换的管教RE/RT连接到AM335X的一个IO管脚,通过软件输出IO的高低变化来实现RS-485芯片的状态转换。
在一个具体的实施场景中,采用的软件系统是Linux3.8.13的内核和xenomai2.6.3的实时内核,实现双内核制,即Linux的内核和xenomai的实时内核,这样既保留了Linux系统自身的功能,又可以实现实时线程的管理。将串口22发送数据分成两个线程去完成,发送数据这个比较耗时的任务,使用Linux的线程。而检测发送完成状态这个耗时较少的任务使用xenomai的实时线程去完成。这样即使发送数据过程中被抢占,由于检测发送数据完成状态的线程是高优先级的实时线程还会抢回CPU,能减少串口22状态切换的延时时间,从而保证通讯能正常进行。
区别于现有技术,本发明提出一种切换串口数据传输状态的方法及装置,通过建立实时线程监控串口寄存器的状态,当串口寄存器为空时,切换串口的数据传输状态。由于实时线程具有最高优先级,因此能保证减少串口状态切换的延时时间的同时还能保证通讯能正常进行。
本发明还提出了一种具有存储功能的装置,其上存储有计算机程序,计算机程序能够被执行实现上述切换串口数据传输状态的方法。在一个实施例中,具有存储功能的装置可以是终端中的存储器。
区别于现有技术,本发明提出一种切换串口数据传输状态的方法及装置,通过建立实时线程监控串口寄存器的状态,当串口寄存器为空时,切换串口的数据传输状态。由于实时线程具有最高优先级,因此能保证减少串口状态切换的延时时间的同时还能保证通讯能正常进行。
以上所述仅为本发明的实施方式,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (10)

  1. 一种切换串口数据传输状态的方法,其特征在于,所述方法包括:
    所述串口通过设置在所述串口内的串口寄存器发送数据;
    创建用于判断所述串口寄存器是否为空的实时线程;
    若所述实时线程判断所述串口寄存器为空,则所述串口切换数据传输状态。
  2. 根据权利要求1所述的切换串口数据传输状态的方法,其特征在于,所述串口通过设置在所述串口内的串口寄存器发送数据的步骤具体包括:
    所述串口使用Linux线程通过设置在所述串口内的串口寄存器发送数据。
  3. 根据权利要求1所述的切换串口数据传输状态的方法,其特征在于,若所述实时线程判断所述串口寄存器为空,则所述串口切换数据传输状态的步骤之后还包括:
    所述串口接收数据并存储至所述串口寄存器。
  4. 根据权利要求1所述的切换串口数据传输状态的方法,其特征在于,所述方法还包括:
    若所述实时线程判断所述串口寄存器不为空,则继续判断所述串口寄存器的状态。
  5. 根据权利要求1所述的切换串口数据传输状态的方法,其特征在于,所述串口为RS-485串口。
  6. 根据权利要求1所述的切换串口数据传输状态的方法,其特征在于,所述串口的通讯方式为半双工通讯方式。
  7. 根据权利要求1所述的切换串口数据传输状态的方法,其特征在于,所述实时线程具有最高优先级。
  8. 一种数据传输装置,其特征在于,包括处理器、设置有串口寄存器的串口以及存储器;
    所述存储器上存储有可在所述处理器上运行的计算机程序;
    所述串口通过所述串口寄存器收发数据;
    所述处理器执行所述计算机程序时实现权利要求1-7中任一所述切换串口数据传输状态的方法。
  9. 根据权利要求8所述的数据传输装置,其特征在于,所述串口为RS-485串口。
  10. 一种具有存储功能的装置,其上存储有计算机程序,其特征在于,所述计算机程序能够被执行实现权利要求1-7中任一所述切换串口数据传输状态的方法。
PCT/CN2017/111009 2017-11-15 2017-11-15 切换串口数据传输状态的方法及装置 WO2019095124A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2017/111009 WO2019095124A1 (zh) 2017-11-15 2017-11-15 切换串口数据传输状态的方法及装置
CN201780034123.9A CN109313623B (zh) 2017-11-15 2017-11-15 切换串口数据传输状态的方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/111009 WO2019095124A1 (zh) 2017-11-15 2017-11-15 切换串口数据传输状态的方法及装置

Publications (1)

Publication Number Publication Date
WO2019095124A1 true WO2019095124A1 (zh) 2019-05-23

Family

ID=65225707

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/111009 WO2019095124A1 (zh) 2017-11-15 2017-11-15 切换串口数据传输状态的方法及装置

Country Status (2)

Country Link
CN (1) CN109313623B (zh)
WO (1) WO2019095124A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113515479A (zh) * 2021-05-19 2021-10-19 河南牧原智能科技有限公司 一种控制485收发方向切换的方法、装置、设备及介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110830482B (zh) * 2019-11-13 2021-07-27 哈尔滨工业大学 一种部件串行接口的通用驱动系统及方法
CN114201428A (zh) * 2020-09-18 2022-03-18 高创(苏州)电子有限公司 电子装置及usb接口切换方法
CN112783816B (zh) * 2021-01-04 2022-07-22 东风汽车股份有限公司 一种手持式双串口协议捕获与分析诊断仪及其使用方法
CN115718719A (zh) * 2021-08-24 2023-02-28 广州视源电子科技股份有限公司 基于串口线程的信息传输方法、装置和系统
CN114328336A (zh) * 2021-12-24 2022-04-12 深圳市智微智能软件开发有限公司 基于Android的串口收发方法、系统、终端及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221550A (zh) * 2008-01-30 2008-07-16 许新朋 一种串行通讯的方法及芯片
CN104331062A (zh) * 2014-09-30 2015-02-04 苏州合欣美电子科技有限公司 一种研磨机控制器串口的测试方法
CN106849780A (zh) * 2017-02-16 2017-06-13 深圳市科陆电子科技股份有限公司 仪表阀控电机的控制方法及电机状态控制机

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6957432B2 (en) * 2000-03-21 2005-10-18 Microsoft Corporation Real-time scheduler
CN101136735B (zh) * 2006-09-12 2010-05-12 中兴通讯股份有限公司 使用通用异步收发报机的半双工串口通信系统及通信方法
US8561070B2 (en) * 2010-12-02 2013-10-15 International Business Machines Corporation Creating a thread of execution in a computer processor without operating system intervention
CN103389913B (zh) * 2013-07-30 2017-03-29 武汉邮电科学研究院 一种用于Linux系统的实时中断处理方法
CN103678233A (zh) * 2013-12-06 2014-03-26 昆山申光电子机械厂 一种串口通讯卡实时测控系统及方法
CN104598411B (zh) * 2014-09-02 2018-01-23 奇点新源国际技术开发(北京)有限公司 一种收发器io端口的状态切换方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221550A (zh) * 2008-01-30 2008-07-16 许新朋 一种串行通讯的方法及芯片
CN104331062A (zh) * 2014-09-30 2015-02-04 苏州合欣美电子科技有限公司 一种研磨机控制器串口的测试方法
CN106849780A (zh) * 2017-02-16 2017-06-13 深圳市科陆电子科技股份有限公司 仪表阀控电机的控制方法及电机状态控制机

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113515479A (zh) * 2021-05-19 2021-10-19 河南牧原智能科技有限公司 一种控制485收发方向切换的方法、装置、设备及介质

Also Published As

Publication number Publication date
CN109313623B (zh) 2022-04-15
CN109313623A (zh) 2019-02-05

Similar Documents

Publication Publication Date Title
WO2019095124A1 (zh) 切换串口数据传输状态的方法及装置
KR101951072B1 (ko) 코어 간 통신 장치 및 방법
US8976789B2 (en) Communication transport protocol for distributed information technology architectures
EP2513744A1 (en) Automatic and controllable system operation
CN103888441A (zh) 一种应用程序与协议栈之间的信息传输方法及处理装置
US10609125B2 (en) Method and system for transmitting communication data
CN104904169A (zh) 调整线程优先级以改进点到点(p2p)器件之间的吞吐量
US10176128B2 (en) Communication system for inter-chip communication
US11736567B2 (en) Data transmission and network interface controller
WO2024088076A1 (zh) 一种基于单总线信息传输的数据流控方法、装置及通信系统
CN116471242A (zh) 基于rdma的发送端、接收端、数据传输系统及方法
CN116150054A (zh) 一种基于pcie的中断信息处理方法
WO2012171398A1 (zh) 实时处理系统中的共享资源访问方法和实时处理系统
CN113992740B (zh) 一种基于自主可控的中间件及数据传输方法
CN113886297B (zh) 一种基于dma的spi并发通讯se装置及方法
KR100261149B1 (ko) 피씨아이(pci) 이더넷(ethernet) 제어장치 및 제어방법
CN112235076A (zh) 提高双系统之间通信速率的方法、系统与处理器
JP2007272694A (ja) 通信インターフェース装置及び通信方法
US11233514B2 (en) Semiconductor device including subsystem interfaces and communications method thereof
CN108701103B (zh) 具有工作存储器的计算单元的存储器直接访问控制装置
US8751603B2 (en) Exploiting cluster awareness infrastructure through internet socket based applications
US20240015785A1 (en) Systems, devices, and methods related to conserving communication bandwidth with spare time schedule
CN111338680B (zh) 从站的固件升级方法、固件升级装置及终端
US10135758B2 (en) Chip and transmission scheduling method
CN103986733A (zh) 一种网络接口模式和基于该网络接口模式的数据通信方法

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

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

Country of ref document: EP

Kind code of ref document: A1