File verification method, device and storage medium

Through the file fingerprint comparison of the blockchain network, the problems of malicious tampering and digital signature forgery during the file distribution process are solved, and higher file verification security and convenience are achieved.

CN115733613BActive Publication Date: 2024-09-20XFUSION DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211277190.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-18
Publication Date
2024-09-20
Estimated Expiration
2042-10-18

AI Technical Summary

Technical Problem

In the existing file distribution process, there is a risk of malicious tampering when users obtain files through third-party platforms, and digital signature verification tools can be forged, resulting in low file verification security.

Method used

Using the blockchain network, by generating file fingerprints and broadcasting them to the blockchain network, each distribution node compares the original fingerprints to achieve file verification and improve the accuracy and reliability of verification.

Benefits of technology

Instead of relying on the official website, users can verify files through other distribution nodes in the blockchain network, improving the convenience and security of file verification and reducing the risk of tampering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115733613B
    Figure CN115733613B
Patent Text Reader

Abstract

The present application discloses a file verification method, device and storage medium, which relates to the field of file verification technology and is used to improve the efficiency of file verification. The method includes: a first device obtains a first file and generates a first file fingerprint; the first device broadcasts a first request message to a blockchain network; wherein the blockchain network includes multiple distribution nodes, each distribution node is used to store the current blockchain corresponding to the distributed file; the current blockchain of the target file includes multiple blocks, and the multiple blocks are linked based on the transmission path of the target file, and each block is used to record the distribution information of a distribution node of the target file for the target file and the original fingerprint of the target file; the first request message includes the first file fingerprint, and the first file fingerprint is used to: enable the device that receives the first file fingerprint to compare whether there is a first original fingerprint consistent with the first file fingerprint locally, and obtain a first comparison result; the first device obtains the first comparison result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of file verification technology, and in particular to a file verification method, device and storage medium. Background Art

[0002] File distribution is a way to implement file transfer. Usually, the original issuer uploads the file to the official website for users to download and obtain. The user who obtains the file may redistribute the file as a third-party platform, and it will eventually be obtained by the target user.

[0003] However, when users distribute files through third-party platforms, there is a risk that the files may be maliciously tampered with. In response to this, digital signature technology is currently widely used to provide verification for the files obtained by the target user. This verification process is used to detect whether there are risks in the file, that is, to determine whether the file has been maliciously used or tampered with. After obtaining the file, the target user obtains a digital signature verification tool from the official website for verification.

[0004] Since the process of the target user visiting the official website to obtain the digital signature verification tool is relatively simple, the digital signature verification tool can also be provided to the target user through a third-party platform. However, the digital signature verification tool provided by the third-party platform has problems such as forgery and unreliability, which leads to low security in the file verification process. Summary of the invention

[0005] The embodiments of the present application provide a file verification method, device and storage medium for improving the convenience and security of users during the file verification process.

[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0007] In a first aspect, a file verification method is provided, the method comprising: a first device obtains a first file; the first device generates a first file fingerprint of the first file; the first device broadcasts a first request message to a blockchain network; wherein the blockchain network comprises a plurality of distribution nodes, each distribution node being used to store a current blockchain corresponding to a file distributed by the distribution node; the current blockchain corresponding to the distributed file comprises a plurality of blocks, the plurality of blocks are linked based on a transmission path of the distributed file, each block is used to record distribution information of a distribution node of the distributed file for the distributed file, and the information recorded in each block comprises an original fingerprint of the distributed file; wherein the first request message comprises the first file fingerprint, and the first file fingerprint is used for a device that receives the first file fingerprint to compare whether there is a first original fingerprint consistent with the first file fingerprint in the original fingerprint of the distributed file to obtain a first comparison result; the first device obtains the first comparison result.

[0008] Through the above method, since multiple distribution nodes in the blockchain network all store the current blockchain of the distributed files, when any recipient of the file verifies the file through the blockchain network, each distribution node that transmits the file can feedback the verification result to the recipient, so that the file recipient is not limited to only being able to complete the file verification process by accessing the official website server, but can also be verified by other distribution nodes in the blockchain corresponding to the file; and since the information in the blockchain cannot be easily tampered with, it helps to improve the accuracy of the file verification process.

[0009] In a possible implementation, the first device obtains a first comparison result, including: if the first device does not receive any information fed back by a device in the blockchain network within a preset time period after broadcasting a first request message, determining that the first comparison result is that the device receiving the first file fingerprint does not have a first original fingerprint consistent with the first file fingerprint locally; or, if the first device receives first indication information within a preset time period after broadcasting the first request message, determining the first comparison result based on the first indication information; wherein the first indication information is used to indicate that the device receiving the first file fingerprint has the first original fingerprint locally.

[0010] This possible implementation method provides a specific implementation method for a first device to determine a file verification result, and determines the file verification result by judging feedback information received within a preset time period, which helps to save power consumption of devices performing file verification in the blockchain network and computing resources of the first device.

[0011] In a possible implementation manner, the first indication information includes a file transmission link of the first file.

[0012] This possible implementation method, while completing the file verification, helps to trace the file by feeding back the file transfer link to the first device. By tracing the link relationship between each block in the current blockchain of the file, the file propagation process can be traced, which helps users obtain the completed file propagation process and improves the transparency of file transfer.

[0013] In one possible implementation, the blockchain network also includes a first server, which is used to manage the current blockchain corresponding to the distributed file. The method also includes: the first device distributes the first file to the second device; the first device sends a second request message to the first server, and the second request message is used to request to add a target block to the current blockchain corresponding to the first file to obtain the target blockchain, and the target block is used to record the distribution information of the first file distributed by the first device; the first device receives the target blockchain fed back by the first server, and updates the current blockchain to the target blockchain.

[0014] This possible implementation method provides a method for adding blocks to the current blockchain of a file, which helps to extend the blockchain and improve the management efficiency of the blockchain network.

[0015] In a possible implementation, the method also includes: the first device receives a third request message broadcast by the second device, the third request message including a second file fingerprint; the first device compares the second file fingerprint with the first original fingerprint based on the second file fingerprint to determine whether they are consistent, and obtains a second comparison result; when the first device determines that the first original fingerprint exists, the first device sends second indication information to the second device; wherein the second indication information is used to indicate that the first original fingerprint exists in the first device.

[0016] This possible implementation method describes the process of how a distribution node in a blockchain network provides file verification services to other devices. Since the formation of a distribution node in a blockchain network in this application includes a verification process of the distribution node itself, the reliability of the device that performs the file verification process is improved. Furthermore, since the addition and deletion of distribution nodes in the blockchain network is flexible and reliable, the efficiency of the file verification process is greatly improved.

[0017] In a possible implementation manner, the second indication information includes a file transmission link of the first file.

[0018] In this possible implementation, when the first device acts as a distribution node in the blockchain network and confirms for other devices that there is no risk in the file, the transmission path of the first file can be further sent to the device to improve the transparency of file transmission.

[0019] In a second aspect, a file verification method is provided, which is applied to a first server, and the first server is used to manage a current blockchain corresponding to at least one file. The method includes: the first server receives a first request message sent by a first device, and the first request message includes a first file fingerprint; the first server compares whether there is a first original fingerprint consistent with the first file fingerprint in the current blockchain corresponding to the at least one file based on the first file fingerprint, and obtains a first comparison result; wherein, the current blockchain corresponding to the target file in the at least one file includes multiple blocks for transmitting the target file, and the multiple blocks are linked based on the transmission path of the target file, each block is used to record distribution information of a distribution node of the target file for the target file, and the information recorded in each block includes the original fingerprint of the target file; when the first server determines that the first original fingerprint exists in the original fingerprint of the at least one file, it sends a first indication information to the first device; wherein the first indication information is used to indicate that the first original fingerprint exists in the first server.

