CN113609532B - Data integrity checking method and device, computer equipment and storage medium - Google Patents

Data integrity checking method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113609532B
CN113609532B CN202110932361.XA CN202110932361A CN113609532B CN 113609532 B CN113609532 B CN 113609532B CN 202110932361 A CN202110932361 A CN 202110932361A CN 113609532 B CN113609532 B CN 113609532B
Authority
CN
China
Prior art keywords
data
issued
check code
mark file
receiving end
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
CN202110932361.XA
Other languages
Chinese (zh)
Other versions
CN113609532A (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.)
Sungrow Power Supply Co Ltd
Original Assignee
Sungrow Power Supply 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 Sungrow Power Supply Co Ltd filed Critical Sungrow Power Supply Co Ltd
Priority to CN202110932361.XA priority Critical patent/CN113609532B/en
Publication of CN113609532A publication Critical patent/CN113609532A/en
Application granted granted Critical
Publication of CN113609532B publication Critical patent/CN113609532B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Abstract

The invention discloses a data integrity checking method, a data integrity checking device, computer equipment and a storage medium. The method comprises the following steps when being executed by a data receiving end: if the flag file is not renamed, generating a receiving check code of the issued data, and acquiring the issued check code in the flag file; the mark file is generated according to a mark file creation instruction sent by a data sending end, and the issuing check code is generated by the data sending end according to data to be issued and is stored in the mark file creation instruction; and carrying out integrity check on the issued data according to the received check code and the issued check code. By using the technical scheme of the invention, the data issuing efficiency can be improved, and the repeated issuing and ineffective issuing of the data can be reduced.

Description

