Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description.
In the embodiment of the application, the terminal device refers to a device with an intelligent operating system, and the devices can support functions in the aspects of audio, video, data and the like, and include an intelligent mobile terminal such as a smart phone, a tablet computer and an intelligent wearable device, and also can be a smart television, a personal computer and other devices. And intelligent operating systems such as YunOS, IOS, Android and the like.
Referring to fig. 1, a schematic diagram of a data transmission interaction according to an embodiment of the present application is shown.
The data transmission system includes: a terminal device 10 and a server 20. The user can interact with the server through the application such as the client and the like in the terminal equipment to execute operations such as file uploading and the like.
The server 20 may record, for a stored file, identification information of the file, where the identification information may uniquely characterize one data content, that is, identification information of different data is different, and identification information of matching data is matched, where the matching includes the same. Therefore, for the file, the data content of the file can be represented by the file identification information, the file identification information is also identification information, the file identification information of different files is different, and the file identification information of the matched file is matched. The identification information can be obtained by calculation through multiple algorithms, each algorithm corresponds to one type of identification information, the identification information obtained by the same algorithm can be compared with each other, and the identification information obtained by different algorithms does not have comparability, namely the matching executed in the embodiment of the application is the matching between the identification information obtained by the same algorithm and the file identification information. The identification information includes: the message abstract and the file identification information comprise: the Message Digest (Message Digest) is a fixed-length value uniquely corresponding to one data (file), and is obtained by calculating the data file through a certain algorithm.
Therefore, when different users upload system files to the server, the server only stores one file, and users who subsequently upload the file can upload the files quickly based on the second transfer function. However, in order to prevent an attacker from stealing a file by forging identification information (such as a message digest), the embodiment can ensure that the file exists locally in the terminal device through the verification of the file data on the basis of confirming that the server side stores the file, and provide a second-pass function on the basis of the verification of the file data to inform that the file upload of the corresponding terminal device is successful. Therefore, on the basis that the server confirms that the file matched with the file to be transmitted is stored, the file transmission verification can be realized through the following interactive process:
102. and after the server confirms that the file to be transmitted is matched with the stored file, determining verification target information of the file to be transmitted according to the stored file. For a file to be transmitted, which needs to be uploaded, the server confirms that the file to be transmitted is matched with a stored file (if a file with the same data content as the file to be transmitted exists, that is, the file to be transmitted is the same as the stored file), and can determine verification target information of the file to be transmitted according to the stored file, wherein the verification target information is used for informing a target which needs to be verified of the terminal device, such as data in a target area, an algorithm which needs to be used, and the like.
104. And the server sends the verification target information.
106. And the terminal equipment determines at least one piece of identification information of the file to be transmitted according to the verification target information and generates verification information according to the identification information. The terminal equipment determines a target to be verified according to the verification target information, so that at least one piece of identification information can be calculated according to the file to be transmitted, the identification information can be calculated according to partial data in the file to be transmitted, such as data of a target area, and then verification information is generated according to the identification information.
108. And the terminal equipment sends the verification information.
110. And the server acquires at least one piece of identification information in the file to be transmitted from the verification information.
112. And the server judges whether the identification information of the file to be transmitted is matched with the identification information of the corresponding stored file. The verification target information is determined according to the identification information of the stored file, so that matching between the identification information of the file to be transmitted and the identification information of the stored file is facilitated.
114. And after confirming that the identification information is matched, the server sends the information of the file to be transmitted. The information comprises storage information, in addition, if the server fails to verify, namely the file to be transmitted is not credible, the uploading of the file is also ignored, response information of transmission failure can also be fed back, and then the terminal equipment can send the file to the server to upload the file.
Therefore, under the condition that the file to be transmitted is confirmed to be matched with the stored file, the target needing to be verified in the file to be transmitted is confirmed based on the stored file, so that at least one piece of identification information in the file to be transmitted is obtained, whether the identification information of the file to be transmitted is matched with the identification information of the corresponding stored file is judged, the identification information is confirmed to be matched, namely the file to be transmitted exists in the terminal equipment, the information of the file to be transmitted can be sent without the terminal equipment sending the file to be transmitted, the file is informed of successful transmission, the problem of file counterfeiting is effectively prevented based on the identification information, and the safety of data is guaranteed.
Referring to fig. 2, a flowchart illustrating steps of a server side in an embodiment of a file transfer method of the present application is shown.
Step 202, determining the verification target information of the file to be transmitted according to the stored file, and sending the verification target information.
Step 204, obtaining at least one identification information in the file to be transmitted from the received verification information.
Step 206, determining whether the identification information of the file to be transmitted matches the identification information of the corresponding stored file.
If yes, go to step 208; if not, the flow is ended.
And step 208, after the identification information is confirmed to be matched, sending the information of the file to be transmitted.
The server confirms that the file to be transmitted is matched with the stored file (if a file with the same data content as the file to be transmitted exists, namely the file to be transmitted is the same as the stored file), and can determine the verification target information of the file to be transmitted according to the stored file. The verification target information is used for informing the terminal device of a target to be verified, such as data of a target area, an algorithm to be used, and the like, wherein the terminal device calculates identification information of a file to be transmitted according to the verification target information, and the verification target information is determined according to the identification information of the corresponding matched stored file. Therefore, the terminal equipment can calculate at least one identification information in the file to be transmitted according to the identification information, and the identification information is returned to the server after forming the verification information.
The server can correspondingly receive verification information, acquire at least one piece of identification information in the file to be transmitted from the verification information, match each piece of identification information with corresponding identification information of a stored file respectively, if all pieces of identification information are matched, confirm that the file to be transmitted exists in the terminal equipment, and provide a second transmission function for the file to be transmitted, so that the information of the file to be transmitted can be generated, for example, storage information of the file to be transmitted based on a storage record of the stored file, for example, a storage address in the storage record of the stored file is used as a storage address of the file to be transmitted, and then the storage information is fed back to the terminal equipment to inform the terminal equipment that the file is successfully uploaded, and the storage information of the file in the server is obtained.
Referring to fig. 3, a flowchart illustrating steps of a terminal device side in an embodiment of a file transmission method of the present application is shown.
Step 302, receiving verification target information.
Step 304, determining at least one identification information of the file to be transmitted according to the verification target information, and generating verification information according to the identification information.
Step 306, sending the verification information.
Step 308, receiving the information of the file to be transmitted.
The server confirms that the file to be transmitted is matched with the stored file (if a file with the same data content as the file to be transmitted exists, namely the file to be transmitted is the same as the stored file), and can determine the verification target information of the file to be transmitted according to the stored file. After receiving the verification target information, the terminal equipment can determine at least one piece of identification information of the file to be transmitted according to the verification target information, namely, at least one piece of target data needing to be verified in the file to be transmitted is determined according to the verification information, then the identification information of each piece of target data is calculated respectively, the verification information is generated by adopting the obtained at least one piece of identification information, and then the verification information is sent to the server. The server checks the credibility of the file according to the verification information, namely, whether the file is matched with the identification information of the pre-stored file is determined according to the identification information, so that whether the file to be transmitted is really stored in the terminal equipment is verified, the file to be transmitted is considered to be really stored after the identification information is matched, therefore, the information of the file to be transmitted can be sent, the terminal receives the information of the file to be transmitted and then confirms that the file is successfully uploaded, and when the file is needed subsequently, the file can be obtained from the server according to the information of the file to be transmitted.
In summary, after the server confirms that the file to be transmitted is matched with the stored file, the server can determine the verification target information of the file to be transmitted according to the stored file, so that the terminal device can calculate the identification information of at least one target datum in the file to be transmitted based on the verification target information, judge whether the identification information of the file to be transmitted is matched with the identification information of the corresponding stored file, and confirm that the file to be transmitted is stored in the terminal device after the identification information is matched, so that the information of the file to be transmitted can be sent, the file is ensured to exist in both the server and the client through the verification information, the problem that the file is stolen by forged information is prevented, and the information safety is ensured.
In order to improve the security of the second transmission function, the present embodiment may include two stages for file transmission, where one stage is an inquiry stage, and is used to inquire whether a file to be transmitted is a stored file in the server, and if the file is the stored file, the second transmission function may be executed, and the second stage, i.e., the second transmission stage, is entered.
Referring to fig. 4, another data transmission interaction diagram according to the embodiment of the present application is shown.
402. And the terminal equipment generates file information according to the file to be transmitted.
The file information is used for determining a stored file matched with the file to be transmitted, and the file information comprises file identification information of the file to be transmitted.
404. And the terminal equipment sends the file information of the file to be transmitted to the server.
406. The server acquires at least one file identification information from the file information.
408. And the server judges whether the file identification information of the file to be transmitted is matched with the file identification information of the stored file.
410a, if the file identification information is not matched, the server sends response information to inform the terminal equipment of uploading the file; at 412a, the terminal device uploads the file to the server.
And 410b, if the file identification information is matched, the server determines the verification target information of the file to be transmitted according to the stored file and sends the verification target information.
412b, the terminal device determines at least one identification information of the file to be transmitted according to the verification target information, and generates verification information according to the identification information. And the terminal equipment sends the verification information.
414. And the server acquires at least one piece of identification information in the file to be transmitted from the verification information.
416. And the server judges whether the identification information of the file to be transmitted is matched with the identification information of the corresponding stored file. The verification target information is determined according to the identification information of the stored file, so that matching between the identification information of the file to be transmitted and the identification information of the stored file is facilitated.
418. And after confirming that the identification information is matched, the server generates storage information of the file to be transmitted and sends the storage information. In addition, if the server fails to verify, that is, the file to be transmitted is not trusted, the uploading of the file is also ignored, and response information of transmission failure can also be fed back, and then the terminal device can send the file to the server to upload the file.
Referring to fig. 5, a flowchart of steps of a terminal device side in another embodiment of the file transfer method of the present application is shown.
Step 502, calculating at least one file identification information of the file to be transmitted, and using the at least one file identification information of the file to be transmitted as file information.
Step 504, sending the file information of the file to be transmitted.
If the file identification information is a Message Digest, at least one of a (Message-Digest Algorithm, fifth version) value, a SHA (Secure Hash Algorithm) value, and a base64 value of the file to be transmitted may be calculated, and the at least one file identification information of the file to be transmitted is used as file information. The file size of the file to be transmitted can also be obtained, and the file size of the file to be transmitted is added in the file information. That is, the file information includes file identification information and file size of the file to be transmitted, and the file identification information may be a message digest, and the message digest includes md5 value, SHA value, base64 value, and the like. Terminal information such as MAC address and user information such as user identification can be carried in the file information. The file information is then sent to the server to cause the server to verify whether a matching file is stored based on the file identification information and the file size of the file.
Atstep 506, verification target information is received.
And if the server judges that the file to be transmitted is not matched with the stored file, the server can send response information of the uploaded file, and the terminal equipment sends the file to be transmitted to the server after receiving the transmission response information indicating the uploaded file. And if the server judges that the file to be transmitted is matched with the stored file, generating verification target information and sending the verification target information to the terminal equipment. The embodiment of the application takes the server as an example to judge that the file to be transmitted is matched with the stored file.
Step 508, determining at least one target area corresponding to the file to be transmitted according to the verification target information.
Step 510, calculating identification information of the data corresponding to the target area, and generating verification information according to the identification information.
Step 512, sending the verification information to a server.
In this embodiment, for example, a file stored in a server is matched with a file to be transmitted, where the verification target information is used to determine verification data improved by the terminal device, for example, to determine a target area for extracting the target data to calculate identification information. Therefore, after receiving the verification target information, at least one target area can be determined according to the verification target information, target data is respectively extracted from each target area of the file to be transmitted, and identification information such as a message digest corresponding to each target data is calculated. Identification information of one or more portions of the file to be transmitted is thus calculated, for example, a message digest is calculated by extracting 20KB of data every 1024 KB. The area for calculating the identification information is the area in which the identification information is calculated for the corresponding matched stored file in the server, so that the matching judgment of the server is facilitated. In this embodiment of the present application, the verification information may include more than one message digest, and the more than one message digest may be calculated according to data corresponding to a discontinuous target area in the file to be transmitted. That is, when more than one target area is determined from the file to be transmitted, each target area is discontinuous, and the obtained message digest is the message digest of discontinuous data in the file to be transmitted.
In an optional embodiment, determining, according to the verification target information, that the file to be transmitted corresponds to at least one target area includes: acquiring at least one data length and at least one offset from the verification target information; and determining a target area from the file to be transmitted according to the offset and the data length. . The method includes the steps that at least one data length and at least one offset are obtained from verification target information, the data length is the data length of a target area of a message summary needing to be calculated, target areas with different sizes can be determined according to different data lengths, the offset is used for determining the starting position of the target area, the starting position of the target area can be determined based on the offset, the target area is determined based on the ending position corresponding to the starting position of the data length area, and then data are extracted from the target area to calculate identification information. When the data length and the offset are more than one, the verification target information can also record the matching relationship between the data length and the offset, so that the target area can be accurately determined.
In the embodiment of the application, after the target area is determined, an algorithm for calculating the identification information may be further determined, and different identification information is determined according to different algorithms, where the identification information includes a message digest, and the message digest includes at least one of: md5 value, SHA value, base64 value. The SHA values include message digests of SHA families such as SHA1, SHA125, SHA256, SHA512, and the like. Therefore, the various message digests can be obtained by adopting corresponding algorithm calculation, and the matching judgment is carried out among the message digests of the same type.
In an optional embodiment of the present application, the verification target information includes: and a channel identifier, where the channel identifier is an identifier of a channel corresponding to communication between the server and the terminal device, for example, if a session is established between the server and the terminal device, the channel identifier is a sessionId, and the sessionId may be set as a character string with a length of 48 bits. The creation time and expiration time of the transmission channel can be parsed from the channel identification. In addition, signature data is also included in the channel identifier to ensure that the channel identifier is not falsifiable, for example, the signature data is auth _ md5 signed by a user key. Judging whether the corresponding transmission channel is effective or not according to the channel identifier; and executing the step of sending the verification information after judging that the transmission channel is effective. That is, whether the corresponding transmission channel is valid is determined according to the channel identifier, for example, whether the transmission channel is valid within the time period is determined according to the creation time and the expiration time, and whether the transmission channel is correct is determined according to the signature data. If the transmission channel is invalid, the message can be ignored or the server is informed to retransmit; if the transmission channel is valid, the subsequent steps can be performed. Wherein the validity of the transmission channel may be judged before calculating the message digest of the target data, or before sending the verification information.
Step 514, receiving the stored information.
After the server judges that the verification information passes the verification, namely after the identification information of the file to be transmitted is matched with the corresponding identification information in the stored file, the server can generate the file identification of the file to be transmitted, determine the corresponding storage information such as a storage address, and feed the storage information back to the mesoscopic equipment to identify the successful transmission of the file to be transmitted, and the terminal equipment determines the file identification, the storage address and other information of the corresponding file according to the storage information, so that the subsequent acquisition is facilitated.
Referring to fig. 6, a flow chart illustrating steps of a server side in another embodiment of the file transfer method of the present application is shown.
Step 602, receiving file information of the file to be transmitted, and acquiring at least one file identification information from the file information.
The server can receive file information sent by the terminal equipment, and the file information can inform the terminal equipment of a file to be uploaded, so that file identification information of the file to be transmitted can be obtained from the file information, the file identification information can represent data content of the file to be transmitted, and the size of the file to be transmitted can be obtained from the file information.
Step 604, determining whether the file identification information of the file to be transmitted is matched with the file identification information of the stored file.
The file identification information of the file to be transmitted may then be used to match file identification information of files already stored in the server. If yes, that is, the file identification information of the file to be transmitted is matched with the file identification information of the stored file, executestep 608; if not, that is, the file identification information of the file to be transmitted does not match the file identification information of the stored file, go to step 606. If the file identification information of the file to be transmitted is the same as the file identification information of the stored file, the file to be transmitted and the stored file can be determined to be the same file, namely, the same data content is provided.
Step 606, generating and sending response information to inform the terminal device of uploading files.
Step 608, determining whether the file size of the file to be transmitted matches the file size of the corresponding matched stored file.
After the file identification information of the file to be transmitted is judged to be matched with the file identification information of the stored file, whether the file size of the stored file matched with the file identification information is matched with the file size of the file to be transmitted can be judged. If yes, go to step 610; if not, go to step 606.
And step 610, determining verification target information by adopting at least one target area corresponding to the identification information according to the identification information corresponding to the stored file.
Therefore, the terminal equipment can acquire the storage record or the storage information of the stored file, the identification information corresponding to the stored file is determined according to the storage information, the identification information is obtained through calculation according to the data corresponding to the target area in the stored file, the target area for calculating the identification information determines at least one target area needing to calculate the identification information in the file to be transmitted, and the verification target information is obtained based on the at least one target area. And the channel identifier of the transmission channel can be acquired, and if session (session) communication is adopted between the server and the terminal device, the channel identifier is sessionId, and the channel identifier is added to the verification target information.
In addition, since the file identification information can uniquely represent the data content of one file, when different users store the same file (i.e. the file with the same data content), one file identification can be allocated to each user, and all users can also share the file identification, so that the file identification can also be recorded in the storage record or storage information, and each user identification corresponding to the file identification can also be recorded. Or, separating the file storage information from the user data in the server, that is, storing information of the file in the storage information of the file, such as file identification information, file size, identification information of data corresponding to at least one target area in the file, and storing in the user data: and establishing a mapping relation between the user data and the storage information of the file by using the file identification, the user identification, the uploading time and the like, so that the file can be found based on the file identification, and the corresponding user can also be found based on the file identification information.
In an optional embodiment of the present application, determining verification target information by using at least one identification information corresponding to a target area includes: determining an offset and a data length according to the target area corresponding to the at least one piece of identification information; and generating verification target information by adopting the offset and the data length. The method comprises the steps of determining target areas with identification information according to stored files matched with files to be transmitted, selecting at least one target area to calculate offset and data length, and generating verification target information by adopting the offset and the data length.
Step 612, sending the verification target information.
The authentication target information may be sent to the server.
Atstep 614, authentication information is received.
And the terminal equipment generates verification information according to the verification target information and returns the verification information to the server. The verification information comprises a channel identifier and identifier information of data corresponding to at least one target area.
And step 616, acquiring the identification information of the data corresponding to the target area from the verification information.
Step 618, determining whether the identification information of the file to be transmitted matches the identification information of the corresponding stored file.
And acquiring a channel identifier and identifier information of data corresponding to a target area from the verification information, and then checking the reliability of the file to be transmitted by adopting the message digest according to the transmission channel identifier and the data corresponding to the target area, wherein if both the channel identifier and the message digest pass the verification, the reliability is confirmed, otherwise, the reliability is not confirmed.
Whether the identification information of the file to be transmitted is matched with the identification information of the corresponding stored file or not can be judged; if yes, i.e. the identification information is matched, go to step 620; if not, that is, the identification information is not matched, the process may be ended, or step 606 may be executed, to instruct the terminal device to upload the corresponding file.
In an optional embodiment, whether the corresponding transmission channel is valid is determined according to the channel identifier; and executing the step of sending the verification information after judging that the transmission channel is effective. That is, whether the corresponding transmission channel is valid is determined according to the channel identifier, for example, whether the transmission channel is valid within the time period is determined according to the creation time and the expiration time, and whether the transmission channel is correct is determined according to the signature data. And can also judge whether the replay attack appears on the basis of the channel identification, thus judge the validity of the transmission channel, namely a valid channel identification (such as sessionId) will be marked as used at the server after being used, thus after encountering the same channel identification again, the server will refuse the request, prevent from appearing the replay attack because the authentication information is intercepted in the course of sending. If the transmission channel is invalid, the message can be ignored; if the transmission channel is valid, the subsequent steps can be performed.
Step 620, allocating a file identifier for the file to be transmitted, and establishing an association relationship between the file identifier and the corresponding storage record of the stored file.
Step 622, generating the storage information of the file to be transmitted by using the file address and/or the file identifier in the storage record.
Step 624, sending the stored information.
After confirming that the file to be transmitted is credible, namely the channel identifier is valid and the identification information is matched, a new file identifier can be generated according to the corresponding same stored file, the file identifier is distributed to the file to be transmitted, and an association relation is established between the file identifier and the corresponding storage record of the stored file, namely the storage record is correspondingly associated with the file identifier of the file to be uploaded by the terminal equipment. Therefore, the file address and/or the file identifier can be obtained from the storage record, the storage information of the file to be transmitted is generated by adopting the file address and/or the file identifier and is returned to the terminal equipment, so that the terminal equipment is informed that the file is successfully uploaded, and the second transmission function is completed.
In an embodiment of the present application, the message digest includes at least one of the following: md5 value, SHA value, base64 value. The SHA values include message digests of SHA families such as SHA1, SHA125, SHA256, SHA512, and the like.
Therefore, in an optional embodiment, at the query stage, at least one message digest calculated for the file to be transmitted may be carried in the file information to determine the storage state corresponding to the file to be transmitted. That is, the file information may be a combination of a message digest such as an md5 value and a file size during the query phase, or a combination of two or more message digests, such as a combination of hash functions such as an md5 value and a sha1 value. Moreover, for the verification information, the message digest of the data corresponding to one target area in the file to be transmitted, such as the md5 value, may be calculated, or the message digests of a plurality of discontinuous data corresponding to the target area may be calculated.
In summary, in the embodiments of the present application, a file may be uniquely determined by using multiple factors such as a message digest and a file size, so as to query whether a corresponding file is stored in a server. On the basis, the probability that an attacker forges the information stealing file is greatly reduced.
In the second transmission stage, the message digest of the target area in the file is used as one of the judgment criteria for judging that the client owns the file, so that the second transmission function is prevented from being provided for the client under the condition that the client does not have the file, namely the client cannot transmit the file for the second under the condition that the client does not have the file, and the data security is improved.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the embodiments. Further, those skilled in the art will also appreciate that the embodiments described in the specification are presently preferred and that no particular act is required of the embodiments of the application.
The embodiment of the application also provides a file transmission device which is applied to the server.
Referring to fig. 7, a block diagram of a file transfer apparatus according to an embodiment of the present application is shown, which may specifically include the following modules:
the target sending module 702 is configured to determine verification target information of a file to be transmitted according to a stored file, and send the verification target information, where the file to be transmitted is matched with the stored file.
An obtaining module 704, configured to obtain at least one piece of identification information in the file to be transmitted from the received verification information, where the identification information is determined according to the verification target information.
The determining module 706 is configured to determine whether the identification information of the file to be transmitted matches the identification information of the corresponding stored file.
And a storage sending module 708, configured to send the information of the file to be transmitted after the identification information is confirmed to be matched.
In summary, after the server confirms that the file to be transmitted is matched with the stored file, the server can determine the verification target information of the file to be transmitted according to the stored file, so that the terminal equipment can calculate the identification information of at least one target datum in the file to be transmitted based on the verification target information, judge whether the identification information of the file to be transmitted is matched with the identification information corresponding to the stored file, and confirm that the file to be transmitted is stored in the terminal equipment after the identification information is matched, so that the information of the file to be transmitted can be sent, the file is ensured to exist in both the server and the client through the verification information, the problem that the file is stolen by forged information is prevented, and the safety of information is ensured.
Wherein the identification information includes: and (4) message digest. The message digest includes at least one of: md5 value of fifth version of message digest algorithm, SHA value of secure hash algorithm, and 64 value of base.
The target sending module 702 is configured to determine verification target information by using at least one target area corresponding to the identification information according to the identification information corresponding to the stored file.
The target sending module 702 is configured to determine an offset and a data length according to a target area corresponding to the at least one piece of identification information; and generating verification target information by adopting the offset and the data length.
And the identification information is generated according to the data of the target area in the file to be transmitted. And if the number of the identification information is more than one, calculating and determining the identification information according to the discontinuous target area corresponding data in the file to be transmitted.
The target sending module 702 is further configured to obtain a channel identifier of a transmission channel, and add the channel identifier of the transmission channel to the verification target information.
The determining module 706 is further configured to determine whether the transmission channel is valid according to the channel identifier; and if the transmission channel is effective, executing the matching judgment of the identification information.
The obtaining module 704 is further configured to receive file information of the file to be transmitted, and obtain at least one file identifier from the file information; the determining module 706 is further configured to determine whether the file identifier information of the file to be transmitted matches the file identifier information of the stored file; and if the file identification information is matched, confirming that the file to be transmitted is matched with the stored file.
The file information further includes: the file size of the file to be transmitted; the determining module 706 is further configured to determine whether the file size of the file to be transmitted matches the file size of the stored file matched with the file identification information; and if the sizes of the files are matched, confirming that the file to be transmitted is matched with the stored file.
The information of the file to be transmitted includes storage information of the file to be transmitted, and the storage sending module 708 is further configured to allocate a file identifier for the file to be transmitted, and establish an association relationship between the file identifier and the stored file corresponding storage record; generating storage information of the file to be transmitted by adopting the file address and/or the file identification in the storage record
The embodiment of the application also provides a file transmission device which is applied to the terminal equipment.
Referring to fig. 8, a block diagram of another embodiment of the document transmission apparatus according to the present application is shown, and specifically, the apparatus may include the following modules:
a receiving module 802, configured to receive verification target information, where the verification target information is generated according to a stored file that matches a file to be transmitted; and receiving the information of the file to be transmitted.
The verification information determining module 804 is configured to determine at least one piece of identification information of the file to be transmitted according to the verification target information, and generate verification information according to the identification information.
A sending module 806, configured to send the verification information.
In summary, after the server confirms that the file to be transmitted is matched with the stored file, the server can determine the verification target information of the file to be transmitted according to the stored file, so that the terminal equipment can calculate the identification information of at least one target datum in the file to be transmitted based on the verification target information, judge whether the identification information of the file to be transmitted is matched with the identification information corresponding to the stored file, and confirm that the file to be transmitted is stored in the terminal equipment after the identification information is matched, so that the storage information of the file to be transmitted can be generated, the file is ensured to exist in both the server and the client through the verification information, the problem that the file is stolen by forged information is prevented, and the safety of information is ensured.
Referring to fig. 9, a block diagram of an alternative embodiment of a document transport apparatus according to the present application is shown.
Wherein the identification information includes: and (4) message digest. The message digest includes at least one of: md5 value of fifth version of message digest algorithm, SHA value of secure hash algorithm, and 64 value of base.
The verification information determination module 804 includes: an area determination sub-module 8042 and a calculation sub-module 8044.
The area determining submodule 8042 is configured to determine, according to the verification target information, that the file to be transmitted corresponds to at least one target area.
The calculating submodule 8044 is configured to calculate identification information of the data corresponding to the target area.
The area determination submodule 8044 is configured to obtain at least one data length and at least one offset from the verification target information; and determining a target area from the file to be transmitted according to the offset and the data length.
The verification target information includes: identifying a channel; the verification information determining module 804 is further configured to determine whether a corresponding transmission channel is valid according to the channel identifier; and after confirming that the transmission channel is valid, sending the verification information.
And if the verification information comprises more than one identification information, calculating and determining each identification information according to discontinuous target area corresponding data in the file to be transmitted.
The device further comprises:
the file information determining module 808 is configured to generate file information of the file to be transmitted, and send the file information of the file to be transmitted, where the file information is used to determine a stored file that matches the file to be transmitted.
The file information determining module 808 is configured to calculate at least one piece of file identification information of the file to be transmitted, and use the at least one piece of file identification information of the file to be transmitted as file information.
The file information determining module 808 is further configured to obtain a file size of the file to be transmitted, and add the file size of the file to be transmitted in the file information.
In an embodiment of the present application, the message digest includes at least one of the following: md5 value, SHA value, base64 value. The SHA values include message digests of SHA families such as SHA1, SHA125, SHA256, SHA512, and the like.
Therefore, in an optional embodiment, two or more message digests calculated for the file to be transmitted can be carried in the file information in the query stage to determine the corresponding storage state of the file to be transmitted. That is, the file information may be a combination of a message digest such as an md5 value and a file size during the query phase, or a combination of two or more message digests, such as a combination of an md5 value and a sha1 value, or other hash functions. Moreover, for the second verification information, the message digests of the data corresponding to 1 target area in the file to be transmitted, such as the md5 value, may be calculated, or the message digests of a plurality of discontinuous data corresponding to the target area may also be calculated.
In summary, in the embodiments of the present application, a file may be uniquely determined by using multiple factors such as a message digest and a file size, so as to query whether a corresponding file is stored in a server. On the basis, the probability that an attacker forges the information stealing file is greatly reduced.
In the second transmission stage, the message digest of the target area in the file is used as one of the judgment criteria for judging that the client owns the file, so that the second transmission function is prevented from being provided for the client under the condition that the client does not have the file, namely the client cannot transmit the file for the second under the condition that the client does not have the file, and the data security is improved.
The present application further provides a non-volatile readable storage medium, where one or more modules (programs) are stored in the storage medium, and when the one or more modules are applied to a terminal device, the one or more modules may cause the terminal device to execute instructions (instructions) of method steps in the present application.
In an alternative embodiment, the method comprises: one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause a terminal device to perform one or more of the file transfer methods described in embodiments of the present application.
In another alternative embodiment, the method comprises: one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause a server to perform one or more of the file transfer methods described in embodiments of the present application.
Fig. 10 is a schematic hardware structure diagram of an apparatus according to an embodiment of the present application. The device may include various devices such as a server, a terminal device, a temperature control device, and the like. As shown in fig. 10, the terminal device may include aninput device 100, a processor 101, anoutput device 102, amemory 103, and at least onecommunication bus 104. Thecommunication bus 104 is used to realize communication connection between the elements. Thememory 103 may comprise a high speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, where various programs may be stored in thememory 103 for performing various processing functions and implementing the method steps of the present embodiment.
Alternatively, the processor 101 may be implemented by, for example, a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a controller, a microcontroller, a microprocessor, or other electronic components, and the processor 101 is coupled to theinput device 100 and theoutput device 102 through a wired or wireless connection.
Optionally, theinput device 100 may include a variety of input devices, for example, at least one of a user-oriented user interface, a device-oriented device interface, a software programmable interface, a camera, and a sensor. Optionally, the device interface facing the device may be a wired interface for data transmission between devices, or may be a hardware plug-in interface (e.g., a USB interface, a serial port, etc.) for data transmission between devices; optionally, the user-facing user interface may be, for example, a user-facing control key, a voice input device for receiving voice input, and a touch sensing device (e.g., a touch screen with a touch sensing function, a touch pad, etc.) for receiving user touch input; optionally, the programmable interface of the software may be, for example, an entry for a user to edit or modify a program, such as an input pin interface or an input interface of a chip; optionally, the transceiver may be a radio frequency transceiver chip with a communication function, a baseband processing chip, a transceiver antenna, and the like. An audio input device such as a microphone may receive voice data. Theoutput device 102 may include a display, a sound, or other output device.
In this embodiment, the processor of the terminal device includes a module for executing the functions of the modules of the data processing apparatus in each device, and specific functions and technical effects may refer to the foregoing embodiments, which are not described herein again.
Fig. 11 is a schematic hardware structure diagram of a terminal device according to another embodiment of the present application. FIG. 11 is a specific embodiment of the implementation of FIG. 10. As shown in fig. 11, the terminal device of the present embodiment includes aprocessor 111 and amemory 112.
Theprocessor 111 executes the computer program code stored in thememory 112 to implement the file transmission method in fig. 1 to 6 in the above embodiments.
Thememory 112 is configured to store various types of data to support operations at the terminal device. Examples of such data include instructions for any application or method operating on the terminal device, such as messages, pictures, videos, and so forth. Thememory 112 may include a Random Access Memory (RAM) and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
Optionally, theprocessor 111 is provided in theprocessing assembly 110. The terminal device may further include: acommunication component 113, apower component 114, a multimedia component 115, anaudio component 116, an input/output interface 117 and/or asensor component 118. The specific components included in the terminal device are set according to actual requirements, which is not limited in this embodiment.
Theprocessing component 110 generally controls the overall operation of the terminal device. Theprocessing component 110 may include one ormore processors 111 to execute instructions to perform all or part of the steps of the methods of fig. 1-6 described above. Further, theprocessing component 110 can include one or more modules that facilitate interaction between theprocessing component 110 and other components. For example, theprocessing component 110 may include a multimedia module to facilitate interaction between the multimedia component 115 and theprocessing component 110.
Thepower supply component 114 provides power to the various components of the terminal device. Thepower components 114 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the terminal device.
The multimedia component 115 includes a display screen that provides an output interface between the terminal device and the user. In some embodiments, the display screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the display screen includes a touch panel, the display screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
Theaudio component 116 is configured to output and/or input audio signals. For example, theaudio component 116 may include a Microphone (MIC) configured to receive external audio signals when the terminal device is in an operational mode, such as a voice recognition mode. The received audio signal may further be stored in thememory 112 or transmitted via thecommunication component 113. In some embodiments,audio component 116 further includes a speaker for outputting audio signals.
The input/output interface 117 provides an interface between theprocessing component 110 and peripheral interface modules, which may be click wheels, buttons, etc. These buttons may include, but are not limited to: a volume button, a start button, and a lock button.
Thesensor component 118 includes one or more sensors for providing various aspects of status assessment for the terminal device. For example, thesensor component 118 may detect the open/closed status of the terminal device, the relative positioning of the components, the presence or absence of user contact with the terminal device. Thesensor assembly 118 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact, including detecting the distance between the user and the terminal device. In some embodiments, thesensor assembly 118 may also include a camera or the like.
Thecommunication component 113 is configured to facilitate wired or wireless communication between the terminal device and other devices. The terminal device may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In one embodiment, the terminal device may include a SIM card slot therein for inserting a SIM card therein, so that the terminal device may log onto a GPRS network to establish communication with the server via the internet.
From the above, thecommunication component 113, theaudio component 116, the input/output interface 117 and thesensor component 118 in the embodiment of fig. 11 can be implemented as the input device in the embodiment of fig. 10.
In a terminal device of this embodiment, the method includes: one or more processors; and one or more machine readable media having instructions stored thereon, which when executed by the one or more processors, cause the terminal device to perform a method as described in one or more of the embodiments of the application.
In a server of this embodiment, the method includes: one or more processors; and one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the server to perform a method as described in one or more of the embodiments of the application.
An embodiment of the present application further provides an operating system for a terminal device, as shown in fig. 12, the operating system of the device includes: a receiving unit 1202, an authentication unit 1204, and a communication unit 1206.
A receiving unit 1202 that receives verification target information generated from a stored file that matches a file to be transmitted; and receiving the information of the file to be transmitted.
The verification unit 1204 determines at least one piece of identification information of the file to be transmitted according to the verification target information, and generates verification information according to the identification information.
A communication unit 1006, which transmits the authentication information.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the true scope of the embodiments of the application.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The foregoing describes a file transmission method, a file transmission apparatus, a terminal device, a storage medium, and an operating system provided in the present application in detail, and specific examples are applied in the present application to explain the principles and embodiments of the present application, and the descriptions of the foregoing examples are only used to help understand the method and core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.