CN109104481B - File integrity detection method, file integrity detection device and terminal equipment - Google Patents

File integrity detection method, file integrity detection device and terminal equipment Download PDF

Info

Publication number
CN109104481B
CN109104481B CN201810889979.0A CN201810889979A CN109104481B CN 109104481 B CN109104481 B CN 109104481B CN 201810889979 A CN201810889979 A CN 201810889979A CN 109104481 B CN109104481 B CN 109104481B
Authority
CN
China
Prior art keywords
file
server
marker
mark
ending
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810889979.0A
Other languages
Chinese (zh)
Other versions
CN109104481A (en
Inventor
周慧鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN201810889979.0A priority Critical patent/CN109104481B/en
Publication of CN109104481A publication Critical patent/CN109104481A/en
Application granted granted Critical
Publication of CN109104481B publication Critical patent/CN109104481B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application provides a file integrity detection method, a file integrity detection device, a terminal device and a computer readable storage medium, comprising: before downloading a first file from a server, downloading a start mark file and an end mark file of the first file, wherein the first file is a file needing to be downloaded from the server, and the start mark file and the end mark file are used for indicating whether the first file is complete or not; if the starting mark file and the ending mark file are both downloaded successfully, detecting whether the content of the starting mark file is the same as that of the ending mark file; and if the content of the starting marker file is the same as that of the ending marker file, determining that the first file is complete, and downloading the first file from the server. The problem that whether the file stored in the server is complete or not can not be detected in the prior art can be solved through the method and the device.

Description

File integrity detection method, file integrity detection device and terminal equipment
Technical Field
The present application belongs to the field of communications technologies, and in particular, to a file integrity detection method, a file integrity detection apparatus, a terminal device, and a computer-readable storage medium.
Background
With the rapid development of network technology, in order to facilitate file management, users generally upload files in terminal devices to a server, store the files in the server, and download the files from the server when necessary. However, the prior art cannot detect whether the file stored in the server is complete, and when the file stored in the server is incomplete, the user downloads the incomplete file.
Disclosure of Invention
In view of this, the present application provides a file integrity detection method, a file integrity detection apparatus, a terminal device, and a computer-readable storage medium, so as to solve the problem that the prior art cannot detect whether a file stored in a server is complete.
A first aspect of the present application provides a file integrity detection method, including:
before downloading a first file from a server, downloading a start mark file and an end mark file of the first file, wherein the first file is a file needing to be downloaded from the server, and the start mark file and the end mark file are used for indicating whether the first file is complete or not;
if the starting mark file and the ending mark file are both downloaded successfully, detecting whether the content of the starting mark file is the same as that of the ending mark file;
and if the content of the starting marker file is the same as that of the ending marker file, determining that the first file is complete, and downloading the first file from the server.
A second aspect of the present application provides a file integrity detection apparatus, including:
the first downloading module is used for downloading a start mark file and an end mark file of a first file before the first file is downloaded from a server, wherein the first file is a file needing to be downloaded from the server, and the start mark file and the end mark file are used for indicating whether the first file is complete or not;
a content detection module, configured to detect whether the content of the start marker file is the same as the content of the end marker file if both the start marker file and the end marker file are successfully downloaded;
and the second downloading module is used for determining that the first file is complete and downloading the first file from the server if the content of the starting marker file is the same as that of the ending marker file.
A third aspect of the present application provides a terminal device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the file integrity detection method according to the first aspect when executing the computer program.
A fourth aspect of the present application provides a computer-readable storage medium, storing a computer program which, when executed by a processor, performs the steps of the file integrity detection method as described in the first aspect above.
A fifth aspect of the present application provides a computer program product comprising a computer program which, when executed by one or more processors, performs the steps of the file integrity verification method as described in the first aspect above.
It can be seen from the above that, in the present scheme, before downloading a first file from a server, a start flag file and an end flag file of the first file are downloaded from the server, if the start flag file and the end flag file are both downloaded successfully, it is detected whether the content of the start flag file is the same as the content of the end flag file, and when the content of the start flag file is the same as the content of the end flag file, it is determined that the first file is complete, and the first file is downloaded from the server from the beginning. According to the scheme, the completeness of the file stored in the server can be detected through the starting mark file and the ending mark file, and the file is downloaded when the file is complete, so that a user can be ensured to download the complete file from the server, and the problem that whether the file stored in the server is complete or not cannot be detected in the prior art is solved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flowchart illustrating an implementation process of a file integrity detection method according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating an implementation of a file integrity detection method according to a second embodiment of the present application;
FIG. 3 is a schematic diagram of a file integrity detection apparatus according to a third embodiment of the present application;
fig. 4 is a schematic diagram of a terminal device provided in the fourth embodiment of the present application;
fig. 5 is a schematic diagram of a terminal device provided in the fifth embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In particular implementations, the terminal devices described in embodiments of the present application include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers having touch sensitive surfaces (e.g., touch screen displays and/or touch pads). It should also be understood that in some embodiments, the device is not a portable communication device, but is a desktop computer having a touch-sensitive surface (e.g., a touch screen display and/or touchpad).
In the discussion that follows, a terminal device that includes a display and a touch-sensitive surface is described. However, it should be understood that the terminal device may include one or more other physical user interface devices such as a physical keyboard, mouse, and/or joystick.
The terminal device supports various applications, such as one or more of the following: a drawing application, a presentation application, a word processing application, a website creation application, a disc burning application, a spreadsheet application, a gaming application, a telephone application, a video conferencing application, an email application, an instant messaging application, an exercise support application, a photo management application, a digital camera application, a web browsing application, a digital music player application, and/or a digital video player application.
Various applications that may be executed on the terminal device may use at least one common physical user interface device, such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal can be adjusted and/or changed between applications and/or within respective applications. In this way, a common physical architecture (e.g., touch-sensitive surface) of the terminal can support various applications with user interfaces that are intuitive and transparent to the user.
It should be understood that, the sequence numbers of the steps in this embodiment do not mean the execution sequence, and the execution sequence of each process should be determined by the function and the inherent logic of the process, and should not constitute any limitation to the implementation process of the embodiment of the present application.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Referring to fig. 1, which is a schematic view of an implementation flow of a file integrity detection method provided in an embodiment of the present application, as shown in the figure, the file integrity detection method may include the following steps:
step S101, before downloading a first file from a server, downloading a start mark file and an end mark file of the first file.
Wherein, the first file is a file to be downloaded from the server. The start flag file and the end flag file are used to indicate whether the first file is complete, the start flag file and the end flag file may be files including flag information, the flag information in the start flag file and the flag information in the end flag file are the same, the flag information is used to indicate whether the first file is complete, the flag information may be set by a user, or may be automatically generated when the terminal device uploads the start flag file of the first file to the server, for example, when the terminal device uploads the start flag file of the first file to the server, the current time information of the terminal device (i.e., the time when the start flag file is uploaded) is obtained, and the current time information is used as the flag information in the start flag file and the end flag file. The server includes, but is not limited to, a File Transfer Protocol (FTP) server, where the FTP server is a computer providing File storage and access service on the internet, and a user may use a terminal device to remotely access the FTP server through the network to download a File stored in the FTP server according to the FTP service.
In the embodiment of the application, the terminal device uploads the start marker file and the end marker file of the first file while uploading the first file to the server, and detects whether the first file stored in the server is complete through the start marker file and the end marker file, that is, detects whether the first file uploaded to the server by the terminal device is complete.
In this embodiment of the present application, a terminal device may send first file downloading request information to a server, and after receiving the first file downloading request information, the server feeds back a start flag file and an end flag file of the first file to the terminal device, and if the start flag file and the end flag file of the first file are received within a preset time, it is determined that both the start flag file and the end flag file of the first file are successfully downloaded; if any one of the start marker file and the end marker file of the first file is not received within the preset time, it is determined that the downloading of the file (i.e., the file which is not received) fails, the file may not exist in the server, the first file may be incomplete, and at this time, a prompt message may be sent to the server to prompt that the first file is incomplete through the prompt message. The preset time is used for judging whether the file is successfully downloaded from the server, and the preset time can be set by the user, which is not limited herein.
It should be noted that, in order to avoid a file download failure caused by a network reason, before downloading a start flag file and an end flag file of a first file from a server, a network to which a terminal device is currently connected is detected, and an RSSI (Received Signal Strength Indication) value of a Received Signal of the network to which the terminal device is currently connected is obtained, and when the RSSI value of the network to which the terminal device is currently connected is greater than or equal to a preset threshold, the terminal device may communicate with the server through the currently connected network, for example, upload a file to the server or download a file from the server through the currently connected network; when the RSSI value of the network to which the terminal equipment is currently connected is smaller than the preset threshold value, the network to which the terminal equipment is currently connected can be switched to the network with the RSSI value larger than the preset threshold value, so that the network is kept stable when the terminal equipment is communicated with the server.
Step S102, if the start mark file and the end mark file are both downloaded successfully, detecting whether the content of the start mark file is the same as the content of the end mark file.
In this embodiment, if the terminal device successfully downloads the start flag file and the end flag file from the server, it may determine whether the first file is complete by detecting whether the content of the start flag file is the same as the content of the end flag file (i.e., detecting whether the flag information in the start flag file is the same as the flag information in the end flag file).
Step S103, if the content of the start marker file is the same as the content of the end marker file, determining that the first file is complete, and downloading the first file from the server.
In this embodiment of the present application, if the content of the start marker file is the same as the content of the end marker file, it may be determined that the first file is complete, and the first file starts to be downloaded from the server; if the content of the start marker file is different from the content of the end marker file, it may be determined that the first file is incomplete, and a prompt message may be sent to the server to prompt the server that the first file is incomplete.
According to the embodiment of the application, the integrity of the file stored in the server can be detected through the start marker file and the end marker file, and the file is downloaded when the file is complete, so that a user can be ensured to download the complete file from the server, and the problem that whether the file stored in the server is complete cannot be detected in the prior art is solved.
Referring to fig. 2, which is a schematic view of an implementation flow of the file integrity detection method provided in the second embodiment of the present application, as shown in the figure, the file integrity detection method may include the following steps:
step S201, a start flag file of the first file is uploaded to the server.
Wherein the first file is a file to be downloaded from the server, the start flag file and the end flag file are used for indicating whether the first file is complete or not, the start flag file and the end flag file may refer to files including flag information, the flag information in the start flag file and the flag information in the end flag file are the same, the flag information is used for indicating whether the first file is complete, the flag information can be set by a user or automatically generated when the terminal device uploads a start flag file of the first file to the server, for example, when the terminal device uploads the start marker file of the first file to the server, the current time information of the terminal device (i.e., the time when the start marker file is uploaded) is obtained, and the current time information is used as the marker information in the start marker file and the end marker file. The server includes but is not limited to an FTP server, the FTP server is a computer which provides file storage and access service on the Internet, and according to the FTP service, a user can remotely access the FTP server through a network by using a terminal device to download files stored by the FTP server.
Step S202, after the uploading of the starting mark file is completed, the first file is uploaded to the server;
optionally, when the number of the first files is multiple, the uploading the first file to the server includes:
and uploading a plurality of first files to the server one by one.
In this embodiment of the application, when the terminal device uploads the first file to the server, the number of the first file may be one or more (i.e., at least two), and when the number of the first file is multiple, the first file may be uploaded to the server one by one, so as to reduce data processing threads of the terminal device.
Step S203, after the uploading of the first file is completed, uploading an end flag file of the first file to the server.
In this embodiment of the application, when the terminal device uploads the first file to the server, the start flag file of the first file may be uploaded to the server first, after the upload of the start flag file is completed, the terminal device uploads the first file to the server again, and after the upload of the first file is completed, the end flag file of the first file is uploaded to the server.
Optionally, the content of the start marker file and the content of the end marker file both include:
the start marks the time when the file is uploaded.
In this embodiment, when the terminal device uploads the start marker file to the server, it may obtain current time information of the terminal device (i.e., time when the start marker file is uploaded), and use the current time information as the contents of the start marker file and the end marker file.
In order to facilitate the user to know the progress of the terminal device in uploading the file to the server, the uploading progress bar may be displayed when the terminal device uploads the start marker file of the first file, and the end marker file of the first file to the server.
Step S204, before downloading the first file from the server, downloading the start flag file and the end flag file.
The step is the same as step S101, and reference may be made to the related description of step S101, which is not repeated herein.
Step S205, if the start flag file and the end flag file are both downloaded successfully, detecting whether the content of the start flag file is the same as the content of the end flag file.
The step is the same as step S102, and reference may be made to the related description of step S102, which is not repeated herein.
Step S206, if the content of the start marker file is the same as the content of the end marker file, determining that the first file is complete, and downloading the first file from the server.
The step is the same as step S103, and reference may be made to the related description of step S103, which is not described herein again.
Optionally, if the content of the start marker file is different from the content of the end marker file, or if downloading of any one of the start marker file and the end marker file fails, it is determined that the first file is incomplete.
In this embodiment of the present application, if the content of the start marker file is different from the content of the end marker file, it is determined that the first file is incomplete; and if at least one of the starting marker file and the ending marker file fails to download, determining that the first file is incomplete.
Optionally, after determining that the first file is incomplete, the method further includes:
and sending prompt information to the server, wherein the prompt information is used for prompting the server that the first file is incomplete.
In this embodiment of the application, after determining that the first file is incomplete, the terminal device may send a prompt message to the server to prompt the server that the first file is incomplete, and after receiving the prompt message, the server may delete the incomplete first file from the server to prevent other users from downloading the incomplete first file.
According to the method and the device for detecting the integrity of the first file in the server, when the first file is uploaded to the server, the start mark file and the end mark file of the first file are uploaded at the same time, so that the integrity of the first file in the server can be detected according to the start mark file and the end mark file of the first file when the first file is downloaded from the server.
Referring to fig. 3, the document integrity detection apparatus provided in the third embodiment of the present application is schematically illustrated, and for convenience of description, only the relevant portions of the third embodiment of the present application are shown.
The file integrity detection device comprises:
a first downloading module 31, configured to download a start flag file and an end flag file of a first file before downloading the first file from a server, where the first file is a file that needs to be downloaded from the server, and the start flag file and the end flag file are used to indicate whether the first file is complete;
a content detection module 32, configured to detect whether the content of the start marker file is the same as the content of the end marker file if the start marker file and the end marker file are both downloaded successfully;
a second downloading module 33, configured to determine that the first file is complete if the content of the start marker file is the same as the content of the end marker file, and download the first file from the server.
Optionally, the file integrity detection apparatus further includes:
a determining module 34, configured to determine that the first file is incomplete if the content of the start marker file is different from the content of the end marker file, or if any one of the start marker file and the end marker file fails to be downloaded;
and a prompt information sending module 35, configured to send prompt information to the server, where the prompt information is used to prompt the server that the first file is incomplete.
Optionally, the file integrity detection apparatus further includes:
a file uploading module 36, configured to upload the first file to the server.
Optionally, the file uploading module 36 includes:
a first uploading unit, configured to upload the start flag file to the server;
a second uploading unit, configured to upload the first file to the server after the uploading of the start flag file is completed;
and the third uploading unit is used for uploading the ending mark file to the server after the first file is uploaded.
Optionally, the second uploading unit is specifically configured to:
and when the number of the first files is multiple, uploading the multiple first files to the server one by one.
Optionally, the content of the start marker file and the content of the end marker file both include:
the start marks the time when the file is uploaded.
The file integrity detection device provided in the embodiment of the present application can be applied to the first method embodiment and the second method embodiment, and for details, reference is made to the description of the first method embodiment and the second method embodiment, and details are not repeated here.
Fig. 4 is a schematic diagram of a terminal device according to a fourth embodiment of the present application. The terminal device as shown in the figure may include: one or more processors 401 (only one shown); one or more input devices 402 (only one shown), one or more output devices 403 (only one shown), and memory 404. The processor 401, the input device 402, the output device 403, and the memory 404 are connected by a bus 405. The memory 404 is used for storing instructions and the processor 401 is used for executing the instructions stored by the memory 404. Wherein:
the processor 401 is configured to download a start flag file and an end flag file of a first file before downloading the first file from a server, where the first file is a file that needs to be downloaded from the server, and the start flag file and the end flag file are used to indicate whether the first file is complete; if the starting mark file and the ending mark file are both downloaded successfully, detecting whether the content of the starting mark file is the same as that of the ending mark file; and if the content of the starting marker file is the same as that of the ending marker file, determining that the first file is complete, and downloading the first file from the server.
Optionally, the processor 401 is further configured to:
and if the content of the start marker file is different from the content of the end marker file, or if any one of the start marker file and the end marker file fails to download, determining that the first file is incomplete.
Optionally, after determining that the first file is incomplete, the processor 401 is further configured to:
and sending prompt information to the server, wherein the prompt information is used for prompting the server that the first file is incomplete.
Optionally, before downloading the file from the server, the processor 401 is further configured to:
uploading the first file to the server;
optionally, the processor 401 is specifically configured to:
uploading the start marker file to the server;
after the uploading of the start marker file is completed, uploading the first file to the server;
and after the uploading of the first file is completed, uploading the ending mark file to the server.
Optionally, when the number of the first files is multiple, the processor 401 is specifically configured to:
and uploading a plurality of first files to the server one by one.
Optionally, the content of the start marker file and the content of the end marker file both include:
the start marks the time when the file is uploaded.
It should be understood that, in the embodiment of the present Application, the Processor 401 may be a Central Processing Unit (CPU), and the Processor may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 402 may include a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, a data receiving interface, and the like. The output devices 403 may include a display (LCD, etc.), speakers, a data transmission interface, and the like.
The memory 404 may include a read-only memory and a random access memory, and provides instructions and data to the processor 401. A portion of the memory 404 may also include non-volatile random access memory. For example, the memory 404 may also store device type information.
In a specific implementation, the processor 401, the input device 402, the output device 403, and the memory 404 described in this embodiment may execute the implementation described in the embodiment of the file integrity detection method provided in this embodiment, or may execute the implementation described in the file integrity detection apparatus described in the third embodiment, which is not described herein again.
Fig. 5 is a schematic diagram of a terminal device provided in the fifth embodiment of the present application. As shown in fig. 5, the terminal device 5 of this embodiment includes: a processor 50, a memory 51 and a computer program 52 stored in said memory 51 and executable on said processor 50. The processor 50 executes the computer program 52 to implement the steps in the above-mentioned embodiments of the file integrity checking method, such as the steps S101 to S103 shown in fig. 1. Alternatively, the processor 50, when executing the computer program 52, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of the modules 31 to 36 shown in fig. 3.
Illustratively, the computer program 52 may be partitioned into one or more modules/units, which are stored in the memory 51 and executed by the processor 50 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 52 in the terminal device 5. For example, the computer program 52 may be divided into a first downloading module, a content detecting module, a second downloading module, a determining module, a prompt information sending module, and a file uploading module, where the specific functions of the modules are as follows:
the first downloading module is used for downloading a start mark file and an end mark file of a first file before the first file is downloaded from a server, wherein the first file is a file needing to be downloaded from the server, and the start mark file and the end mark file are used for indicating whether the first file is complete or not;
a content detection module, configured to detect whether the content of the start marker file is the same as the content of the end marker file if both the start marker file and the end marker file are successfully downloaded;
and the second downloading module is used for determining that the first file is complete and downloading the first file from the server if the content of the starting marker file is the same as that of the ending marker file.
A determining module, configured to determine that the first file is incomplete if the content of the start marker file is different from the content of the end marker file, or if any one of the start marker file and the end marker file fails to be downloaded;
and the prompt information sending module is used for sending prompt information to the server, wherein the prompt information is used for prompting the server that the first file is incomplete.
And the file uploading module is used for uploading the first file to the server.
Optionally, the file uploading module includes:
a first uploading unit, configured to upload the start flag file to the server;
a second uploading unit, configured to upload the first file to the server after the uploading of the start flag file is completed;
and the third uploading unit is used for uploading the ending mark file to the server after the first file is uploaded.
Optionally, the second uploading unit is specifically configured to:
and when the number of the first files is multiple, uploading the multiple first files to the server one by one.
Optionally, the content of the start marker file and the content of the end marker file both include:
the start marks the time when the file is uploaded.
The terminal device 5 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 50, a memory 51. Those skilled in the art will appreciate that fig. 5 is merely an example of a terminal device 5 and does not constitute a limitation of terminal device 5 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input-output devices, network access devices, buses, etc.
The processor 50 may be a central processing unit CPU, but may also be other general purpose processors, digital signal processors DSP, application specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may be an internal storage unit of the terminal device 5, such as a hard disk or a memory of the terminal device 5. The memory 51 may also be an external storage device of the terminal device 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the terminal device 5. The memory 51 is used for storing the computer program and other programs and data required by the terminal device. The memory 51 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for detecting the integrity of a file in a server is applied to terminal equipment, and is characterized by comprising the following steps:
before downloading a first file from a server, downloading a start mark file and an end mark file of the first file, wherein the first file is a file needing to be downloaded from the server, and the start mark file and the end mark file are used for indicating whether the first file is complete or not; the method comprises the steps that terminal equipment uploads a start marker file and an end marker file of a first file while uploads the first file to a server;
if the start mark file and the end mark file of the first file are received within the preset time, determining that the start mark file and the end mark file of the first file are both downloaded successfully; if any one of the start marker file and the end marker file of the first file is not received within a preset time, determining that the start marker file and the end marker file of the first file are failed to download;
if the starting mark file and the ending mark file are both downloaded successfully, detecting whether the content of the starting mark file is the same as that of the ending mark file;
if the content of the starting marker file is the same as that of the ending marker file, determining that the first file is complete, and downloading the first file from the server;
and if the downloading of the starting mark file and the ending mark file fails, determining that the starting mark file and the ending mark file do not exist in the server, and the first file is incomplete.
2. The file integrity detection method of claim 1, further comprising:
and if the content of the starting marker file is different from the content of the ending marker file, determining that the first file is incomplete.
3. The file integrity detection method of claim 2, after determining that the first file is incomplete, further comprising:
and sending prompt information to the server, wherein the prompt information is used for prompting the server that the first file is incomplete.
4. The file integrity checking method of claim 1, further comprising, before downloading the file from the server:
and uploading the first file to the server.
5. The file integrity detection method of claim 4, wherein said uploading the first file to the server comprises:
uploading the start marker file to the server;
after the uploading of the start marker file is completed, uploading the first file to the server;
and after the uploading of the first file is completed, uploading the ending mark file to the server.
6. The file integrity detection method of any one of claims 1 to 5, wherein the contents of the start marker file and the end marker file each comprise:
the start marks the time when the file is uploaded.
7. A file integrity detection device in a server is contained in a terminal device, and is characterized by comprising:
the first downloading module is used for downloading a start mark file and an end mark file of a first file before the first file is downloaded from a server, wherein the first file is a file needing to be downloaded from the server, and the start mark file and the end mark file are used for indicating whether the first file is complete or not; the method comprises the steps that terminal equipment uploads a start marker file and an end marker file of a first file while uploads the first file to a server;
the content detection module is used for determining that the starting mark file and the ending mark file of the first file are downloaded successfully if the starting mark file and the ending mark file of the first file are received within preset time; if any one of the start marker file and the end marker file of the first file is not received within a preset time, determining that the start marker file and the end marker file of the first file are failed to download; if the starting mark file and the ending mark file are both downloaded successfully, detecting whether the content of the starting mark file is the same as that of the ending mark file; if the downloading of the starting marker file and the ending marker file fails, determining that the starting marker file and the ending marker file do not exist in a server, and the first file is incomplete;
and the second downloading module is used for determining that the first file is complete and downloading the first file from the server if the content of the starting marker file is the same as that of the ending marker file.
8. The file integrity checking device of claim 7, further comprising:
and the determining module is used for determining that the first file is incomplete if the content of the starting marker file is different from the content of the ending marker file.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the file integrity detection method according to any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the file integrity detection method according to any one of claims 1 to 6.
CN201810889979.0A 2018-08-07 2018-08-07 File integrity detection method, file integrity detection device and terminal equipment Active CN109104481B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810889979.0A CN109104481B (en) 2018-08-07 2018-08-07 File integrity detection method, file integrity detection device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810889979.0A CN109104481B (en) 2018-08-07 2018-08-07 File integrity detection method, file integrity detection device and terminal equipment

Publications (2)

Publication Number Publication Date
CN109104481A CN109104481A (en) 2018-12-28
CN109104481B true CN109104481B (en) 2021-09-21

Family

ID=64848632

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810889979.0A Active CN109104481B (en) 2018-08-07 2018-08-07 File integrity detection method, file integrity detection device and terminal equipment

Country Status (1)

Country Link
CN (1) CN109104481B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109922142B (en) * 2019-02-21 2022-04-19 创新先进技术有限公司 File downloading method, device and system
CN112099822B (en) * 2020-08-26 2023-09-15 华人运通(江苏)技术有限公司 File update reminding method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1855059A (en) * 2005-04-21 2006-11-01 中兴通讯股份有限公司 Method for accessing data file of telecommunication apparatus
CN106603614A (en) * 2015-10-20 2017-04-26 北京国双科技有限公司 File transmission method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050149720A1 (en) * 2004-01-07 2005-07-07 Shimon Gruper Method for speeding up the pass time of an executable through a checkpoint
CN101193284B (en) * 2007-12-27 2010-07-07 北京中星微电子有限公司 Validation method, system and device for transmission integrity of compressed file
CN102790790A (en) * 2011-10-21 2012-11-21 北京安天电子设备有限公司 Checking system and method for rapidly acquiring integrity of web server file
CN106570425A (en) * 2015-10-10 2017-04-19 北京奇虎科技有限公司 Hard disk data encryption method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1855059A (en) * 2005-04-21 2006-11-01 中兴通讯股份有限公司 Method for accessing data file of telecommunication apparatus
CN106603614A (en) * 2015-10-20 2017-04-26 北京国双科技有限公司 File transmission method and device

Also Published As

Publication number Publication date
CN109104481A (en) 2018-12-28

Similar Documents

Publication Publication Date Title
CN108733342B (en) Volume adjusting method, mobile terminal and computer readable storage medium
CN108038112B (en) File processing method, mobile terminal and computer readable storage medium
CN110225104B (en) Data acquisition method and device and terminal equipment
CN107451244B (en) Folder naming method, mobile terminal and computer readable storage medium
CN108400868B (en) Seed key storage method and device and mobile terminal
CN110244963B (en) Data updating method and device and terminal equipment
CN106126256A (en) A kind of driven management method, Apparatus and system
CN109104481B (en) File integrity detection method, file integrity detection device and terminal equipment
CN106775835B (en) Method, server and terminal for acquiring upgrade file
CN107679222B (en) Picture processing method, mobile terminal and computer readable storage medium
CN109271266B (en) File transmission method and device and terminal equipment
CN109298956B (en) File transmission method and device and terminal equipment
CN112015459A (en) Method and device for upgrading image file, terminal and readable storage medium
CN110245016B (en) Data processing method, system, device and terminal equipment
CN110874729B (en) Switching method and switching device for electronic red packet identification strategy and mobile terminal
CN107609119B (en) File processing method, mobile terminal and computer readable storage medium
CN109492249B (en) Rapid generation method and device of design drawing and terminal equipment
CN108536512B (en) Interface switching method and device and terminal equipment
CN112912855A (en) Starting-up detection method, starting-up detection device and mobile terminal
CN110874730B (en) Information processing method, information processing device and mobile terminal
CN110162479B (en) Abnormal application detection method and device and terminal equipment
CN111352357B (en) Robot control method and device and terminal equipment
CN108595569B (en) File path copying method, file path copying device and mobile terminal
CN110688035B (en) Photo album processing method, photo album processing device and mobile terminal
CN109799715B (en) Data receiving method, device and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant