CN107230331B - Wireless data communication method applied to industrial detection - Google Patents

Wireless data communication method applied to industrial detection Download PDF

Info

Publication number
CN107230331B
CN107230331B CN201610167525.3A CN201610167525A CN107230331B CN 107230331 B CN107230331 B CN 107230331B CN 201610167525 A CN201610167525 A CN 201610167525A CN 107230331 B CN107230331 B CN 107230331B
Authority
CN
China
Prior art keywords
data
data block
server
client
mark
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.)
Active
Application number
CN201610167525.3A
Other languages
Chinese (zh)
Other versions
CN107230331A (en
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.)
Baowu Equipment Intelligent Technology Co Ltd
Original Assignee
Shanghai Baosteel Industry Technological Service 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 Shanghai Baosteel Industry Technological Service Co Ltd filed Critical Shanghai Baosteel Industry Technological Service Co Ltd
Priority to CN201610167525.3A priority Critical patent/CN107230331B/en
Publication of CN107230331A publication Critical patent/CN107230331A/en
Application granted granted Critical
Publication of CN107230331B publication Critical patent/CN107230331B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C17/00Arrangements for transmitting signals characterised by the use of a wireless electrical link
    • G08C17/02Arrangements for transmitting signals characterised by the use of a wireless electrical link using a radio link

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a wireless data communication method applied to industrial detection, which is characterized in that a client initiates connection handshake to a server when data communication starts, the client sends a connection request data packet, and the server replies a connection confirmation data packet; the client starts to transmit data to the server after receiving the connection confirmation packet, and the client adopts repeated transmission and the server adopts redundancy confirmation during data transmission; after the data communication is completed, the server initiates disconnection handshake to the client, the server sends a data confirmation packet that all data have been received, the client sends a disconnection data packet to the server after receiving the data confirmation packet, and the server finishes the data communication after receiving the disconnection data packet. The method overcomes the defects of traditional data communication in the industrial production field, ensures accurate and reliable data transmission, improves the industrial production efficiency, and ensures the correct application of the detection data.

Description

