CN104219004A - Electronic device and data processing method and device thereof - Google Patents

Electronic device and data processing method and device thereof Download PDF

Info

Publication number
CN104219004A
CN104219004A CN201310215535.6A CN201310215535A CN104219004A CN 104219004 A CN104219004 A CN 104219004A CN 201310215535 A CN201310215535 A CN 201310215535A CN 104219004 A CN104219004 A CN 104219004A
Authority
CN
China
Prior art keywords
data
uart interface
checking
send
receive
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201310215535.6A
Other languages
Chinese (zh)
Inventor
王阳
高俊娟
杨小伟
陈俊卿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry Co Ltd
Original Assignee
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry Co Ltd
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 Hongfujin Precision Industry Shenzhen Co Ltd, Hon Hai Precision Industry Co Ltd filed Critical Hongfujin Precision Industry Shenzhen Co Ltd
Priority to CN201310215535.6A priority Critical patent/CN104219004A/en
Publication of CN104219004A publication Critical patent/CN104219004A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The data processing method is applied in an electronic device with a UART interface. The data processing method comprises: judging whether the UART interface sends data or receives data; if the UART interface sends data, conducting negation operation on the data to be sent so as to obtain first verification data; controlling the UART interface to send data to be sent and the first verification data to a receiving side according to a preset sending sequence; if the UART interface receives data, identifying data to be received and second verification data according to the preset sending sequence; conducting negation operation on one of the data to be received and second verification data so as to obtain verification data; checking whether the verification data is the identical to the other one of the data to be received and second verification data; and if the verification data is not identical to the other one of the data to be received and second verification data, sending a retransmission instruction to the receiving side.

Description

