CN106789898B - Remote data transmission terminal, system and coding and decoding method thereof - Google Patents
Remote data transmission terminal, system and coding and decoding method thereof Download PDFInfo
- Publication number
- CN106789898B CN106789898B CN201611033401.2A CN201611033401A CN106789898B CN 106789898 B CN106789898 B CN 106789898B CN 201611033401 A CN201611033401 A CN 201611033401A CN 106789898 B CN106789898 B CN 106789898B
- Authority
- CN
- China
- Prior art keywords
- character
- data
- field
- character string
- line
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L67/025—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Document Processing Apparatus (AREA)
Abstract
The invention relates to the technical field of industrial Internet of things data transmission, in particular to a remote data transmission terminal, a remote data transmission system and encoding and decoding methods thereof. The coding method of the remote data transmission protocol provided by the invention comprises the following steps: and carrying out ASCII (American standard code for information interchange) code conversion on the fields in the coded content line by line, taking 0x01 characters as intervals between every two adjacent fields, taking 0x02 characters as intervals between the fields in each line, and finally forming SelectHelp data for transmission. The coding method of the remote data transmission protocol provided by the invention improves the efficiency of data transmission among systems such as equipment, ERP, MES and the like in the industrial Internet of things.
Description
Technical Field
The invention relates to the technical field of industrial Internet of things data transmission, in particular to a remote data transmission terminal, a remote data transmission system and encoding and decoding methods thereof.
Background
At present, in the field of industrial internet of things, interactive information among systems such as an intelligent terminal, an ERP system, an MES system and a PDM system still adopts data formats such as XML and JSON, and the XML and the JSON mainly have the defects of high data redundancy, incapability of storing special characters, complex escape and fussy, and are not beneficial to the efficient and stable development of the industrial internet of things.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a remote data transmission terminal, a remote data transmission system and a coding and decoding method thereof, and the efficiency of data transmission among systems such as equipment, ERP, MES and the like in the industrial Internet of things is improved.
In a first aspect, the present invention provides an encoding method for a remote data transmission protocol, including: acquiring all fields of a first line of coded content, carrying out ASCII code conversion on the fields according to a sequence from left to right to obtain field character strings corresponding to each field, and forming the field character strings into line character strings of the first line, wherein 0x01 characters are used as intervals between every two adjacent field character strings in the line character strings of the first line, 0x02 characters are arranged at the tail end of the line character strings of the first line, and the line character strings of the first line are used as temporary character strings; and acquiring a next line of fields of the coded content, coding to obtain a next line of line character strings, adding the next line of line character strings to the temporary character strings until the fields of all lines of the coded content are coded, and sending the finally obtained temporary character strings as selectHelp data.
The coding method of the remote data transmission protocol provided by the invention has the advantages of simple coding mode and high transmission rate, can code fields in any form, is suitable for data transmission among equipment in the field of industrial Internet of things, unifies the protocol format of the equipment during data interaction, reduces the access workload, and is beneficial to improving the integration efficiency of the industrial Internet of things system.
Preferably, the ASCII code converting the fields to obtain the field string corresponding to each of the fields includes: carrying out ASCII code conversion on the field to obtain a first character string; if the first character string does not contain 0x01 characters and 0x02 characters, the first character string is taken as a field character string corresponding to the field; if the first character string contains 0x01 characters or 0x02 characters, the field is converted into base64 characters, and the base64 characters are subjected to ASCII code conversion to obtain a field character string corresponding to the field.
In a second aspect, the present invention provides a method for decoding a remote data transmission protocol, including: receiving SelectHelp data; setting the row coordinate and the column coordinate of the storage address to be 0; reading a character in the SelectHelp data, and if the character is not 0x01 and the character is not 0x02, adding the character at the end of a second character string; if the character is 0x01, converting the second character into text data and storing the text data into a storage address, emptying the second character string, and adding 1 to the column coordinate of the storage address; if the character is 0x02, converting the second character string into text data, storing the text data into a storage address, emptying the second character string, adding 1 to the row coordinate of the storage address, and changing the column coordinate of the storage address into 0; and judging whether the character is the last character of the SelectHelp data, and if not, reading the next character in the SelectHelp data and performing character conversion.
The decoding method of the remote data transmission protocol provided by the invention is matched with the coding method in the first aspect, so that the data transmission rate can be improved, the protocol format of the equipment during data interaction is unified, the access workload is reduced, and the integration efficiency of the industrial Internet of things system is improved.
Preferably, the method further comprises the following steps: and judging whether the maximum column coordinates of each row of storage addresses are consistent, and if not, marking the SelectHelp data as invalid data.
In a third aspect, the present invention provides a remote data transmission terminal, including: the system comprises an acquisition interface, a data preprocessing module, a coding module and a communication module; the acquisition interface is used for being connected with a data output interface of the equipment; the data preprocessing module is used for preprocessing the data output by the equipment to obtain coded content; the encoding module is used for acquiring all fields in a first row of encoded content, performing ASCII code conversion on the fields in a left-to-right sequence to obtain field character strings corresponding to each field, and forming all the field character strings into a row character string in the first row, wherein every two adjacent field character strings in the row character string in the first row take 0x01 characters as intervals, the tail of the row character string in the first row is 0x02 characters, and the row character string in the first row is taken as a temporary character string; acquiring a next line of fields of the coding content, coding the next line of fields to obtain a next line of line character strings, adding the next line of line character strings to the temporary character strings until all the lines of fields of the coding content are coded, and sending the finally obtained temporary character strings as selectHelp data; and the communication module is used for sending the SelectHelp data to a remote server.
The remote data transmission terminal provided by the embodiment reduces unnecessary information through reasonable data structure encapsulation, ensures the uniformity of the interface, reduces the trouble of protocol conversion between equipment and a system, and realizes intercommunication and interconnection among a data acquisition system, a field control system and a manufacturing execution system.
Preferably, the acquisition interface comprises at least one of an I/O interface, RS232, RS485, and an ethernet interface.
Preferably, the communication module is a wired communication module or a wireless communication module.
In a fourth aspect, the present invention provides a remote data transmission system, comprising a remote server, at least one remote data transmission terminal described in the third aspect; the remote server comprises a data receiving module, a decoding module and a storage module; the data receiving module is used for receiving SelectHelp data sent by a terminal; the decoding module is used for reading the character in the SelectHelp data, and if the character is not 0x01 and the character is not 0x02, the character is added at the end of a second character string; if the character is 0x01, converting the second character into text data and storing the text data into a storage address, emptying the second character string, and adding 1 to the column coordinate of the storage address; if the character is 0x02, converting the second character string into text data, storing the text data into a storage address, emptying the second character string, adding 1 to the row coordinate of the storage address, and changing the column coordinate of the storage address into 0; judging whether the character is the last character of the SelectHelp data or not, and if not, reading the next character in the SelectHelp data and performing character conversion; the storage module is used for storing the decoded SelectHelp data.
According to the remote data transmission system provided by the invention, the data protocol adopts the SelectHelp format, and the data transmission, transmission and processing efficiency is realized through a Zero ICE or Socket network transmission framework; the format of data exchange among all devices and systems in the industrial Internet of things is unified, the trouble of protocol conversion among the devices and the systems is reduced, and the development of the industrial Internet of things is promoted.
Preferably, the system further comprises a data query module, wherein the data query module is used for searching data related to the instruction input by the user in the storage module and returning a query result to the user.
Preferably, the data query module is configured to search for data in a storage address input by the user in the storage module, or search for data matching a field input by the user in the storage module, and return a query result to the user.
Drawings
Fig. 1 is a flowchart of an encoding method of a remote data transmission protocol according to an embodiment of the present invention;
fig. 2 is a flowchart of a decoding method of a remote data transmission protocol according to an embodiment of the present invention;
fig. 3 is a block diagram of a remote data transmission terminal according to an embodiment of the present invention;
fig. 4 is a block diagram of a remote data transmission system according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and therefore are only examples, and the protection scope of the present invention is not limited thereby.
It is to be noted that, unless otherwise specified, technical or scientific terms used herein shall have the ordinary meaning as understood by those skilled in the art to which the invention pertains.
Example one
As shown in fig. 1, the encoding method of a remote data transmission protocol provided in this embodiment includes:
step S11, acquiring all fields of a first line of coded content, carrying out ASCII code conversion on the fields according to the sequence from left to right to obtain field character strings corresponding to each field, and forming all the field character strings into line character strings of the first line, wherein 0x01 characters are used as intervals between every two adjacent field character strings in the line character strings of the first line, 0x02 characters are arranged at the tail of the line character strings of the first line, and the line character strings of the first line are used as temporary character strings;
and step S12, acquiring the next line of fields of the coded content, coding to obtain the next line of line character strings, adding the next line of line character strings to the temporary character strings until the fields of all lines of the coded content are coded, and sending the finally obtained temporary character strings as SelectHelp data.
In step S12, the method for obtaining the next row character string of the next row by obtaining the next row field of the encoded content and encoding is the same as the method in step S11, and is not described herein again.
The selecthellp data is an aggregate of data queries or data packets, the selecthellp data is organized according to rows and columns, for example, the data in table 1 includes rows and columns, and the specific form of the selecthellp data obtained after conversion is detailed in the following specific steps. Generally, in the field of industrial internet of things, the first row of the SelectHelp data includes names (such as "number", "current temperature", "current location", and "fault number" in table 1), and data corresponding to the respective names (such as "10", "23.4", "a 01", and "11" in table 1) starts from the second row.
In the process of exchanging service data of the industrial ethernet, there are basically no special characters such as 0x01 and 0x02, so the remote data transmission protocol of this embodiment uses 0x01 characters as separators between fields, and uses 0x02 characters to separate rows. Therefore, after the field is converted to ASCII code, the 0x01, 0x02 characters cannot appear. The length and the number of the fields are not limited, the fields can be increased at will without affecting the original data, and the future protocol extension is facilitated.
The protocol frame format of the remote data transmission protocol in this implementation has the following features:
1) coding format
All communication packets are composed of ACSII code characters.
2) The data packets are displayed in rows and columns to form tabular data.
As shown in table 1, the first row shows the specific column names of the data and the second layer begins to represent the values of the specific each row. Wherein, the "number", "current temperature", "current position", "fault number" are the fields of the first row; "10", "23.4", "A01", "11" are fields of the second row.
TABLE 1
Numbering | Current temperature | Current temperature | Fault number |
10 | 23.4 | A01 | 11 |
Taking the data in table 1 as an example, the encoding is performed as follows:
step one, acquiring all fields of a first line of encoded content: "number", "current temperature", "current position", "failure number"; and carrying out ASCII code conversion on the fields in the sequence from left to right to obtain a field character string corresponding to each field, such as: the field string corresponding to the field "number" after conversion is "0 x7f 0x160x 530 xf 7", the field string corresponding to the field "current temperature" after conversion is "0 x5f 0x 530 x 520 x4d 0x6e 0x290x5e 0xa 6", the field string corresponding to the field "current position" after conversion is "0 x5f 0x 530 x 520 x4d 0x4f 0x4d 0x7f 0x6 e", the field string corresponding to the field "fault number" after conversion is "0 x 650 x 450 x 960 x9c 0x 530 xf 7"; the line string that groups all field strings into the first line is "0 x7f 0x160x 530 xf70x01 0x5f 0x53 0x52 0x4d 0x6e 0x29 0x5e 0xa6 0x01 0x5f 0x53 0x52 0x4d 0x4f 0x4d 0x7f 0x6e 0x01 0x65 0x45 0x96 0x9c 0x53 0xf70x02", where every two adjacent field strings are separated by 0x01 characters and the line string ends with 0x02 characters; the line character string of the first line is taken as a temporary character string. Wherein, the 0x01 and 0x02 are underlined to clearly show the positions of the separators 0x01 and 0x02, and there is no format in the actual encoding process.
Step two, all fields of a second line of the encoded content are acquired: "10", "23.4", "A01", "11"; enter fields in left-to-right orderEach corresponding field character string is obtained by line ASCII code conversion, the corresponding field character string after the conversion of the field "10" is "0 x 310 x 30", the corresponding field character string after the conversion of the field "23.4" is "0 x 320 x 330 x2e 0x 34", the corresponding field character string after the conversion of the field "A01" is "0 x 410 x 300 x 31", and the corresponding field character string after the conversion of the field "11" is "0 x 310 x 31"; the line string that groups all field strings into the second line is "0 x 310 x300x01 0x32 0x33 0x2e 0x340x01 0x41 0x30 0x31 0x01 0x31 0x31 0x02", where every two adjacent field strings are separated by 0x01 characters and the line string ends with 0x02 characters; after the line string of the second line is added to the temporary string, a new temporary string of "0 x7f 0x160x 530 xf7 is obtained0x01 0x5f 0x53 0x52 0x4d 0x6e 0x29 0x5e 0xa60x01 0x5f 0x53 0x52 0x4d 0x4f 0x4d 0x7f 0x6e 0x010x65 0x45 0x96 0x9c 0x53 0xf70x020 x31 0x30 0x01 0x32 0x33 0x2e 0x34 0x01 0x41 0x30 0x310x01 0x31 0x31 0x02”。
Since only two rows of data are listed in table 1, the temporary character string obtained in step two is the finally obtained temporary character string, and the finally obtained temporary character string is sent as selecthellp data.
In the actual use process, the data is far more than two lines, and only the fields in the next line of the coded content need to be continuously obtained and coded according to the method until the fields in all the lines are coded, and finally the obtained temporary character string is used as the SelectHelp data to be sent. The encoding manner for each row is similar, and is not described herein again.
The encoding method of the remote data transmission protocol provided by the embodiment has the advantages of simple encoding mode and high transmission rate, can encode fields in any form, is suitable for data transmission among devices in the field of industrial internet of things, unifies protocol formats of the devices during data interaction, reduces access workload, and is beneficial to improving the integration efficiency of the industrial internet of things system.
When the field is converted into ASCII code, in order to prevent the occurrence of 0x01 characters after conversion and collision with the delimiter, special processing needs to be performed on the field, and therefore, a specific process of performing ASCII code conversion on the field to obtain a field character string includes: carrying out ASCII code conversion on the field to obtain a first character string; if the first character string does not contain 0x01 characters and 0x02 characters, the first character string is taken as a field character string of the field; if the field after the ASCII code conversion contains 0x01 characters or 0x02 characters, the field is converted into base64 characters, and the base64 characters are converted into a field character string by the ASCII code conversion.
Example two
Based on the same inventive concept as the encoding method, the present embodiment provides a decoding method of a remote data transmission protocol, as shown in fig. 2, including:
in step S21, SelectHelp data is received.
In step S22, the row coordinate and the column coordinate of the memory address are both set to 0. This is the memory address initialization step.
Step S23, reading the character in the SelectHelp data, and if the character is not 0x01 and the character is not 0x02, storing the character in a second character string; if the character is 0x01, converting the second character string into text data and storing the text data in a storage address, and adding 1 to the column coordinate of the storage address; if the character is 0x02, the second character string is converted into text data and stored in the memory address, the row coordinate of the memory address is added with 1, and the column coordinate of the memory address is changed to 0.
Step S24, judging whether the character is the last character of the SelectHelp data, if not, returning to step S23, reading the next character in the SelectHelp data, and performing character conversion; if the character is the last character, the decoding is finished.
Still taking the data in table 1 as an example, the decoding process is as follows:
the SelectHelp data sent by the receiving encoding end is' 0x7f 0x160x 530 xf70x01 0x5f 0x53 0x52 0x4d 0x6e 0x29 0x5e 0xa60x01 0x5f 0x53 0x52 0x4d 0x4f 0x4d 0x7f 0x6e 0x01 0x65 0x45 0x96 0x9c 0x53 0xf70x020x31 0x30 0x01 0x32 0x33 0x2e 0x340x01 0x41 0x30 0x31 0x01 0x31 0x31 0x02", the coordinates of the memory address at this time are (0, 0).
Reading the first character in the selecthell data as "0 x7 f" instead of 0x01 and 0x02, reading the second character string2 as "0 x7 f", reading the second character "0 x 16", reading string2 as "0 x7f 0x 16", reading the third character "0 x 53", reading string2 as "0 x7f 0x160x 53", reading the fourth character "0 xf 7", reading string2 as "0 x7f 0x160x 530 xf 7", reading the fifth character as "0 x 01", at this time, transcoding the string2 to obtain the text data as "number", storing as the storage address of (0,0) (i.e. the position of the first row in table 1), and adding 1 to the column coordinate of the storage address, at this time, the storage address of (0,1), and string 2. Reading the next character in the selectHelp data continuously, storing the character into string2 until the next '0 x 01' is met, transcoding string2 to '0 x5f 0x 530 x 520 x4d 0x6e 0x290x5e 0xa 6' to obtain the text data as the 'current temperature', storing the text data according to the storage address of (0,1) (namely the position of the first row and the first column in the table 1), adding 1 to the column coordinate of the storage address, wherein the storage address is (0,2) at this moment, and emptying string 2. And continuously reading characters in the SelectHelp data, and obtaining that the text data with the storage address of (0,2) is the current position and the text data with the storage address of (0,3) is the fault number according to the steps. When the read character is "0 x 02", the row coordinate of the storage address is added with 1, and the column coordinate of the storage address is 0, then the storage address is changed to (1, 0) clear string2, so that the contents of the first row are all decoded. Decoding of the second row is performed as described above, eventually reducing all of the contents of table 1.
The decoding method of the remote data transmission protocol provided by the embodiment can improve the data transmission rate by matching with the coding method, unify the protocol format of the devices during data interaction, reduce the access workload and contribute to improving the integration efficiency of the industrial Internet of things system.
In order to detect the integrity of the received protocol, the decoding process further comprises: judging whether the number of the fields in each row is consistent, if not, representing that the data format is invalid, and the specific implementation mode is as follows: and judging whether the maximum column coordinates of the storage addresses of each row are consistent or not, and if not, marking the SelectHelp data as invalid data.
EXAMPLE III
Based on the same inventive concept of the encoding method, the present embodiment further provides a remote data transmission terminal 5, as shown in fig. 3, including: the device comprises an acquisition interface 1, a data preprocessing module 2, a coding module 3 and a communication module 4. The acquisition interface 1 is used for connecting with a data output interface of the equipment. The data preprocessing module 2 is used for preprocessing the data output by the device to obtain the encoded content, and the preprocessing mainly comprises format conversion of the data output by the device to enable the data to meet the requirements of the encoding protocol. The encoding module 3 is configured to obtain all fields in a first row of encoded content, perform ASCII code conversion on the fields in order from left to right to obtain a field character string corresponding to each field, and form all the field character strings into a row character string in the first row, where 0x01 characters are used as intervals between every two adjacent field character strings in the row character string in the first row, 0x02 characters are at the end of the row character string in the first row, and the row character string in the first row is used as a temporary character string; and acquiring a next line of field of the coded content, coding to obtain a next line of line character string, adding the next line of line character string to the temporary character string until all lines of field of the coded content are coded, and sending the finally obtained temporary character string as selectHelp data. The communication module 4 is configured to send the SelectHelp data to the remote server 6.
The remote data transmission terminal 5 provided by this embodiment reduces unnecessary information by reasonable data structure encapsulation, ensures the uniformity of the interface, reduces the trouble of protocol conversion between devices and systems, and realizes the intercommunication and interconnection among the data acquisition system, the field control system, and the manufacturing execution system.
The remote data transmission terminal 5 provided by the embodiment is suitable for the butt joint (CPS) of the information physical system related to the existing industry 4.0, and simultaneously supports the high-efficiency interconnection with the traditional service system, and supports the industries such as automobile parts, chemical engineering, mechanical equipment, electronics, cables, bearings and the like.
The remote data transmission terminal 5 of this embodiment is made of an embedded industrial motherboard, where the embedded industrial motherboard includes a CPU, a memory, and a FLASH memory, the CPU completes coordination control among the modules, and the functions of the data preprocessing module 2 and the encoding module 3 are also realized by programs inside the CPU. Wherein, the acquisition interface 1 comprises an I/O interface, RS232, RS485 and an Ethernet interface so as to be conveniently connected with equipment, instruments, robots and the like with different interfaces. Wherein, the communication module 4 is a wired communication module or a wireless communication module.
Example four
Based on the same inventive concept as the encoding and decoding method, the present embodiment further provides a remote data transmission system, as shown in fig. 4, including a remote server 6 and at least one remote data transmission terminal 5. The remote server 6 comprises a data receiving module 61, a decoding module 62 and a storage module 63.
The data receiving module 61 is configured to receive SelectHelp data sent by the terminal. The data receiving module 61 uses ICE or Socket as a communication interface of the transmission bottom layer.
The decoding module 62 is configured to read a character in the SelectHelp data, and add the character at the end of the second character string if the character is not 0x01 and the character is not 0x 02; if the character is 0x01, converting the second character into text data and storing the text data into a storage address, emptying the second character string, and adding 1 to the column coordinate of the storage address; if the character is 0x02, converting the second character string into text data and storing the text data in a storage address, emptying the second character string, adding 1 to the row coordinate of the storage address, and changing the column coordinate of the storage address into 0; and judging whether the character is the last character of the SelectHelp data, and if not, reading the next character in the SelectHelp data and performing character conversion.
The storage module 63 is configured to store the decoded SelectHelp data.
The remote server 6 further comprises a data query module 64, and the data query module 64 is configured to search the storage module 63 for data related to the instruction input by the user, and return a query result to the user. Specifically, the instruction input by the user may be a storage address, and the data query module 64 searches the storage module 63 for data in the storage address input by the user; the instruction entered by the user may also be a field, and the data query module 64 will look up the data matching the field in the storage module 63.
In the remote data transmission system provided by this embodiment, the data protocol adopts the above SelectHelp data format, and the transmission, transmission and processing efficiency of data is realized through a Zero ICE or Socket network transmission framework; the format of data exchange among all devices and systems in the industrial Internet of things is unified, the trouble of protocol conversion among the devices and the systems is reduced, and the development of the industrial Internet of things is promoted.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present invention, and they should be construed as being included in the following claims and description.
Claims (9)
1. A method for encoding a remote data transmission protocol, comprising:
acquiring all fields of a first line of coded content, carrying out ASCII code conversion on the fields according to a sequence from left to right to obtain field character strings corresponding to each field, and forming the field character strings into line character strings of the first line, wherein 0x01 characters are used as intervals between every two adjacent field character strings in the line character strings of the first line, 0x02 characters are arranged at the tail end of the line character strings of the first line, and the line character strings of the first line are used as temporary character strings;
acquiring a next line of fields of the coding content, coding the next line of fields to obtain a next line of line character strings, adding the next line of line character strings to the temporary character strings until all the lines of fields of the coding content are coded, sending the finally obtained temporary character strings as selectHelp data,
the ASCII code conversion is carried out on the fields to obtain the field character string corresponding to each field, and the method comprises the following steps:
carrying out ASCII code conversion on the field to obtain a first character string;
if the first character string does not contain 0x01 characters and 0x02 characters, the first character string is taken as a field character string corresponding to the field;
if the first character string contains 0x01 characters or 0x02 characters, the field is converted into base64 characters, and the base64 characters are subjected to ASCII code conversion to obtain a field character string corresponding to the field.
2. A method for decoding a remote data transmission protocol, comprising:
receiving SelectHelp data;
setting the row coordinate and the column coordinate of the storage address to be 0;
reading a character in the SelectHelp data, and if the character is not 0x01 and the character is not 0x02, adding the character at the end of a second character string; if the character is 0x01, converting the second character string into text data, storing the text data into a storage address, emptying the second character string, and adding 1 to the column coordinate of the storage address; if the character is 0x02, converting the second character string into text data, storing the text data into a storage address, emptying the second character string, adding 1 to the row coordinate of the storage address, and changing the column coordinate of the storage address into 0;
and judging whether the character is the last character of the SelectHelp data, and if not, reading the next character in the SelectHelp data and performing character conversion.
3. The method of claim 2, further comprising: and judging whether the maximum column coordinates of each row of storage addresses are consistent, and if not, marking the SelectHelp data as invalid data.
4. A remote data transmission terminal, comprising: the system comprises an acquisition interface, a data preprocessing module, a coding module and a communication module;
the acquisition interface is used for being connected with a data output interface of the equipment;
the data preprocessing module is used for preprocessing the data output by the equipment to obtain coded content;
the encoding module is used for acquiring all fields in a first row of encoded content, performing ASCII code conversion on the fields in a left-to-right sequence to obtain field character strings corresponding to each field, and forming all the field character strings into a row character string in the first row, wherein every two adjacent field character strings in the row character string in the first row take 0x01 characters as intervals, the tail of the row character string in the first row is 0x02 characters, and the row character string in the first row is taken as a temporary character string; acquiring a next line of fields of the coding content, coding the next line of fields to obtain a next line of line character strings, adding the next line of line character strings to the temporary character strings until all the lines of fields of the coding content are coded, and sending the finally obtained temporary character strings as selectHelp data; the ASCII code conversion is carried out on the fields to obtain the field character string corresponding to each field, and the method comprises the following steps:
carrying out ASCII code conversion on the field to obtain a first character string;
if the first character string does not contain 0x01 characters and 0x02 characters, the first character string is taken as a field character string corresponding to the field;
if the first character string contains 0x01 characters or 0x02 characters, converting the field into base64 characters, and performing ASCII code conversion on the base64 characters to obtain a field character string corresponding to the field;
and the communication module is used for sending the SelectHelp data to a remote server.
5. The terminal of claim 4, wherein the collection interface comprises at least one of an I/O interface, RS232, RS485, and Ethernet interface.
6. The terminal of claim 4, wherein the communication module is a wired communication module or a wireless communication module.
7. A remote data transmission system comprising a remote server, at least one remote data transmission terminal according to any one of claims 4 to 6;
the remote server comprises a data receiving module, a decoding module and a storage module;
the data receiving module is used for receiving SelectHelp data sent by a terminal;
the decoding module is used for reading the character in the SelectHelp data, and if the character is not 0x01 and the character is not 0x02, the character is added at the end of a second character string; if the character is 0x01, converting the second character string into text data, storing the text data into a storage address, emptying the second character string, and adding 1 to the column coordinate of the storage address; if the character is 0x02, converting the second character string into text data, storing the text data into a storage address, emptying the second character string, adding 1 to the row coordinate of the storage address, and changing the column coordinate of the storage address into 0; judging whether the character is the last character of the SelectHelp data or not, and if not, reading the next character in the SelectHelp data and performing character conversion;
the storage module is used for storing the decoded SelectHelp data.
8. The system of claim 7, further comprising a data query module configured to search the storage module for data related to the instruction input by the user and return a query result to the user.
9. The system according to claim 8, wherein the data query module is configured to search the storage module for data in the storage address entered by the user, or search the storage module for data matching the field entered by the user, and return the query result to the user.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611033401.2A CN106789898B (en) | 2016-11-18 | 2016-11-18 | Remote data transmission terminal, system and coding and decoding method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611033401.2A CN106789898B (en) | 2016-11-18 | 2016-11-18 | Remote data transmission terminal, system and coding and decoding method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106789898A CN106789898A (en) | 2017-05-31 |
CN106789898B true CN106789898B (en) | 2020-01-07 |
Family
ID=58971810
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611033401.2A Active CN106789898B (en) | 2016-11-18 | 2016-11-18 | Remote data transmission terminal, system and coding and decoding method thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106789898B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107809329B (en) * | 2017-10-24 | 2020-06-19 | 黄强 | Method for realizing CPS model of information physical fusion system and model thereof |
CN108183909A (en) * | 2017-12-29 | 2018-06-19 | 深圳市信锐网科技术有限公司 | A kind of LoRa communication means and system |
CN108600293B (en) * | 2018-02-27 | 2021-04-20 | 郑之敏 | Internet of things data storage system and method based on eight-vector kernel technology |
CN109409099B (en) * | 2018-09-03 | 2024-08-23 | 中国平安人寿保险股份有限公司 | Cookie data processing method, device, computer equipment and storage medium |
CN113761283B (en) * | 2020-06-01 | 2023-09-05 | 中移(苏州)软件技术有限公司 | A method, device, device and storage medium for reading XML files |
CN115658653A (en) * | 2022-10-31 | 2023-01-31 | 中国建设银行股份有限公司上海市分行 | Method, apparatus and medium for migrating data files to a target database |
CN117311293B (en) * | 2023-11-27 | 2024-04-02 | 深圳市凌壹科技有限公司 | Industrial main board based on remote management and control method thereof |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1677424A (en) * | 2004-03-31 | 2005-10-05 | 深圳市朗科科技有限公司 | Radio-frequency identifying code encoding and decoding method |
CN101930455A (en) * | 2010-07-30 | 2010-12-29 | 南京莱斯信息技术股份有限公司 | Structured data exchanging method |
CN102681980A (en) * | 2011-03-17 | 2012-09-19 | 珠海全志科技股份有限公司 | Typesetting processing method and device based on original document |
CN106027512A (en) * | 2016-05-16 | 2016-10-12 | 武汉斗鱼网络科技有限公司 | Network protocol format based on visible characters, and encoding and decoding method and system thereof |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105450232A (en) * | 2014-08-28 | 2016-03-30 | 华为技术有限公司 | Encoding method, decoding method, encoding device and decoding device |
-
2016
- 2016-11-18 CN CN201611033401.2A patent/CN106789898B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1677424A (en) * | 2004-03-31 | 2005-10-05 | 深圳市朗科科技有限公司 | Radio-frequency identifying code encoding and decoding method |
CN101930455A (en) * | 2010-07-30 | 2010-12-29 | 南京莱斯信息技术股份有限公司 | Structured data exchanging method |
CN102681980A (en) * | 2011-03-17 | 2012-09-19 | 珠海全志科技股份有限公司 | Typesetting processing method and device based on original document |
CN106027512A (en) * | 2016-05-16 | 2016-10-12 | 武汉斗鱼网络科技有限公司 | Network protocol format based on visible characters, and encoding and decoding method and system thereof |
Also Published As
Publication number | Publication date |
---|---|
CN106789898A (en) | 2017-05-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106789898B (en) | Remote data transmission terminal, system and coding and decoding method thereof | |
CN110933146B (en) | Data conversion method and device and server | |
CN102185901B (en) | Client message conversion method | |
CN109902105A (en) | For the data query system of micro services framework, method, equipment and storage medium | |
CN102043862B (en) | Directional web data extraction method | |
CN109150854B (en) | Dynamic configurable communication protocol conversion system based on XML file | |
CN106339498A (en) | Method, device and system for synchronizing data | |
CN105681285A (en) | Method for obtaining information of heterogeneous industrial signal source | |
CN105224739A (en) | A kind of method and system being applied to the combing of PCB specification | |
CN114827306A (en) | Multi-source heterogeneous industrial protocol message analysis method, system, equipment and medium | |
CN113312539B (en) | Method, device, equipment and medium for providing search service | |
Shu et al. | Novel modbus adaptation method for IoT gateway | |
CN110647550A (en) | Integrated energy system management method, device, equipment and storage medium | |
CN102033959A (en) | Method for transferring objects in distributed calculating system | |
CN111861361B (en) | Intelligent resume pushing system and method | |
CN117131928B (en) | Topology map construction method and device for distribution network core resource asset data | |
CN115941692B (en) | Information identification system, equipment and medium based on master-slave block chain storage mode | |
CN112367199A (en) | Configurable self-adaptive intelligent gateway and configuration method | |
CN115098507B (en) | Storage method and related equipment based on industrial Internet data | |
CN101877005A (en) | A GML Compression Method Based on Document Mode | |
CN105005524A (en) | Design method for cloud service system of monitoring software | |
CN112686594B (en) | Express report data statistics method and device | |
CN101604398B (en) | RFID coding analysis system with combination of software and hardware | |
CN113139012A (en) | Method for processing data by ETL tool engine based on JSON and ETL data processing system | |
CN115062051A (en) | Universal assembly cross-database language query method and system |
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 |