[0020] Through the above method, the server used to manage the blockchain network is also involved in the file verification process, so it is not limited to the process of users verifying files through the official website. In addition, the server is flexible and reliable in adding and deleting distribution nodes in the blockchain network, which greatly improves the efficiency of the file verification process.

[0021] In a possible implementation manner, the method further includes: the first indication information includes a file transmission link of the first file.

[0022] This possible implementation method, through the above method, helps users to realize file verification and file traceability through the server that manages the blockchain network, thereby helping to improve the convenience of users in file verification and the transparency of file transfer.

[0023] In a possible implementation, the method also includes: the first server receives a second request message sent by the first device, the second request message is used to request to add a target block to the current blockchain corresponding to the first file to obtain the target blockchain, and the target block is used to record the distribution information of the first file distributed by the first device; the second request message includes registration information of the first device; if the first server verifies that the first device is a registered device according to the registration information, the first server sends the target blockchain to the distribution node of the first file, the distribution node of the first file includes the first device, and the target blockchain is used for the distribution node of the first file to update the current blockchain to the target blockchain; if the first server verifies that the first device is not a registered device according to the registration information, the first server sends indication information to the first device, and the indication information is used to indicate that the verification of the first device fails.

[0024] This possible implementation method provides a method for verifying new nodes based on an authoritative proof mechanism, which helps to extend the blockchain and improve the management efficiency of the blockchain network.

[0025] In a possible implementation, the method also includes: the first server receives a fourth request message sent by the second server, the fourth request message is used to request the creation of a current blockchain of the second file; the first server creates an initial block of the current blockchain of the second file according to the fourth request message, the initial block is used to record the distribution information of the initial distribution node of the second file for the second file, and the information recorded in the initial block includes a second original fingerprint of the second file.

[0026] This possible implementation method provides a way to create a file blockchain, which helps to determine the establishment process of the blockchain network, thereby providing a safe and reliable environment for subsequent file verification.

[0027] In a third aspect, a communication device is provided, comprising: a processor and a memory. The processor is connected to the memory, the memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions stored in the memory, thereby implementing any one of the methods provided in the first aspect.

[0028] In a fourth aspect, a communication device is provided, comprising: a processor and a memory. The processor is connected to the memory, the memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions stored in the memory, thereby implementing any one of the methods provided in the second aspect.

[0029] In a fifth aspect, a chip is provided, comprising: a processor and an interface circuit; the interface circuit is used to receive code instructions and transmit them to the processor; the processor is used to run the code instructions to execute any one of the methods provided in the first aspect or the second aspect.

[0030] In a sixth aspect, a computer-readable storage medium is provided, comprising computer execution instructions, which, when executed on a computer, enable the computer to execute any one of the methods provided in the first aspect or the second aspect.

[0031] In a seventh aspect, a computer program product is provided, comprising computer execution instructions, which, when executed on a computer, cause the computer to execute any one of the methods provided in the first aspect or the second aspect.

[0032] The technical effects brought about by any implementation method in the third to seventh aspects can refer to the technical effects brought about by the corresponding implementation method in the first or second aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 The figure is a schematic diagram of a file distribution and verification scenario;

[0034] Figure 2 A risk diagram of file distribution and verification;

[0035] Figure 3 A schematic diagram of the composition of a blockchain network provided in an embodiment of the present application;

[0036] Figure 4a A schematic diagram of the composition of a file transmission system provided in an embodiment of the present application;

[0037] Figure 4b A schematic diagram of the composition of a file transmission system provided in an embodiment of the present application;

[0038] Figure 5 A hardware schematic diagram of a communication device provided in an embodiment of the present application;

[0039] Figure 6 A flowchart of a file verification method provided in an embodiment of the present application;

[0040] Figure 7 A schematic diagram of the composition of a blockchain in a blockchain network provided in an embodiment of the present application;

[0041] Figure 8 A flowchart of a file verification method provided in an embodiment of the present application;

[0042] Fig. 9 A flowchart of a file verification method provided in an embodiment of the present application;

[0043] Fig.10 A schematic diagram of a process for creating an initial block provided in an embodiment of the present application;

[0044] Fig.11 A schematic diagram of the relationship between an initial distribution node and a distribution node provided in an embodiment of the present application;

[0045] Fig.12 A schematic diagram of the composition of a communication device provided in an embodiment of the present application;

[0046] Fig.13 A schematic diagram of the composition of a communication device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.

[0048] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0049] Currently, file distribution can be applied to Figure 1The scenario shown includes the original issuer, the official website, the third-party platform and the user. Among them, the original issuer is used to provide the original file. For example, the original issuer uploads the original file to the official website. The official website is a platform for carrying files, which is used for users to download and obtain files. Specifically, the official website can be managed by a server, and the user device can download the file by accessing the server. In some large companies, in addition to providing original file downloads through the official website, many third-party platforms can also be used to provide users with download channels for obtaining files. The files obtained through the third-party platform mean that they finally reach the user device after multiple forwardings. During this period, the files may be tampered with or information may be lost, so that the files finally obtained by the user device are different from the original files, and may bring risks to the user device. For example, the file is maliciously tampered with and then distributed. The tampered file may maliciously collect user information and business data when it reaches the user device, and the tampered file may attack the system of the user device and other risk issues.

[0050] In order to avoid the above risk problems, the official website includes not only files uploaded by the original issuer, but also digital signature verification tools for users to verify files. Verifying files with digital signature verification tools helps users determine the credibility of files, thereby preventing low-credibility files from causing risky behaviors to user devices.

[0051] Specifically, the digital signature verification tool mainly uses the technology of public key and private key to realize the verification of files. The digital signature verification tool contains a digital signature file, a public key and a digital signature generation algorithm. The official website generates an original digital signature based on the original file, and then encrypts the original data signature through the private key to obtain a digital signature file. After the user obtains the file and the digital signature verification tool, a new digital signature is generated for the currently obtained file based on the digital signature generation algorithm, and then the digital signature file is decrypted through the public key to obtain the decrypted digital signature. If the decrypted digital signature is the same as the new digital signature generated by the user, it is considered that the file obtained by the user is the same as the original file; if the decrypted digital signature is different from the new digital signature, it is considered that the file obtained by the user is different from the original file, and there is a risk problem. Among them, the above-mentioned digital signature generation algorithm can be a hash function, and the digital signature is a hash value generated by the hash function according to the file, and this application does not limit this.

[0052] It is understandable that the above method helps users determine the credibility of files obtained from third-party platforms or other devices, thereby avoiding the introduction of risky files. However, the above digital signature tools are not limited to being provided to users on official websites. In fact, third-party platforms can also provide users with download paths. Currently, since digital signature verification tools based on digital signature technology can be forged, the digital signature verification tools obtained by users from third-party platforms themselves have the risk of being unreliable. In this regard, the current method of verifying files can only be achieved by obtaining verification tools from the official website. This is the only way to prevent users from obtaining digital signature verification tools in a timely manner when the user does not have access to the official website or when the official website has operational failures, causing inconvenience to the user. Figure 2 As shown in the figure, there are several situations as shown in the figure that may cause the files obtained by users to be at risk. For example, the third-party platform sends a tampered file to user 1, the third-party platform sends a file with a missing digital signature to user 2, the third-party platform provides a forged digital signature verification tool to user 3, or the official website fails, making it impossible for user 4 to obtain the digital signature verification tool from the official website.