Electronic installation and data processing method thereof and device
Technical field
The present invention relates to a kind of electronic installation, particularly relate to a kind of there is UART interface electronic installation and UART interface data processing method and device.
Background technology
Existing many electronic installations adopt UART interface and other electronic installation to carry out communication, but this electronic installation does not detect the data of UART interface transmission.When UART interface communication occurs abnormal, will there is exception in the data of UART interface transmission, but electronic installation cannot be learnt, thus can cause cannot normal communication between electronic installation.
Summary of the invention
In view of this, be necessary to provide a kind of data processing method that can detect UART interface data in fact.
In addition, be necessary to provide a kind of data processing equipment that can detect UART interface data in fact.
In addition, be necessary to provide a kind of electronic installation that can detect UART interface data in fact.
This data processing method is applied to be had in the electronic installation of UART interface, the receipt that this electronic installation is sent data to recipient by UART interface and received from transmit leg.This data processing method comprises the steps:
Judge that UART interface sends data and still receives data;
If UART interface sends data, carry out negate computing by needing the data sent and obtain the first checking data;
Control UART interface according to preset sending order send need send data and the first checking data to this recipient;
If UART interface receives data, the sending order preset according to this identifies the data and the second checking data that need to receive;
One in the data needing to receive and the second checking data is carried out negate computing and is verified data;
Whether detection validation data are identical with the another one in the second checking data with the data needing to receive; And
If verification msg and need the data that receive not identical with the another one in the second checking data, then send retransmission instructions to this transmit leg, to retransfer the data of these needs reception to ask this transmit leg.
This data processing equipment is applied in electronic installation, and this electronic installation comprises UART interface and processor, and this processor, when this UART interface sends data to recipient, produces and sends instruction; This processor, when this UART interface receives the data of transmit leg transmission, produces and receives instruction.This data processing equipment comprises judge module, computing module, control device, identification module and detection module.This judge module is used for judging whether UART interface sends data or receive data according to transmission instruction or reception instruction, if UART interface sends data produce operational order, if when UART interface receives data, and generation recognition instruction.This computing module produces the first checking data for responding operational order to needing the data sent to carry out negate.This control device for control UART interface according to preset sending order send these needs send data and this first checking data to this recipient.This identification module is for responding recognition instruction and identify the data and the second checking data that need to receive according to the sending order preset from the data received, and the data received by these needs send to this computing module to be verified data to carry out negate computing with the one in this second checking data.Whether this detection module is used for detection validation data identical with the another one in this second checking data with the data that these needs receive, if verification msg is not identical with the another one in this second checking data with the data that these needs receive, this detection module sends retransmission instructions and resends to ask this transmit leg the data needing reception to this transmit leg.
This electronic installation comprises UART interface and processor, and this processor, when this UART interface sends data to recipient, produces and sends instruction; This processor, when this UART interface receives the data of transmit leg transmission, produces and receives instruction.This electronic installation also comprises data processing equipment.This data processing equipment comprises judge module, computing module, control device, identification module and detection module.This judge module is used for judging whether UART interface sends data or receive data according to transmission instruction or reception instruction, if UART interface sends data produce operational order, if when UART interface receives data, and generation recognition instruction.This computing module produces the first checking data for responding operational order to needing the data sent to carry out negate.This control device for control UART interface according to preset sending order send these needs send data and this first checking data to this recipient.This identification module is for responding recognition instruction and identify the data and the second checking data that need to receive according to the sending order preset from the data received, and the data received by these needs send to this computing module to be verified data to carry out negate computing with the one in this second checking data.Whether this detection module is used for detection validation data identical with the another one in this second checking data with the data that these needs receive, if verification msg is not identical with the another one in this second checking data with the data that these needs receive, this detection module sends retransmission instructions and resends to ask this transmit leg the data needing reception to this transmit leg.
Above-mentioned electronic installation and data processing equipment thereof and method can process the data of UART interface, to make electronic installation when receiving the data of UART interface, can detect the data of UART interface.And when UART interface data occur abnormal, electronic installation can ask transmit leg to resend data, thus the phenomenon that effectively prevent UART interface communication abnormality occurs.
Accompanying drawing explanation
Fig. 1 is the applied environment schematic diagram of the data processing equipment of a better embodiment.
Fig. 2 is the functional block diagram of the data processing equipment of a better embodiment.
Fig. 3 is the data processing method flow chart of a better embodiment.
Main element symbol description
Data processing equipment 10
Electronic installation 100a、100b
Processor 20a、20b
Memory 30a、30b
UART interface 40a、40b
Judge module 11
Computing module 12
Control module 13
Identification module 14
Detection module 15
Step S301~S313
Following embodiment will further illustrate the present invention in conjunction with above-mentioned accompanying drawing.
Embodiment
Please refer to Fig. 1, it illustrates the schematic diagram of the applied environment of data processing equipment 10.In the electronic installation 100a that two data processing equipments 10 are applied to communication respectively and electronic installation 100b.Electronic installation 100a comprises processor 20a, memory 30a and UART interface 40a.Electronic installation 100b comprises processor 20b, memory 30b and UART interface 40b.Electronic installation 100a is communicated with UART interface 40b by UART interface 40a with electronic installation 100b.UART interface 40a and UART interface 40b all comprises the transmission pin TXD for sending data and the reception pin RXD for receiving data.Electronic installation 100a and electronic installation 100b is chip, also can be electronic product, such as, and computer, multimedia player etc.
Please refer to Fig. 2, each data processing equipment 10 comprises judge module 11, computing module 12, control module 13, identification module 14 and detection module 15.Module 11 ~ 15 comprises computer program instructions.These computer program instructions are stored in memory 30a, and processor 20a performs these computer program instructions, provide corresponding data processing function.When detailed description electronic installation 100a sends data to electronic installation 100b and receives the data from electronic installation 100b respectively below, how module 11 ~ 15 provides corresponding data processing capacity.
When electronic installation 100a needs to send data to electronic installation 100b(recipient by UART interface 40a) time, processor 20a produces and sends instruction.When electronic installation 100a needs to receive electronic installation 100b(transmit leg by UART interface 40a) data that send time, processor 20a produces and receives instruction.
Judge module 11 is for the transmission instruction that produces according to processor 20a or receive instruction and judge whether UART interface 40a sends data or receive data.If when judge module 11 judges that UART interface 40a sends data, when namely transmitting pin TXD transmission data, judge module 11 produces operational order.
Computing module 12 obtains the first checking data according to this operational order to needing the data sent to carry out negate computing.Such as, transmission 0000, first checking data is needed to be 1111.
Needs transmission data and the first checking data are sent to electronic installation 100b according to the sending order preset by control module 13 controls transfer pin TXD.In the present embodiment, the sending order preset is first send the data needing to send, rear transmission first checking data.In other embodiments, after also first can sending the first checking data, send the data needing to send, or the first checking data is needing to send between the data sent.
Further, if when judge module 11 judges that UART interface 40a receives data, when namely receiving pin RXD reception data, judge module 11 produces recognition instruction.Understandably, the data that UART interface 40a receives comprise data and second checking data of the reception of electronic installation 100a needs, and this second checking data obtains needing the data received to carry out negate computing.
Identification module 14 identifies the data and the second checking data that need to receive from the data received according to the sending order preset according to this recognition instruction.Understandably, which identification module 14 identifies according to the sequencing of the data from electronic installation 100b is the data needing to receive, and which is the second checking data.
Computing module 12, for the one in the data needing to receive and the second checking data is carried out negate computing, is verified data.Such as, the data if desired received are 0111 and carry out negate computing to the data that needs receive, and verification msg is 1000.If the second checking data is 1110 and carry out negate computing to the second checking data, verification msg is 0001.
Whether detection module 15 is identical with the another one in the second checking data with the data needing to receive for detection validation data.If verification msg is identical with the another one in the second checking data with the data needing to receive, detection module 15 detects that UART interface communication is normal.If verification msg is not identical with the another one in the second checking data with the data needing to receive, detection module 15 judges UART interface communication abnormality, and sends retransmission instructions to electronic installation 100b with the data of asking electronic installation 100b to resend needs reception by transmission pin TXD.
Please refer to Fig. 3, it is the flow chart of data processing method.Data processing method is applied to be had in the electronic installation of UART interface.When UART interface sends data to recipient, electronic installation produces and sends instruction.When UART interface receives the data of transmit leg, electronic installation produces and receives instruction.
Step S301, judges whether UART interface receives data or send data.If UART interface sends data, perform step S303; If UART interface receives data, perform step S307.If UART interface does not send data yet not received data, repeat step S301.
Step S303, carries out negate computing by needing the data sent and obtains checking data.
Step S305, the data needed according to the sending order transmission preset and checking data are to recipient.In present embodiment, preset sending order be first send need send data after send the first checking data.In other embodiments, after also first can sending the first checking data, send the data needing to send, or the first checking data is needing to send between the data sent.
Step S307, from the data received, identify the data and the second checking data that need to receive according to the sending order preset, the data that these needs receive are transmitted by recipient.
Step S309, carries out negate by the one in the data needing to receive and the second checking data, is verified data.
Step S311, whether detection validation data are identical with the another one in the second checking data with the data needing to receive.If verification msg is identical with the another one in the second checking data with the data needing to receive, namely UART interface communication is normal, performs step S313; If verification msg is not identical with the another one in the second checking data with the data needing to receive, i.e. UART interface communication abnormality, flow process terminates.
Step S313, sends retransmission instructions and to retransfer data with request recipient.
Above embodiment is only in order to illustrate technical scheme of the present invention and unrestricted, although with reference to above preferred embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that, can modify to technical scheme of the present invention or equivalent replacement, and not depart from the spirit and scope of technical solution of the present invention.