Wireless data communication method applied to industrial detection
Technical Field
The invention relates to a wireless data communication method applied to industrial detection.
Background
With the development of scientific technology, data transmission networks, especially wireless networks, are widely used, so that data transmission in industrial detection through wireless networks is preferred by most detection devices. However, most industrial production fields have severe environments, various interferences such as magnetic fields and electric fields exist around the industrial production fields, wireless signals have poor stability, and the accuracy and the reliability of data transmission are seriously affected. Meanwhile, the traditional data communication based on TCP/IP is established based on wired data transmission, the complex handshaking and interaction mechanism of the traditional data communication is easy to generate communication interruption or long-time delay, and particularly in some embedded devices, due to the imperfect realization of a protocol stack, the data communication is not only long in time but also unstable, so that the application of data transmission in industrial production fields is limited.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a wireless data communication method applied to industrial detection, which overcomes the defects of traditional data communication in an industrial production field, ensures accurate and reliable data transmission, improves the industrial production efficiency and ensures the correct application of detection data.
In order to solve the above technical problems, the wireless data communication method applied to industrial detection of the present invention comprises the following steps:
the method comprises the following steps that firstly, a client initiates connection handshake to a server when data communication starts, the client sends a connection request data packet to the server, and the server replies a client connection confirmation data packet;
step two, the client starts to transmit data to the server after receiving the connection confirmation packet of the server, and the client adopts repeated transmission and the server adopts redundant confirmation during data transmission;
and step three, after the data communication is finished, the server initiates disconnection handshake to the client, the server sends all data receiving data confirmation packets to the client, the client sends disconnection data packets to the server after receiving the data confirmation packets, and the server finishes the data communication after receiving the disconnection data packets.
Further, the connection request data packet sent by the client to the server includes the length of the transmission data and the size of the transmission data block, the server establishes a data receiving area and a data block receiving flag area according to the length of the transmission data and the size of the transmission data block, each flag in the data block receiving flag area corresponds to one data block, a flag is not set in the data block receiving flag area, it indicates that the data block corresponding to the flag is not received, and a flag is set in the data block receiving flag area, it indicates that the data block corresponding to the flag has been received.
Further, the connection request data packet sent by the client to the server comprises the length of the transmission data and the size of the transmission data block, the client establishes a data block confirmation mark area according to the length of the transmission data and the size of the transmission data block, each mark in the data block confirmation mark area corresponds to one data block, a data block which is not provided with a mark in the data block confirmation mark area indicates that the data block is not received by the server, and a data block which is provided with a mark in the data block confirmation mark area indicates that the data block is received by the server.
Further, before sending the data block to the server, the client searches for the flag of the data block in the data block acknowledgement flag area, if the flag exists, it indicates that the data block has been received by the server, and does not need to be sent again, if the data block has no flag, it indicates that the data block has not been received by the server and needs to be sent.
Further, the data block sent by the client to the server contains an ID, the ID corresponds to the sequential position of the data block in the transmission data, and the ID is in one-to-one correspondence with the mark of the data block in the data block confirmation mark area.
Further, the data acknowledgement packet sent by the server to the client includes the sequence position ID of the received data block and the redundant acknowledgement flag ID, the sequence position ID is the same as the data block ID sent by the client and corresponds to the flag of the data block in the data block receiving flag area of the server.
Further, after receiving the data confirmation packet sent by the server, the client identifies the flag corresponding to the sent data block ID in the data block confirmation flag area, and identifies the corresponding flag bit according to the redundant confirmation flag ID of the server in the data block.
Further, the redundant acknowledgement flag ID in the data acknowledgement packet sent by the server to the client is related to the sequence position ID, the sequence position ID in the data acknowledgement packet is 100, which indicates that the server receives the data block with the ID of 100 sent by the client, and the redundant acknowledgement flag ID is composed of the flags of the data block with the ID of 100 in the data block receiving flag area before the data block position.
The wireless data communication method applied to industrial detection adopts the technical scheme that the client initiates connection handshake to the server when data communication starts, the client sends a connection request data packet, and the server replies a connection confirmation data packet; the client starts to transmit data to the server after receiving the connection confirmation packet, and the client adopts repeated transmission and the server adopts redundancy confirmation during data transmission; after the data communication is completed, the server initiates disconnection handshake to the client, the server sends a data confirmation packet that all data have been received, the client sends a disconnection data packet to the server after receiving the data confirmation packet, and the server finishes the data communication after receiving the disconnection data packet. The method overcomes the defects of traditional data communication in the industrial production field, ensures accurate and reliable data transmission, improves the industrial production efficiency, and ensures the correct application of the detection data.
Drawings
The invention is described in further detail below with reference to the following figures and embodiments:
FIG. 1 is a schematic diagram of a wireless data communication method for industrial inspection according to the present invention;
FIG. 2 is a diagram illustrating data transmission in the present method;
fig. 3 is a schematic diagram of identification of a data block sequence position ID and a redundancy confirmation flag ID in the method.
Detailed Description
Embodiment as shown in fig. 1, the wireless data communication method applied to industrial inspection of the present invention includes the following steps:
step one, initiating a connection handshake to a server 2 by a client 1 when data communication starts, wherein the client 1 sends a connection request data packet to the server 2, and the server 2 replies a connection confirmation data packet of the client 1; if the client does not receive the connection confirmation data packet of the server within the set time, the connection handshake can be retried or the connection can be abandoned;
step two, the client 1 starts to transmit data to the server 2 after receiving the connection confirmation packet of the server 2, and the client 1 adopts repeated transmission and the server 2 adopts redundant confirmation during data transmission;
step three, after the data communication is completed, the server 2 initiates disconnection handshake to the client 1, the server 2 sends all data received data confirmation packets to the client 1, the client 1 sends disconnection data packets to the server 2 after receiving the data confirmation packets, and the server 2 finishes the data communication after receiving the disconnection data packets.
Preferably, the connection request data packet sent by the client to the server includes the length of the transmission data and the size of the transmission data block, the server establishes a data receiving area and a data block receiving flag area according to the length of the transmission data and the size of the transmission data block, each flag in the data block receiving flag area corresponds to one data block, a flag is not set in the data block receiving flag area, it indicates that the data block corresponding to the flag is not received, and a flag is set in the data block receiving flag area, it indicates that the data block corresponding to the flag has been received.
Preferably, the connection request data packet sent by the client to the server includes the length of the transmission data and the size of the transmission data block, the client establishes a data block acknowledgement flag area according to the length of the transmission data and the size of the transmission data block, each flag in the data block acknowledgement flag area corresponds to one data block, a data block without a flag in the data block acknowledgement flag area indicates that the data block is not received by the server, and a data block with a flag in the data block acknowledgement flag area indicates that the data block has been received by the server.
Preferably, before sending the data block to the server, the client searches for the flag of the data block in the data block acknowledgement flag area, if the flag exists, it indicates that the data block has been received by the server, and does not need to be sent again, if the data block has no flag, it indicates that the data block has not been received by the server and needs to be sent.
Preferably, the data block sent by the client to the server contains an ID corresponding to the sequential position of the data block in the transmission data, and the ID is in one-to-one correspondence with the identifier of the data block in the data block identification identifier area.
Preferably, the data acknowledgement packet sent by the server to the client includes the sequence position ID of the received data block and the redundant acknowledgement flag ID, and the sequence position ID is the same as the data block ID sent by the client and corresponds to the flag of the data block in the data block receiving flag area of the server.
Preferably, after receiving the data acknowledgement packet sent by the server, the client identifies the flag corresponding to the sent data block ID in the data block acknowledgement flag field, and identifies the corresponding flag bit according to the redundant acknowledgement flag ID of the server in the data block.
Preferably, the redundant acknowledgement flag ID in the data acknowledgement packet sent by the server to the client is related to the sequence position ID, the sequence position ID in the data acknowledgement packet is 100, which indicates that the server receives the data block with the ID of 100 sent by the client, and the redundant acknowledgement flag ID is composed of the flags of the data block with the ID of 100, which are several data blocks before the data block position in the data block receiving flag area. For example, taking the redundant acknowledgement flag ID as a 32-bit unsigned integer as an example, each bit corresponds to a data block receiving flag indicating whether the data block at the position has been received.
As shown in fig. 2, after the communication connection is established, the client 1 establishes a data block acknowledgement flag area 12 according to the length of the transmission data and the size of the data block transmitted in each data packet, where each flag corresponds to one data block; the server 2 establishes a data block reception flag area 22 according to the transmission data length and the data block size transmitted in each data packet. The client 1 searches the data block without the confirmation mark in the data block confirmation mark area 12, takes out the data block from the data sending area 11, packs the data block and sends the data block to the server 2; meanwhile, the client 1 receives the confirmation data packet sent from the server 2, extracts the current data block sequence position ID and the redundancy confirmation ID from the confirmation data packet, and sets a confirmation mark at the corresponding position of the data block confirmation mark area 12; the server 2 receives the data packet sent by the client 1, extracts the data block ID, searches whether the data block is received in the data block receiving mark area 22 according to the ID, if the data block is not received, puts the data block to the corresponding position of the data receiving area 21 and sets the received mark in the data block receiving mark area 22; meanwhile, the server 2 sends a confirmation packet of the current data block to the client 1, wherein the confirmation packet not only contains the ID of the current data block, but also contains the identification of whether a plurality of data blocks before the current data block have been received. When the server 2 checks the block reception flag area 22 to confirm that all the blocks have been received, it transmits all the data-received packets to the client 1. After the client 1 finishes sending all data blocks, the data block acknowledgement flag area 12 is checked, the data blocks without data acknowledgement marks are retransmitted, and the repeated sending times are set or the data blocks are stopped until all data sent by the server 2 are received and acknowledged data packets are received.
As shown in fig. 3, the sequential position ID of the data block in the data block acknowledgement flag area 12 corresponds to the sequential position ID of the data block in the data block receiving flag area 22 one by one, and meanwhile, the redundant acknowledgement flag ID in the data acknowledgement packet of the server is composed of the sequential position ID of the data block and the flags of the data blocks before the data block position to provide the identification of whether the data blocks before the current data block have been received.
The method can reliably carry out data communication and effectively improve the efficiency of data communication through practical application tests, and the efficiency can be improved by tens of times in a wireless environment compared with the efficiency of a traditional data communication mode based on TCP/IP, thereby ensuring accurate and reliable transmission of industrial detection data, improving the industrial production efficiency and ensuring correct application of the detection data.