Data integrity checking method and device, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of the Internet of things and the technical field of intelligent zero-carbon equipment management in the scene of the Internet of things, in particular to a data integrity checking method, a data integrity checking device, computer equipment and a storage medium.
Background
In the scenario, a large number of intelligent devices and semi-intelligent devices are connected to the network, and higher requirements are also put on the complexity and bandwidth of a system network. Meanwhile, due to the limitation of the resources of the Internet of things equipment, the characteristics of small data files and high frequency are presented on the information exchange and data file transmission with the equipment management platform.
In a conventional internet scenario, integrity checking of transmitted data is typically performed by: creating a mark file at a data receiving end by a data transmitting end, and renaming the mark file after the transmission of the data to be transmitted is completed. The data receiving end judges whether the data transmission is complete or not by checking whether the renamed mark file exists or not. Or the data transmitting end calculates the check code of the data to be transmitted, sends the check code and the data to be transmitted to the data receiving end, the data receiving end calculates the check code of the received data, compares the two check codes, and judges whether the data transmission is complete.
In the first verification manner, after the data transmission is completed, if the network abnormality causes the renaming failure of the flag file, the repeated issuing of the data is easily caused. In the second verification mode, due to lack of feedback of the data receiving end, the problem of repeated data issuing also exists. The technical scheme in the prior art is not suitable for the situation of the Internet of things, and the intelligent zero-carbon equipment management platform performs data integrity verification of the issued data on the accessed intelligent networking terminal equipment or the edge networking terminal equipment.
Disclosure of Invention
The embodiment of the invention provides a data integrity checking method, a data integrity checking device, computer equipment and a storage medium, so that the data issuing efficiency is improved, and repeated issuing and invalid issuing of data are reduced.
In a first aspect, an embodiment of the present invention provides a data integrity checking method, where the method includes:
if the flag file is not renamed, generating a receiving check code of the issued data, and acquiring the issued check code in the flag file;
the mark file is generated according to a mark file creation instruction sent by a data sending end, and the issuing check code is generated by the data sending end according to data to be issued and is stored in the mark file creation instruction;
and carrying out integrity check on the issued data according to the received check code and the issued check code.
In a second aspect, an embodiment of the present invention provides a data integrity checking method, including:
generating an issuing check code of the data to be issued, generating a mark file creation instruction according to the issuing check code, and sending the mark file creation instruction to a data receiving end so that the data receiving end generates a mark file which stores the issuing check code;
Transmitting the data to be issued to a data receiving end, and sending a flag file renaming instruction to the data receiving end so that the data receiving end renames the flag file;
if a renaming success instruction fed back by the data receiving end is received, determining that the data to be issued is completely issued; and the renaming success instruction is sent after the data receiving end renames the mark file according to the mark file renaming instruction, or the data receiving end sends when the mark file is not renamed and the issuing check code in the mark file is the same as the receiving check code of the issued data.
In a third aspect, an embodiment of the present invention provides a data integrity checking apparatus, including:
the check code acquisition module is used for generating a receiving check code of the issued data and acquiring the issued check code in the mark file if the mark file is not renamed;
the mark file is generated according to a mark file creation instruction sent by a data sending end, and the issuing check code is generated by the data sending end according to data to be issued and is stored in the mark file creation instruction;
and the data integrity checking module is used for carrying out integrity checking on the issued data according to the received check code and the issued check code.
In a fourth aspect, an embodiment of the present invention provides a data integrity checking apparatus, including:
the mark file creation instruction sending module is used for generating an issuing check code of the data to be issued, generating a mark file creation instruction according to the issuing check code, and sending the mark file creation instruction to the data receiving end so that the data receiving end generates a mark file which stores the issuing check code;
the mark file renaming instruction sending module is used for transmitting the data to be issued to the data receiving end and sending a mark file renaming instruction to the data receiving end so that the data receiving end renames the mark file;
the data integrity confirmation module is used for determining that the data to be issued is completely issued if a renaming success instruction fed back by the data receiving end is received; and the renaming success instruction is sent after the data receiving end renames the mark file according to the mark file renaming instruction, or the data receiving end sends when the mark file is not renamed and the issuing check code in the mark file is the same as the receiving check code of the issued data.
In a fifth aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the processor implements the data integrity checking method according to any one of the embodiments of the present invention when executing the program.
In a sixth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions which, when executed by a computer processor, are used to perform a data integrity checking method as described in any of the embodiments of the present invention.
According to the embodiment of the invention, the mark file is generated when the mark file creation instruction sent by the data sending end is received, and when the data integrity check is carried out on the issued data, if the mark file is not renamed, but the receiving check code of the issued data is the same as the issuing check code in the mark file, the issued data is determined to be complete. The method solves the problems that in the prior art, the verification result of the data integrity verification mode is inaccurate, and repeated data issuing is easy to cause, improves the accuracy and efficiency of data issuing, and reduces repeated issuing and invalid issuing of data.
Drawings
FIG. 1 is a flow chart of a data integrity checking method according to a first embodiment of the present invention;
FIG. 2 is a flow chart of yet another data integrity verification method in accordance with a second embodiment of the present invention;
FIG. 3 is a flow chart of a data integrity verification method in accordance with a third embodiment of the present invention;
FIG. 4 is a flow chart of a data integrity verification method in accordance with a fourth embodiment of the present invention;
FIG. 5 is a schematic diagram of a data integrity checking apparatus according to a fifth embodiment of the present invention;
FIG. 6 is a schematic diagram of a data integrity checking apparatus according to a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a computer device in a seventh embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flowchart of a data integrity verification method provided in an embodiment of the present invention, where the embodiment is applicable to a case of verifying the integrity of received data in a data distribution scenario of the internet of things, the method may be performed by a data integrity verification device, which may be implemented by software and/or hardware and is generally integrated in a computer device, and the computer device may be a data receiving device, typically an intelligent network terminal device or an edge network terminal device.
As shown in fig. 1, the technical solution of the embodiment of the present invention specifically includes the following steps:
s110, if the fact that the mark file is not renamed is determined, generating a receiving check code of the issued data, and acquiring the issued check code in the mark file.
The mark file is generated according to a mark file creation instruction sent by a data sending end, and the issuing check code is generated by the data sending end according to data to be issued and is stored in the mark file creation instruction.
Specifically, the data transmitting end may establish socket connection with the data receiving end in advance, generate a sending check code according to the data to be sent, construct a flag file creation instruction according to the sending check code, send the flag file creation instruction to the data receiving end, and generate the flag file after the data receiving end receives the instruction.
The data transmitting end generates the transmitting check code according to the data to be transmitted, and the data receiving end generates the receiving check code according to the transmitted data, and may adopt a hash algorithm such as MD5 information digest algorithm, SHA-256 (Secure Hash Algorithm, secure hash algorithm 256), etc., and the specific mode adopted by the data transmitting end to generate the transmitting check code according to the data to be transmitted is the same as the specific mode adopted by the data receiving end to generate the receiving check code according to the transmitted data, but the specific algorithm for generating the data check code is not limited in this embodiment.
It should be noted that, in this embodiment, the checking process of the data receiving end to the issued data is described by taking the flag file as an example, but the checking process is not limited to the flag file, and may be a flag bit in the memory. Specifically, the data transmitting end generates an issuing check code according to data to be issued, constructs a flag bit creation instruction according to the issuing check code, creates a flag bit in the memory after receiving the flag bit creation instruction by the data receiving end, and writes the issuing check code into the memory. After the data to be issued is issued by the data transmitting end, a flag bit modification instruction is transmitted to the data receiving end. And the data receiving end performs data integrity verification according to whether the flag bit is modified and whether the check codes are equal.
S120, carrying out integrity check on the issued data according to the received check code and the issued check code.
In the embodiment of the invention, when the receiving check code and the issuing check code are the same, the issued data is indicated to be complete data, otherwise, the issued data is indicated to be incomplete. According to the embodiment of the invention, the integrity of the issued data is comprehensively judged according to whether the mark file is renamed or not and whether the check codes are the same or not, so that the capability of the data receiving end for detecting the data integrity is improved, whether the data is complete or not can be accurately judged, and the erroneous judgment of the data integrity is eliminated.
According to the technical scheme, the mark file is generated when the mark file creation instruction sent by the data sending end is received, and when the data integrity of the issued data is checked, if the mark file is not renamed, but the receiving check code of the issued data is the same as the issuing check code in the mark file, the issued data is determined to be complete. The method solves the problems that in the prior art, the verification result of the data integrity verification mode is inaccurate, and repeated data issuing is easy to cause, improves the accuracy and efficiency of data issuing, and reduces repeated issuing and invalid issuing of data.
Example two
Fig. 2 is a flowchart of yet another data integrity verification method provided in a second embodiment of the present invention, where the step of creating a flag file and renaming the flag file according to an instruction issued by a data transmitting end is added on the basis of the foregoing embodiment.
Correspondingly, as shown in fig. 2, the technical scheme of the embodiment of the invention specifically includes the following steps:
s210, creating a mark file according to the received mark file creation instruction, acquiring an issuing check code in the mark file creation instruction, and storing the issuing check code in the mark file.
Before sending the data to be issued, the data sending end calculates an issuing check code in advance according to the data to be issued, and constructs a mark file creation instruction according to the issuing check code. After receiving the mark file creation instruction, the data receiving end creates a mark file, and writes the issued check code into the mark file.
S220, renaming the mark file according to the received mark file renaming instruction.
After the data sending end sends the data to be sent, a flag file renaming instruction is sent to the data receiving end, and after the data receiving end receives the flag file renaming instruction, the flag file is renamed. If the network state is normal, the data receiving end renames the mark file successfully, and then the data to be issued is completely issued. Otherwise, if network delay or failure is encountered, the flag file is not successfully renamed and verification of data integrity may continue according to the check code.
Optionally, after the data sending end issues the data to be issued, the data receiving end may perform verification on the integrity of the data synchronously or asynchronously.
Specifically, when the data receiving end asynchronously performs data integrity check, the data sending end sends a check notification instruction to the data receiving end after the data sending end issues the data, and after the data receiving end receives the check notification instruction sent by the data sending end, the data receiving end checks the name of the mark file first and then checks the check code to check the data integrity. The data sending end can disconnect the connection with the data receiving end after the data sending end sends the data, reestablish the connection with the data receiving end, send the checking notification instruction to the data sending end through the newly established connection, and check the data integrity after the data receiving end receives the checking notification instruction. The data receiving end can also automatically check the data integrity at regular intervals. The data integrity check of the data receiving end in this embodiment is synchronous or asynchronous, and the method during asynchronous processing is not limited.
S230, judging whether the target mark file is renamed, if so, executing S280, otherwise, executing S240.
When the data transmitting end performs integrity check on the data issued by the target, firstly, whether the target mark file matched with the data issued by the target is renamed is checked, and if the target mark file is renamed, the integrity of the data issued by the target is indicated.
S240, generating a receiving check code of the issued data, and acquiring the issued check code in the target mark file.
If the target mark file is not renamed, the data transmitting end continues to check the check code of the data issued by the target.
S250, judging whether the receiving check code and the issuing check code are the same, if so, executing S260, otherwise, executing S270.
If the received check code is the same as the issued check code, the issued data is complete, but at this time, the target mark file may not be renamed successfully due to network delay and other reasons, so that after confirming that the issued data is complete, the target mark file is renamed.
If the received check code is different from the issued check code, the issued data is incomplete and cannot be used. Optionally, the issued data is invalid data at this time, so that the issued data can be cleaned, and the space of the data receiving end is saved.
S260, determining that the issued data is complete, and renaming the target mark file.
S270, determining that the issued data is incomplete.
S280, determining that the issued data is complete.
According to the technical scheme of the embodiment, the mark file with the issued check code is generated when the mark file creation instruction sent by the data sending end is received, and when the data integrity of the issued data is checked, if the mark file is renamed or is not renamed, the received check code of the issued data is the same as the issued check code in the mark file, and the issued data is determined to be complete. The method solves the problems that in the prior art, the verification result of the data integrity verification mode is inaccurate, and repeated data issuing is easy to cause, improves the accuracy and efficiency of data issuing, and reduces repeated issuing and invalid issuing of data.
Example III
Fig. 3 is a flowchart of a data integrity verification method provided by a third embodiment of the present invention, where the present embodiment is applicable to a case of verifying the integrity of data to be delivered in a data delivery scenario of the internet of things, the method may be performed by a data integrity verification device, and the device may be implemented by software and/or hardware and is generally integrated in a computer device, and the computer device may be a device management platform in the internet of things, in particular, a data sending device.
As shown in fig. 3, the technical solution of the embodiment of the present invention specifically includes the following steps:
s310, generating an issuing check code of the data to be issued, generating a mark file creation instruction according to the issuing check code, and sending the mark file creation instruction to a data receiving end so that the data receiving end generates a mark file storing the issuing check code.
The data transmitting end is connected with the data receiving end in advance, and generates a transmitting check code according to the data to be transmitted before transmitting the data to be transmitted, a mark file creating instruction is constructed according to the transmitting check code and is transmitted to the data receiving end, and after the data receiving end receives the mark file creating instruction, the mark file is created, and the transmitting check code is written into the mark file.
S320, transmitting the data to be issued to a data receiving end, and sending a flag file renaming instruction to the data receiving end so that the data receiving end renames the flag file.
After the data transmitting end transmits the data to be transmitted after transmitting the data, a renaming instruction of the mark file is transmitted to the data receiving end, the data receiving end renames the mark file after receiving the renaming instruction of the mark file, and the data receiving end feeds back the instruction of successful renaming to the data transmitting end after renaming the mark file.
S330, if a renaming success instruction fed back by the data receiving end is received, determining that the data to be issued is completely issued.
And the renaming success instruction is sent after the data receiving end renames the mark file according to the mark file renaming instruction, or the data receiving end sends when the mark file is not renamed and the issuing check code in the mark file is the same as the receiving check code of the issued data.
When the data receiving end determines that the mark file matched with the data to be issued sent by the data sending end is renamed, the data receiving end determines that the data to be issued of the data sending end is completely issued. Or although the mark file is not renamed, when the check code of the received issued data is the same as the check code in the mark file, the to-be-issued data of the data transmitting end can be determined to be completely issued. In both cases, the data receiving end feeds back a renaming success instruction to the data sending end, and after the data sending end receives the renaming success instruction, the data to be issued is determined to be successfully issued. The purpose of this arrangement is to avoid repeated delivery of data.
According to the technical scheme, before the data is sent out, the data sending end sends the mark file creation instruction to the data receiving end, so that the data receiving end generates the mark file with the sending check code stored therein, and after the data to be sent out is sent out, the mark file renaming instruction is sent to the data receiving end, so that the data receiving end can check the data integrity according to the mark file name and the check code, and when the renaming success instruction fed back by the data receiving end is received, the data is determined to be completely sent out. The method solves the problems that in the prior art, the verification result of the data integrity verification mode is inaccurate, and repeated data issuing is easy to cause, improves the accuracy and efficiency of data issuing, and reduces repeated issuing and invalid issuing of data.
Example IV
Fig. 4 is a flowchart of yet another data integrity verification method according to a fourth embodiment of the present invention, where a process of determining that the data to be delivered fails in delivery is added on the basis of the above embodiment, and a process of pre-determining whether the data to be delivered has been completely delivered before delivering the data to be delivered.
Correspondingly, as shown in fig. 4, the technical solution of the embodiment of the present invention specifically includes the following steps:
s410, generating a transmitting check code of data to be transmitted.
In the embodiment of the invention, after the data transmitting end establishes the issuing connection with the data receiving end, the issuing check code of the data to be issued is generated.
S420, sending a query instruction to the data receiving end and receiving a query result fed back by the data receiving end.
Before the data to be issued is issued, the data transmitting end actively inquires whether the data to be issued is successfully issued or not, and if the data to be issued is successfully issued before, repeated issuing is not needed.
S430, judging whether the renamed mark file exists according to the query result, if so, executing S440, otherwise, executing S450.
When the flag file at the data receiving end is renamed or the flag file at the data receiving end is not renamed, but the check code in the flag file is the same as the issuing check code of the data to be issued, the data to be issued can be considered to be successfully issued without repeating the issuing.
S440, determining that the data to be issued is completely issued. S4100 is performed.
In the embodiment of the invention, the data transmitting end judges whether the data to be transmitted is successfully transmitted or not by detecting whether the mark file of the data receiving end is renamed or not.
Optionally, the data sending end may also determine, through the status of the issuing log, whether the data to be issued has been completely issued before. The state of the issuing log can be divided into the issuing/issuing, the successful issuing and the issuing failure, and the data transmitting end can also establish the issuing log of the data to be issued before generating the issuing check code of the data to be issued when the data to be issued is issued for the first time. After the data receiving end receives the renaming instruction of the mark file, after the mark file is renamed successfully, when the data receiving end receives the renaming success instruction fed back by the data receiving end, the state of the issuing log is modified to be successful. When the data receiving end determines that the mark file is not renamed, but the issuing check code in the mark file is the same as the receiving check code of the issued data, renaming the mark file, feeding back a renaming success instruction after renaming, and when the data sending end receives the renaming success instruction, modifying the state of the issued log into the issuing success, or the data sending end sends a mark file name inquiry instruction to the data receiving end at regular time, and after the renaming of the mark file is determined, modifying the state of the issued log into the issuing success.
Similarly, if the data receiving end determines that the flag file is not renamed and the issuing check code and the receiving check code are different, the data receiving end feeds back an issuing failure instruction to the data sending end, and when the data sending end receives the issuing failure instruction, the data sending end changes the state of the issuing log into issuing failure. Or the data transmitting end sends check code inquiry instructions to the data receiving end at regular time, and when the check codes are confirmed to be different in times and reach the maximum check times, the data transmitting end modifies the state of the issuing log into issuing failure. Or the data transmitting end determines that the renaming success instruction fed back by the data receiving end is not received yet after the preset time interval is exceeded, and the state of the issuing log is modified into the issuing failure.
When the data transmitting end transmits the target data, firstly, whether a transmission log matched with the target data exists or not is detected, if the transmission log does not exist, the transmission log can be newly established, the transmission flow is continuously executed, and after the transmission data is completed, the transmission log state is updated. If the issuing log exists and the issuing log state is the issuing failure, continuing to execute the issuing flow, and updating the issuing log state after the issuing data is completed. If the issuing log exists and the issuing log state is successful, the issuing data is not repeated. If the issuing logs exist, but the state of the timing retrieval issuing logs is to be issued/issued, and the retrieval times exceed the preset retrieval times, the target data is determined to be unsuccessful in issuing, and the issuing needs to be performed again.
The timing in the present embodiment may refer to every fixed time interval, or may refer to every linearly increasing time interval, or every exponentially increasing time interval, which is not limited in the present embodiment.
In the embodiment of the invention, the data transmitting end judges whether the data is issued or not in advance before issuing the data, thereby improving the accuracy and efficiency of data issuing and reducing repeated issuing and invalid issuing of the data.
S450, generating a mark file creation instruction according to the issued check code, and sending the mark file creation instruction to the data receiving end so that the data receiving end generates and stores the mark file of the issued check code.
In the embodiment of the invention, if the data to be delivered is not completely delivered, the data to be delivered is delivered in a mode of S450-S4100. S450-S4100 are similar to the above embodiments, and the description of this embodiment is omitted here.
S460, transmitting the data to be issued to the data receiving end, and sending a flag file renaming instruction to the data receiving end so that the data receiving end renames the flag file.
S470, judging whether a renaming success instruction fed back by the data receiving end is received, if yes, returning to execute S440, otherwise executing S480.
S480, judging whether a failure issuing instruction fed back by the data receiving end is received, if yes, executing S490, otherwise executing S4100.
S490, determining failure of issuing data to be issued.
The issuing failure instruction is that the data receiving end does not rename the mark file when determining that the mark file is not renamed, and the issuing check code in the mark file is not transmitted when the receiving check code of the issued data is different.
S4100, ending.
It should be noted that, in this embodiment, when the data to be issued is issued, the data receiving end renames the flag file when the flag file is not renamed, but the issuing check code in the flag file is the same as the receiving check code of the issued data. Therefore, when the data transmitting end judges whether the data is completely transmitted before transmitting the data, the data transmitting end only needs to judge whether the renamed mark file exists in the data receiving end. When the data receiving end determines that the sending check code in the flag file is the same as the receiving check code of the sent data, and does not rename the flag file, the data sending end needs to judge whether the flag file is renamed or not when judging whether the data to be sent is completely sent before the data to be sent, or the flag file is not renamed, but the check code in the flag file is the same as the check code of the data to be sent, which is not limited in this embodiment.
According to the technical scheme, the data transmitting end transmits the query instruction to the data receiving end before transmitting the data, whether the data to be transmitted is completely transmitted or not is queried, when the data to be transmitted is not completely transmitted before, the data receiving end transmits the mark file creation instruction to enable the data receiving end to generate the mark file with the transmitting check code stored therein, and after transmitting the data to be transmitted, the data receiving end transmits the mark file renaming instruction to enable the data receiving end to perform data integrity check according to the name of the mark file and the check code, when the renaming success instruction fed back by the data receiving end is received, the data is determined to be completely transmitted, and when the transmitting failure instruction fed back by the data receiving end is received, the transmitting failure of the data to be transmitted is determined. The method solves the problems that in the prior art, the verification result of the data integrity verification mode is inaccurate, and repeated data issuing is easy to cause, improves the accuracy and efficiency of data issuing, and reduces repeated issuing and invalid issuing of data.
Example five
Fig. 5 is a schematic structural diagram of a data integrity checking apparatus in a fifth embodiment of the present invention, where the apparatus is disposed in a data receiving end, and typically, the data receiving end may be an intelligent networking terminal device or an edge networking terminal device. The device comprises: a check code acquisition module 510 and a data integrity check module 520, wherein:
The check code obtaining module 510 is configured to generate a received check code of the issued data if it is determined that the flag file is not renamed, and obtain the issued check code in the flag file;
the mark file is generated according to a mark file creation instruction sent by a data sending end, and the issuing check code is generated by the data sending end according to data to be issued and is stored in the mark file creation instruction;
the data integrity check module 520 is configured to perform integrity check on the issued data according to the received check code and the issued check code.
According to the technical scheme, the mark file is generated when the mark file creation instruction sent by the data sending end is received, and when the data integrity of the issued data is checked, if the mark file is not renamed, but the receiving check code of the issued data is the same as the issuing check code in the mark file, the issued data is determined to be complete. The method solves the problems that in the prior art, the verification result of the data integrity verification mode is inaccurate, and repeated data issuing is easy to cause, improves the accuracy and efficiency of data issuing, and reduces repeated issuing and invalid issuing of data.
Based on the above embodiment, the data integrity verification module 520 includes:
and the data integrity confirming unit is used for confirming that the issued data is complete and renaming the mark file if the received check code is the same as the issued check code.
On the basis of the above embodiment, the apparatus further includes:
the mark file creating module is used for creating a mark file according to the received mark file creating instruction, acquiring an issuing check code in the mark file creating instruction and storing the issuing check code into the mark file;
and the mark file renaming module is used for renaming the mark file according to the received mark file renaming instruction.
The data integrity checking device provided by the embodiment of the invention can execute the data integrity checking method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example six
Fig. 6 is a schematic structural diagram of a data integrity verification device provided in a sixth embodiment of the present invention, where the device is disposed in a data transmitting end, and typically may be a device management platform in the internet of things. The device comprises: the flag file creation instruction sending module 610, the flag file renaming instruction sending module 620, and the data integrity validation module 630. Wherein:
The mark file creation instruction sending module 610 is configured to generate an issuing check code of data to be issued, generate a mark file creation instruction according to the issuing check code, and send the mark file creation instruction to the data receiving end, so that the data receiving end generates a mark file storing the issuing check code;
the flag file renaming instruction sending module 620 is configured to transmit data to be issued to the data receiving end, and send a flag file renaming instruction to the data receiving end, so that the data receiving end renames the flag file;
the data integrity confirmation module 630 is configured to determine that the data to be sent is completely sent if a renaming success instruction fed back by the data receiving end is received; and the renaming success instruction is sent after the data receiving end renames the mark file according to the mark file renaming instruction, or the data receiving end sends when the mark file is not renamed and the issuing check code in the mark file is the same as the receiving check code of the issued data.
According to the technical scheme, before the data is sent out, the data sending end sends the mark file creation instruction to the data receiving end, so that the data receiving end generates the mark file with the sending check code stored therein, and after the data to be sent out is sent out, the mark file renaming instruction is sent to the data receiving end, so that the data receiving end can check the data integrity according to the mark file name and the check code, and when the renaming success instruction fed back by the data receiving end is received, the data is determined to be completely sent out. The method solves the problems that in the prior art, the verification result of the data integrity verification mode is inaccurate, and repeated data issuing is easy to cause, improves the accuracy and efficiency of data issuing, and reduces repeated issuing and invalid issuing of data.
On the basis of the above embodiment, the apparatus further includes:
the data transmission failure confirming module is used for determining transmission failure of data to be transmitted if a transmission failure instruction fed back by the data receiving end is received; the issuing failure instruction is that the data receiving end does not rename the mark file when determining that the mark file is not renamed, and the issuing check code in the mark file is not transmitted when the receiving check code of the issued data is different.
On the basis of the above embodiment, the apparatus further includes:
the query result acquisition module is used for sending a query instruction to the data receiving end and receiving a query result fed back by the data receiving end;
and the data issued confirmation module is used for determining that the data to be issued is completely issued if the renamed mark file exists according to the query result.
The data integrity checking device provided by the embodiment of the invention can execute the data integrity checking method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example seven
Fig. 7 is a schematic structural diagram of a computer device according to a seventh embodiment of the present invention, and as shown in fig. 7, the computer device includes a processor 70, a memory 71, an input device 72, and an output device 73; the number of processors 70 in the computer device may be one or more, one processor 70 being taken as an example in fig. 7; the processor 70, memory 71, input means 72 and output means 73 in the computer device may be connected by a bus or other means, in fig. 7 by way of example.
The memory 71 is used as a computer readable storage medium for storing a software program, a computer executable program, and a module, such as a module corresponding to a data integrity checking method in an embodiment of the present invention (for example, a check code obtaining module 510 and a data integrity checking module 520 in a data integrity checking device, or a flag file creation instruction sending module 610, a flag file renaming instruction sending module 620, and a data integrity confirming module 630 in a data integrity checking device). The processor 70 executes various functional applications of the computer device and data processing, i.e., implements the data integrity checking method described above, by running software programs, instructions and modules stored in the memory 71. The method comprises the following steps:
if the flag file is not renamed, generating a receiving check code of the issued data, and acquiring the issued check code in the flag file;
the mark file is generated according to a mark file creation instruction sent by a data sending end, and the issuing check code is generated by the data sending end according to data to be issued and is stored in the mark file creation instruction;
And carrying out integrity check on the issued data according to the received check code and the issued check code.
Alternatively, a data integrity checking method as described above is implemented. The method comprises the following steps:
generating an issuing check code of the data to be issued, generating a mark file creation instruction according to the issuing check code, and sending the mark file creation instruction to a data receiving end so that the data receiving end generates a mark file which stores the issuing check code;
transmitting the data to be issued to a data receiving end, and sending a flag file renaming instruction to the data receiving end so that the data receiving end renames the flag file;
if a renaming success instruction fed back by the data receiving end is received, determining that the data to be issued is completely issued; and the renaming success instruction is sent after the data receiving end renames the mark file according to the mark file renaming instruction, or the data receiving end sends when the mark file is not renamed and the issuing check code in the mark file is the same as the receiving check code of the issued data.
The memory 71 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for functions; the storage data area may store data created according to the use of the terminal, etc. In addition, memory 71 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, memory 71 may further include memory remotely located relative to processor 70, which may be connected to the computer device 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.
The input device 72 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the computer device. The output means 73 may comprise a display device such as a display screen.
Example eight
An eighth embodiment of the present invention also provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a data integrity checking method comprising:
if the flag file is not renamed, generating a receiving check code of the issued data, and acquiring the issued check code in the flag file;
the mark file is generated according to a mark file creation instruction sent by a data sending end, and the issuing check code is generated by the data sending end according to data to be issued and is stored in the mark file creation instruction;
and carrying out integrity check on the issued data according to the received check code and the issued check code.
Alternatively, a data integrity checking method as described above is performed. The method comprises the following steps:
generating an issuing check code of the data to be issued, generating a mark file creation instruction according to the issuing check code, and sending the mark file creation instruction to a data receiving end so that the data receiving end generates a mark file which stores the issuing check code;
Transmitting the data to be issued to a data receiving end, and sending a flag file renaming instruction to the data receiving end so that the data receiving end renames the flag file;
if a renaming success instruction fed back by the data receiving end is received, determining that the data to be issued is completely issued; and the renaming success instruction is sent after the data receiving end renames the mark file according to the mark file renaming instruction, or the data receiving end sends when the mark file is not renamed and the issuing check code in the mark file is the same as the receiving check code of the issued data.
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present invention is not limited to the above-described method operations, and may also perform the related operations in the data integrity checking method provided in any embodiment of the present invention.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, etc., and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the data integrity checking apparatus, each unit and module included are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (11)