[0053] In view of the above-mentioned situations, the embodiment of the present application provides a file verification method. Specifically, when a user obtains a first file through a first device, a first file fingerprint is generated according to the first file, and the first file fingerprint is broadcasted to the blockchain network. The device receiving the first file fingerprint compares whether there is a first original fingerprint consistent with the first file fingerprint locally, thereby obtaining a verification result to realize file verification. Among them, the blockchain network includes multiple distribution nodes, each distribution node is used to store the current blockchain corresponding to the file distributed by the distribution node, and the current blockchain includes multiple blocks, each block is used to record the distribution information of a distribution node of the target file for the target file, and the information recorded in each block contains the original fingerprint of the target file. The way of file verification through the above-mentioned blockchain mechanism replaces the way of distribution and verification centered on the official website in the traditional file distribution process. The user realizes file verification through each distribution node in the blockchain formed by the transmission file, thereby avoiding the failure of a single verification device or the influence of the user's file verification when it is not online; in addition, by utilizing the openness and security of blockchain technology, each distribution node cannot easily tamper with the information used for file verification, thereby enhancing the reliability of the file verification process.

[0054] In order to make the embodiments of the present application clearer, the concepts and some contents related to the embodiments of the present application are briefly introduced below.

[0055] 1. Blockchain

[0056] Blockchain refers to a chain data structure formed by connecting multiple blocks in chronological order. In this application, blockchain is used to store the distribution information of a file, wherein the chronological order of block connection refers to the distribution order of the file.

[0057] 2. Block

[0058] A block is used to record the distribution information of a distribution node for a file. The block includes an initial block, which is used to record the distribution information of the first distribution node for a file. The first distribution node can also be called an initial distribution node or a root node.

[0059] It is understandable that the initial distribution node is the original issuer of the file.

[0060] 3. Distribution Node

[0061] A distribution node refers to a user device that distributes files and writes distribution information into blocks.

[0062] 4. Blockchain Network

[0063] The blockchain network is composed of multiple distribution nodes, where each distribution node is used to store the current blockchain corresponding to the files distributed by the distribution node. For example, distribution node A distributes file 1 and file 2 respectively, where file 1 and file 2 correspond to a current blockchain respectively. The distribution node stores the current blockchain corresponding to file 1 and file 2 respectively. It can be understood that multiple distribution nodes are used to transmit one or more files.

[0064] It can be understood that the current blockchain refers to the latest distribution information of a file stored in the distribution node.

[0065] like Figure 3 As shown, it is a schematic diagram of the composition of the blockchain network provided in the embodiment of the present application, which includes the transmission path formed by each distribution node of file 1 and file 2.

[0066] The solution provided in the embodiment of the present application can be applied to Figure 4a or Figure 4b In the file transfer system 40 shown. Figure 4aAs shown, the file transmission system 40 may include multiple user devices (such as user devices 401-403) and multiple servers (such as servers 411-412). Specifically, user device 401 can serve as the above-mentioned original issuer and upload the target file to server 411 for managing the official website. After receiving the newly uploaded target file, server 411 requests server 412 to establish a blockchain for the target file to record the subsequent distribution information of the target file. Server 412 creates an initial block of the target file, which at least stores the original fingerprint of the file. When the file is distributed, for example, user device 402 downloads the target file by accessing server 411, and the process is a distribution of the target file from server 411 to user device 402. User device 402 can also distribute the target file to user device 403 again, and the process is another distribution of the target file from user device 402 to user device 403. The above two distributions can record the distribution information in the blockchain corresponding to the target file through the server 412. The server 412 is used to manage and update the blockchain corresponding to the target file, and send the updated blockchain to each distribution node in the blockchain, so that each distribution node updates the current blockchain stored locally. When the user device 403 needs to perform file verification, the file fingerprint of the received file can be broadcast to the blockchain network. At this time, the device server 412, the user device 402 and the server 412 in the blockchain can all receive the request of the user device 403 in normal operation, and perform file verification to obtain the verification result.

[0067] It should be noted that the number and connection relationship of user devices and servers included in the above file transmission system 40 are only examples, and this application does not limit this. Figure 4b As shown, the file transfer system 40 may include multiple servers for managing the blockchain corresponding to the file, that is, Figure 4a The server 412 in the file transfer system can be expanded to a server cluster, which includes at least a server 413 and a server 414, wherein the server cluster communicates with other devices in the file transfer system through an interface server 415, and the interface server 415 is used to receive messages sent to the server cluster by other devices in the file transfer system, and to perform simple processing on the received messages. For example, the interface server 415 receives a request message for creating a blockchain of a target file sent by the server 411. The interface server 415 can determine, based on the resource usage of the servers 413 and 414 in the server cluster, that the request message should be handled by a server with more idle resources, thereby helping to improve the number and efficiency of distribution nodes included in the server cluster management blockchain network.

[0068] It can be understood that the user device 401 is the original issuer of the target file, and its information is recorded in the initial block in the blockchain of the target file. Figure 3 The user device 402 is a distribution node in the target file transmission process. When the user device 402 uploads its distribution information to the server 412 and completes the process of adding a block to the target file to record its distribution information, the user device 402 Figure 3 It can serve as distribution node 2, distribution node 3, distribution node 4 or distribution node 5.

[0069] It should be noted that the target file may be uploaded by the original issuer to the official website for download and distribution by other user devices, so the distribution node 1 or the distribution node 6 can also be used to represent the official website. The initial block can record the distribution information of the distribution node. In addition, for ease of management, the server 412 itself can replace the original issuer or the official website as a device for recording distribution information in the blockchain network.

[0070] In terms of hardware implementation, the above user devices, servers or distribution nodes can all be implemented as follows: Figure 5 The communication device shown in the figure realizes the corresponding functions. Figure 5 , which is a schematic diagram of the hardware structure of a communication device 50 provided in an embodiment of the present application.

[0071] Figure 5 The communication device 50 shown may include: a processor 501 , a memory 502 , a communication interface 503 , and a bus 504 . The processor 501 , the memory 502 , and the communication interface 503 may be connected via the bus 504 .

[0072] The processor 501 is the control center of the communication device 50, and may be a general-purpose central processing unit (CPU) or other general-purpose processors, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0073] As an example, the processor 501 may include one or more CPUs, such as Figure 5 CPU 0 and CPU1 are shown in .

[0074] The memory 502 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.

[0075] In a possible implementation, the memory 502 may exist independently of the processor 501. The memory 502 may be connected to the processor 501 via a bus 504 and used to store data, instructions, or program codes. When the processor 501 calls and executes the instructions or program codes stored in the memory 502, the file verification method provided in the embodiment of the present application can be implemented.

[0076] In another possible implementation, the memory 502 may also be integrated with the processor 501 .

[0077] The communication interface 503 is used for the communication device 50 to connect with other devices through a communication network, and the communication network may be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication interface 503 may include a receiving unit for receiving data and a sending unit for sending data.

[0078] The bus 504 may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, a high-speed peripheral component interconnect (PCI-Express or PCIE) bus, or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0079] It should be pointed out that Figure 5 The structure shown in the figure does not constitute a limitation on the communication device 50, except Figure 5 In addition to the components shown, the communication device 50 may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0080] like Figure 6 The figure is a flowchart of a file verification method provided in an embodiment of the present application. Figure 6 The method shown can be applied to Figure 4a or Figure 4b The file transmission system shown in the figure includes the following steps S601-S604.