Claims (9)

1. an electronic installation, it comprises UART interface and processor, and described processor, when described UART interface sends data to recipient, produces and sends instruction; Described processor, when described UART interface receives the data of transmit leg transmission, produces and receives instruction; It is characterized in that: described electronic installation also comprises data processing equipment, described data processing equipment comprises:
Judge module, for judging whether UART interface sends data or receive data according to transmission instruction or reception instruction, if UART interface sends data produce operational order, if when UART interface receives data, generation recognition instruction;
Computing module, produces the first checking data for responding operational order to needing the data sent to carry out negate;
Control device, for control UART interface according to preset sending order send described need send data and described first checking data to described recipient;
Identification module, for responding recognition instruction and identify the data and the second checking data that need to receive according to default sending order from the data received, and the one in the data of reception and described second checking data is needed to send to described computing module to be verified data to carry out negate computing by described;
Detection module, whether identical with the another one in described second checking data with the described data needing to receive for detection validation data, if verification msg is not identical with the another one in described second checking data with the described data needing to receive, described detection module sends retransmission instructions and resends to ask described transmit leg the data needing reception to described transmit leg.
2. electronic installation as claimed in claim 1, is characterized in that: described default sending order is the data first sending needs transmission, rear transmission checking data.
3. electronic installation as claimed in claim 2, is characterized in that: described default sending order is for first to send checking data, and rear transmission needs the data sent.
4. a data processing method, it is applied to has in the electronic installation of UART interface, the receipt that described electronic installation is sent data to recipient by UART interface and received from transmit leg, it is characterized in that: described data processing method comprises the steps:
Judge that UART interface sends data and still receives data;
If UART interface sends data, carry out negate computing by needing the data sent and obtain the first checking data;
Control UART interface according to preset sending order send need send data and the first checking data to described recipient;
If UART interface receives data, identify the data and the second checking data that need to receive according to described default sending order;
One in the data needing to receive and the second checking data is carried out negate computing and is verified data;
Whether detection validation data are identical with the another one in the second checking data with the data needing to receive; And
If verification msg and need the data that receive not identical with the another one in the second checking data, then send retransmission instructions to described transmit leg, to retransfer the described data needing reception to ask described transmit leg.
5. data processing method as claimed in claim 4, is characterized in that: described default sending order is send checking data after the data first sending needs transmission.
6. data processing method as claimed in claim 4, is characterized in that: described default sending order is for first to send checking data, and rear transmission needs the data sent.
7. a data processing equipment, it is applied in electronic installation, and described electronic installation comprises UART interface and processor, and described processor, when described UART interface sends data to recipient, produces and sends instruction; Described processor, when described UART interface receives the data of transmit leg transmission, produces and receives instruction; It is characterized in that: described data processing equipment comprises:
Judge module, for judging whether UART interface sends data or receive data according to transmission instruction or reception instruction, if UART interface sends data produce operational order, if when UART interface receives data, generation recognition instruction;
Computing module, produces the first checking data for responding operational order to needing the data sent to carry out negate;
Control device, for control UART interface according to preset sending order send described need send data and described first checking data to described recipient;
Identification module, for responding recognition instruction and identify the data and the second checking data that need to receive according to default sending order from the data received, and the one in the data of reception and described second checking data is needed to send to described computing module to be verified data to carry out negate computing by described;
Detection module, whether identical with the another one in described second checking data with the described data needing to receive for detection validation data, if verification msg is not identical with the another one in described second checking data with the described data needing to receive, described detection module sends retransmission instructions and resends to ask described transmit leg the data needing reception to described transmit leg.
8. data processing equipment as claimed in claim 7, is characterized in that: described default sending order is the data first sending needs transmission, rear transmission checking data.
9. data processing equipment as claimed in claim 7, is characterized in that: described default sending order is for first to send checking data, and rear transmission needs the data sent.
CN201310215535.6A 2013-06-03 2013-06-03 Electronic device and data processing method and device thereof Pending CN104219004A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310215535.6A CN104219004A (en) 2013-06-03 2013-06-03 Electronic device and data processing method and device thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310215535.6A CN104219004A (en) 2013-06-03 2013-06-03 Electronic device and data processing method and device thereof

