CN112217610A - Data processing method and device, consumer machine, terminal and readable storage medium - Google Patents

Data processing method and device, consumer machine, terminal and readable storage medium Download PDF

Info

Publication number
CN112217610A
CN112217610A CN202010984150.6A CN202010984150A CN112217610A CN 112217610 A CN112217610 A CN 112217610A CN 202010984150 A CN202010984150 A CN 202010984150A CN 112217610 A CN112217610 A CN 112217610A
Authority
CN
China
Prior art keywords
data
response signal
signal data
countdown
consumer
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.)
Granted
Application number
CN202010984150.6A
Other languages
Chinese (zh)
Other versions
CN112217610B (en
Inventor
贺月路
傅观骏
钟水盈
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Heshi Office Equipments Co ltd
Original Assignee
Heshi Office Equipments Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Heshi Office Equipments Co ltd filed Critical Heshi Office Equipments Co ltd
Priority to CN202010984150.6A priority Critical patent/CN112217610B/en
Publication of CN112217610A publication Critical patent/CN112217610A/en
Application granted granted Critical
Publication of CN112217610B publication Critical patent/CN112217610B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements 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/1607Details of the supervisory signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements 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/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • H04L1/188Time-out mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)

Abstract

The invention discloses a data processing method, a data processing device, a consumption machine, a terminal and a readable storage medium; the method is carried out by the interaction of the consumer computer and the terminal, and the data processing method can solve the problem of data loss caused by communication interruption and the like when the consumer computer uploads data; the method sets a countdown for waiting to receive response signal data at the consumer side, so that when the response signal data is not successfully received, the communication can be ended when the countdown for waiting to receive the response signal data is ended; setting a countdown waiting for receiving next data to be sent at a terminal side for receiving the consumer data, so that the communication can be ended when the countdown waiting for receiving the next data to be sent is ended when the next data to be sent is not successfully received; and further, the data uploaded by the consumer computer can be judged not to be successfully uploaded, and the data loss of the consumer computer in the data uploading process is prevented. The invention can be widely applied to the technical field of consumer machines.

Description

