CN109271266B - File transmission method and device and terminal equipment - Google Patents

File transmission method and device and terminal equipment Download PDF

Info

Publication number
CN109271266B
CN109271266B CN201811180803.4A CN201811180803A CN109271266B CN 109271266 B CN109271266 B CN 109271266B CN 201811180803 A CN201811180803 A CN 201811180803A CN 109271266 B CN109271266 B CN 109271266B
Authority
CN
China
Prior art keywords
copy
cut
version information
operation set
operating system
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
CN201811180803.4A
Other languages
Chinese (zh)
Other versions
CN109271266A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201811180803.4A priority Critical patent/CN109271266B/en
Publication of CN109271266A publication Critical patent/CN109271266A/en
Application granted granted Critical
Publication of CN109271266B publication Critical patent/CN109271266B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/543User-generated data transfer, e.g. clipboards, dynamic data exchange [DDE], object linking and embedding [OLE]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/545Gui

Abstract

The application is applicable to the technical field of communication, and provides a file transmission method, a file transmission device and terminal equipment, wherein the file transmission method comprises the following steps: monitoring whether a connection is established with a PC end; if the connection with the PC end is established, sending a first operation set to the PC end, wherein the first operation set comprises a copy object and a cut object supported by the MTP protocol, and the first operation set is used for indicating the PC end to execute corresponding copy operation or cut operation according to the copy object or the cut object supported by the MTP protocol. The method can improve the operation success rate of the copying operation and the cutting operation.

Description

File transmission method and device and terminal equipment
Technical Field
The present application belongs to the field of communications technologies, and in particular, to a file transmission method, an apparatus, a terminal device, and a computer-readable storage medium.
Background
The current mobile device has a larger memory, and a user can store more data through the mobile device, but the operation of the mobile device is still limited to a certain extent and inconvenient because the volume of the mobile device is limited. For example, when a user needs to copy or cut a file (or folder) of a mobile device, a connection is usually established with a Personal Computer (PC), and the file (or folder) is copied or cut by an operation at the PC.
The existing file transmission method generally adopts the google native flow to realize the copy and cut of the file, but because the operating system of the PC end is continuously updated, operation failure or data loss may be caused when the copy operation or the cut operation is executed by adopting the google native flow.
Therefore, it is necessary to provide a new method to solve the above technical problems.
Disclosure of Invention
In view of this, embodiments of the present application provide a file transfer method to solve the problem of operation failure or data loss caused by executing a copy operation or a cut operation in the prior art.
A first aspect of an embodiment of the present application provides a file transfer method, including:
monitoring whether a connection is established with a PC end;
if the connection with the PC end is established, sending a first operation set to the PC end, wherein the first operation set comprises a copy object and a cut object supported by the MTP protocol, and the first operation set is used for indicating the PC end to execute corresponding copy operation or cut operation according to the copy object or the cut object supported by the MTP protocol.
A second aspect of the embodiments of the present application provides a file transfer method, including:
monitoring whether a connection is established with the mobile equipment;
if the connection with the mobile equipment is established, receiving a first operation set sent by the mobile equipment, wherein the first operation set comprises a copy object and a cut object supported by an MTP protocol, and the version information of an operating system of the PC end is first appointed version information;
and if the PC end receives the copy instruction or the cut instruction, executing corresponding copy operation or cut operation according to the copy instruction or the cut instruction and the copy object or the cut object supported by the MTP protocol.
A third aspect of the embodiments of the present application provides a file transfer apparatus, where the file transfer apparatus is applied to a mobile device, and the file transfer apparatus includes:
the connection monitoring unit is used for monitoring whether the connection is established with the PC terminal;
a first operation set sending unit, configured to send a first operation set to a PC end if a connection is established with the PC end, where the first operation set includes a copy object and a cut object supported by an MTP protocol, and the first operation set is used to instruct the PC end to perform a corresponding copy operation or cut operation according to the copy object or the cut object supported by the MTP protocol.
A fourth aspect of the embodiments of the present application provides a file transfer apparatus, including:
the monitoring unit is connected with the mobile equipment and is used for monitoring whether the connection with the mobile equipment is established;
a first operation set receiving unit, configured to receive a first operation set sent by a mobile device if a connection is established with the mobile device, where the first operation set includes a copy object and a cut object supported by an MTP protocol, and version information of an operating system at a PC end is first specified version information;
and the operation execution unit is used for executing corresponding copy operation or cut operation according to the copy instruction or the cut instruction and the copy object or the cut object supported by the MTP protocol if the PC end receives the copy instruction or the cut instruction.
A fifth aspect of embodiments of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method according to the first aspect or implements the steps of the method according to the second aspect when executing the computer program.
A sixth aspect of embodiments of the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method according to the first aspect or performs the steps of the method according to the second aspect.
Compared with the prior art, the embodiment of the application has the advantages that:
the operation set comprising the copy object and the cut object is sent to the PC end after the operation set is connected with the PC end, so that the operation set is prevented from interacting with the PC end once by executing one operation, the interaction times are reduced, and the copy object and the cut object which are contained in the first operation set sent to the PC end are supported by an MTP protocol and are not an android native copy object and a native cut object, so that the operation set can be suitable for the PC ends with different operating system versions to execute corresponding copy operation and cut operation, the operation success rate of the copy operation and the cut operation is improved, and the data loss is reduced.
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 flowchart of a file transmission method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another file transmission method according to the second embodiment of the present application;
fig. 3 is a structural diagram of a file transfer device according to a third embodiment of the present application;
fig. 4 is a structural diagram of another file transfer device according to a 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.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
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 mobile terminals 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 devices described above are not portable communication devices, but rather are desktop computers having touch-sensitive surfaces (e.g., touch screen displays and/or touch pads).
In the discussion that follows, a mobile terminal that includes a display and a touch-sensitive surface is described. However, it should be understood that the mobile terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and/or joystick.
The mobile terminal 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 mobile terminal 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.
In addition, in the description of the present application, the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
The first embodiment is as follows:
fig. 1 shows a flowchart of a file transfer method provided in an embodiment of the present application, which is described from a mobile device side, and details are as follows:
step S11, monitoring whether to establish connection with the PC terminal;
in the step, whether the mobile equipment (such as a mobile phone, a U disk and the like) is connected with the PC end through a USB line is monitored.
Step S12, if the connection is established with the PC end, sending a first operation set to the PC end, where the first operation set includes a copy object and a cut object supported by the MTP protocol, and the first operation set is used to instruct the PC end to execute a corresponding copy operation or a corresponding cut operation according to the copy object or the cut object supported by the MTP protocol.
After the mobile device establishes a connection with the PC, the file of the mobile device is copied or cut by using a Multimedia Transfer Protocol (MTP). The MTP is a protocol published by microsoft for data interaction between a media device and a PC, and the bottom layer relies on a Universal Serial Bus (USB) protocol.
In this step, the MTP protocol specifies input parameters and output parameters, and the mobile device further defines a copy object (CopyObject) and a cut object (MoveObject) supported in the MTP protocol specification, so that the PC can perform corresponding copy operation and cut operation according to the input parameters and the output parameters of the MTP protocol specification and the defined copy object and cut object. The input parameters include the following information: data type, source address, output parameters include the following information: a destination address and a storage location.
In the embodiment of the application, if it is monitored that a connection with a PC end is established, a first operation set is sent to the PC end, where the first operation set includes a copy object and a cut object supported by an MTP protocol, and the first operation set is used to instruct the PC end to execute a corresponding copy operation or a corresponding cut operation according to the copy object or the cut object supported by the MTP protocol. The operation set comprising the copy object and the cut object is sent to the PC end after the operation set is connected with the PC end, so that the operation set is prevented from interacting with the PC end once by executing one operation, the interaction times are reduced, and the copy object and the cut object which are contained in the first operation set sent to the PC end are supported by an MTP protocol and are not an android native copy object and a native cut object, so that the operation set can be suitable for the PC ends with different operating system versions to execute corresponding copy operation and cut operation, the operation success rate of the copy operation and the cut operation is improved, and the data loss is reduced.
Optionally, in order to further improve the operation success rate of the copy operation and the cut operation, the file transfer method further includes:
a1, receiving feedback information which is sent by the PC end and comprises operation failure;
a2, acquiring the version information of the operating system of the PC terminal; the os version information here includes the os version number installed on the PC side, the os name, and the like. Of course, if a plurality of operating systems are installed on the PC, the operating system version number, the operating system name, and the like currently in communication with the mobile device are acquired. Optionally, there are various ways for the mobile device to obtain the os version information of the PC, for example, obtaining the os version information by inputting the os version information of the PC into the mobile device by a user, or sending the os version information by requesting the PC. When sending the acquisition by requesting the PC side, the step a2 includes: a21, requesting the version information of the operating system at the PC end through the USB protocol; a22, receiving the version information of the operating system sent by the PC terminal. Specifically, when the mobile device establishes a connection with the PC terminal through the USB cable, the mobile device requests the os version information of the PC terminal through the USB protocol, and the PC terminal sends the os version information corresponding to the os currently communicating with the mobile device to the mobile device.
A3, if the version information of the operating system of the PC end is second specified version information, sending a second operation set to the PC end, where the second operation set includes an android native copy object and a native cut object, the native copy object and the native cut object are different from those supported by the MTP protocol, and the second operation set instructs the PC end to execute a corresponding copy operation or a cut operation according to the native copy object and the native cut object.
Wherein the second specified version information includes at least one operating system version information.
Preferably, the second specified version information is a windows 7 version, or a version below windows 7 or an operating system version corresponding to other non-first specified version information. Preferably, the first specified version information is a windows10 version, or a windows10 or more version.
Optionally, in order to obtain accurate os version information, if the os version information of the PC is the first specified version information, the user is prompted to input the os version information of the PC,
judging whether the operating system version information of the PC end input by the user is the same as the first appointed version information, if the operating system version information of the PC end input by the user is different from the first appointed version information, taking the operating system version information of the PC end input by the user as the acquired operating system version information of the PC end, and sending a second operation set to the PC end, and if the operating system version information of the PC end input by the user is the same as the first appointed version information, sending a first operation set to the PC end.
In this embodiment, when the os version information automatically acquired by the mobile device from the PC is different from the os version information input by the user, the second operation set is sent based on the os version information input by the user.
Optionally, after sending the first operation set to the PC, the method may still cause the copy operation or the cut operation to be failed again, and therefore includes:
counting the times of sending the first operation set to the PC terminal;
correspondingly, if the version information of the operating system of the PC terminal input by the user is the same as the first specified version information, sending the first operation set to the PC terminal specifically includes:
if the version information of the operating system of the PC end input by the user is the same as the first appointed version information, judging whether the counted times of sending the first operation set to the PC end is less than or equal to the preset times, and if the counted times of sending the first operation set to the PC end is less than or equal to the preset times, sending the first operation set to the PC end.
In this embodiment, the first operation set is sent to the PC only if the number of times of sending the first operation set to the PC is less than or equal to the preset number of times. Of course, if the number of times of sending the first operation set to the PC is greater than the preset number of times, the user is prompted to find the reason for the failure in executing the operation, for example, to find whether the mobile device itself has a problem.
Optionally, after the step a1, the method includes:
judging whether the type corresponding to the feedback information is a specified type; wherein the specified type includes, but is not limited to, any of: copy path problems, USB interface problems, antivirus software problems, etc.
Correspondingly, the step a2 specifically includes:
and if the type corresponding to the feedback information is not the specified type, acquiring the version information of the operating system of the PC terminal.
In this embodiment, since the operation failure is usually caused by the problem of the specified type, it is considered whether the operation failure is caused by the version of the operating system of the PC side after the type corresponding to the excluded feedback information is not the specified type, and the speed of solving the operation failure can be increased.
Optionally, if the operating system of the PC includes a customized copy object and a customized cut object, the mobile device sends a priority setting instruction to the PC, where the priority setting instruction is used to instruct the PC to set different priorities for different scenes: when a copy operation or a cut operation between files (or folders) of the mobile device is executed, setting the priority of a copy object and a cut object which are supported by the MTP protocol and comprise the first operation set to be higher than the priority of a self-defined copy object and a cut object which are contained in an operating system at the PC end; when the copy operation or the cut operation between the files (or the folders) of the PC end is executed, the priority of the copy object and the cut object which are set to be supported by the MTP protocol and comprise the first operation set is lower than the priority of the self-defined copy object and the cut object which are set to be supported by the operating system of the PC end. By setting different priorities for different scenes, the successful execution of the copy operation and the cut operation of the corresponding scene can be ensured.
Example two:
fig. 2 shows a schematic flow chart of another file transmission method provided in the second embodiment of the present application, which is mainly described from the PC side and detailed as follows:
step S21, monitoring whether to establish connection with the mobile device;
step S22, if the connection with the mobile device is established, receiving a first operation set sent by the mobile device, wherein the first operation set comprises a copy object and a cut object supported by the MTP protocol, and the version information of the operating system of the PC end is first appointed version information;
in this step, the MTP protocol specifies input parameters and output parameters, and the mobile device further defines a copy object (CopyObject) and a cut object (MoveObject) supported in the MTP protocol specification, so that the PC can perform corresponding copy operation and cut operation according to the input parameters and the output parameters of the MTP protocol specification and the defined copy object and cut object. The input parameters include the following information: data type, source address, output parameters include the following information: a destination address and a storage location.
Step S23, if the PC receives the copy instruction or the cut instruction, execute a corresponding copy operation or a cut operation according to the copy instruction or the cut instruction and the copy object or the cut object supported by the MTP protocol.
In this step, if the PC end receives the copy instruction, the PC end executes the corresponding copy operation according to the copy object supported by the MTP protocol included in the received first operation set, instead of executing the corresponding copy operation according to the android native copy object, so that the PC end can be suitable for the PC ends installed with different operating system versions to execute the corresponding copy operation and cut operation, thereby improving the operation success rate of the copy operation and cut operation and reducing data loss.
Optionally, in order to ensure that the mobile device timely knows whether the current operation is successful or failed, the file transmission method further includes:
if the copying operation or the cutting operation fails, sending feedback information including the operation failure to the mobile equipment;
if the version information of the operating system of the PC end is second specified version information, receiving a second operation set sent by the mobile device, wherein the second operation set comprises an android native copy object and a native cut object, the native copy object and the native cut object are different from those supported by the MTP protocol, and the second operation set instructs the PC end to execute corresponding copy operation or cut operation according to the native copy object and the native cut object;
wherein the second specified version information includes at least one operating system version information.
Preferably, the second specified version information is a windows 7 version, or a version below windows 7 or an operating system version corresponding to other non-first specified version information. Preferably, the first specified version information is a windows10 version, or a windows10 or more version.
Optionally, the file transfer method further includes:
if the version information of the operating system of the PC end is first appointed version information and is different from the version information of the operating system of the PC end input by a user, receiving a second operation set sent by the mobile equipment; and if the version information of the operating system of the PC terminal is first appointed version information and is the same as the version information of the operating system of the PC terminal input by a user, receiving a first operation set sent by the mobile equipment.
Optionally, if the operating system of the PC end includes a customized copy object and a customized cut object, the PC end receives a priority setting instruction sent by the mobile device, where the priority setting instruction is used to instruct the PC end to set different priorities for different scenes: when a copy operation or a cut operation between files (or folders) of the mobile device is executed, setting the priority of a copy object and a cut object which are supported by the MTP protocol and comprise the first operation set to be higher than the priority of a self-defined copy object and a cut object which are contained in an operating system at the PC end; when the copy operation or the cut operation between the files (or the folders) of the PC end is executed, the priority of the copy object and the cut object which are set to be supported by the MTP protocol and comprise the first operation set is lower than the priority of the self-defined copy object and the cut object which are set to be supported by the operating system of the PC end. By setting different priorities for different scenes, the successful execution of the copy operation and the cut operation of the corresponding scene can be ensured.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Example three:
corresponding to the embodiment, fig. 3 shows a structure diagram of a file transfer apparatus provided in the embodiment of the present application, where the file transfer apparatus is applied to a mobile device, and for convenience of description, only the parts related to the embodiment are shown:
the file transfer apparatus 3 includes: a connection listening unit 31 and a first operation set sending unit 32, wherein:
a connection monitoring unit 31, configured to monitor whether a connection is established with a PC terminal;
a first operation set sending unit 32, configured to send a first operation set to a PC end if a connection is established with the PC end, where the first operation set includes a copy object and a cut object supported by an MTP protocol, and the first operation set is used to instruct the PC end to perform a corresponding copy operation or a corresponding cut operation according to the copy object or the cut object supported by the MTP protocol.
The MTP protocol specifies input parameters and output parameters, and the mobile device further defines a copy object (CopyObject) and a cut object (MoveObject) supported in the MTP protocol specification, so that the PC can perform corresponding copy operation and cut operation according to the input parameters and the output parameters of the MTP protocol specification and the defined copy object and cut object. The input parameters include the following information: data type, source address, output parameters include the following information: a destination address and a storage location.
In the embodiment of the application, after the operation set is connected with the PC end, the operation set comprising the copy object and the cut object is sent to the PC end, so that the operation set is prevented from interacting with the PC end once by executing one operation, the interaction times are reduced, and the copy object and the cut object which are included in the first operation set sent to the PC end are supported by an MTP protocol and are not android native copy object and native cut object, so that the operation set can be suitable for the PC ends installed with different operating system versions to execute corresponding copy operation and cut operation, the operation success rate of the copy operation and the cut operation is improved, and the data loss is reduced.
Optionally, in order to further improve the operation success rate of the copy operation and the cut operation, the file transfer apparatus 3 further includes:
the feedback information receiving unit is used for receiving feedback information which comprises operation failure and is sent by the PC terminal;
the operating system version information acquisition unit is used for acquiring operating system version information of the PC terminal; the os version information here includes the os version number installed on the PC side, the os name, and the like. Optionally, the operating system version information obtaining unit includes: the operating system version information request module is used for requesting the operating system version information of the PC terminal through a USB protocol; and the operating system version information module is used for receiving the operating system version information sent by the PC terminal.
A second operation set sending unit, configured to send a second operation set to the PC end if the os version information of the PC end is a second specified version information, where the second operation set includes an android native copy object and a native cut object, the native copy object and the native cut object are different from the copy object and the cut object supported by the MTP protocol, and the second operation set instructs the PC end to perform a corresponding copy operation or a cut operation according to the native copy object and the native cut object.
Wherein the second specified version information includes at least one operating system version information.
Preferably, the second specified version information is a windows 7 version, or a version below windows 7 or an operating system version corresponding to other non-first specified version information. Preferably, the first specified version information is a windows10 version, or a windows10 or more version.
Optionally, in order to obtain accurate os version information, the file transfer apparatus further includes:
the operating system version information prompt input unit is used for prompting a user to input the operating system version information of the PC end if the operating system version information of the PC end is first specified version information;
and the operating system version information comparison unit is used for judging whether the operating system version information of the PC end input by the user is the same as the first appointed version information or not, taking the operating system version information of the PC end input by the user as the acquired operating system version information of the PC end and sending a second operation set to the PC end if the operating system version information of the PC end input by the user is different from the first appointed version information, and sending a first operation set to the PC end if the operating system version information of the PC end input by the user is the same as the first appointed version information.
Optionally, since the failure of the copy operation or the cut operation may be caused again after the first operation set is sent to the PC, the file transfer apparatus further includes: the number counting unit is used for counting the number of times of sending the first operation set to the PC terminal after the first operation set is sent to the PC terminal;
correspondingly, the os version information comparing unit is specifically configured to:
if the version information of the operating system of the PC end input by the user is the same as the first appointed version information, judging whether the counted times of sending the first operation set to the PC end is less than or equal to the preset times, and if the counted times of sending the first operation set to the PC end is less than or equal to the preset times, sending the first operation set to the PC end.
Optionally, the file transfer apparatus further includes:
the feedback information type judging unit is used for judging whether the type corresponding to the feedback information is a specified type; wherein the specified type includes, but is not limited to, any of: copy path problems, USB interface problems, antivirus software problems, etc.
Correspondingly, the os version information obtaining unit is specifically configured to: and if the type corresponding to the feedback information is not the specified type, acquiring the version information of the operating system of the PC terminal.
Optionally, the file transfer apparatus further includes:
a priority setting instruction sending unit, configured to send a priority setting instruction to the PC end if an operating system of the PC end includes a customized copy object and a customized cut object, where the priority setting instruction is used to instruct the PC end to set different priorities for different scenes: when a copy operation or a cut operation between files (or folders) of the mobile device is executed, setting the priority of a copy object and a cut object which are supported by the MTP protocol and comprise the first operation set to be higher than the priority of a self-defined copy object and a cut object which are contained in an operating system at the PC end; when the copy operation or the cut operation between the files (or the folders) of the PC end is executed, the priority of the copy object and the cut object which are set to be supported by the MTP protocol and comprise the first operation set is lower than the priority of the self-defined copy object and the cut object which are set to be supported by the operating system of the PC end.
Example four:
corresponding to the embodiment, fig. 4 shows a schematic structural diagram of another file transmission device provided in the fourth embodiment of the present application, which is applied to a PC side, and for convenience of description, only the parts related to the present embodiment are shown.
The another file transfer apparatus 4 includes: a mobile device connection monitoring unit 41, a first operation set receiving unit 42, and an operation executing unit 43. Wherein:
a connection monitoring unit 41 connected to the mobile device, configured to monitor whether a connection is established with the mobile device;
a first operation set receiving unit 42, configured to receive a first operation set sent by a mobile device if a connection is established with the mobile device, where the first operation set includes a copy object and a cut object supported by an MTP protocol, and version information of an operating system at the PC end is first specified version information;
the MTP protocol specifies input parameters and output parameters, and the mobile device further defines a copy object (CopyObject) and a cut object (MoveObject) supported in the MTP protocol specification, so that the PC can perform corresponding copy operation and cut operation according to the input parameters and the output parameters of the MTP protocol specification and the defined copy object and cut object. The input parameters include the following information: data type, source address, output parameters include the following information: a destination address and a storage location.
An operation executing unit 43, configured to, if the PC receives the copy instruction or the cut instruction, execute a corresponding copy operation or a corresponding cut operation according to the copy instruction or the cut instruction and the copy object or the cut object supported by the MTP protocol.
In the embodiment of the application, because the PC terminal executes the corresponding copy operation or cut operation according to the copy instruction or cut instruction and the copy object or cut object supported by the MTP protocol, instead of executing the corresponding copy operation according to the android native copy object, the PC terminal can be suitable for the PC terminals installed with different operating system versions to execute the corresponding copy operation and cut operation, thereby improving the operation success rate of the copy operation and cut operation and reducing data loss.
Optionally, in order to ensure that the mobile device timely knows whether the current operation is successful or failed, the another file transmission apparatus 4 further includes:
a feedback information sending unit, configured to send feedback information including operation failure to the mobile device if the copy operation or the cut operation fails;
a second operation set receiving unit, configured to receive a second operation set sent by a mobile device if the version information of the operating system of the PC end is second specified version information, where the second operation set includes an android native copy object and a native cut object, the native copy object and the native cut object are different from the copy object and the cut object supported by the MTP protocol, and the second operation set instructs the PC end to perform a corresponding copy operation or a cut operation according to the native copy object and the native cut object;
wherein the second specified version information includes at least one operating system version information.
Preferably, the second specified version information is a windows 7 version, or a version below windows 7 or an operating system version corresponding to other non-first specified version information. Preferably, the first specified version information is a windows10 version, or a windows10 or more version.
Optionally, the another file transmission apparatus 4 further includes:
the operating system version information comparison unit is used for receiving a second operation set sent by the mobile equipment if the operating system version information of the PC terminal is first appointed version information and is different from the operating system version information of the PC terminal input by a user; and if the version information of the operating system of the PC terminal is first appointed version information and is the same as the version information of the operating system of the PC terminal input by a user, receiving a first operation set sent by the mobile equipment.
Optionally, the another file transmission apparatus 4 further includes:
a priority setting indication receiving unit, configured to receive, by the PC end, a priority setting indication sent by the mobile device if an operating system of the PC end includes a customized copy object and a customized cut object, where the priority setting indication is used to indicate that the PC end sets different priorities for different scenes: when a copy operation or a cut operation between files (or folders) of the mobile device is executed, setting the priority of a copy object and a cut object which are supported by the MTP protocol and comprise the first operation set to be higher than the priority of a self-defined copy object and a cut object which are contained in an operating system at the PC end; when the copy operation or the cut operation between the files (or the folders) of the PC end is executed, the priority of the copy object and the cut object which are set to be supported by the MTP protocol and comprise the first operation set is lower than the priority of the self-defined copy object and the cut object which are set to be supported by the operating system of the PC end. By setting different priorities for different scenes, the successful execution of the copy operation and the cut operation of the corresponding scene can be ensured.
Example five:
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, when executing the computer program 52, implements the steps in the above-described respective file transfer method embodiments, such as the steps S11 to S12 shown in fig. 1, or the steps S21 to S23 shown in fig. 2. 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 units 31 to 32 shown in fig. 3, or such as the units 41 to 43 shown in fig. 4.
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 connection listening unit and a first operation set sending unit, and each unit specifically functions as follows:
the connection monitoring unit is used for monitoring whether the connection is established with the PC terminal;
a first operation set sending unit, configured to send a first operation set to a PC end if a connection is established with the PC end, where the first operation set includes a copy object and a cut object supported by an MTP protocol, and the first operation set is used to instruct the PC end to perform a corresponding copy operation or cut operation according to the copy object or the cut object supported by the MTP protocol.
Alternatively, the computer program 52 may be divided into a connection monitoring unit with the mobile device, a first operation set receiving unit, and an operation executing unit, where the specific functions of each unit are as follows:
the monitoring unit is connected with the mobile equipment and is used for monitoring whether the connection with the mobile equipment is established;
a first operation set receiving unit, configured to receive a first operation set sent by a mobile device if a connection is established with the mobile device, where the first operation set includes a copy object and a cut object supported by an MTP protocol, and version information of an operating system at a PC end is first specified version information;
and the operation execution unit is used for executing corresponding copy operation or cut operation according to the copy instruction or the cut instruction and the copy object or the cut object supported by the MTP protocol if the PC end receives the copy instruction or the cut instruction.
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), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, 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 (9)

