WO2023024922A1 - Information transmission method, apparatus, and system based on serial port thread - Google Patents

Information transmission method, apparatus, and system based on serial port thread Download PDF

Info

Publication number
WO2023024922A1
WO2023024922A1 PCT/CN2022/111754 CN2022111754W WO2023024922A1 WO 2023024922 A1 WO2023024922 A1 WO 2023024922A1 CN 2022111754 W CN2022111754 W CN 2022111754W WO 2023024922 A1 WO2023024922 A1 WO 2023024922A1
Authority
WO
WIPO (PCT)
Prior art keywords
state
serial port
thread
external device
data information
Prior art date
Application number
PCT/CN2022/111754
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 WO2023024922A1 publication Critical patent/WO2023024922A1/en

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/42Bus transfer protocol, e.g. handshake; Synchronisation
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • 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

Definitions

  • the present application relates to the field of data processing, and in particular to an information transmission method, device and system based on serial thread.
  • the built-in serial port of the microcontroller unit is insufficient.
  • the built-in serial port is often not enough.
  • the existing solutions are generally re-selecting to have more serial port chips, or adding an external interface conversion chip, and converting the communication port of other protocols into a serial port for improvement, and these two existing solutions need to increase costs and revisions, and in When the hardware PCB has been finalized, the problem cannot be solved.
  • the embodiment of the present application provides an information transmission method, device and system based on a serial port thread, which can solve the problem of inability to perform information transmission with multiple external devices caused by insufficient built-in serial ports. Described technical scheme is as follows:
  • the embodiment of the present application provides an information transmission method based on a serial port thread, the method is applied to a micro control unit, and the micro control unit runs a serial port thread, and the method includes:
  • the state of the serial port thread is changed from a message sending state to a message receiving state
  • the state of the serial port thread is changed from the message receiving state to the serial port conversion state, and when the information to be sent to the When receiving third data information from another external device, the third data information is sent to the other external device through the serial port thread.
  • sending the third data information to the other external device through the serial port thread includes:
  • the third data information transmitted by the control thread corresponding to the other external device is obtained within the preset second time period, the third data information is sent to the other external device through the serial port thread .
  • modify the state of the serial port thread from the serial port conversion state to the initialization state including:
  • the state of the serial port thread is modified from the serial port conversion state to the initialization state.
  • the method also includes:
  • the second data message sent by the one external device is received within the preset first time period, the second data message is passed to the control thread corresponding to the one external device through the serial port thread, And modify the state of the serial port thread from the message receiving state to the message receiving complete state.
  • the state of the serial port thread is changed from a message receiving complete state to a serial port conversion state.
  • the method also includes:
  • the state of the serial port thread is changed from the initialization state to the message waiting state;
  • the control thread corresponding to the one external device If the first data information delivered by the control thread corresponding to the one external device is obtained within the preset fourth time period, modify the state of the serial port thread from a message waiting state to a message sending state, and sending the first data information to the one external device through the serial port thread.
  • modify the state of the serial port thread from the initialization state to the message waiting state including:
  • the state of the serial port thread is set to the initialization state
  • a connection between the serial port thread and the control thread corresponding to the one external device is established, and the state of the serial port thread is changed from an initialization state to a message waiting state.
  • the method also includes:
  • the state of the serial port thread is changed from a message waiting state to a serial port conversion state.
  • the embodiment of the present application provides an information transmission device based on a serial port thread, the device is applied to a micro control unit, and the micro control unit runs a serial port thread, and the device includes:
  • the first data information sending module is used to modify the state of the serial port thread from the message sending state to a message after the first data information to be sent to an external device is sent to the external device through the serial port thread receiving status;
  • the third data information sending module is used to modify the state of the serial port thread from the message receiving state to serial port conversion if the second data information sent by the one external device is not received within the preset first time period state, and when acquiring third data information to be sent to another external device, send the third data information to the other external device through the serial port thread.
  • the third data information sending module is configured to:
  • the third data information transmitted by the control thread corresponding to the other external device is obtained within the preset second time period, the third data information is sent to the other external device through the serial port thread .
  • the third data information sending module is configured to:
  • the state of the serial port thread is changed from the serial port conversion state to the initialization state.
  • the device also includes:
  • the second data information sending module is configured to transmit the second data information to the connected device through the serial port thread if the second data information sent by the one external device is received within the preset first time period. Describe a control thread corresponding to an external device, and modify the state of the serial port thread from a message receiving state to a message receiving complete state.
  • the device also includes:
  • Other data information determination module used to determine that other data information delivered by the control thread corresponding to the one external device is not received within the preset third time period, then change the state of the serial port thread from the message receiving completion state Modify to serial port conversion status.
  • the device also includes:
  • the initialization module is used to modify the state of the serial port thread from the initialization state to the message waiting state in response to the initialization operation initiated by the user;
  • the first data information acquisition module is configured to: if the first data information delivered by the control thread corresponding to the one external device is acquired within the preset fourth time period, the state of the serial port thread is sent by a message The waiting state is changed to a message sending state, and the first data information is sent to the one external device through the serial port thread.
  • the state of the serial port thread is set to the initialization state
  • a connection between the serial port thread and the control thread corresponding to the one external device is established, and the state of the serial port thread is changed from an initialization state to a message waiting state.
  • the device also includes:
  • the first data information judging module is configured to change the status of the serial port thread from The message waiting state is changed to the serial port conversion state.
  • an embodiment of the present application provides an information transmission system based on a serial port thread, including: a micro-control unit and a plurality of external devices; the micro-control unit is electrically connected to each of the external devices;
  • the microcontroller unit is configured to execute the method as described in the first aspect.
  • an embodiment of the present application provides a computer storage medium, where a plurality of instructions are stored in the computer storage medium, and the instructions are adapted to be loaded by a processor and execute the method as described in the first aspect.
  • the embodiment of the present application provides a micro control unit, including: a processor and a memory; wherein, the memory stores a computer program, and the computer program is suitable for being loaded and executed by the processor as described in the first aspect the method described.
  • an embodiment of the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
  • the method is applied to a micro-control unit, and the micro-control unit runs a serial port thread
  • the first data information to be sent to an external device is sent to the After the above-mentioned one external device, modify the state of the serial port thread from the message sending state to the message receiving state; if the second data information sent by the one external device is not received within the preset first time period, then the The state of the serial port thread is modified from the message receiving state to the serial port conversion state, and when the third data information to be sent to another external device is obtained, the third data information is sent to the said serial port thread through the serial port thread. another external device.
  • FIG. 1 is a schematic flow diagram of a serial port thread-based information transmission method provided in Embodiment 1 of the present application;
  • FIG. 2 is a schematic flow diagram of a method for transmitting information based on a serial port thread provided in Embodiment 2 of the present application;
  • FIG. 3 is a schematic flow diagram of a method for transmitting information based on a serial port thread provided in Embodiment 3 of the present application;
  • Fig. 4 is a schematic diagram of a process of interaction between a micro control unit and an external device provided in Embodiment 3 of the present application;
  • FIG. 5 is a schematic structural diagram of an information transmission device based on a serial port thread provided in Embodiment 4 of the present application;
  • FIG. 6 is a schematic structural diagram of a serial thread-based information transmission system provided in Embodiment 5 of the present application.
  • FIG. 7 is a schematic structural diagram of a microcontroller unit provided by an embodiment of the present application.
  • the embodiment of the present application discloses an information transmission method based on a serial port thread, and the method is applied to a micro control unit, wherein the micro control unit runs a serial port thread.
  • serial port thread-based information transmission method provided by the embodiment of the present application will be described in detail below with reference to the accompanying drawings.
  • FIG. 1 is a flow chart of a method for transmitting information based on a serial port thread disclosed in the embodiment of the present application. The method includes the following steps:
  • the serial port thread refers to a time-division multiplexing technology thread.
  • the time-division multiplexing technology is a technology that transmits different signals in the same channel in different time periods.
  • An external device is a device that interacts with the microcontroller unit, where an external device can be a tablet, a smart phone, and a computer device.
  • the first data information is information sent by the micro control unit to an external device, which may be notification data information or data information carrying data content. Exemplarily, it may be the image data information sent by the microcontroller unit to an external device.
  • the state of the serial port thread is an index used to characterize the working conditions of the current serial port.
  • the state of the serial port thread can include: initialization state, message sending state, message receiving state, serial port conversion state, message waiting state and Message receiving completion status.
  • the initialization state refers to that each parameter of the serial port thread is in an initial setting state. Exemplarily, the initialization state may be that all parameters are 0.
  • the message sending status means that the current serial port thread has data information to be sent and the serial port thread can execute the sending instruction of the data information.
  • the message receiving state refers to the state where the serial port thread is waiting to receive data information sent by other external devices.
  • the serial port conversion state refers to the state in which the serial port thread is converted from connecting one external device to another external device.
  • the message waiting state refers to the state that the serial port thread is waiting for other threads to send data information.
  • the message receiving completion status means that other external devices have successfully sent data information to the serial port thread.
  • the preset first time period can be adjusted by itself, for example, it can be 20S or other time periods.
  • the second data information is information for interaction between the external device and the micro control unit, and the data information may be feedback information for the first data information, or may be data information unrelated to the first data information.
  • the other external device is an electronic device different from the one external device, wherein the other external device may be one or more, and the other external device may be of the same type as the first external device, or may be the same type as the other external device.
  • one external device may be a smart phone, and the other external device may also be a smart phone, or one external device may be a smart phone, and the other external device may be a tablet computer.
  • the third data information is information designated by the microcontroller unit to be sent to another external device.
  • the second data information if the second data information is not received, it means that the current external device has no data information to interact with the microcontroller unit, and the state of the serial port thread does not need to be in the message receiving state.
  • the micro control unit needs to interact with another external device. Before interacting with another external device, change the state of the serial port thread from the message receiving state to the serial port conversion state to instruct the micro control unit to interact with another external device. .
  • FIG. 2 it is a flowchart of an information transmission method based on a serial port thread disclosed in the embodiment of the present application. The method includes the following steps:
  • S220 Determine whether the second data information sent by an external device is received within the preset first time period, if yes, perform S230; if not, perform S250.
  • control thread corresponding to an external device is a thread parallel to the serial port thread, both of which are configured in the micro control unit, and the control thread can process the received second data information.
  • the second data message sent by an external device If the second data message sent by an external device is received within the preset first time period, it will be sent to the corresponding control thread by the serial port thread, so that the control thread processes the second data message, and the serial port thread continues to execute other data messages simultaneously. operation.
  • the state of the serial port thread is changed from the message receiving state to the message receiving complete state.
  • the preset third time period is a time period that can be set by itself. If no other data information from an external device is received within this time period, it means that there is no data between an external device and the micro control unit. information to interact. Then the micro control unit can interact with another external device, and modify the state of the serial port thread from the state of message receiving completion to the state of serial port conversion.
  • S260 Modify the state of the serial port thread from a serial port conversion state to an initialization state, and establish a connection between the serial port thread and a control thread corresponding to the other external device.
  • the state of the serial port thread is changed from the serial port conversion state to the initialization state, it indicates that the micro control unit will interact with another external device.
  • the serial port thread is first established to connect with the control thread, and the control thread corresponds to another external device. After the connection is established, the micro control unit can interact with another external device.
  • modify the state of the serial port thread from the serial port conversion state to the initialization state including:
  • the state of the serial port thread is changed from the serial port conversion state to the initialization state.
  • the initialization operation initiated by the user may be to power on the micro control unit, and may also be an initialization operation set by the user, which is used to set the current state of the serial port thread to the initialization state.
  • the state of the serial port thread is changed from the initialization state to the message waiting state, and then the micro control unit can receive data information and process the data information.
  • the preset second time period may be the same time period as the first time period, or may be a time period different from the first time period.
  • the third data information is sent to the serial port thread by the control thread, and the third data information is sent to another external device, so that the other external device receives the third data information, and in another external device.
  • the third data message is processed.
  • the control thread corresponds to another external device.
  • the second data information sent by an external device is received within the preset first time period
  • the second data information is processed through the control thread.
  • the change of the state of the serial port thread indicates that the micro control unit communicates with another external device. devices to interact.
  • FIG. 3 it is a flowchart of an information transmission method based on a serial port thread disclosed in the embodiment of the present application. The method includes the following steps:
  • the state of the serial port thread is changed from the initialization state to the message waiting state, including:
  • the state of the serial port thread is set to the initialization state
  • a connection between the serial port thread and the control thread corresponding to the one external device is established, and the state of the serial port thread is changed from an initialization state to a message waiting state.
  • a connection is first established between the serial port thread and the control thread, and the control thread corresponds to an external device.
  • the micro control unit can interact with an external device. It should be noted that different control threads correspond to different external devices.
  • the state of the serial port thread is changed from the initialization state to the message waiting state, so that the micro control unit receives data information sent by an external device.
  • the state of the serial port thread is changed from the initialization state to the message waiting state, and it is judged whether the first data information is received within the preset fourth time period. Then, the interaction between the micro control unit and another external device is established through the modification of the state of the serial port thread.
  • the micro control unit can be better utilized, so that the micro control unit can more efficiently establish connections with external devices.
  • FIG. 5 shows a schematic structural diagram of an information transmission device based on a serial port thread provided by an exemplary embodiment of the present application.
  • the information transmission device based on the serial port thread can be implemented as all or a part of the intelligent interactive panel through software, hardware or a combination of the two.
  • the device includes a first data information sending module 510, a third data information sending module 520, a second data information sending module 530, other data information determination module 540, an initialization module 550, a first data information acquisition module 560 and a first data information Judgment module 570 .
  • the first data information sending module 510 is used to modify the state of the serial port thread from the message sending state to message receiving status;
  • the third data information sending module 520 is configured to modify the state of the serial port thread from the message receiving state to the serial port if the second data information sent by the one external device is not received within the preset first time period The state is changed, and when the third data information to be sent to another external device is obtained, the third data information is sent to the other external device through the serial port thread.
  • the third data information sending module 520 is configured to:
  • the third data information transmitted by the control thread corresponding to the other external device is obtained within the preset second time period, the third data information is sent to the other external device through the serial port thread .
  • the third data information sending module 520 is configured to:
  • the state of the serial port thread is changed from the serial port conversion state to the initialization state.
  • the device also includes:
  • the second data information sending module 530 is configured to, if the second data information sent by the one external device is received within the preset first time period, transfer the second data information to the user through the serial port thread
  • the control thread corresponding to the one external device modifies the state of the serial port thread from a message receiving state to a message receiving complete state.
  • the device also includes:
  • the other data information determination module 540 is configured to complete the state of the serial port thread by message receiving if it is determined that no other data information transmitted by the control thread corresponding to the one external device has been received within the preset third time period. The state is changed to the serial port conversion state.
  • the device also includes:
  • the initialization module 550 is used to respond to the initialization operation initiated by the user, modifying the state of the serial port thread from the initialization state to the message waiting state;
  • the first data information acquiring module 560 is configured to change the state of the serial port thread from The message waiting state is changed to the message sending state, and the first data information is sent to the one external device through the serial port thread.
  • the initialization module 550 is used for:
  • the state of the serial port thread is set to the initialization state
  • a connection between the serial port thread and the control thread corresponding to the one external device is established, and the state of the serial port thread is changed from an initialization state to a message waiting state.
  • the device also includes:
  • the first data information judging module 570 is configured to: if the first data information transmitted by the control thread corresponding to the one external device is not obtained within the preset fourth time period, then the state of the serial port thread Change from the message waiting state to the serial port conversion state.
  • serial port thread-based information transmission device when the serial port thread-based information transmission device provided in the above-mentioned embodiments executes the serial port thread-based information transmission method, the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned Function allocation is accomplished by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the serial port thread-based information transmission device and the serial port thread-based information transmission method embodiment provided by the above embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, and will not be repeated here.
  • the embodiment of the present application also provides a serial port thread-based information transmission system.
  • a serial port thread-based information transmission system For details, refer to the schematic structural diagram of a serial port thread-based information transmission system shown in FIG. 6 .
  • a micro control unit 610 a plurality of external devices 620; the micro control unit is electrically connected to each of the external devices;
  • the micro-control unit is used to execute the method steps of the embodiment shown in FIGS. 1-3 .
  • the specific execution process please refer to the specific description of the embodiment shown in FIGS. 1-3 , which will not be repeated here.
  • the embodiment of the present application also provides a computer storage medium, the computer storage medium can store a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method steps of the above-mentioned embodiments shown in Figures 1-3
  • the specific execution process refer to the specific description of the embodiments shown in FIGS. 1-3 , and details are not repeated here.
  • the device where the storage medium is located may be a micro control unit.
  • the micro control unit 1000 may include: at least one processor 1001 and a memory 1005 .
  • the processor 1001 may include one or more processing cores.
  • the processor 1001 uses various interfaces and lines to connect various parts in the entire micro control unit 1000, by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005, Various functions of the micro control unit 1000 are executed and data is processed.
  • the processor 1001 may use at least one of Digital Signal Processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). implemented in the form of hardware.
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 1001 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU) and a modem.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • the CPU mainly handles the operating system, user interface and application programs, etc.
  • the GPU is used to render and draw the content that needs to be displayed on the display screen
  • the modem is used to handle wireless communication. It can be understood that the above modem may also not be integrated into the processor 1001, but implemented by a single chip.
  • the memory 1005 may include a random access memory (Random Access Memory, RAM), and may also include a read-only memory (Read-Only Memory).
  • the memory 1005 includes a non-transitory computer-readable storage medium (non-transitory computer-readable storage medium). The memory 1005 may be used to store instructions, programs, codes, sets of codes or sets of instructions.
  • the memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), Instructions and the like for implementing the above method embodiments; the storage data area can store the data and the like involved in the above method embodiments.
  • the memory 1005 may also be at least one storage device located away from the aforementioned processor 1001 .
  • the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an operation application program of the micro control unit.
  • the processor 1001 can be used to call the operation application program of the micro control unit stored in the memory 1005, and specifically perform the following operations:
  • the state of the serial port thread is changed from a message sending state to a message receiving state
  • the state of the serial port thread is changed from the message receiving state to the serial port conversion state, and when the information to be sent to the When receiving third data information from another external device, the third data information is sent to the other external device through the serial port thread.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions
  • the device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-permanent storage in computer readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read only memory (ROM) or flash RAM.
  • RAM random access memory
  • ROM read only memory
  • flash RAM flash random access memory
  • Computer-readable media including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information.
  • Information may be computer readable instructions, data structures, modules of a program, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
  • computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Systems (AREA)

