CN110492979B - Incremental data transmission method and device, slave and storage medium - Google Patents

Incremental data transmission method and device, slave and storage medium Download PDF

Info

Publication number
CN110492979B
CN110492979B CN201910779128.5A CN201910779128A CN110492979B CN 110492979 B CN110492979 B CN 110492979B CN 201910779128 A CN201910779128 A CN 201910779128A CN 110492979 B CN110492979 B CN 110492979B
Authority
CN
China
Prior art keywords
incremental data
data
acquisition instruction
incremental
state identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910779128.5A
Other languages
Chinese (zh)
Other versions
CN110492979A (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.)
Nanjing Haixing Power Grid Technology Co Ltd
Hangzhou Hexing Electrical Co Ltd
Ningbo Henglida Technology Co Ltd
Original Assignee
Nanjing Haixing Power Grid Technology Co Ltd
Hangzhou Hexing Electrical Co Ltd
Ningbo Henglida Technology 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 Nanjing Haixing Power Grid Technology Co Ltd, Hangzhou Hexing Electrical Co Ltd, Ningbo Henglida Technology Co Ltd filed Critical Nanjing Haixing Power Grid Technology Co Ltd
Priority to CN201910779128.5A priority Critical patent/CN110492979B/en
Publication of CN110492979A publication Critical patent/CN110492979A/en
Application granted granted Critical
Publication of CN110492979B publication Critical patent/CN110492979B/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Selective Calling Equipment (AREA)
  • Arrangements For Transmission Of Measured Signals (AREA)

Abstract

The invention discloses an incremental data transmission method, an incremental data transmission device, a slave and a storage medium. The method comprises the steps of judging whether a current state identifier in a currently received data acquisition instruction is the same as a historical state identifier in a data acquisition instruction received last time or not by receiving a data acquisition instruction which is sent by a host and contains the state identifier, if so, sending incremental data corresponding to the historical state identifier again, and if not, sending the incremental data corresponding to the current state identifier. Therefore, whether incremental data are transmitted successfully or not can be accurately judged through the state identification in the data acquisition instruction, and then corresponding processing is carried out, so that the problem of data transmission of data loss or data repetition is solved, the error rate in the incremental data transmission process is reduced, and the safety in the incremental data transmission process is ensured.

Description