[0081] S601: A first device obtains a first file.

[0082] The first device can be Figure 3 , Figure 4a or Figure 4b The first file is obtained in the manner described above, for example, from a server running the official website or from a third-party platform. Figure 3 Receiving Figure 3 Other devices outside the blockchain network where the files are distributed by the distribution node. For example, the first device is the above Figure 4a or Figure 4b The user device 402 or the user device 403 in FIG.

[0083] S602: The first device generates a first file fingerprint for a first file.

[0084] The first file fingerprint refers to feature information generated according to the metadata of the first file, and the feature information is used to characterize the first file. The metadata of the first file refers to data attribute information of the first file, such as file name, file storage location, file size and other information.

[0085] In a possible implementation, the first device uses a hash function according to the metadata of the first file to generate a hash value, and uses the hash value as the fingerprint of the first file.

[0086] It is understandable that when the first file is tampered with, the metadata of the first file will generally change, and accordingly, the first file fingerprint generated according to the metadata of the first file is different from the first original fingerprint generated according to the original file of the first file. The first file fingerprint helps the first device to determine whether the first file is a risky file.

[0087] S603. The first device broadcasts a first request message to the blockchain network.

[0088] Wherein, the blockchain network includes multiple distribution nodes, each distribution node is used to store the current blockchain corresponding to the files distributed by the distribution node; the current blockchain corresponding to the distributed files includes multiple blocks, and the multiple blocks are linked based on the transmission path of the distributed files, and each block is used to record the distribution information of a distribution node of the distributed files for the distributed files, and the information recorded in each block includes the original fingerprint of the distributed files. Wherein, the first request message includes the first file fingerprint, and the first file fingerprint is used to: the device that receives the first file fingerprint compares the original fingerprint of the distributed file to see whether there is a first original fingerprint that is consistent with the first file fingerprint, and obtains the first comparison result. It can be understood that the device that receives the first file fingerprint is any distribution node in the above blockchain network.

[0089] It is understandable that the blockchain network includes multiple distribution nodes, wherein the multiple distribution nodes can be used to transmit the same or different files. In other words, the above-mentioned distributed files may include one or more files. Figure 3 As shown, the blockchain network includes multiple distribution nodes for transmitting file 1 and file 2. Each distribution node is used to store the current blockchain corresponding to the file distributed by the distribution node. For example, distribution node 1, distribution node 2, distribution node 3 and distribution node 4 are used to store the current blockchain of file 1, and distribution node 2, distribution node 5 and distribution node 6 are used to store the current blockchain of file 2. The current blockchain of file 1 is composed of five blocks, and the five blocks are used to record the distribution information of distribution node 1, distribution node 2, distribution node 3, distribution node 4 and distribution node 5 respectively. The current blockchain of file 2 is composed of three blocks, and the three blocks are used to record the distribution information of distribution node 6, distribution node 5 and distribution node 2 respectively. Figure 3 The current blockchains contained in the blockchain network shown are as follows Figure 7 As shown, it includes the current blockchain of file 1 and the current blockchain of file 2.

[0090] It is understandable that all distribution nodes in operation in the blockchain network can receive the first file fingerprint broadcast by the first device.

[0091] Optionally, the distribution information includes at least a distribution node fingerprint. The distribution node fingerprint is generated when the distribution node joins the blockchain corresponding to the distributed file, and the distribution node fingerprint is used to indicate the characteristics of the distribution node. The distribution node fingerprint is different between different distribution nodes.

[0092] In one possible implementation, the distribution node fingerprint is generated based on the registration information of the distribution node itself. The registration information refers to the registration information of the distribution node accessing the blockchain network.

[0093] In another possible implementation, the distribution node fingerprint is generated based on the registration information of the distribution node and the distribution time.

[0094] It should be noted that the present application does not limit the method for generating the distribution node fingerprint. For example, the method of generating the first file fingerprint by using a hash function can be referred to. The first device generates a hash value of the distribution node and uses the hash value as the distribution node fingerprint.

[0095] Optionally, each block stores the distribution node fingerprint recorded in the previous block. The previous block refers to the previous block adjacent to the selected block in the link order of the current blockchain. For example, Figure 7 In the current blockchain of file 1, the previous block of block 3 corresponding to distribution node 3 is block 2, wherein block 3 stores the distribution node fingerprint of distribution node 2 recorded in block 2.

[0096] It can be understood that the block stores the distribution node fingerprint of the previous block, thereby realizing that multiple blocks form a chain data structure, and then indicate the file transfer path of the file through the blockchain.

[0097] For example, in Figure 7 In the example, block 1 stores the distribution node fingerprint of distribution node 1, block 2 stores the distribution node fingerprints of distribution node 1 and distribution node 2, block 3 stores the distribution node fingerprints of distribution node 2 and distribution node 3, and block 4 stores the distribution node fingerprints of distribution node 3 and distribution node 4. In the above manner, the link direction of the current blockchain is determined between blocks by determining the distribution node fingerprint of the previous block.

[0098] Optionally, when the first device obtains the first file, it further obtains a way to access the blockchain network, which is used to broadcast the first file fingerprint to the blockchain network for file verification. For example, when the first device obtains the first file from the server of the official website, it further obtains a software installation package for accessing the blockchain network, and installs the software to broadcast the first file fingerprint to the blockchain network. It is understandable that the first device, as the recipient of the first file, needs to have a way to access the blockchain network when it requires the first file to verify the credibility. In this regard, it is proposed in the present application that the first device can install software for accessing the blockchain network, and use the software to broadcast information to the blockchain network and perform a file verification process.

[0099] S604: The first device obtains a first comparison result.

[0100] It can be understood that when the first file fingerprint is broadcast to the blockchain network, each distribution node in the blockchain network can receive the first file fingerprint if it is in normal operation; when the first file corresponding to the first file fingerprint is transmitted in the blockchain network, the distribution node transmitting the first file in the blockchain network can determine the first original fingerprint identical to the first file fingerprint; when the first file corresponding to the first file fingerprint is not transmitted in the blockchain network, the information locally stored by each distribution node in the blockchain network does not contain the first original fingerprint identical to it. Among them, the first comparison result is used to indicate whether the first file fingerprint is consistent with the original fingerprint locally stored by the replying distribution node. If consistent, it means that there is a file transmission path for the file in the blockchain network, which can be understood as the first file has not been tampered with during the distribution process, and there is no risk problem; if inconsistent, it means that there is no file transmission path for the file in the blockchain network, which can be understood as the first file may be tampered with, and there is a risk problem.

[0101] In a possible implementation, if the first device does not receive information fed back by a device in the blockchain network within a preset time period after broadcasting the first request message, the first comparison result is determined to be that the device receiving the first file fingerprint does not have a first original fingerprint that is consistent with the first file fingerprint locally. Alternatively, if the first device receives first indication information within a preset time period after broadcasting the first request message, the first comparison result is determined based on the first indication information; wherein the first indication information is used to indicate that the device receiving the first file fingerprint has the first original fingerprint locally.

[0102] It can be understood that in the above method, the device receiving the first file fingerprint determines the first comparison result by judging whether there is a first original fingerprint identical to the first file fingerprint locally. Among them, when the device receiving the first file fingerprint determines that there is a first original fingerprint, it sends a first indication information to the first device, and the first device determines the file verification result by receiving the first indication information. When the device receiving the first file fingerprint determines that the first original fingerprint does not exist locally, it does not send feedback information to the first device. The first device determines the file verification result by judging whether the feedback information is received within a preset time period. In this way, it helps to avoid the situation where nodes used to transmit different files in the blockchain network all feedback the comparison results to the first device when receiving the first request message, and the first device receives too many messages, thereby saving power consumption and computing resources of each node and the first device.

[0103] Optionally, the first indication information includes a file transfer link of the first file.

[0104] It is understandable that when the device receiving the first file fingerprint determines that there is a first original fingerprint identical to it locally, the file transfer path of the first file corresponding to the first original fingerprint can be further sent to the first device. In the above manner, while completing the file verification, the file can also be traced, and the file propagation process can be traced by tracing the link relationship between each block in the current blockchain of the file, which helps users obtain the completed file propagation process and improves the transparency of file transmission.

[0105] Optionally, when the first device receives multiple first indication information, the first device selects the longest file transfer path from the file transfer paths included in the multiple first indication information as the final result. It can be understood that this method helps the first device to obtain the latest file transfer path.

[0106] It should be noted that some devices in the blockchain network may fail to update the file transfer path of the file in a timely manner, so that the file transfer path fed back after the file verification is not the latest file transfer path. In this case, the longer file transfer path can be used as the latest file transfer path for users to view.

[0107] Optionally, when the first device receives multiple first indication messages, and the file transfer paths included in the multiple first indication messages are the same, the latest file transfer path is selected as the final result. The latest file transfer path refers to the file transfer path included in the last received first indication message among the multiple identical first indication messages received by the first device within a preset time period.

[0108] In another possible implementation, the first device receives a first comparison result, which is fed back to the first device by a node in the blockchain network that receives the first file fingerprint. The first comparison result includes indication information that a first original fingerprint identical to the first file fingerprint exists locally, or indication information that a first original fingerprint identical to the first file fingerprint does not exist locally.

[0109] Optionally, when the first comparison result includes indication information that a first original fingerprint identical to the first file fingerprint exists locally, the indication information is the first indication information mentioned above.

[0110] It can be understood that, in the above manner, each device that receives the first file fingerprint feeds back the comparison result to the first device, so that the first device directly obtains the file verification result.

[0111] Through the above method, since multiple distribution nodes in the blockchain network all store the current blockchain of the distributed files, when any recipient of the file performs file verification through the blockchain network, each distribution node that transmits the file can realize file verification, so that the file recipient is not limited to only being able to complete the file verification process by accessing the official website server, but can also verify it through other distribution nodes in the blockchain corresponding to the file; and since the information in the blockchain cannot be easily tampered with, it helps to improve the accuracy of the file verification process.

[0112] In the above scheme, a process is provided for users to implement file verification and traceability through a blockchain network, wherein the blockchain network can be specifically managed by a first server. For example, when a file is published, the first server creates an initial block in the blockchain for the newly published file, which is used to subsequently record file distribution information. It can be understood that in the above step S603, the first device broadcasts the first file fingerprint to the blockchain network. In fact, in addition to the various distribution nodes that constitute the blockchain network, the first server used to manage the blockchain network can also receive the first file fingerprint. Therefore, an embodiment of the present application provides another file verification method, such as Figure 8 As shown, steps S801-S805 are included.

[0113] S801-S802 are the same as the above steps S601-S602.

[0114] S803: The first device broadcasts a first request message.

[0115] Correspondingly, the first server receives a first request message, wherein the first request message includes a first file fingerprint.

[0116] S804. The first server compares the first file fingerprint in the first request message to see whether there is a first original fingerprint consistent with the first file fingerprint in the current blockchain corresponding to the at least one file, and obtains a first comparison result.

[0117] Among them, the current blockchain corresponding to the target file in at least one file includes multiple blocks for transmitting at least one file, and the multiple blocks are linked based on the transmission path of the target file. Each block is used to record the distribution information of a distribution node of the target file for the target file, and the information recorded in each block contains the original fingerprint of the target file.

[0118] It can be understood that the first server used to manage the blockchain network itself stores the original fingerprints of each file. Therefore, when the first device broadcasts the first file fingerprint in the blockchain network, the first server can determine the first comparison result by comparing the first file fingerprint with the locally stored original fingerprint.

[0119] The first comparison result is the same as the first comparison result in the above step S604 and will not be described in detail.

[0120] S805: When determining that the first original fingerprint exists, the first server sends first indication information to the first device.

[0121] Correspondingly, the first device receives first indication information sent by the first server. The first indication information is used to indicate that the first original fingerprint exists in the first server.

[0122] Optionally, the first indication information includes a file transfer link of the first file.

[0123] Through the above method, users can realize file verification and file traceability through the server that manages the blockchain network, thereby helping to improve the convenience of file verification for users and the transparency of file transfer.

[0124] It is understandable that in the above solution, the first device, as the file receiver, implements the file verification process through the blockchain network. Furthermore, the first device can also serve as a distribution node in the blockchain network to provide file verification services for other devices. Before the first device provides file verification services, it needs to join the blockchain network through the first server. Specifically, Fig. 9 As shown, a file verification method provided in an embodiment of the present application includes steps S901-S908.

[0125] S901. A first device distributes a first file to a second device.

[0126] It should be noted that there are many ways for the first device to distribute the first file to the second device. For example, after receiving the file acquisition request from the second device, the first device sends it to the second device; or, the first device can also actively distribute the first file to the second device, and this application does not impose any restrictions on this.

[0127] It can be understood that the first device distributes the file as a third-party platform in the transmission path of the first file.

[0128] S902. The first device sends a second request message to the first server.

[0129] Correspondingly, the first server receives the second request message.

[0130] The second request message is used to request to add a target block to the current blockchain corresponding to the first file to obtain a target blockchain. The target block is used to record the distribution information of the first file distributed by the first device.

[0131] The target blockchain is a blockchain formed by adding a target block based on the current blockchain. That is, the first device requests to add a block recording the distribution information of the first file distributed by the first device based on the current blockchain corresponding to the first file.

[0132] It is understandable that the first server is used to manage the blockchain network. When a blockchain in the blockchain network needs to be expanded, the first server is usually required to perform verification. The verification process by the first server can also be called authoritative proof in the blockchain mechanism.

[0133] Proof-of-authority (POA) is a blockchain consensus mechanism based on identity rights. In a blockchain network based on the proof-of-authority mechanism, there is a validator node for verifying the node identity and distributing information. After the verification, the validator node will sign the distribution node and approve the distribution event recorded by the distribution information. In this application, the first server used to manage the blockchain network serves as the validator node. Of course, the validator node can also reselect a device in the blockchain network to run the proof-of-authority mechanism to promote the connection between the blockchain network and external devices.

[0134] In one implementation, the second request message includes registration information of the first device, which refers to registration information of the first device accessing the blockchain network. The registration information serves as verification information in the authority certification mechanism.

[0135] S903: The first server verifies whether the first device is a registered device.

[0136] Optionally, the first server verifies whether the first device is a registered device according to the registration information in the second request message.

[0137] It is understandable that the process of the first server verifying the first device is used to determine whether the first device is trustworthy and risk-free relative to the first server or other nodes in the blockchain corresponding to the files it distributes. Among them, judging the registration information of the first device helps to maintain the consistency of information in the system, so that the first device uses the same identity information to log in when accessing the blockchain network, avoiding the statistics of multiple identity information.

[0138] Specifically, if the first server verifies that the first device is a registered device, the first server executes step S904; if the first server verifies that the first device is not a registered device, the first server executes step S905.

[0139] S904. The first server sends the target blockchain to the distribution node of the first file.

[0140] Accordingly, the distribution node of the first file receives the target blockchain. The distribution node of the first file includes the first device.

[0141] The target blockchain creates a new block in the current blockchain corresponding to the first file by the first server, and stores the distribution information of the first device in the new block.

[0142] Optionally, the distribution information includes a distribution node fingerprint of the first device.

[0143] Optionally, the distribution information includes a distribution time when the first device distributes the first file.

[0144] Optionally, the distribution information stored in the newly created block includes a node header and a data area. The node header includes a node index, a timestamp when the distribution node is generated, a hash value pointing to the previous distribution node, and a hash value pointing to the distribution node. The data area includes the distribution node fingerprint and the distribution time of the first file. Exemplarily, the distribution node fingerprint is based on a hash string generated by the first device.

[0145] It is understandable that the hash value in the node header is only used to determine the link relationship between blocks, and the distribution node fingerprint in the data area is generated based on the device information corresponding to the distribution node, for example, the device information corresponding to the distribution node is the registration information of the first device. The index is used to indicate the length of the current blockchain, and the timestamp when the distribution node is generated is used for subsequent users to understand the creation time of the distribution node when obtaining the file transfer path. Among them, the creation time of the distribution node can be the same as or different from the distribution time of the first file.

[0146] It should be noted that the information in the node header and the data area may include more or less information, and this application does not impose any limitation on this.

[0147] In a possible implementation, the data area further includes distributor information, where the distributor information is used to indicate registration information of the distribution node.

[0148] It is understandable that the purpose of the first server sending the target blockchain to the distribution node of the first file is to enable the distribution node used to transmit the first file in the blockchain network to update the current blockchain of the first file. In this way, if the device that subsequently obtains the first file performs file verification or requests a file transmission path, all distribution nodes of the first file can perform the file verification process and provide the latest file transmission path.

[0149] Optionally, the above step S904 can also be implemented in the following way: the first server sends the target blockchain in the form of broadcasting, so that the distribution node in the blockchain network receives the target blockchain and determines whether the current blockchain of the file corresponding to the target blockchain is stored locally. If so, the current blockchain is updated to the target blockchain; if not, no update is performed.

[0150] S905. The first server sends instruction information to the first device.

[0151] The indication information is used to indicate that verification of the first device fails.

[0152] Specifically, if the first device is not registered in the blockchain network, the first server may regard it as an untrustworthy device, that is, refuse to add the device to the blockchain network, thereby avoiding affecting other nodes.

[0153] The verification method for newly added nodes based on the authoritative proof mechanism provided by the above process will help to extend the blockchain and improve the management efficiency of the blockchain network.

[0154] After the first device successfully joins the blockchain network as a distribution node of the first file, the first device can provide file verification services for other devices as a distribution node in the blockchain network, specifically including the following steps S906-S908.

[0155] S906. The first device receives a third request message sent by the second device.

[0156] The third request message includes the second file fingerprint.

[0157] The second device is a recipient of the first file distributed by the first device. The second file fingerprint is generated based on the first file distributed by the first device. The second file fingerprint is generated in the same manner as the first file fingerprint, and the above description may be referred to.

[0158] Optionally, before step S906, the method further includes: the second device generating a second file fingerprint according to the received first file.

[0159] S907: The first device compares the second file fingerprint in the third request message with whether there is a first original fingerprint that is consistent with the second file fingerprint locally, and obtains a second comparison result.

[0160] If the first device has a first original fingerprint that is consistent with the second file fingerprint, it means that the file corresponding to the second file fingerprint is the first file distributed by the first device. If the first device does not have a first original fingerprint that is consistent with the second file fingerprint, it means that the file corresponding to the second file fingerprint is not the first file distributed by the first device, and there is a risk problem and it cannot be trusted.

[0161] It should be noted that the file corresponding to the second file fingerprint is one of the files distributed by the first device, which is only used to indicate that the files are the same, but does not limit the file corresponding to the second file fingerprint to be the file distributed by the first device to the second device at this time.

[0162] S908: When determining that the first original fingerprint exists, the first device sends second indication information to the second device.

[0163] Correspondingly, the second device receives second indication information, where the second indication information is used to indicate that the first original fingerprint exists in the first device.

[0164] Optionally, the second indication information includes a file transfer link of the first file.

[0165] It is understandable that when the device receiving the second file fingerprint determines that there is a first original fingerprint identical to it locally, the file transfer path of the first file corresponding to the first original fingerprint can be further sent to the first device. In the above manner, while completing the file verification, the file can also be traced, and the file propagation process can be traced by tracing the link relationship between the various blocks in the current blockchain of the file, which helps users obtain the completed file propagation process and improves the transparency of file transmission.

[0166] Through the above steps S906-S908, the process of how a distribution node in a blockchain network provides file verification services for other devices is described. In combination with the above steps S901-S905, since the formation of a distribution node in the blockchain network in this application includes a verification process for the distribution node itself, the reliability of the device that executes the file verification process is improved. Furthermore, since the addition and deletion of distribution nodes in the blockchain network is flexible and reliable, the efficiency of the file verification process is greatly improved.

[0167] In a possible implementation, the third request message also includes the distribution information of the first device, and the distribution information is used to request verification of the credibility of the first device. It can be understood that when the second device broadcasts the third request message to the blockchain network, if the first file corresponding to the second file fingerprint in the third request message has a transmission path, then each distribution node of the first file can verify the credibility of the first file corresponding to the second file fingerprint. Further, the second device can also request each distribution node of the first file to verify the credibility of the first device for the distribution information. In other words, the distribution node that receives the third request message can search for the distribution information of the first device in the file transmission path of the first file. If it exists, it means that the first device is credible; if it does not exist, it means that the first device is untrustworthy, and further, the first file distributed to the second device is also untrustworthy.

[0168] Optionally, when each distribution node that receives the third request message determines that the second file fingerprint exists locally but the distribution information of the first device does not exist, it can request the first server to update the file transfer path of the first file, and make another judgment based on the updated file transfer path to obtain a judgment result.

[0169] Optionally, the above judgment result is included in the first comparison result and fed back to the second device.

[0170] It is understandable that in a blockchain network, when the first server updates the file transfer path of the first file, some distribution nodes may be offline or in an abnormal operating state, thus failing to update the file transfer path in time. In this regard, the above method helps to implement the file transfer path of the transmitted file refreshed by the distribution node in this case, and performs file verification based on the refreshed file transfer path, which helps to improve the accuracy of file verification.

[0171] Among them, the files initially released by the original issuer are managed by the first server as a special distribution node in the blockchain network. Fig.10 As shown, a method for creating a blockchain provided by an embodiment of the present application includes steps S1001-S1004. The method is applied to the initial release stage of a file, including an original issuer, a first server and a second server, wherein the second server is an official platform for carrying files, such as an official website,

[0172] S1001. The original issuer uploads a second file to a second server.

[0173] It should be noted that the purpose of the original issuer uploading the file to the official website is to facilitate more user devices to access and obtain the relevant files, and the second server that manages the official website has a strong device management capability, which is convenient for more devices to access and obtain the relevant files at the same time. The above step S1001 is an optional step. In fact, the original issuer itself can also directly request the first server to record the distribution information of the second file. This application does not limit this. The following is an example of the interaction between the second server and the first server.

[0174] S1002. The second server sends a fourth request message to the first server.

[0175] The fourth request message is used to request creation of the current blockchain of the second file.

[0176] In a possible implementation, the fourth request message includes file metadata of the second file. The file metadata is used by the first server to generate a second original fingerprint of the second file, which is subsequently distributed to a distribution node of the second file or a device requiring file verification.

[0177] In another possible implementation manner, the fourth request message includes the second original fingerprint of the second file.

[0178] It is understandable that the second original fingerprint can be generated by the server where the official website is located, or by the server that manages the blockchain network, and this application does not impose any restrictions on this.

[0179] S1003. The first server creates an initial block of the current blockchain of the second file according to the fourth request message.

[0180] The initial block is used to record the distribution information of the initial distribution node of the second file for the second file, and the information recorded in the initial block includes the second original fingerprint.

[0181] It is understandable that the initial distribution node is a special distribution node, which is essentially the same as the distribution node and is used to distribute the second file. The difference is that the initial distribution node is created after the file is released but before distribution. Specifically, the initial distribution node includes a node header and a data area. Among them, the node header includes a node index value 0, a timestamp when the node is generated, and a hash value of the current node. The data area includes information such as the original fingerprint of the second file, file metadata, and the original issuer. It is basically the same as the information in the distribution node. The node index value 0 facilitates the positioning of the block, the timestamp when the node is generated is used to indicate the node creation time, and the hash value of the current node is used to subsequently obtain the distribution node of the file from the initial distribution node to achieve the link.

[0182] For example, Fig.11The figure shows a schematic diagram of the relationship between an initial distribution node and a distribution node provided by the present application. Fig.11 In the example, the initial distribution node, the first distribution node and the second distribution node are included. Each distribution node includes a node header and a data area, and the information included therein is as described above. The first distribution node and the second distribution node both include a previous node hash value, and the previous node hash value is used to indicate the node hash value of the distribution node corresponding to the previous block in the link direction of the blockchain. In this way, the distribution nodes of the file are linked according to the transmission path to form a blockchain that records the file distribution information.

[0183] It should be noted that the creation of the above initial block indicates the creation of the current blockchain of the second file. Since there is no distribution process when the file is initially released, the current blockchain of the second file actually only contains the initial block. When the subsequent file is distributed and a new block is created as the distribution node of the second file, the initial block and the new block constitute the blockchain.

[0184] It can be understood that when the second file is subsequently distributed, its distribution information can update the current blockchain of the second file through the above steps S901-S905.

[0185] S1004. The first server sends the current blockchain of the second file to the second server.

[0186] Optionally, after receiving the current blockchain of the second file, the second server starts a distribution process for the second file.

[0187] It can be understood that when the second server receives the response message from the first server, it indicates that the preparation work for recording the file transmission path of the second file has been completed. After the second server distributes the second file, the second file can undergo file verification or traceability.

[0188] The method of creating the file blockchain provided by the above method helps to determine the establishment process of the blockchain network, thereby providing a safe and reliable environment for subsequent file verification.

[0189] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the method. It is understandable that in order to realize the above functions, the communication device includes at least one of the hardware structure and software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0190] The embodiment of the present application can divide the functional units of the communication device according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0191] In the case of dividing each functional module into corresponding functional modules, Fig.12 A possible structural diagram of a communication device corresponding to the first device involved in the above embodiment is shown. Fig.12 As shown, the communication device 120 includes a communication unit 1201 and a processing unit 1202 .

[0192] The communication unit 1201 is used to obtain a first file.

[0193] The processing unit 1202 is configured to generate a first file fingerprint of a first file.

[0194] The communication unit 1201 is also used to broadcast a first request message to the blockchain network; wherein the blockchain network includes multiple distribution nodes, each distribution node is used to store the current blockchain corresponding to the file distributed by the distribution node; the current blockchain corresponding to the distributed file includes multiple blocks, and the multiple blocks are linked based on the transmission path of the distributed file, each block is used to record the distribution information of a distribution node of the distributed file for the distributed file, and the information recorded in each block includes the original fingerprint of the distributed file; the first request message includes the first file fingerprint, and the first file fingerprint is used to: enable the device that receives the first file fingerprint to compare whether there is a first original fingerprint consistent with the first file fingerprint in the original fingerprint of the distributed file, and obtain a first comparison result.

[0195] The communication unit 1201 is further used to obtain a first comparison result.

[0196] In one example, the communication unit 1201 is specifically used to determine, if no information fed back by a device in the blockchain network is received within a preset time period after the first request message is broadcasted, a first comparison result that the device receiving the first file fingerprint does not have a first original fingerprint consistent with the first file fingerprint locally; or, if first indication information is received within a preset time period after the first request message is broadcasted, determine the first comparison result based on the first indication information; wherein the first indication information is used to indicate that the device receiving the first file fingerprint has the first original fingerprint locally.

[0197] In an example, the first indication information includes a file transfer link of the first file.

[0198] In one example, the blockchain network also includes a first server, which is used to manage the current blockchain corresponding to the distributed file. The communication unit 1201 is also used to distribute the first file to the second device; the communication unit 1201 is also used to send a second request message to the first server, and the second request message is used to request to add a target block to the current blockchain corresponding to the first file to obtain the target blockchain, and the target block is used to record the distribution information of the first file distributed by the first device; the communication unit 1201 is also used to receive the target blockchain fed back by the first server, and update the current blockchain to the target blockchain.

[0199] In one example, the communication unit 1201 is also used to receive a third request message broadcast by the second device, and the third request message includes a second file fingerprint; the processing device 1202 is also used to compare the second file fingerprint with the first original fingerprint based on the second file fingerprint to obtain a second comparison result; the communication unit 1201 is also used to send second indication information to the second device when it is determined that the first original fingerprint exists; wherein the second indication information is used to indicate that the first original fingerprint exists in the first device.

[0200] In an example, the second indication information includes a file transfer link of the first file.

[0201] In an example, the communication device 120 further includes a storage unit 1203. The storage unit 1203 is used to store computer-executable instructions, and other units in the communication device can perform corresponding actions according to the computer-executable instructions stored in the storage unit 1203.

[0202] For the detailed description of the above optional manner, please refer to the above method embodiment, which will not be repeated here. In addition, the explanation of any communication device 120 provided above and the description of the beneficial effects can refer to the above corresponding method embodiment, which will not be repeated here.

[0203] In the case of dividing each functional module into corresponding functional modules, Fig.13 FIG. 1 is a schematic diagram showing a possible structure of the first server corresponding to the communication device 130 involved in the above embodiment. Fig.13 As shown, the communication device 130 is used to manage the current blockchain corresponding to at least one file, and the communication device 130 includes a communication unit 1301 and a processing unit 1302.

[0204] The communication unit 1301 is configured to receive a first request message sent by a first device, where the first request message includes a first file fingerprint.

[0205] The processing unit 1302 is used to compare whether there is a first original fingerprint consistent with the first file fingerprint in the current blockchain corresponding to the at least one file according to the first file fingerprint, and obtain a first comparison result; wherein the current blockchain corresponding to the target file in the at least one file includes multiple blocks for transmitting the target file, and the multiple blocks are linked based on the transmission path of the target file, each block is used to record distribution information of a distribution node of the target file for the target file, and the information recorded in each block includes the original fingerprint of the target file.

[0206] The communication unit 1301 is further configured to send first indication information to the first device when it is determined that the first original fingerprint exists in the original fingerprints of at least one file; wherein the first indication information is used to indicate that the first original fingerprint exists in the first server.