1. A file transmission method is applied to mobile equipment and comprises the following steps:
monitoring whether a connection is established with a PC end;
if the connection is established with the PC end, sending a first operation set to the PC end, wherein the first operation set comprises a copy object and a cut object supported by an MTP protocol, and the first operation set is used for indicating the PC end to execute corresponding copy operation or cut operation according to the copy object or the cut object supported by the MTP protocol, wherein the MTP protocol specifies input parameters and output parameters, and the input parameters comprise the following information: data type, source address; the output parameters include the following information: a destination address and a storage location; the mobile device defining a copy object and a cut object supported in the MTP protocol specification;
receiving feedback information which comprises operation failure and is sent by a PC end;
acquiring version information of an operating system of the PC terminal;
if the version information of the operating system of the PC end is second specified version information, sending a second operation set to the PC end, wherein the second operation set comprises an android native copy object and a native cut object, the native copy object and the native cut object are different from those supported by the MTP protocol, and the second operation set instructs the PC end to execute corresponding copy operation or cut operation according to the native copy object and the native cut object.
2. The file transmission method according to claim 1, wherein if the version information of the operating system at the PC side is the first designated version information, the user is prompted to input the version information of the operating system at the PC side,
judging whether the operating system version information of the PC end input by the user is the same as the first appointed version information, if the operating system version information of the PC end input by the user is different from the first appointed version information, taking the operating system version information of the PC end input by the user as the acquired operating system version information of the PC end, and sending a second operation set to the PC end, and if the operating system version information of the PC end input by the user is the same as the first appointed version information, sending a first operation set to the PC end.
3. The file transfer method according to claim 2, wherein after said sending the first set of operations to the PC side, comprising:
counting the times of sending the first operation set to the PC terminal;
correspondingly, if the version information of the operating system of the PC terminal input by the user is the same as the first specified version information, sending the first operation set to the PC terminal specifically includes:
if the version information of the operating system of the PC end input by the user is the same as the first appointed version information, judging whether the counted times of sending the first operation set to the PC end is less than or equal to the preset times, and if the counted times of sending the first operation set to the PC end is less than or equal to the preset times, sending the first operation set to the PC end.
4. The file transmission method according to claim 1, wherein after the receiving of the feedback information including operation failure sent by the PC side, comprising:
judging whether the type corresponding to the feedback information is a specified type;
correspondingly, the acquiring the version information of the operating system of the PC terminal specifically includes:
and if the type corresponding to the feedback information is not the specified type, acquiring the version information of the operating system of the PC terminal.
5. A file transmission method is applied to a PC end and comprises the following steps:
monitoring whether a connection is established with the mobile equipment;
if the connection with the mobile device is established, receiving a first operation set sent by the mobile device, wherein the first operation set comprises a copy object and a cut object supported by an MTP protocol, and the version information of an operating system of the PC end is first specified version information, wherein the MTP protocol specifies input parameters and output parameters, and the input parameters comprise the following information: data type, source address; the output parameters include the following information: a destination address and a storage location; the mobile device defining a copy object and a cut object supported in the MTP protocol specification;
if the PC end receives a copy instruction or a cut instruction, executing corresponding copy operation or cut operation according to the copy instruction or the cut instruction and a copy object or a cut object supported by the MTP protocol;
if the copying operation or the cutting operation fails, sending feedback information including the operation failure to the mobile equipment;
and if the version information of the operating system of the PC end is second specified version information, receiving a second operation set sent by the mobile equipment, wherein the second operation set comprises an android native copy object and a native cut object, the native copy object and the native cut object are different from those supported by the MTP protocol, and the second operation set instructs the PC end to execute corresponding copy operation or cut operation according to the native copy object and the native cut object.
6. A file transmission device applied to a mobile device is characterized by comprising:
the connection monitoring unit is used for monitoring whether the connection is established with the PC terminal;
a first operation set sending unit, configured to send a first operation set to a PC end if a connection is established with the PC end, where the first operation set includes a copy object and a cut object supported by an MTP protocol, and the first operation set is used to instruct the PC end to perform a corresponding copy operation or a cut operation according to the copy object or the cut object supported by the MTP protocol, where the MTP protocol specifies input parameters and output parameters, and the input parameters include the following information: data type, source address; the output parameters include the following information: a destination address and a storage location; the mobile device defining a copy object and a cut object supported in the MTP protocol specification;
the feedback information receiving unit is used for receiving feedback information which comprises operation failure and is sent by the PC terminal;
the operating system version information acquisition unit is used for acquiring operating system version information of the PC terminal; the version information of the operating system comprises the version number of the operating system installed at the PC terminal, the name of the operating system and the like;
a second operation set sending unit, configured to send a second operation set to the PC end if the os version information of the PC end is a second specified version information, where the second operation set includes an android native copy object and a native cut object, the native copy object and the native cut object are different from the copy object and the cut object supported by the MTP protocol, and the second operation set instructs the PC end to perform a corresponding copy operation or a cut operation according to the native copy object and the native cut object.
7. A file transmission device is applied to a PC end and comprises:
the monitoring unit is connected with the mobile equipment and is used for monitoring whether the connection with the mobile equipment is established;
a first operation set receiving unit, configured to receive a first operation set sent by a mobile device if a connection is established with the mobile device, where the first operation set includes a copy object and a cut object supported by an MTP protocol, and version information of an operating system at a PC end is first specified version information, where the MTP protocol specifies input parameters and output parameters, and the input parameters include the following information: data type, source address; the output parameters include the following information: a destination address and a storage location; the mobile device defining a copy object and a cut object supported in the MTP protocol specification;
an operation execution unit, configured to execute, if the PC receives a copy instruction or a cut instruction, a corresponding copy operation or a corresponding cut operation according to the copy instruction or the cut instruction and a copy object or a cut object supported by the MTP protocol;
a feedback information sending unit, configured to send feedback information including operation failure to the mobile device if the copy operation or the cut operation fails;
a second operation set receiving unit, configured to receive a second operation set sent by a mobile device if the os version information of the PC is second specified version information, where the second operation set includes an android native copy object and a native cut object, the native copy object and the native cut object are different from the copy object and the cut object supported by the MTP protocol, and the second operation set instructs the PC to perform a corresponding copy operation or a cut operation according to the native copy object and the native cut object.
8. 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 method according to any one of claims 1 to 4 or implements the steps of the method according to claim 5 when executing the computer program.
9. 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 method according to any one of claims 1 to 4 or carries out the steps of the method according to claim 5.
CN201811180803.4A 2018-10-09 2018-10-09 File transmission method and device and terminal equipment Active CN109271266B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811180803.4A CN109271266B (en) 2018-10-09 2018-10-09 File transmission method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811180803.4A CN109271266B (en) 2018-10-09 2018-10-09 File transmission method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN109271266A CN109271266A (en) 2019-01-25
CN109271266B true CN109271266B (en) 2020-07-28

