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

Real-time receiving and transmitting method and device based on Linux platform and storage medium

A real-time receiving and platform technology, applied in the direction of bus network, data exchange through path configuration, etc., can solve the problems of needing to modify the driver, heavy workload to modify the driver, and heavy workload.

Active Publication Date: 2019-05-21
ZHUHAI PILOT TECH
View PDF10 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0009] In order to overcome the deficiencies of the prior art, one of the purposes of the present invention is to provide a real-time transceiver method based on the Linux platform, which can solve the technical problems of the prior art with a large workload and the need to modify the driver
[0010] The second object of the present invention is to provide an electronic device, which can solve the technical problems of heavy workload and need to modify the drive in the prior art
[0011] The third object of the present invention is to provide a computer-readable storage medium, which can solve the technical problems of heavy workload and need to modify the driver in the prior art

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
  • Real-time receiving and transmitting method and device based on Linux platform and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0038] The invention provides a real-time sending and receiving method based on a Linux platform, and relates to an electric meter product realized by using a LINUX operating system, and a device for collecting and transmitting data through a serial port RS485.

[0039] The MODBUS RTU protocol specification is an industry standard (De facto) for communication protocols in the industrial field, and is now a common connection method between industrial electronic devices. The main reasons why Modbus is more widely used than other communication protocols are: public publication and no copyright requirements, easy deployment and maintenance; Modbus RTU In data acquisition and supervisory control systems (SCADA), Modbus is usually used to connect monitoring computers and remote terminals Control system (RTU).

[0040] Such as figure 1 As shown, the real-time transceiving method based on Linux platform of the present invention comprises the steps:

[0041] S1: Set the current threa...

Embodiment 2

[0052] Embodiment 2 discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the following steps are implemented:

[0053] Setting step: set the current thread as the state of receiving data in real time, and set the state of receiving data in real time as the highest priority; detection step: detect whether the serial port device has collected data, if so, execute the judgment step, otherwise judge whether it is in the preset Collect the data within the waiting time, if so, execute the judgment step, otherwise re-detect the serial port device; judgment step: judge whether the frame length of the collected data meets the preset byte, if so, execute the matching step, otherwise , continue to collect the remaining bytes of the data; matching step: match each component in the frame format of the data with the corresponding information in the ...

Embodiment 3

[0056] Embodiment 3 discloses a readable computer storage medium, which is used to store a program, and when the program is executed by a processor, the real-time sending and receiving method of Embodiment 1 is realized.

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 discloses a real-time receiving and transmitting method based on a Linux platform. The method comprises the following steps: setting the current thread to be in a real-time data receiving state; when the serial port device collects data, if the frame format of the data satisfies the preset byte, executing judgment on whether the data satisfies the preset byte, respectively matching each component in the frame format of the data with corresponding information in a cache under the condition that the data satisfies the preset byte, receiving the data when each component is consistent with the corresponding information in the cache, otherwise, discarding the data and emptying the cache; If the preset bytes are not met, whether the data are collected within the preset waiting timeor not is judged, if yes, whether the preset bytes are met or not is judged, and if not, the serial port equipment is detected again; Functional modular design of a protocol is realized in a user state, and dependence on hardware serial port driving is avoided; Rapid transplanting appeals across hardware platforms are achieved, the transplanting workload can be reduced, and risks caused by drivermodification can be avoided.

Description

technical field [0001] The invention relates to the technical field of data sending and receiving, in particular to a real-time sending and receiving method, equipment and storage medium based on a Linux platform. Background technique [0002] At present, with the development of the power electronics industry, the product functions are becoming more and more complex, the LINUX-based operating system platform is more and more widely used, the product hardware is constantly updated, and the product application function porting activities are becoming more and more frequent. [0003] Linux is a non-real-time system. The rs485 driver provided by linux adopts a simple delay flow control algorithm. In the field of data acquisition, MODBUS RTU protocol communication needs to be implemented, and the delay time is too long or not real-time, which causes the slave The device cannot split MODBUS RTU protocol data packets, resulting in data loss. [0004] The current solutions are all ...

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
IPC IPC(8): H04L12/40
Inventor 范竞昭郭玉娟张民恕彭洁
Owner ZHUHAI PILOT TECH