Claims (6)

1. A wireless data communication method applied to industrial detection comprises the following steps: the method is characterized by comprising the following steps:
the method comprises the following steps that firstly, a client initiates connection handshake to a server when data communication starts, the client sends a connection request data packet to the server, and the server replies a client connection confirmation data packet;
step two, the client starts to transmit data to the server after receiving the connection confirmation packet of the server, and the client adopts repeated transmission and the server adopts redundant confirmation during data transmission;
after the data communication is completed, the server initiates disconnection handshake to the client, the server sends all data receiving data confirmation packets to the client, the client sends disconnection data packets to the server after receiving the data confirmation packets, and the server finishes the data communication after receiving the disconnection data packets;
the method comprises the steps that a connection request data packet sent by a client to a server comprises the length of transmission data and the size of a transmission data block, the server establishes a data receiving area and a data block receiving mark area according to the length of the transmission data and the size of the transmission data block, each mark in the data block receiving mark area corresponds to one data block, a mark is not set in the data block receiving mark area, the data block corresponding to the mark is not received, and a mark is set in the data block receiving mark area, so that the data block corresponding to the mark is received;
the client establishes a data block confirmation mark area according to the length of the transmission data and the size of the transmission data block, each mark in the data block confirmation mark area corresponds to one data block, a data block without a mark in the data block confirmation mark area indicates that the data block is not received by the server, and a data block with a mark in the data block confirmation mark area indicates that the data block is received by the server.
2. The wireless data communication method for industrial inspection as claimed in claim 1: the method is characterized in that: before sending the data block to the server, the client searches the mark of the data block in the data block confirmation mark area, if the mark exists, the data block is received by the server, and does not need to be sent again, if the data block has no mark, the data block is not received by the server and needs to be sent.
3. The wireless data communication method for industrial inspection according to claim 1 or 2: the method is characterized in that: the data block sent by the client to the server contains an ID, the ID corresponds to the sequential position of the data block in the transmission data, and the ID is in one-to-one correspondence with the mark of the data block in the data block confirmation mark area.
4. The wireless data communication method for industrial inspection according to claim 3: the method is characterized in that: the data confirmation packet sent by the server to the client contains the sequence position ID and the redundancy confirmation mark ID of the received data block, wherein the sequence position ID is the same as the data block ID sent by the client and corresponds to the mark of the data block in the data block receiving mark area of the server one by one.
5. The wireless data communication method for industrial inspection according to claim 4: the method is characterized in that: after receiving the data confirmation packet sent by the server, the client identifies the mark corresponding to the sent data block ID in the data block confirmation mark area, and identifies the corresponding mark bit according to the redundant confirmation mark ID of the server in the data block.
6. The wireless data communication method for industrial inspection according to claim 4: the method is characterized in that: the redundant confirmation mark ID in the data confirmation packet sent by the server to the client is related to the sequence position ID, the sequence position ID in the data confirmation packet is 100, the sequence position ID indicates that the server receives the data block with the ID of 100 sent by the client, and the redundant confirmation mark ID is composed of marks of a plurality of data blocks before the data block position in the data block receiving mark area, wherein the data block with the ID of 100.
CN201610167525.3A 2016-03-23 2016-03-23 Wireless data communication method applied to industrial detection Active CN107230331B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610167525.3A CN107230331B (en) 2016-03-23 2016-03-23 Wireless data communication method applied to industrial detection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610167525.3A CN107230331B (en) 2016-03-23 2016-03-23 Wireless data communication method applied to industrial detection