Family

ID=65196427

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811180803.4A Active CN109271266B (en) 2018-10-09 2018-10-09 File transmission method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN109271266B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112445651B (en) * 2019-09-05 2024-01-30 腾讯科技(深圳)有限公司 File copying method, device, equipment and medium
CN114172897B (en) * 2021-12-09 2023-08-25 西安邮电大学 Method and system for transmitting files of PC (personal computer) end and Android end

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101589592A (en) * 2006-02-27 2009-11-25 微软公司 Multi-protocol removable storage device
CN105205100A (en) * 2015-08-24 2015-12-30 青岛海信移动通信技术股份有限公司 Data synchronization method based on MTP between terminals and terminals
CN105975353A (en) * 2016-04-29 2016-09-28 乐视控股(北京)有限公司 Electronic device and method for copying data from the other directly connected electronic device
CN107247735A (en) * 2017-05-08 2017-10-13 北京小米移动软件有限公司 Document transmission method and device
CN107391425A (en) * 2017-08-30 2017-11-24 四川长虹电器股份有限公司 A kind of Android device
CN107562372A (en) * 2017-08-01 2018-01-09 广东欧珀移动通信有限公司 A kind of electronic equipment and its data managing method, computer-readable recording medium
CN107872482A (en) * 2016-09-27 2018-04-03 中兴通讯股份有限公司 The method and device of transmitting file on a kind of mobile terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8849730B2 (en) * 2011-12-15 2014-09-30 Microsoft Corporation Prediction of user response actions to received data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101589592A (en) * 2006-02-27 2009-11-25 微软公司 Multi-protocol removable storage device
CN105205100A (en) * 2015-08-24 2015-12-30 青岛海信移动通信技术股份有限公司 Data synchronization method based on MTP between terminals and terminals
CN105975353A (en) * 2016-04-29 2016-09-28 乐视控股(北京)有限公司 Electronic device and method for copying data from the other directly connected electronic device
CN107872482A (en) * 2016-09-27 2018-04-03 中兴通讯股份有限公司 The method and device of transmitting file on a kind of mobile terminal
CN107247735A (en) * 2017-05-08 2017-10-13 北京小米移动软件有限公司 Document transmission method and device
CN107562372A (en) * 2017-08-01 2018-01-09 广东欧珀移动通信有限公司 A kind of electronic equipment and its data managing method, computer-readable recording medium
CN107391425A (en) * 2017-08-30 2017-11-24 四川长虹电器股份有限公司 A kind of Android device

