Unlock instant, AI-driven research and patent intelligence for your innovation.

A method and system for sending and receiving data

A data sending method and data technology, applied in the field of communication, can solve the problems of poor real-time performance, long program time, and consumption of software systems, and achieve the effect of enhancing real-time performance and easy reuse

Active Publication Date: 2016-11-02
福智易车联网(宁波)有限公司
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The purpose of the embodiments of the present invention is to provide a data transmission method, which aims to solve the problem that when the prior art UART transmits continuous data packets in a query mode, it needs to wait for all characters to be transmitted before the program returns. For a single-task software system, It takes a long time to program, and it is easy to cause poor real-time performance of the software system

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method and system for sending and receiving data
  • A method and system for sending and receiving data
  • A method and system for sending and receiving data

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0057] figure 1 A flow chart showing the implementation of the data sending method provided by Embodiment 1 of the present invention is described in detail as follows:

[0058] In S101, receiving a data sending request from an application;

[0059] In S102, according to the request, the character data to be sent is stored in the sending buffer;

[0060] In S103, return to continue executing the application program, and call the sending interrupt callback function;

[0061] In the embodiment of the present invention, return to continue to execute the application program, and call the sending interrupt callback function at the same time, without waiting for the completion of data transmission before returning to the main application program.

[0062]In the embodiment of the present invention, the hardware automatically turns on the sending function, turns on the sending and sending interrupt, and when a character data is sent, the microcontroller calls the sending interrupt ca...

Embodiment 2

[0083] Figure 5 A flow chart showing the implementation of the data receiving method provided by Embodiment 2 of the present invention is described in detail as follows:

[0084] In S501, when character data is received, a receiving interrupt is generated and the receiving interrupt callback function is called;

[0085] In this embodiment, the single-chip microcomputer receives the data packet by enabling the receiving interrupt callback function.

[0086] In S502, in the receiving callback function, store the received character data into the receiving buffer;

[0087] In S503, in the timing interrupt, parse the character data in the receiving buffer, and process the parsed character data.

[0088] Optionally, the structure of the receiving buffer can be the same as that of the sending buffer, or a different structure. For example, the receiving buffer includes a character array with a length of N, a data push position pointer pushInPos And a data fetch location pointer po...

Embodiment 3

[0109] Figure 8 It shows the structural diagram of the data transmission system provided by the third embodiment of the present invention. For the convenience of description, only the parts related to the embodiment of the present invention are shown. The system can be a software unit, a hardware unit or a software unit built in a single-chip microcomputer. Hard binding unit.

[0110] The system includes:

[0111] a receiving unit 81, configured to receive a data transmission request from an application;

[0112] The storage unit 82 is used to store the character data to be sent into the sending buffer according to the request;

[0113] The calling unit 83 is used to return to continue executing the application program, and call the sending interrupt callback function;

[0114] The sending unit 84 is configured to send the character data in the sending buffer in the sending interrupt callback function.

[0115] Optionally, the sending buffer includes a character array with ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention is applied to the technical field of communication and provides a method and a system for transmitting and receiving data. The method comprises the following steps of receiving a data transmitting request of an application program; according to the request, storing character data to be transmitted into a transmission buffer area; returning to continuously execute the application program and calling a transmission stop calling function; and in the transmission stop calling function, transmitting the character data in the transmission buffer area. By the method and the system, the whole data transmission process is separated from an upper-layer application, so that a large amount of time for waiting a transmission process of hardware is not required, and meanwhile, in a transmission stop service routine of data, a few of commands can also be executed, so that the real-time property of the whole system is not affected, the real-time property of the system is improved, and UART (Universal Asynchronous Receiver / Transmitter) communication which is easy to reuse and clear in layer and receives and transmits a data packet in real time is realized.

Description

technical field [0001] The invention belongs to the technical field of communication, and in particular relates to a data sending and receiving method and system. Background technique [0002] Universal Asynchronous Receiver / Transmitter (UART) is a universal serial data bus for asynchronous communication. The bus bidirectional communication can realize full-duplex data transmission and reception. UART can be used for multiple independent Communication between working hosts, the working principle of asynchronous serial communication is to transmit each character of the transmitted data one by one. Most of the current serial ports are integrated inside the single-chip microcomputer. As a part of the interface of the single-chip microcomputer, most single-chip microcomputers have the function of automatically generating the start, check, and stop bits of the UART. The software program only needs to configure the relevant registers. There is an interrupt generation mechanism fo...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F13/38
Inventor 熊整文王刘强
Owner 福智易车联网(宁波)有限公司