Publications (1)

Publication Number Publication Date
CN104219004A true CN104219004A (en) 2014-12-17

Family

ID=52100179

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310215535.6A Pending CN104219004A (en) 2013-06-03 2013-06-03 Electronic device and data processing method and device thereof

Country Status (1)

Country Link
CN (1) CN104219004A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107085507A (en) * 2016-02-16 2017-08-22 三星电子株式会社 Data receiving-transmitting method and device
CN109271099A (en) * 2018-08-22 2019-01-25 郑州云海信息技术有限公司 The method realized the write protection of I2C data with CPLD and read confirmation
CN112416839A (en) * 2020-11-02 2021-02-26 光华临港工程应用技术研发(上海)有限公司 System for realizing UART (universal asynchronous receiver transmitter) communication

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107085507A (en) * 2016-02-16 2017-08-22 三星电子株式会社 Data receiving-transmitting method and device
CN109271099A (en) * 2018-08-22 2019-01-25 郑州云海信息技术有限公司 The method realized the write protection of I2C data with CPLD and read confirmation
CN112416839A (en) * 2020-11-02 2021-02-26 光华临港工程应用技术研发(上海)有限公司 System for realizing UART (universal asynchronous receiver transmitter) communication

Similar Documents

Publication Publication Date Title
CN102546784B (en) Method for conducting batch upgrading for device firmware based on controller area network (CAN) bus
CN102804698B (en) For running the method for bus system, especially CAN
US20160350251A1 (en) Universal serial bus (usb) hub for connecting different port types and method thereof
RU2016117388A (en) METHOD, SYSTEM AND COMPUTER SOFTWARE PRODUCT FOR PREVENTING SPOUPING IN A CAR NETWORK
CN104317765A (en) Serial communication based one-to-many communication system and implementation method
CN105407008A (en) Reconnecting method and system for interrupted TCP (Transmission Control Protocol) connection, terminal and server
CN104917586A (en) Verification method, device and system of transmitted data
CN104065508A (en) Application service health examination method, device and system
CN104219004A (en) Electronic device and data processing method and device thereof
CN105487937A (en) RDMA (Remote Direct Memory Access) implementation method and device
WO2015153915A1 (en) Detecting the orientation of a multimedia link connected to a device
CN103106113A (en) Interrupt event processing method and processing equipment
CN104360973A (en) Communicating system, communicating method and relevant communicating devices
CN104753723A (en) Single board resetting method, device and set of baseband unit
RU2018145653A (en) SYSTEMS AND METHODS FOR INITIALIZING THE CONFIGURATION OF DEVICES WORKING IN INDUSTRIAL AUTOMATION ENVIRONMENTS
CN107994975B (en) Radio frequency data transmission optimization method, radio frequency data transmission equipment and radio frequency receiving end
CN115361236A (en) Data transmission consistency checking method, device, equipment and medium
CN106484441A (en) Controller initial method and the electronic installation of application the method
CN113806273B (en) Fast peripheral component interconnect data transfer control system
US9992034B2 (en) Component multicast protocol
CN101833528A (en) Method for regulating transmission speed of electronic equipment
CN105634692A (en) Data packet transmitting method and receiving method based on UDP protocol
CN102904564B (en) For method and the relevant apparatus of the drive current of adjustment transmission interface
TW201437825A (en) System and method of testing data transmitting performance of computer
CN104579593B (en) Data monitoring system and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20141217