Also Published As

Publication number Publication date
CN109271266A (en) 2019-01-25

Similar Documents

Publication Publication Date Title
CN108900770B (en) Method and device for controlling rotation of camera, smart watch and mobile terminal
CN108038112B (en) File processing method, mobile terminal and computer readable storage medium
CN108427649B (en) Access management method, terminal device, system and storage medium of USB interface
CN110225104B (en) Data acquisition method and device and terminal equipment
US20160224207A1 (en) Method and system for freezing and unfreezing applications
EP3493059A1 (en) Application data migration method and device
CN110286768B (en) Virtual object display method, terminal device and computer-readable storage medium
CN110244963B (en) Data updating method and device and terminal equipment
US9335862B1 (en) Virtual multi-device navigation in surface computing system
EP2888661B1 (en) Re-use of binaries for multiple user accounts
CN109271266B (en) File transmission method and device and terminal equipment
CN109298956B (en) File transmission method and device and terminal equipment
EP3832460A1 (en) Method and apparatus for displaying application program, and terminal device
CN106775835B (en) Method, server and terminal for acquiring upgrade file
CN109104481B (en) File integrity detection method, file integrity detection device and terminal equipment
CN111756618B (en) Group chat processing method and device, electronic equipment and readable storage medium
CN105279164B (en) File processing method and device based on IOS (input/output system)
CN107368735B (en) Application installation method, mobile terminal and computer readable storage medium
CN110874729B (en) Switching method and switching device for electronic red packet identification strategy and mobile terminal
CN108536512B (en) Interface switching method and device and terminal equipment
CN110245016B (en) Data processing method, system, device and terminal equipment
CN108509111B (en) Application notification method and device and terminal equipment
CN107609119B (en) File processing method, mobile terminal and computer readable storage medium
CN108632366B (en) File downloading method and device and terminal equipment
CN110874730B (en) Information processing method, information processing device and mobile terminal

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