Data processing method and device, consumer machine, terminal and readable storage medium
Technical Field
The invention relates to the technical field of consumer machines, in particular to a data processing method, a data processing device, a consumer machine, a terminal and a readable storage medium.
Background
At present, when the consumer computer uploads data, the uploaded data can not be uploaded next time after the uploading is finished. Therefore, when data is uploaded, uploading fails due to self problems or external reasons, and data loss occurs if the data is not processed; that is, when the consumer computer communicates with the upper computer software, the communication is easily interrupted due to a problem (such as the consumer computer going down) or an external problem (such as power failure and network interruption), thereby causing a problem of data loss. For example, when the consumer computer uploads data, the data is not completely transmitted to the upper computer, and the transmission medium is suddenly disconnected; or when the upper computer returns a response signal to the consumption machine, the transmission medium is suddenly disconnected; or when the consumer uploads data or receives a return response signal, the communication is interrupted when the data such as a sudden downtime and the like are not completely uploaded and stored, which causes the problem of data loss.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art. Therefore, the invention provides a data processing method, a data processing device, a consumer machine, a terminal and a readable storage medium.
The technical scheme adopted by the invention is as follows:
a data processing method according to an embodiment of the first aspect of the invention, performed by a consumer machine, comprises the steps of:
sending first target data, and starting countdown of a first preset time length, wherein the first target data is any one of data to be sent, and the first preset time length is the time length for a consumer to wait for receiving response signal data;
if the response signal data is successfully received, deleting the first target data, closing the countdown of the first preset time length, and determining whether the data to be sent still exist;
if the data to be sent exists, sending second target data, starting countdown of a first preset time length, and executing a step of detecting whether response signal data are successfully received, wherein the second target data are the next data to be sent of the first target data;
if the data to be sent does not exist, sending null data, starting countdown with a first preset time length, detecting whether response signal data of the null data are successfully received or not, if the response signal data are successfully received, finishing communication, and if the response signal data are not successfully received, finishing the communication when the countdown with the first preset time length is finished;
and if the response signal data is not successfully received, ending the communication when the countdown of the first preset time length is ended.
Further, according to some embodiments of the present invention, after successfully receiving the response signal data, the method further comprises the following steps:
the consumer machine analyzes the response signal data;
if the analysis is failed, sending analysis failure signal data, deleting the response signal data, and restarting the countdown of the first preset time length;
detecting whether the response signal data is received again successfully or not, if the response signal data is received again successfully, executing a step of analyzing the response signal data, otherwise, ending the communication when the countdown of the first preset time length is ended;
and if the analysis is successful, executing the steps of deleting the first target data, closing the countdown of the first preset time length and determining whether the data is to be sent or not.
Further, according to some embodiments of the invention, the data processing method further comprises:
after receiving returned analysis failure signal data, the consumption machine retransmits first data to be transmitted, wherein the first data to be transmitted is data to be transmitted corresponding to the analysis failure signal data;
and when the consumer machine receives the analysis failure signal data for three times, ending the communication.
A data processing method according to an embodiment of a second aspect of the present invention, executed by a terminal, includes the steps of:
detecting whether the first target data sent by the consumer machine is successfully received;
if the first target data is successfully received, storing the first target data, returning response signal data which are successfully received, and starting countdown of a second preset time length, wherein the second preset time length is a time length for waiting for receiving the next data to be sent;
detecting whether the second target data sent by the consumer machine is successfully received; if the second target data is successfully received, saving the second target data, returning response signal data which is successfully received, and restarting the countdown of the second preset time length; if the second target data is not successfully received, detecting whether the null data sent by the consumption machine is successfully received or not, and if the null data is successfully received, returning response signal data of the null data; if the null data is not successfully received, ending the communication when the countdown of the second preset time length is ended;
and if the first target data is not successfully received, not returning response signal data.
Further, according to some embodiments of the present invention, after the successfully receiving the first target data, the method further includes:
analyzing the first target data;
if the analysis is failed, sending analysis failure signal data, deleting the first target data, and restarting the countdown of a second preset duration;
detecting whether the first target data is received again successfully or not, if the first target data is received again successfully, executing a step of analyzing the first target data, otherwise, ending the communication when the countdown of the second preset time length is ended;
and if the analysis is successful, executing the steps of saving the first target data, returning response signal data which is successfully received, and starting countdown of a second preset time length.
Further, according to some embodiments of the invention, the data processing method further comprises:
after receiving analysis failure signal data sent by a consumer computer, returning first response signal data again, wherein the first response signal data is response signal data corresponding to the analysis failure signal data;
when the analysis failure signal data transmitted by the consumer is received three consecutive times, the communication is ended.
A data processing apparatus according to a third aspect embodiment of the present invention includes:
at least one processor;
at least one memory for storing at least one program;
when the at least one program is executed by the at least one processor, the at least one program causes the at least one processor to implement the data processing method according to the embodiment of the first aspect.
A consumer apparatus according to a fourth aspect embodiment of the invention comprises a data processing apparatus as described in the third aspect embodiment.
A terminal according to an embodiment of a fifth aspect of the present invention includes:
at least one processor;
at least one memory for storing at least one program;
when the at least one program is executed by the at least one processor, the at least one program causes the at least one processor to implement the data processing method according to the embodiment of the second aspect.
A computer-readable storage medium according to an embodiment of the sixth aspect of the present invention has stored thereon a program executable by a processor, which when executed by the processor is configured to implement a data processing method as described in the embodiments of the first and second aspects.
The invention has the beneficial effects that:
the invention can solve the problem of data loss caused by communication interruption and the like when the consumer computer uploads data by providing a data processing method; the method sets a countdown for waiting to receive response signal data at the consumer side, so that when the response signal data is not successfully received, the communication can be ended when the countdown for waiting to receive the response signal data is ended; setting a countdown waiting for receiving next data to be sent at a terminal side for receiving the consumer data, so that the communication can be ended when the countdown waiting for receiving the next data to be sent is ended when the next data to be sent is not successfully received; and further, the data uploaded by the consumer computer can be judged not to be successfully uploaded, and the data loss of the consumer computer in the data uploading process is prevented.
Drawings
FIG. 1 is a flow chart of a data processing method executed by a consumer machine according to an embodiment of the present invention;
fig. 2 is a flowchart of a data processing method executed by a terminal according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a data processing method performed by a consumer machine and a terminal according to an embodiment of the present invention;
FIG. 4 is a block diagram of a data processing apparatus for a consumer machine according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a hardware structure of a terminal according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, it should be understood that the orientation or positional relationship referred to in the description of the orientation, such as the upper, lower, front, rear, left, right, etc., is based on the orientation or positional relationship shown in the drawings, and is only for convenience of description and simplification of description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention.
In the description of the present invention, the meaning of a plurality of means is one or more, and the meaning of a plurality of means is two or more, and larger, smaller, larger, etc. are understood to exclude the essential numbers. If there is a description to first, second, third etc. for the purpose of distinguishing between technical features, it is not intended to indicate or imply relative importance or to implicitly indicate the number of technical features indicated or to implicitly indicate the precedence of technical features indicated.
In the description of the present invention, unless otherwise explicitly limited, terms such as arrangement, installation, connection and the like should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific contents of the technical solutions.
Referring to fig. 1, fig. 1 is a flow chart of a data processing method provided by an embodiment of the present application, which is executed by a consumer machine, and includes, but is not limited to, the following steps:
s1, sending first target data, starting countdown of a first preset time length, wherein the first target data is any one of data to be sent, and the first preset time length is the time length for a consumer to wait for receiving response signal data;
S2A, if response signal data are successfully received, deleting the first target data, closing the countdown of the first preset time length, and determining whether data to be sent still exist;
S2A1, if data to be sent exist, sending second target data, starting countdown of a first preset time length, and executing a step of detecting whether response signal data are successfully received, wherein the second target data are the next data to be sent of the first target data;
S2A2, if data to be sent does not exist, sending null data, starting countdown of a first preset time length, detecting whether response signal data of the null data are successfully received or not, if the response signal data are successfully received, finishing communication, and if the response signal data are not successfully received, finishing the communication when the countdown of the first preset time length is finished;
and S2B, if the response signal data is not successfully received, ending the communication when the countdown of the first preset time length is ended.
Further, in step S2A, after the consumer computer successfully receives the response signal data, the method further includes the following steps:
S2A0, the consumer machine analyzes the response signal data,
S2A0a, if the analysis fails, sending analysis failure signal data, deleting the response signal data, and restarting countdown of a first preset time length;
S2A0a1, detecting whether the response signal data are received again successfully, if the response signal data are received again successfully, executing a step of analyzing the response signal data, otherwise, ending the communication when the countdown of the first preset time length is ended;
S2A0b, if the analysis is successful, executing the steps of deleting the first target data, closing the countdown of the first preset time length, and determining whether data to be sent exist.
Further, the data processing method further comprises:
after receiving returned analysis failure signal data, the consumption machine retransmits first data to be transmitted, wherein the first data to be transmitted is data to be transmitted corresponding to the analysis failure signal data;
and when the consumer machine receives the analysis failure signal data for three times, ending the communication.
Referring to fig. 2, fig. 2 is a flowchart of a data processing method, executed by a terminal and corresponding to a consumer side, according to an embodiment of the present application, and the method includes, but is not limited to, the following steps:
D1. detecting whether the first target data sent by the consumer machine is successfully received;
D1A, if the first target data is successfully received, storing the first target data, returning response signal data which are successfully received, and starting countdown of a second preset time length, wherein the second preset time length is a time length for waiting for receiving the next data to be sent;
D1A1, detecting whether the second target data sent by the consumption machine is successfully received;
D1A1a. if the second target data is successfully received, storing the second target data, returning response signal data which are successfully received, and restarting the countdown of the second preset time length;
D1A1b. if the second target data is not successfully received, detecting whether the empty data sent by the consumption machine is successfully received or not;
D1A1ba. if the null data is successfully received, returning response signal data of the null data;
if the null data is not successfully received, ending the communication when the countdown of the second preset time length is ended;
d1b. if the first target data is not successfully received, no reply signal data is returned.
Further, in the step D1A, if the first target data is successfully received, the method further includes the following steps:
d1a0 parses the first target data,
D1A0a, if the analysis fails, sending analysis failure signal data, deleting the first target data, and restarting countdown of a second preset duration;
D1A0a1, detecting whether the first target data is received again successfully, if the first target data is received again successfully, executing a step of analyzing the first target data, and if not, finishing the communication when the countdown of the second preset time length is finished;
and D1A0b, if the analysis is successful, executing the steps of storing the first target data, returning to the step of receiving the successful response signal data, and starting the countdown of a second preset time length.
Further, the data processing method further comprises:
after receiving analysis failure signal data sent by a consumer computer, returning first response signal data again, wherein the first response signal data is response signal data corresponding to the analysis failure signal data;
when the analysis failure signal data transmitted by the consumer is received three consecutive times, the communication is ended.
In this embodiment, when the consumer machine starts to upload data, the application layer of the consumer machine splits data to be transmitted into packets and transmits the packets through the transmission layer. Each packet data consists of a packet header, data, a CRC check word and a packet tail. The head and tail of the packet are a fixed segment of data; the CRC check word is used to check the packet data. Similarly, the terminal transmits the data to the application layer after the data is successfully received by the transmission layer. The application layer firstly unpacks the received data, judges whether the head and the tail of the packet are correct, judges whether the CRC check is correct and judges whether the format of the data is correct. If the application layer of the terminal unpacks the packet, the packet header, the packet tail, the CRC check and any field data in the data are incorrect, the data are judged to be unpacked failure, namely data transmission error; similarly, when the consumer receives the response signal data returned by the terminal, the application layer of the consumer first unpacks the received response signal data, determines whether the header and the trailer are correct, determines whether the CRC check is correct, and determines whether the format of the data is correct. If the application layer of the consumer machine unpacks the packet, the packet header, the packet tail, the CRC check, and any field data in the data are incorrect, the unpacking is judged to be a failure, that is, a data transmission error.
In this embodiment, without considering the case of data transmission error, it is assumed that the consumer computer can unpack successfully when receiving the response signal data returned by the terminal and the terminal receives the data to be sent by the consumer computer, that is, the packet header, the packet trailer, the CRC check, and any field data in the data are correct, and the flow of the data processing method is specifically as follows:
1. the consumption machine starts to send data to be sent, and after the application layer of the consumption machine sends a packet of data, the consumption machine enters a receiving state and waits for the terminal to return a response signal data packet. And starts a countdown waiting for reception.
(1) If the consumer machine is sending a packet of data, it has not yet been completely transmitted to the terminal, but the transmission medium is suddenly disconnected. At this time, the transmission layer of the terminal stops receiving due to the fact that data cannot be received;
(2) the application layer of the terminal does not return a response signal data packet to the consumer because the application layer does not receive any data sent by the transmission layer;
(3) the transmission layer of the consumer does not receive any data, and the application layer waits for a period of time before the countdown time is over. The application layer judges that the communication is overtime because no data is received, and then the communication is ended;
(4) at this point there is no loss or duplication of data.
2. After the transmission layer of the terminal successfully receives the data sent by the consumer, the data are transmitted to the application layer, the application layer can store the data, at the moment, the application layer of the terminal can send a response signal data packet to the consumer through the transmission layer, then the application layer enters a receiving state, waits for receiving the next packet of data, and starts a countdown waiting for receiving.
(1) If the terminal sends a response signal data packet to the consumer, the transmission medium is suddenly disconnected, the transmission layer of the consumer stops receiving due to no data being received, and the application layer does not receive any data sent by the transmission layer;
(2) after waiting for a period of time, the application layer of the consumer computer judges that the communication is overtime because no response is received, and then the communication is ended;
(3) similarly, the transmission layer of the terminal does not receive the next packet of data sent by the consumer, and after the countdown of the application layer is finished, the communication is judged to be overtime because no data is received, and then the communication is finished;
(4) at this time, the data in the packet exists in the consumer computer and the upper computer at the same time, and repeated data segments appear.
3. After receiving the response signal data packet, the transmission layer of the consumer machine transmits the response signal data packet to the application layer. The application layer cancels the countdown when receiving the response signal packet.
(1) If the consumption machine is down after the transmission layer of the consumption machine receives a packet of response signal data packet or during the receiving process, the consumption machine loses the communication capability, and the communication is directly finished;
(2) the terminal judges that the communication is overtime because no data is received after the countdown of the application layer of the terminal is finished because the transmission layer does not receive the next packet of data sent by the consumer, and then the communication is finished;
(3) at this time, the packet data exists in the consumer computer and the upper computer at the same time, and repeated data segments appear.
4. And after receiving the response signal data packet, the application layer of the consumer machine judges that the terminal has successfully received the last packet of data. Thus, the consuming machine deletes the last packet of data sent from the consuming machine.
(1) If the consumer machine is down after deleting the previous packet of data, the consumer machine directly finishes the communication;
(2) the terminal judges that the communication is overtime because no data is received after the countdown of the application layer of the terminal is finished because the transmission layer does not receive the next packet of data sent by the consumer, and then the communication is finished;
(3) at this point there is no loss or duplication of data.
5. And the application layer of the consumer computer can judge whether data which needs to be sent still exist after receiving the response signal data packet, and if the data which needs to be sent do not exist, the application layer of the consumer computer can send an empty data packet and transmit the empty data packet to the terminal through the transmission layer.
6. And after receiving the empty data packet, the transmission layer of the terminal transmits the empty data packet to the application layer. And the application layer cancels the countdown when receiving the empty data packet, and simultaneously, the application layer of the terminal judges that the data is completely received after receiving the empty data packet, sends a response signal data packet and sends the response signal data packet to the consumer machine through the transmission layer. The application layer then ends the communication.
7. The transmission layer of the consumer machine receives the response signal data packet of the null data packet and then transmits the response signal data packet to the application layer. And when the application layer receives the response signal data packet of the null data packet, the countdown is cancelled, and the communication is ended.
In this embodiment, if a data transmission error is considered, it is assumed that when the consumer receives the response signal data returned by the terminal and the terminal receives the data to be transmitted sent from the consumer, an unpacking failure may occur, that is, a packet header, a packet trailer, a CRC check, and any field data in the data are incorrect in the data packet, and both the unpacking failure and the data transmission error are determined. At this time, the data processing method flow refers to fig. 3, fig. 3 is one of the processing flows of the data processing method according to an embodiment of the present invention, and the flow specifically includes:
1. the consumer machine starts to send data, and after the application layer of the consumer machine sends a packet of data, the consumer machine enters a receiving state, waits for a response packet to be returned, and starts a countdown waiting for receiving.
(1) If the consumer machine is sending this packet of data, it has not yet been completely transmitted to the terminal, but the transmission medium is suddenly disconnected. At this time, the transmission layer of the terminal stops receiving due to the fact that data cannot be received;
(2) the application layer of the terminal does not return a response signal data packet to the consumer because the application layer does not receive any data sent by the transmission layer;
(3) the transmission layer of the consumer does not receive any data, and the application layer waits for a period of time before the countdown time is over. The application layer judges that the communication is overtime because no data is received, and then the communication is ended;
(4) at this point there is no loss or duplication of data.
2. After the transmission layer of the terminal successfully receives the packet data, the packet data is transmitted to the application layer, and the application layer firstly carries out unpacking processing on the received packet data, judges whether the packet head and the packet tail are correct, judges whether CRC (cyclic redundancy check) is correct and judges whether the format of the data is correct.
(1) If the application layer of the terminal unpacks the packet, the packet header, the packet tail, the CRC check and any field data in the data are incorrect, the data are judged to be unpacked failure, namely data transmission error; at this time, the application layer of the terminal discards the received data, and then, the application layer of the terminal sends an analysis failure response packet to the consumer machine through the transport layer. The application layer enters a receiving state, waits for receiving the packet data again, and starts a countdown waiting for receiving;
(2) and after receiving the response packet of the analysis failure, the transmission layer of the consumer machine transmits the response packet to the application layer. And after receiving the analysis failure response packet, the application layer cancels the receiving countdown and then analyzes the analysis failure response packet. After successful analysis, whether three times of failed analysis response packets are received or not is judged, and if not, the data of the packets are retransmitted. If the application layer of the consumer machine recognizes that the analysis failure response packet is received for three times continuously, the transmission failure is judged, and then the communication is ended;
(3) the application layer of the terminal judges that the receiving is overtime because the receiving countdown is finished and no receiving exists, and then the communication is finished;
(4) at this point there is no loss or duplication of data.
3. After the application layer of the terminal is unpacked successfully, data can be extracted and stored in a database, and then the application layer of the terminal can send a response signal data packet to the consumer through the transmission layer; the application layer of the terminal enters a receiving state, waits for receiving the next packet of data, and starts a countdown waiting for receiving.
(1) If the terminal returns a response signal packet to the consumer, the transmission medium is suddenly disconnected. The transmission layer of the consumer computer stops receiving due to the fact that the data cannot be received, and the application layer of the consumer computer does not receive any data sent by the transmission layer;
(2) after waiting for a period of time, the application layer of the consumer computer judges that the communication is overtime because no response is received, and then the communication is ended;
(3) similarly, the transmission layer of the terminal does not receive the next packet of data sent by the consumer, and after the countdown of the application layer is finished, the communication is judged to be overtime because no data is received, and then the communication is finished;
(4) at this time, the packet data exists in the consumer computer and the upper computer at the same time, and repeated data segments appear.
4. After receiving the response signal data packet, the transmission layer of the consumer machine transmits the response signal data packet to the application layer. The application layer cancels the countdown when receiving the response signal data packet;
(1) if the transmission layer of the consumer is down after receiving the response signal data packet or during receiving, the consumer loses the communication capability and directly finishes the communication;
(2) the terminal judges that the communication is overtime because no data is received after the countdown of the application layer of the terminal is finished because the transmission layer does not receive the next packet of data sent by the consumer, and then the communication is finished;
(3) at this time, the packet data exists in the consumer computer and the upper computer at the same time, and repeated data segments appear.
5. And after receiving the response signal data packet, the application layer of the consumer computer analyzes the response signal data packet.
(1) If the application layer of the consumer computer unpacks the packet, the packet head, the packet tail, the CRC check and any field data in the data are incorrect, the packet unpacking is judged to be failed, namely, the data transmission is wrong; at this time, the application layer of the consumer machine discards the received data; then, the application layer of the consumer computer sends an analysis failure response packet to the terminal through the transmission layer, the application layer enters a receiving state, waits for receiving the response signal data packet again, and starts a countdown waiting for receiving;
(2) and after receiving the analysis failure response packet, the application layer cancels the receiving countdown and then analyzes the analysis failure response packet. After successful analysis, whether the failure response packet is received three times continuously is judged. If not, the response signal data packet is retransmitted; if the application layer of the terminal recognizes that the analysis failure response packet is received for three times continuously, the transmission failure is judged, and then the communication is ended;
(3) at this time, the application layer of the consumer machine judges that the receiving is overtime because the receiving countdown is finished and no receiving is carried out, and then the communication is finished;
(4) at this time, the packet data exists in the consumer computer and the upper computer at the same time, and repeated data segments appear.
6. If the application layer of the consumer machine successfully analyzes the response signal data packet, the terminal is judged to successfully receive the last packet of data; thus, the consuming machine deletes the previous packet of data from the consuming machine.
(1) If the consumer machine is down after deleting the previous packet of data, the consumer machine directly finishes the communication;
(2) the terminal judges that the communication is overtime because no data is received after the countdown of the application layer of the terminal is finished because the transmission layer does not receive the next packet of data sent by the consumer, and then the communication is finished;
(3) at this point there is no loss or duplication of data.
7. The application layer of the consumer machine can judge whether data which needs to be sent exist, if the data which needs to be sent do not exist, the application layer of the consumer machine can send a null data packet, and the null data packet is transmitted to the terminal through the transmission layer.
8. After receiving the empty data packet, the transmission layer of the terminal transmits the empty data packet to the application layer, and the application layer cancels the countdown when receiving the empty data packet; and then the application layer of the terminal unpacks the data packet, after the unpacking is successful, the data is judged to be completely received, a response signal data packet is returned and sent to the consumer machine through the transmission layer, and then the application layer finishes the communication.
9. The transmission layer of the consumer receives the post-acknowledgement signal data packet and transmits the post-acknowledgement signal data packet to the application layer. The application layer cancels the countdown when receiving the packet; then, the application layer of the consumer computer unpacks the response signal data packet, and after the unpacking is successful, the communication is also ended.
10. A complete transmission is thus completed.
In summary, the data processing method described in this embodiment has the following advantages:
the embodiment of the invention provides a data processing method, which can solve the problem of data loss caused by communication interruption and the like when a consumer computer uploads data; the method sets a countdown for waiting to receive response signal data at the consumer side, so that when the response signal data is not successfully received, the communication can be ended when the countdown for waiting to receive the response signal data is ended; setting a countdown waiting for receiving next data to be sent at a terminal side for receiving the consumer data, so that the communication can be ended when the countdown waiting for receiving the next data to be sent is ended when the next data to be sent is not successfully received; and further, the data uploaded by the consumer computer can be judged not to be successfully uploaded, and the data loss of the consumer computer in the data uploading process is prevented.
On the other hand, referring to fig. 4, an embodiment of the present invention further provides a data processing apparatus 200, for a consumer machine, specifically including:
at least one processor 210;
at least one memory 220 for storing at least one program;
when the at least one program is executed by the at least one processor 210, the at least one processor 210 is caused to implement the data processing method as shown in fig. 3.
The memory 220, which is a non-transitory computer-readable storage medium, may be used to store non-transitory software programs and non-transitory computer-executable programs. The memory 220 may include high speed random access memory and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 220 may optionally include remote memory located remotely from processor 210, and such remote memory may be connected to processor 210 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
It will be appreciated that the device architecture shown in FIG. 4 does not constitute a limitation of the data processing device 200, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
In the data processing apparatus 200 shown in fig. 4, the processor 210 may retrieve the program stored in the memory 220 and execute, but is not limited to, some steps in the embodiment shown in fig. 3.
The embodiment of the present invention further provides a consumer machine, which includes the data processing apparatus 200 of the embodiment shown in fig. 4. The consumer machine in the embodiment has the hardware structure of the data processing apparatus 200, and can make the processor 210 in the data processing apparatus 200 call the program stored in the memory 220 to realize the data processing method shown in fig. 3. The specific implementation of the consumer machine of this embodiment can refer to the above embodiments, and is not described herein again.
The embodiment of the invention also provides a terminal used for receiving the data sent by the consumer computer; the terminal can be a mobile terminal device with a display function, such as a smart phone, a tablet computer, an e-book reader, an MP3(Moving picture expertsgroupandiolayorylayer iii), an MP4(Moving picture expertsgrouudiolayeye IV), a portable computer, a smart watch, and a smart bracelet.
As shown in fig. 5, the terminal 100 may include: a processor 1001 (e.g., CPU, singlechip), a bus 1002, a consumer interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable communication connections between these components. The consumer machine interface 1003 is used to connect with a consumer machine. The consumer interface 1003 may include a standard wired interface, a wireless interface. Network interface 1004 may include a standard wired interface, a wireless interface (e.g., a WIFI interface), and the like. The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001 described previously. Alternatively, the program in the memory 1005 may be an APP (Application program) installed in advance, or an APP downloaded and installed from the internet through the network interface 1004.
In the terminal shown in fig. 5, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the consumer interface 1003 is mainly used for connecting a consumer; and the processor 1001 may be used to call up a program stored in the memory 1005.
Those skilled in the art will appreciate that the terminal structure shown in fig. 5 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
An embodiment of the present invention further provides a computer-readable storage medium, which stores a program executable by a processor, and the program executable by the processor is used for implementing the method shown in fig. 3 when being executed by the processor.
It will be understood that all or some of the steps, systems of methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data as a term well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention.

Claims (10)

1. A data processing method, characterized by the steps performed by a consumer machine of:
sending first target data, and starting countdown of a first preset time length, wherein the first target data is any one of data to be sent, and the first preset time length is the time length for a consumer to wait for receiving response signal data;
if the response signal data is successfully received, deleting the first target data, closing the countdown of the first preset time length, and determining whether the data to be sent still exist;
if the data to be sent exists, sending second target data, starting countdown of a first preset time length, and executing a step of detecting whether response signal data are successfully received, wherein the second target data are the next data to be sent of the first target data;
if the data to be sent does not exist, sending null data, starting countdown with a first preset time length, detecting whether response signal data of the null data are successfully received or not, if the response signal data are successfully received, finishing communication, and if the response signal data are not successfully received, finishing the communication when the countdown with the first preset time length is finished;
and if the response signal data is not successfully received, ending the communication when the countdown of the first preset time length is ended.
2. A data processing method according to claim 1, further comprising, after successful reception of the reply signal data, the steps of:
the consumer machine analyzes the response signal data;
if the analysis is failed, sending analysis failure signal data, deleting the response signal data, and restarting the countdown of the first preset time length;
detecting whether the response signal data is received again successfully or not, if the response signal data is received again successfully, executing a step of analyzing the response signal data, otherwise, ending the communication when the countdown of the first preset time length is ended;
and if the analysis is successful, executing the steps of deleting the first target data, closing the countdown of the first preset time length and determining whether the data is to be sent or not.
3. A data processing method according to claim 2, further comprising:
after receiving returned analysis failure signal data, the consumption machine retransmits first data to be transmitted, wherein the first data to be transmitted is data to be transmitted corresponding to the analysis failure signal data;
and when the consumer machine receives the analysis failure signal data for three times, ending the communication.
4. A data processing method, characterized by comprising the steps of:
detecting whether the first target data sent by the consumer machine is successfully received;
if the first target data is successfully received, storing the first target data, returning response signal data which are successfully received, and starting countdown of a second preset time length, wherein the second preset time length is a time length for waiting for receiving the next data to be sent;
detecting whether the second target data sent by the consumer machine is successfully received; if the second target data is successfully received, saving the second target data, returning response signal data which is successfully received, and restarting the countdown of the second preset time length; if the second target data is not successfully received, detecting whether the null data sent by the consumption machine is successfully received or not, and if the null data is successfully received, returning response signal data of the null data; if the null data is not successfully received, ending the communication when the countdown of the second preset time length is ended;
and if the first target data is not successfully received, not returning response signal data.
5. The data processing method of claim 4, wherein if the first target data is successfully received, further comprising the steps of:
analyzing the first target data;
if the analysis is failed, sending analysis failure signal data, deleting the first target data, and restarting the countdown of a second preset duration;
detecting whether the first target data is received again successfully or not, if the first target data is received again successfully, executing a step of analyzing the first target data, otherwise, ending the communication when the countdown of the second preset time length is ended;
and if the analysis is successful, executing the steps of saving the first target data, returning response signal data which is successfully received, and starting countdown of a second preset time length.
6. A data processing method according to claim 5, further comprising:
after receiving analysis failure signal data sent by a consumer computer, returning first response signal data again, wherein the first response signal data is response signal data corresponding to the analysis failure signal data;
when the analysis failure signal data transmitted by the consumer is received three consecutive times, the communication is ended.
7. A data processing apparatus characterized by: the method comprises the following steps:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement the data processing method of any one of claims 1-3.
8. Consumer machine, its characterized in that: comprising a data processing device as claimed in claim 7.
9. A terminal, characterized by: the method comprises the following steps:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement the data processing method of any one of claims 4-6.
10. A computer-readable storage medium, characterized in that: stored thereon a program executable by a processor for implementing the data processing method according to any of claims 1-6 when executed by the processor.
CN202010984150.6A 2020-09-18 2020-09-18 Data processing method and device, consumer machine, terminal and readable storage medium Active CN112217610B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010984150.6A CN112217610B (en) 2020-09-18 2020-09-18 Data processing method and device, consumer machine, terminal and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010984150.6A CN112217610B (en) 2020-09-18 2020-09-18 Data processing method and device, consumer machine, terminal and readable storage medium

Publications (2)

Publication Number Publication Date
CN112217610A true CN112217610A (en) 2021-01-12
CN112217610B CN112217610B (en) 2023-03-14

Family

ID=74050401

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010984150.6A Active CN112217610B (en) 2020-09-18 2020-09-18 Data processing method and device, consumer machine, terminal and readable storage medium

Country Status (1)

Country Link
CN (1) CN112217610B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113094305A (en) * 2021-04-02 2021-07-09 北京黑蚁兄弟科技有限公司 Asynchronous communication processing method, device and storage medium
CN113132367A (en) * 2021-04-09 2021-07-16 国网电力科学研究院有限公司 Data transmission self-adaption method and device for engineering monitoring Internet of things acquisition terminal

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104660698A (en) * 2015-02-17 2015-05-27 广东新农人农业科技股份有限公司 Electronic weighing instrument data collecting and storing method and device
CN107318156A (en) * 2017-07-20 2017-11-03 深圳先进技术研究院 Data repeating method and device in wireless sensor network
CN109286476A (en) * 2018-09-25 2019-01-29 京信通信系统(中国)有限公司 A kind of method, receiving end and transmitting terminal transmitting data
CN109861999A (en) * 2019-01-21 2019-06-07 深圳市敢为软件技术有限公司 Control method, device and the storage medium of data transmission
CN111629368A (en) * 2020-05-19 2020-09-04 歌尔科技有限公司 Communication method of earphone and charging box, earphone and readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104660698A (en) * 2015-02-17 2015-05-27 广东新农人农业科技股份有限公司 Electronic weighing instrument data collecting and storing method and device
CN107318156A (en) * 2017-07-20 2017-11-03 深圳先进技术研究院 Data repeating method and device in wireless sensor network
CN109286476A (en) * 2018-09-25 2019-01-29 京信通信系统(中国)有限公司 A kind of method, receiving end and transmitting terminal transmitting data
CN109861999A (en) * 2019-01-21 2019-06-07 深圳市敢为软件技术有限公司 Control method, device and the storage medium of data transmission
CN111629368A (en) * 2020-05-19 2020-09-04 歌尔科技有限公司 Communication method of earphone and charging box, earphone and readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113094305A (en) * 2021-04-02 2021-07-09 北京黑蚁兄弟科技有限公司 Asynchronous communication processing method, device and storage medium
CN113094305B (en) * 2021-04-02 2024-03-26 北京黑蚁兄弟科技有限公司 Asynchronous communication processing method, device and storage medium
CN113132367A (en) * 2021-04-09 2021-07-16 国网电力科学研究院有限公司 Data transmission self-adaption method and device for engineering monitoring Internet of things acquisition terminal
CN113132367B (en) * 2021-04-09 2024-02-23 国网电力科学研究院有限公司 Engineering monitoring-oriented data transmission self-adaptive method and device for Internet of things acquisition terminal

Also Published As

Publication number Publication date
CN112217610B (en) 2023-03-14

Similar Documents

Publication Publication Date Title
CN106559739B (en) Lightweight data transmission method suitable for Bluetooth low-power wireless communication system
CN112217610B (en) Data processing method and device, consumer machine, terminal and readable storage medium
US11146090B2 (en) Battery management system, and method and apparatus for transmitting information
CN108989103B (en) Device upgrading method, debugger, network device and network system
US10750570B2 (en) Call termination method, application processor, and modem
CN112035145B (en) Equipment upgrading method and related device
CN106681774B (en) Software upgrading method of Bluetooth loudspeaker and intelligent terminal
CN106506124A (en) Retransmit message and determine method and device
CN110213020A (en) Data transmission method, terminal, system and device based on bluetooth peripheral hardware
CN108886713B (en) Data transmission method, data receiving equipment and data sending equipment
CN112953839A (en) Data framing transmission method, telemetering equipment and data center platform
EP2846470B1 (en) A method of mobile terminal internal communications
CN104660639B (en) Cloud terminal upgrade processing method and device
CN110855686A (en) SPI protocol communication method, system, equipment and computer storage medium
US9749821B1 (en) LTE network interactions for non-duplication of SMS
CN109039552B (en) Data recovery method and device
US9781691B2 (en) Wireless communication device, non-transitory computer readable medium, and wireless communication system
CN101647213A (en) System and method for processing data and control messages in a communication system
CN113568640A (en) Upgrading method of main program of air conditioner external unit, operation control device and air conditioner
CN116582826A (en) Message transmission method, electronic equipment and storage medium
US8615192B2 (en) Communication system, communication apparatus, control method of communication apparatus, and computer-readable storage medium
US10243755B2 (en) Communication device and communication method
CN104298630A (en) Communication method, communication devices and equipment based on SPI
CN113452603A (en) Data transmission method and related device
CN111356119A (en) Data transmission method and related equipment

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