1. A method of data integrity verification performed by a data receiving end, the method comprising:
if the flag file is not renamed, generating a receiving check code of the issued data, and acquiring the issued check code in the flag file;
The mark file is generated according to a mark file creation instruction sent by a data sending end, and the issuing check code is generated by the data sending end according to data to be issued and is stored in the mark file creation instruction; after the data to be issued is issued by the data transmitting end, a flag file renaming instruction is transmitted to the data receiving end, so that the data receiving end renames the flag file after receiving the flag file renaming instruction;
carrying out integrity check on the issued data according to the received check code and the issued check code;
the method further comprises the steps of:
and if the flag file is determined to be renamed successfully, determining that the data to be issued is completely issued.
2. The method of claim 1, wherein the integrity checking of the delivered data based on the received check code and the delivered check code comprises:
if the received check code is the same as the issued check code, the issued data is determined to be complete, and the mark file is renamed.
3. The method of claim 1, further comprising, prior to determining that the flag file is not renamed:
Creating a mark file according to the received mark file creation instruction, acquiring an issuing check code in the mark file creation instruction, and storing the issuing check code into the mark file;
and renaming the mark file according to the received mark file renaming instruction.
4. A method for verifying data integrity, performed by a data transmitting end, the method comprising:
generating an issuing check code of the data to be issued, generating a mark file creation instruction according to the issuing check code, and sending the mark file creation instruction to a data receiving end so that the data receiving end generates a mark file which stores the issuing check code;
transmitting the data to be issued to a data receiving end, and sending a flag file renaming instruction to the data receiving end so that the data receiving end renames the flag file;
if a renaming success instruction fed back by the data receiving end is received, determining that the data to be issued is completely issued; and the renaming success instruction is sent after the data receiving end renames the mark file according to the mark file renaming instruction, or the data receiving end sends when the mark file is not renamed and the issuing check code in the mark file is the same as the receiving check code of the issued data.
5. The method according to claim 4, further comprising:
if a sending failure instruction fed back by the data receiving end is received, determining that the sending of the data to be sent fails; the issuing failure instruction is that the data receiving end does not rename the mark file when determining that the mark file is not renamed, and the issuing check code in the mark file is not transmitted when the receiving check code of the issued data is different.
6. The method of claim 4, further comprising, after generating the delivery verification code for the data to be delivered:
sending a query instruction to a data receiving end and receiving a query result fed back by the data receiving end;
if the renamed mark file exists according to the query result, the data to be issued is determined to be completely issued.
7. A data integrity verification apparatus deployed in a data receiving terminal, the apparatus comprising:
the check code acquisition module is used for generating a receiving check code of the issued data and acquiring the issued check code in the mark file if the mark file is not renamed;
the mark file is generated according to a mark file creation instruction sent by a data sending end, and the issuing check code is generated by the data sending end according to data to be issued and is stored in the mark file creation instruction; after the data to be issued is issued by the data transmitting end, a flag file renaming instruction is transmitted to the data receiving end, so that the data receiving end renames the flag file after receiving the flag file renaming instruction;
The data integrity checking module is used for carrying out integrity checking on the issued data according to the received check code and the issued check code;
and the data integrity checking module is further configured to determine that the data to be issued is completely issued if it is determined that the flag file has been renamed successfully.
8. A data integrity verification apparatus deployed in a data transmitting end, the apparatus comprising:
the mark file creation instruction sending module is used for generating an issuing check code of the data to be issued, generating a mark file creation instruction according to the issuing check code, and sending the mark file creation instruction to the data receiving end so that the data receiving end generates a mark file which stores the issuing check code;
the mark file renaming instruction sending module is used for transmitting the data to be issued to the data receiving end and sending a mark file renaming instruction to the data receiving end so that the data receiving end renames the mark file;
the data integrity confirmation module is used for determining that the data to be issued is completely issued if a renaming success instruction fed back by the data receiving end is received; and the renaming success instruction is sent after the data receiving end renames the mark file according to the mark file renaming instruction, or the data receiving end sends when the mark file is not renamed and the issuing check code in the mark file is the same as the receiving check code of the issued data.
9. A device management platform, characterized in that the platform establishes a connection with at least two intelligent networking terminal devices and/or edge networking terminal devices, the platform being adapted to perform the data integrity checking method according to any of claims 4-6.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the data integrity verification method of any one of claims 1-3 or 4-6 when the program is executed by the processor.
11. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the data integrity checking method of any one of claims 1-3 or 4-6.
CN202110932361.XA 2021-08-13 2021-08-13 Data integrity checking method and device, computer equipment and storage medium Active CN113609532B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110932361.XA CN113609532B (en) 2021-08-13 2021-08-13 Data integrity checking method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110932361.XA CN113609532B (en) 2021-08-13 2021-08-13 Data integrity checking method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113609532A CN113609532A (en) 2021-11-05
CN113609532B true CN113609532B (en) 2024-04-12