Incremental data transmission method and device, slave and storage medium
Technical Field
The present invention relates to the field of data transmission, and in particular, to an incremental data transmission method, an incremental data transmission device, a slave, and a storage medium.
Background
Under the condition of abnormal disturbance of the communication line environment, data transmission problems such as loss, code error, repeated transmission for many times or abnormal transmission data are frequently generated in the process of sending incremental data measured by a measuring device and other slave machines to a host machine. In order to reduce the problem in the incremental transmission process, the following two methods are currently adopted to transmit incremental data.
The first is a high-frequency low-magnitude data transmission mode, which reduces the influence of single data loss by reducing incremental data of single transmission. However, this method can only reduce the magnitude of incremental data loss, and cannot fundamentally solve the problem of data loss.
The second mode is that in the data communication process, the host computer initiates communication for reading incremental data to the slave computer, when the communication fails due to the disturbance of the communication environment, the host computer sends a rereading command to the slave computer, the slave computer is required to send the incremental data transmitted last time again, and the slave computer sends the incremental data to the host computer after receiving the rereading command. When the next incremental data is obtained, if the slave receives a command for reading the next incremental data sent by the host, the slave considers that the last incremental data is successfully sent, deletes the last incremental data stored in the slave, and sends the next incremental data to the host. However, when the slave does not receive the command due to the communication environment disturbance, the master will send a reread command to reread the next incremental data, and since the slave cannot confirm that the last incremental data is successfully sent from the reread command, the last incremental data will not be deleted and sent again, so that the repeated data is transmitted and accumulated for many times, and data transmission errors are caused.
Therefore, the two modes still cause data transmission problems such as data loss or data repetition, and the security in the incremental data transmission process cannot be ensured.
Disclosure of Invention
The invention aims to provide an incremental data transmission method, an incremental data transmission device, a slave and a storage medium, wherein whether incremental data are successfully transmitted or not can be accurately judged through a state identifier in a data acquisition command, if the incremental data are successfully transmitted, the slave sends incremental data corresponding to a current state identifier, and if the incremental data are failed to be transmitted, the slave resends the incremental data corresponding to a historical state identifier. Therefore, the problem of data transmission of data loss or data repetition is avoided, the error rate in the incremental data transmission process is reduced, and the safety in the incremental data transmission process is ensured.
In order to solve the above technical problem, the present invention provides an incremental data transmission method, which is applied to a slave, and the method includes:
receiving a data acquisition instruction which is sent by a host and contains a state identifier; the state identification of the same incremental data is the same, and the state identification of different incremental data is different;
judging whether the current state identifier in the currently received data acquisition instruction is the same as the historical state identifier in the data acquisition instruction received last time;
if yes, sending the incremental data corresponding to the historical state identification again;
and if not, sending incremental data corresponding to the current state identification.
Preferably, the method further comprises the following steps:
and adding a check mode to the incremental data.
Preferably, the check mode is specifically a signature check mode or a cyclic redundancy check mode.
Preferably, the method further comprises the following steps:
detecting whether the communication link is normal;
if not, the communication failure is prompted.
Preferably, the method further comprises the following steps:
and generating a transmission log containing the transmission time of all the incremental data.
In order to solve the above technical problem, the present invention provides an incremental data transmission method, which is applied to a host, and comprises:
generating a data acquisition instruction containing a state identifier; the state identifiers of the same incremental data are the same, and the state identifiers of different incremental data are different;
and sending the data acquisition instruction to a slave machine.
To solve the above technical problem, the present invention provides a method for transmitting incremental data, including:
the host generates a data acquisition instruction containing a state identifier; the state identifications of the same incremental data are the same, the state identifications of different incremental data are different, and the data acquisition instruction is sent to the slave;
and the slave machine receives the data acquisition instruction, judges whether the current state identifier in the currently received data acquisition instruction is the same as the historical state identifier in the data acquisition instruction received last time, and if so, sends the incremental data corresponding to the historical state identifier again, and if not, sends the incremental data corresponding to the current state identifier.
In order to solve the above technical problem, the present invention provides an incremental data transmission device, including:
the receiving module is used for receiving a data acquisition instruction which is sent by the host and contains the state identifier; the state identification of the same incremental data is the same, and the state identification of different incremental data is different;
and the judging module is used for judging whether the current state identifier in the currently received data acquisition instruction is the same as the historical state identifier in the data acquisition instruction received last time, if so, sending the incremental data corresponding to the historical state identifier again, and if not, sending the incremental data corresponding to the current state identifier.
In order to solve the above technical problem, the present invention provides a slave, including a memory for storing a computer program;
a processor for implementing the steps of the incremental data transmission method as claimed in any one of the above when executing said computer program.
In order to solve the above technical problem, the present invention provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the incremental data transmission method according to any one of the above items.
According to the incremental data transmission method provided by the invention, each data acquisition instruction received by a slave machine comprises a state identifier, the state identifiers for acquiring the same incremental data are the same, and the state identifiers for acquiring different incremental data are different. Determining whether the last incremental data is successfully transmitted or not by judging whether the current state identifier in the currently received data acquisition instruction is the same as the historical state identifier in the last received data acquisition instruction or not; if the incremental data are different, the transmission is considered to be successful, the slave machine sends the incremental data corresponding to the current state identification, and repeated sending caused by the fact that whether the last incremental data are sent successfully or not is not known is avoided; if the incremental data are the same, the transmission is considered to be failed, and the slave machine retransmits the incremental data corresponding to the historical state identification until the transmission is confirmed to be successful, so that the transmission problem of data loss is avoided. Therefore, whether incremental data are transmitted successfully or not can be accurately judged through the state identification in the data acquisition instruction, and then corresponding processing is carried out, so that the problem of data transmission of data loss or data repetition is solved, the error rate in the incremental data transmission process is reduced, and the safety in the incremental data transmission process is ensured.
In addition, the incremental data transmission device, the slave and the storage medium provided by the invention correspond to the method, and have the same beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention, the drawings required for the embodiments will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of an incremental data transmission method applied to a slave according to an embodiment of the present invention;
fig. 2 is a flowchart of an incremental data transmission method applied to a host according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for transmitting incremental data according to an embodiment of the present invention;
fig. 4 is a structural diagram of an incremental data transmission apparatus according to an embodiment of the present invention;
fig. 5 is a structural diagram of a slave according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without any creative work belong to the protection scope of the present invention.
The core of the invention is to provide an incremental data transmission method, an incremental data transmission device, a slave and a storage medium, wherein whether incremental data are successfully transmitted or not can be accurately judged through a state identifier in a data acquisition instruction, if the incremental data are successfully transmitted, the slave sends incremental data corresponding to a current state identifier, and if the incremental data are failed to be transmitted, the slave resends the incremental data corresponding to a historical state identifier. Therefore, the problem of data transmission of data loss or data repetition is avoided, the error rate in the incremental data transmission process is reduced, and the safety in the incremental data transmission process is ensured.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a flowchart of an incremental data transmission method applied to a slave according to an embodiment of the present invention. As shown in FIG. 1, an incremental data transmission method applied to a slave machine comprises steps S101-S104.
Step S101: receiving a data acquisition instruction which is sent by a host and contains a state identifier; the state identifications of the same incremental data are the same, and the state identifications of different incremental data are different.
Step S102: and judging whether the current state identifier in the currently received data acquisition instruction is the same as the historical state identifier in the data acquisition instruction received last time.
In one embodiment, the slave receives a data acquisition command sent by the master for acquiring incremental data, and the data acquisition command includes a status identifier for determining whether the incremental data is successfully sent. The corresponding status identifiers in the data acquisition instructions for acquiring the same incremental data are the same, and the corresponding status identifiers in the data acquisition instructions for acquiring different incremental data are different. Specifically, the slave may determine whether the host successfully receives the previous incremental data according to the status identifier in the received data acquisition instruction. After receiving the data acquisition instruction, the slave machine firstly acquires the state identifier therein, judges whether the received current state identifier is the same as the received historical state identifier, and if so, the slave machine does not receive the incremental data sent by the slave machine last time, and the last data transmission fails, so that the incremental data sent by the slave machine last time needs to be acquired again. If the current state identifier is different from the last acquired state identifier, it indicates that the host needs to acquire new incremental data, which can be understood as that the last incremental data is successfully transmitted.
It is to be understood that the currently received data retrieving instruction may be a reading instruction for retrieving new incremental data, or may be a re-reading instruction for retrieving the last transmitted incremental data due to unsuccessful transmission. It should be noted that, the data acquisition instruction received last time in this embodiment refers to the received data acquisition instruction closest to the current time interval; the current status flag and the historical status flag mentioned in this embodiment are both status flags in the data acquisition instruction, and are only used for distinction here.
Step S103: if yes, the incremental data corresponding to the historical state identification is sent again;
in specific implementation, when the slave determines that the current state identifier in the currently received data acquisition instruction is the same as the historical state identifier in the data acquisition instruction received last time, which indicates that the master needs to acquire the incremental data sent last time again, that is, the incremental data corresponding to the historical state identifier in the data acquisition instruction, the slave sends the incremental data sent last time again.
Step S104: and if not, sending the incremental data corresponding to the current state identification.
In a specific implementation, when the slave determines that a current state identifier in a currently received data acquisition instruction is different from a historical state identifier in a data acquisition instruction received last time, which indicates that incremental data required to be acquired by the master is different from incremental data corresponding to the historical state identifier and represents that transmission of the incremental data sent last time is successful, the slave sends the incremental data corresponding to the current state identifier. Furthermore, the slave computer can delete the increment data sent last time, so that the storage space is saved, and the sending error can be better avoided.
In one embodiment, the incremental data is embodied as encrypted data. When the slave machine sends the incremental data to the host machine, the data is encrypted firstly, so that the data is prevented from being tampered, and the safety is higher. It should be noted that the specific encryption method is not limited in the present invention, as long as the master and the slave adopt the appropriate encryption method and decryption method. In addition, in other embodiments, to improve the efficiency of transmission, the incremental data may also be compressed, and correspondingly, the host further needs to decompress the incremental data according to the compression type of the incremental data.
In one embodiment, after the slave machine sends the incremental data, a transmission log for recording sending information is correspondingly generated, wherein the sending information comprises a data acquisition instruction corresponding to the sending time of the incremental data and the incremental data, and the data acquisition instruction is convenient for a worker to subsequently view. It is understood that those skilled in the art can record other transmission information by using the transmission log according to actual needs, and is not limited to the above two.
According to the incremental data transmission method provided by the invention, each data acquisition instruction received by a slave machine comprises a state identifier, the state identifiers for acquiring the same incremental data are the same, and the state identifiers for acquiring different incremental data are different. Determining whether the last incremental data is successfully transmitted or not by judging whether the current state identifier in the currently received data acquisition instruction is the same as the historical state identifier in the last received data acquisition instruction or not; if the incremental data are different, the transmission is considered to be successful, the slave machine sends the incremental data corresponding to the current state identification, and repeated sending caused by the fact that whether the last incremental data are sent successfully or not is not known is avoided; if the incremental data are identical, the transmission is considered to be failed, the slave machine retransmits the incremental data corresponding to the historical state identification until the successful transmission is confirmed, and the transmission problem of data loss is avoided. Therefore, whether incremental data are transmitted successfully or not can be accurately judged through the state identification in the data acquisition instruction, and then corresponding processing is carried out, so that the problem of data transmission of data loss or data repetition is solved, the error rate in the incremental data transmission process is reduced, and the safety in the incremental data transmission process is ensured.
On the basis of the above embodiment, the incremental data transmission method further includes: a check pattern is added to the incremental data.
In a specific embodiment, a check mode can be added to the incremental data in a mode of adding a link protocol in the process of sending the incremental data from the slave to the master. Specifically, the checking mode can be divided into two types, and one checking mode is a cyclic redundancy check mode. The slave machine sends the check data calculated by adopting the cyclic redundancy check mode and the incremental data to the host machine, the host machine calculates the check data value in the link data frame after receiving the check data value, if the check data value calculated by the host machine is consistent with the check data value added by the slave machine, the host machine considers that the data is valid, otherwise, the data is considered to be wrong, and the slave machine is required to retransmit the incremental data. The method can prevent abnormal data displacement caused by bus interference and other factors in data transmission. And the other check mode is a signature check mode, the slave machine receives a signature mode issued by the host machine and carries out signature calculation on the data according to the signature mode, then the host machine carries out check and answer, if the check and answer are successful, the data is considered to be valid, otherwise, the data is considered to be invalid, and the slave machine is required to resend the incremental data, so that the incremental data in data transmission is prevented from being maliciously tampered. It should be noted that the verification mode is not limited to the above two modes, and those skilled in the art can select an appropriate verification mode according to actual needs.
On the basis of the above embodiment, the incremental data transmission method further includes:
detecting whether the communication link is normal;
if not, the communication failure is prompted.
Specifically, the slave can detect whether the communication link between the slave and the host is normally connected before sending the incremental data, and if the communication link is abnormal, a prompt of communication failure is sent in time, and the sending of the incremental data is stopped, so that the incremental data sending failure caused by the abnormal communication is reduced. It should be noted that the slave computer can detect the communication link at any time under the condition that the slave computer is connected with the host computer, and is not limited to detecting the communication link before sending the incremental data, so as to help the staff to find out the communication abnormality in time, and enable the staff to repair in time.
Fig. 2 is a flowchart of an incremental data transmission method applied to a host according to an embodiment of the present invention. As shown in fig. 2, an incremental data transmission method applied to a host includes steps S201 and S202.
Step S201: generating a data acquisition instruction containing a state identifier; the state identification of the same incremental data is the same, and the state identification of different incremental data is different;
step S202: and sending a data acquisition instruction to the slave.
In specific implementation, when the master acquires the incremental data, a data acquisition instruction needs to be generated and sent to the slave. The data acquisition instruction comprises a state identifier, wherein when the acquired incremental data is the same as the acquired incremental data acquired last time, the state identifier is set to be the same as the state identifier acquired last time; when the acquired incremental data is different from that acquired last time, the state flag in the data acquisition instruction is set to be different from that of the last time. It can be understood that, when the host computer does not successfully receive the incremental data, the data acquisition instruction which is the same as the last state identifier is sent again, so that the slave computer recognizes that the host computer is abnormal in the last transmission and needs to resend the last incremental data; when the host successfully receives the incremental data, a data acquisition command different from the last state identifier is sent, so that the slave recognizes that the last transmission of the host is successful and new incremental data needs to be sent. For example, the master sends a data acquisition command containing the state identifier X to the slave, and after receiving the command, the slave correspondingly sends incremental data to the master; if the host receives the incremental data, sending a data acquisition command containing a state identifier Y to the slave, and if the slave knows that the last incremental data is successfully sent according to the fact that the state identifier Y is different from the state identifier X, sending the next incremental data to the host; if the host does not receive the incremental data, the host repeatedly sends a data acquisition command containing the state identifier X, and if the slave receives the incremental data and knows that the transmission of the incremental data of the last time fails, the slave sends the incremental data corresponding to the state identifier X again.
According to the incremental data transmission method provided by the invention, data acquisition instructions sent by a host all contain state identifiers, the state identifiers for acquiring the same incremental data are the same, and the state identifiers for acquiring different incremental data are different. The slave machine determines whether the last incremental data is successfully transmitted or not by judging whether the current state identifier in the currently received data acquisition instruction is the same as the historical state identifier in the last received data acquisition instruction or not; if the incremental data are different, the transmission is considered to be successful, the slave machine sends the incremental data corresponding to the current state identification, and repeated sending caused by the fact that whether the last incremental data are sent successfully or not is not known is avoided; if the incremental data are identical, the transmission is considered to be failed, the slave machine retransmits the incremental data corresponding to the historical state identification until the successful transmission is confirmed, and the transmission problem of data loss is avoided. Therefore, whether incremental data are transmitted successfully or not can be accurately judged through the state identification in the data acquisition instruction, and then corresponding processing is carried out, so that the data transmission problem of data loss or data repetition is avoided, the error rate in the incremental data transmission process is reduced, and the safety in the incremental data transmission process is ensured.
Fig. 3 is a flowchart of a method for transmitting incremental data according to an embodiment of the present invention. As shown in fig. 3, the method includes steps S301, S302, and S303:
step S301: the host generates a data acquisition instruction containing state identification, wherein the state identification of the same incremental data is the same, and the state identification of different incremental data is different.
Step S302: the master sends a data acquisition command to the slave.
The slave mentioned in this embodiment may be an instrument and meter device for measurement, and the master may be an upper computer communicating with the slave, and usually, the communication mode between the master and the slave is wired communication. Of course, those skilled in the art can use wired communication according to actual situations, and the present invention is not limited thereto.
Specifically, when the master acquires the incremental data, a data acquisition instruction needs to be generated and sent to the slave. The data acquisition instruction comprises a state identifier, wherein when the acquired incremental data is the same as the last time, the state identifier is set to be the same as the last state identifier; when the acquired incremental data is different from the last time, the state flag in the data acquisition instruction is set to be different from the state flag of the last time. It can be understood that, when the host computer does not successfully receive the incremental data, the data acquisition instruction which is the same as the last state identifier is sent again, so that the slave computer recognizes that the host computer is abnormal in the last transmission and needs to resend the last-sent incremental data; when the host successfully receives the incremental data, a data acquisition command different from the last state identifier is sent, so that the slave recognizes that the last transmission of the host is successful and new incremental data needs to be sent.
Step S303: and the slave machine receives the data acquisition instruction, judges whether the current state identification in the currently received data acquisition instruction is the same as the historical state identification in the data acquisition instruction received last time, and if so, sends the incremental data corresponding to the historical state identification again, and if not, sends the incremental data corresponding to the current state identification.
Specifically, the slave may determine whether the host successfully receives the previous incremental data according to the status identifier in the received data acquisition instruction. After receiving the data acquisition instruction, the slave machine firstly acquires the state identifier therein, judges whether the current state identifier in the currently received data acquisition instruction is the same as the historical state identifier in the data acquisition instruction received last time, if so, the master machine does not receive the incremental data sent by the slave machine last time, and the last data transmission fails, so that the incremental data sent by the slave machine last time needs to be acquired again. If the current state identifier is different from the last acquired state identifier, it indicates that the host needs to acquire incremental data different from the last acquired incremental data, which can be understood as that the last incremental data is successfully transmitted.
It is to be understood that the currently received data retrieving instruction may be a reading instruction for retrieving new incremental data, or may be a re-reading instruction for retrieving the last transmitted incremental data due to unsuccessful transmission. It should be noted that, the last received data acquisition instruction mentioned in this embodiment refers to a received data acquisition instruction that is closest to the current time interval; the current status flag and the historical status flag mentioned in this embodiment are both status flags in the data acquisition instruction, and are only used for distinction here.
According to the incremental data transmission method provided by the invention, each data acquisition instruction received by a slave machine comprises a state identifier, the state identifiers for acquiring the same incremental data are the same, and the state identifiers for acquiring different incremental data are different. Determining whether the last incremental data is successfully transmitted or not by judging whether the current state identifier in the currently received data acquisition instruction is the same as the historical state identifier in the last received data acquisition instruction or not; if the incremental data are different, the transmission is considered to be successful, and the slave machine sends the incremental data corresponding to the current state identification, so that repeated sending caused by the fact that whether the last incremental data are sent successfully or not is not known is avoided; if the incremental data are the same, the transmission is considered to be failed, and the slave machine retransmits the incremental data corresponding to the historical state identification until the transmission is confirmed to be successful, so that the transmission problem of data loss is avoided. Therefore, whether incremental data are transmitted successfully or not can be accurately judged through the state identification in the data acquisition instruction, and then corresponding processing is carried out, so that the problem of data transmission of data loss or data repetition is solved, the error rate in the incremental data transmission process is reduced, and the safety in the incremental data transmission process is ensured.
In the above embodiments, the incremental data transmission method applied to the slave is described in detail, and the present invention also provides an embodiment corresponding to the slave. It should be noted that the present invention describes the embodiments of the slave from two perspectives, one is from the perspective of the function module, and the other is from the perspective of the hardware.
Fig. 4 is a structural diagram of an incremental data transmission apparatus according to an embodiment of the present invention. As shown in fig. 4, an incremental data transmission apparatus includes:
a receiving module 40, configured to receive a data acquisition instruction that includes a status identifier and is sent by a host; the state identifiers of the same incremental data are the same, and the state identifiers of different incremental data are different;
a determining module 41, configured to determine whether a current status identifier in the currently received data obtaining instruction is the same as a historical status identifier in the data obtaining instruction received last time, if so, send the incremental data corresponding to the historical status identifier again, and if not, send the incremental data corresponding to the current status identifier.
Since the embodiment of this section corresponds to the embodiment of the method section, please refer to the description of the embodiment of the method section for the embodiment of this section, and details are not repeated here.
As a preferred embodiment, the incremental data transmission device further comprises:
the adding module is used for adding a verification mode to the incremental data; wherein the check mode is specifically a signature check mode or a cyclic redundancy check mode.
As a preferred embodiment, the incremental data transmission apparatus further includes:
the detection module is used for detecting whether the communication link is normal or not; if not, the communication failure is prompted.
As a preferred embodiment, the incremental data transmission apparatus further includes:
and the generation module is used for generating a transmission log containing the sending time of all incremental data.
According to the incremental data transmission device provided by the invention, each data acquisition instruction received by the slave machine comprises the state identification, the state identifications for acquiring the same incremental data are the same, and the state identifications for acquiring different incremental data are different. Determining whether the last incremental data is successfully transmitted or not by judging whether the current state identifier in the currently received data acquisition instruction is the same as the historical state identifier in the last received data acquisition instruction or not; if the incremental data are different, the transmission is considered to be successful, the slave machine sends the incremental data corresponding to the current state identification, and repeated sending caused by the fact that whether the last incremental data are sent successfully or not is not known is avoided; if the incremental data are the same, the transmission is considered to be failed, and the slave machine retransmits the incremental data corresponding to the historical state identification until the transmission is confirmed to be successful, so that the transmission problem of data loss is avoided. Therefore, whether incremental data are transmitted successfully or not can be accurately judged through the state identification in the data acquisition instruction, and then corresponding processing is carried out, so that the problem of data transmission of data loss or data repetition is solved, the error rate in the incremental data transmission process is reduced, and the safety in the incremental data transmission process is ensured.
Fig. 5 is a structural diagram of a slave according to an embodiment of the present invention. As shown in fig. 5, a slave machine comprises a memory 50 for storing a computer program;
a processor 51 for implementing the steps of the incremental data transmission method of any one of the above when executing the computer program.
The processor 51 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 51 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 51 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 51 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 51 may further include an AI (Artificial Intelligence) processor for processing a calculation operation related to machine learning.
Memory 50 may include one or more computer-readable storage media, which may be non-transitory. Memory 50 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 50 is at least used for storing the following computer program 501, wherein after being loaded and executed by the processor 51, the computer program can implement relevant steps in the method for acquiring the operation habit of the user disclosed in any one of the foregoing embodiments. In addition, the resources stored in the memory 50 may also include an operating system 502, data 503, and the like, and the storage manner may be a transient storage manner or a permanent storage manner. Operating system 502 may include Windows, unix, linux, etc. Data 503 may include, but is not limited to, diagnostic interaction data, diagnostic device signals, and the like.
In some embodiments, the server may also include an input output interface 52, a communication interface 53, a power supply 54, and a communication bus 55.
Those skilled in the art will appreciate that the configuration shown in FIG. 5 does not constitute a limitation of slaves and may include more or fewer components than those shown.
The slave provided by the invention can realize the following method: the received data acquisition instructions all contain state identifiers, the state identifiers for acquiring the same incremental data are the same, and the state identifiers for acquiring different incremental data are different. Determining whether the last incremental data is successfully transmitted or not by judging whether the current state identifier in the currently received data acquisition instruction is the same as the historical state identifier in the last received data acquisition instruction or not; if the incremental data are different, the transmission is considered to be successful, the slave machine sends the incremental data corresponding to the current state identification, and repeated sending caused by the fact that whether the last incremental data are sent successfully or not is not known is avoided; if the incremental data are the same, the transmission is considered to be failed, and the slave machine retransmits the incremental data corresponding to the historical state identification until the transmission is confirmed to be successful, so that the transmission problem of data loss is avoided. Therefore, whether incremental data are transmitted successfully or not can be accurately judged through the state identification in the data acquisition instruction, and then corresponding processing is carried out, so that the problem of data transmission of data loss or data repetition is solved, the error rate in the incremental data transmission process is reduced, and the safety in the incremental data transmission process is ensured.
The invention also provides an embodiment corresponding to the host. It should be noted that the present invention describes the embodiment of the host from two perspectives, one is based on the function module and the other is based on the hardware.
Another incremental data transmission device provided in an embodiment of the present invention includes:
the generating module is used for generating a data acquisition instruction containing the state identifier; the state identification of the same incremental data is the same, and the state identification of different incremental data is different;
and the sending module is used for sending a data acquisition instruction to the slave machine.
Since the embodiments of this section correspond to the embodiments of the method section, reference is made to the description of the embodiments of the method section for the embodiments of this section, and details are not repeated here. The incremental data transmission device provided by the invention has the same beneficial effect as the incremental data transmission method applied to the host.
The host provided by the embodiment of the invention comprises a memory, a storage unit and a control unit, wherein the memory is used for storing a computer program;
a processor for implementing the steps of the incremental data transmission method of any one of the above when executing a computer program.
The processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), PLA (Programmable Logic Array). The processor may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content that the display screen needs to display. In some embodiments, the processor may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
The memory may include one or more computer-readable storage media, which may be non-transitory. The memory may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory is at least used for storing a computer program, where after the computer program is loaded and executed by the processor, the relevant steps in the method for acquiring the operation habit of the user disclosed in any one of the foregoing embodiments can be implemented. In addition, the resources stored in the memory may also include an operating system, data and the like, and the storage mode may be transient storage or permanent storage. The operating system may include Windows, unix, linux, and the like. The data may include, but is not limited to, diagnostic interaction data, diagnostic device signals, and the like.
In some embodiments, the server may further include an input output interface, a communication interface, a power source, and a communication bus.
Those skilled in the art will appreciate that the architecture in this embodiment is not limiting to the host, and may include more or fewer components than those shown.
The beneficial effect of the host provided by the invention is the same as that of the incremental data transmission method applied to the host.
Finally, the invention also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium stores thereon a computer program, which when executed by a processor implements the steps described in the above-described method embodiments (which may be a method for the master-side or a method for the slave-side or a method for the master-side and the slave-side).
It is to be understood that if the method in the above embodiments is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods described in the embodiments of the present application, or all or part of the technical solution. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The incremental data transmission method, the incremental data transmission device, the slave and the storage medium provided by the invention are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
It should also be noted that, in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a component of' 8230; \8230;" does not exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.