Publications (2)

Publication Number Publication Date
CN107230331A CN107230331A (en) 2017-10-03
CN107230331B true CN107230331B (en) 2020-12-04

Family

ID=59932733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610167525.3A Active CN107230331B (en) 2016-03-23 2016-03-23 Wireless data communication method applied to industrial detection

Country Status (1)

Country Link
CN (1) CN107230331B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109718529A (en) * 2018-12-05 2019-05-07 深圳市广和通无线股份有限公司 Sideline judge's flagpole and its method for carrying out information interchange

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101202604B (en) * 2007-08-14 2011-03-30 深圳市同洲电子股份有限公司 Method for transmitting network data
CN101227486B (en) * 2008-02-03 2010-11-17 浙江大学 Transport protocols suitable for multiprocessor network on chip
CN103209195A (en) * 2012-01-11 2013-07-17 国家电网公司 Data acquisition method, terminal and far-end device
KR101467414B1 (en) * 2013-01-11 2014-12-10 주식회사 엘지유플러스 Method of transmitting data in wireless communication system and apparatus thereof
CN104967497B (en) * 2015-06-09 2019-04-12 武汉数字派特科技有限公司 A kind of reliable data transmission method and upgrade method based on network communication protocol
CN105120439B (en) * 2015-07-13 2018-11-23 宁波尚为信息技术有限公司 Beidou long message communication means

