Data retransmission prevention method and system
Technical Field
The invention relates to the technical field of data transmission, in particular to a data retransmission preventing method and system.
Background
With the development of information technology, especially the rapid update of network technology, the data volume is growing sharply, and the data volume needing to be transmitted and processed is also multiplied, resulting in higher cost investment in storage and processing of the server. At present, the data transmission process between the intelligent terminal and the server is roughly: data such as pictures or video screens acquired through the intelligent terminal are stored locally in the intelligent terminal, and then are sent to the server for data processing, generally, the frequency of uploading the locally stored data to the server is high, and therefore the data volume to be transmitted and processed is large. And after processing the received data, the server feeds back a confirmation signal to the intelligent terminal. And the intelligent terminal judges whether the server successfully receives the uploaded data according to whether the confirmation signal from the server is received within the preset time. When the confirmation signal from the server is not received after the preset time, the data is retransmitted to the server; when an acknowledgement signal is received from the server before the preset time arrives, the next data is transmitted.
But the server receives the next data sent by the intelligent terminal when the server has not processed the data. For example, the smart terminal has 10 records to submit to the server, and it is assumed that the server needs 30 seconds to process the data, but the uploading frequency of the smart terminal is 20 seconds/time. In fact, when the preset time arrives, the server does not receive the data, but the data is processed, so that the problem of repeated data transmission is caused. It is easy to understand that, to a certain extent, the preset time is reduced, and the next data is sent after the server finishes processing the data and returns the confirmation signal, so that the data transmission efficiency is obviously greatly reduced.
Disclosure of Invention
Based on the above problems, the present invention provides a data retransmission prevention method and system, which can effectively avoid the situation of data retransmission.
In view of the above, an aspect of the present invention provides a data retransmission prevention method, including:
sending locally stored data to be processed to a server;
detecting whether a confirmation signal from the server is received within a preset time;
and when the detection result is yes, deleting the data to be processed.
Further, the server includes a scalable storage array, and the detecting whether the acknowledgement signal is received from the server within the preset time includes:
and detecting whether a confirmation signal generated after the server expands the storage array and stores the data to be processed to the expanded storage array is received or not within a preset time.
Further, the sending the stored data to be processed to the server includes:
periodically detecting whether new data to be processed is generated;
and when new data to be processed is generated, after the flag state of the data to be processed is set to be 0, sending the data to be processed to the server.
Further, the "deleting the data to be processed when the detection result is yes" includes:
after receiving the confirmation signal from the server, setting the flag state of the data to be processed to be 1;
periodically detecting whether to-be-processed data with a flag state of 1 exist;
and when the data to be processed with the flag state of 1 exists, deleting the data to be processed with the flag state of 1.
Another aspect of the present invention provides a data retransmission prevention system, which is applied to an intelligent terminal, and includes:
the sending module is used for sending the locally stored data to be processed to the server;
the detection module is used for detecting whether the confirmation signal from the server is received or not within preset time;
and the deleting module is used for deleting the data to be processed when the detection result is yes.
Further, the server comprises an expandable storage array, and the detection module is used for detecting whether a confirmation signal generated by the server after expanding the storage array and storing the data to be processed in the expanded storage array is received or not within a preset time.
Further, the sending module includes:
the detection unit is used for periodically detecting whether new data to be processed is generated;
and the setting unit is used for sending the data to be processed to the server after setting the flag state of the data to be processed to be 0 when new data to be processed is generated.
Further, the deletion module includes:
the setting unit is used for setting the flag state of the data to be processed to be 1 after receiving the confirmation signal from the server;
the detection unit is used for periodically detecting whether the data to be processed with the flag state of 1 exists or not;
and the deleting unit is used for deleting the data to be processed with the flag state of 1 when the data to be processed with the flag state of 1 exists.
The invention also provides a data retransmission preventing method, which is applied to a server and comprises the following steps:
receiving data to be processed from an intelligent terminal;
expanding a pre-established storage array, and storing the data to be processed to the expanded storage array;
and generating a confirmation signal, and sending the confirmation signal to the intelligent terminal, so that the intelligent terminal deletes the locally stored to-be-processed data after receiving the confirmation signal.
The invention also provides a data retransmission-preventing system, which is applied to a server and is characterized by comprising the following components:
the receiving module is used for receiving data to be processed from the intelligent terminal;
the storage module is used for expanding a pre-established storage array and storing the data to be processed to the expanded storage array;
and the confirmation module is used for generating a confirmation signal and sending the confirmation signal to the intelligent terminal, so that the intelligent terminal deletes the locally stored to-be-processed data after receiving the confirmation signal.
According to the data retransmission preventing method and system provided by the invention, the server does not perform data processing firstly after receiving the data, but immediately sends the confirmation signal to the intelligent terminal, and the intelligent terminal deletes the locally stored data to be processed after receiving the confirmation signal, so that the data repeated transmission is effectively prevented from occupying the storage space of the server under the condition of ensuring the data transmission efficiency.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a flowchart illustrating a data retransmission-preventing method according to a first embodiment of the present invention;
fig. 2 is a schematic structural diagram of a data retransmission-preventing system according to a second embodiment of the present invention;
fig. 3 is a flowchart illustrating a data retransmission-preventing method according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a data retransmission-preventing system according to a fourth embodiment of the present invention.
Description of the main element symbols:
100-a data anti-retransmission system; 10-a sending module; 11-a detection unit; 12-a setting unit; 20-a detection module; 30-delete module; 31-a setting unit; 32-a detection unit; 33-a deletion unit; 200-a data anti-retransmission system; 40-a receiving module; 50-a storage module; 60-confirmation module.
Detailed Description
In order to facilitate understanding of the present invention, the data retransmission preventing method and system will be described more clearly and completely with reference to the accompanying drawings. The attached drawings show the preferred embodiments of the data retransmission prevention method and system. The data anti-retransmission method and system can be implemented in many different forms and are not limited to the embodiments described herein. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
Fig. 1 shows a flow diagram of a data retransmission prevention method according to an embodiment of the present invention.
As shown in fig. 1, the data retransmission prevention method provided in the embodiment of the present invention is applied to an intelligent terminal with data acquisition and transmission functions, such as a mobile phone, an ipad, and the like, and includes:
and step S1, sending the locally stored data to be processed to the server.
Specifically, whether new data to be processed is generated or not is periodically detected. The data to be processed may be text, image or voice, etc. When new data to be processed is generated, the data to be processed is sent to the server, so that the server can process the data to be processed.
Preferably, in another embodiment, when new data to be processed is generated, the flag state of the data to be processed is set to 0. The flag state is used to reflect a flag indicating whether a history of data to be processed is transmitted to the server, and in this embodiment, the flag state includes two types: 0 and 1, wherein the flag state of 0 indicates that the data to be processed has not been transmitted to the server; the flag state of 1 indicates that the data to be processed has been transmitted to the server, i.e. there is a history of transmission to the server. And sending the data to be processed with the flag state of 0 to the server.
Step S2, detecting whether an acknowledgement signal is received from the server within a preset time.
In this embodiment, the server includes an expandable storage array, and when receiving the data to be processed, the storage array is expanded to store the data to be processed. The memory array is composed of memory cells arranged in an N-row-by-M-column matrix form, and each memory cell can store preset bit binary data. The storage array is scalable, which means that the storage space of the storage array is freely scalable according to the amount of data received. The storage array stores data in different storage units in a segmented mode, and when the data are accessed, the related storage units in the storage array act together, so that the data access time is greatly reduced, and the better space utilization rate is achieved.
Specifically, whether a confirmation signal generated by the server after expanding the storage array and storing the to-be-processed data in the expanded storage array is received or not is detected within a preset time. When receiving the confirmation signal from the server within the preset time, the data to be processed is indicated to be successfully sent to the server, and the next data can be transmitted; when the confirmation signal from the server is not received within the preset time, the loss of the data to be processed is indicated.
And step S3, deleting the data to be processed when the detection result is yes.
In this embodiment, the to-be-processed data that has been transmitted is immediately deleted, so that the to-be-processed data is prevented from being transmitted to the server again and occupying the storage space of the server. Specifically, after receiving the acknowledgement signal from the server, the locally stored to-be-processed data is directly deleted.
Further, after receiving the confirmation signal from the server, setting the flag state of the data to be processed to 1. And periodically detecting whether the local to-be-processed data with the flag state of 1 is stored. And when the data to be processed with the flag state of 1 exists, deleting the data to be processed with the flag state of 1, thereby avoiding repeated transmission of the data.
Example 2
Fig. 2 is a schematic structural diagram of a data retransmission prevention system according to an embodiment of the present invention.
As shown in fig. 2, a data retransmission-preventing system 100 provided in an embodiment of the present invention is applied to an intelligent terminal with data acquisition and transmission functions, such as a mobile phone, an ipad, and the like, and includes a sending module 10, a detecting module 20, and a deleting module 30.
The sending module 10 is configured to send locally stored data to be processed to a server.
The transmitting module 10 includes a detecting unit 11 and a setting unit 12.
The detection unit 11 is used for periodically detecting whether new data to be processed is generated.
The setting unit 12 is configured to, when new data to be processed is generated, send the data to be processed to the server after setting the flag state of the data to be processed to 0.
The detection module 20 is configured to detect whether an acknowledgement signal is received from the server within a preset time.
The server comprises an expandable storage array, and the detection module is used for detecting whether a confirmation signal generated after the server expands the storage array and stores the data to be processed into the expanded storage array is received or not within preset time.
The deleting module 30 is configured to delete the to-be-processed data when the detection result is yes. In this embodiment, the deletion module 30 includes a setting unit 31, a detection unit 32, and a deletion unit 33.
The setting unit 31 is configured to set the flag state of the to-be-processed data to 1 after receiving the acknowledgement signal from the server.
The detection unit 32 is configured to periodically detect whether there is data to be processed with a flag state of 1.
The deleting unit 33 is configured to delete the data to be processed with the flag state of 1 when there is the data to be processed with the flag state of 1.
Example 3
Fig. 3 is a flowchart illustrating a data retransmission prevention method according to an embodiment of the present invention.
As shown in fig. 3, the method for preventing retransmission of data provided in the embodiment of the present invention is applied to a server with a processing function, and includes:
and step S11, receiving the data to be processed from the intelligent terminal.
Specifically, whether data to be processed from the intelligent terminal exists or not is periodically detected. The data to be processed may be text, image or voice, etc. When the data to be processed from the intelligent terminal exists, the data to be processed is received, and the data to be processed is conveniently stored and processed in the later period.
And step S12, expanding the pre-established storage array, and storing the data to be processed into the expanded storage array.
Specifically, the pre-established storage array is expanded when the data to be processed is received. The pre-established memory array is composed of memory cells arranged in an N-row-by-M-column matrix form, and each memory cell can store binary data with predetermined bits. The storage array is scalable, which means that the storage space of the storage array is freely scalable according to the amount of data received. The storage array stores data in different storage units in a segmented mode, and when the data are accessed, the related storage units in the storage array act together, so that the data access time is greatly reduced, and the better space utilization rate is achieved.
And further, storing the data to be processed into the expanded storage array to wait for subsequent processing.
And step S13, generating a confirmation signal, and sending the confirmation signal to the intelligent terminal, so that the intelligent terminal deletes the locally stored to-be-processed data after receiving the confirmation signal.
Specifically, when the data to be processed is received, a confirmation signal is generated and fed back to the intelligent terminal, so that the intelligent terminal is informed that the data to be processed is successfully sent, and the locally stored data to be processed can be deleted and the next data can be transmitted.
Example 4
Fig. 4 shows a schematic structural diagram of a data retransmission prevention system according to an embodiment of the present invention.
As shown in fig. 4, the data retransmission prevention system 200 provided in the embodiment of the present invention is applied to a server with a processing function, and includes a receiving module 40, a storing module 50, and a confirming module 60.
The receiving module 40 is used for receiving the data to be processed from the intelligent terminal.
The storage module 50 is configured to expand a pre-established storage array, and store the to-be-processed data in the expanded storage array.
The confirmation module 60 is configured to generate a confirmation signal and send the confirmation signal to the intelligent terminal, so that the intelligent terminal deletes the locally stored to-be-processed data after receiving the confirmation signal.
According to the data retransmission preventing method and system provided by the invention, the server does not perform data processing firstly after receiving the data, but immediately sends the confirmation signal to the intelligent terminal, and the intelligent terminal deletes the locally stored data to be processed after receiving the confirmation signal, so that the data repeated transmission is effectively prevented from occupying the storage space of the server under the condition of ensuring the data transmission efficiency.
The system provided by the embodiment of the present invention has the same implementation principle and technical effect as the foregoing method embodiment, and for the sake of brief description, no mention is made in the system embodiment, and reference may be made to the corresponding contents in the foregoing method embodiment.
In all examples shown and described herein, any particular value should be construed as merely exemplary, and not limiting, and thus other examples of example embodiments may have different values. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
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 units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.