Family

ID=78340703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110932361.XA Active CN113609532B (en) 2021-08-13 2021-08-13 Data integrity checking method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113609532B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000295239A (en) * 1999-04-06 2000-10-20 Nec Commun Syst Ltd Transfer control system and method for detecting faulty node at file transfer
CN101060696A (en) * 2006-04-17 2007-10-24 大唐移动通信设备有限公司 A method for ensuring the compatible integrity parameters from both the receiving and sending parties
CN101388058A (en) * 2008-10-17 2009-03-18 北大方正集团有限公司 Data integrity verifying method and apparatus
CN102143010A (en) * 2010-08-24 2011-08-03 华为软件技术有限公司 Method for detecting message revision, sender equipment and receiver equipment
CN104579558A (en) * 2014-12-05 2015-04-29 苏州沃斯麦机电科技有限公司 Method for detecting integrity in data transmission process
CN105488425A (en) * 2015-11-30 2016-04-13 中国科学院国家授时中心 Data security assurance method based on serial port transmission
CN112905106A (en) * 2019-12-04 2021-06-04 贵州白山云科技股份有限公司 Data processing method, device, system, equipment and storage medium
CN112953812A (en) * 2021-01-29 2021-06-11 西藏宁算科技集团有限公司 File message uploading and storing method and device thereof
WO2021134418A1 (en) * 2019-12-31 2021-07-08 华为技术有限公司 Data checking method and apparatus

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000295239A (en) * 1999-04-06 2000-10-20 Nec Commun Syst Ltd Transfer control system and method for detecting faulty node at file transfer
CN101060696A (en) * 2006-04-17 2007-10-24 大唐移动通信设备有限公司 A method for ensuring the compatible integrity parameters from both the receiving and sending parties
CN101388058A (en) * 2008-10-17 2009-03-18 北大方正集团有限公司 Data integrity verifying method and apparatus
CN102143010A (en) * 2010-08-24 2011-08-03 华为软件技术有限公司 Method for detecting message revision, sender equipment and receiver equipment
CN104579558A (en) * 2014-12-05 2015-04-29 苏州沃斯麦机电科技有限公司 Method for detecting integrity in data transmission process
CN105488425A (en) * 2015-11-30 2016-04-13 中国科学院国家授时中心 Data security assurance method based on serial port transmission
CN112905106A (en) * 2019-12-04 2021-06-04 贵州白山云科技股份有限公司 Data processing method, device, system, equipment and storage medium
WO2021134418A1 (en) * 2019-12-31 2021-07-08 华为技术有限公司 Data checking method and apparatus
CN112953812A (en) * 2021-01-29 2021-06-11 西藏宁算科技集团有限公司 File message uploading and storing method and device thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
云数据传输加密及完整性校验方案;陈庄;叶成荫;齐锋;;信息安全研究(第07期);全文 *