Also Published As

Publication number Publication date
CN107230331A (en) 2017-10-03

Similar Documents

Publication Publication Date Title
CN102377650B (en) Data transmission processing method, device and system
US10021182B2 (en) Method and apparatus for data synchronization
WO2017190541A1 (en) Dictionary information synchronization method, apparatus and device
CN109217983B (en) Industrial Internet of things operation terminal communication protocol design method
US20180227083A1 (en) Method for updating firmware of low power wide area module
CN108886713B (en) Data transmission method, data receiving equipment and data sending equipment
CN104394234A (en) Multi-window UDP (user datagram protocol) wireless transmission method applied to environment monitoring
CN103856578A (en) Automatic slave station address acquisition method through Modbus RTU and slave station
CN101507318A (en) Radio communication device and method used in mobile communication system
CN107230331B (en) Wireless data communication method applied to industrial detection
JP2016157994A (en) Emergency communication method and emergency communication device
US20160359950A1 (en) Systems and methods for improved trivial file transfer protocol
CN106170949B (en) Fail reciprocity body detecting method, IPsec peer-to-peer and the network equipment
CN103023818A (en) Method and device for media access control forced forwarding of address resolution protocol (ARP) message
MX2021007683A (en) Data retransmission indication and processing method and device.
CN104243107A (en) Data transmission method, device, terminal, server and system
CN113170297A (en) Earphone communication method
CN102447597B (en) Method and device for realizing IP (Internet Protocol) effectiveness detection
CN104506383A (en) Method and system for measuring data processing efficiency of server in TCP (transmission control protocol) transmission
CN113965959A (en) Vehicle-mounted intelligent data connectionless reliable transmission method
KR101376583B1 (en) Apparatus and method for nack configuration in mobile communication system
WO2017040948A1 (en) Enabling time flexibility for block transfer in coap protocol
JP5740280B2 (en) Method for establishing link of radio base station apparatus
CN111506013A (en) P L C device remote data communication implementation method based on virtual serial port
JP2020205484A5 (en)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 3520 Tongji Road, Baoshan District, Shanghai 201900

Patentee after: Baowu equipment Intelligent Technology Co.,Ltd.

Address before: 201900, 335, Pu Pu Road, Shanghai, Baoshan District

Patentee before: SHANGHAI BAOSTEEL INDUSTRY TECHNOLOGICAL SERVICE Co.,Ltd.

CP03 Change of name, title or address