[0207] In an example, the first indication information includes a file transfer link of the first file.

[0208] In one example, the communication unit 1301 is also used to receive a second request message sent by the first device, the second request message is used to request to add a target block to the current blockchain corresponding to the first file to obtain the target blockchain, and the target block is used to record the distribution information of the first file distributed by the first device; the second request message includes registration information of the first device; if the processing unit 1302 verifies that the first device is a registered device according to the registration information, the communication unit 1301 is also used to send the target blockchain to the distribution node of the first file, the distribution node of the first file includes the first device, and the target blockchain is used for the distribution node of the first file to update the current blockchain to the target blockchain; if the processing unit 1302 verifies that the first device is not a registered device according to the registration information, the communication unit 1301 is also used to send indication information to the first device, and the indication information is used to indicate that the verification of the first device has failed.

[0209] In one example, the communication unit 1301 is further used to receive a fourth request message sent by the second server, where the fourth request message is used to request the creation of a current blockchain for the second file; the processing unit 1302 is further used to create an initial block of the current blockchain for the second file according to the fourth request message, where the initial block is used to record distribution information of the initial distribution node of the second file for the second file, and the information recorded in the initial block includes the original fingerprint of the second file.

[0210] In an example, the communication device 130 further includes a storage unit 1303. The storage unit 1303 is used to store computer-executable instructions, and other units in the communication device can perform corresponding actions according to the computer-executable instructions stored in the storage unit 1303.

[0211] For the detailed description of the above optional manner, please refer to the above method embodiment, which will not be repeated here. In addition, the explanation of any communication device 130 provided above and the description of the beneficial effects can refer to the above corresponding method embodiment, which will not be repeated here.

[0212] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed on a computer, the computer executes the method executed by any one of the image processing devices provided above.

[0213] For the explanation of the relevant contents and description of the beneficial effects of any of the above-mentioned computer-readable storage media, reference may be made to the above-mentioned corresponding embodiments, which will not be repeated here.

[0214] The embodiment of the present application also provides a chip. The chip integrates a control circuit and one or more ports for implementing the above-mentioned communication device 120 or the functions of the communication device 120. Optionally, the functions supported by the chip can be referred to above and will not be repeated here. A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned embodiment can be completed by instructing the relevant hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The above-mentioned processing unit or processor can be a central processing unit, a general-purpose processor, an application specific integrated circuit (ASIC), a microprocessor (digital signal processor, DSP), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.

[0215] The embodiment of the present application also provides a computer program product including instructions, when the instructions are run on a computer, the computer executes any one of the methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more servers that can be integrated with the medium. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.

[0216] It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to the above-mentioned memories, computer-readable storage media and communication chips, etc., are all non-transitory.

[0217] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with a medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0218] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0219] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A file verification method, characterized in that: The method comprises: The first device obtains the first file; The first device generates a first file fingerprint of the first file; The first device broadcasts a first request message to a blockchain network; wherein the blockchain network includes a plurality of distribution nodes, each distribution node is used to store a current blockchain corresponding to a file distributed by the distribution node; the current blockchain corresponding to the distributed file includes a plurality of blocks, the plurality of blocks are linked based on a transmission path of the distributed file, each block is used to record distribution information of a distribution node of the distributed file for the distributed file, and the information recorded in each block includes an original fingerprint of the distributed file; The first request message includes a first file fingerprint, and the first file fingerprint is used for: the device receiving the first file fingerprint compares the original fingerprint of the distributed file to see whether there is a first original fingerprint that is consistent with the first file fingerprint, and obtains a first comparison result; The first device obtains the first comparison result; The blockchain network further includes a first server, the first server being used to manage the current blockchain corresponding to the distributed file, and the method further includes: The first device distributes the first file to the second device; The first device sends a second request message to the first server, where the second request message is used to request to add a target block to the current blockchain corresponding to the first file to obtain a target blockchain, where the target block is used to record distribution information of the first file distributed by the first device; The first device receives the target blockchain fed back by the first server, and updates the current blockchain to the target blockchain; The first device receives a third request message broadcast by the second device, where the third request message includes a second file fingerprint; The first device compares the second file fingerprint with the first original fingerprint to determine whether the second file fingerprint is consistent with the first original fingerprint, and obtains a second comparison result; When determining that the first original fingerprint exists, the first device sends second indication information to the second device; wherein the second indication information is used to indicate that the first original fingerprint exists in the first device.

2. The method according to claim 1, characterized in that The first device obtains the first comparison result, including: If the first device does not receive any information fed back by a device in the blockchain network within a preset time period after broadcasting the first request message, it is determined that the first comparison result is that the device receiving the first file fingerprint does not have a first original fingerprint consistent with the first file fingerprint locally; Alternatively, if the first device receives first indication information within a preset time period after broadcasting the first request message, the first comparison result is determined based on the first indication information; wherein the first indication information is used to indicate that the first original fingerprint exists locally on the device that receives the first file fingerprint.

3. The method according to claim 2, characterized in that The first indication information includes a file transfer link of the first file.

4. The method according to claim 1, characterized in that: The second indication information includes a file transfer link of the first file.

5. A file verification method, characterized in that: Applied to a first server, the first server is used to manage a current blockchain corresponding to at least one file, the method comprising: The first server receives a first request message sent by a first device, where the first request message includes a first file fingerprint; The first server compares, based on the first file fingerprint, whether there is a first original fingerprint consistent with the first file fingerprint in the current blockchain corresponding to the at least one file, to obtain a first comparison result; wherein the current blockchain corresponding to the target file in the at least one file includes a plurality of blocks for transmitting the target file, the plurality of blocks are linked based on the transmission path of the target file, each block is used to record distribution information of a distribution node of the target file for the target file, and the information recorded in each block includes the original fingerprint of the target file; When determining that the first original fingerprint exists in the original fingerprints of the at least one file, the first server sends first indication information to the first device; wherein the first indication information is used to indicate that the first original fingerprint exists in the first server; The first server receives a second request message sent by the first device, where the second request message is used to request to add a target block to the current blockchain corresponding to the first file to obtain a target blockchain, where the target block is used to record distribution information of the first file distributed by the first device; and the second request message includes registration information of the first device; If the first server verifies that the first device is a registered device according to the registration information, the first server sends the target blockchain to the distribution node of the first file, the distribution node of the first file includes the first device, and the target blockchain is used for the distribution node of the first file to update the current blockchain to the target blockchain; If the first server verifies that the first device is not a registered device according to the registration information, the first server sends indication information to the first device, where the indication information is used to indicate that the verification of the first device fails; The first server receives a fourth request message sent by the second server, where the fourth request message is used to request creation of a current blockchain of the second file; The first server creates an initial block of the current blockchain of the second file according to the fourth request message, wherein the initial block is used to record distribution information of the initial distribution node of the second file for the second file, and the information recorded in the initial block includes a second original fingerprint of the second file.

6. The method according to claim 5, characterized in that The first indication information includes a file transfer link of the first file.

7. A communication device, characterized in that: The method comprises a memory and a processor; the memory is used to store program codes; the processor is used to call program codes to execute the method according to any one of claims 1 to 4.

8. A communication device, characterized in that: It comprises a memory and a processor; the memory is used to store program code; the processor is used to call the program code to execute the method according to any one of claims 5-6.

9. A computer-readable storage medium, characterized in that: The method comprises a program code, and when the program code is executed on a computer or a processor, the computer or the processor executes the method according to any one of claims 1 to 6.