Also Published As

Publication number Publication date
CN113609532A (en) 2021-11-05

Similar Documents

Publication Publication Date Title
CN110995513B (en) Data sending and receiving method in Internet of things system, internet of things equipment and platform
CN108696589B (en) Block chain data transmission method, device, equipment and storage medium
CN103248711B (en) A kind of method of files passe and server
CN109101664B (en) Data transmission method, device, equipment and medium for lightweight node
CN105224362A (en) Host computer carries out the method and system of program upgrade to slave computer
CN109981279B (en) Block chain system, communication method, device, equipment and medium
CN112532704B (en) Data transmission method, device, electronic equipment and storage medium
CN101686145A (en) Equipment capable of upgrading, upgrading method and system
CN103841111A (en) Method for preventing data from being submitted repeatedly and server
CN109391673A (en) A kind of method, system and the terminal device of management update file
CN110633168A (en) Data backup method and system for distributed storage system
CN112968907B (en) Data transmission method, data storage method, data query method, medium and device
WO2021098139A1 (en) Method and device for storing state data of cross-chain transaction, and storage medium
CN104079623A (en) Method and system for controlling multilevel cloud storage synchrony
CN112087475B (en) Message pushing method and device for cloud platform component application and message server
CN108846085B (en) ID generation method, device, electronic equipment and system
CN114612101A (en) Reliable inter-link route cross-link method and system for connection
CN109189403B (en) Operating system OS batch installation method and device and network equipment
US20230043889A1 (en) Message Processing Method and Device, Storage Medium, and Electronic Device
CN113609532B (en) Data integrity checking method and device, computer equipment and storage medium
CN112969198A (en) Data transmission method, terminal and storage medium
CN108933681B (en) Configuration updating method of cloud computing system, control center and cloud computing node
CN103731424A (en) Network data transmitting method, device and system
JP6364727B2 (en) Information processing system, distributed processing method, and program
CN104022948A (en) Type X message transmission system and method

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