Abstract

Embodiments of the present application relate to the technical field of data processing. Disclosed are an information transmission method, apparatus, and system based on a serial port thread. The method comprises: after first data information to be sent to one external device is sent to the one external device by means of a serial port thread, modifying the state of the serial port thread from a message sending state to a message receiving state; and if no second data information sent by the one external device is received within a preset first time period, modifying the state of the serial port thread from the message receiving state to a serial port conversion state, and when third data information to be sent to another external device is obtained, sending the third data information to the another external device by means of the serial port thread. By means of the method in the embodiments of the present application, the problem that information transmission cannot be performed with a plurality of external devices due to insufficient built-in serial ports can be alleviated without increasing cost.

Description

基于串口线程的信息传输方法、装置和系统Information transmission method, device and system based on serial thread
本申请要求于2021年08月24日提交中国专利局、申请号为202110975793.9、申请名称为“基于串口线程的信息传输方法、装置和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110975793.9 and the application title "Information Transmission Method, Device and System Based on Serial Port Thread" submitted to the China Patent Office on August 24, 2021, the entire contents of which are incorporated by reference in this application.
技术领域technical field
本申请涉及数据处理领域,尤其涉及基于串口线程的信息传输方法、装置和系统。The present application relates to the field of data processing, and in particular to an information transmission method, device and system based on serial thread.
背景技术Background technique
目前经常会遇到微控制单元内置串口不足的情况,当需要外部多个设备连接时,内置串口往往不能满足。At present, it is often encountered that the built-in serial port of the microcontroller unit is insufficient. When multiple external devices need to be connected, the built-in serial port is often not enough.
现有的方案一般是重新选择拥有更多串口芯片,或者外部添加接口转换芯片,通过其他协议通讯口转化为串口的方式进行改善,而这两种现有方案均需要增加成本以及改版,而且在硬件PCB已经定版情况下,无法解决问题。The existing solutions are generally re-selecting to have more serial port chips, or adding an external interface conversion chip, and converting the communication port of other protocols into a serial port for improvement, and these two existing solutions need to increase costs and revisions, and in When the hardware PCB has been finalized, the problem cannot be solved.
因此,亟需一种方法,能够在不增加成本的情况下,改善内置串口不足而导致的无法和多个外部设备进行信息传输的问题。Therefore, there is an urgent need for a method that can improve the problem of inability to transmit information with multiple external devices caused by insufficient built-in serial ports without increasing costs.
发明内容Contents of the invention
本申请实施例提供了一种基于串口线程的信息传输方法、装置和系统,可以解决内置串口不足而导致的无法与多个外部设备进行信息传输的问题。所述技术方案如下:The embodiment of the present application provides an information transmission method, device and system based on a serial port thread, which can solve the problem of inability to perform information transmission with multiple external devices caused by insufficient built-in serial ports. Described technical scheme is as follows:
第一方面,本申请实施例提供了一种基于串口线程的信息传输方法,所述方法应用于微控制单元,所述微控制单元运行有串口线程,所述方法包括:In the first aspect, the embodiment of the present application provides an information transmission method based on a serial port thread, the method is applied to a micro control unit, and the micro control unit runs a serial port thread, and the method includes:
在通过所述串口线程将待发送给一个外部设备的第一数据信息发送给所述一个外部设备之后,将所述串口线程的状态由消息发送状态修改为消息接收状态;After the first data information to be sent to an external device is sent to the one external device through the serial port thread, the state of the serial port thread is changed from a message sending state to a message receiving state;
若在预设的第一时间段内未接收到所述一个外部设备发送的第二数据信息,则将所述串口线程的状态由消息接收状态修改为串口转化状态,并在获取到待发送给另一外部设备的第三数据信息时,通过所述串口线程将所述第三数据信息发送给所述另一外部设备。If the second data information sent by the one external device is not received within the preset first time period, the state of the serial port thread is changed from the message receiving state to the serial port conversion state, and when the information to be sent to the When receiving third data information from another external device, the third data information is sent to the other external device through the serial port thread.
可选的,在获取到待发送给另一外部设备的第三数据信息时,通过所述串口线程将所述第三数据信息发送给所述另一外部设备,包括:Optionally, when the third data information to be sent to another external device is obtained, sending the third data information to the other external device through the serial port thread includes:
将所述串口线程的状态由串口转化状态修改为初始化状态,并建立所述串口线程、与所述另一外部设备对应的控制线程两者之间的连接;Modifying the state of the serial port thread from a serial port conversion state to an initialization state, and establishing a connection between the serial port thread and the control thread corresponding to the other external device;
将所述串口线程的状态由初始化状态修改为消息等待状态;Modifying the state of the serial port thread from an initialization state to a message waiting state;
若在预设的第二时间段内获取到与所述另一外部设备对应的控制线程传递的第三数据信息,通过所述串口线程将所述第三数据信息发送给所述另一外部设备。If the third data information transmitted by the control thread corresponding to the other external device is obtained within the preset second time period, the third data information is sent to the other external device through the serial port thread .
可选的,将所述串口线程的状态由串口转化状态修改为初始化状态,包括:Optionally, modify the state of the serial port thread from the serial port conversion state to the initialization state, including:
响应于用户发起的初始化操作,将所述串口线程的状态由串口转化状态修改为初 始化状态。In response to the initialization operation initiated by the user, the state of the serial port thread is modified from the serial port conversion state to the initialization state.
可选的,所述方法还包括:Optionally, the method also includes:
若在预设的第一时间段内接收到所述一个外部设备发送的第二数据信息,则通过所述串口线程将所述第二数据信息传递给与所述一个外部设备对应的控制线程,并将所述串口线程的状态由消息接收状态修改为消息接收完成状态。If the second data message sent by the one external device is received within the preset first time period, the second data message is passed to the control thread corresponding to the one external device through the serial port thread, And modify the state of the serial port thread from the message receiving state to the message receiving complete state.
可选的,在将所述串口线程的状态由消息接收状态修改为消息接收完成状态之后,还包括:Optionally, after modifying the state of the serial port thread from the message receiving state to the message receiving complete state, it also includes:
若确定预设的第三时间段内未接收到与所述一个外部设备对应的控制线程传递的其他数据信息,则将所述串口线程的状态由消息接收完成状态修改为串口转化状态。If it is determined that no other data information transmitted by the control thread corresponding to the one external device is received within the preset third time period, the state of the serial port thread is changed from a message receiving complete state to a serial port conversion state.
可选的,所述方法还包括:Optionally, the method also includes:
响应于用户发起的初始化操作,将串口线程的状态由初始化状态修改为消息等待状态;In response to the initialization operation initiated by the user, the state of the serial port thread is changed from the initialization state to the message waiting state;
若在预设的第四时间段内获取到与所述一个外部设备对应的控制线程传递的所述第一数据信息,则将所述串口线程的状态由消息等待状态修改为消息发送状态,并通过所述串口线程将所述第一数据信息发送给所述一个外部设备。If the first data information delivered by the control thread corresponding to the one external device is obtained within the preset fourth time period, modify the state of the serial port thread from a message waiting state to a message sending state, and sending the first data information to the one external device through the serial port thread.
可选的,响应于用户发起的初始化操作,将串口线程的状态由初始化状态修改为消息等待状态,包括:Optionally, in response to the initialization operation initiated by the user, modify the state of the serial port thread from the initialization state to the message waiting state, including:
响应于用户发起的初始化操作,将所述串口线程的状态设置为初始化状态;In response to the initialization operation initiated by the user, the state of the serial port thread is set to the initialization state;
建立所述串口线程、与所述一个外部设备对应的控制线程两者之间的连接,并将所述串口线程的状态由初始化状态修改为消息等待状态。A connection between the serial port thread and the control thread corresponding to the one external device is established, and the state of the serial port thread is changed from an initialization state to a message waiting state.
可选的,所述方法还包括:Optionally, the method also includes:
若在预设的第四时间段内未获取到与所述一个外部设备对应的控制线程传递的所述第一数据信息,则将所述串口线程的状态由消息等待状态修改为串口转化状态。If the first data information transmitted by the control thread corresponding to the one external device is not obtained within the preset fourth time period, the state of the serial port thread is changed from a message waiting state to a serial port conversion state.
第二方面,本申请实施例提供了一种基于串口线程的信息传输装置,所述装置应用于微控制单元,所述微控制单元运行有串口线程,所述装置包括:In the second aspect, the embodiment of the present application provides an information transmission device based on a serial port thread, the device is applied to a micro control unit, and the micro control unit runs a serial port thread, and the device includes:
第一数据信息发送模块,用于在通过所述串口线程将待发送给一个外部设备的第一数据信息发送给所述一个外部设备之后,将所述串口线程的状态由消息发送状态修改为消息接收状态;The first data information sending module is used to modify the state of the serial port thread from the message sending state to a message after the first data information to be sent to an external device is sent to the external device through the serial port thread receiving status;
第三数据信息发送模块,用于若在预设的第一时间段内未接收到所述一个外部设备发送的第二数据信息,则将所述串口线程的状态由消息接收状态修改为串口转化状态,并在获取到待发送给另一外部设备的第三数据信息时,通过所述串口线程将所述第三数据信息发送给所述另一外部设备。The third data information sending module is used to modify the state of the serial port thread from the message receiving state to serial port conversion if the second data information sent by the one external device is not received within the preset first time period state, and when acquiring third data information to be sent to another external device, send the third data information to the other external device through the serial port thread.
可选的,所述第三数据信息发送模块,用于:Optionally, the third data information sending module is configured to:
将所述串口线程的状态由串口转化状态修改为初始化状态,并建立所述串口线程、与所述另一外部设备对应的控制线程两者之间的连接;Modifying the state of the serial port thread from a serial port conversion state to an initialization state, and establishing a connection between the serial port thread and the control thread corresponding to the other external device;
将所述串口线程的状态由初始化状态修改为消息等待状态;Modifying the state of the serial port thread from an initialization state to a message waiting state;
若在预设的第二时间段内获取到与所述另一外部设备对应的控制线程传递的第三数据信息,通过所述串口线程将所述第三数据信息发送给所述另一外部设备。If the third data information transmitted by the control thread corresponding to the other external device is obtained within the preset second time period, the third data information is sent to the other external device through the serial port thread .
可选的,所述第三数据信息发送模块,用于:Optionally, the third data information sending module is configured to:
响应于用户发起的初始化操作,将所述串口线程的状态由串口转化状态修改为初始化状态。In response to the initialization operation initiated by the user, the state of the serial port thread is changed from the serial port conversion state to the initialization state.
可选的,所述装置还包括:Optionally, the device also includes:
第二数据信息发送模块,用于若在预设的第一时间段内接收到所述一个外部设备发送的第二数据信息,则通过所述串口线程将所述第二数据信息传递给与所述一个外部设备对应的控制线程,并将所述串口线程的状态由消息接收状态修改为消息接收完成状态。The second data information sending module is configured to transmit the second data information to the connected device through the serial port thread if the second data information sent by the one external device is received within the preset first time period. Describe a control thread corresponding to an external device, and modify the state of the serial port thread from a message receiving state to a message receiving complete state.
可选的,所述装置还包括:Optionally, the device also includes:
其他数据信息确定模块,用于若确定预设的第三时间段内未接收到与所述一个外部设备对应的控制线程传递的其他数据信息,则将所述串口线程的状态由消息接收完成状态修改为串口转化状态。Other data information determination module, used to determine that other data information delivered by the control thread corresponding to the one external device is not received within the preset third time period, then change the state of the serial port thread from the message receiving completion state Modify to serial port conversion status.
可选的,所述装置还包括:Optionally, the device also includes:
初始化模块,用于响应于用户发起的初始化操作,将串口线程的状态由初始化状态修改为消息等待状态;The initialization module is used to modify the state of the serial port thread from the initialization state to the message waiting state in response to the initialization operation initiated by the user;
第一数据信息获取模块,用于若在预设的第四时间段内获取到与所述一个外部设备对应的控制线程传递的所述第一数据信息,则将所述串口线程的状态由消息等待状态修改为消息发送状态,并通过所述串口线程将所述第一数据信息发送给所述一个外部设备。The first data information acquisition module is configured to: if the first data information delivered by the control thread corresponding to the one external device is acquired within the preset fourth time period, the state of the serial port thread is sent by a message The waiting state is changed to a message sending state, and the first data information is sent to the one external device through the serial port thread.
可选的,初始化模块,用于:Optionally, initialize the module for:
响应于用户发起的初始化操作,将所述串口线程的状态设置为初始化状态;In response to the initialization operation initiated by the user, the state of the serial port thread is set to the initialization state;
建立所述串口线程、与所述一个外部设备对应的控制线程两者之间的连接,并将所述串口线程的状态由初始化状态修改为消息等待状态。A connection between the serial port thread and the control thread corresponding to the one external device is established, and the state of the serial port thread is changed from an initialization state to a message waiting state.
可选的,所述装置还包括:Optionally, the device also includes:
第一数据信息判断模块,用于若在预设的第四时间段内未获取到与所述一个外部设备对应的控制线程传递的所述第一数据信息,则将所述串口线程的状态由消息等待状态修改为串口转化状态。The first data information judging module is configured to change the status of the serial port thread from The message waiting state is changed to the serial port conversion state.
第三方面,本申请实施例提供一种基于串口线程的信息传输系统,包括:微控制单元、多个外部设备;所述微控制单元与所述每一外部设备电性连接;In a third aspect, an embodiment of the present application provides an information transmission system based on a serial port thread, including: a micro-control unit and a plurality of external devices; the micro-control unit is electrically connected to each of the external devices;
所述微控制单元,用于执行如第一方面所述的方法。The microcontroller unit is configured to execute the method as described in the first aspect.
第四方面,本申请实施例提供一种计算机存储介质,所述计算机存储介质存储有多条指令,所述指令适于由处理器加载并执行如第一方面所述的方法。In a fourth aspect, an embodiment of the present application provides a computer storage medium, where a plurality of instructions are stored in the computer storage medium, and the instructions are adapted to be loaded by a processor and execute the method as described in the first aspect.
第五方面,本申请实施例提供一种微控制单元,包括:处理器和存储器;其中,所述存储器存储有计算机程序,所述计算机程序适于由所述处理器加载并执行如第一方面所述的方法。In the fifth aspect, the embodiment of the present application provides a micro control unit, including: a processor and a memory; wherein, the memory stores a computer program, and the computer program is suitable for being loaded and executed by the processor as described in the first aspect the method described.
第六方面,本申请实施例提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现第一方面所述的方法。In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
在本申请实施例中,该方法应用于微控制单元,所述微控制单元运行有串口线程,本申请实施例在通过所述串口线程将待发送给一个外部设备的第一数据信息发送给所述一个外部设备之后,将所述串口线程的状态由消息发送状态修改为消息接收状态; 若在预设的第一时间段内未接收到所述一个外部设备发送的第二数据信息,则将所述串口线程的状态由消息接收状态修改为串口转化状态,并在获取到待发送给另一外部设备的第三数据信息时,通过所述串口线程将所述第三数据信息发送给所述另一外部设备。采用本申请实施例中的方法,能够在不增加成本的情况下,改善内置串口不足而导致的无法和多个外部设备进行信息传输的问题。In the embodiment of the present application, the method is applied to a micro-control unit, and the micro-control unit runs a serial port thread, and in the embodiment of the present application, the first data information to be sent to an external device is sent to the After the above-mentioned one external device, modify the state of the serial port thread from the message sending state to the message receiving state; if the second data information sent by the one external device is not received within the preset first time period, then the The state of the serial port thread is modified from the message receiving state to the serial port conversion state, and when the third data information to be sent to another external device is obtained, the third data information is sent to the said serial port thread through the serial port thread. another external device. By adopting the method in the embodiment of the present application, the problem of inability to transmit information with multiple external devices caused by insufficient built-in serial ports can be improved without increasing the cost.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present application. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1是本申请实施例一提供的一种基于串口线程的信息传输方法的流程示意图;FIG. 1 is a schematic flow diagram of a serial port thread-based information transmission method provided in Embodiment 1 of the present application;
图2是本申请实施例二提供的一种基于串口线程的信息传输方法的流程示意图;FIG. 2 is a schematic flow diagram of a method for transmitting information based on a serial port thread provided in Embodiment 2 of the present application;
图3是本申请实施例三提供的一种基于串口线程的信息传输方法的流程示意图;3 is a schematic flow diagram of a method for transmitting information based on a serial port thread provided in Embodiment 3 of the present application;
图4是本申请实施例三提供的一种微控制单元与外部设备交互的过程示意图;Fig. 4 is a schematic diagram of a process of interaction between a micro control unit and an external device provided in Embodiment 3 of the present application;
图5是本申请实施例四提供的一种基于串口线程的信息传输装置的结构示意图;FIG. 5 is a schematic structural diagram of an information transmission device based on a serial port thread provided in Embodiment 4 of the present application;
图6是本申请实施例五提供的一种基于串口线程的信息传输系统的结构示意图;FIG. 6 is a schematic structural diagram of a serial thread-based information transmission system provided in Embodiment 5 of the present application;
图7是本申请实施例提供的一种微控制单元的结构示意图。FIG. 7 is a schematic structural diagram of a microcontroller unit provided by an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施例方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.
应当明确,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。It should be clear that the described embodiments are only some of the embodiments of the present application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of this application.
下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present application as recited in the appended claims.
在本申请的描述中,需要理解的是,术语“第一”、“第二”、“第三”等仅用于区别类似的对象,而不必用于描述特定的顺序或先后次序,也不能理解为指示或暗示相对重要性。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本申请中的具体含义。此外,在本申请的描述中,除非另有说明,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be Read as indicating or implying relative importance. Those of ordinary skill in the art can understand the specific meanings of the above terms in this application according to specific situations. In addition, in the description of the present application, unless otherwise specified, "plurality" means two or more. "And/or" describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently. The character "/" generally indicates that the contextual objects are an "or" relationship.
需要注意的是,由于篇幅所限,本申请说明书没有穷举所有可选的实施方式,本领域技术人员在阅读本申请说明书后,应该能够想到,只要技术特征不互相矛盾,那 么技术特征的任意组合均可以构成可选的实施方式。It should be noted that due to limited space, this specification does not exhaustively list all optional implementation modes. After reading the specification, those skilled in the art should be able to imagine that as long as the technical features do not contradict each other, any of the technical features Any combination can constitute an optional embodiment.
下面对各个实施例进行详细说明。Each embodiment will be described in detail below.
实施例1Example 1
本申请实施例公开了基于串口线程的信息传输方法,该方法应用于微控制单元,其中,微控制单元运行有串口线程。The embodiment of the present application discloses an information transmission method based on a serial port thread, and the method is applied to a micro control unit, wherein the micro control unit runs a serial port thread.
下面将结合附图,对本申请实施例提供的基于串口线程的信息传输方法进行详细介绍。The serial port thread-based information transmission method provided by the embodiment of the present application will be described in detail below with reference to the accompanying drawings.
请参见图1,为本申请实施例公开的一种基于串口线程的信息传输方法的流程图。该方法包括以下步骤:Please refer to FIG. 1 , which is a flow chart of a method for transmitting information based on a serial port thread disclosed in the embodiment of the present application. The method includes the following steps:
S110、在通过所述串口线程将待发送给一个外部设备的第一数据信息发送给所述一个外部设备之后,将所述串口线程的状态由消息发送状态修改为消息接收状态。S110. After the first data information to be sent to an external device is sent to the one external device through the serial port thread, modify the state of the serial port thread from a message sending state to a message receiving state.
本实施例中,串口线程是指时分复用技术线程,具体的,时分复用技术是将不同的信号在不同的时间段内在同一个信道中传输的技术。外部设备是与微控制单元进行交互的设备,其中,外部设备可以是平板、智能手机和计算机设备。第一数据信息是由微控制单元发送至一个外部设备的信息,可以是通知类数据信息,也可以是携带由数据内容的数据信息。示例性的,可以是由微控制单元发送的图片数据信息至一个外部设备。In this embodiment, the serial port thread refers to a time-division multiplexing technology thread. Specifically, the time-division multiplexing technology is a technology that transmits different signals in the same channel in different time periods. An external device is a device that interacts with the microcontroller unit, where an external device can be a tablet, a smart phone, and a computer device. The first data information is information sent by the micro control unit to an external device, which may be notification data information or data information carrying data content. Exemplarily, it may be the image data information sent by the microcontroller unit to an external device.
本实施例中,串口线程的状态是用于表征当前串口的工作情况的指标,具体的,串口线程的状态可以包括:初始化状态、消息发送状态、消息接收状态、串口转化状态、消息等待状态和消息接收完成状态。其中,初始化状态是指串口线程的各项参数均为最初的设定状态,示例性的,初始化状态可以是所有参数均为0。消息发送状态是指当前串口线程存有待发送的数据信息且串口线程可以执行数据信息的发送指令。消息接收状态是指串口线程处于等待接收其他外部设备发送的数据信息的状态。串口转化状态是指串口线程由连接一个外部设备转换至连接另一外部设备的状态。消息等待状态是指串口线程处于等待其他线程发送数据信息的状态。消息接收完成状态是指其他外部设备已经成功发送数据信息至串口线程。In this embodiment, the state of the serial port thread is an index used to characterize the working conditions of the current serial port. Specifically, the state of the serial port thread can include: initialization state, message sending state, message receiving state, serial port conversion state, message waiting state and Message receiving completion status. Wherein, the initialization state refers to that each parameter of the serial port thread is in an initial setting state. Exemplarily, the initialization state may be that all parameters are 0. The message sending status means that the current serial port thread has data information to be sent and the serial port thread can execute the sending instruction of the data information. The message receiving state refers to the state where the serial port thread is waiting to receive data information sent by other external devices. The serial port conversion state refers to the state in which the serial port thread is converted from connecting one external device to another external device. The message waiting state refers to the state that the serial port thread is waiting for other threads to send data information. The message receiving completion status means that other external devices have successfully sent data information to the serial port thread.
S120、若在预设的第一时间段内未接收到所述一个外部设备发送的第二数据信息,则将所述串口线程的状态由消息接收状态修改为串口转化状态,并在获取到待发送给另一外部设备的第三数据信息时,通过所述串口线程将所述第三数据信息发送给所述另一外部设备。S120. If the second data information sent by the one external device is not received within the preset first time period, modify the state of the serial port thread from the message receiving state to the serial port conversion state, and obtain the pending When sending the third data information to another external device, send the third data information to the other external device through the serial port thread.
本实施例中,预设的第一时间段可以自行调整,示例性的,可以是20S或者其他时间段。第二数据信息是外部设备与微控制单元进行交互的信息,该数据信息可以是针对第一数据信息的反馈信息,也可以是与第一数据信息无关的数据信息。另一外部设备是不同于一个外部设备的电子设备,其中,另一外部设备可以是一台,也可以是多台,另一外部设备可以是与一个外部设备种类相同的设备,也可以是与一个外部设备种类不同的设备。示例性的,一个外部设备可以是智能手机,另一外部设备也可以是智能手机,或者一个外部设备可以是智能手机,另一外部设备可以是平板电脑。In this embodiment, the preset first time period can be adjusted by itself, for example, it can be 20S or other time periods. The second data information is information for interaction between the external device and the micro control unit, and the data information may be feedback information for the first data information, or may be data information unrelated to the first data information. The other external device is an electronic device different from the one external device, wherein the other external device may be one or more, and the other external device may be of the same type as the first external device, or may be the same type as the other external device. A device with a different type of external device. Exemplarily, one external device may be a smart phone, and the other external device may also be a smart phone, or one external device may be a smart phone, and the other external device may be a tablet computer.
第三数据信息是微控制单元指定发送给另一外部设备的信息。The third data information is information designated by the microcontroller unit to be sent to another external device.
本实施例中,若未收到第二数据信息,说明当前一个外部设备并没有数据信息与微控制单元进行交互,则串口线程的状态不需要处于消息接收状态。当前微控制单元需要与另一外部设备进行交互,在与另一外部设备进行交互之前,将串口线程的状态由消息接收状态修改为串口转化状态,以指示微控制单元与另一外部设备进行交互。In this embodiment, if the second data information is not received, it means that the current external device has no data information to interact with the microcontroller unit, and the state of the serial port thread does not need to be in the message receiving state. Currently, the micro control unit needs to interact with another external device. Before interacting with another external device, change the state of the serial port thread from the message receiving state to the serial port conversion state to instruct the micro control unit to interact with another external device. .
本实施例中,在通过串口线程将待发送给一个外部设备的第一数据信息发送给一个外部设备后,若在预设的第一时间段内未接收到一个外部设备发送的第二数据信息,则将串口线程进行转化,变成与另一外部设备进行交互。通过上述技术方案能够实现在不增加成本的情况下,改善内置串口不足而导致的无法和多个外部设备进行信息传输的问题。In this embodiment, after the first data information to be sent to an external device is sent to an external device through the serial port thread, if the second data message sent by an external device is not received within the preset first time period , then convert the serial port thread into interacting with another external device. Through the above technical solution, the problem of inability to transmit information with multiple external devices caused by insufficient built-in serial ports can be improved without increasing the cost.
实施例2Example 2
参见图2,为本申请实施例公开的一种基于串口线程的信息传输方法的流程图。该方法包括以下步骤:Referring to FIG. 2 , it is a flowchart of an information transmission method based on a serial port thread disclosed in the embodiment of the present application. The method includes the following steps:
S210、在通过所述串口线程将待发送给一个外部设备的第一数据信息发送给所述一个外部设备之后,将所述串口线程的状态由消息发送状态修改为消息接收状态。S210. After the first data information to be sent to an external device is sent to the one external device through the serial port thread, modify the state of the serial port thread from a message sending state to a message receiving state.
S220、判断在预设的第一时间段内是否接收到一个外部设备发送的第二数据信息,若是,执行S230;若否,执行S250。S220. Determine whether the second data information sent by an external device is received within the preset first time period, if yes, perform S230; if not, perform S250.
S230、若在预设的第一时间段内接收到所述一个外部设备发送的第二数据信息,则通过所述串口线程将所述第二数据信息传递给与所述一个外部设备对应的控制线程,并将所述串口线程的状态由消息接收状态修改为消息接收完成状态。S230. If the second data information sent by the one external device is received within the preset first time period, transfer the second data information to the control corresponding to the one external device through the serial port thread thread, and modify the state of the serial port thread from a message receiving state to a message receiving complete state.
本实施例中,与一个外部设备对应的控制线程是与串口线程并行的线程,均被配置于微控制单元,控制线程可以对接收到的第二数据信息进行处理。In this embodiment, the control thread corresponding to an external device is a thread parallel to the serial port thread, both of which are configured in the micro control unit, and the control thread can process the received second data information.
若在预设的第一时间段内接收到一个外部设备发送的第二数据信息,则由串口线程发送给相应的控制线程,以便控制线程对第二数据信息进行处理,同时串口线程继续执行其他的操作。本实施例中,在成功接收到第二数据信息后,将串口线程的状态由消息接收状态修改为消息接收完成状态。If the second data message sent by an external device is received within the preset first time period, it will be sent to the corresponding control thread by the serial port thread, so that the control thread processes the second data message, and the serial port thread continues to execute other data messages simultaneously. operation. In this embodiment, after the second data information is successfully received, the state of the serial port thread is changed from the message receiving state to the message receiving complete state.
S240、若确定预设的第三时间段内未接收到与所述一个外部设备对应的控制线程传递的其他数据信息,则将所述串口线程的状态由消息接收完成状态修改为串口转化状态。S240. If it is determined that no other data information transmitted by the control thread corresponding to the one external device is received within the preset third time period, modify the state of the serial port thread from the message receiving complete state to the serial port conversion state.
本实施例中,预设的第三时间段是可以自行设置的时间段,在该时间段内未接收到来自一个外部设备的其他数据信息,则说明一个外部设备与微控制单元之间没有数据信息进行交互。那么微控制单元可以与另一外部设备进行交互,并且将串口线程的状态由消息接收完成状态修改为串口转化状态。In this embodiment, the preset third time period is a time period that can be set by itself. If no other data information from an external device is received within this time period, it means that there is no data between an external device and the micro control unit. information to interact. Then the micro control unit can interact with another external device, and modify the state of the serial port thread from the state of message receiving completion to the state of serial port conversion.
S250、若在预设的第一时间段内未接收到所述一个外部设备发送的第二数据信息,则将所述串口线程的状态由消息接收状态修改为串口转化状态。S250. If the second data information sent by the one external device is not received within the preset first time period, modify the state of the serial port thread from the message receiving state to the serial port conversion state.
S260、将所述串口线程的状态由串口转化状态修改为初始化状态,并建立所述串口线程、与所述另一外部设备对应的控制线程两者之间的连接。S260. Modify the state of the serial port thread from a serial port conversion state to an initialization state, and establish a connection between the serial port thread and a control thread corresponding to the other external device.
本实施例中,串口线程的状态由串口转化状态修改为初始化状态后,就表明微控制单元将与另一外部设备进行交互。具体的,先将串口线程与控制线程建立连接,该 控制线程对应另一外部设备,在建立连接后,微控制单元就可以与另一外部设备进行交互。In this embodiment, after the state of the serial port thread is changed from the serial port conversion state to the initialization state, it indicates that the micro control unit will interact with another external device. Specifically, the serial port thread is first established to connect with the control thread, and the control thread corresponds to another external device. After the connection is established, the micro control unit can interact with another external device.
可选的,将所述串口线程的状态由串口转化状态修改为初始化状态,包括:Optionally, modify the state of the serial port thread from the serial port conversion state to the initialization state, including:
响应于用户发起的初始化操作,将所述串口线程的状态由串口转化状态修改为初始化状态。In response to the initialization operation initiated by the user, the state of the serial port thread is changed from the serial port conversion state to the initialization state.
本实施例中,用户发起的初始化操作可以是将微控制单元进行通电,还可以是用户自行设置的初始化操作,用于将当前的串口线程的状态设置为初始化状态。In this embodiment, the initialization operation initiated by the user may be to power on the micro control unit, and may also be an initialization operation set by the user, which is used to set the current state of the serial port thread to the initialization state.
S270、将所述串口线程的状态由初始化状态修改为消息等待状态。S270. Change the state of the serial port thread from the initialization state to the message waiting state.
本实施例中,串口线程的状态由初始化状态修改为消息等待状态,则微控制单元就能够接收数据信息,并对数据信息进行处理。In this embodiment, the state of the serial port thread is changed from the initialization state to the message waiting state, and then the micro control unit can receive data information and process the data information.
S280、若在预设的第二时间段内获取到与所述另一外部设备对应的控制线程传递的第三数据信息,通过所述串口线程将所述第三数据信息发送给所述另一外部设备。S280. If the third data information transmitted by the control thread corresponding to the other external device is obtained within the preset second time period, send the third data information to the other external device through the serial port thread external device.
本实施例中,预设的第二时间段可以是与第一时间段相同的时间段,也可以是与第一时间段不同的时间段。在该时间段内由控制线程发送至串口线程第三数据信息,并将第三数据信息发送至另一外部设备,以使另一外部设备接收第三数据信息,并在另一外部设备内对第三数据信息进行处理。其中,控制线程是与另一外部设备对应的。In this embodiment, the preset second time period may be the same time period as the first time period, or may be a time period different from the first time period. During this period of time, the third data information is sent to the serial port thread by the control thread, and the third data information is sent to another external device, so that the other external device receives the third data information, and in another external device. The third data message is processed. Wherein, the control thread corresponds to another external device.
本实施例中,若在预设的第一时间段内接收到一个外部设备发送的第二数据信息,则通过控制线程处理第二数据信息。在通过串口线程与一个外部设备进行交互后,若在预设的第三时间段内未接收到与一个设备进行交互的其他数据信息,则通过串口线程状态的变化指示微控制单元与另一外部设备进行交互。采用本实施例中的技术手段,能够完成微控制单元与一个设备进行交互的过程,并在完全完成与一个设备进行交互后,微控制单元再与另一设备进行交互。这样能够在不增加成本的情况下,既能保证与设备进行完整的交互过程,又能在不同的时段与多个设备进行交互。In this embodiment, if the second data information sent by an external device is received within the preset first time period, the second data information is processed through the control thread. After interacting with an external device through the serial port thread, if no other data information for interacting with a device is received within the preset third time period, the change of the state of the serial port thread indicates that the micro control unit communicates with another external device. devices to interact. By adopting the technical means in this embodiment, the process of the micro-control unit interacting with one device can be completed, and after the interaction with one device is completely completed, the micro-control unit then interacts with another device. In this way, the complete interaction process with the device can be guaranteed without increasing the cost, and the interaction with multiple devices can be performed at different time periods.
实施例3Example 3
参见图3,为本申请实施例公开的一种基于串口线程的信息传输方法的流程图。该方法包括以下步骤:Referring to FIG. 3 , it is a flowchart of an information transmission method based on a serial port thread disclosed in the embodiment of the present application. The method includes the following steps:
S310、响应于用户发起的初始化操作,将串口线程的状态由初始化状态修改为消息等待状态。S310. In response to the initialization operation initiated by the user, modify the state of the serial port thread from the initialization state to the message waiting state.
可选的,本实施例中,响应于用户发起的初始化操作,将串口线程的状态由初始化状态修改为消息等待状态,包括:Optionally, in this embodiment, in response to the initialization operation initiated by the user, the state of the serial port thread is changed from the initialization state to the message waiting state, including:
响应于用户发起的初始化操作,将所述串口线程的状态设置为初始化状态;In response to the initialization operation initiated by the user, the state of the serial port thread is set to the initialization state;
建立所述串口线程、与所述一个外部设备对应的控制线程两者之间的连接,并将所述串口线程的状态由初始化状态修改为消息等待状态。A connection between the serial port thread and the control thread corresponding to the one external device is established, and the state of the serial port thread is changed from an initialization state to a message waiting state.
本实施例中,先将串口线程与控制线程建立连接,该控制线程对应一个外部设备,在建立连接后,微控制单元就可以与一个外部设备进行交互。值得注意的是,不同的控制线程对应的外部设备是不同的。在建立微控制单元与一个外部设备的连接后,则将串口线程的状态由初始化状态修改为消息等待状态,以便微控制单元接收一个外部设备发送的数据信息。In this embodiment, a connection is first established between the serial port thread and the control thread, and the control thread corresponds to an external device. After the connection is established, the micro control unit can interact with an external device. It should be noted that different control threads correspond to different external devices. After the connection between the micro control unit and an external device is established, the state of the serial port thread is changed from the initialization state to the message waiting state, so that the micro control unit receives data information sent by an external device.
S320、判断在预设的第四时间段内是否获取到与一个外部设备对应的控制线程传递的第一数据信息;若是,则执行S330;若否,则执行S340。S320. Determine whether the first data information transmitted by the control thread corresponding to an external device is acquired within the preset fourth time period; if yes, execute S330; if not, execute S340.
S330、若在预设的第四时间段内获取到与所述一个外部设备对应的控制线程传递的所述第一数据信息,则将所述串口线程的状态由消息等待状态修改为消息发送状态,并通过所述串口线程将所述第一数据信息发送给所述一个外部设备。S330. If the first data information transmitted by the control thread corresponding to the one external device is obtained within the preset fourth time period, modify the state of the serial port thread from the message waiting state to the message sending state , and send the first data information to the one external device through the serial port thread.
S340、若在预设的第四时间段内未获取到与所述一个外部设备对应的控制线程传递的所述第一数据信息,则将所述串口线程的状态由消息等待状态修改为串口转化状态。S340. If the first data information transmitted by the control thread corresponding to the one external device is not obtained within the preset fourth time period, modify the state of the serial port thread from message waiting state to serial port conversion state.
本实施例中,若在预设的第四时间段内未接收到数据信息,则说明一个外部设备与微控制单元没有数据信息进行交互,则修改串口线程的状态,以便微控制单元与另一外部设备进行交互。具体的,可以参见图4中示出的一种微控制单元与外部设备交互的过程示意图。从图4中可以看出,在不同的时间段内微控制单元与不同的外部设备进行交互。In this embodiment, if no data information is received within the preset fourth time period, it means that an external device interacts with the micro control unit without data information, and the state of the serial port thread is modified so that the micro control unit communicates with another interact with external devices. Specifically, reference may be made to a schematic diagram of a process of interaction between a micro control unit and an external device shown in FIG. 4 . It can be seen from Figure 4 that the MCU interacts with different external devices in different time periods.
本实施例中,通过响应于用户发起的初始化操作,将串口线程的状态由初始化状态修改为消息等待状态,以及判断在预设的第四时间段内是否接收到第一数据信息,若没有接收到,则通过串口线程的状态的修改,建立微控制单元与另一外部设备的交互。采用上述技术方案,能够更好地利用微控制单元,以使微控制单元能够更加高效地建立与外部设备的连接。In this embodiment, by responding to the initialization operation initiated by the user, the state of the serial port thread is changed from the initialization state to the message waiting state, and it is judged whether the first data information is received within the preset fourth time period. Then, the interaction between the micro control unit and another external device is established through the modification of the state of the serial port thread. By adopting the above technical solution, the micro control unit can be better utilized, so that the micro control unit can more efficiently establish connections with external devices.
实施例4Example 4
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
请参见图5,其示出了本申请一个示例性实施例提供的基于串口线程的信息传输装置的结构示意图。该基于串口线程的信息传输装置可以通过软件、硬件或者两者的结合实现成为智能交互平板的全部或一部分。该装置包括第一数据信息发送模块510、第三数据信息发送模块520、第二数据信息发送模块530、其他数据信息确定模块540、初始化模块550、第一数据信息获取模块560和第一数据信息判断模块570。Please refer to FIG. 5 , which shows a schematic structural diagram of an information transmission device based on a serial port thread provided by an exemplary embodiment of the present application. The information transmission device based on the serial port thread can be implemented as all or a part of the intelligent interactive panel through software, hardware or a combination of the two. The device includes a first data information sending module 510, a third data information sending module 520, a second data information sending module 530, other data information determination module 540, an initialization module 550, a first data information acquisition module 560 and a first data information Judgment module 570 .
第一数据信息发送模块510,用于在通过所述串口线程将待发送给一个外部设备的第一数据信息发送给所述一个外部设备之后,将所述串口线程的状态由消息发送状态修改为消息接收状态;The first data information sending module 510 is used to modify the state of the serial port thread from the message sending state to message receiving status;
第三数据信息发送模块520,用于若在预设的第一时间段内未接收到所述一个外部设备发送的第二数据信息,则将所述串口线程的状态由消息接收状态修改为串口转化状态,并在获取到待发送给另一外部设备的第三数据信息时,通过所述串口线程将所述第三数据信息发送给所述另一外部设备。The third data information sending module 520 is configured to modify the state of the serial port thread from the message receiving state to the serial port if the second data information sent by the one external device is not received within the preset first time period The state is changed, and when the third data information to be sent to another external device is obtained, the third data information is sent to the other external device through the serial port thread.
可选的,所述第三数据信息发送模块520,用于:Optionally, the third data information sending module 520 is configured to:
将所述串口线程的状态由串口转化状态修改为初始化状态,并建立所述串口线程、与所述另一外部设备对应的控制线程两者之间的连接;Modifying the state of the serial port thread from a serial port conversion state to an initialization state, and establishing a connection between the serial port thread and the control thread corresponding to the other external device;
将所述串口线程的状态由初始化状态修改为消息等待状态;Modifying the state of the serial port thread from an initialization state to a message waiting state;
若在预设的第二时间段内获取到与所述另一外部设备对应的控制线程传递的第三 数据信息,通过所述串口线程将所述第三数据信息发送给所述另一外部设备。If the third data information transmitted by the control thread corresponding to the other external device is obtained within the preset second time period, the third data information is sent to the other external device through the serial port thread .
可选的,所述第三数据信息发送模块520,用于:Optionally, the third data information sending module 520 is configured to:
响应于用户发起的初始化操作,将所述串口线程的状态由串口转化状态修改为初始化状态。In response to the initialization operation initiated by the user, the state of the serial port thread is changed from the serial port conversion state to the initialization state.
可选的,所述装置还包括:Optionally, the device also includes:
第二数据信息发送模块530,用于若在预设的第一时间段内接收到所述一个外部设备发送的第二数据信息,则通过所述串口线程将所述第二数据信息传递给与所述一个外部设备对应的控制线程,并将所述串口线程的状态由消息接收状态修改为消息接收完成状态。The second data information sending module 530 is configured to, if the second data information sent by the one external device is received within the preset first time period, transfer the second data information to the user through the serial port thread The control thread corresponding to the one external device modifies the state of the serial port thread from a message receiving state to a message receiving complete state.
可选的,所述装置还包括:Optionally, the device also includes:
其他数据信息确定模块540,用于若确定预设的第三时间段内未接收到与所述一个外部设备对应的控制线程传递的其他数据信息,则将所述串口线程的状态由消息接收完成状态修改为串口转化状态。The other data information determination module 540 is configured to complete the state of the serial port thread by message receiving if it is determined that no other data information transmitted by the control thread corresponding to the one external device has been received within the preset third time period. The state is changed to the serial port conversion state.
可选的,所述装置还包括:Optionally, the device also includes:
初始化模块550,用于响应于用户发起的初始化操作,将串口线程的状态由初始化状态修改为消息等待状态;The initialization module 550 is used to respond to the initialization operation initiated by the user, modifying the state of the serial port thread from the initialization state to the message waiting state;
第一数据信息获取模块560,用于若在预设的第四时间段内获取到与所述一个外部设备对应的控制线程传递的所述第一数据信息,则将所述串口线程的状态由消息等待状态修改为消息发送状态,并通过所述串口线程将所述第一数据信息发送给所述一个外部设备。The first data information acquiring module 560 is configured to change the state of the serial port thread from The message waiting state is changed to the message sending state, and the first data information is sent to the one external device through the serial port thread.
可选的,初始化模块550,用于:Optionally, the initialization module 550 is used for:
响应于用户发起的初始化操作,将所述串口线程的状态设置为初始化状态;In response to the initialization operation initiated by the user, the state of the serial port thread is set to the initialization state;
建立所述串口线程、与所述一个外部设备对应的控制线程两者之间的连接,并将所述串口线程的状态由初始化状态修改为消息等待状态。A connection between the serial port thread and the control thread corresponding to the one external device is established, and the state of the serial port thread is changed from an initialization state to a message waiting state.
可选的,所述装置还包括:Optionally, the device also includes:
第一数据信息判断模块570,用于若在预设的第四时间段内未获取到与所述一个外部设备对应的控制线程传递的所述第一数据信息,则将所述串口线程的状态由消息等待状态修改为串口转化状态。The first data information judging module 570 is configured to: if the first data information transmitted by the control thread corresponding to the one external device is not obtained within the preset fourth time period, then the state of the serial port thread Change from the message waiting state to the serial port conversion state.
需要说明的是,上述实施例提供的基于串口线程的信息传输装置在执行基于串口线程的信息传输方法时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的基于串口线程的信息传输装置与基于串口线程的信息传输方法实施例属于同一构思,其体现实现过程详见方法实施例,这里不再赘述。It should be noted that, when the serial port thread-based information transmission device provided in the above-mentioned embodiments executes the serial port thread-based information transmission method, the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned Function allocation is accomplished by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the serial port thread-based information transmission device and the serial port thread-based information transmission method embodiment provided by the above embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, and will not be repeated here.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present application are for description only, and do not represent the advantages and disadvantages of the embodiments.
本实施例中,在通过串口线程将待发送给一个外部设备的第一数据信息发送给一个外部设备后,若在预设的第一时间段内未接收到一个外部设备发送的第二数据信息,则将串口线程进行转化,变成与另一外部设备进行交互。通过上述技术方案能够实现在不增加成本的情况下,改善内置串口不足而导致的无法和多个外部设备进行信息传 输的问题。In this embodiment, after the first data information to be sent to an external device is sent to an external device through the serial port thread, if the second data message sent by an external device is not received within the preset first time period , then convert the serial port thread into interacting with another external device. Through the above technical solution, it can be achieved without increasing the cost, and the problem of inability to transmit information with multiple external devices caused by the lack of built-in serial ports can be improved.
实施例5Example 5
本申请实施例还提供了一种基于串口线程的信息传输系统,具体的,可以参见图6中示出的一种基于串口线程的信息传输系统的结构示意图。包括:微控制单元610、多个外部设备620;所述微控制单元与所述每一外部设备电性连接;The embodiment of the present application also provides a serial port thread-based information transmission system. For details, refer to the schematic structural diagram of a serial port thread-based information transmission system shown in FIG. 6 . Including: a micro control unit 610, a plurality of external devices 620; the micro control unit is electrically connected to each of the external devices;
所述微控制单元,用于执行如上述图1-图3所示实施例的方法步骤,具体执行过程可以参见图1-图3所示实施例的具体说明,在此不进行赘述。The micro-control unit is used to execute the method steps of the embodiment shown in FIGS. 1-3 . For the specific execution process, please refer to the specific description of the embodiment shown in FIGS. 1-3 , which will not be repeated here.
实施例6Example 6
本申请实施例还提供了一种计算机存储介质,所述计算机存储介质可以存储有多条指令,所述指令适于由处理器加载并执行如上述图1-图3所示实施例的方法步骤,具体执行过程可以参见图1-图3所示实施例的具体说明,在此不进行赘述。The embodiment of the present application also provides a computer storage medium, the computer storage medium can store a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method steps of the above-mentioned embodiments shown in Figures 1-3 For the specific execution process, refer to the specific description of the embodiments shown in FIGS. 1-3 , and details are not repeated here.
存储介质所在设备可以是微控制单元。The device where the storage medium is located may be a micro control unit.
实施例7Example 7
请参见图7,为本申请实施例提供了一种微控制单元的结构示意图。如图7所示,所述微控制单元1000可以包括:至少一个处理器1001和存储器1005。Please refer to FIG. 7 , which provides a schematic structural diagram of a microcontroller unit according to an embodiment of the present application. As shown in FIG. 7 , the micro control unit 1000 may include: at least one processor 1001 and a memory 1005 .
其中,处理器1001可以包括一个或者多个处理核心。处理器1001利用各种接口和线路连接整个微控制单元1000内的各个部分,通过运行或执行存储在存储器1005内的指令、程序、代码集或指令集,以及调用存储在存储器1005内的数据,执行微控制单元1000的各种功能和处理数据。可选的,处理器1001可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器1001可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示屏所需要显示的内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器1001中,单独通过一块芯片进行实现。Wherein, the processor 1001 may include one or more processing cores. The processor 1001 uses various interfaces and lines to connect various parts in the entire micro control unit 1000, by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005, Various functions of the micro control unit 1000 are executed and data is processed. Optionally, the processor 1001 may use at least one of Digital Signal Processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). implemented in the form of hardware. The processor 1001 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly handles the operating system, user interface and application programs, etc.; the GPU is used to render and draw the content that needs to be displayed on the display screen; the modem is used to handle wireless communication. It can be understood that the above modem may also not be integrated into the processor 1001, but implemented by a single chip.
其中,存储器1005可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。可选的,该存储器1005包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器1005可用于存储指令、程序、代码、代码集或指令集。存储器1005可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现上述各个方法实施例的指令等;存储数据区可存储上面各个方法实施例中涉及到的数据等。存储器1005可选的还可以是至少一个位于远离前述处理器1001的存储装置。如图7所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及微控制单元的操作应用程序。Wherein, the memory 1005 may include a random access memory (Random Access Memory, RAM), and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium (non-transitory computer-readable storage medium). The memory 1005 may be used to store instructions, programs, codes, sets of codes or sets of instructions. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), Instructions and the like for implementing the above method embodiments; the storage data area can store the data and the like involved in the above method embodiments. Optionally, the memory 1005 may also be at least one storage device located away from the aforementioned processor 1001 . As shown in FIG. 7 , the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an operation application program of the micro control unit.
在图7所示的微控制单元1000中,处理器1001可以用于调用存储器1005中存储的微控制单元的操作应用程序,并具体执行以下操作:In the micro control unit 1000 shown in FIG. 7, the processor 1001 can be used to call the operation application program of the micro control unit stored in the memory 1005, and specifically perform the following operations:
在通过所述串口线程将待发送给一个外部设备的第一数据信息发送给所述一个外部设备之后,将所述串口线程的状态由消息发送状态修改为消息接收状态;After the first data information to be sent to an external device is sent to the one external device through the serial port thread, the state of the serial port thread is changed from a message sending state to a message receiving state;
若在预设的第一时间段内未接收到所述一个外部设备发送的第二数据信息,则将所述串口线程的状态由消息接收状态修改为串口转化状态,并在获取到待发送给另一外部设备的第三数据信息时,通过所述串口线程将所述第三数据信息发送给所述另一外部设备。If the second data information sent by the one external device is not received within the preset first time period, the state of the serial port thread is changed from the message receiving state to the serial port conversion state, and when the information to be sent to the When receiving third data information from another external device, the third data information is sent to the other external device through the serial port thread.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowcharts and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。存储器是计算机可读介质的示例。Memory may include non-permanent storage in computer readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read only memory (ROM) or flash RAM. The memory is an example of a computer readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、 只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information. Information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes Other elements not expressly listed, or elements inherent in the process, method, commodity, or apparatus are also included. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
以上仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The above are only examples of the present application, and are not intended to limit the present application. For those skilled in the art, various modifications and changes may occur in this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims (20)

  1. 一种基于串口线程的信息传输方法,其特征在于,所述方法应用于微控制单元,所述微控制单元运行有串口线程,所述方法包括:A kind of information transmission method based on serial port thread, it is characterized in that, described method is applied to micro control unit, and described micro control unit runs serial port thread, and described method comprises:
    在通过所述串口线程将待发送给一个外部设备的第一数据信息发送给所述一个外部设备之后,将所述串口线程的状态由消息发送状态修改为消息接收状态;After the first data information to be sent to an external device is sent to the one external device through the serial port thread, the state of the serial port thread is changed from a message sending state to a message receiving state;
    若在预设的第一时间段内未接收到所述一个外部设备发送的第二数据信息,则将所述串口线程的状态由消息接收状态修改为串口转化状态,并在获取到待发送给另一外部设备的第三数据信息时,通过所述串口线程将所述第三数据信息发送给所述另一外部设备。If the second data information sent by the one external device is not received within the preset first time period, the state of the serial port thread is changed from the message receiving state to the serial port conversion state, and when the information to be sent to the When receiving third data information from another external device, the third data information is sent to the other external device through the serial port thread.
  2. 根据权利要求1所述的方法,其特征在于,在获取到待发送给另一外部设备的第三数据信息时,通过所述串口线程将所述第三数据信息发送给所述另一外部设备,包括:The method according to claim 1, characterized in that, when the third data information to be sent to another external device is obtained, the third data information is sent to the other external device through the serial port thread ,include:
    将所述串口线程的状态由串口转化状态修改为初始化状态,并建立所述串口线程、与所述另一外部设备对应的控制线程两者之间的连接;Modifying the state of the serial port thread from a serial port conversion state to an initialization state, and establishing a connection between the serial port thread and the control thread corresponding to the other external device;
    将所述串口线程的状态由初始化状态修改为消息等待状态;Modifying the state of the serial port thread from an initialization state to a message waiting state;
    若在预设的第二时间段内获取到与所述另一外部设备对应的控制线程传递的第三数据信息,通过所述串口线程将所述第三数据信息发送给所述另一外部设备。If the third data information transmitted by the control thread corresponding to the other external device is obtained within the preset second time period, the third data information is sent to the other external device through the serial port thread .
  3. 根据权利要求2所述的方法,其特征在于,将所述串口线程的状态由串口转化状态修改为初始化状态,包括:The method according to claim 2, wherein modifying the state of the serial port thread from a serial port conversion state to an initialization state includes:
    响应于用户发起的初始化操作,将所述串口线程的状态由串口转化状态修改为初始化状态。In response to the initialization operation initiated by the user, the state of the serial port thread is changed from the serial port conversion state to the initialization state.
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-3, further comprising:
    若在预设的第一时间段内接收到所述一个外部设备发送的第二数据信息,则通过所述串口线程将所述第二数据信息传递给与所述一个外部设备对应的控制线程,并将所述串口线程的状态由消息接收状态修改为消息接收完成状态。If the second data message sent by the one external device is received within the preset first time period, the second data message is passed to the control thread corresponding to the one external device through the serial port thread, And modify the state of the serial port thread from the message receiving state to the message receiving complete state.
  5. 根据权利要求4所述的方法,其特征在于,在将所述串口线程的状态由消息接收状态修改为消息接收完成状态之后,还包括:The method according to claim 4, wherein, after modifying the state of the serial port thread from the message receiving state to the message receiving complete state, further comprising:
    若确定预设的第三时间段内未接收到与所述一个外部设备对应的控制线程传递的其他数据信息,则将所述串口线程的状态由消息接收完成状态修改为串口转化状态。If it is determined that no other data information transmitted by the control thread corresponding to the one external device is received within the preset third time period, the state of the serial port thread is changed from a message receiving complete state to a serial port conversion state.
  6. 根据权利要求1-5中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-5, wherein the method further comprises:
    响应于用户发起的初始化操作,将串口线程的状态由初始化状态修改为消息等待状态;In response to the initialization operation initiated by the user, the state of the serial port thread is changed from the initialization state to the message waiting state;
    若在预设的第四时间段内获取到与所述一个外部设备对应的控制线程传递的所述第一数据信息,则将所述串口线程的状态由消息等待状态修改为消息发送状态,并通过所述串口线程将所述第一数据信息发送给所述一个外部设备。If the first data information delivered by the control thread corresponding to the one external device is obtained within the preset fourth time period, modify the state of the serial port thread from a message waiting state to a message sending state, and sending the first data information to the one external device through the serial port thread.
  7. 根据权利要求6所述的方法,其特征在于,响应于用户发起的初始化操作,将串口线程的状态由初始化状态修改为消息等待状态,包括:The method according to claim 6, wherein, in response to the initialization operation initiated by the user, the state of the serial port thread is changed from the initialization state to the message waiting state, including:
    响应于用户发起的初始化操作,将所述串口线程的状态设置为初始化状态;In response to the initialization operation initiated by the user, the state of the serial port thread is set to the initialization state;
    建立所述串口线程、与所述一个外部设备对应的控制线程两者之间的连接,并将 所述串口线程的状态由初始化状态修改为消息等待状态。Establish the connection between the serial port thread and the control thread corresponding to the one external device, and modify the state of the serial port thread from the initialization state to the message waiting state.
  8. 根据权利要求6或7所述的方法,其特征在于,所述方法还包括:The method according to claim 6 or 7, characterized in that the method further comprises:
    若在预设的第四时间段内未获取到与所述一个外部设备对应的控制线程传递的所述第一数据信息,则将所述串口线程的状态由消息等待状态修改为串口转化状态。If the first data information transmitted by the control thread corresponding to the one external device is not obtained within the preset fourth time period, the state of the serial port thread is changed from a message waiting state to a serial port conversion state.
  9. 一种基于串口线程的信息传输装置,其特征在于,所述装置应用于微控制单元,所述微控制单元运行有串口线程,所述装置包括:A kind of information transmission device based on serial port thread, it is characterized in that, described device is applied to micro-control unit, and described micro-control unit runs with serial port thread, and described device comprises:
    第一数据信息发送模块,用于在通过所述串口线程将待发送给一个外部设备的第一数据信息发送给所述一个外部设备之后,将所述串口线程的状态由消息发送状态修改为消息接收状态;The first data information sending module is used to modify the state of the serial port thread from the message sending state to a message after the first data information to be sent to an external device is sent to the external device through the serial port thread receiving status;
    第三数据信息发送模块,用于若在预设的第一时间段内未接收到所述一个外部设备发送的第二数据信息,则将所述串口线程的状态由消息接收状态修改为串口转化状态,并在获取到待发送给另一外部设备的第三数据信息时,通过所述串口线程将所述第三数据信息发送给所述另一外部设备。The third data information sending module is used to modify the state of the serial port thread from the message receiving state to serial port conversion if the second data information sent by the one external device is not received within the preset first time period state, and when acquiring third data information to be sent to another external device, send the third data information to the other external device through the serial port thread.
  10. 根据权利要求9所述的装置,其特征在于,所述第三数据信息发送模块,用于:The device according to claim 9, wherein the third data information sending module is configured to:
    将所述串口线程的状态由串口转化状态修改为初始化状态,并建立所述串口线程、与所述另一外部设备对应的控制线程两者之间的连接;Modifying the state of the serial port thread from a serial port conversion state to an initialization state, and establishing a connection between the serial port thread and the control thread corresponding to the other external device;
    将所述串口线程的状态由初始化状态修改为消息等待状态;Modifying the state of the serial port thread from an initialization state to a message waiting state;
    若在预设的第二时间段内获取到与所述另一外部设备对应的控制线程传递的第三数据信息,通过所述串口线程将所述第三数据信息发送给所述另一外部设备。If the third data information transmitted by the control thread corresponding to the other external device is obtained within the preset second time period, the third data information is sent to the other external device through the serial port thread .
  11. 根据权利要求10所述的装置,其特征在于,所述第三数据信息发送模块,用于:The device according to claim 10, wherein the third data information sending module is configured to:
    响应于用户发起的初始化操作,将所述串口线程的状态由串口转化状态修改为初始化状态。In response to the initialization operation initiated by the user, the state of the serial port thread is changed from the serial port conversion state to the initialization state.
  12. 根据权利要求9-11中任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 9-11, wherein the device further comprises:
    第二数据信息发送模块,用于若在预设的第一时间段内接收到所述一个外部设备发送的第二数据信息,则通过所述串口线程将所述第二数据信息传递给与所述一个外部设备对应的控制线程,并将所述串口线程的状态由消息接收状态修改为消息接收完成状态。The second data information sending module is configured to transmit the second data information to the connected device through the serial port thread if the second data information sent by the one external device is received within the preset first time period. Describe a control thread corresponding to an external device, and modify the state of the serial port thread from a message receiving state to a message receiving complete state.
  13. 根据权利要求12所述的装置,其特征在于,所述装置还包括:The device according to claim 12, wherein the device further comprises:
    其他数据信息确定模块,用于若确定预设的第三时间段内未接收到与所述一个外部设备对应的控制线程传递的其他数据信息,则将所述串口线程的状态由消息接收完成状态修改为串口转化状态。Other data information determination module, used to determine that other data information delivered by the control thread corresponding to the one external device is not received within the preset third time period, then change the state of the serial port thread from the message receiving completion state Modify to serial port conversion status.
  14. 根据权利要求9-13中任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 9-13, wherein the device further comprises:
    初始化模块,用于响应于用户发起的初始化操作,将串口线程的状态由初始化状态修改为消息等待状态;The initialization module is used to modify the state of the serial port thread from the initialization state to the message waiting state in response to the initialization operation initiated by the user;
    第一数据信息获取模块,用于若在预设的第四时间段内获取到与所述一个外部设备对应的控制线程传递的所述第一数据信息,则将所述串口线程的状态由消息等待状态修改为消息发送状态,并通过所述串口线程将所述第一数据信息发送给所述一个外 部设备。The first data information acquisition module is configured to: if the first data information delivered by the control thread corresponding to the one external device is acquired within the preset fourth time period, the state of the serial port thread is sent by a message The waiting state is changed to a message sending state, and the first data information is sent to the one external device through the serial port thread.
  15. 根据权利要求14所述的装置,其特征在于,初始化模块,用于:The device according to claim 14, wherein the initialization module is used for:
    响应于用户发起的初始化操作,将所述串口线程的状态设置为初始化状态;In response to the initialization operation initiated by the user, the state of the serial port thread is set to the initialization state;
    建立所述串口线程、与所述一个外部设备对应的控制线程两者之间的连接,并将所述串口线程的状态由初始化状态修改为消息等待状态。A connection between the serial port thread and the control thread corresponding to the one external device is established, and the state of the serial port thread is changed from an initialization state to a message waiting state.
  16. 根据权利要求14或15所述的装置,其特征在于,所述装置还包括:The device according to claim 14 or 15, wherein the device further comprises:
    第一数据信息判断模块,用于若在预设的第四时间段内未获取到与所述一个外部设备对应的控制线程传递的所述第一数据信息,则将所述串口线程的状态由消息等待状态修改为串口转化状态。The first data information judging module is configured to change the status of the serial port thread from The message waiting state is changed to the serial port conversion state.
  17. 一种基于串口线程的信息传输系统,其特征在于,包括:微控制单元、多个外部设备;所述微控制单元与所述每一外部设备电性连接;An information transmission system based on a serial port thread, characterized in that it includes: a micro-control unit and a plurality of external devices; the micro-control unit is electrically connected to each of the external devices;
    所述微控制单元,用于执行如权利要求1-8任一项所述的方法。The micro control unit is configured to execute the method according to any one of claims 1-8.
  18. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有多条指令,所述指令适于由处理器加载并执行如权利要求1-8中任一项的方法。A computer storage medium, characterized in that the computer storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor and execute the method according to any one of claims 1-8.
  19. 一种微控制单元,其特征在于,包括:处理器和存储器;其中,所述存储器存储有计算机程序,所述计算机程序适于由所述处理器加载并执行如权利要求1-8中任一项的方法。A micro control unit, characterized in that it comprises: a processor and a memory; wherein, the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing any one of claims 1-8 item method.
  20. 一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现权利要求1-8中任一项所述的方法。A computer program product, comprising a computer program, which implements the method according to any one of claims 1-8 when the computer program is executed by a processor.
