CN107425943A - Message data transmission method and device, electronic equipment and computer storage medium - Google Patents
Message data transmission method and device, electronic equipment and computer storage medium Download PDFInfo
- Publication number
- CN107425943A CN107425943A CN201710775498.2A CN201710775498A CN107425943A CN 107425943 A CN107425943 A CN 107425943A CN 201710775498 A CN201710775498 A CN 201710775498A CN 107425943 A CN107425943 A CN 107425943A
- Authority
- CN
- China
- Prior art keywords
- data packet
- message data
- request data
- packet
- request
- 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
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 57
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000012790 confirmation Methods 0.000 claims abstract description 41
- 238000004891 communication Methods 0.000 claims abstract description 40
- 238000012217 deletion Methods 0.000 claims description 4
- 230000037430 deletion Effects 0.000 claims description 4
- 230000006870 function Effects 0.000 description 10
- 230000004044 response Effects 0.000 description 7
- 230000008569 process Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000012546 transfer Methods 0.000 description 2
- 238000013524 data verification Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/1607—Details of the supervisory signal
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
- G06F13/4286—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using a handshaking protocol, e.g. RS232C link
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Communication Control (AREA)
Abstract
The application provides a message data transmission method, a message data transmission device, electronic equipment and a computer storage medium. The message data transmission method is applied to serial port communication and comprises the following steps: sending a request data packet to opposite terminal equipment through a serial port communication protocol, wherein the request data packet carries mark information so that the opposite terminal equipment can judge whether the request data packet conforms to a preset format according to the mark information and return confirmation information when the request data packet conforms to the preset format; and when receiving the confirmation information returned by the opposite terminal equipment, performing message data operation according to the operation mode in the request data packet. By the message data transmission method and device, the electronic equipment and the computer storage medium, message data can be operated by using serial port communication, and cost is saved.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for transmitting packet data, an electronic device, and a computer storage medium.
Background
The file transfer protocol used in the related art is mostly based on network transmission or USB transmission, however, when a problem occurs in software and the network module and the USB module are not loaded, a user cannot perform operations such as reading and writing on files on the system.
Disclosure of Invention
The application provides a message data transmission method, a message data transmission device, electronic equipment and a computer storage medium. The message data may be manipulated using serial communication.
According to a first aspect of an embodiment of the present application, a method for transmitting message data is provided. The method is applied to serial port communication, and comprises the following steps:
sending a request data packet to opposite terminal equipment through a serial port communication protocol, wherein the request data packet carries mark information so that the opposite terminal equipment can judge whether the request data packet conforms to a preset format according to the mark information and return confirmation information when the request data packet conforms to the preset format; and when receiving the confirmation information returned by the opposite terminal equipment, performing message data operation according to the operation mode in the request data packet.
Further, the first field of the data packet with the predetermined format is used for storing the mark information.
Further, the data packet of the predetermined format further includes a field for describing the operation type.
Further, the data packet of the predetermined format further includes a field for describing a size of the data packet.
Further, the operation mode includes any one of:
a sending mode, configured to send message data to the peer device, so that the peer device receives the message data;
a request mode, configured to send request information to the peer device to request the peer device to send message data, and receive the message data sent by the peer device;
a command mode, configured to send an operation command to the peer device, so that the peer device executes the operation command, and returns an execution result; wherein the operation command comprises at least one of a deletion command, a query command, a copy command and a paste command.
According to a second aspect of the embodiments of the present application, there is provided a message data transmission method applied to serial port communication, the method including:
receiving a request data packet sent by opposite-end equipment through a serial port communication protocol, wherein the request data packet carries mark information; judging whether the request data packet conforms to a preset format or not according to the marking information; and returning confirmation information when the request data packet conforms to the preset format so that the opposite terminal equipment can perform message data operation according to the operation mode in the request data packet.
According to a third aspect of the embodiments of the present application, there is provided a message data transmission device, which is applied to serial port communication, the device including:
a request data packet sending unit, configured to send a request data packet to an opposite-end device through a serial port communication protocol, where the request data packet carries tag information, so that the opposite-end device determines, according to the tag information, whether the request data packet conforms to a predetermined format, and returns a confirmation message when the request data packet conforms to the predetermined format;
a confirmation information receiving unit, configured to receive confirmation information returned by the peer device;
and the message data operation unit is used for performing message data operation according to the operation mode in the request data packet when the confirmation information receiving unit receives the confirmation information returned by the opposite terminal equipment.
According to a fourth aspect of the embodiments of the present application, there is provided a packet data transmission apparatus, which is applied to serial port communication, the apparatus including:
a request data packet receiving unit, configured to receive a request data packet sent by an opposite end device through a serial communication protocol, where the request data packet carries tag information;
the judging unit is used for judging whether the request data packet conforms to a preset format or not according to the marking information;
and the confirmation information returning unit is used for returning confirmation information when the judging unit judges that the predetermined format is met so as to enable the opposite terminal equipment to carry out message data operation according to the operation mode in the request data packet.
According to a fifth aspect of embodiments herein, there is provided an electronic apparatus, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the message data transmission method.
According to a sixth aspect of the embodiments of the present application, there is provided a computer storage medium storing computer-executable instructions for executing the above message data transmission method.
According to the message data transmission method, the message data transmission device, the electronic equipment and the computer storage medium, because the request data packet sent by the local terminal equipment carries the mark information, the opposite terminal equipment can conveniently judge whether the request data packet conforms to the preset format or not according to the mark information. When the format accords with the preset format, the message data operation can be carried out between the local terminal equipment and the opposite terminal equipment. Namely, the message data can be operated by using serial port communication. And moreover, a network card or a USB port is not required to be used for upgrading, and the low-cost serial port is used, so that the cost of some embedded board cards with simple functions can be saved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
Fig. 1 is a flowchart illustrating a message data transmission method according to an embodiment of the present application;
fig. 2 is a flowchart illustrating a message data operation in a sending mode according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a message data operation in a receiving mode according to an embodiment of the present application;
FIG. 4 is a flow chart illustrating a message data operation in a command mode according to an embodiment of the present application;
fig. 5 is a flowchart illustrating a message data transmission method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a message data transmission apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a message data transmission apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
The following describes a message data transmission method according to an embodiment of the present application in detail with reference to the accompanying drawings. The features of the following examples and embodiments may be combined with each other without conflict.
As shown in fig. 1, fig. 1 is a flowchart of a message data transmission method according to an exemplary embodiment of the present application, where the method is applied to serial port communication, and the method includes steps 11 to 13. Wherein,
in step 11, a request packet is sent to the peer device through the serial communication protocol. The request data packet carries the tag information, so that the opposite terminal equipment can judge whether the request data packet conforms to the predetermined format according to the tag information and return the confirmation information when the request data packet conforms to the predetermined format.
In step 12, an acknowledgement message returned by the peer device is received.
In step 13, the message data operation is performed according to the operation mode in the request packet.
In this embodiment of the present application, when a local device needs to perform a packet data operation with an opposite device, a Request packet (Request packet) needs to be sent to the opposite device, where the Request packet is used for a first handshake between the local device and the opposite device. The request data packet is a data packet packaged according to a predetermined format, and the request data packet carries tag information. After the opposite terminal device receives the request data packet sent by the local terminal device, it can judge whether the request data packet conforms to the predetermined format according to the mark information, if the request data packet conforms to the predetermined format, it returns confirmation information, i.e. returns an acknowledgement packet (acknowledgement packet), which is used for responding to the handshake of the request data packet and indicating that the opposite terminal device is ready to be connected with the local terminal device. Then, the home terminal equipment can perform message data operation according to the operation mode in the request data packet.
In an optional embodiment, the operation mode between the local device and the peer device may include any one of the following:
and the sending mode is used for sending the message data to the opposite terminal equipment so as to enable the opposite terminal equipment to receive the message data.
And the request mode is used for sending request information to the opposite terminal equipment to request the opposite terminal equipment to send message data and receiving the message data sent by the opposite terminal equipment.
The command mode is used for sending an operation command to the opposite terminal equipment so that the opposite terminal equipment can execute the operation command and return an execution result; the operation command comprises at least one of a deletion command, a query command, a copy command and a paste command.
In the sending mode, the operation flow of the message data between the local terminal device and the opposite terminal device is as shown in fig. 2.
Referring to fig. 2, first, the local device sends a request packet to the peer device, which is in agreement with the peer device and requires that it prepare to receive a file. After receiving the request data packet, the opposite terminal equipment analyzes and identifies the marking information in the data packet, when the request data packet is judged to be in accordance with the preset format, a response packet is returned to the local terminal equipment, and then the local terminal equipment sends a confirmation packet to the opposite terminal equipment after receiving the response packet, so that the local terminal equipment is ready to send files. And then starts to send the message data packet 1 after waiting for a preset time (e.g. 200 ms). After receiving the packet 1, the opposite terminal device returns a confirmation packet, then the local terminal device sends the packet 2, and after receiving the packet 2, the opposite terminal device returns a confirmation packet. Accordingly, the opposite terminal device returns a confirmation packet after receiving the message data packet sent by the local terminal device each time, and the local terminal device sends the next message data packet after receiving the confirmation packet returned by the opposite terminal device each time. After the file is sent, the local terminal device sends an end packet to notify the opposite terminal device to end the current transmission, and the file transmission is completed.
In the receiving mode, the operation flow of the message data between the local device and the peer device is as shown in fig. 3.
Referring to fig. 3, first, the local device sends a request packet to the peer device to tell the peer device about the files and related settings that the peer device needs to send. When the opposite terminal equipment judges that the request data packet conforms to the preset format, a response packet is returned to the local terminal equipment, and then the local terminal equipment sends a confirmation packet to the opposite terminal equipment to indicate that the local terminal equipment is ready to receive the file. Then, the opposite end device starts to send the message data packet 1, the local end device returns a confirmation packet after receiving the message data packet 1, then the opposite end device sends the message data packet 2, and the local end device returns a confirmation packet after receiving the message data packet 2. In turn, the home terminal equipment returns an acknowledgement packet every time it receives a packet. And the opposite terminal equipment sends the next message data packet after receiving the confirmation packet sent by the local terminal equipment. When the data transmission is finished, the opposite terminal equipment sends an end packet to indicate that the transmission is finished, the local terminal equipment sends the last confirmation packet after receiving the end packet, then the receiving state is finished, and the file transmission is finished.
In the command mode, the message data operation flow between the local device and the peer device is as shown in fig. 4.
Referring to fig. 4, first, the local device sends a request packet to the peer device, and the peer device is requested to execute a command and then returns a result. And after receiving the request data packet, the opposite terminal equipment returns a response packet. Then the local terminal equipment sends a command packet. And the opposite terminal equipment receives the command data packet, analyzes and executes the command in the command data packet. And then, sequentially returning the execution results to the local terminal equipment in the form of a message data packet 1, a message data packet 2 and the like, wherein the local terminal equipment returns a confirmation packet after receiving one message data packet. And when the opposite terminal equipment finishes the operation, sending an end packet, and when the local terminal equipment receives the end packet sent by the opposite terminal equipment, returning to the last confirmation packet, and finishing the command operation. For example, if the content in the command packet received by the peer device is a "ps" character string, the peer device will run ps commands, and then sequentially return the running results to the local device in the form of data packets, so that the local device can obtain the process state of the peer device. It should be noted that the operation command in the embodiment of the present application is not limited to a delete command, an inquiry command, a copy command, or a paste command, and may be applied to all executable commands supported by the peer device in practical applications.
In the embodiment of the application, if an unrecoverable error occurs in the message data operation process, an error data packet is sent, and the local terminal device or the opposite terminal device actively finishes transmission and disconnects the connection after receiving the error data packet.
In the embodiment of the present application, various data packets (including a request data packet, a response packet, an acknowledgement packet, a message data packet, a command packet, an error packet, and the like) sent in a message data operation process all include a common part, which may also be referred to as a header, and the rest may be referred to as a body. The data packets may follow a predetermined format when packed.
In an alternative embodiment, the first field of the predetermined format packet (also referred to as the first field of the header) is used to store the Flag information, such as Flag field, which may be a character string of 8 bytes, and the Flag information may be used as magic word. On one hand, when the opposite terminal equipment receives the data packet, whether the data packet conforms to the preset format can be judged only by checking the first 8 bytes, and the efficiency of message data transmission is improved. On the other hand, the marking information can be changed along with the updating of the version of the serial communication protocol, if the serial communication protocol has a plurality of versions, each version has different marking information, and after the opposite terminal equipment receives the data packet, the version of the serial communication protocol adopted by the local terminal equipment can be confirmed only by checking the marking information, so that communication preparation can be made according to the version of the serial communication protocol adopted by the local terminal equipment, and the expansibility of the serial communication protocol is improved.
In another alternative embodiment, the packet of the predetermined format further includes a field for describing the type of operation. This field may be stored in the packet header, such as the Option Type field, or may be 8 bytes, and may define the operation Type of the packet. The opposite end device may determine the operation type of the data packet sent by the local end device according to the field describing the operation type in the received data packet. Such as request packets, acknowledgement packets, data packets, and the like.
In another alternative embodiment, the data packet with the predetermined format further includes a field for describing the size of the data packet, and the field may also be stored in the packet header, such as a packet Len field, indicating the size of the current data packet.
In the embodiment of the present application, the attribute of the data packet may be defined in the body portion of each data packet. For example, 1, in the packet body of the request packet, may define: a Request Type field for indicating whether a file transfer is in a transmission mode, a reception mode, or a command mode. And a Name field indicating a file Name in the transmission file mode or the reception file mode. An Encode field indicating an encoding format used when transmitting the text file. The Request Option field is an array for storing an extended data segment, such as a maximum packet size, how many packets a file is divided into, etc. 2. The body of the response package can define: the OACK _ Option field is an array for transmitting parameters in response to a request packet when establishing a connection, and can tell the peer device how large a file is to be received. If the opposite terminal device finds that the file is larger than the residual space of the current disk, the transmission can be finished in advance, and the transmission does not need to be finished when the received file cannot be stored, so that the transmission efficiency is submitted, and unnecessary time waste of a user is avoided. 3. The body of the acknowledgement packet may define: a Block field for counting and acknowledging the current packet. For example, when a file is sent, if the receiving end receives a first packet, an acknowledgement packet with block 0 is returned, and if the receiving end receives a second packet, a acknowledgement packet with block 2 is returned, so as to confirm the accuracy of the sequence of the packet. ACK _ Option field, which is used for acknowledging the status of the last received packet, such as: successful reception and verification pass, successful reception but data verification fail, request for retransmission, error at the current acknowledgement end, no data received at that time, request for retransmission, completion of transmission, etc. 4. The body of the packet data packet may be defined as follows: a Block field, a count of the current packet. Size field: the size of the data block is defined. And a Checksum field, which is a data check code and is used for ensuring the correctness of the data. If the check code calculated by the received data packet is different from the check code of the field, it indicates that the data is dirty, and the current data packet needs to be discarded. Data field: defining the data to be transmitted. 5. The body of the command packet may define: a CMD field for transmitting commands. For example, if the peer device is a linux terminal, the home device may fill "ps-aux" strings in the CMD field, and after receiving the Command packet, the peer device directly runs the CMD strings therein, and then sends back the running result in the format of a packet, thereby implementing real-time control of the home device on the peer device. 6. The body of the error packet may define: an Error Code field and an Error Code field, which are used for informing the opposite terminal device of specific errors.
In the embodiment of the application, because the request data packet sent by the local terminal device carries the tag information, the opposite terminal device can conveniently judge whether the request data packet conforms to the predetermined format according to the tag information. When the format accords with the preset format, message data operation can be carried out between the local terminal equipment and the opposite terminal equipment, and functions of updating platform software, transmitting files, refreshing and browsing files and the like are realized. Therefore, the operation of message data can be carried out by using serial port communication, the upgrading can be realized by using a serial port with low cost without using a network card or a USB port, and the cost of some embedded board cards with simple functions can be saved.
As shown in fig. 5, fig. 5 is a message data transmission method applied to serial port communication according to an exemplary embodiment of the present application, where the method includes steps 51 to 54. Wherein,
in step 51, a request data packet sent by the peer device is received through the serial communication protocol, where the request data packet carries the tag information.
The request packet can be regarded as a first handshake between the peer device and the home device.
In step 52, it is determined whether the request packet conforms to the predetermined format according to the tag information.
If yes, go to step 53, otherwise go to step 54.
In step 53, the acknowledgement information is returned for the peer device to perform the message data operation according to the operation mode in the request data packet.
When the request data packet conforms to the predetermined format, an acknowledgement packet (acknowledgement packet) is returned, which is used for responding to the handshake of the request data packet and indicates that the local device is ready to connect with the peer device. And the opposite terminal equipment can conveniently carry out message data operation according to the operation mode in the request data packet.
In step 54, an error message is returned.
In the embodiment of the application, because the request data packet received by the local terminal device carries the tag information, it is convenient to judge whether the request data packet conforms to the predetermined format according to the tag information. And when the format accords with the preset format, returning confirmation information, namely, performing message data operation between the local terminal equipment and the opposite terminal equipment, and realizing the functions of updating platform software, transmitting files, refreshing and browsing files and the like. Therefore, the operation of message data can be carried out by using serial port communication, the upgrading can be realized by using a serial port with low cost without using a network card or a USB port, and the cost of some embedded board cards with simple functions can be saved.
Corresponding to the embodiment of the message data transmission method shown in fig. 1, the present application also provides an embodiment of a message data transmission apparatus. The embodiment of the message data transmission device of the embodiment of the application can be applied to a message data transmission method. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a message data transmission device 60 according to an exemplary embodiment of the present application, where the message data transmission device 60 is applied to serial communication, and the device 60 includes: a request packet transmitting unit 61, an acknowledgement information receiving unit 62 and a message data operating unit 63.
The request packet sending unit 61 is configured to send a request packet to an opposite-end device through a serial communication protocol. The request data packet carries the tag information, so that the opposite terminal equipment can judge whether the request data packet conforms to the predetermined format according to the tag information and return the confirmation information when the request data packet conforms to the predetermined format.
The acknowledgement receiving unit 62 is configured to receive acknowledgement returned by the peer device.
The message data operation unit 63 is configured to perform a message data operation according to an operation mode in the request data packet when the acknowledgment information receiving unit 62 receives acknowledgment information returned by the peer device.
In an alternative embodiment, the first field of the packet in the predetermined format is used to store the tag information.
In an alternative embodiment, the packet of the predetermined format further includes a field for describing the type of operation.
In an alternative embodiment, the packet of the predetermined format further comprises a field for describing the size of the packet.
In an alternative embodiment, the operation mode in the data packet sent by the request data packet sending unit 61 may include any one of the following:
and the sending mode is used for sending the message data to the opposite terminal equipment so as to enable the opposite terminal equipment to receive the message data.
And the request mode is used for sending request information to the opposite terminal equipment to request the opposite terminal equipment to send message data and receiving the message data sent by the opposite terminal equipment.
A command mode, configured to send an operation command to an opposite-end device, so that the opposite-end device processes message data according to the operation command; wherein the operation command comprises at least one of a deletion command, a query command, a copy command and a paste command.
In the embodiment of the present application, because the request data packet sent by the request data packet sending unit 61 carries the tag information, the opposite end device can conveniently determine whether the request data packet conforms to the predetermined format according to the tag information. When the format accords with the preset format, message data operation can be carried out between the local terminal equipment and the opposite terminal equipment, and functions of updating platform software, transmitting files, refreshing and browsing files and the like are realized. Therefore, the operation of message data can be carried out by using serial port communication, the upgrading can be realized by using a serial port with low cost without using a network card or a USB port, and the cost of some embedded board cards with simple functions can be saved.
Corresponding to the embodiment of the message data transmission method shown in fig. 5, the present application also provides an embodiment of a message data transmission apparatus. The message data transmission device of the embodiment of the application can be applied to a message data transmission method. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a message data transmission device 70 according to an exemplary embodiment of the present application, where the message data transmission device 70 is applied to serial communication, and the device 70 includes: a request packet receiving unit 71, a judging unit 72, and an acknowledgement returning unit 73.
The request packet receiving unit 71 is configured to receive a request packet sent by an opposite-end device through a serial communication protocol, where the request packet carries tag information. The judging unit 72 is configured to judge whether the request packet conforms to a predetermined format according to the tag information. The confirmation information returning unit 73 is configured to return confirmation information when the determining unit 72 determines that the request data packet conforms to the predetermined format, so that the peer device performs the message data operation according to the operation mode in the request data packet.
In this embodiment, since the request packet received by the request packet receiving unit 71 carries the tag information, the determining unit 72 may determine whether the request packet conforms to the predetermined format according to the tag information. When the format accords with the preset format, the confirmation information is returned, namely, message data operation can be carried out between the local terminal equipment and the opposite terminal equipment, and the functions of updating platform software, transmitting files, refreshing and browsing files and the like are realized. Therefore, the operation of message data can be carried out by using serial port communication, the upgrading can be realized by using a serial port with low cost without using a network card or a USB port, and the cost of some embedded board cards with simple functions can be saved.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The embodiment of the present application further provides an electronic device 80, and refer to fig. 8.
The electronic device 80 includes at least one processor 81 (illustrated in fig. 8 as 1 processor for example), and a memory 82 communicatively coupled to the at least one processor.
The memory 82 stores instructions executable by the at least one processor 81, and the instructions are executed by the at least one processor to enable the at least one processor to execute the message data transmission method of the embodiment shown in fig. 1.
The embodiment of the present application further provides a computer storage medium, which stores computer-executable instructions, where the computer-executable instructions are used to execute the message data transmission method in the embodiment shown in fig. 1.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.
Claims (10)
1. A message data transmission method is applied to serial port communication, and the method comprises the following steps:
sending a request data packet to opposite terminal equipment through a serial port communication protocol, wherein the request data packet carries mark information so that the opposite terminal equipment can judge whether the request data packet conforms to a preset format according to the mark information and return confirmation information when the request data packet conforms to the preset format;
and when receiving the confirmation information returned by the opposite terminal equipment, performing message data operation according to the operation mode in the request data packet.
2. The method of claim 1, wherein the first field of the predetermined format packet is used to store the tag information.
3. The method of claim 1, wherein the packet of the predetermined format further comprises a field for describing a type of operation.
4. The method of claim 1, wherein the packet of the predetermined format further comprises a field for describing a size of the packet.
5. The method of claim 3, wherein the operational mode comprises any one of:
a sending mode, configured to send message data to the peer device, so that the peer device receives the message data;
a request mode, configured to send request information to the peer device to request the peer device to send message data, and receive the message data sent by the peer device;
a command mode, configured to send an operation command to the peer device, so that the peer device executes the operation command, and returns an execution result; wherein the operation command comprises at least one of a deletion command, a query command, a copy command and a paste command.
6. A message data transmission method is applied to serial port communication, and the method comprises the following steps:
receiving a request data packet sent by opposite-end equipment through a serial port communication protocol, wherein the request data packet carries mark information;
judging whether the request data packet conforms to a preset format or not according to the marking information; and
and returning confirmation information when the request data packet conforms to the preset format so that the opposite terminal equipment can perform message data operation according to the operation mode in the request data packet.
7. A message data transmission device is applied to serial port communication, and the device comprises:
a request data packet sending unit, configured to send a request data packet to an opposite-end device through a serial port communication protocol, where the request data packet carries tag information, so that the opposite-end device determines, according to the tag information, whether the request data packet conforms to a predetermined format, and returns a confirmation message when the request data packet conforms to the predetermined format;
a confirmation information receiving unit, configured to receive confirmation information returned by the peer device;
and the message data operation unit is used for performing message data operation according to the operation mode in the request data packet when the confirmation information receiving unit receives the confirmation information returned by the opposite terminal equipment.
8. A message data transmission device is applied to serial port communication, and the device comprises:
a request data packet receiving unit, configured to receive a request data packet sent by an opposite end device through a serial communication protocol, where the request data packet carries tag information;
the judging unit is used for judging whether the request data packet conforms to a preset format or not according to the marking information;
and the confirmation information returning unit is used for returning confirmation information when the judging unit judges that the request data packet conforms to the preset format so as to enable the opposite terminal equipment to carry out message data operation according to the operation mode in the request data packet.
9. An electronic device, comprising: at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the message data transmission method of any one of claims 1 to 5.
10. A computer storage medium having stored thereon computer-executable instructions for performing the message data transmission method of any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710775498.2A CN107425943A (en) | 2017-08-31 | 2017-08-31 | Message data transmission method and device, electronic equipment and computer storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710775498.2A CN107425943A (en) | 2017-08-31 | 2017-08-31 | Message data transmission method and device, electronic equipment and computer storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107425943A true CN107425943A (en) | 2017-12-01 |
Family
ID=60435533
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710775498.2A Pending CN107425943A (en) | 2017-08-31 | 2017-08-31 | Message data transmission method and device, electronic equipment and computer storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107425943A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108322443A (en) * | 2017-12-30 | 2018-07-24 | 京信通信系统(中国)有限公司 | Equipment interactive communication method, apparatus, storage medium and computer equipment |
CN108877181A (en) * | 2018-07-18 | 2018-11-23 | 深圳市茁壮网络股份有限公司 | Seeking for remote controller method, remote controler and electronic equipment |
CN110231798A (en) * | 2019-05-21 | 2019-09-13 | 上海航天设备制造总厂有限公司 | Communication Interaction Response Mechanism Between Human-Computer Interface and Programmable Logic Controller |
CN110244604A (en) * | 2019-05-29 | 2019-09-17 | 北京大豪科技股份有限公司 | Data transmission method, device, electronic equipment and storage medium |
CN110647490A (en) * | 2019-10-22 | 2020-01-03 | 深圳市康冠智能科技有限公司 | Data transmission method, device, equipment and computer storage medium |
CN110875799A (en) * | 2018-09-04 | 2020-03-10 | 华为技术有限公司 | Transmission control method and device |
CN111246519A (en) * | 2020-01-16 | 2020-06-05 | 杭州涂鸦信息技术有限公司 | Zigbee data transmission method, system and device |
CN111586154A (en) * | 2020-04-30 | 2020-08-25 | 北京百度网讯科技有限公司 | Data storage method, device, equipment and storage medium based on transmission channel |
CN111935243A (en) * | 2020-07-17 | 2020-11-13 | 杭州海康机器人技术有限公司 | Data information transmission method, device, system and equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101031037A (en) * | 2007-03-28 | 2007-09-05 | 深圳创维-Rgb电子有限公司 | Circuit device for repeating on-line programm |
CN101409727A (en) * | 2008-11-24 | 2009-04-15 | 株洲南车时代电气股份有限公司 | Document transmission method and apparatus |
CN102098131A (en) * | 2009-12-15 | 2011-06-15 | 航天科工惯性技术有限公司 | Dynamic parameter configuration-based general framing and de-framing method for serial port data frames |
CN103051716A (en) * | 2012-12-25 | 2013-04-17 | 中标软件有限公司 | Method and system for redirecting network-oriented serial device |
US20140016538A1 (en) * | 2012-07-13 | 2014-01-16 | Canon Kabushiki Kaisha | Time sensitive transaction over an asynchronous serial link |
-
2017
- 2017-08-31 CN CN201710775498.2A patent/CN107425943A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101031037A (en) * | 2007-03-28 | 2007-09-05 | 深圳创维-Rgb电子有限公司 | Circuit device for repeating on-line programm |
CN101409727A (en) * | 2008-11-24 | 2009-04-15 | 株洲南车时代电气股份有限公司 | Document transmission method and apparatus |
CN102098131A (en) * | 2009-12-15 | 2011-06-15 | 航天科工惯性技术有限公司 | Dynamic parameter configuration-based general framing and de-framing method for serial port data frames |
US20140016538A1 (en) * | 2012-07-13 | 2014-01-16 | Canon Kabushiki Kaisha | Time sensitive transaction over an asynchronous serial link |
CN103051716A (en) * | 2012-12-25 | 2013-04-17 | 中标软件有限公司 | Method and system for redirecting network-oriented serial device |
Non-Patent Citations (2)
Title |
---|
王承君: "自定义串口数据通信协议的分析与设计", 《计算机工程》 * |
陈荔 等: "基于串口自定义协议传输文件的设计", 《计算机技术与发展》 * |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108322443A (en) * | 2017-12-30 | 2018-07-24 | 京信通信系统(中国)有限公司 | Equipment interactive communication method, apparatus, storage medium and computer equipment |
CN108877181A (en) * | 2018-07-18 | 2018-11-23 | 深圳市茁壮网络股份有限公司 | Seeking for remote controller method, remote controler and electronic equipment |
CN110875799A (en) * | 2018-09-04 | 2020-03-10 | 华为技术有限公司 | Transmission control method and device |
US11477130B2 (en) | 2018-09-04 | 2022-10-18 | Huawei Technologies Co., Ltd. | Transmission control method and apparatus |
CN110875799B (en) * | 2018-09-04 | 2023-07-07 | 华为技术有限公司 | Transmission control method and device |
CN110231798A (en) * | 2019-05-21 | 2019-09-13 | 上海航天设备制造总厂有限公司 | Communication Interaction Response Mechanism Between Human-Computer Interface and Programmable Logic Controller |
CN110244604A (en) * | 2019-05-29 | 2019-09-17 | 北京大豪科技股份有限公司 | Data transmission method, device, electronic equipment and storage medium |
CN110647490A (en) * | 2019-10-22 | 2020-01-03 | 深圳市康冠智能科技有限公司 | Data transmission method, device, equipment and computer storage medium |
CN111246519A (en) * | 2020-01-16 | 2020-06-05 | 杭州涂鸦信息技术有限公司 | Zigbee data transmission method, system and device |
CN111586154A (en) * | 2020-04-30 | 2020-08-25 | 北京百度网讯科技有限公司 | Data storage method, device, equipment and storage medium based on transmission channel |
CN111586154B (en) * | 2020-04-30 | 2022-08-05 | 北京百度网讯科技有限公司 | Data storage method, device, equipment and storage medium based on transmission channel |
CN111935243A (en) * | 2020-07-17 | 2020-11-13 | 杭州海康机器人技术有限公司 | Data information transmission method, device, system and equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107425943A (en) | Message data transmission method and device, electronic equipment and computer storage medium | |
CN107835040B (en) | Data communication method, equipment and storage medium based on Bluetooth | |
CN106843942B (en) | Wearable device and firmware upgrading method thereof | |
CN102281121B (en) | Method, equipment and system for transmitting and verifying data file | |
CN106155734B (en) | Method and device for downloading software version | |
CN112822260B (en) | File transmission method and device, electronic equipment and storage medium | |
CN104468843A (en) | File uploading method and device | |
CN111897585A (en) | Linux-based multi-hardware adaptation method | |
CN112000355A (en) | Method and device for firmware upgrading and household appliance | |
CN101807155A (en) | Embedded software on-line updating method | |
CN107908417B (en) | Firmware upgrading method and electronic equipment | |
CN105978937A (en) | Bluetooth slave device and upgrade method thereof | |
EP3764576A1 (en) | System and method for implementing a hybrid automatic repeat request process | |
CN112560529A (en) | Binding method and system based on two-dimensional code | |
CN106302604B (en) | Data transmission method and device | |
CN103731424B (en) | A kind of transmission method of network data, apparatus and system | |
CN110134423A (en) | Update method, device and the computer readable storage medium of firmware | |
CN116466986B (en) | Equipment software upgrading method and device of energy storage system, communication module and medium | |
CN101197959B (en) | Terminal control method, system and equipment | |
CN118012351A (en) | Data read-write order keeping method and device based on remote storage protocol, electronic equipment and storage medium | |
CN116483409A (en) | Remote firmware updating method, system, electronic equipment and storage medium | |
CN114579166B (en) | Component module upgrade method, component module and financial robot | |
JP6568998B2 (en) | Terminal arrangement management method and device | |
CN104253900A (en) | Smart phone and data transmission method and data transmission system thereof | |
CN114866530A (en) | Method and apparatus for downloading upgrade data package, and computer storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171201 |