Claims (10)

1. An incremental data transmission method is applied to a slave machine, and comprises the following steps:
receiving a data acquisition instruction which is sent by a host and contains a state identifier; the state identification of the same incremental data is the same, and the state identification of different incremental data is different;
judging whether the current state identifier in the currently received data acquisition instruction is the same as the historical state identifier in the data acquisition instruction received last time;
if so, sending the incremental data corresponding to the historical state identification again;
if not, incremental data corresponding to the current state identifier is sent;
wherein the delta data is compressed before being transmitted.
2. The incremental data transmission method of claim 1, further comprising:
and adding a check mode to the incremental data.
3. The incremental data transmission method according to claim 2, wherein said check mode is specifically a signature check mode or a cyclic redundancy check mode.
4. The incremental data transmission method of claim 1, further comprising:
detecting whether the communication link is normal;
if not, the communication failure is prompted.
5. The incremental data transmission method of claim 1 further comprising:
and generating a transmission log containing the sending time of all the incremental data.
6. An incremental data transmission method, applied to a host, the method comprising:
generating a data acquisition instruction containing a state identifier; the state identification of the same incremental data is the same, and the state identification of different incremental data is different;
sending the data acquisition instruction to a slave machine so that the slave machine can judge whether a current state identifier in the currently received data acquisition instruction is the same as a historical state identifier in the data acquisition instruction received last time; if yes, sending the incremental data corresponding to the historical state identification again; if not, sending incremental data corresponding to the current state identification; and the slave compresses the incremental data before sending the incremental data.
7. A method of transmitting incremental data, the method comprising:
the host generates a data acquisition instruction containing a state identifier; the state identifications of the same incremental data are the same, the state identifications of different incremental data are different, and the data acquisition instruction is sent to the slave;
the slave machine receives the data acquisition instruction, judges whether a current state identifier in the currently received data acquisition instruction is the same as a historical state identifier in the data acquisition instruction received last time, and if so, sends the incremental data corresponding to the historical state identifier again, and if not, sends the incremental data corresponding to the current state identifier;
and the slave compresses the incremental data before sending the incremental data.
8. An incremental data transmission apparatus, comprising:
the receiving module is used for receiving a data acquisition instruction which is sent by the host and contains the state identifier; the state identification of the same incremental data is the same, and the state identification of different incremental data is different;
the judging module is used for judging whether a current state identifier in a currently received data acquisition instruction is the same as a historical state identifier in a data acquisition instruction received last time, if so, sending incremental data corresponding to the historical state identifier again, and if not, sending the incremental data corresponding to the current state identifier;
wherein the delta data is compressed before being transmitted.
9. A slave machine, comprising a memory for storing a computer program;
a processor for implementing the steps of the incremental data transmission method of any one of claims 1 to 5 when executing said computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the incremental data transmission method according to any one of claims 1 to 5.
CN201910779128.5A 2019-08-22 2019-08-22 Incremental data transmission method and device, slave and storage medium Active CN110492979B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910779128.5A CN110492979B (en) 2019-08-22 2019-08-22 Incremental data transmission method and device, slave and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910779128.5A CN110492979B (en) 2019-08-22 2019-08-22 Incremental data transmission method and device, slave and storage medium

Publications (2)

Publication Number Publication Date
CN110492979A CN110492979A (en) 2019-11-22
CN110492979B true CN110492979B (en) 2022-10-28

Family

ID=68552784

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910779128.5A Active CN110492979B (en) 2019-08-22 2019-08-22 Incremental data transmission method and device, slave and storage medium

Country Status (1)

Country Link
CN (1) CN110492979B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108111598A (en) * 2017-12-19 2018-06-01 腾讯科技(深圳)有限公司 Delivery method, device and the storage medium of cloud disk data

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7600021B2 (en) * 2002-04-03 2009-10-06 Microsoft Corporation Delta replication of source files and packages across networked resources
CN102271034B (en) * 2010-12-31 2012-07-04 重庆重邮信科通信技术有限公司 Long term evolution (LTE) uplink hybrid automatic repeat request (HARQ) control method
CN104348849B (en) * 2013-07-25 2019-06-14 腾讯科技(深圳)有限公司 Instant messaging key-value data distributing method, server, client and system
CN109388671B (en) * 2018-10-10 2022-02-11 腾讯科技(深圳)有限公司 Data processing method, device, equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108111598A (en) * 2017-12-19 2018-06-01 腾讯科技(深圳)有限公司 Delivery method, device and the storage medium of cloud disk data

Also Published As

Publication number Publication date
CN110492979A (en) 2019-11-22

Similar Documents

Publication Publication Date Title
CN106294102B (en) Application program testing method, client, server and system
CN111211929A (en) Fault positioning method, fault positioning device, control equipment and intelligent equipment
CN110289997B (en) Log message checking method, device and system
CN110930131A (en) Vehicle maintenance method, device, equipment and medium
CN111555841A (en) Communication data checking method, device, equipment and medium
CN112069008A (en) Equipment debugging information acquisition method and device and equipment debugging information generation method
CN114020297A (en) Bluetooth-based intelligent water meter program upgrading method, device, equipment and medium
CN103914368A (en) Security software performance test method, system and device
CN113259996A (en) IOT wireless debugging method and equipment
CN110492979B (en) Incremental data transmission method and device, slave and storage medium
CN117632166A (en) File burning method, device, equipment and storage medium
CN117391099A (en) Data downloading and checking method and system for smart card and storage medium
CN115129509B (en) Data transmission method, device and medium
CN112463067A (en) Data protection method and equipment in NVMe-oF scene
CN112947964A (en) Chip firmware updating method, device, equipment and storage medium
CN112114220A (en) Fault detection method and device
WO2023131073A1 (en) Self-checking method and apparatus for head unit testing
CN116931829A (en) Disk information transmission method, device, equipment and storage medium
CN115220923A (en) Signal verification method, medium, electronic device, and program product
CN109150414B (en) Method, device, equipment and storage medium for enhancing Bluetooth communication stability between equipment
CN110928955B (en) Data interaction method and device, computer equipment and storage medium
CN113626279B (en) I2C communication monitoring method, device, CPLD and medium
CN116341011B (en) Detection system and method
CN113806069B (en) Nuclear power station system interaction method and device, peripheral system and storage medium
KR101761075B1 (en) Data processing device, data communication device, communication system, data processing method, data communication method, and recording medium

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