PCT/CN2022/111754 2021-08-24 2022-08-11 Information transmission method, apparatus, and system based on serial port thread WO2023024922A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110975793.9 2021-08-24
CN202110975793.9A CN115718719A (en) 2021-08-24 2021-08-24 Information transmission method, device and system based on serial port thread

Publications (1)

Publication Number Publication Date
WO2023024922A1 true WO2023024922A1 (en) 2023-03-02

Family

ID=85253442

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/111754 WO2023024922A1 (en) 2021-08-24 2022-08-11 Information transmission method, apparatus, and system based on serial port thread

Country Status (2)

Country Link
CN (1) CN115718719A (en)
WO (1) WO2023024922A1 (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003258756A (en) * 2002-03-01 2003-09-12 Nippon Telegr & Teleph Corp <Ntt> Communication channel allocation method in center station, center station device, communication channel allocation program, and recording medium with such program recorded thereon
CN101089835A (en) * 2007-05-30 2007-12-19 华为技术有限公司 Control method, system and equipment of single serial port multi-CPU
WO2008059558A1 (en) * 2006-11-13 2008-05-22 Fujitsu Limited Wireless communication system
CN101571840A (en) * 2009-06-05 2009-11-04 四川长虹电器股份有限公司 Two-line unclocked data interaction method
CN102193683A (en) * 2010-03-12 2011-09-21 北京汇冠新技术股份有限公司 Control board and serial communication arbiter for touch screen with camera
CN102387012A (en) * 2011-10-12 2012-03-21 北京创毅视讯科技有限公司 Method for transmitting data on half-duplex bus and interface device
CN105159194A (en) * 2015-08-25 2015-12-16 天津市英贝特航天科技有限公司 Switching circuit and switching method for switching data receiving/sending operation of RS-485 serial port
CN109062847A (en) * 2018-07-31 2018-12-21 深圳职业技术学院 System on chip, IP kernel and its control method for RS485 serial communication
CN109313623A (en) * 2017-11-15 2019-02-05 深圳配天智能技术研究院有限公司 Switch the method and device of serial data transmission state
CN111813728A (en) * 2020-09-02 2020-10-23 湖南慧明谦信息技术有限公司 Multi-bus and multi-channel interface realized by single serial port multiplexing mode

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003258756A (en) * 2002-03-01 2003-09-12 Nippon Telegr & Teleph Corp <Ntt> Communication channel allocation method in center station, center station device, communication channel allocation program, and recording medium with such program recorded thereon
WO2008059558A1 (en) * 2006-11-13 2008-05-22 Fujitsu Limited Wireless communication system
CN101089835A (en) * 2007-05-30 2007-12-19 华为技术有限公司 Control method, system and equipment of single serial port multi-CPU
CN101571840A (en) * 2009-06-05 2009-11-04 四川长虹电器股份有限公司 Two-line unclocked data interaction method
CN102193683A (en) * 2010-03-12 2011-09-21 北京汇冠新技术股份有限公司 Control board and serial communication arbiter for touch screen with camera
CN102387012A (en) * 2011-10-12 2012-03-21 北京创毅视讯科技有限公司 Method for transmitting data on half-duplex bus and interface device
CN105159194A (en) * 2015-08-25 2015-12-16 天津市英贝特航天科技有限公司 Switching circuit and switching method for switching data receiving/sending operation of RS-485 serial port
CN109313623A (en) * 2017-11-15 2019-02-05 深圳配天智能技术研究院有限公司 Switch the method and device of serial data transmission state
CN109062847A (en) * 2018-07-31 2018-12-21 深圳职业技术学院 System on chip, IP kernel and its control method for RS485 serial communication
CN111813728A (en) * 2020-09-02 2020-10-23 湖南慧明谦信息技术有限公司 Multi-bus and multi-channel interface realized by single serial port multiplexing mode

Also Published As

Publication number Publication date
CN115718719A (en) 2023-02-28

Similar Documents

Publication Publication Date Title
US8966073B2 (en) Network communication method and system
US8874686B2 (en) DDS structure with scalability and adaptability and node constituting the same
WO2019201340A1 (en) Processor core scheduling method and apparatus, terminal, and storage medium
WO2024088268A1 (en) Rdma event management methods, and device and storage medium
CN102855214B (en) Realize the method for data consistency and a kind of multiple nucleus system
US20240069850A1 (en) Application Sharing Method, Electronic Device, and Storage Medium
CN109918203A (en) Access server memory management optimization method, access server and communication system
CN103327281A (en) Format conversion method and format conversion circuit
EP3091712A1 (en) Smart device for realizing multiple-device collaboration and working method for multiple-device collaboration
WO2023103599A1 (en) Screen projection method and apparatus, storage medium and electronic device
WO2023185044A1 (en) Data processing method and apparatus, and electronic device and storage medium
CN109891400A (en) Method, apparatus and storage medium based on SPI asynchronous process event
JP2024518365A (en) Device connection method, device, device, and storage medium
EP4220627A1 (en) Control method and apparatus, and electronic device
WO2023024922A1 (en) Information transmission method, apparatus, and system based on serial port thread
CN103975301B (en) The method for carrying out Event Service to local client computer application by home server
JP2007151109A (en) Multiplex object transmission protocol support method and its device
CN104427000A (en) Communication system with transport link mechanism and method of operation thereof
WO2018205557A1 (en) Page logic control method and apparatus, computer apparatus and readable storage medium
CN110659017B (en) External request processing method and related device
WO2014185955A1 (en) Systems and methods for discovering and utilizing wireless communication protocols for accessing services by wi-fi devices
CN108055186B (en) Master-slave processor communication method and device
US20220052962A1 (en) Method and system for changing resource state, terminal, and storage medium
CN102117261A (en) Communication method between inner processors of chip
CN103870318A (en) Non-symmetric-processing multi-core system and network device thereof

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE